WI-004: Build the docs subsite
WI-004: Build the docs subsite
Problem
Collaborators need to read the architecture, decisions, standards, and backlog at a URL, with search and navigation, without a checkout. ADR-0013 specifies Astro Starlight as apps/docs on Cloudflare Pages, single-sourced from the root docs/ directory.
In scope
apps/docswith Astro + Starlight.- An Astro content-collection loader using
glob({ base: '../../docs' })so rootdocs/is the only copy of every authored file. - Sidebar grouping: Architecture · Decisions · Standards · Work.
- Built-in search working across all sections.
- Any missing
title/descriptionfrontmatter added to existingdocs/files.
Split out
- Cloudflare Pages deploy — moved to WI-007 (#21). It needs credentials from WI-H04 (#12), and the build half is fully verifiable offline. Splitting kept the subsite from being blocked on an account signup, rather than dropping the DoD line.
Out of scope
- Custom theming or branding beyond Starlight defaults.
- Authentication or access control — the site is public.
- Editing the substance of any document. Frontmatter fixes only.
Definition of done
-
pnpm --filter docs devserves the site locally. -
pnpm --filter docs buildsucceeds with zero broken internal links. - Every file under root
docs/renders, includingarchitecture.md, all 17 ADRs, all 10 standards, and the work backlog. - There are no duplicated markdown files and no symlinks —
apps/docscontains no copy of any file that exists in rootdocs/. - Editing one line in
docs/decisions/ADR-0008-drizzle-query-layer.mdchanges the built site with no second edit anywhere. - Search returns a result for a term that appears only in a standards document.
- Relative links between
docs/files work both on GitHub and on the built site.
Verification
pnpm --filter docs build # must report no broken linkspnpm --filter docs dev# Visit the local URL: check each sidebar section, then search for a# standards-only term such as "confident false completion".Single-source check:
# Should return nothing — no duplicated content files under apps/docsfind apps/docs -name '*.md' -not -path '*/node_modules/*'Then edit an ADR heading, rebuild, and confirm the change appears with no other file touched.
Notes
The glob loader is the crux. A copy step or symlink approach was explicitly rejected in ADR-0013 — symlinks are painful across the WSL boundary, and any copy step means documentation that requires two edits, which is documentation that rots.