/squiffy:squiffyfrom Squiffy
Write, edit, check, and play Squiffy interactive stories and gamebooks. Handles .squiffy files, squiffy.json project config, sections, passages, links, attributes, and CLI playtesting.
Ships in Squiffy. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Squiffy is a language for choice-based interactive stories. A story is one or more .squiffy text files, usually with a squiffy.json project file, which build into a web page. Full docs: https://squiffystory.com (an index for AI agents is at https://squiffystory.com/llms.txt).
Before writing anything, look for squiffy.json in the story's folder. It changes the rules for setting attributes:
squiffy.json (Squiffy 7 rules): text goes in quotes, and another attribute is written by its plain name.
@set weapon = "sword", @set best = score, [[Go]](next, name = "Bob", gold += price)@.
@set weapon = sword, @set best = @score, [[Go]](next, name = Bob, gold += @price)Numbers, true/false, @set has_key, @set not has_key, :=, @inc and @dec are the same in both. Match the story's existing style. Don't add a squiffy.json to a story without asking: it changes how the story's existing assignments are read (--convert-v6 converts them and adds one).
squiffy.json also names the main file ("main"), where the story starts. With it, every .squiffy, .css and .js file in the folder is part of the story, without @import.
@title The Cellar
@start top
[[top]]:
@set gold = 0
You're at the top of the cellar steps. You could [listen], or [[go down]](cellar, lamp = true).
[listen]:
Something drips below.
[[cellar]]:
It's dark.{{#if lamp}} Your lamp shows a [chest].{{/if}} [[Go back up]](top), or [[leave by the back door]](outside).
[chest]:
@inc gold 5
You find {{gold}} gold.
[[outside]]:
@end
You step out into the night with {{gold}} gold. THE END.
[[name]]: starts a section. [[name]] or [[link text]](name) links to one. Going to a new section turns off every earlier link.[name]: starts a passage inside the section above it. [name] or [link text](name) links to one. Passage links can be clicked in any order, once each, until the player leaves the section. Coming back to a section shows it again with fresh passage links, so guard one-off rewards with an attribute: {{#unless chest_open}}[chest]{{/unless}}. Any text in single square brackets is a passage link.[[Buy]](shop, gold -= 3, has_sword = true).+++Link text ends the section with a link to a new, unnamed section that follows.@set, @inc, @dec, @unset, @clear, @end, @repeat, @class are directives: one per line, at the start of a section or passage. They always run when it's shown, even inside {{#if}}; use the {{set}}, {{inc}} helpers to change attributes conditionally.{{...}} is the Handlebars text processor: {{gold}}, {{= price * 2}}, {{#if gold > 5 and not has_key}}...{{else}}...{{/if}}, (seen "chest"), {{goto "end"}}, {{embed "map"}}. Helpers take subexpressions in ( ), never nested {{ }}.@end marks a section as an ending. A section with no links out and no @end is a "dead end", which --check warns about.[[section]]: is the start of the story (a section called _default in CLI output), unless @start names another.@import file.squiffy adds another file, in a story without squiffy.json.The Squiffy command-line tool runs with npx (Node.js required). Run it in the story's folder (the one with squiffy.json), or give it the .squiffy file for a story without one. After every change:
npx @textadventures/squiffy-cli --check --json
Lists problems with file, line, column, severity and code: compile errors, broken links, unreachable sections (squiffy/unreachable-section) and dead ends (squiffy/dead-end). Exit code 1 if there are errors. Fix errors. Fix warnings, or ask the author: an unreachable section may be unfinished work they want to keep.npx @textadventures/squiffy-cli --play --save game.json --json
shows the start and the numbered choices. Then click one link per run, reading the result before choosing the next. The JSON has every step so far in steps; read the last one, and choices:
npx @textadventures/squiffy-cli --play --save game.json --choose "go down" --json
--choose takes a link's text or number. Use --start section to begin somewhere else, --input name=Ann to fill a text box, --attributes to see attributes, --seed 1 for repeatable randomness. Delete game.json to start again. Errors in the story (such as bad JavaScript) are reported, with exit code 1.npx @textadventures/squiffy-cli --random 50 --json
Reports errors, dead ends, endings reached and sections never visited. Each problem has the options to reproduce it, such as --play --seed 7 --choose 'go down' --choose 'Go back up', or for a long route, --choices build/random/problem-1.txt (a file with one link per line). Run those with --play to see it happen.npx @textadventures/squiffy-cli (no flags). With squiffy.json, it writes to build/; otherwise next to the file. --serve serves it on http://localhost:8282, and --inline makes one HTML file.Time is virtual in --play and --random: animations, {{goto ... after=}} and {{#every}} happen at once (a {{#every}} that never stops is left after 20 times). Scripts a story adds to its page aren't run.
If the CLI says it doesn't know --check, --play or --random, it's an older version: try npx @textadventures/squiffy-cli@beta, or tell the author to update.
Don't write game.json, build/ or random/ output into the author's story files, and delete scratch save files you made when you're done.
@end. Aim for --check with no warnings, and --random with no problems.Read these when you need more than the above:
@start, @title, @repeat, @clear, @end, embedding and {{goto}}. Read when writing structure beyond basic sections and links.seen/visits/turns/previous. Read before writing any @set or link setter you aren't sure of.{{helper}}, with its parameters. Read before using a helper not shown above.squiffy.json (main, exclude, panels, player settings, saves, Back button, strings), stories in several files, @import, images, music and sound.@class and the class helpers.@ui, the squiffy API, custom helpers and animations.references/attributes.md (opens in a new tab)references/dynamic-text.md (opens in a new tab)references/helpers.md (opens in a new tab)references/javascript.md (opens in a new tab)references/player-input.md (opens in a new tab)references/project.md (opens in a new tab)references/styling.md (opens in a new tab)references/syntax.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub textadventures/squiffy --plugin squiffyOther plugins' skills for the same job