Skip to content

Architecture

The documentation and governance system spans three repositories, each with a distinct responsibility:

RepositoryRole
docs-controlCentral governance hub — repository settings, branch protection config, managed files manifest, reusable CI workflows, caller workflow templates, and downstream dispatch
docs-builderDocker build image — Astro + Starlight build orchestration, npm dependencies, Puppeteer PDF generation, interactive components
docs-themeAstro Starlight plugin — shared branding, CSS, fonts, logos, layout components, astro.config.mjs, and content.config.ts

Content repositories only need a docs/ directory. The build container and workflow handle everything else.

When a template file changes in docs-control on main:

  1. The dispatch workflow fires and triggers enforcement in every downstream repository
  2. The enforcement workflow compares desired state against current state and patches any drift
  3. The file sync workflow detects drifted managed files, creates a PR with canonical content, and auto-merges it

Two fine-grained personal access tokens provide least-privilege separation:

TokenPermissionsUsed by
REPO_SETTINGS_TOKENAdministration R/W, Pages R/W, Contents Read, Metadata Readenforce-repo-settings.yml, dispatch-downstream.yml
REPO_SYNC_TOKENContents R/W, Issues R/W, Pull Requests R/W, Metadata Readsync-managed-files.yml

The enforcement workflow needs admin access to modify branch protection and Pages settings. The sync workflow needs contents and PR access to create branches, commit files, and merge PRs. Splitting these reduces the blast radius if either token is compromised.

Docs-control is both the provider and consumer of its own governance config. When enforce-repo-settings.yml runs on docs-control itself (via the push trigger), it detects this by comparing managed_files.source_repo against github.repository. This triggers the self_contexts override in branch protection — docs-control uses workflows directly (check name: Check linked issues), while downstream repositories use caller wrappers (check name: check / Check linked issues). See the configuration page for details on contexts vs self_contexts.

Directory / FilePurpose
.github/config/repo-settings.jsonCentral config: repository settings, branch protection, Actions permissions, Pages config, and the managed files manifest
.github/config/downstream-repos.jsonRegistry of enrolled downstream repositories
.github/config/docs-sites.jsonMetadata for each downstream docs site (label, URL, description) used by README templating
.github/workflows/Reusable workflows: enforcement, file sync, pages deploy, linked-issue check, and dispatch
workflows/Caller templates downstream repositories install into .github/workflows/
docs/Documentation source (built and deployed via Astro Starlight)
CONTRIBUTING.mdContributor workflow rules (synced to all downstream repositories)
CLAUDE.mdAI assistant instructions (synced to all downstream repositories)
README.md.tplTemplate for dynamically generated downstream README files
.pre-commit-config.yamlPre-commit hooks configuration (synced to all downstream repositories)
.markdownlint.jsonMarkdown linting rules
.yamllint.yamlYAML linting rules