Skip to main content

@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 into apps/docs/.
  • No runtime code imports from coach, vault, or vault-view. @nx/enforce-module-boundaries restricts scope:docs to scope:docs and scope:shared.
  • No silent link rot. docusaurus.config.mjs sets onBrokenLinks: 'throw', onBrokenAnchors: 'throw', onDuplicateRoutes: 'throw', and onBrokenMarkdownLinks: '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 from apps/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): Declares INCLUDE/EXCLUDE globs, GUIDE page order, PACKAGE_ORDER for the Apps & libs sidebar, and pageFor() 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 as src/...) 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 from GUIDE, packages(), planning skills, and adrFiles().
  • 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.
  • /architecture and /apps/*, /libs/*/* — System map (ARCHITECTURE.md) and every package README in PACKAGE_ORDER.
  • /planning and /planning/conventions — Agent planning skills documentation.
  • /decisions and /decisions/* — Knowledge base ADRs from reasonry/source/initiatives/ai-coach/decisions/.

How to extend it​

  1. Add or update the source Markdown file in its canonical home (docs/guide/, apps/*/README.md, libs/*/*/README.md, or reasonry/).
  2. If you added a new guide page or workspace package, register it in GUIDE or PACKAGE_ORDER in src/sources.mjs.
  3. Update src/remark/ only when adding a new Markdown transformation shared across repository docs.
  4. Run npm exec nx lint docs and npm exec nx build docs to 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/ and libs/ layout and scope:docs module-boundary tags.
  • DEC-AIC-0049 — Explains the reasonry/ knowledge base whose ADRs are published under /decisions.