|
| 1 | +# Documentation Discipline |
| 2 | + |
| 3 | +When writing or modifying documentation, follow these rules. |
| 4 | + |
| 5 | +These rules do not apply to AI-facing prompts (agent definitions, skills, commands, rules, etc. under `.claude/`). |
| 6 | + |
| 7 | +## Audience awareness |
| 8 | + |
| 9 | +- **Documentation is written for third-party readers who consult it later, not for the user you're chatting with.** Avoid subjective writing that depends on the chat context. A third-party reader doesn't know "what the user asked for", "what the prior version of the doc said", or "which file something was ported from". |
| 10 | + - NG examples: Phrasings that presume the chat context, such as "Added per user request" or "Previously was X, now changed to Y". |
| 11 | + - Instead: Document only the facts, specifications, and assumptions readable from the doc itself, in a form independent of any conversation history. Leave change history in git log / PR descriptions; do not put it in the doc body. |
| 12 | +- **Exception**: This does not apply when the user explicitly asks for such phrasing, or when the doc is itself an extension of the chat context (plans, reports, meeting notes, etc.). |
| 13 | + |
| 14 | +## Reference independence |
| 15 | + |
| 16 | +- **Do not reference matters that have not been documented in a form a third party can access.** Verbal decisions, Slack messages, chat history, unpublished material, etc. must not be cited as sources. |
| 17 | + - When citing, point to a place a third party can follow (a file in the repo, a public URL, a published spec, etc.). |
| 18 | + - When no such public reference exists, do not include the citation at all — rewrite the passage so the doc stands on its own. |
| 19 | + |
| 20 | +## Markdown notation |
| 21 | + |
| 22 | +- **Escape `|` inside inline code in table cells.** Markdown's table cell separator is `|` even inside inline code, so leaving it unescaped breaks parsing. Escape it as `\|`. |
| 23 | + - NG: `| operator | `a | b` represents OR |` |
| 24 | + - OK: `| operator | `a \| b` represents OR |` |
| 25 | +- **Wrap Markdown source at a reasonable width (target: 100 characters max).** Don't pack a long paragraph onto one line; break at sentence or clause boundaries to preserve readability and diff clarity. |
| 26 | + - Exception: Places where Markdown forbids line breaks (table rows, heading lines, etc.). |
| 27 | +- **A single newline in Markdown source does not produce a line break in the rendered output.** The viewer treats source newlines as whitespace and joins them into one paragraph. To split lines visually, use one of: |
| 28 | + - Separate paragraphs: insert a blank line. |
| 29 | + - Separate items: use a list (`-` or `1.`). |
| 30 | + - In-paragraph line break (use sparingly): two trailing spaces at end of line, or a `<br>` tag. |
0 commit comments