← Skills

runbook-write

runbook-write

When an agent or user needs a feature doc, runbook, or technical explanation written or a stale one found. Also use when the user says "document this," "write the runbook," "explain how this works," "is this doc still true," "update the docs," "what does the next person need to know," or "write it up." Use this whenever the deliverable is durable prose about a system. For marketing copy, see copywriting. For deciding a design, see architecture-review.

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

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.