You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add continuity engine, manuscript import, and PR automation templates
- New src/continuity.js: deterministic continuity checks wired into a new
'story continuity' command and folded into doctor, report, and next.
Catches dead characters appearing after their died-in chapter, payoffs
before plants, questions resolved before introduced, unfired Chekhov
promises, POV/cast mismatches, chapter numbering gaps, completion-state
contradictions, and broken continuity/state.md references.
- New schema fields: optional character died-in, and chapter/scene mentions
for posthumous or flashback references that should stay legal.
- New src/import.js: 'story import' splits an existing manuscript (file or
directory) into a new project with accurate word counts and registries,
and prints recurring proper-name candidates for bible building.
- New examples/the-unraveled-thread: deliberately broken project whose
exact findings are asserted by check-examples.js, doubling as the README
demo and a regression test. Harbor example enriched with populated
continuity state, a planted promise, and an open question.
- New templates/github: story-checks.yml CI for story repos and
draft-next-chapter.yml for writing a book via scheduled chapter PRs.
- CLI failure summaries now use a failure message instead of repeating the
success message. Docs, skills, JSON schema updated; version 0.3.0.
https://claude.ai/code/session_01XVwAnE2xRMVd7CZR4MrSU1
Copy file name to clipboardExpand all lines: .claude-plugin/plugin.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "story-skills",
3
-
"version": "0.2.1",
3
+
"version": "0.3.0",
4
4
"description": "A suite of cross-referenced skills and CLI maintenance tools for end-to-end story writing powered by markdown. Covers story initialization, character management, worldbuilding, plot structure, chapter writing, revision, validation, reporting, indexing, word counts, and manuscript export.",
Copy file name to clipboardExpand all lines: .codex-plugin/plugin.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "story-skills",
3
-
"version": "0.2.1",
3
+
"version": "0.3.0",
4
4
"description": "A suite of cross-referenced skills and CLI maintenance tools for end-to-end story writing powered by markdown. Covers story initialization, character management, worldbuilding, plot structure, chapter writing, revision, validation, reporting, indexing, word counts, and manuscript export.",
Copy file name to clipboardExpand all lines: README.md
+46-2Lines changed: 46 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@
6
6
7
7
Story Skills gives agents a shared project format for fiction: a story bible, character files, worldbuilding notes, factions, artifacts, plot arcs, scene state, continuity questions, promises/payoffs, timelines, and chapter drafts. Everything is plain markdown with YAML frontmatter, packaged as standard Agent Skills with Codex and Claude Code plugin support.
8
8
9
+
The companion CLI treats the story bible as a checkable contract: a **continuity engine** catches dead characters walking, payoffs that land before their setup, unfired Chekhov guns, and stale story state — deterministically, before a reader ever could.
Then ask **"Start a new story"** to scaffold the project.
42
44
45
+
## 🔎 The Continuity Engine
46
+
47
+
Long-range consistency is the thing language models are worst at and prompts cannot fix. Story Skills makes it deterministic: character deaths, promises/payoffs, open questions, scene casts, and durable knowledge/object state live in frontmatter, and `story continuity` treats contradictions like a compiler treats type errors.
48
+
49
+
[`examples/the-unraveled-thread/`](examples/the-unraveled-thread/) is a deliberately broken mystery. It passes `story validate` and `story links` cleanly — every file is well-formed — but the story itself doesn't hold together:
50
+
51
+
```text
52
+
$ story continuity examples/the-unraveled-thread
53
+
Continuity check failed: 4 errors, 3 warnings
54
+
error: chapters/chapter-04.md lists edran-vale, who died in chapter-02; move posthumous appearances to mentions
55
+
error: continuity/promises/the-broken-compass.md pays off in chapter-02 before it is planted in chapter-03
56
+
error: continuity/questions/who-burned-the-mill.md resolves in chapter-02 before it is introduced in chapter-03
warning: chapters/chapter-03.md POV character nessa-thorn is not listed in characters
59
+
warning: continuity/promises/the-sealed-letter.md was planted in chapter-01, 3 chapters ago, and has no payoff yet
60
+
warning: continuity/state.md object-state[0] status active conflicts with worldbuilding/artifacts/vales-compass.md status destroyed
61
+
```
62
+
63
+
These findings are exact, file-addressed, and reproducible — CI asserts them on every commit. Intentional flashbacks and posthumous appearances stay legal via the chapter `mentions` field. `story doctor` and `story next` fold the same checks into prioritized repair actions.
64
+
43
65
## ✍️ Highly Recommended: Better Writing
44
66
45
67
For stronger chapter drafts and revision passes, install [forjd/better-writing](https://github.com/forjd/better-writing) alongside Story Skills. It adds voice calibration, anti-generic writing checks, and a final prose-quality pass.
@@ -225,7 +247,7 @@ For non-agent use:
225
247
|**plot-structure**| Plans arcs with structures like three-act, hero's journey, Save the Cat, and kishotenketsu |*"Create a plot arc"*|
226
248
|**chapter-writing**| Drafts chapters through an outline-first workflow that pulls from story context |*"Write the next chapter"*|
227
249
|**revision-continuity**| Revises drafts, audits continuity, and keeps character state, timeline, and arc changes consistent |*"Continuity-check chapter 3"*|
228
-
|**story-maintenance**| Runs deterministic CLI checks for validation, reports, indexing, links, word counts, and export |*"Validate my story project"*|
250
+
|**story-maintenance**| Runs deterministic CLI checks for validation, continuity, reports, indexing, links, word counts, import, and export |*"Validate my story project"*|
229
251
230
252
For stronger prose, pair **chapter-writing** with [**better-writing**](https://github.com/forjd/better-writing).
231
253
@@ -253,6 +275,8 @@ The CLI is for deterministic maintenance only. Agents should write story content
253
275
|`story reindex [path]`| Rebuild registry tables from the current markdown files |
254
276
|`story wordcount [path] --write`| Count chapter prose and update chapter frontmatter plus the chapter registry |
A story project with deterministic checks is a story project an agent can advance unattended. The [`templates/github/`](templates/github/) workflows turn a story repository into a self-drafting book:
308
+
309
+
-[`story-checks.yml`](templates/github/story-checks.yml) runs `story validate`, `story links`, and `story continuity` on every push and pull request, so a chapter PR cannot merge with a continuity contradiction.
310
+
-[`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 deterministic 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.
311
+
312
+
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 per morning.
313
+
314
+
## 📥 Import An Existing Manuscript
315
+
316
+
Most writers don't start from a blank page. `story import` reverse-engineers a Story Skills project from work in progress:
317
+
318
+
```shell
319
+
story import draft.md --title "The Lost Coast" --genre mystery
320
+
```
321
+
322
+
It splits the manuscript on chapter headings (or imports a directory of chapter files), 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.
323
+
281
324
## 📁 Project Structure
282
325
283
326
Running **story-init** creates this layout:
@@ -328,7 +371,8 @@ Every story element is a markdown file with YAML frontmatter. The skills cross-r
328
371
329
372
- Read [**The Cormorant Tide**](https://github.com/danjdewhurst/the-cormorant-tide), a full story project generated with Story Skills.
330
373
- Explore [`examples/the-last-ember/`](examples/the-last-ember/) for a complete fantasy example: three characters, two locations, a magic system, a plot arc with foreshadowing, and a drafted first chapter.
331
-
- Explore [`examples/harbor-of-second-light/`](examples/harbor-of-second-light/) for a near-future coastal mystery example with memory technology, a posthumous witness arc, and a drafted first chapter.
374
+
- Explore [`examples/harbor-of-second-light/`](examples/harbor-of-second-light/) for a near-future coastal mystery example with memory technology, a posthumous witness arc, populated continuity state, and a drafted first chapter.
375
+
- Explore [`examples/the-unraveled-thread/`](examples/the-unraveled-thread/) for a deliberately broken project that demonstrates every class of finding the continuity engine reports.
Copy file name to clipboardExpand all lines: docs/first-20-minutes.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,11 +63,12 @@ story wordcount . --write
63
63
story reindex .
64
64
story links .
65
65
story validate .
66
+
story continuity .
66
67
story next .
67
68
story doctor .
68
69
```
69
70
70
-
Use `story next .` before a drafting session. Use `story doctor .` when something feels inconsistent or stale.
71
+
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.
Optional scalar: `died-in`, the chapter id in which the character dies on the page. Set it together with `status: deceased`; `story continuity` then errors on appearances in later chapters. Characters who died before chapter 1 should use `status: deceased` without `died-in`.
51
+
49
52
### Worldbuilding
50
53
51
54
Locations require `name` and `type`. Systems require `name` and `type`.
@@ -60,14 +63,22 @@ Arcs require `name`, `type`, and `status`; they may list `characters`, `themes`,
60
63
61
64
### Chapters And Scenes
62
65
63
-
Chapters require `title`, `number`, and `status`; optional reference lists are `locations`, `characters`, and `arcs-advanced`.
66
+
Chapters require `title`, `number`, and `status`; optional reference lists are `locations`, `characters`, `mentions`, and `arcs-advanced`.
67
+
68
+
Scenes require `title`, `chapter`, `scene`, and `status`. Scenes carry machine-readable continuity fields: `pov`, `location`, `characters`, `mentions`, `arcs-advanced`, and `state-changes`.
64
69
65
-
Scenes require `title`, `chapter`, `scene`, and `status`. Scenes carry machine-readable continuity fields: `pov`, `location`, `characters`, `arcs-advanced`, and `state-changes`.
70
+
`characters` means present in-scene. `mentions` means referenced, remembered, recorded, or seen in flashback; deceased characters may appear there without triggering continuity errors.
66
71
67
72
### Continuity
68
73
69
74
`continuity/state.md` stores `current-chapter`, `character-state`, `object-state`, and `knowledge-state`.
70
75
76
+
State entries are lists of mappings checked by `story continuity`:
77
+
78
+
-`character-state` entries reference an existing `character` and optionally a `location`, plus free-form `physical`, `emotional`, and `knowledge` notes.
79
+
-`object-state` entries reference an existing `artifact`, an optional `owner` (character or faction), an optional `location`, and a `status` that must agree with the artifact file.
80
+
-`knowledge-state` entries reference an existing `character`, a non-empty `knows` fact, and an optional `learned-in` chapter id.
81
+
71
82
Questions require `title` and `status`; optional chapter references are `introduced` and `resolved`.
72
83
73
84
Promises require `title` and `status`; optional chapter references are `planted` and `payoff`.
The bell under Bellwether Reef rang on its own when the storm cracked the sealed chamber. Theo built it as a failsafe: if the bell rings, the archive is live again.
18
+
19
+
## Payoff
20
+
21
+
A later chapter must reveal what the failsafe was meant to summon - and who else heard the bell.
Theo's recording says the Afterimage Archive was active during the Blackout Night. Twelve residents died and Theo took the blame. What was the archive doing, and on whose orders?
17
+
18
+
## Evidence
19
+
20
+
- The sealed chamber under Bellwether Reef carries Harbor Authority plating.
21
+
- Theo's recording was hidden before his death and addressed to Mara.
22
+
- Councillor Venn controls the archive-keeper appointments.
23
+
24
+
## Resolution Plan
25
+
26
+
Resolve once Mara confronts Venn with the lantern's contents.
0 commit comments