Last update: 2026-11-28
These rules say how AI agents write and organize technical documentation in any project. They extend the general development rules (R1 to R5), mainly R2 (document as you go), R4 (human readability) and R5 (long-term maintainability). When the two conflict, the general rules win. A project may add its own rules on top (for example, which tracker and docs site it uses); it may not lower these.
Two words used below: the docs home is the one place documentation lives (a docs repository or a docs/ folder), and the tracker is the issue tracker (Linear, Jira, GitHub Issues). Cite rules as D1, D2 and so on.
Rule. Keep all technical documentation in one docs home, in folders by purpose, with an index page and navigation that reach every page.
Rules for agents
projects/<repo>/ (one repository), projects/workspace/ (knowledge that spans repositories, including the glossary and the server inventory), issues/open/ and issues/done/ (task folders, D2), decisions/ (D8), api/ (API specs or collections), templates/, and skills/ and rules/ for agents.Red flags: a page nothing links to; a broken link; two pages that state the same fact differently.
Rule. Every task gets one folder holding its whole written record, and the folder moves from open to done when the task ships.
Rules for agents
<ISSUE-ID>-<slug> for a tracker issue, otherwise YYYY-MM-DD-<slug>, with a lowercase kebab-case slug. Check that no folder for that issue exists yet.templates/: draft.md (before work, one screen), breakdown.md (big tasks: subtasks A, B, C split per R1, each with scope, "done when", dependencies), plan.md (before code), doc.md (during and after work, D4).plan.md and doc.md. The parent doc.md is an index table plus the final state (what was merged and deployed).doc.md, update the living pages (D5), move the folder to done, update the index, close the issue.Red flags: one task in both open and done; two folders for one issue; a shipped task still under open; a task file that matches no template.
Rule. A reader with no chat history and no tracker access can understand, continue or reproduce the work from the docs alone.
Rules for agents
<ISSUE-ID> — <title>), and links to its parent task, its plan and the issue.Red flags: "see the ticket" as the only explanation; requirements pasted into several files that now disagree.
Rule. doc.md records what was actually done, so another person can reproduce, operate or undo it. It shows only the final, working version; git keeps the history.
Rules for agents
Red flags: "configured the server" with no command; "first we tried X"; future tense in a finished doc.
Rule. Task records say what happened; living pages say how the system works today. Every lasting fact ends up on a living page, so nobody has to replay old tasks to understand the system.
Rules for agents
doc.md.Last reviewed: YYYY-MM-DD line under the title of each living page. Update the date whenever you check the page against reality.Red flags: "read tasks A to O to see how payments work"; a living page older than the code it describes; a page that is half tutorial, half reference.
Rule. Every code change is traceable from its docs, and docs change in the same task as the code they describe.
Rules for agents
doc.md (repository and branch, short and full hash, message, files), and commit the docs once.docs: <verb> <what>.Red flags: a shipped change with no hash in its doc; an API change with an outdated spec; a docs commit titled "update".
Rule. Readers scan before they read. Plans, drafts and issues open with the problem; records and answers open with a summary. Structure carries the rest.
Rules for agents
Red flags: a plan that opens with steps; a wall of prose where a table fits; a command inside a sentence.
Rule. The final-version rule removes failed attempts, not reasons. Lasting decisions and production incidents get records that keep the why.
Rules for agents
decisions/NNNN-<slug>.md with context, options considered, decision, consequences. Never rewrite an accepted ADR; supersede it with a new one and link both ways.doc.md also covers impact, timeline, root cause and follow-up actions, without blame. Each follow-up becomes a tracker issue or a task folder.Red flags: nobody knows why a choice was made; the same incident happens twice; a postmortem that names a person as the cause.
Rule. Documentation gets copied, published and indexed. It holds no secrets and no personal data.
Rules for agents
.env path, a secret manager entry), never its value.Red flags: a password, token or key value; a customer's phone number; an IP address repeated across task docs.
Rule. What can be checked by a machine is checked on every change, and the documentation gets more standard over time, never less.
Rules for agents
Red flags: a check disabled to make a commit pass; new pages copying an outdated pattern; the same review comment made twice with no rule added.