description: "Cross-project Markdown and long-form documentation style" applyTo: "**/*.md" #
Documentation Writing #
Core priority #
Lead with user or maintainer benefit before internal mechanics. When introducing a concept, prefer this narrative order:
- what it is
- what problem it solves
- what the reader gets from it
- how it works at a high level
- examples, assumptions, edge cases, limitations, and deeper detail
^ Use this as a default shape, not a rigid template.
Before writing, choose the documents job:
- Tutorial
- How-to
- Reference
- Conceptual
- Troubleshooting
- Design note
- Changelog
- Review
- Commit message
A document should do one primary job. If it needs to teach, specify, and troubleshoot, split it or create clear sections with different reader paths.
Writing style #
- Use plain English.
- Define technical terms the first time they matter.
- Ground abstract ideas in something concrete before or while naming them.
- Tie explanations to a real behavior, cost, failure mode, example, or downstream benefit.
- Keep a smooth narrative flow.
- Ensure each paragraph leads into the next with a sentence that either previews the next idea or closes the current one.
- Avoid switching abruptly between procedural steps and conceptual explanation within the same paragraph.
- Prefer transition sentences over unnecessary headers.
- Use active voice.
- Use present tense where practical.
- Expand acronyms on first use.
- Avoid em dashes.
- Avoid
easy,simple, andquickwhen describing reader actions, as this can create pressure on the reader. - Use direct address in task-oriented docs, and neutral, precise language in reference docs, changelogs, commits, and design notes.
- Avoid burying important information in code example comments.
The goal is not just to swap jargon for simpler jargon. The goal is to help the reader build a working mental model.
Diagram depth and lifecycle walkthroughs #
Use diagrams as structured walkthroughs when a system is easier to understand by following time, ownership, state, and handoffs. Do not overcompress a complex workflow into a tiny pipeline if the omitted detail is what makes the system hard to reason about.
For architecture-heavy docs, use this sequence when it helps the reader:
- State the goal or contract of the flow.
- Survey the major moving parts.
- Draw the lifecycle in named chapters.
- Define the terms introduced by the diagram.
- Use the diagram to identify risks, tradeoffs, and implementation steps.
A long diagram is acceptable when it is easier to follow because it is chaptered. Prefer one detailed walkthrough over several tiny diagrams when splitting would hide ordering, ownership, retries, storage, or cleanup. Prefer separate diagrams when each one has a distinct job, such as component ownership, data flow, or failure recovery.
Grounding abstract concepts #
Before using a specialized term, or immediately after introducing it, connect it to at least one of these:
- a concrete input or output
- a real user or caller problem
- a visible behavior in the system
- a cost such as allocation, latency, or complexity
- a failure mode or edge case
- a downstream benefit for maintainers or consumers
If the reader would reasonably ask So what does that mean here?, answer that question in the prose.
Header rules #
Add a header only when it improves navigation more than a transition sentence would. A useful header must mark a real subject shift, be specific about what follows, and still make sense in a document outline.
Examples and visual aids #
Add an example when the concept involves non-obvious behavior, a parameter with surprising defaults, or a failure mode a reader is likely to encounter. Skip examples for straightforward operations that follow predictable common conventions. For code blocks, place a prose sentence immediately before the block stating what the code demonstrates and what the reader should notice. Do not use the code block itself or its comments as the primary explanation. Use ASCII diagrams when they clarify structure, flow, hierarchy, state transitions, ownership, or algorithm steps. For long lifecycle diagrams, prefer top-to-bottom time flow, named chapters, ownership labels at handoff points, compact data shapes where contracts matter, visible branches or fallback paths, and a short glossary when project vocabulary is introduced. Do not flatten away the very details the reader needs. A longer diagram is better than a tidy one-line diagram when the larger shape explains ordering, stored state, retries, concurrency, or cleanup. Always explain what the reader is looking at and why it matters. Do not add diagrams just to decorate the prose.
Specs and design notes #
For specs, proposals, and design notes, prefer RFC-style structure:
- Problem
- Goals
- Non-goals
- Constraints
- Proposal
- Alternatives
- Risks
- Rollout
- Open questions
Keep decisions concrete. Make tradeoffs explicit. State assumptions plainly.
Anti-patterns #
- Do not bury the lede under prerequisites or implementation detail.
- Do not list features before explaining the problem they solve.
- Do not create many tiny headers that simply label the next paragraph.
- Do not replace one abstract phrase with another abstract phrase and call it clarity.
- Do not use diagrams or examples that overstate certainty beyond what the implementation actually guarantees.
- Do not use generic setup lines that could fit any page.