Documentation & Writing / Agent-Readable Docs
Write docs agents can act on
- MUST put the actionable rules first, as a numbered list using RFC 2119 keywords (MUST, SHOULD, MAY).
- MUST make each page self-contained: it can be fetched and used without reading other pages.
- MUST give each page a stable ID and a version so agents can cite and cache it.
- MUST publish raw Markdown alongside HTML, and an
llms.txtindex with one line per page. - SHOULD use the same section order on every page so agents can jump to a section by name.
- SHOULD state when a rule applies and when it does not.
- SHOULD show a good and a bad example for each non-obvious rule.
- SHOULD link to primary sources instead of restating them.
- MAY provide a machine-readable catalogue (JSON) for filtering.
- MUST publish a
content_hashfor each versioned page in the machine-readable catalogue. - MUST NOT change a page’s version or
content_hashwhen only metadata refreshes: a star count, a build timestamp, a generated-at date. - SHOULD have consumers cache by content identity and refetch on a change to it, never on a clock.
When to apply
Section titled “When to apply”Any documentation an agent will read: practices, runbooks, API docs, skills, READMEs, AGENTS.md files.
Examples
Section titled “Examples”This site: every practice follows Rules → When to apply → Procedure → Examples → Anti-patterns → Checklist → References, has a BP-NNNN ID and semver, and is served as .md. Its catalog.json carries a content_hash per practice, computed over the content only, so a scheduled star-count refresh moves generated and no hash.
Anti-patterns
Section titled “Anti-patterns”- Long narrative pages where the rule is in paragraph six.
- Content only available as rendered HTML or images.
- Renaming pages without keeping the old ID resolvable.
- A consumer that refetches on a timer, or when a generated-at timestamp moves with no content change behind it.
Checklist
Section titled “Checklist”- Rules first, RFC 2119 keywords
- Stable ID + version
-
content_hashper page, unchanged by metadata refreshes - Raw
.mdandllms.txtpublished