Writing Styleguide
Prose rules for everything BoB authors — GitHub issues, commit messages, PR descriptions, journal entries, code comments, and docs. Each rule is short and concrete enough to apply mid-write and check against after. Cite a rule by its ID (
WS-1) instead of restating the style inline. (Back to reference index.)
This is reference mode — look up the rule you need, don’t read end-to-end. It is the single place commands, agents, hooks, and reviewers point at when they invoke a prose rule.
Scope, and the line with the documentation standard. The
documentation standard (DS) owns how docs/ are
structured — Diátaxis mode, directory taxonomy, frontmatter — and the writing
principles for docs (§4: inverted pyramid, scannability, controlled vocabulary,
single-source-of-truth, the bare-#N rule). This styleguide is broader in artifact
and narrower in concern: it governs prose across all authored artifacts, not just
docs. To avoid duplication (DS §4.4, applied to itself), it owns the cross-artifact
rules below and references DS for the principles DS already owns — it never restates
them. When a rule lives in DS, cite DS; when it lives here, cite WS-N.
How to cite a rule
Section titled “How to cite a rule”Reference a rule by its stable ID, never by paraphrasing the style into your own text:
-
In a review comment, command, agent, or hook: “see WS-1”, optionally linking to this doc. The
WS-NID is the contract — it never changes, so a citation stays valid even when the rule’s wording is refined. -
For a DS-owned principle, cite “DS §4.1” and link
documentation-standard.md. -
Programmatically, resolve a rule’s text with the lookup tool (so tooling cites the canonical wording rather than embedding a copy):
Terminal window node ~/.claude/scripts/styleguide/cite.js list # all rule IDs + titlesnode ~/.claude/scripts/styleguide/cite.js WS-1 # print one rule
Rules (owned here)
Section titled “Rules (owned here)”Each rule has a stable WS-N ID, a one-line statement, and a concrete do/don’t. IDs are
append-only — a rule is never renumbered, so a citation never goes stale.
WS-1 — Write for the artifact’s reader, not the editing session
Section titled “WS-1 — Write for the artifact’s reader, not the editing session”A finished artifact must stand on its own for someone encountering it fresh. They did not watch you write it and cannot see any earlier draft.
- Don’t reference the editing or correction process, or a prior version of the text the reader can’t see (“accurate framing”, “now corrected”, “as revised”, “to clarify the above”).
- Don’t negate a claim the reader was never shown (“it does not give up on tests” when nothing said it did) — describe the present state directly instead.
- Don’t contrast against an external source the reader doesn’t have in front of them as if they do (“unlike the previous approach…”).
- Prefer plain present-state description over editorial meta-commentary.
Do: “The loop pushes after each chunk.” Don’t: “To correct the earlier claim, the loop now actually does push after each chunk (it does not skip the push).”
WS-2 — Say why, not just what, in commit and PR bodies
Section titled “WS-2 — Say why, not just what, in commit and PR bodies”The subject line states the change; the body exists to explain the motivation and the
trade-offs. A bare subject is enough only for a trivial, self-evident change. Reviewers
and git log archaeologists read the body to recover intent the diff can’t show.
- Lead the body with the problem or motivation, then the approach, then any alternative considered and rejected.
- Don’t restate the diff in prose (“changed X to Y”) — the diff already says that; say why X became Y.
Do: “Rebase before ff-merge: the release bot auto-pushes to master on feat pushes, so a plain merge would fail fast-forward.” Don’t: “Updated the merge step.”
WS-3 — State it plainly; cut hedges and filler
Section titled “WS-3 — State it plainly; cut hedges and filler”Confident present-tense prose reads faster and ages better. Hedge words and filler add length without information.
- Drop “basically”, “just”, “simply”, “obviously”, “of course”, “in order to” (→ “to”), and “we should probably”.
- Don’t soften a definite fact into a maybe; if it’s true, state it.
Do: “
cdprov refreshre-links the manifest.” Don’t: “Basically,cdprov refreshshould just re-link the manifest, more or less.”
Principles referenced (owned by the documentation standard)
Section titled “Principles referenced (owned by the documentation standard)”These apply to all artifacts, not only docs — but the canonical statement lives in DS §4, so cite DS rather than restating them here.
| Cite | Principle | Applied beyond docs |
|---|---|---|
| DS §4.1 | Inverted pyramid — answer first | A commit subject is the conclusion; an issue’s first sentence is the ask; a comment’s first line is the point. |
| DS §4.2 | Scannability — write for the skim | Issue/PR bodies use headings, tables, and short lists, not walls of prose. |
| DS §4.3 | Controlled vocabulary — one name per thing | Use the canonical term (warp-drive, requirement, BOB_SOURCE) in issues and comments too. |
| DS §4.4 | Single source of truth — one owner per fact | Link to the owning doc from an issue/comment; don’t paste a copy that will drift. |
| DS §4.5 | Reserve bare #N for real issue/PR references |
Use C1/H2/“item 1” for intra-body item numbers — enforced by make check. |
Adding a rule
Section titled “Adding a rule”The doc is living — rules accrete as prose feedback recurs. To add one without restructuring:
- Append a new
### WS-N — <title>section under Rules (owned here), taking the next freeN. Never renumber an existing rule (citations are permanent). - Give it a one-line statement, do/don’t bullets, and a
Do:/Don't:example pair. - If the rule is really a DS principle applied to a new artifact, don’t add a
WS-N— add a row to the referenced-principles table instead.
The lookup tool (cite.js) reads these headings directly, so a newly appended rule is
immediately citable with no other change.
See also
Section titled “See also”- Documentation Standard — owns doc structure and the §4 writing principles this styleguide references.
- Memory conventions — the archive-on-supersede rule for preserving why a preference changed (the same “write for the reader” instinct, applied to memory history).