write-chapter
You are running the write-chapter skill. Your job is to produce one
chapter of the book, in the declared language, faithful to every input in
the assembled context.
When to invoke
- "Write chapter N" / "next chapter" / "continue" / "escribe el capítulo N".
- The book has a finished
setup.md AND a plan/outline.md with a
non-empty beat sheet for the target chapter.
Hard rules
- Write in the language declared in
setup.md. Default Spanish (es).
- Write to the structural budget, not to a word count. An LLM cannot
count words while drafting; a numeric goal doesn't produce the number, it
produces padding — the filler your
style.md bans. Hit every beat in
the beat sheet — including its typed grounding beats (2-4 per chapter,
150-400 words each) — and length emerges from that. Nobody counts the
words — ever. By design the pipeline never measures generated length or
shows it back to the model: a visible count-vs-target breeds compensation
(padding this chapter, or "write more generously" leaking into the next).
Do not run wc, do not estimate your own length, do not report a count.
Deepening a chapter is the expand-chapter skill's job (need tests,
never length) — never hand-edit for length.
- Three beat types per chapter: plot, grounding (the outline's typed
texture beats), subtext. The chapter is not a list of events; it is a
lived experience — and the POV chooses at least once.
- Seed envelope is law. Every seed marked
plant/echo/payoff
in the bundle must land exactly as the envelope specifies. When the
envelope shows a seed's realized touches, rhyme with that wording.
- Never reveal shadow content directly. The shadow timeline is what
you, the writer, know. The POV knows only what their consciousness lets.
- Canon is sacred. Names, places, costs of magic, established
relationships — immutable. If something feels wrong, flag it to the
user before writing; do not contradict canon silently.
- Apply the bundle's Craft checklist (anti-patterns, dwelling, seeds)
and Style guide (§10) — both already in your context. Obey them; do
not re-derive the rules. The full
references/*.md files are for
on-demand depth only. On top of the style guide this skill enforces:
voice & distance match setup.md (default close third, past), and
POV constant within a chapter unless setup declares rotation.
- No invented continuity. If you need a fact canon lacks (a birth
town, a river's name), invent it and flag it in your output so
update-canon can promote it.
Steps
1. Build the context bundle
Run:
python3 .claude/skills/write-chapter/scripts/build_context.py \
--series-slug <slug> \
--book-number <N> \
--chapter <M>
This writes output/<series>/book-NN/notes/_context-chMM.md. It is the
only input you need — everything is assembled in deterministic
order:
- Setup (the book's identity)
1b. Decisions —
notes/decisions.md (book-level binding choices) plus
this chapter's gate decisions from plan-chapter
(notes/decisions-chMM.md). These OVERRIDE anything below that
conflicts. Honor them exactly; if a beat seems to contradict a locked
decision, stop and surface it rather than quietly choosing.
- Series context (if continuation)
- Canon (characters, factions, magic, world, timeline)
- Plan (outline + arcs)
- Shadow timeline slice for this chapter (writer-only)
- Seed envelope (exact seeds to plant/echo/payoff)
- Story so far (hierarchical summaries)
- Continuity seam — previous chapter's summary + its final scene verbatim
- Chapter beat sheet — your specific instruction
- Style guide (this book's own
style.md)
- Craft references (anti-patterns, dwelling, seed-craft)
Read this file in full. Do not skim. The beat sheet at section 9 is
the contract for this chapter.
2. Refuse if the beat sheet is empty
If the chapter's section 9 contains only > TODO: lines, stop.
Tell the user the chapter has no plan and ask them to run plan-book
or fill in the beats by hand. Do not write a chapter from imagination.
2b. Pre-write consistency check (last cheap gate)
plan-chapter already ran the deep gate and locked the forks. This is
the final quick pass before 10 000 words land on top of a problem — keep
the adversarial bias, not the length. Scan the beat sheet once against:
- Shadow — does a beat require the POV to know what shadow keeps hidden?
- Seed envelope — can each seed actually be planted/echoed/paid given POV,
location, events?
- Arcs — is the POV's arc state compatible with the beats?
- Canon / grimoire — any named character, place, magic detail contradicting
canon/* or the grimoire?
- Motivation — can the POV want each beat with only what they know now?
- Tone & pacing — register matches
setup §Prose constraints; not two same
-register chapters back to back.
If anything surfaces, STOP — do not draft. Quote the exact lines, say why it
matters dramatically, offer 2-3 options (including revising the plan file,
not just the chapter — the author may change the story at any point), and wait.
If the author overrules a flag, proceed but record it in notes/decisions.md.
If clean, say so ("consistency check clean — proceeding to draft") and continue.
3. Write the chapter
Open output/<series>/book-NN/chapters/<NN>.md for writing.
Overwrite guard (check ONCE, before block 1). If the file already exists
with substantial prose (>500 words) AND has uncommitted changes (git status --porcelain -- <file> is non-empty), STOP and ask the author before
regenerating — a rewrite would destroy unversioned prose. If the file is
committed (recoverable) or trivial, proceed. The per-block appends below are the
same session extending its own draft, so they do not re-trigger this guard.
Structure:
# Capítulo N — <Title>
<prose>
Heading uses the language declared in setup (Capítulo / Chapter).
The chapter is all prose after the heading. No subheadings inside
the chapter unless the user has declared a sectioned format.
Drafting plan inside your head before writing:
- Decide the opening. Not "X woke up". Not battle. Start in the
middle of an action that reveals who the POV is and what they care
about. Use a non-visual sense (smell, sound, touch, taste) if it
fits — see
dwelling-techniques.md.
- Plan the grounding beats first. Where will the 2-4 grounding
moments sit, and which licensed type is each (world unfolded in use,
stage built, cost made visible, deliberation, re-orientation,
secondary humanized)? They should be load-bearing — a labor watched
working, a room the scene will use, a price felt. Lingering with no
type is not a beat.
- Lay plot beats around the grounding. A plot beat is a hinge:
decision, conflict, revelation. Between hinges, the world breathes —
and the POV chooses at least once per chapter (see the sliding
scales block in
plan/arcs.md); wins arrive only over paid failures.
- Plant subtext. What does the POV feel but not say? What lie are
they protecting in this scene? This is where seeds embed naturally.
- Bring in the seed envelope. Plant seeds inside scenes already
underway. Echo seeds in a different sensory register. Pay off
without explaining.
- End on the transition out specified in the beat sheet.
Draft in 2-4 sequential scene blocks, not one pass. A chapter of 8-12k
words is past the length where a single generation holds quality — the beats
land, the pacing keeps, the voice stays honest at the start and then decays, and
the close (the documented highest-risk zone) gets the tiredest prose. Partition
the beat sheet into blocks of 1-3 beats each (a block = one scene, or two
tightly-coupled scenes; a long beat sheet is still 2-4 blocks, never one per
beat). Then, for each block:
- Re-read, in the bundle (
notes/_context-chNN.md), these named sections:
the Chapter N — beat sheet, the Voice spine, and the Continuity
contract (if present). This re-read is mandatory between blocks — it resets
the instruction adherence a long generation erodes. Re-read the sections; do
not write from memory of them.
- Re-read the last 2-3 paragraphs you just wrote (the intra-chapter seam)
so the new block continues the live voice, not a remembered one.
- Draft the block's beats plus its share of the outline's typed grounding
beats, and land the block on a scene turn, not a summary.
- Append to
chapters/NN.md (Edit tool). Do not revise earlier blocks
while drafting — polish is revise-chapter's job, not this pass's.
After the final block, do one continuity read of the whole chapter for seams
between blocks — a repeated description, a dropped object, a time skip — and fix
only those seam defects. (A heavier subagent variant of this block flow —
chapter-smith — is recorded in IMPROVEMENT-PLAN.md T20; this in-session flow
is the current standard.)
4. Hand to the grounding pass — no length check
There is deliberately no word-count verification step. Every chapter gets
one expand-chapter grounding pass regardless (need tests, not length), and
only the critique's structural findings can motivate more work after that:
- Under
write-novel, the orchestrator's step 2c runs the mandatory
expand-chapter grounding pass. Just stop after writing.
- Standalone, recommend
expand-chapter as the next step (never
hand-edit the prose — that skips the EXPAND markers and the per-pass
caps; at most 2 passes per chapter).
5. Report
Print to the user:
- Chapter number, title.
- One-sentence summary of what happened (visible plot).
- Seeds planted / echoed / paid off in this chapter (by id).
- Any canon facts you invented while drafting that need promotion
(e.g., "I named the river Soral — promote to canon/world.md").
- Suggested next step:
critique-chapter <N> for a hard read
update-canon <N> to fold the chapter into summaries + canon
write-chapter <N+1> to keep going
6. Hand off
Do not automatically run update-canon. The user decides whether
this chapter is good enough to lock in. They will tell you when to
move on.
What this skill does NOT do
- Does not modify
plan/, canon/, or summaries/. Only writes the
chapter file and reads the context bundle.
- Does not auto-update seed status. That happens in
update-canon.
- Does not invent characters, places, or magic rules. It uses what
canon and plan say, and flags any gap.
Files this skill writes
output/<series>/book-NN/chapters/<NN>.md — the chapter.
output/<series>/book-NN/notes/_context-ch<NN>.md — the assembled
context bundle (regeneratable; safe to delete after the chapter is
accepted).
1---2name: write-chapter3description: Write a single chapter of the book in the declared language, writing to the structural budget (every beat in the beat sheet; length is never counted), using the assembled deterministic context (setup + canon + plan + shadow + seed envelope + recent chapters). Use this when the user says "write chapter N", "next chapter", or "continue". Refuses if the chapter's outline beat sheet is empty.4---56# write-chapter78You are running the **write-chapter** skill. Your job is to produce one9chapter of the book, in the declared language, faithful to every input in10the assembled context.1112## When to invoke1314- "Write chapter N" / "next chapter" / "continue" / "escribe el capítulo N".15- The book has a finished `setup.md` AND a `plan/outline.md` with a16 non-empty beat sheet for the target chapter.1718## Hard rules1920- **Write in the language declared in `setup.md`.** Default Spanish (`es`).21- **Write to the structural budget, not to a word count.** An LLM cannot22 count words while drafting; a numeric goal doesn't produce the number, it23 produces padding — the filler your `style.md` bans. Hit **every beat in24 the beat sheet** — including its typed grounding beats (2-4 per chapter,25 150-400 words each) — and length emerges from that. **Nobody counts the26 words — ever.** By design the pipeline never measures generated length or27 shows it back to the model: a visible count-vs-target breeds compensation28 (padding this chapter, or "write more generously" leaking into the next).29 Do not run `wc`, do not estimate your own length, do not report a count.30 Deepening a chapter is the **`expand-chapter` skill**'s job (need tests,31 never length) — never hand-edit for length.32- **Three beat types per chapter:** plot, grounding (the outline's typed33 texture beats), subtext. The chapter is not a list of events; it is a34 lived experience — and the POV chooses at least once.35- **Seed envelope is law.** Every seed marked `plant`/`echo`/`payoff`36 in the bundle must land exactly as the envelope specifies. When the37 envelope shows a seed's *realized* touches, rhyme with that wording.38- **Never reveal shadow content directly.** The shadow timeline is what39 *you*, the writer, know. The POV knows only what their consciousness lets.40- **Canon is sacred.** Names, places, costs of magic, established41 relationships — immutable. If something feels wrong, *flag it to the42 user* before writing; do not contradict canon silently.43- **Apply the bundle's Craft checklist** (anti-patterns, dwelling, seeds)44 and **Style guide** (§10) — both already in your context. Obey them; do45 not re-derive the rules. The full `references/*.md` files are for46 on-demand depth only. On top of the style guide this skill enforces:47 **voice & distance** match `setup.md` (default close third, past), and48 **POV constant within a chapter** unless setup declares rotation.49- **No invented continuity.** If you need a fact canon lacks (a birth50 town, a river's name), invent it and *flag it* in your output so51 `update-canon` can promote it.5253## Steps5455### 1. Build the context bundle5657Run:5859```bash60python3 .claude/skills/write-chapter/scripts/build_context.py \61 --series-slug <slug> \62 --book-number <N> \63 --chapter <M>64```6566This writes `output/<series>/book-NN/notes/_context-chMM.md`. It is the67**only** input you need — everything is assembled in deterministic68order:69701. Setup (the book's identity)711b. **Decisions** — `notes/decisions.md` (book-level binding choices) plus72 this chapter's gate decisions from `plan-chapter`73 (`notes/decisions-chMM.md`). These OVERRIDE anything below that74 conflicts. Honor them exactly; if a beat seems to contradict a locked75 decision, stop and surface it rather than quietly choosing.762. Series context (if continuation)773. Canon (characters, factions, magic, world, timeline)784. Plan (outline + arcs)795. Shadow timeline slice for this chapter (writer-only)806. Seed envelope (exact seeds to plant/echo/payoff)817. Story so far (hierarchical summaries)828. Continuity seam — previous chapter's summary + its final scene verbatim839. **Chapter beat sheet — your specific instruction**8410. Style guide (this book's own `style.md`)8511. Craft references (anti-patterns, dwelling, seed-craft)8687Read this file in full. Do not skim. The beat sheet at section 9 is88the contract for this chapter.8990### 2. Refuse if the beat sheet is empty9192If the chapter's section 9 contains only `> TODO:` lines, **stop**.93Tell the user the chapter has no plan and ask them to run `plan-book`94or fill in the beats by hand. Do not write a chapter from imagination.9596### 2b. Pre-write consistency check (last cheap gate)9798`plan-chapter` already ran the deep gate and locked the forks. This is99the final quick pass before 10 000 words land on top of a problem — keep100the adversarial bias, not the length. Scan the beat sheet once against:101102- **Shadow** — does a beat require the POV to know what shadow keeps hidden?103- **Seed envelope** — can each seed actually be planted/echoed/paid given POV,104 location, events?105- **Arcs** — is the POV's arc state compatible with the beats?106- **Canon / grimoire** — any named character, place, magic detail contradicting107 `canon/*` or the grimoire?108- **Motivation** — can the POV *want* each beat with only what they know now?109- **Tone & pacing** — register matches `setup §Prose constraints`; not two same110 -register chapters back to back.111112If anything surfaces, **STOP — do not draft.** Quote the exact lines, say why it113matters *dramatically*, offer 2-3 options (including revising the **plan file**,114not just the chapter — the author may change the story at any point), and wait.115If the author overrules a flag, proceed but record it in `notes/decisions.md`.116If clean, say so ("consistency check clean — proceeding to draft") and continue.117118### 3. Write the chapter119120Open `output/<series>/book-NN/chapters/<NN>.md` for writing.121122**Overwrite guard (check ONCE, before block 1).** If the file already exists123with substantial prose (>500 words) AND has uncommitted changes (`git status124--porcelain -- <file>` is non-empty), **STOP and ask the author** before125regenerating — a rewrite would destroy unversioned prose. If the file is126committed (recoverable) or trivial, proceed. The per-block appends below are the127same session extending its own draft, so they do not re-trigger this guard.128129Structure:130131```markdown132# Capítulo N — <Title>133134<prose>135```136137Heading uses the language declared in setup (`Capítulo` / `Chapter`).138The chapter is **all prose** after the heading. No subheadings inside139the chapter unless the user has declared a sectioned format.140141Drafting plan inside your head before writing:1421431. **Decide the opening.** Not "X woke up". Not battle. Start in the144 middle of an action that reveals who the POV is and what they care145 about. Use a non-visual sense (smell, sound, touch, taste) if it146 fits — see `dwelling-techniques.md`.1472. **Plan the grounding beats first.** Where will the 2-4 grounding148 moments sit, and which licensed type is each (world unfolded in use,149 stage built, cost made visible, deliberation, re-orientation,150 secondary humanized)? They should be load-bearing — a labor watched151 working, a room the scene will use, a price felt. Lingering with no152 type is not a beat.1533. **Lay plot beats around the grounding.** A plot beat is a hinge:154 decision, conflict, revelation. Between hinges, the world breathes —155 and the POV *chooses* at least once per chapter (see the sliding156 scales block in `plan/arcs.md`); wins arrive only over paid failures.1574. **Plant subtext.** What does the POV feel but not say? What lie are158 they protecting in this scene? This is where seeds embed naturally.1595. **Bring in the seed envelope.** Plant seeds inside scenes already160 underway. Echo seeds in a different sensory register. Pay off161 without explaining.1626. **End on the transition out** specified in the beat sheet.163164**Draft in 2-4 sequential scene blocks, not one pass.** A chapter of 8-12k165words is past the length where a single generation holds quality — the beats166land, the pacing keeps, the voice stays honest at the start and then decays, and167the close (the documented highest-risk zone) gets the tiredest prose. Partition168the beat sheet into blocks of **1-3 beats each** (a block = one scene, or two169tightly-coupled scenes; a long beat sheet is still 2-4 blocks, never one per170beat). Then, for **each block**:1711721. **Re-read, in the bundle (`notes/_context-chNN.md`), these named sections:**173 the *Chapter N — beat sheet*, the *Voice spine*, and the *Continuity174 contract* (if present). This re-read is mandatory between blocks — it resets175 the instruction adherence a long generation erodes. Re-read the sections; do176 not write from memory of them.1772. **Re-read the last 2-3 paragraphs you just wrote** (the intra-chapter seam)178 so the new block continues the live voice, not a remembered one.1793. **Draft the block's beats** plus its share of the outline's typed grounding180 beats, and land the block on a scene turn, not a summary.1814. **Append to `chapters/NN.md`** (Edit tool). Do **not** revise earlier blocks182 while drafting — polish is `revise-chapter`'s job, not this pass's.183184After the final block, do **one continuity read of the whole chapter** for seams185between blocks — a repeated description, a dropped object, a time skip — and fix186only those seam defects. (A heavier subagent variant of this block flow —187`chapter-smith` — is recorded in `IMPROVEMENT-PLAN.md` T20; this in-session flow188is the current standard.)189190### 4. Hand to the grounding pass — no length check191192There is deliberately **no word-count verification step**. Every chapter gets193one `expand-chapter` grounding pass regardless (need tests, not length), and194only the critique's structural findings can motivate more work after that:195196- Under **`write-novel`**, the orchestrator's step 2c runs the mandatory197 `expand-chapter` grounding pass. Just stop after writing.198- **Standalone**, recommend `expand-chapter` as the next step (never199 hand-edit the prose — that skips the `EXPAND` markers and the per-pass200 caps; at most 2 passes per chapter).201202### 5. Report203204Print to the user:205206- Chapter number, title.207- One-sentence summary of what happened (visible plot).208- Seeds planted / echoed / paid off in this chapter (by id).209- Any canon facts you invented while drafting that need promotion210 (e.g., "I named the river *Soral* — promote to canon/world.md").211- Suggested next step:212 - `critique-chapter <N>` for a hard read213 - `update-canon <N>` to fold the chapter into summaries + canon214 - `write-chapter <N+1>` to keep going215216### 6. Hand off217218Do **not** automatically run `update-canon`. The user decides whether219this chapter is good enough to lock in. They will tell you when to220move on.221222## What this skill does NOT do223224- Does not modify `plan/`, `canon/`, or `summaries/`. Only writes the225 chapter file and reads the context bundle.226- Does not auto-update seed status. That happens in `update-canon`.227- Does not invent characters, places, or magic rules. It uses what228 canon and plan say, and flags any gap.229230## Files this skill writes231232- `output/<series>/book-NN/chapters/<NN>.md` — the chapter.233- `output/<series>/book-NN/notes/_context-ch<NN>.md` — the assembled234 context bundle (regeneratable; safe to delete after the chapter is235 accepted).