Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

dialogue-systems

БесплатноБез исполняемых скриптовНе проверен

Builds engine-neutral branching dialogue with Ink, Yarn Spinner or a small JSON graph runner: lines, choices, conditions, variables and localization IDs. Use…

gamedev-skillsот gamedev-skills★ 12 656 звёзд на GitHub

Об этом скилле

Dialogue systems

Model conversations as a graph: nodes hold lines, choices branch, conditions gate options and a variable store remembers what the player did. The first decision is build or adopt: Ink or Yarn Spinner when writers need real flow control, a small data-driven runner when lines, choices and flags are enough. Never build a new scripting language.

When to use

  • Designing branching conversations, choice menus or narrative state that later lines read.
  • Choosing between Ink, Yarn Spinner and a custom JSON/resource graph.
  • Wiring a dialogue runtime into the game loop: advance, show choices, run commands, persist.

Not this skill: VN presentation and flow (visual-novel), quest logic (rpg), widget code (godot-ui-control, roblox-ui) and UI layout rules (game-ui-ux), persisting variables across sessions (save-systems).

Core workflow

  1. Inspect the project: existing .ink/.yarn/.yarnproject files, an installed integration (ink-unity-integration, inkjs, Yarn Spinner for Unity or Godot), or a JSON graph. Keep what exists.
  2. Choose the tool.
    • Ink: prose-first, weave and gather flow, read counts as free flags; best for dialogue-heavy or choose-your-own-adventure narrative.
    • Yarn Spinner: node-based, explicit <<commands>> dispatched to game code, built-in line IDs for localization; best for game-driven dialogue with many engine hooks.
    • Custom runner: a JSON graph plus about 100 lines of interpreter, when you need full control or no dependency.
  3. Define the node contract: a node yields a line (speaker plus line ID), a choice set, a command, or an end/jump. The runner hands lines and choices to the UI and waits.
  4. Keep variables outside the UI in one store the dialogue reads and writes, so cutscenes, tests and saves see the same state.
  5. Author line IDs from day one; display text comes from a per-locale string table.
  6. Apply costs on the transition (the choice), not on a node the player can revisit.
  7. Validate before handing back:
    • Ink: inklecate -o story.json story.ink exits 1 on compile errors.
    • Yarn: ysc compile story.yarn exits 1 on errors (warnings, such as an undeclared variable, still exit 0). ysc run --auto-advance --start-node GuardIntro story.yarn plays it and reads each choice from stdin (with no input it waits forever); without --start-node it looks for a node titled Start and exits 0 if there is none, so run is not a CI gate (see Version notes for ysc versions).
    • Custom graph: run validate_graph() from references/runner.md; it must return no problems (missing targets, nodes without an exit, undeclared variables, unreachable nodes).
    • Then walk each choice path once with a script that picks choices in order.

Patterns

1. Engine-neutral dialogue graph (data, not code)

{
  "start": "guard_intro",
  "vars": { "gold": 0, "gate_open": false },
  "nodes": {
    "guard_intro": {
      "speaker": "Guard", "line": "DLG_GUARD_001",
      "choices": [
        { "text": "DLG_OPT_BRIBE", "to": "bribe", "if": "gold >= 50",
          "set": { "gold": "gold - 50" } },
        { "text": "DLG_OPT_LEAVE", "to": "end" }
      ]
    },
    "bribe": {
      "speaker": "Guard", "line": "DLG_GUARD_BRIBED",
      "set": { "gate_open": true },
      "next": "end"
    },
    "end": { "end": true }
  }
}

line/text are string-table IDs (localization), not literal text. if gates a choice; set mutates the variable store. The gold cost sits on the choice, so it is paid once per pick even if the bribe node is revisited; the idempotent gate_open write can live on the node. A string set value is an expression, so a literal string needs inner quotes: "mood": "'angry'". The full interpreter that walks this graph is in references/runner.md. Its variable store starts from vars; replace those defaults with the player's saved narrative state when starting a real conversation. Declare every referenced variable so unknown names still expose authoring mistakes.

2. Runner step (a state machine over the graph)

# Godot 4.7. The runner holds the current node and a variable store. Every line
# waits for the player: the UI calls choose() or the continue callback.
func goto(id: String) -> void:
    current = graph.nodes[id]
    apply_set(current.get("set", {}))
    if current.get("end", false):
        ui.close()
        return
    if current.has("line"):
        ui.show_line(current.get("speaker", ""), localize(current.line))
    if current.has("choices"):
        var shown = current.choices.filter(func(c): return eval_cond(c.get("if", "")))
        ui.show_choices(shown)            # only choices whose condition passes
    elif current.has("next"):
        var next_id: String = current.next
        ui.show_continue(func(): goto(next_id))   # advance when the player continues

func choose(choice: Dictionary
Полный SKILL.md на GitHub

Установить dialogue-systems в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/ink-and-yarn.mdreferences/runner.md

FAQ

Что делает скилл dialogue-systems?

Builds engine-neutral branching dialogue with Ink, Yarn Spinner or a small JSON graph runner: lines, choices, conditions, variables and localization IDs. Use for NPC conversations, dialogue trees, barks, .ink or .yarn files, or dialogue that dead-ends. Not for visual-novel backlog and skip (`visual-novel`), quests (`rpg`) or text box widgets (`godot-ui-control`, `game-ui-ux`).

Как установить скилл dialogue-systems?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл dialogue-systems запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить dialogue-systems с