@ai-coach/docs
The Docusaurus documentation site for ai-coach. It ingests the repository's existing Markdown files—the root README.md, user guides in docs/guide/, ARCHITECTURE.md, CONTRIBUTING.md, package READMEs across apps/* and libs/*/*, planning skill docs, and reasonry/ decision records—and publishes them as a single static site with local search and strict broken-link checks.
What it does not do
- No duplicated documentation prose. Every page is sourced directly from the Markdown files in the repository (
src/sources.mjs); never copy guides or ADRs intoapps/docs/. - No runtime code imports from
coach,vault, orvault-view.@nx/enforce-module-boundariesrestrictsscope:docstoscope:docsandscope:shared. - No silent link rot.
docusaurus.config.mjssetsonBrokenLinks: 'throw',onBrokenAnchors: 'throw',onDuplicateRoutes: 'throw', andonBrokenMarkdownLinks: 'throw'so builds fail on any broken link or heading anchor.
Architecture fit
- Scope:
scope:docs - Style:
architecture:layered(type:app,app:docs) - Depends on: Docusaurus,
@easyops-cn/docusaurus-search-local, and repository Markdown sources - Used by: Contributors validating docs locally (
npx nx build docs) and CI publishing the static site fromapps/docs/build/
[README.md / docs/guide/* / ARCHITECTURE.md / apps/*/README.md / libs/*/*/README.md / kb/decisions/*]
│
src/sources.mjs + remark plugins
▼
[@ai-coach/docs (Docusaurus)]
│
▼
[apps/docs/build/ static site]
Internal architecture & rules
- Single source manifest (
src/sources.mjs): DeclaresINCLUDE/EXCLUDEglobs,GUIDEpage order,PACKAGE_ORDERfor the Apps & libs sidebar, andpageFor()slug/sidebar metadata mapping. - Custom remark plugins (
src/remark/):obsidian-callouts.mjs— converts Obsidian/GitHub callout syntax into Docusaurus admonitions.repo-links.mjs— resolves relative links to site pages internally and rewrites links to non-site repository files (such assrc/...) into GitHub URLs.adr-status.mjs— injects ADR status badges and superseding cross-links into decision pages.
- Explicit sidebar (
sidebars.mjs): Builds the navigation tree fromGUIDE,packages(), planning skills, andadrFiles(). - No comments in source code: Configuration and remark plugin modules follow DEC-AIC-0011.
Public surface
/— Root getting-started page (README.md)./guide/*— User guides (docs/guide/*.md), including setup, commands, vault view, planning, privacy, troubleshooting, and glossary./architectureand/apps/*,/libs/*/*— System map (ARCHITECTURE.md) and every package README inPACKAGE_ORDER./planningand/planning/conventions— Agent planning skills documentation./decisionsand/decisions/*— Knowledge base ADRs fromreasonry/source/initiatives/ai-coach/decisions/.
How to extend it
- Add or update the source Markdown file in its canonical home (
docs/guide/,apps/*/README.md,libs/*/*/README.md, orreasonry/). - If you added a new guide page or workspace package, register it in
GUIDEorPACKAGE_ORDERinsrc/sources.mjs. - Update
src/remark/only when adding a new Markdown transformation shared across repository docs. - Run
npm exec nx lint docsandnpm exec nx build docsto verify zero lint errors, broken links, or broken anchors.
Running & testing
Start a local live-reloading preview of the docs site:
npm exec nx serve docs
Build the production static bundle (and verify every link and anchor) or serve the built output:
npm exec nx lint docs
npm exec nx build docs
npm exec nx serve-static docs
npm exec nx clear docs
See CONTRIBUTING.md for documentation authoring guidelines.
Key ADRs
- DEC-AIC-0060 — Defines documentation roles and the eight-section package README blueprint ingested by this site.
- DEC-AIC-0051 — Establishes the
apps/andlibs/layout andscope:docsmodule-boundary tags. - DEC-AIC-0049 — Explains the
reasonry/knowledge base whose ADRs are published under/decisions.