Contributing to the Docs
This site is a VitePress docsite, themed from design-system/DESIGN.md, gated behind Cloudflare Access. Drop a markdown file into a category folder and it appears in the sidebar. Need richer than markdown? Inline Vue lives in the same file. Need a fully standalone artifact? Drop it in public/.
Using Claude Code? Reach for the docs skill first. It encodes everything on this page — category structure, the three fidelity tiers, the stale mechanism, mermaid + design-token rules, maintaining section overviews, and a ready-to-fork HTML mock template — so an agent adds docs the right way without you re-explaining any of it. Just ask it to "add an architecture doc", "mark this doc stale", or "add an HTML mock to docs" and the skill loads automatically.
Quick start
# from the repo root
bun install
bun run docs # vitepress dev docs --port 5199
# → http://localhost:5199VitePress is pinned as a devDependency (vitepress@1.6.4), so bun run docs uses the local binary — no bunx fetch, reproducible across machines. There's also a Docs entry in .claude/launch.json (runs bun run docs) for the Claude Code preview tooling.
Drop-in workflow. Create docs/<category>/my-doc.md, add a title: and order: to its frontmatter, restart the dev server, and it's in the nav + sidebar. No config.mts edits.
Pick a tier of fidelity
Pick the lowest tier that fits — higher tiers add maintenance cost.
Tier 1 — Markdown
Plain markdown, fenced code, mermaid, frontmatter. The default for most docs.
---
title: My Doc
order: 3
---
# My Doc
Short intro paragraph.
## A section
- Lists
- `inline code`
- Tables, fenced code, mermaid all work natively
```python
def hello(): return "world"
```
```mermaid
flowchart LR
A[Start] --> B[Done]
```Use it for: runbooks, RFCs, architecture notes, dev-setup guides — anything that reads top-to-bottom.
Categories
Every category is a top-level folder under docs/. Drop a .md in and it appears.
| Folder | Sidebar label | Goes here |
|---|---|---|
architecture/ | Architecture | System/design docs. |
research/ | Research | Deep-dive investigations / external research. |
design-system/ | Design System | DESIGN.md tokens, style guidance. |
proposals/ | Proposals & RFCs | Design proposals/RFCs. Copy proposals/_template.md. |
runbooks/ | Runbooks & Guides | Operational runbooks. |
dev-setup/ | Dev Setup | New-machine / dev-environment setup. |
Add a new category
Add one row to CATEGORIES in config.mts and create the matching folder with at least one .md (otherwise it's skipped):
const CATEGORIES = [
{ dir: 'architecture', label: 'Architecture' },
// ...
{ dir: 'my-new-cat', label: 'My New Category' },
]Marking a doc stale
Out-of-date docs stay reachable (so inbound links don't break) but lose top billing. Set stale: true in the frontmatter:
---
title: Old Architecture Note
stale: true
staleNote: Superseded by the Views agent rework — kept for history. # optional
---Two things happen automatically off that one flag:
- The doc drops out of its category's main list into a collapsed "Stale" sub-group at the bottom of that category in the sidebar.
- A warning banner renders at the top of the page (injected by
theme/Layout.vue).
The file does not move, so its URL is unchanged and inbound links keep working.
Recently updated on the home page
The home page shows a Recently updated grid of the six freshest docs — so a doc you add surfaces there with no extra work. The signal is the last git commit date for the file (falling back to file mtime if git history isn't available at build time); stale-flagged docs and category landing pages are excluded.
Mermaid diagrams
Fenced ```mermaid blocks render client-side. The theme cleans up after failures so a single broken diagram can't pollute other pages.
Semicolons break sequenceDiagram text. ; is a statement separator in mermaid's sequence grammar. Inside any sequenceDiagram message or Note, use —, ,, or <br/> instead.
Note over X: token validated; identity locked ❌ parse error
Note over X: token validated, identity locked ✓Design tokens
The docsite imports the live DESIGN.md token set. Use the CSS variables for every color, font, and radius — never hardcode brand hex.
/* available globally on every page */
color: var(--color-primary); /* brand primary (Core Purple) */
background: var(--vp-c-bg-soft); /* dark-mode aware surface */
border-radius: var(--radius-lg); /* 16px */
font-family: var(--font-body);| Variable family | Source | Use for |
|---|---|---|
--color-primary, --color-brand-*, --color-purple-50..950 (+ pink/green/red/orange/black ramps) | design-system/generated/tokens.css (from DESIGN.md) | Brand, accents, tints. |
--vp-c-bg, --vp-c-bg-soft, --vp-c-bg-alt, --vp-c-text-1, --vp-c-text-2, --vp-c-divider, --vp-c-brand-1 | VitePress + theme overrides | Surfaces and text — dark-mode aware. Prefer these for chrome. |
--radius-xs..xl, --font-body | DESIGN.md | Shape and type. |
See /design-system/ in the sidebar for the palette and full token list.
Run locally / build / deploy
bun run docs # dev w/ HMR (vitepress dev docs --port 5199)
bun run docs.build # production build (catches dead links)
bun run docs.preview # serve the built site locallyThese scripts call the pinned local vitepress@1.6.4 binary. The dev branch auto-deploys to Cloudflare Pages; to preview any other branch before merge, run the Docs Preview GitHub Action (workflow_dispatch in .github/workflows/docs-preview.yml) against your ref for a shareable URL.
Dev-server restart needed for new files/categories. The nav + sidebar are generated by a filesystem scan at config-load time. HMR covers content edits live, but a newly added file or category only shows up after the dev server restarts (or in a fresh build).
See also
- For Claude Code agents: the
docsskill — same content, agent-targeted. - Tokens source of truth:
design-system/DESIGN.md. Hand-edit; generated artifacts flow from it. - VitePress docs: vitepress.dev for the framework itself (Vue in markdown, frontmatter, custom theme).