From narrative-ink
Applies an opinionated set of Ink code formatting conventions to .ink files or ```ink code blocks in markdown. A Prettier-style formatter — whitespace/structure only, no semantic changes. Use when the user asks to format, clean up, or standardize Ink code style, or when editing Ink samples in docs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/narrative-ink:ink-styleThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A non-destructive formatter for Ink code. Applies consistent indentation, spacing, and structural conventions without changing program semantics.
A non-destructive formatter for Ink code. Applies consistent indentation, spacing, and structural conventions without changing program semantics.
The full rule reference lives in rules.md. The formatter implementation lives in format-ink.py.
/narrative-ink:ink-style or similar.md files where consistency mattersDo NOT invoke when the user wants semantic changes (refactors, bug fixes, new features). This skill only changes whitespace and surface structure.
Run the bundled format-ink.py script — it lives in this skill's directory, next to this SKILL.md. It accepts .ink files (formatted whole) or .md files (only ```ink fenced blocks are touched; surrounding prose is left alone).
python3 format-ink.py PATH/TO/FILE # format in place
python3 format-ink.py --check PATH # print diff, exit 1 if changes needed
python3 format-ink.py --stdout PATH # print formatted output to stdout
After formatting, run the verifier (below) before committing. Then report what changed to the user.
Always verify the formatter didn't change compiled output:
python3 format-ink.py --verify-blocks PATH
For a .md file, this extracts each ```ink block, scaffolds it as a compilable snippet, compiles both the original and the formatted version with inkjs-compiler, and compares JSON. For a .ink file, it compiles the whole file before and after. Per-block outcomes:
The verifier needs inkjs-compiler. It searches $INKJS_COMPILER, $PATH, and ./node_modules/.bin/inkjs-compiler. Install it with npm install inkjs if it isn't already available.
The guiding rule: modify whitespace only where it provably cannot affect compiled output. Preserve everything else verbatim. See rules.md for the full statement.
The formatter changes:
~, ,, ->, before ( in function calls){...} only when the braces contain a pure expression (no : and no |)// in line commentsThe formatter does NOT change:
{...} when the braces contain : or | — content is rendered[...] or the surrounding choice line — rendered#tag, # tag, #tag: value all preserved as written)```ink blocks in markdown filesTwo canonical fixtures live in test-fixtures/:
indentation-cases.ink — covers L1–L5 nesting, switches, conditionals, knots, functions, stitches, tags, glue, and other edge casescrime-scene-formatted.ink — Joseph Humfrey's "Long example: crime scene" from inkle's Writing with ink tutorial, fully formattedBoth are idempotent under the formatter: re-running produces no changes.
npx claudepluginhub spaceninja/narrative-ink-skills --plugin narrative-inkProvides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.