When creating or editing any markdown file, follow the discipline below. These are the always-apply rules distilled from the audit-docs audit, which ships as audit-docs.prompt.md and as the fuller audit-docs/SKILL.md, whose bundled references carry the operational detail. To audit docs/ against the code as a whole, run the /audit-docs skill.
- Zero hallucination. Document only what the code provably does. Read the implementation; don't infer behaviour from a name, type, comment, file location, or familiar pattern.
- Prove it. Before writing any technical claim, know the exact file (and ideally lines) that prove it. If you can't, don't write it. Silence beats speculation: no "appears to", "should", "will", or planned/intended behaviour.
- Fix existing statements that contradict the code.
- Cut a comment by whole sentences, above the public floor. Never delete or cut below one sentence the documentation comment on a public or exported symbol, a public structure member, or a package or module. Keep the sentence saying what it does, even where it restates the name, code, or syntax; where unclear, keep the first sentence. Correct a wrong or absent-content claim from the body. If the body was not read, keep the comment and report it. Cut other sentences that restate code, re-describe documented members, or narrate alternatives or reasoning where the code needs only the conclusion, keeping every other sentence word for word. A package or file comment says what the unit is for and never tours its members.
- Current state only. Describe the code as it is now, in prose and in comments alike. Never narrate the past ("replaces", "used to", "formerly", "for the first time", "unlike the old") and never name a file, flag, or tool that no longer exists. Future intent lives in a
TODO in the code, never in the documentation. Name the code a comment describes (a line, a block, the function, or the file); a comment giving the reason the code is written as it is passes. Where no code corresponds, correct the comment to the current fact it carries, and delete it only when none remains. An existing comment, public or private, is kept unless it is commented-out code, every sentence restates the code beneath it, or it narrates a change stating no current fact; a verbose one is tightened by whole sentences, keeping its summary and every reason, constraint, or warning that no other kept sentence gives while cutting its history and the alternatives not taken, and trimming happens only inside the requested scope. Inside that scope, a comment you correct for drift is still tightened, and tightening also cuts a sentence arguing the code is safe, a scenario or consequence no code, test, or document states, or a general explanation of what a language, library, or platform does. A comment the change added is held to the length of a new comment: one sentence saying what the code does, plus at most one for an error, a constraint, a caller duty, or the reason the code cannot show. A note about a deliberate omission the code depends on and a file header pass this test. An architectural or cross-cutting decision goes in a decision record of its own under docs/. The reason a particular piece of code is written as it is stays in a comment beside that code.
- No em-dashes or en-dashes. Never write
— (em-dash) or – (en-dash); replace each with a comma, parenthesis, colon, separate sentence, or a spaced hyphen -. The hyphen - is fine wherever it is grammatically correct, including the - separator between a label and a brief description in lists. When you edit a markdown file, replace its existing em-dashes and en-dashes too.
- Canadian English (strong preference) for prose you write or change: colour, behaviour, favour, centre, defence, and
-ize/-ization (standardize, organization). See the Canadian spelling guide. Don't retroactively convert existing prose, and never change code identifiers, config/JSON keys, quoted code, file/package names, or CSS properties (background_color, themeColor).
- No subjective adjectives in new prose (important, critical, robust, seamless, powerful, efficient, etc.). State facts. Objective is not robotic, though: replace the adjective with the concrete cited fact that earns it (show, don't tell).
- Use prose for reasoning (the why and how the system uses it), not line-by-line narration; reserve bullets and numbered lists for genuine enumerations (steps, options, fields). Don't force explanation into parallel bullet fragments, and don't de-list a real list. Lead each paragraph with its point.
- Voice (new or changed prose only). Write plain, formal English for a developer reading once: complete, grammatical sentences with one idea each, ordinary pronouns and transitions where the meaning is clear, and the point first. State what the code does, and write a consequence or scenario only where code, a test, or a document states it. Stop when the facts stop: no announcing sentences, closing summaries, or adjectives without the fact that earns them. Stay formal (no contractions). Worked examples of the target style are in
voice-and-ai-tells.md.
- Document a tunable value by the name a consumer changes it by (env var, config key, CLI flag, or a named member of a centralized constants/config module that other code reads), judging by role, not location. Don't document an ephemeral local variable as the config surface.
- Acronyms in prose you write or edit use capitals (ID, URL) and are expanded on first use per doc ("Deoxyribonucleic acid (DNA)"). Keep exact casing for brand/tool/package names (npm, iOS), domain terms (snRNA), and direct code references (an
id field).
- No placeholders, TODOs, or empty "add details here" sections.
- Two readers, one document. Every page is read by a newcomer meeting the system for the first time and by someone who already works in it, and serving only the second is the ordinary failure. Serve both on one page, by order rather than by splitting it between them: what the subject is and why a reader would reach for it, what that reader must already have or have read, then the detail. A page only its author can follow is not finished, and neither is one whose reader could have got it faster from the source. A page that grows too long as a whole is tightened in place; see the next bullet.
- Keep it short. Match the length to what the change needs: cover the substance, with no filler sections, repeated summaries, or boilerplate. Edit the sentence a change made false before adding one. Never cut a definition, a unit, or a condition to save words; cut whole passages instead.
- Brevity is measured too, not only whether each paragraph earns its place. Judge the whole document: would a careful human asked to write the same brief have produced something shorter? Tighten a long page in place by removing what it repeats, and propose any split, move, or rename to the user rather than making it. This is a judgement call, not a word or line count, worked through in
writing-for-both-readers.md.
- A diagram, table, or snippet can replace a long passage. Where a passage stays long because the subject needs it, consider whether a Mermaid diagram (never defaulting to
flowchart, chosen per diagram-and-image-accessibility.md), a table, a code/config snippet, or an image would replace prose and shorten the page. Add one only where it does.
- Introduce every term of art where the document first uses it, in a short parenthesis or by a link to the document that defines it, then use it unchanged. Expanding an acronym is not introducing it, since the expansion is often as opaque as the abbreviation. Spell a concept one way across
docs/: a concept spelled three ways is three concepts to anyone meeting it, and it defeats their search.
- A document opens with a single H1 named for its file, then a one to three sentence introduction for a reader who does not yet know the subject, then H2s. Headings are unique and fully descriptive ("Retry backoff limits", not "Limits"), because anchors are generated from them, and use sentence case.
- Tables only for uniform data scanned quickly. If columns repeat across rows, cells sit empty, or a cell holds a sentence of prose, use a list instead.
- Prefer Markdown to raw HTML for layout or styling.
- Link text names the destination: never "here", "link", "this", or a bare URL.
- Every file reference is a clickable markdown link to a file, never a bare filename and never a link to a directory. Link to a file inside the directory (e.g. its
index.md/README.md) instead. A generic reference, where no particular file is meant, is a code span rather than a link: "update your README.md".
- Use relative links (GitHub-compatible) and verify the path resolves from the doc's own location.
- Don't paste full definitions/class bodies; link to the file. Inline snippets only for a usage example, a config line, a data sample, or logic that text can't convey, each as short as the point allows.
- Readability first: correct content, never form. Docs are for people. An existing list, numbered list, table, heading, or code block keeps its form; never turn a list into prose, and never remove a code block as a repeat of the sentence it illustrates. Judge an existing code block in its page's context, not by a line count: an example, command, config entry, data sample, or short logic excerpt stays (corrected against the code, trimmed only where a shorter form still works), and only a block transcribing an implementation a link serves as well is replaced by that link.
- Every diagram must include both
accTitle (specific) and accDescr (a real description, not "a diagram showing…"). No exceptions. Images are held to the same bar: real alt text, never "screenshot" or "diagram".
- Valid Mermaid only; reflect actual current code; pick the diagram type that fits (don't default to
flowchart).