Agent skill

Interactive Fiction

by danjdewhurst in danjdewhurst/story-skills

This skill should be used when the user asks to "write a branching story", "interactive fiction", "choose your own adventure", "plan the branches", "choice graph", "add a choice", "gamebook"…

MITAuto-check: notesWriting & Content

Install Interactive Fiction

skills CLI
$ npx skills add danjdewhurst/story-skills --skill interactive-fiction -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install danjdewhurst/story-skills interactive-fiction --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/danjdewhurst/story-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/interactive-fiction .claude/skills/interactive-fiction && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
interactive-fiction
GitHub stars
279
Used in
1 other repo
Token cost
~3.3k tokens
SKILL.md length
1,814 words
Files
3 (incl. references)
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

This skill should be used when the user asks to "write a branching story", "interactive fiction", "choose your own adventure", "plan the branches", "choice graph", "add a choice", "gamebook"…

  • Works in 4 steps: Plan The Choice Graph → Draft A Passage → Revise A Branching Book → …
  • Asks to write a branching story
  • SKILL.md covers Overview, Prerequisites, When to Use and How The Graph Works, plus 5 more sections
  • Calls node

What it does

Interactive Fiction is an agent skill from danjdewhurst/story-skills. This skill should be used when the user asks to "write a branching story", "interactive fiction", "choose your own adventure", "plan the branches", "choice graph", "add a choice", "gamebook", "Twine", "Ink", "draft a branch", "where the branches rejoin", "add an ending", "unreachable chapter", "path continuity", "state-differs-by-path", or wants to plan, draft, or revise a story project whose chapters carry choices. NOT for turning a finished linear book into an interactive edition in Ink or Twine (use adaptation).

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/choice-graph.md` and `references/path-continuity.md`).

It sits in Writing & Content, covering Creative writing and fiction. The repository describes itself as: Agent Skills for end-to-end story writing in markdown, packaged as Codex and Claude Code plugins. The licence is MIT.

When your agent uses it

  • Asks to write a branching story
  • Interactive fiction
  • Choose your own adventure
  • Plan the branches

Example prompts

  • “write a branching story”
  • “interactive fiction”
  • “choose your own adventure”
  • “/interactive-fiction”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Plan The Choice Graph
  2. Draft A Passage
  3. Revise A Branching Book
  4. Build

What it can do on your machine

Read from SKILL.md and the folder at commit 1df23f9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Interactive Fiction loads about 3.3k tokens when it runs, and up to ~5.9k if it reads all its reference files. Until then it costs about 136 tokens; SKILL.md has 1,814 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~136
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:223
    `bunfig.toml` (which can run code) and `.env`, and a

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from danjdewhurst/story-skills at commit 1df23f9, republished under its MIT licence (© danjdewhurst). 1,814 words, ~3,260 tokens.

Download SKILL.mdSave it as .claude/skills/interactive-fiction/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
interactive-fiction
description
This skill should be used when the user asks to "write a branching story", "interactive fiction", "choose your own adventure", "plan the branches", "choice graph", "add a choice", "gamebook", "Twine", "Ink", "draft a branch", "where the branches rejoin", "add an ending", "unreachable chapter", "path continuity", "state-differs-by-path", or wants to plan, draft, or revise a story project whose chapters carry `choices`. NOT for turning a finished linear book into an interactive edition in Ink or Twine (use adaptation).

Interactive Fiction

Overview

Plan, draft, and revise a branching book: a story project whose chapters are passages joined by choices in their frontmatter. The chapters and their choices are the source of truth. story continuity follows the paths of choices, and story build --format twee or --format ink turns the project into a playable Twine or ink story.

This 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 adaptation skill; once that edition project exists, draft and revise its chapters here.

Prerequisites

A story project with story.md in the root. For a new book, start it with the story-init skill first. Read story.md (language, pov, tense, form, status, ifid) and chapters/_index.md, then the choices of every chapter: together they are the graph. A small example is examples/the-gull-rock-light, a branch-and-bottleneck story with two endings.

When to Use

  • Planning a choice graph: structure, branch points, rejoins, endings
  • Writing or changing choices entries
  • Drafting a chapter on a branch, at a rejoin, or at an ending
  • Revising a branching book, and reading state-differs-by-path, unreachable-chapter, and the other branching findings
  • Building the book as Twine or ink
  • NOT for converting a linear book (use adaptation), drafting a linear chapter (use chapter-writing), or a linear continuity audit (use revision-continuity). Prose craft inside a passage still comes from scene-craft and line-editing

How The Graph Works

  • Each chapter is one passage. Its choices are where the reader can go:

    yaml
    choices:
      - 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 choices, 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 (text: Continue). With no choices anywhere the book is linear again.

  • text becomes the link text: no [, ], |, ->, <-, or line break, and no final <. Quote it if it looks like a number.

  • to is a chapter id. It may be the chapter itself (a loop) or, while planning, a chapter-NN with no file yet; the builds need every target written.

Workflow

1. Plan The Choice Graph

Agree the shape with the user before drafting; see references/choice-graph.md for the structures, choice design, and numbering. Then:

  1. Draw the graph: every passage, every choice, every rejoin, every ending. Count passages and endings against target-words and the form.

  2. 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, story pacing, and the story diagram and story series lifelines still read chapter numbers, so this keeps them close to the paths.

  3. Scaffold each passage as an outline chapter with its POV and cast, then add its choices by hand (story add does not write them):

    shell
    story add chapter 'The Landing' --number 1 --status outline --pov ada-fenn --character ada-fenn --hook decision --path .
  4. Check the skeleton before writing prose. story links . warns unreachable-chapter for every chapter no path from the start reaches, and errors on a choice to a missing chapter, except a chapter-NN with no file yet, which it allows as scheduled. So a typo such as chapter-09 for chapter-08 passes: compare every to with the planned passage list by hand, and once every passage has a file, run story build . --format twee, which refuses any choice to a missing chapter.

  5. Record the state choices set that the CLI does not track (flags, trust, items the reader can carry down one branch) in notes/branch-map.md, a working file the CLI ignores: a table of each flag, the chapter that sets it, and the chapters that read it.

2. Draft A Passage

Draft with the chapter-writing workflow (outline, approval, prose, post-write updates), with these differences:

  • Run story context chapter-NN --path . 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.
  • 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 (hook: decision) and make each choice meaningful, informed, and acknowledged in the passage it leads to.
  • At an ending: no choices, hook: resolution, 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 (THE END.).

After saving the passage, record continuity as chapter-writing does, following references/path-continuity.md for the branching rules: deaths and revivals, one knowledge-state entry per branch for a fact learned on two branches, and the continuity/state.md snapshot.

3. Revise A Branching Book

Use revision-continuity for the passes, plus these checks:

  • Reachability: fix every unreachable-chapter 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:
    1. Take a snapshot (see Draft Snapshots in the revision-continuity skill).
    2. remove chapter refuses while scene files point at the chapter, so dry-run each of its scenes: story remove scene <scene-id> --path . --dry-run.
    3. Dry-run the chapter: story remove chapter <id> --path . --dry-run. While the chapter still has scenes, this prints only that refusal. It also refuses while a died-in, since, or learned-in field, or a progression's from, 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.
    4. 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.
    5. 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 (story snapshot --restore <name> --path . --dry-run first, as the revision-continuity skill describes).
  • Endings: list the chapters with no choices. Each should be a deliberate ending. A chapter that lost its last choice in a revision is an accidental ending: give it a choice.
  • 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 story continuity . and read the branching findings in references/path-continuity.md. Then do the hand checks there for what the checker reads by chapter number. Branching books in ../story-maintenance/references/continuity-checks.md says which continuity, knowledge, context, timeline, and grid results follow the paths and which go by chapter number.
  • Renumbering: story move chapter, story split, and story merge rewrite every to that named an old id. Split and merge work here only on chapters with no choices, and merge only when no choice leads to the second chapter; restructure anything else by hand. A split gives its first half a Continue choice 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.
  • Rejoin prose: after changing a branch, reread every rejoin it leads to and confirm the prose still holds on that path.
Show full SKILL.md (524 more words)Show less
4. Build
shell
story build . --format twee
story build . --format ink

Both write to dist/ and refuse to build while a choice is malformed or leads to a missing chapter. Without ifid: in story.md, 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.

The ink build escapes ink syntax in the prose, so flags and conditional text (VAR, ~, { }) never go in chapters. Once the graph is settled, build a working copy with --out adaptations/interactive/{story-id}.ink and write that logic into it by hand. --out never replaces an existing file, so a rebuild after changing choices 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 adaptation skill's references/interactive-fiction.md.

Maintenance

After adding, removing, renumbering, or rewriting chapters or their choices, run:

shell
story reindex .
story wordcount . --write
story check .

Repair every error. Treat unreachable-chapter and state-differs-by-path as findings to resolve or record. story next . suggests drafting the next chapter number, as for a linear book: plan from the graph instead.

If story is not installed, use the bundled fallback node ../story-maintenance/scripts/story.js with the same arguments. Use node <checkout>/bin/story.js 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 story from, so . and other relative paths keep their meaning. Use Node, not Bun or a package script: Bun would load that folder's bunfig.toml (which can run code) and .env, and a package script runs from the checkout's root.

Hard 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 --dry-run that lists what it deletes.
  • Never write rejoin prose that is true on only one incoming path.
  • Never silence state-differs-by-path with an object-state entry the rejoin chapter's prose does not make true.
  • Never put ink logic in chapter prose; keep it in the built copy under adaptations/interactive/. Write Twine macros in chapters only once the author has picked a story format (Harlowe, SugarCube, Chapbook).

Reference Files

  • references/choice-graph.md - Branching structures, designing choices, numbering, rejoins, endings, and scope
  • references/path-continuity.md - What story continuity follows by path and what it still reads by number, the branching findings and their fixes, and the hand checklist

Shared Conventions

Every story skill follows the shared conventions in ../story-maintenance/references/conventions.md, 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 story-maintenance, the essentials are: kebab-case ids and filenames, YAML frontmatter on every story-project file, _index.md registry tables that story reindex rebuilds (never edit them by hand), bidirectional links between entities, characters for who is on the page and mentions for who is only referred to, status: deceased plus died-in: chapter-{NN} for deaths, and no project-local generator or build scripts (run only the installed or bundled Story CLI).

© danjdewhurst, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/interactive-fiction of danjdewhurst/story-skills.

  • SKILL.md
  • references/choice-graph.md
  • references/path-continuity.md

Open the folder on GitHubat commit 1df23f9

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in danjdewhurst/story-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Interactive Fiction next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Interactive Fiction compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Interactive Fiction this skilldanjdewhurst/story-skills2791 repos~3.3kAutomated safety check: NotesMIT
Story Multi-Perspective Reviewzenstory-ai/oh-story-claudecode7.4k3 repos~3kAutomated safety check: PassMIT
Story Toolbox Routerzenstory-ai/oh-story-claudecode7.4k1 repos~1.7kAutomated safety check: PassMIT
Short Web Fiction Trend Scanzenstory-ai/oh-story-claudecode7.4k3 repos~1.2kAutomated safety check: PassMIT
InkOS Creative HarnessNarcooo/inkos10k1 repos~1.1kAutomated safety check: PassAGPL-3.0
Novel Arteternityspring/shuohao-skills4.2k—~1.1kAutomated safety check: NotesApache-2.0

Similar skills

  • Story Multi-Perspective Review

    zenstory-ai/oh-story-claudecode

    Reviews Chinese web-novel text with several reviewer agents in parallel, falling back to a single-agent pass, and reports structure, character, prose and setting problems with fixes.

    7.4k GitHub starsUsed in 3 repos~3k tokens
    Writing & ContentAuto-check passed
  • Story Toolbox Router

    zenstory-ai/oh-story-claudecode

    Routes a Chinese web-novel writing request to the matching tool in a 13-skill toolbox, covers author habit memory, and can launch a local dashboard for browsing a project.

    7.4k GitHub starsUsed in 1 repo~1.7k tokens
    Writing & ContentAuto-check passed
  • Short Web Fiction Trend Scan

    zenstory-ai/oh-story-claudecode

    Scans popular short web-fiction rankings on Chinese platforms such as Dianzhong and Heiyan to surface trending emotional hooks, themes and topic candidates with an expiry warning.

    7.4k GitHub starsUsed in 3 repos~1.2k tokens
    Writing & ContentAuto-check passed
  • Drives long-form fiction, scripts, storyboards, interactive films and long-document translation through InkOS, with every change made by a typed action.

    10k GitHub starsUsed in 1 repo~1.1k tokens
    Writing & ContentAuto-check passed
  • Novel Art

    eternityspring/shuohao-skills

    给 AI 短剧出美术设定集(场景 + 叙事道具):场景的设计意图、一致性锚点、光照时段变体、 空景提示词;道具的戏剧功能、状态变体、尺度参照、白底无手提示词。

    4.2k GitHub stars~1.1k tokensUpdated 12 days ago
    Writing & ContentAuto-check: notes
  • Web Novel AI-Trace Remover

    zenstory-ai/oh-story-claudecode

    Rewrites AI-sounding Chinese web novel text so it reads naturally, changing as little as possible and keeping plot, names and numbers intact.

    7.4k GitHub starsUsed in 2 repos~2.6k tokens
    Writing & ContentAuto-check passed

More from danjdewhurst/story-skills

All 24 skills in this repo
  • Adaptation

    danjdewhurst/story-skills

    This skill should be used when the user asks to "make an audiobook", "narration script", "narrator", "ACX", "Findaway", "pronunciation guide", "how long is the audiobook", "adapt to a screenplay"…

    279 GitHub starsUsed in 2 repos~3.5k tokens
    Auto-check: notes
  • Story Maintenance

    danjdewhurst/story-skills

    This skill should be used when the user asks to "validate", "reindex", "repair registries", "check links", "run the continuity, pacing, clue, voice, or name checks", "count words", "summarize a…

    279 GitHub starsUsed in 1 repo~5.4k tokens
    Auto-check: notes
  • Research

    danjdewhurst/story-skills

    This skill should be used when the user asks to "research", "fact-check", "check the history", "is this accurate", "research notes", "sources", "historical accuracy", "technical accuracy", "how…

    279 GitHub starsUsed in 2 repos~2.4k tokens
    Auto-check: notes
  • Chapter Writing

    danjdewhurst/story-skills

    This skill should be used when the user asks to "write a chapter", "next chapter", "chapter outline", "draft chapter", "continue the story", "write a scene", "outline a chapter", or wants to write…

    279 GitHub starsUsed in 1 repo~4.8k tokens
    Auto-check: notes
  • Character Management

    danjdewhurst/story-skills

    This skill should be used when the user asks to "create a character", "update a character", "add a character", "build a family tree", "character relationships", "character timeline", "character…

    279 GitHub starsUsed in 1 repo~3.9k tokens
    Auto-check: notes
  • Discovery Drafting

    danjdewhurst/story-skills

    This skill should be used when the user asks about "pantsing", "discovery write", "write without an outline", "discovery draft", "write into the dark", "story kernel", "reconcile a chapter", "dead…

    279 GitHub starsUsed in 1 repo~2k tokens
    Auto-check: notes

Questions about Interactive Fiction

What does Interactive Fiction do?

This skill should be used when the user asks to "write a branching story", "interactive fiction", "choose your own adventure", "plan the branches", "choice graph", "add a choice", "gamebook"…. Interactive Fiction is an agent skill from danjdewhurst/story-skills. This skill should be used when the user asks to "write a branching story", "interactive fiction", "choose your own adventure", "plan the branches", "choice graph", "add a choice", "gamebook", "Twine", "Ink", "draft a branch", "where the branches rejoin", "add an ending", "unreachable chapter", "path continuity", "state-differs-by-path", or wants to plan, draft, or revise a story project whose chapters carry choices.

When should I use Interactive Fiction?

Interactive Fiction fits situations like: asks to write a branching story; interactive fiction; choose your own adventure; plan the branches.

How do I install Interactive Fiction in Claude Code?

Run `npx skills add danjdewhurst/story-skills --skill interactive-fiction -a claude-code`. Or copy the skill folder (skills/interactive-fiction in danjdewhurst/story-skills) into .claude/skills/interactive-fiction in your project. Claude Code loads it when a task matches its description.

How do I install Interactive Fiction in Codex?

Run `npx skills add danjdewhurst/story-skills --skill interactive-fiction -a codex`. Or copy the skill folder (skills/interactive-fiction in danjdewhurst/story-skills) into .agents/skills/interactive-fiction in your project. Codex loads it when a task matches its description.

Can I use Interactive Fiction in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add danjdewhurst/story-skills --skill interactive-fiction -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/interactive-fiction, .gemini/skills/interactive-fiction, .github/skills/interactive-fiction and .opencode/skills/interactive-fiction in your project.

What does Interactive Fiction need to run?

Going by SKILL.md and its folder, Interactive Fiction needs the command-line tools its instructions call (node).

Does Interactive Fiction access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Interactive Fiction safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Interactive Fiction use?

Interactive Fiction is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Interactive Fiction use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.6k tokens, read only when the agent opens those files.

What are the alternatives to Interactive Fiction?

Skills that share tags, products or a category with Interactive Fiction: Story Multi-Perspective Review (zenstory-ai/oh-story-claudecode, 7.4k stars), Story Toolbox Router (zenstory-ai/oh-story-claudecode, 7.4k stars), Short Web Fiction Trend Scan (zenstory-ai/oh-story-claudecode, 7.4k stars) and InkOS Creative Harness (Narcooo/inkos, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Interactive Fiction?

danjdewhurst (a GitHub user) maintains it in danjdewhurst/story-skills, which has 279 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 8, 2026.

Source: danjdewhurst/story-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.