Contributing Documentation Content
How to add or update a page on this docs site — file structure, frontmatter, sidebar wiring, and the review handoff chain.
This guide covers the docs-site-specific workflow for adding or editing
content pages. For repository-level setup, scripts, and PR expectations,
see CONTRIBUTING.md in the repository root.
Where content lives
Every page is a Markdown file under src/content/docs/, loaded as an Astro
content collection (see src/content.config.ts). The route a file resolves
to is its path relative to that directory:
src/content/docs/design/tokens.md -> /design/tokens
src/content/docs/guides/token-usage.md -> /guides/token-usage
src/pages/[...slug].astro reads the collection and renders every entry
through DocsLayout.astro automatically — you do not need to create a page
file for new content.
Required frontmatter
Every page needs exactly two frontmatter fields, enforced by the Zod schema
in src/content.config.ts:
---
title: Page Title
description: One or two sentences describing the page for previews and meta tags.
---
Both are required strings. The build fails if either is missing.
Adding a new page
- Create the Markdown file under the appropriate subdirectory of
src/content/docs/(e.g.design/for ecosystem package docs,guides/for task-oriented how-tos). - Add the required
titleanddescriptionfrontmatter. - Write the content. Follow the existing house style: concise Markdown,
[text](url)links (no bare URLs), and code examples that match the actual installed package API — verify against the real source orCHANGELOG.mdin the upstreamproject-design/repo rather than assuming. - If the page should appear in the sidebar, add it to
DocsLayout.astro(see below). Pages not linked from the sidebar are still built and reachable by direct URL, but won’t be discoverable through navigation. - Run
npm run buildand check the new route renders.
Wiring a page into the sidebar
The sidebar nav lives in src/layouts/DocsLayout.astro. Two patterns exist
today:
- Package docs (Tokens, UI, UI Astro, Components, Base) are generated
from the
packagesarray near the top of the component — each entry adds an Overview + Reference link pair. - Single pages (like “Introduction”) are written directly as an
<a>inside a named<SpStack>section.
Add a new top-level section by following the existing SpStack/<nav>
pattern, or extend the packages array if the new page is another
ecosystem-package doc pair.
Keeping content synchronized with upstream packages
This repository documents packages it does not own (spectre-tokens,
spectre-ui, spectre-ui-astro, spectre-components, spectre-base, all
published from project-design/). When an upstream package ships a release:
- Check the installed version range in
package.jsonagainst the latest published version inproject-design/<repo>/package.json(the project-design top-levelROADMAP.mdcan lag behind individual repoCHANGELOG.mdfiles — prefer the per-repo source when they disagree). - Read the relevant
CHANGELOG.mdentries since the version currently documented here. - Update the affected overview and reference pages — version numbers, new recipes/components, new props, and any claims about component counts or “current version” callouts.
- Verify against actual source (
src/recipes/*.ts,src/components/*.astro,astro-adapter.contract.json) when a changelog entry is ambiguous — don’t guess at prop names or option values.
Review and handoff chain
Per CLAUDE.md: Claude Code → Codex review → Bradley Potts commits.
Claude Code does not create commits in this repository. Before handing off:
- Run
npm run build(ornpm run checkfor build + typecheck). - Summarize what changed and call out any broken links or unresolved risks.
- Update
CHANGELOG.mdif the change is release-relevant.
Next steps
- Using Spectre Tokens and Using Spectre UI Components are examples of the guide format described above.
- See
CLAUDE.mdin the repository root for the full implementation guide and working rules.