This file is the contract for every Markdown files in the repo: each tier's job, the writing rules, and the word budgets that verify-doc-budgets enforces. The audit/apply workflow is the dsh-doc-standards skill; the decision record is the doc-tiers-and-budgets RFC.
Every fact has exactly one home — the tier whose job it is — and every other place that needs it links there instead of restating it. A rule restated in two files drifts word-by-word until the copies disagree; a link cannot drift, and verify-md-links keeps it resolving.
| Tier | Job | Does NOT belong there |
|---|---|---|
Root AGENTS.md |
Standing orders: rules an agent needs in context in every session, one to three lines each, linking its home | Stories, worked examples, situational procedures, anything restated from a linked home |
Subtree AGENTS.md (packages/, examples/, docs/) |
Orders specific to that subtree | Repo-wide rules the root file already carries |
| architecture.md | The system map: services, the loop, extension seams — read before changing packages/ |
Type shapes (→ core-data-structures), per-package detail (→ package READMEs), decision rationale (→ RFCs), implementation-status annotations |
| core-data-structures/ | The type catalog: literal shapes and semantics of the spine and seam vocabulary | Behavior narration (→ architecture.md) |
| rfc/ | Decision records: the why and the what-was-given-up; implemented/ RFCs describe shipped reality in present tense |
Migration plans, test checklists, and spec-speak ("should…") once the decision has shipped |
| postmortem/ | Incident stories — the only tier where war-story narrative belongs | — |
| cookbook/ | Step-by-step how-tos with numbered verify steps | Design rationale (→ the RFC each guide links) |
| Package README | The per-package contract: config, semantics, limitations, extension points | JSDoc restatement, generated-catalog restatement (event/tool tables), other packages' concerns |
| development.md | First-stop contributor onboarding: local setup, daily workflow, and CI shape at summary level; a bilingual pair under the i18n contract | Runtime/version rationale (→ RFCs), gate-by-gate enumerations that drift from package.json scripts |
| Generated catalogs: cordis events, cordis services, tool-catalog, config-catalog, persistence-catalog, module-graph.md | Exhaustive enumerations regenerated from source, freshness-gated | Hand edits of any kind |
Skills (.agents/skills/) |
Workflows: how to carry out a recurring task against the contracts | The contracts themselves (→ docs) |
Placement test: a story about a bug → postmortem. Why we chose X → RFC. How to do task Y → cookbook. What type Z looks like → core-data-structures. What package P promises → its README. A rule every agent must always obey → root AGENTS.md, one line, linking the home that holds the why.
verify-md-wrap): the editor soft-wraps; hard breaks make a one-word edit re-diff the whole paragraph. Prose only — code blocks, tables, and list structure stay; code comments stay under the linter's column limit.ts blocks must compile (doc-typecheck); a pasted type definition is fenced `ts type-equiv and registered in the manifest so it cannot drift (mechanics).@mode tag (emit | waterfall | parallel | serial); the catalog generator hard-errors without it. Write the JSDoc to stand alone — it becomes the catalog entry (catalog RFC).verify-type-equiv catches drifted pastes, not never-documented new types (what counts as core).Every PR has a lesson it wants to append, and without pressure nothing leaves. scripts/doc-budgets.manifest.json stores the allowed word-count ceiling for each budgeted standing doc; pnpm run verify-doc-budgets fails when a doc exceeds its ceiling or a budgeted file is missing.
When the gate goes red:
Ceilings keep working headroom: at least 5% above the current size, ratcheted down after trims. Target budgets: root AGENTS.md ≤ 1,500 words; architecture.md ≤ 1,800; each subtree AGENTS.md ≤ 600, except this file ≤ 1,250; packages/README.md ≤ 600. Unbudgeted tiers (package READMEs, RFCs, reference matrices) have no ceiling; review and the slop checklist govern them.
Hunt these in any doc; the dsh-doc-standards skill runs this list as an audit:
implemented/ RFCs: "should", migration plans, acceptance checklists. An implemented RFC describes what is, per rfc/implemented/AGENTS.md.When one doc refers to another doc, an RFC, a package README, or any file in the repo, link it with a relative Markdown link to the actual path — never bare prose or a number ("see RFC 005"), which is uncheckable and rots on rename. pnpm run verify-md-links (part of doc-sync; see the cross-link lint RFC) fails when a relative target does not exist, so a rename that orphans a link is caught before review. This is also why RFC files carry dates and topics instead of stable numbers: they survive moves between lifecycle and class folders without dangling references.
The gate checks file existence, not #anchor validity — verify anchors yourself when linking to one.