/document: Documentation sweep (TDD step 8)
Bring all documentation touched by the change up to date. Commits are blocked until this step completes.
When to run
- Previous step:
/review-step(review clean). - Next step: none (the workflow ends here with branch + PR).
- Gate (exit): full sweep complete and final
vp run checkgreen. No commit until then. Then branch + PR; never push tomain.
Scope: everything touched by the change
- JSDoc on all new/changed exported functions, types, and values (created in
/mock; verify present and accurate now). Self-evident exports get exactly one line; doc blocks ≤ 3 lines for typical functions; no@exampleunless usage isn't inferable from the signature/name; no em-dashes. Omit@typeannotations; describe non-obvious parameters; annotate Effect Schemas when not self-explanatory. specs.mdsync: the spec must reflect final behavior. If implementation legitimately changed details (via the pause rule), the spec already says so; verify. Acceptance criteria, skip records, and edge cases must match reality.docs/pages and package READMEs: update or create when the public API surface of a package changed.docs/follows the Diátaxis framework (tutorial/,how-to/,reference/,explanation/). Each page fits exactly one mode; theweft-docs-authoragent carries the placement rules.- Example
readme.mdfor every touchedexamples/*package. Must contain the required sections: Overview, Problem, Solution, How It Works, When to Use.
Authorship split
- Prose documentation (
docs/pages, package READMEs, example readmes, conceptual guides): spawn theweft-docs-authoragent (defined in.claude/agents/weft-docs-author.md). Give it the feature'sspecs.mdpath, the changed files, and the doc targets. It grounds itself in source before writing and never documents unverified APIs. - JSDoc +
specs.mdsync: done by the main thread directly (it holds the implementation context). - Fallback: if the agent is unavailable, the main thread writes the prose docs itself following the rules in
.claude/agents/weft-docs-author.md.
Procedure
- Inventory the diff: list changed exports, packages with public-API changes, touched examples.
- Main thread: verify/complete JSDoc; sync
specs.md. - Spawn
weft-docs-authorfor the prose targets from the inventory; review its output against the source (no invented APIs, no JSX-isms, required readme sections present). - Run
vp run check: formats and lints the JSDoc and markdown. Must be green. - Create a branch, commit, open a PR. Never push to
main.
Rules
- Documentation is a hard gate: a feature without its docs sweep is not committable.
- All prose follows the "Docs Prose Style" rules in
CLAUDE.md(sentence length cap, no em-dashes, paragraph cadence, bullets over long prose lists, metaphor allowance). - Docs must match the source: every claim verifiable, code samples follow Oxfmt conventions (tabs, double quotes) and Effect idioms, no
<Component/>-style JSX in any sample.