Skip to content
Primer printing platePrimer

Contributing

  1. Change authored source: YAML in tokens/, type rules, or a component spec.
  2. Add behavior tests when changing alias resolution or serialization.
  3. Run npm run build, npm run tokens:check, and npm run verify, plus python3 -m unittest discover -s tests -p 'test_*.py' for the design kit.
  4. Review the catalog in dark and light, at desktop and mobile widths, including an alternate accent.
  5. Update the usage documents. Commit generated foundation artifacts alongside source changes.
  6. For a release, run npm run release:check, tag v*, and deliver from that tag.

When reviewing an existing checkout, run npm run verify before a full build so the freshness check sees the committed token output.

For design decisions, use design review to distinguish foundation defects from application-owned patterns. The design skills guide lists primer-design, primer-tally, and primer-notami. Maintain local guidance in skills/primer-design/, skills/primer-tally/, and skills/primer-notami/, and run npm run skills:check after skill changes. Run npm run docs:build for guide or navigation changes. The catalog uses the configured Python 3 interpreter (python3 on PATH) to assemble its downloadable design kit. Run npm run design:pack to build that archive independently.

CI uses a GitLab-hosted Linux runner with Node 24 and Python 3. The checks job runs npm run verify, npm run site:build, and python3 -m unittest discover -s tests -p 'test_*.py'. Run npm ci, npm run build, and npm run verify locally, then npm run site:build to verify the complete documentation site. GitLab runs validation; Cloudflare Pages hosts the site. See the repository map for authored and generated file locations and deployment for hosting setup. Token generation has no runtime dependencies. The package name is @hyugin/primer and stays private. Consumers adopt the design kit or use the hosted catalog without a registry install. No license was selected. Protect v* tags in GitLab so a published tag cannot be moved.

The catalog uses Astro Starlight for routes, the generated Pagefind index, document outlines, and Markdown rendering. catalog/src/components/WorkspaceFrame.astro owns the responsive header, navigation drawer, and inline search. DocsTitle.astro owns breadcrumbs and the badge documentation tabs. docs.css contains the site shell’s light and dark presentation. custom.css retains the Primer specimens. The shell uses self-hosted Mona Sans for headings and navigation, with system typography for body text, independently of Primer’s specimen styles. The unmodified documentation font comes from Primer Product UI; its source and SIL Open Font License notices are in assets/fonts/docs/. DocsExample.astro and DocsResources.astro are not referenced by the current pages.

The shell follows the layout and interaction of GitHub Primer Product UI documentation. Doctocat is coupled to Next.js and React, so the catalog retains its Astro implementation instead of adding a second framework. Keep links and resource cards grounded in material that exists in this repository. Guides in catalog/src/content/docs/guides/ are generated from docs/ by scripts/site-assets.mjs; edit the canonical files here. After changing navigation or shell behavior, run npm run docs:build and check desktop and narrow-screen navigation, keyboard interaction, both themes, and search in the built site.

The reference is GitHub Primer Product UI, especially its component overview and guidelines. The shell was independently implemented; no Doctocat source or GitHub brand assets are bundled. Desktop measurements use a 65px header, 300px sidebar, 800px main column including 36px gutters, and a 280px outline region. The outline hides below 1366px and the sidebar becomes a drawer below 1025px.

Use npm run site:preview -- --port 4327 to inspect the built catalog. Pagefind searches the built documentation; the preview is the entry point for checking search, drawer focus, theme persistence, and narrow-page overflow.