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★ 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
- Inspect the project: existing
.ink/.yarn/.yarnprojectfiles, an installed integration (ink-unity-integration, inkjs, Yarn Spinner for Unity or Godot), or a JSON graph. Keep what exists. - 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.
- 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.
- Keep variables outside the UI in one store the dialogue reads and writes, so cutscenes, tests and saves see the same state.
- Author line IDs from day one; display text comes from a per-locale string table.
- Apply costs on the transition (the choice), not on a node the player can revisit.
- Validate before handing back:
- Ink:
inklecate -o story.json story.inkexits 1 on compile errors. - Yarn:
ysc compile story.yarnexits 1 on errors (warnings, such as an undeclared variable, still exit 0).ysc run --auto-advance --start-node GuardIntro story.yarnplays it and reads each choice from stdin (with no input it waits forever); without--start-nodeit looks for a node titledStartand exits 0 if there is none, sorunis not a CI gate (see Version notes foryscversions). - Custom graph: run
validate_graph()fromreferences/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.
- Ink:
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
Установить dialogue-systems в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic