write-chapter

A command for drafting a chapter from an outline and updating the project's existing story-tracking documents afterward.

In plain words
What is it for?
It helps write the next chapter or a specified chapter, check that an outline exists, record scene and canon changes, track story threads, and maintain voice and setting details.
Why use it?
It connects chapter writing with continuity and planning records, helping new scenes fit the established manuscript.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/third-order-labs/longform-plugin/write-chapter
Clone the repo
git clone --depth 1 https://github.com/third-order-labs/longform-plugin
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,759 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00022 $0.02759
Opus 5 $0.00011 $0.01380
Sonnet 5 $0.00004 $0.00552
Haiku 4.5 $0.00002 $0.00276

Measured yesterday against content hash 5cdc0f645815, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

write-chapter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/write-chapter.md · 181 lines

How it starts

The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/write-chapter — Draft a Chapter

The core workflow loop. Draft a chapter from its outline, then update whatever tracking documents exist and assess whether the project needs new ones. This is where manuscript and infrastructure grow together — the documents earn their existence through the work.

Invocation

/write-chapter
/write-chapter next
/write-chapter 12
/write-chapter "The Crossing"

Skills Referenced

  • long-form-methodology — workflow loop, document hierarchy, living document philosophy
  • continuity-management — scene log format, canon updates, glossary management
  • narrative-craft — thread awareness, foreshadowing recognition
  • scene-craft — lived-in texture, dialogue craft, POV discipline
  • authorial-voice — voice filtering and observation

Workflow

Step 1: Load the Chapter Outline

Locate the outline:

  • If the user specifies a chapter, find the matching file in outlines/book-X/
  • If "next" or no argument, find the next unwritten outline (compare outlines to existing draft files)
  • If no outline exists, inform the user: "No outline found for this chapter. Run /plan-chapter first, or describe what you want this chapter to do and we'll work through it."

Read the full outline.

Step 2: Load What Exists

Check what documents the project currently has and read whatever is available. Not all of these will exist — especially in early chapters. Use what's there, note what's missing, don't fail.

Always exists (from /start-project):

  • docs/07-continuity.md — current canon; do not contradict
  • docs/03-characters.md — character profiles and arc directions
  • docs/00-pitch.md — what the story is about

May exist — read if present:

  • docs/06-scene-log.md — recent entries for narrative context (last 2-3)
  • docs/08-voice.md — authorial consciousness and character voice profiles
  • docs/05-glossary.md — correct names, terms, spellings
  • docs/25-style-guide.md — prose register, POV, tense, length targets
  • docs/13-threads.md — active thread tracking
  • docs/19-foreshadowing-checklist.md — seeds to plant
  • docs/02-world.md — world reference
  • docs/04-outline.md — series/book-level structural context
  • Any other project-specific tracking docs that have been created

Read the full file on GitHub · 181 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 181 lines · 22 tokens per session scan A 5cdc0f645815

Subscribe to this mod's changes

write-chapter is a command published in the GitHub repository third-order-labs/longform-plugin (2 stars, last pushed 1mo ago), licensed MIT. It adds 22 tokens to every session and 2,759 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.