DEC-AIC-0060: Standardize documentation roles and package READMEs with an eight-section blueprint and agent skill
Status: accepted · 2026-11-28 · supersedes DEC-AIC-0034
Context
DEC-AIC-0034 established a single home for each kind of documentation: a one-screen root README.md, a user guide in docs/guide/, CONTRIBUTING.md, ARCHITECTURE.md alongside package READMEs, and ADRs in kb/ (moved from docs/adr/ by DEC-AIC-0049).
Since DEC-AIC-0034, the workspace moved from a flat packages/ layout into apps/* and domain-grouped libs/*/* with enforced scope:*, architecture:hexagonal vs architecture:layered, and type:* module boundaries (DEC-AIC-0051, observed: repository @ 2026-11-28). apps/docs/src/sources.mjs ingests apps/*/README.md and libs/*/*/README.md directly into the Docusaurus site (observed: apps/docs/src/sources.mjs @ 2026-11-28).
DEC-AIC-0034 did not specify what a package README should contain. Existing package READMEs drifted into inconsistent formats, often listing file-by-file inventories that go stale when code moves while omitting boundaries, architectural placement, extension recipes, verified Nx targets, and governing ADRs.
Decision
-
Keep the single-home documentation split from DEC-AIC-0034 intact:
- Root
README.mdstays distinct as the product front door and user-facing story: what ai-coach is, how it works, how to start, and where to read on. It fits on one screen and holds no reference tables. docs/guide/holds the user guide (setup, first-session, the-climb, vault-view, planning, commands, coaching-styles, configuration, privacy, troubleshooting, glossary). Changes to commands or settings update a guide page, notREADME.mdor a package README.CONTRIBUTING.mdholds contributor commands, house rules, and the documentation map.ARCHITECTURE.mdholds the system-wide map; package READMEs (apps/*/README.md,libs/*/*/README.md) explain how each individual app or library is built and how it fits into that architecture.kb/holds architectural decision records (DEC-AIC-0049).- Every fact lives in one place; other pages link to it rather than duplicating it.
- Root
-
Every package README (
apps/*/README.mdandlibs/*/*/README.md) follows an eight-section blueprint:- What it is doing — clear, human-readable explanation of the package's purpose and responsibilities.
- What it deliberately does NOT do (Non-goals & Boundaries) — explicit constraints that prevent drift (forbidden dependencies, no direct disk I/O, no
data-accessimports, no business logic in adapters or UI). - How it connects to the main architecture — where the package sits in the workspace (
scope:*,architecture:hexagonalvsarchitecture:layered,type:*, upstream/downstream dependencies) plus a small ASCII or Mermaid diagram showing data and control flow. - Internal architecture & rules — internal structure, patterns, invariants, and rules contributors and agents must follow when modifying the package.
- Public surface / Contract — what other packages actually import or call (key exports, ports, routes, MCP tools, UI primitives, or grouped CLI capabilities linking to
docs/guide/for full references) rather than a brittle line-by-line file inventory. - How to extend it — a short 3–4 step recipe for the most common change in the package (for example, adding a CLI command, MCP tool, signal store, or UI primitive).
- Running & testing — adapts by project type:
- Libraries (
libs/*/*): only the actualnpm exec nx ...targets that exist on the project, verified vianpm exec nx show project <name>. - Apps (
apps/*): how to invoke or serve the app (invocation pattern plus 2–3 representative examples, linking todocs/guide/*instead of duplicating full command/flag lists) plus its verifiednpm exec nx ...targets (lint,typecheck,test,build).
- Libraries (
- Key ADRs (always last) — a short bulleted list of the 2–5 most important ADRs governing the package, each with a relative link into
kb/source/initiatives/ai-coach/decisions/and a one-line explanation of why it applies.
-
Apply newcomer-friendly writing and Docusaurus ingestion rules to all docs and package READMEs:
- Write in plain words for a newcomer, using "you", short sentences, and active voice. Keep each package README scannable (1–2 screens max) and link terms to
docs/guide/glossary.mdinstead of re-explaining them. - Account for
apps/docs/src/sources.mjsandapps/docs/src/remark/repo-links.mjs: use a single H1 (# @ai-coach/<name>), standard H2 (##) section headings, and valid relative Markdown links sonpx nx build docspasses with zero broken links or anchors.
- Write in plain words for a newcomer, using "you", short sentences, and active voice. Keep each package README scannable (1–2 screens max) and link terms to
-
Ship the standard as a reusable multi-agent skill:
- The canonical skill lives at
.agents/skills/package-readme/SKILL.mdwith a concrete template and review checklist. - Symlink it into every supported agent skill directory in this repository (
.claude/skills/,.cursor/skills/,.opencode/skills/,.gemini/skills/,.codex/skills/) using relative symlinks (../../.agents/skills/package-readme) and list it in.agents/skills/README.md.
- The canonical skill lives at
This ADR supersedes DEC-AIC-0034. All single-home documentation rules and Docusaurus site structure from DEC-AIC-0034 carry forward unchanged except where extended here for package READMEs and kb/ (DEC-AIC-0049).
Consequences
- Every refactored and new app or library tells a consistent, human-readable architectural story instead of a stale file listing.
- Root
README.mdstays focused on the user-facing product pitch and quick start, clearly separated from package-level architectural docs. - Contributors and AI agents across Claude Code, Cursor, OpenCode, Gemini CLI, and Codex share one canonical
package-readmeskill without copy drift. - Docusaurus builds (
npx nx build docs) automatically validate every relative link and anchor in package READMEs, including links todocs/guide/andkb/. - Existing package READMEs written before this standard will be brought into alignment incrementally as packages are touched or refactored.
Alternatives Considered
- Leave package README structure informal as in DEC-AIC-0034. Rejected: informal READMEs drifted toward brittle file tables and omitted architectural boundaries, extension recipes, and governing ADRs.
- Document the blueprint only in
CONTRIBUTING.mdwithout an Agent Skill. Rejected: AI agents editing or scaffolding packages reliably follow a dedicated skill with a template and checklist, whereas prose inCONTRIBUTING.mdis easy to miss. - Copy
package-readme/SKILL.mdinto each agent directory. Rejected: copies drift across agents; relative symlinks to.agents/skills/package-readmekeep a single source of truth (consistent with DEC-AIC-0050).