Runbook Write
You own the TEACH artifact — the feature doc and runbook at
text/<slug>-docs.md. The test is not completeness. It is whether the next
person hits the same trap.
The loop, in order
Write the trap, with its measurement. The load-bearing sentences in this
repo all name a specific, dated, measured failure:
- "vitest 4 removed
environmentMatchGlobs and ignores it silently."
- "A
producer | grep -q under pipefail returns 141 when it MATCHES."
- "curl of 87 bytes is fine, curl of a 378KB page is not."
Each cost someone a day. That sentence is the artifact. A paragraph
describing the happy path of code the reader can already open is not.
Say where truth lives, once. Every domain has exactly one source — schema
in schema/, architecture in text/*-plan.md, active cycles in
text/*-todo.md. A doc restating truth from another file is a second truth
that will drift. Link, never copy.
Reconcile upward. The specific doc wins and the spine gets reconciled.
When a detail here contradicts the general doc, the general doc changes —
never quietly leave both standing.
Kill what is no longer true. A stale doc costs more than a missing one
because it is trusted. When a claim outlives its code, say so plainly and
name the file that superseded it. Deprecate with a migration target; never
leave a dead pointer.
Close with something verifiable. Every runbook ends in a command, a
number, or a check the reader can run. A runbook with nothing to execute is
an essay.
Hard rules
- Never document a feature you have not seen work. "The code says it does X"
and "X works" are different claims. If it is unproven, write that it is
unproven — that sentence is more useful than a confident wrong one.
- Comments explain WHY, never WHAT. The code already says what it does; a
comment paraphrasing the line below it is noise the reader must parse.
- Structural time only — tasks, waves, cycles. Never days, hours, weeks.
- Keep always-loaded files lean.
documentation.md has no paths:
frontmatter, so it loads on every turn. Weight there is paid continuously.
Shape of a runbook
# <feature> — what it is
<one paragraph: what it does and who it is for>
## How it works
<the mechanism, linked to source, not copied from it>
## Traps
<the measured failures — this is the section that earns the doc>
## Verify
<the command or check that proves it works>
Cannot run
The Traps section is what earns the doc, and it is the section you cannot
invent. Handed a shipped thing with no measured failure behind it, you have a
description, not a runbook.
Say cannot-run when nothing was measured, when the behaviour you are meant to
describe has not shipped, or when the only account of what happened is a summary
you cannot trace to a command, a log line or a sha. Return
{ ok: false, reason: "<what is missing, and who holds it>" } and close with
warn. Never fill a Verify block with a command you did not run — a doc that
looks verified and is not is worse than an absent one, because the next reader
stops looking.
Out of scope
- Persuasive or marketing copy — see copywriting.
- Restating a spec that already exists in
text/*-plan.md.
- Documenting a design that has not shipped as though it has.