interactive-fiction
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInteractive Fiction
互动小说
Overview
概述
Plan, draft, and revise a branching book: a story project whose chapters
are passages joined by in their frontmatter. The chapters and
their choices are the source of truth. follows the paths
of choices, and or turns the
project into a playable Twine or ink story.
choicesstory continuitystory build --format twee--format inkThis skill owns books written to branch from the start. Turning an existing
linear book into an interactive edition (a branch map drawn from its scenes,
then a copied project) belongs to the skill; once that edition
project exists, draft and revise its chapters here.
adaptation规划、起草并修订分支故事书:一种故事项目,其中各章节都是段落,并通过其 frontmatter 中的 相互连接。章节及其 是唯一的事实来源。 沿 choices 的路径进行跟踪, 或 则将项目转换为可玩的 Twine 或 ink 故事。
choiceschoicesstory continuitystory build --format twee--format ink本 skill 专门处理从创作之初就设计为分支结构的书。将现有线性书转换为互动版(先根据其场景绘制分支图,再复制生成项目)属于 skill 的职责;该互动版项目建立后,可在此起草和修订其章节。
adaptationPrerequisites
前置条件
A story project with in the root. For a new book, start it with
the skill first. Read (, , ,
, , ) and , then the of
every chapter: together they are the graph. A small example is
, a
branch-and-bottleneck story with two endings.
story.mdstory-initstory.mdlanguagepovtenseformstatusifidchapters/_index.mdchoicesexamples/the-gull-rock-light需要准备一个根目录中包含 的故事项目。对于新书,应先使用 skill 创建。读取 (、、、、、)和 ,然后读取每个章节的 ;它们共同构成整个图。一个小型示例是 ,这是一个包含两个结局的分支—瓶颈型故事。
story.mdstory-initstory.mdlanguagepovtenseformstatusifidchapters/_index.mdchoicesexamples/the-gull-rock-lightWhen to Use
使用场景
- Planning a choice graph: structure, branch points, rejoins, endings
- Writing or changing entries
choices - Drafting a chapter on a branch, at a rejoin, or at an ending
- Revising a branching book, and reading ,
state-differs-by-path, and the other branching findingsunreachable-chapter - Building the book as Twine or ink
- NOT for converting a linear book (use ), drafting a linear chapter (use
adaptation), or a linear continuity audit (usechapter-writing). Prose craft inside a passage still comes fromrevision-continuityandscene-craftline-editing
- 规划选择图:结构、分支点、汇合点、结局
- 编写或修改 条目
choices - 起草位于分支、汇合点或结局的章节
- 修订分支故事书,并读取 、
state-differs-by-path及其他分支检查结果unreachable-chapter - 将故事构建为 Twine 或 ink
- 不适用于转换线性书(使用 )、起草线性章节(使用
adaptation)或执行线性连续性审计(使用chapter-writing)。passage 内部的行文创作仍应采用revision-continuity和scene-craftline-editing
How The Graph Works
图的工作方式
-
Each chapter is one passage. Itsare where the reader can go:
choicesyamlchoices: - text: Search the rocks for Tobias to: chapter-02 - text: Climb the tower to the lamp to: chapter-03 -
The lowest-numbered chapter is the start.
-
Once any chapter has, the links are exactly the choices: a chapter with none is an ending, and a chapter that leads on to one place needs a single choice (
choices). With no choices anywhere the book is linear again.text: Continue -
becomes the link text: no
text,[,],|,->, or line break, and no final<-. Quote it if it looks like a number.< -
is a chapter id. It may be the chapter itself (a loop) or, while planning, a
towith no file yet; the builds need every target written.chapter-NN
-
每个章节()都是一个段落(
chapter)。其passage表示读者可以前往的位置:choicesyamlchoices: - text: Search the rocks for Tobias to: chapter-02 - text: Climb the tower to the lamp to: chapter-03 -
编号最小的章节是起点。
-
一旦任何章节包含,链接关系就完全由这些 choices 构成:没有 choices 的章节是结局;需要继续前往下一处的章节必须只有一个 choice(
choices)。如果整个故事中都没有任何 choices,它就会重新变成线性结构。text: Continue -
会成为链接文本:其中不得包含
text、[、]、|、->或换行,也不得以<-结尾。如果它看起来像数字,请使用引号。< -
是 chapter id。它可以指向章节自身(形成循环),也可以在规划阶段指向尚无文件的
to;构建时所有目标都必须已经写好。chapter-NN
Workflow
工作流
1. Plan The Choice Graph
1. 规划选择图
Agree the shape with the user before drafting; see
for the structures, choice design, and
numbering. Then:
references/choice-graph.md-
Draw the graph: every passage, every choice, every rejoin, every ending. Count passages and endings againstand the
target-words.form -
Number chapters so each choice leads to a higher number, except a loop back. The promise, question, and clue ledgers, the clock and route checks,, and the
story pacingandstory diagramlifelines still read chapter numbers, so this keeps them close to the paths.story series -
Scaffold each passage as an outline chapter with its POV and cast, then add itsby hand (
choicesdoes not write them):story addshellstory add chapter 'The Landing' --number 1 --status outline --pov ada-fenn --character ada-fenn --hook decision --path . -
Check the skeleton before writing prose.warns
story links .for every chapter no path from the start reaches, and errors on a choice to a missing chapter, except aunreachable-chapterwith no file yet, which it allows as scheduled. So a typo such aschapter-NNforchapter-09passes: compare everychapter-08with the planned passage list by hand, and once every passage has a file, runto, which refuses any choice to a missing chapter.story build . --format twee -
Record the state choices set that the CLI does not track (flags, trust, items the reader can carry down one branch) in, a working file the CLI ignores: a table of each flag, the chapter that sets it, and the chapters that read it.
notes/branch-map.md
起草前应先与用户确认图形结构。有关结构、choice 设计和编号方式,请参阅 。然后:
references/choice-graph.md-
绘制整张图:每个 passage、每个 choice、每个汇合点和每个结局。结合和
target-words核对段落数与结局数。form -
为章节编号,使每个 choice 都通向编号更大的章节,只有循环会返回之前的章节。承诺、问题和线索台账、时钟与路线检查、,以及
story pacing和story diagram的生命线仍会读取章节编号,因此这种方式可以让它们与路径保持紧密对应。story series -
先将每个 passage 搭建成包含 POV 和角色阵容的大纲章节,再手动添加其(
choices不会写入这些 choices):story addshellstory add chapter 'The Landing' --number 1 --status outline --pov ada-fenn --character ada-fenn --hook decision --path . -
在编写正文前检查骨架。会对每个无法从起点到达的 chapter 发出
story links .警告,并对指向缺失章节的 choice 报错;但尚无文件的unreachable-chapter会被视为已排期的目标,因此允许通过。因此,本应指向chapter-NN却误写为chapter-08之类的错误会暂时通过检查:请手动将每个chapter-09与计划中的 passage 列表进行比对;待所有 passage 都有文件后,运行to,该命令会拒绝任何指向缺失章节的 choice。story build . --format twee -
在中记录 CLI 不会跟踪、由 choices 设置的状态(flags、信任状态、读者可沿某个分支携带的物品)。这是一个 CLI 会忽略的工作文件:用表格记录每个 flag、设置它的章节以及读取它的章节。
notes/branch-map.md
2. Draft A Passage
2. 起草段落
Draft with the workflow (outline, approval, prose,
post-write updates), with these differences:
chapter-writing- Run for every passage. In a branching book it holds only what was drafted and learned on a path to that chapter, so a sibling branch never leaks in.
story context chapter-NN --path . - On a branch: the passage may use everything on the paths that lead to it, and nothing from its sibling.
- At a rejoin: the context lists the scenes of every branch that leads there. Read each incoming chapter and write only what is true on every path: who is where, who is hurt, what the reader has seen. Facts are marked known when any incoming path teaches them, so check each fact the rejoin uses against every branch. A detail that differs by path stays out of the rejoin prose, or is carried by a flag in the built Twine or ink file (see Build).
- At a branch point: end on the decision () and make each choice meaningful, informed, and acknowledged in the passage it leads to.
hook: decision - At an ending: no ,
choices, and an ending that pays off the path that reached it. Name it as an ending in the prose if the book's style does (hook: resolution).THE END.
After saving the passage, record continuity as does,
following for the branching rules:
deaths and revivals, one entry per branch for a fact
learned on two branches, and the snapshot.
chapter-writingreferences/path-continuity.mdknowledge-statecontinuity/state.md使用 工作流进行起草(大纲、审批、正文、写入后更新),但需遵循以下差异:
chapter-writing- 对每个 passage 运行 。在分支故事书中,它只包含沿通往该章节的路径已起草和已获知的内容,因此兄弟分支的信息不会泄漏进来。
story context chapter-NN --path . - **位于分支上时:**段落可以使用通往它的所有路径上的信息,但不得使用其兄弟分支的任何信息。
- **位于汇合点时:**上下文会列出每条通往该处的分支上的场景。读取每个入站章节,并且只写入在所有路径上都成立的内容:谁在哪里、谁受了伤、读者见过什么。任一入站路径教会某项事实后,它就会被标记为 known(已知),因此必须将汇合点使用的每个事实与所有分支逐一核对。路径不同而存在差异的细节不应写入汇合点正文,或者可通过构建后的 Twine 或 ink 文件中的 flag 承载(见“构建”)。
- **位于分支点时:**在决定处结束(),并确保每个 choice 都有明确意义、能让读者获得充分依据,并在其通往的段落中得到回应。
hook: decision - **位于结局时:**不得设置 ,应使用
choices,并让结局兑现抵达该处的路径铺垫。如果故事风格需要,应在正文中明确标示结局(hook: resolution)。THE END.
保存段落后,应按照 的方式记录连续性信息,并遵循 中的分支规则:记录死亡与复活;对于在两个分支中各自学到的事实,每个分支各记录一条 条目;并维护 快照。
chapter-writingreferences/path-continuity.mdknowledge-statecontinuity/state.md3. Revise A Branching Book
3. 修订分支故事书
Use for the passes, plus these checks:
revision-continuity- Reachability: fix every by adding a choice that leads there, from a passage the user agrees (see Hard Rules). Removing the chapter deletes its file and its drafted prose, so offer it only as an option, and put the whole removal to the user for one approval:
unreachable-chapter- Take a snapshot (see Draft Snapshots in the skill).
revision-continuity - refuses while scene files point at the chapter, so dry-run each of its scenes:
remove chapter.story remove scene <scene-id> --path . --dry-run - Dry-run the chapter: . While the chapter still has scenes, this prints only that refusal. It also refuses while a
story remove chapter <id> --path . --dry-run,died-in, orsincefield, or a progression'slearned-in, names the chapter, so search the project for the chapter id and list those references too: each needs another chapter before the removal can run.from - Show the user every file the dry runs would update and delete, and every reference that blocks the removal. Only with their explicit approval, repoint the blocking references, remove the scenes, then remove the chapter. It drops the choices that led to the chapter and warns which chapters became endings.
- If the chapter removal is still refused after the scenes are gone,
stop and ask the user: go on with the next fix, or restore the
snapshot (first, as the
story snapshot --restore <name> --path . --dry-runskill describes).revision-continuity
- Take a snapshot (see Draft Snapshots in the
- Endings: list the chapters with no . Each should be a deliberate ending. A chapter that lost its last choice in a revision is an accidental ending: give it a choice.
choices - Loops: the CLI does not check that a loop has a way out. Trace every loop and confirm a choice leaves it.
- Path continuity: run and read the branching findings in
story continuity .. Then do the hand checks there for what the checker reads by chapter number. Branching books inreferences/path-continuity.mdsays which../story-maintenance/references/continuity-checks.md,continuity,knowledge,context, andtimelineresults follow the paths and which go by chapter number.grid - Renumbering: ,
story move chapter, andstory splitrewrite everystory mergethat named an old id. Split and merge work here only on chapters with noto, and merge only when no choice leads to the second chapter; restructure anything else by hand. A split gives its first half achoiceschoice that leads to the rest, so offer the user other words for it. None of them edits prose, so reread the passages for chapter numbers in the text.Continue - Rejoin prose: after changing a branch, reread every rejoin it leads to and confirm the prose still holds on that path.
使用 完成各轮修订,同时进行以下检查:
revision-continuity- **可达性:**通过从用户认可的 passage(见“硬性规则”)添加一个通向目标章节的 choice,修复每个 。删除 chapter 会同时删除其文件和已起草的正文,因此只能将其作为一个备选方案提出,并将整个删除操作一次性提交给用户审批:
unreachable-chapter- 创建快照(参见 skill 中的“草稿快照”)。
revision-continuity - 在场景文件仍指向该章节时会拒绝执行,因此应对每个相关场景运行
remove chapter。story remove scene <scene-id> --path . --dry-run - 对章节运行 。当章节仍有场景时,它只会输出这一拒绝信息。如果某个
story remove chapter <id> --path . --dry-run、died-in或since字段,或者某个 progression 的learned-in指向该章节,它也会拒绝执行,因此应搜索项目中的 chapter id,并同时列出这些引用:每个引用都必须先改指向另一个 chapter,删除操作才能继续。from - 向用户展示所有 dry run 将更新或删除的文件,以及所有阻止删除的引用。只有在用户明确批准后,才可重新指向这些阻塞引用、删除场景,最后删除章节。该操作会移除原本通向该章节的 choices,并警告哪些章节因此变成了结局。
- 如果删除场景后章节仍被拒绝执行,请停止并询问用户:是继续处理下一个问题,还是恢复快照(先按照 skill 的说明运行
revision-continuity)。story snapshot --restore <name> --path . --dry-run
- 创建快照(参见
- **结局:**列出所有没有 的章节。它们每一个都应是有意设计的结局。如果某个章节在修订中失去了最后一个 choice,它就是意外结局:应为它添加一个 choice。
choices - **循环:**CLI 不会检查循环是否存在出口。追踪每个循环,并确认其中有一个 choice 能够离开循环。
- **路径连续性:**运行 ,并阅读
story continuity .中的分支检查结果。随后按照该引用中的说明,执行针对检查器仍按章节编号读取内容的手工检查。references/path-continuity.md中的“分支故事书”一节说明了哪些../story-maintenance/references/continuity-checks.md、continuity、knowledge、context和timeline结果按路径追踪,哪些仍按章节编号处理。grid - 重新编号:、
story move chapter和story split会重写所有曾指向旧 id 的story merge。在这里,to和split仅适用于没有merge的章节;choices还要求没有 choice 通向第二个章节,其他结构必须手动重组。拆分后的前半部分会获得一个通往后半部分的mergechoice,因此应为用户提供其他措辞。这些操作都不会编辑正文,因此应重新阅读各 passage,检查正文中出现的章节编号。Continue - **汇合点正文:**更改某个分支后,应重新阅读它通向的每个汇合点,确认正文在该路径上仍然成立。
4. Build
4. 构建
shell
story build . --format twee
story build . --format inkBoth write to and refuse to build while a choice is malformed or
leads to a missing chapter. Without in , they derive the
IFID from the story id and warn with the line to add; add it before
sharing the story, so a retitle keeps the same IFID.
dist/ifid:story.mdThe ink build escapes ink syntax in the prose, so flags and conditional
text (, , ) never go in chapters. Once the graph is settled,
build a working copy with
and write that logic into it by hand. never replaces an existing
file, so a rebuild after changing means deleting the old copy and
carrying the hand-written logic into the new one: ask the author before
deleting a file that has hand-written logic in it. Ink and Twine syntax for
that layer is in the skill's
.
VAR~{ }--out adaptations/interactive/{story-id}.ink--outchoicesadaptationreferences/interactive-fiction.mdshell
story build . --format twee
story build . --format ink两种构建都会写入 ,并在 choice 格式错误或指向缺失章节时拒绝构建。如果 中没有 ,它们会根据 story id 推导 IFID,并警告需要添加哪一行;应在分享故事前添加它,这样更改标题后仍能保留相同的 IFID。
dist/story.mdifid:ink 构建会转义正文中的 ink 语法,因此 flags 和条件文本(、、)绝不能写进章节。整张图确定后,使用 构建一个工作副本,并手动将相关逻辑写入其中。 绝不会覆盖现有文件,因此更改 后重新构建时,需要删除旧副本并把手写逻辑迁移到新副本中;删除包含手写逻辑的文件前,必须先征得作者同意。该逻辑层的 Ink 和 Twine 语法见 skill 的 。
VAR~{ }--out adaptations/interactive/{story-id}.ink--outchoicesadaptationreferences/interactive-fiction.mdMaintenance
维护
After adding, removing, renumbering, or rewriting chapters or their
, run:
choicesshell
story reindex .
story wordcount . --write
story check .Repair every error. Treat and
as findings to resolve or record. suggests drafting the next
chapter number, as for a linear book: plan from the graph instead.
unreachable-chapterstate-differs-by-pathstory next .If is not installed, use the bundled fallback
with the same arguments. Use
instead only when the user names a Story
Skills repository checkout or you are working in one. Write the script as an
absolute path (resolve the fallback relative to this skill folder) and run
it from the folder you would run from, so and other relative
paths keep their meaning. Use Node, not Bun or a package script: Bun would
load that folder's (which can run code) and , and a
package script runs from the checkout's root.
storynode ../story-maintenance/scripts/story.jsnode <checkout>/bin/story.jsstory.bunfig.toml.env添加、删除、重新编号或重写章节及其 后,运行:
choicesshell
story reindex .
story wordcount . --write
story check .修复每一个错误。将 和 视为需要解决或记录的问题。 会建议下一个要起草的章节编号,与线性书相同:此时应从图出发进行规划。
unreachable-chapterstate-differs-by-pathstory next .如果未安装 ,可使用参数相同的内置回退脚本 。只有在用户指定了 Story Skills 仓库检出目录,或你正在该目录中工作时,才改用 。将脚本路径写成绝对路径(相对于此 skill 文件夹解析回退脚本路径),并从原本会运行 的文件夹执行它,以保持 和其他相对路径的含义。使用 Node,不要使用 Bun 或 package script:Bun 会加载该文件夹中的 (其中可以运行代码)和 ,而 package script 会从检出目录的根目录运行。
storynode ../story-maintenance/scripts/story.jsnode <checkout>/bin/story.jsstory.bunfig.toml.envHard Rules
硬性规则
- Never invent a branch, ending, or choice the user has not agreed; offer options instead.
- Never remove a chapter or scene without the user's explicit approval,
given after a snapshot and a that lists what it deletes.
--dry-run - Never write rejoin prose that is true on only one incoming path.
- Never silence with an
state-differs-by-pathentry the rejoin chapter's prose does not make true.object-state - Never put ink logic in chapter prose; keep it in the built copy under
. Write Twine macros in chapters only once the author has picked a story format (Harlowe, SugarCube, Chapbook).
adaptations/interactive/
- 绝不擅自创建用户未同意的 branch、ending 或 choice;应改为提供选项。
- 未经用户明确批准,绝不删除任何 chapter 或 scene;批准必须发生在创建快照并运行列出待删除内容的 之后。
--dry-run - 绝不在仅有一条入站路径成立的 rejoin 中编写正文。
- 绝不能使用 rejoin 章节正文中并未成立的事实,通过 条目消除
object-state问题。state-differs-by-path - 绝不能将 ink 逻辑写入章节正文;应将其保留在 下的构建副本中。只有在作者选定故事格式(Harlowe、SugarCube、Chapbook)后,才可在章节中编写 Twine macros。
adaptations/interactive/
Reference Files
参考文件
- - Branching structures, designing choices, numbering, rejoins, endings, and scope
references/choice-graph.md - - What
references/path-continuity.mdfollows by path and what it still reads by number, the branching findings and their fixes, and the hand checkliststory continuity
- ——分支结构、choice 设计、编号、汇合点、结局与范围
references/choice-graph.md - ——
references/path-continuity.md按路径跟踪和仍按编号读取的内容、分支检查结果及其修复方式,以及手工检查清单story continuity
Shared Conventions
共享约定
Every story skill follows the shared conventions in , resolved relative to this skill folder. Read it before creating, renaming, or linking story files. If that file is missing because this skill was installed without , the essentials are: kebab-case ids and filenames, YAML frontmatter on every story-project file, registry tables that rebuilds (never edit them by hand), bidirectional links between entities, for who is on the page and for who is only referred to, plus for deaths, and no project-local generator or build scripts (run only the installed or bundled Story CLI).
../story-maintenance/references/conventions.mdstory-maintenance_index.mdstory reindexcharactersmentionsstatus: deceaseddied-in: chapter-{NN}每个 story skill 都遵循 中的共享约定,该路径相对于此 skill 文件夹解析。在创建、重命名或链接故事文件前,应先阅读该文件。如果此 skill 是在未同时安装 的情况下安装的,导致该文件缺失,则应遵循以下核心要求:id 和文件名使用 kebab-case;每个故事项目文件都包含 YAML frontmatter; 注册表由 重建(绝不能手动编辑);实体之间使用双向链接;使用 表示实际在场的角色,使用 表示仅被提及的角色;角色死亡时使用 和 ;不得使用项目本地的生成器或构建脚本(只能运行已安装或内置的 Story CLI)。
../story-maintenance/references/conventions.mdstory-maintenance_index.mdstory reindexcharactersmentionsstatus: deceaseddied-in: chapter-{NN}