story-skills 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +439 -0
- package/bin/story.js +8 -0
- package/docs/first-20-minutes.md +119 -0
- package/docs/schema-v2.md +234 -0
- package/package.json +56 -0
- package/schemas/story.schema.json +376 -0
- package/skills/chapter-writing/SKILL.md +131 -0
- package/skills/chapter-writing/references/chapter-template.md +42 -0
- package/skills/chapter-writing/references/scene-template.md +41 -0
- package/skills/chapter-writing/references/writing-guidelines.md +70 -0
- package/skills/character-management/SKILL.md +92 -0
- package/skills/character-management/references/character-template.md +87 -0
- package/skills/character-management/references/ensemble-cast.md +19 -0
- package/skills/character-management/references/relationship-types.md +67 -0
- package/skills/character-management/references/supporting-characters.md +18 -0
- package/skills/discovery-drafting/SKILL.md +105 -0
- package/skills/discovery-drafting/references/dead-ends.md +60 -0
- package/skills/discovery-drafting/references/drafting-cadence.md +77 -0
- package/skills/discovery-drafting/references/reconcile-loop.md +97 -0
- package/skills/discovery-drafting/references/story-kernel.md +67 -0
- package/skills/feedback-triage/SKILL.md +119 -0
- package/skills/feedback-triage/references/feedback-template.md +57 -0
- package/skills/feedback-triage/references/synthesis-template.md +94 -0
- package/skills/genre-craft/SKILL.md +111 -0
- package/skills/genre-craft/references/horror.md +66 -0
- package/skills/genre-craft/references/mg-ya.md +65 -0
- package/skills/genre-craft/references/mystery-fair-play.md +109 -0
- package/skills/genre-craft/references/romance-beats.md +70 -0
- package/skills/genre-craft/references/scifi-pipeline.md +72 -0
- package/skills/genre-craft/references/serial-episodic.md +90 -0
- package/skills/genre-craft/references/thriller.md +71 -0
- package/skills/plot-structure/SKILL.md +109 -0
- package/skills/plot-structure/references/arc-template.md +53 -0
- package/skills/plot-structure/references/mice-quotient.md +29 -0
- package/skills/plot-structure/references/outlining-ladder.md +33 -0
- package/skills/plot-structure/references/promise-template.md +28 -0
- package/skills/plot-structure/references/question-template.md +26 -0
- package/skills/plot-structure/references/short-story-form.md +19 -0
- package/skills/plot-structure/references/structure-models.md +121 -0
- package/skills/research/SKILL.md +101 -0
- package/skills/research/references/research-practice.md +42 -0
- package/skills/revision-continuity/SKILL.md +103 -0
- package/skills/scene-craft/SKILL.md +102 -0
- package/skills/scene-craft/references/deep-pov.md +77 -0
- package/skills/scene-craft/references/dialogue-subtext.md +87 -0
- package/skills/scene-craft/references/exposition.md +72 -0
- package/skills/scene-craft/references/flashbacks-time.md +72 -0
- package/skills/scene-craft/references/openings.md +66 -0
- package/skills/scene-craft/references/scene-cards.md +62 -0
- package/skills/scene-craft/references/scene-sequel.md +80 -0
- package/skills/scene-craft/references/try-fail.md +59 -0
- package/skills/series-continuity/SKILL.md +143 -0
- package/skills/story-init/SKILL.md +282 -0
- package/skills/story-init/references/title-logline.md +24 -0
- package/skills/story-maintenance/SKILL.md +97 -0
- package/skills/story-maintenance/scripts/story.js +7258 -0
- package/skills/submission/SKILL.md +195 -0
- package/skills/submission/references/blurb.md +65 -0
- package/skills/submission/references/comp-titles.md +50 -0
- package/skills/submission/references/query-letter.md +80 -0
- package/skills/submission/references/tracker-template.md +60 -0
- package/skills/submission/references/word-count-norms.md +45 -0
- package/skills/theme-craft/SKILL.md +112 -0
- package/skills/theme-craft/references/antagonist-design.md +71 -0
- package/skills/theme-craft/references/controlling-idea.md +75 -0
- package/skills/theme-craft/references/lie-truth.md +82 -0
- package/skills/theme-craft/references/motif-symbolism.md +57 -0
- package/skills/theme-craft/references/theme-audit.md +63 -0
- package/skills/voice-style/SKILL.md +115 -0
- package/skills/voice-style/references/prose-checks.md +42 -0
- package/skills/voice-style/references/style-sheet-guide.md +89 -0
- package/skills/worldbuilding/SKILL.md +105 -0
- package/skills/worldbuilding/references/artifact-template.md +31 -0
- package/skills/worldbuilding/references/faction-template.md +33 -0
- package/skills/worldbuilding/references/location-template.md +41 -0
- package/skills/worldbuilding/references/system-template.md +31 -0
- package/skills/worldbuilding/references/world-element-types.md +77 -0
- package/src/cli.js +96 -0
- package/src/commands.js +407 -0
- package/src/compare.js +100 -0
- package/src/continuity.js +640 -0
- package/src/frontmatter.js +336 -0
- package/src/import.js +314 -0
- package/src/markdown.js +77 -0
- package/src/options.js +221 -0
- package/src/progress.js +128 -0
- package/src/prose.js +419 -0
- package/src/series.js +481 -0
- package/src/story.js +4614 -0
- package/src/timeline.js +201 -0
- package/src/version.js +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Daniel Dewhurst
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# Story Skills
|
|
4
|
+
|
|
5
|
+
**Agent Skills for planning, tracking, and drafting fiction in markdown.**
|
|
6
|
+
|
|
7
|
+
Story Skills gives agents a shared project format for fiction: a story bible, characters, worldbuilding, factions, artifacts, plot arcs, scenes, continuity state, promises and payoffs, timelines, and chapter drafts. Everything is plain markdown with YAML frontmatter, packaged as standard Agent Skills with Codex and Claude Code plugins.
|
|
8
|
+
|
|
9
|
+
The companion `story` CLI treats the story bible as a checkable contract. Its **continuity engine** catches dead characters walking, payoffs that land before their setup, unfired Chekhov guns, and stale story state, deterministically, before a reader finds them.
|
|
10
|
+
|
|
11
|
+
<img src="assets/demo.gif" alt="story continuity flags a character who died in chapter 2 but appears in chapter 4, a payoff that lands before its setup, and a question resolved before it is asked" width="900">
|
|
12
|
+
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
[](https://agentskills.io)
|
|
15
|
+
[](https://developers.openai.com/codex)
|
|
16
|
+
[](https://docs.anthropic.com/en/docs/claude-code)
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
23
|
+
|
|
24
|
+
Install the plugin in **Codex** or **Claude Code**:
|
|
25
|
+
|
|
26
|
+
```shell
|
|
27
|
+
# Codex
|
|
28
|
+
codex plugin marketplace add danjdewhurst/story-skills
|
|
29
|
+
codex plugin add story-skills@story-skills
|
|
30
|
+
|
|
31
|
+
# Claude Code (type these inside a Claude Code session, not a shell)
|
|
32
|
+
/plugin marketplace add danjdewhurst/story-skills
|
|
33
|
+
/plugin install story-skills@story-skills
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
For any other agent that supports `SKILL.md`, use the Agent Skills CLI:
|
|
37
|
+
|
|
38
|
+
```shell
|
|
39
|
+
npx skills add danjdewhurst/story-skills # or: bunx skills add danjdewhurst/story-skills
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Then ask your agent to **"Start a new story"**. Per-agent instructions for GitHub Copilot, Cursor, Windsurf, Gemini CLI, OpenCode, and others are under [More install options](#more-install-options).
|
|
43
|
+
|
|
44
|
+
### Or let your agent install it
|
|
45
|
+
|
|
46
|
+
Paste this prompt into your coding agent. It works out which agent it is and uses the matching install method:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
Install the Story Skills bundle from https://github.com/danjdewhurst/story-skills.
|
|
50
|
+
|
|
51
|
+
First, work out which agent you are, then use the matching method below. If a command fails or you can't run it, tell me the exact command to run myself.
|
|
52
|
+
|
|
53
|
+
- Claude Code: run `claude plugin marketplace add danjdewhurst/story-skills`, then `claude plugin install story-skills@story-skills`. If the `claude` CLI isn't available, tell me to type `/plugin marketplace add danjdewhurst/story-skills` and then `/plugin install story-skills@story-skills` in this session.
|
|
54
|
+
- Codex: run `codex plugin marketplace add danjdewhurst/story-skills`, then `codex plugin add story-skills@story-skills`.
|
|
55
|
+
- Gemini CLI: run `gemini skills install https://github.com/danjdewhurst/story-skills.git`.
|
|
56
|
+
- Any other agent that supports SKILL.md (GitHub Copilot, Cursor, Windsurf, OpenCode, and others): run `npx skills add danjdewhurst/story-skills`, or `bunx skills add danjdewhurst/story-skills` if only Bun is installed. If that doesn't support you, clone the repository to a temporary directory and copy every folder in its `skills/` directory into your skills directory:
|
|
57
|
+
- GitHub Copilot: `.github/skills/` in this project, or `~/.copilot/skills/` globally
|
|
58
|
+
- Cursor: `.agents/skills/` in this project
|
|
59
|
+
- Windsurf: `.windsurf/skills/` in this project, or `~/.codeium/windsurf/skills/` globally
|
|
60
|
+
- OpenCode: `.opencode/skills/` in this project, or `~/.config/opencode/skills/` globally
|
|
61
|
+
- Anything else: your documented skills directory, or `.agents/skills/` in this project
|
|
62
|
+
|
|
63
|
+
Prefer a project install unless I asked for a global one. If you can't tell which agent you are, ask me before installing. When you're done, tell me what you installed, where it went, and whether I need to restart or reload you for the skills to show up.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## The continuity engine
|
|
67
|
+
|
|
68
|
+
Long-range consistency is what language models are worst at, and prompting can't fix it. Story Skills makes it deterministic: character deaths, promises and payoffs, open questions, scene casts, and durable knowledge and object state live in frontmatter, and `story continuity` treats contradictions the way a compiler treats type errors.
|
|
69
|
+
|
|
70
|
+
[`examples/the-unraveled-thread/`](examples/the-unraveled-thread/) is a deliberately broken mystery. Every file is well-formed, so it passes `story validate` and `story links` cleanly, but the story itself doesn't hold together:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
$ story continuity examples/the-unraveled-thread
|
|
74
|
+
Continuity check failed: 4 errors, 3 warnings, 0 dismissed
|
|
75
|
+
error: chapters/chapter-04.md lists edran-vale, who died in chapter-02; move posthumous appearances to mentions
|
|
76
|
+
error: continuity/promises/the-broken-compass.md pays off in chapter-02 before it is planted in chapter-03
|
|
77
|
+
error: continuity/questions/who-burned-the-mill.md resolves in chapter-02 before it is introduced in chapter-03
|
|
78
|
+
error: continuity/state.md knowledge-state[0] references missing chapter chapter-05
|
|
79
|
+
warning: chapters/chapter-03.md POV character nessa-thorn is not listed in characters
|
|
80
|
+
warning: continuity/promises/the-sealed-letter.md was planted in chapter-01, 3 chapters ago, and has no payoff yet
|
|
81
|
+
warning: continuity/state.md object-state[0] status active conflicts with worldbuilding/artifacts/vales-compass.md status destroyed
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Every finding is exact, file-addressed, and reproducible, and CI asserts this output on every commit. Intentional flashbacks and posthumous appearances stay legal through the chapter `mentions` field, and findings listed in `continuity/exemptions.md` are reported as dismissed. `story doctor` and `story next` fold the same checks into prioritized repair actions.
|
|
85
|
+
|
|
86
|
+
## Skills
|
|
87
|
+
|
|
88
|
+
| Skill | What it does | Try saying |
|
|
89
|
+
|-------|-------------|------------|
|
|
90
|
+
| **story-init** | Scaffolds the story bible, folders, and registries | *"Start a new story"* |
|
|
91
|
+
| **character-management** | Creates character profiles with relationships, traits, arcs, and family trees | *"Create a character"* |
|
|
92
|
+
| **worldbuilding** | Builds locations and systems: magic, politics, technology, religion, and more | *"Design a magic system"* |
|
|
93
|
+
| **plot-structure** | Plans arcs with structures like three-act, hero's journey, Save the Cat, and kishotenketsu | *"Create a plot arc"* |
|
|
94
|
+
| **theme-craft** | Builds the controlling idea (value + cause premise), the moral argument, lie/truth arc types, antagonist design, and motif/symbolism audits | *"What's my story really about?"* |
|
|
95
|
+
| **genre-craft** | Genre packs with checkable conventions: mystery fair-play, romance beats, thriller, horror, MG/YA, sci-fi, and serial/episodic structure | *"Plan a fair-play mystery"* |
|
|
96
|
+
| **research** | Records the real-world facts a story relies on, with sources and the chapters that use them, and flags final chapters resting on unverified research | *"Fact-check the sailing in chapter 4"* |
|
|
97
|
+
| **chapter-writing** | Drafts chapters through an outline-first workflow that pulls from story context | *"Write the next chapter"* |
|
|
98
|
+
| **discovery-drafting** | Pantsing mode: draft from a story kernel, keep post-hoc chapter notes, and reconcile the bible after each discovery-drafted chapter | *"I want to discovery-write"* |
|
|
99
|
+
| **scene-craft** | Plans and checks the scene unit: Scene/Sequel structure, try/fail cycles, scene cards, dialogue subtext and voice differentiation, deep POV, exposition, flashbacks, and openings | *"Does this chapter breathe?"* |
|
|
100
|
+
| **voice-style** | Keeps a copyeditor's style sheet (dialect, house spellings, dialogue punctuation, character voices, watch words) and acts on `story prose` lint findings | *"Set up a style sheet for this book"* |
|
|
101
|
+
| **revision-continuity** | Revises drafts, audits continuity, and keeps character state, timeline, and arc changes consistent | *"Continuity-check chapter 3"* |
|
|
102
|
+
| **feedback-triage** | Collects alpha/beta reader feedback per round, synthesizes convergent and divergent notes, and hands a revision plan to revision-continuity | *"Triage the beta feedback"* |
|
|
103
|
+
| **series-continuity** | Starts sequels and prequels as linked projects, carries characters and world forward, and checks shared canon across books | *"Start a prequel to The Last Ember"* |
|
|
104
|
+
| **submission** | Checks submission readiness, drafts the query letter, pitch, comp titles, synopsis, and blurb, builds the Shunn manuscript, and tracks queries and responses | *"Help me query agents"* |
|
|
105
|
+
| **story-maintenance** | Runs deterministic CLI checks for validation, continuity, reports, indexing, links, word counts, import, and export | *"Validate my story project"* |
|
|
106
|
+
|
|
107
|
+
For stronger prose, pair **chapter-writing** with [**better-writing**](https://github.com/forjd/better-writing). It adds voice calibration, anti-generic writing checks, and a final prose-quality pass, and installs the same way:
|
|
108
|
+
|
|
109
|
+
```shell
|
|
110
|
+
npx skills add forjd/better-writing
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Companion CLI
|
|
114
|
+
|
|
115
|
+
The optional `story` CLI handles deterministic project maintenance while the skills handle the creative work. It needs Node 18 or newer and has no runtime dependencies. Run it with `npx`, or install it globally:
|
|
116
|
+
|
|
117
|
+
```shell
|
|
118
|
+
npx story-skills --help
|
|
119
|
+
npm install -g story-skills # then: story --help
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
To try unreleased changes, run it straight from GitHub with `npx --yes --package github:danjdewhurst/story-skills story --help`.
|
|
123
|
+
|
|
124
|
+
From a clone, use `bun install` and then `bun run story --help`. Copied-skill installs don't need either: `story-maintenance` bundles a `scripts/story.js` fallback that agents run with Node.
|
|
125
|
+
|
|
126
|
+
The CLI is for maintenance only. Agents write story content directly to markdown files and never create project-local build or generator scripts to emit the story.
|
|
127
|
+
|
|
128
|
+
**Create and restructure**
|
|
129
|
+
|
|
130
|
+
| Command | Purpose |
|
|
131
|
+
|---------|---------|
|
|
132
|
+
| `story init "The Last Ember"` | Scaffold a story project with the standard markdown layout |
|
|
133
|
+
| `story init "Book Two" --follows the-last-ember` | Scaffold a sequel (or a prequel with `--precedes`) linked to an existing book, writing the backlink |
|
|
134
|
+
| `story import draft.md --title "The Lost Coast"` | Split an existing manuscript into a new story project and suggest entity candidates |
|
|
135
|
+
| `story add character "Sera Voss"` | Create entity files for characters, locations, systems, factions, artifacts, arcs, chapters, scenes, questions, promises, clues, terms, research notes, and matter pages |
|
|
136
|
+
| `story add matter "Dedication"` | Add a front (default) or `--placement back` matter page such as a dedication, epigraph, or acknowledgments |
|
|
137
|
+
| `story rename character sera-voss "Sera Vale"` | Rename an entity and update kebab-case references |
|
|
138
|
+
| `story remove promise old-setup` | Remove an entity and scrub metadata references |
|
|
139
|
+
| `story migrate [path]` | Upgrade a project to the current schema |
|
|
140
|
+
|
|
141
|
+
**Check and repair**
|
|
142
|
+
|
|
143
|
+
| Command | Purpose |
|
|
144
|
+
|---------|---------|
|
|
145
|
+
| `story validate [path]` | Check required files, schema version, YAML frontmatter, registries, and word-count warnings |
|
|
146
|
+
| `story links [path]` | Check character, location, chapter, and arc cross-references and backlinks |
|
|
147
|
+
| `story continuity [path]` | Check deterministic continuity contracts: deaths, promises and payoffs, questions, casts, and durable state |
|
|
148
|
+
| `story series [path]` | Order linked sequels and prequels by chronology and check shared canon: deaths, casts, knowledge fact ids, names, and destroyed artifacts |
|
|
149
|
+
| `story reindex [path]` | Rebuild registry tables from the current markdown files |
|
|
150
|
+
| `story wordcount [path] --write` | Count chapter prose and update chapter frontmatter plus the chapter registry |
|
|
151
|
+
| `story doctor [path]` | Show health checks with actionable repair steps |
|
|
152
|
+
| `story next [path]` | Recommend the next deterministic writing or maintenance actions |
|
|
153
|
+
| `story report [path] --actionable` | Summarize inventory and optionally include next actions |
|
|
154
|
+
|
|
155
|
+
**Analyze**
|
|
156
|
+
|
|
157
|
+
| Command | Purpose |
|
|
158
|
+
|---------|---------|
|
|
159
|
+
| `story knowledge sera-voss --at chapter-03` | Show what a character knew at a chapter, from timeline-scoped knowledge state |
|
|
160
|
+
| `story timeline [path]` | Show scenes in story-time order from their `date`/`time` (marking scenes told out of order), POV balance by words, and each character's presence and longest absence |
|
|
161
|
+
| `story prose [path]` | Lint chapter prose: filter words, -ly adverbs, said-bookisms, echoes, sentence rhythm, repeated phrases, similar names, and `style-sheet.md` spellings and watch words |
|
|
162
|
+
| `story progress [path] --log` | Report words against `target-words`, the `deadline`, and chapter targets; `--log` records the day's count in `progress.md` for pace and a projected finish |
|
|
163
|
+
| `story compare [path] --ref draft-1` | Compare chapters with an earlier draft (a git ref, or `--against` a copied project folder): word changes, added and removed chapters, and unchanged paragraphs |
|
|
164
|
+
|
|
165
|
+
**Publish**
|
|
166
|
+
|
|
167
|
+
| Command | Purpose |
|
|
168
|
+
|---------|---------|
|
|
169
|
+
| `story synopsis [--pages 1\|3] [--out file]` | Compress arcs into a mechanical 1- or 3-page synopsis |
|
|
170
|
+
| `story export [path] --out manuscript.md` | Combine front matter, chapters, and back matter into a single manuscript markdown file |
|
|
171
|
+
| `story build [path] --format epub` | Build disposable markdown, EPUB, DOCX, or Shunn manuscript artifacts in `dist/`; EPUB builds embed the `story.md` `cover` image and `author` |
|
|
172
|
+
|
|
173
|
+
Behavior notes:
|
|
174
|
+
|
|
175
|
+
- **Matter pages** from `matter/` appear in the export and in every build format except Shunn, which is a submission format.
|
|
176
|
+
- **EPUB and DOCX** builds target plain prose: `*italic*` and `**bold**` become italic and bold runs, scene-break lines (`***`, `---`) become a `* * *` separator, and other markdown structure such as blockquotes, lists, and tables is flattened to text. The markdown export keeps chapter text as-is.
|
|
177
|
+
- **`story rename` and `story remove`** update entity ids in frontmatter reference fields and markdown link targets. They never edit prose, so a character called "Port" can be renamed without touching the word "port" in chapter text.
|
|
178
|
+
- A command that changes a frontmatter value regenerates that file's **frontmatter** from the parsed values, which drops any YAML comments in it. Files whose values don't change are left untouched.
|
|
179
|
+
|
|
180
|
+
For a complete starter transcript, read [`docs/first-20-minutes.md`](docs/first-20-minutes.md). For the project contract, read [`docs/schema-v2.md`](docs/schema-v2.md) and [`schemas/story.schema.json`](schemas/story.schema.json).
|
|
181
|
+
|
|
182
|
+
## Write a book with pull requests
|
|
183
|
+
|
|
184
|
+
A story project with deterministic checks is one an agent can advance unattended. The [`templates/github/`](templates/github/) workflows turn a story repository into a self-drafting book:
|
|
185
|
+
|
|
186
|
+
- [`story-checks.yml`](templates/github/story-checks.yml) runs `story validate`, `story links`, `story continuity`, and `story report --actionable` on every push and pull request, so a chapter PR can't merge with a continuity contradiction.
|
|
187
|
+
- [`draft-next-chapter.yml`](templates/github/draft-next-chapter.yml) runs [Claude Code](https://github.com/anthropics/claude-code-action) on a schedule. It asks `story next` for the next action, drafts the next chapter with the chapter-writing skill, updates scene records and continuity state, runs the maintenance checks, and opens a pull request for review.
|
|
188
|
+
|
|
189
|
+
Copy both files into `.github/workflows/` in the repository that holds your story project, add an `ANTHROPIC_API_KEY` secret, and review one chapter PR each morning.
|
|
190
|
+
|
|
191
|
+
GitHub doesn't start `story-checks.yml` for pull requests opened with the built-in `GITHUB_TOKEN`, so the draft workflow runs the same checks itself after drafting. Pass a personal access token as `github_token` if you also want the checks workflow to run on those PRs.
|
|
192
|
+
|
|
193
|
+
## Import an existing manuscript
|
|
194
|
+
|
|
195
|
+
Most writers don't start from a blank page. `story import` builds a Story Skills project from work in progress:
|
|
196
|
+
|
|
197
|
+
```shell
|
|
198
|
+
story import draft.md --title "The Lost Coast" --genre mystery
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
It splits the manuscript on chapter headings (or imports a directory of chapter files in natural name order, so `chapter-2` comes before `chapter-10`), creates the full project layout with accurate word counts and registries, and prints recurring proper-name candidates so an agent can follow up with `story add character` and `story add location` to build out the bible.
|
|
202
|
+
|
|
203
|
+
`--force` lets an import reuse an existing directory. It replaces every `chapter-NN.md` file in `chapters/`, so stale chapters from an earlier import are removed.
|
|
204
|
+
|
|
205
|
+
## Project structure
|
|
206
|
+
|
|
207
|
+
Running **story-init** creates this layout:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
my-story/
|
|
211
|
+
├── story.md # Story bible: title, genre, themes, POV, tense
|
|
212
|
+
├── style-sheet.md # Voice, house spellings, and watch words
|
|
213
|
+
├── characters/
|
|
214
|
+
│ └── _index.md # Character registry
|
|
215
|
+
├── worldbuilding/
|
|
216
|
+
│ ├── _index.md # World overview
|
|
217
|
+
│ ├── locations/
|
|
218
|
+
│ ├── systems/
|
|
219
|
+
│ ├── factions/
|
|
220
|
+
│ └── artifacts/
|
|
221
|
+
├── plot/
|
|
222
|
+
│ ├── _index.md # Arc overview
|
|
223
|
+
│ ├── arcs/
|
|
224
|
+
│ └── timeline.md
|
|
225
|
+
├── scenes/
|
|
226
|
+
│ └── _index.md # Machine-readable scene registry
|
|
227
|
+
├── continuity/
|
|
228
|
+
│ ├── state.md # Character, object, and knowledge state
|
|
229
|
+
│ ├── questions/
|
|
230
|
+
│ │ └── _index.md
|
|
231
|
+
│ ├── promises/
|
|
232
|
+
│ │ └── _index.md
|
|
233
|
+
│ └── clues/
|
|
234
|
+
│ └── _index.md
|
|
235
|
+
├── glossary/
|
|
236
|
+
│ ├── _index.md
|
|
237
|
+
│ └── terms/
|
|
238
|
+
└── chapters/
|
|
239
|
+
└── _index.md # Chapter registry
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Some files appear only once you need them: `matter/` for front and back matter, `research/` for research notes, `progress.md` for the session log written by `story progress --log`, and `continuity/exemptions.md` for dismissed continuity findings.
|
|
243
|
+
|
|
244
|
+
## How it works
|
|
245
|
+
|
|
246
|
+
Every story element is a markdown file with YAML frontmatter, and the skills cross-reference those files to keep the project consistent:
|
|
247
|
+
|
|
248
|
+
- **`story.md`** is the top-level bible that every skill reads. Its **`schema-version: 2`** field lets the CLI detect incompatible project formats.
|
|
249
|
+
- Every entity file is named by a **kebab-case identifier**, such as `sera-voss` or `chapter-01`.
|
|
250
|
+
- **`_index.md`** files are the registries for each domain.
|
|
251
|
+
- Relationships and references are kept **bidirectional**.
|
|
252
|
+
- Scene records and continuity state keep character knowledge, object ownership, and setups and payoffs in files, so they carry over between sessions.
|
|
253
|
+
|
|
254
|
+
## Examples
|
|
255
|
+
|
|
256
|
+
Complete projects generated with Story Skills:
|
|
257
|
+
|
|
258
|
+
- [**The Cormorant Tide**](https://github.com/danjdewhurst/the-cormorant-tide)
|
|
259
|
+
- [**Pippa and the Borrowed Star**](https://github.com/danjdewhurst/christmas-childrens-story), a children's Christmas story (6 chapters, 2,183 words)
|
|
260
|
+
|
|
261
|
+
Examples in this repository:
|
|
262
|
+
|
|
263
|
+
- [`examples/the-last-ember/`](examples/the-last-ember/): a fantasy with three characters, two locations, a magic system, a plot arc with foreshadowing, and a drafted first chapter.
|
|
264
|
+
- [`examples/the-fall-of-the-citadel/`](examples/the-fall-of-the-citadel/): a prequel to The Last Ember, linked with `series`, `book-number`, and `precedes`, that shares characters and places with the first book. Run `story series examples/the-last-ember` to see the chronology.
|
|
265
|
+
- [`examples/harbor-of-second-light/`](examples/harbor-of-second-light/): a near-future coastal mystery with memory technology, a posthumous witness arc, populated continuity state, and a drafted first chapter.
|
|
266
|
+
- [`examples/the-unraveled-thread/`](examples/the-unraveled-thread/): a deliberately broken project that demonstrates every class of finding the continuity engine reports.
|
|
267
|
+
|
|
268
|
+
## More install options
|
|
269
|
+
|
|
270
|
+
<details>
|
|
271
|
+
<summary><strong>Codex (without the plugin)</strong></summary>
|
|
272
|
+
|
|
273
|
+
The plugin install in [Quick start](#quick-start) is the recommended path. For local skill authoring, copy the skills in directly; Codex detects repo and user skills automatically:
|
|
274
|
+
|
|
275
|
+
```shell
|
|
276
|
+
git clone https://github.com/danjdewhurst/story-skills.git
|
|
277
|
+
|
|
278
|
+
# User-wide
|
|
279
|
+
cp -r story-skills/skills/* ~/.agents/skills/
|
|
280
|
+
|
|
281
|
+
# Or repo-scoped
|
|
282
|
+
cp -r story-skills/skills/* .agents/skills/
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
</details>
|
|
286
|
+
|
|
287
|
+
<details>
|
|
288
|
+
<summary><strong>GitHub Copilot (VS Code)</strong></summary>
|
|
289
|
+
|
|
290
|
+
[VS Code with Copilot](https://code.visualstudio.com/docs/copilot/customization/agent-skills) discovers skills from several directories:
|
|
291
|
+
|
|
292
|
+
```shell
|
|
293
|
+
git clone https://github.com/danjdewhurst/story-skills.git
|
|
294
|
+
|
|
295
|
+
# Copy skills to your project (either works)
|
|
296
|
+
cp -r story-skills/skills/* .github/skills/
|
|
297
|
+
cp -r story-skills/skills/* .agents/skills/
|
|
298
|
+
|
|
299
|
+
# Or install globally
|
|
300
|
+
cp -r story-skills/skills/* ~/.copilot/skills/
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Copilot can activate a skill when your request matches its description, or you can invoke one manually.
|
|
304
|
+
|
|
305
|
+
</details>
|
|
306
|
+
|
|
307
|
+
<details>
|
|
308
|
+
<summary><strong>Cursor</strong></summary>
|
|
309
|
+
|
|
310
|
+
[Cursor](https://www.cursor.com) supports the `SKILL.md` standard:
|
|
311
|
+
|
|
312
|
+
```shell
|
|
313
|
+
git clone https://github.com/danjdewhurst/story-skills.git
|
|
314
|
+
cp -r story-skills/skills/* .agents/skills/
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
</details>
|
|
318
|
+
|
|
319
|
+
<details>
|
|
320
|
+
<summary><strong>Windsurf</strong></summary>
|
|
321
|
+
|
|
322
|
+
[Windsurf](https://windsurf.com) discovers skills from workspace and global directories:
|
|
323
|
+
|
|
324
|
+
```shell
|
|
325
|
+
git clone https://github.com/danjdewhurst/story-skills.git
|
|
326
|
+
|
|
327
|
+
# Copy skills to your project
|
|
328
|
+
cp -r story-skills/skills/* .windsurf/skills/
|
|
329
|
+
|
|
330
|
+
# Or install globally
|
|
331
|
+
cp -r story-skills/skills/* ~/.codeium/windsurf/skills/
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Cascade can invoke a matching skill automatically, or you can use `@skill-name` to invoke one directly.
|
|
335
|
+
|
|
336
|
+
</details>
|
|
337
|
+
|
|
338
|
+
<details>
|
|
339
|
+
<summary><strong>Gemini CLI</strong></summary>
|
|
340
|
+
|
|
341
|
+
[Gemini CLI](https://github.com/google-gemini/gemini-cli) supports the same `SKILL.md` format through the [Agent Skills](https://agentskills.io) standard:
|
|
342
|
+
|
|
343
|
+
```shell
|
|
344
|
+
# Install all skills globally
|
|
345
|
+
gemini skills install https://github.com/danjdewhurst/story-skills.git
|
|
346
|
+
|
|
347
|
+
# Or install a single skill (any folder under skills/)
|
|
348
|
+
gemini skills install https://github.com/danjdewhurst/story-skills.git --path skills/chapter-writing
|
|
349
|
+
|
|
350
|
+
# Or link locally after cloning
|
|
351
|
+
git clone https://github.com/danjdewhurst/story-skills.git
|
|
352
|
+
gemini skills link story-skills/skills
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
Gemini can activate a skill when your request matches its description.
|
|
356
|
+
|
|
357
|
+
</details>
|
|
358
|
+
|
|
359
|
+
<details>
|
|
360
|
+
<summary><strong>OpenCode</strong></summary>
|
|
361
|
+
|
|
362
|
+
[OpenCode](https://opencode.ai) supports the `SKILL.md` format natively:
|
|
363
|
+
|
|
364
|
+
```shell
|
|
365
|
+
git clone https://github.com/danjdewhurst/story-skills.git
|
|
366
|
+
|
|
367
|
+
# Copy skills to your project
|
|
368
|
+
cp -r story-skills/skills/* .opencode/skills/
|
|
369
|
+
|
|
370
|
+
# Or install globally
|
|
371
|
+
cp -r story-skills/skills/* ~/.config/opencode/skills/
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
OpenCode also searches common skill paths such as `.claude/skills/`, so it can find project-level skills installed for other agents.
|
|
375
|
+
|
|
376
|
+
</details>
|
|
377
|
+
|
|
378
|
+
<details>
|
|
379
|
+
<summary><strong>Other platforms</strong></summary>
|
|
380
|
+
|
|
381
|
+
These skills follow the open [Agent Skills](https://agentskills.io) standard. If your agent supports the Agent Skills CLI, install the bundle directly:
|
|
382
|
+
|
|
383
|
+
```shell
|
|
384
|
+
npx skills add danjdewhurst/story-skills # or: bunx skills add danjdewhurst/story-skills
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
Use `--skill <name>` to install only specific skills, or `--agent <name>` to target a supported agent. You can also copy the skill folders into any compatible agent's skills directory.
|
|
388
|
+
|
|
389
|
+
Outside coding agents:
|
|
390
|
+
|
|
391
|
+
- **Claude.ai or ChatGPT Projects**: add the `SKILL.md` and reference files as project knowledge.
|
|
392
|
+
- **Any LLM API**: include the skill content in the system prompt.
|
|
393
|
+
- **By hand**: the templates, workflows, and project structure are model-agnostic.
|
|
394
|
+
|
|
395
|
+
</details>
|
|
396
|
+
|
|
397
|
+
## Development and releasing
|
|
398
|
+
|
|
399
|
+
Development uses Bun:
|
|
400
|
+
|
|
401
|
+
```shell
|
|
402
|
+
bun install
|
|
403
|
+
bun run test
|
|
404
|
+
bun run test:coverage
|
|
405
|
+
bun run test:examples # also validates every example against schemas/story.schema.json
|
|
406
|
+
bun run check:metadata
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
`bun run build:fallback` generates the copied-skill fallback CLI from the package entrypoint. After changing CLI source, rebuild it, check it is current, and confirm it runs under Node:
|
|
410
|
+
|
|
411
|
+
```shell
|
|
412
|
+
bun run build:fallback
|
|
413
|
+
bun run check:fallback
|
|
414
|
+
node skills/story-maintenance/scripts/story.js --help
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
The `evals/` harness regression-tests the writing skills. Fixtures seed a drafting brief with known canon and known traps. A dependency-free checker verifies that drafts keep the canon and spring none of the traps, a model runner (requires the `claude` CLI) drafts through a real model and judges for invented canon, and a pairwise comparison measures the skill against a no-skill baseline. See [`evals/README.md`](evals/README.md).
|
|
418
|
+
|
|
419
|
+
```shell
|
|
420
|
+
bun run check:evals # validate fixture schemas
|
|
421
|
+
bun run eval:selftest # checker self-test against known-good drafts
|
|
422
|
+
node evals/run-skill.js # full model run (needs Claude Code credentials)
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Every published change needs a new version in `package.json`, `.codex-plugin/plugin.json` (Codex's version source), `.claude-plugin/plugin.json` (Claude Code's), and `src/version.js` (printed by `story --version`), so installed users receive updates. Marketplace entries stay unversioned to avoid duplicate version state.
|
|
426
|
+
|
|
427
|
+
Don't bump these by hand. The release script bumps all four, rebuilds the fallback, runs the CI checks, commits `chore: release X.Y.Z`, tags `vX.Y.Z`, pushes, creates a GitHub release with generated notes, and publishes the package to npm. It requires a clean `main` that matches `origin/main`, a logged-in `gh`, and a logged-in `npm` (checked before anything changes):
|
|
428
|
+
|
|
429
|
+
```shell
|
|
430
|
+
bun run release patch # or minor, major, or an explicit version like 1.2.0
|
|
431
|
+
bun run release patch --dry-run # run the checks and print the plan without changing anything
|
|
432
|
+
bun run release patch --no-npm # release to GitHub only and skip the npm publish
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
Distribution metadata lives in `.claude-plugin/` for Claude Code and in `.codex-plugin/` plus `.agents/plugins/marketplace.json` for Codex. The `plugins/story-skills` symlink is intentional: Codex marketplace entries must point at a child plugin directory, so the symlink exposes the repo-root plugin without duplicating `skills/`.
|
|
436
|
+
|
|
437
|
+
## License
|
|
438
|
+
|
|
439
|
+
[MIT](LICENSE)
|
package/bin/story.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# First 20 Minutes With Story Skills
|
|
2
|
+
|
|
3
|
+
This walkthrough shows the complete loop: initialize, add story bible entities, draft a chapter shell, record scene continuity, check the project, and build exports.
|
|
4
|
+
|
|
5
|
+
## 0. Install Prerequisites
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
bun install
|
|
9
|
+
bun run story -- --help
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
All `story ...` commands below also run as `bun run story -- ...` from the repository checkout. For copied-skill installs without the package, use the bundled fallback: `node skills/story-maintenance/scripts/story.js --help`.
|
|
13
|
+
|
|
14
|
+
## 1. Start The Project
|
|
15
|
+
|
|
16
|
+
```shell
|
|
17
|
+
story init "The Tide Room" \
|
|
18
|
+
--genre mystery \
|
|
19
|
+
--sub-genre coastal \
|
|
20
|
+
--setting-era near-future \
|
|
21
|
+
--pov third-person-limited \
|
|
22
|
+
--tense past \
|
|
23
|
+
--theme truth \
|
|
24
|
+
--theme memory \
|
|
25
|
+
--synopsis "A diver finds a sealed room under a storm-damaged harbor."
|
|
26
|
+
cd the-tide-room
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 2. Add The First Story Elements
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
story add character "Mara Quill" --role protagonist
|
|
33
|
+
story add location "Bellwether Reef" --type landmark --character mara-quill
|
|
34
|
+
story add faction "Harbor Council" --type government --member mara-quill --location bellwether-reef
|
|
35
|
+
story add artifact "Signal Lantern" --type technology --owner mara-quill --location bellwether-reef
|
|
36
|
+
story add arc "The Hidden Signal" --type main --character mara-quill --theme truth
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 3. Add A Chapter And Scene Record
|
|
40
|
+
|
|
41
|
+
```shell
|
|
42
|
+
story add chapter "The Bell Under The Reef" \
|
|
43
|
+
--number 1 \
|
|
44
|
+
--pov mara-quill \
|
|
45
|
+
--location bellwether-reef \
|
|
46
|
+
--character mara-quill \
|
|
47
|
+
--arc the-hidden-signal
|
|
48
|
+
|
|
49
|
+
story add scene "Mara Finds The Lantern" \
|
|
50
|
+
--chapter chapter-01 \
|
|
51
|
+
--scene 1 \
|
|
52
|
+
--pov mara-quill \
|
|
53
|
+
--location bellwether-reef \
|
|
54
|
+
--character mara-quill \
|
|
55
|
+
--arc the-hidden-signal
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Write the chapter prose directly in `chapters/chapter-01.md`. Keep scene continuity notes in `scenes/chapter-01-scene-01.md`.
|
|
59
|
+
|
|
60
|
+
## 4. Track Promises And Questions
|
|
61
|
+
|
|
62
|
+
```shell
|
|
63
|
+
story add question "Who sealed the room?" --introduced chapter-01 --character mara-quill
|
|
64
|
+
story add promise "The lantern contains a warning" --planted chapter-01 --arc the-hidden-signal --character mara-quill
|
|
65
|
+
story add term "Signal Lantern" --category artifact --alias lantern
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 5. Run The Authoring Loop
|
|
69
|
+
|
|
70
|
+
```shell
|
|
71
|
+
story wordcount . --write
|
|
72
|
+
story reindex .
|
|
73
|
+
story links .
|
|
74
|
+
story validate .
|
|
75
|
+
story continuity .
|
|
76
|
+
story prose .
|
|
77
|
+
story next .
|
|
78
|
+
story doctor .
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Once the first chapter exists, fill in `style-sheet.md`: set `dialect: british` or `dialect: american`, add a `preferred` entry for each house spelling, and list the book's overused words under `watch-words`. `story prose .` then flags avoided spellings and reports filter words, adverbs, said-bookisms, echoes, sentence rhythm, and repeated phrases for every chapter.
|
|
82
|
+
|
|
83
|
+
Use `story next .` before a drafting session. Use `story doctor .` when something feels inconsistent or stale. Use `story continuity .` after every chapter to catch contradictions - dead characters reappearing, payoffs landing before their setup, stale story state - before a reader does.
|
|
84
|
+
|
|
85
|
+
## 6. Build The Manuscript
|
|
86
|
+
|
|
87
|
+
```shell
|
|
88
|
+
story export . --out manuscript.md
|
|
89
|
+
story build . --format markdown
|
|
90
|
+
story build . --format epub
|
|
91
|
+
story build . --format docx
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Before a real build, add the pages around the chapters and a cover:
|
|
95
|
+
|
|
96
|
+
```shell
|
|
97
|
+
story add matter "Dedication"
|
|
98
|
+
story add matter "Acknowledgments" --placement back
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Write each page's text in its `matter/` file, and set `heading: false` on the dedication so it prints without a title. Add `cover: cover.jpg` and `author: Your Name` to `story.md` so the EPUB carries a cover image and creator. Shunn manuscripts leave matter out.
|
|
102
|
+
|
|
103
|
+
The `dist/` outputs are disposable build artifacts. The source of truth remains the markdown project.
|
|
104
|
+
|
|
105
|
+
`story add` rebuilds the registries automatically, so there is no need to run `story reindex` after each add — reindex explicitly only after hand-editing files or renaming outside the CLI.
|
|
106
|
+
|
|
107
|
+
## 7. Go Further
|
|
108
|
+
|
|
109
|
+
- `git tag draft-1` (after committing) before a revision pass, then `story compare . --ref draft-1` to see which chapters the pass changed and by how much.
|
|
110
|
+
- `story progress . --log` after each session, with `target-words` and `deadline` in `story.md`, to track pace against the deadline.
|
|
111
|
+
- `story timeline .` to see dated scenes in story order, POV balance, and characters who drop out.
|
|
112
|
+
- `story add research "Topic" --used-in chapter-02` to record real-world facts with their sources.
|
|
113
|
+
|
|
114
|
+
- `story add clue "The torn page" --planted chapter-01 --payoff chapter-03` — track a plant/payoff pair alongside questions and promises.
|
|
115
|
+
- `story knowledge mara-quill --at chapter-01` — check what a character knew at a story point (from `knowledge-state` in `continuity/state.md`).
|
|
116
|
+
- `story synopsis --pages 1` — compress arcs into a mechanical 1-page synopsis (`--pages 3` for the longer form).
|
|
117
|
+
- `story series .` — once a sequel or prequel is linked with `story init "Book Two" --follows <path>`, order the books and check shared canon.
|
|
118
|
+
- `story migrate .` — upgrade an older project to the current schema.
|
|
119
|
+
- `continuity/exemptions.md` — log intentional findings (a `pattern` of at least 4 characters plus a `reason`); `story continuity` reports them as dismissed instead of errors.
|