$npx -y skills add hatch3r/hatch3r --skill h4tcher-docusaurus-generatorMaintainer skill — generate or refresh the hatch3r project documentation site (Docusaurus 3.x) from this repo's canonical corpus (agents/, skills/, rules/, commands/, hooks/, docs/, plus counts from the public governance/inventory.json). Use when a hatch3r maintainer asks to buil
| 1 | > Last updated: 2026-07-06 |
| 2 | |
| 3 | # Docusaurus Generator (hatch3r maintainer skill) |
| 4 | |
| 5 | This skill refreshes the **hatch3r project's own** documentation site, which already exists at `website/` (Docusaurus 3.x), by re-deriving its pages from this repository's canonical corpus. It is a framework-dev maintainer tool (hence the `h4tcher-` prefix per CLAUDE.md), not a generic per-project docs generator and not a lifecycle add/refactor/remove preset. It sources content from `agents/`, `skills/`, `rules/`, `commands/`, `hooks/`, and `docs/`; the only governance source is the public `governance/inventory.json` (counts). |
| 6 | |
| 7 | The site lives in `website/` and deploys to `docs.hatch3r.com` via `.github/workflows/deploy-docs.yml` on push to `main` (paths filter: `website/**`). There is no `docs-site/` directory — operate on `website/` directly. Do NOT run `npx create-docusaurus`: the project is already scaffolded; creating a second project is a P4 (Lean Coverage) violation. |
| 8 | |
| 9 | ## Workflow Overview |
| 10 | |
| 11 | 1. **Analyze** the hatch3r repo corpus to identify what each page must reflect |
| 12 | 2. **Map** corpus sources to the existing `website/docs/**` page set and `website/sidebars.ts` |
| 13 | 3. **Regenerate** the affected pages in place under `website/docs/` |
| 14 | 4. **Build & Preview** via the website's own npm scripts |
| 15 | |
| 16 | ## Step 1: Analyze the hatch3r corpus |
| 17 | |
| 18 | Scan this repo to identify what each page must reflect: |
| 19 | |
| 20 | - **CLI surface**: the commands under `src/cli/commands/` (mirror the `npx hatch3r <cmd>` help) → `website/docs/reference/commands/cli-commands.md` |
| 21 | - **Canonical content**: `agents/`, `skills/`, `rules/`, `commands/`, `hooks/` — the artifacts hatch3r ships → the matching `website/docs/reference/{agents,skills,rules,hooks}.md` pages and `reference/commands/agent-commands.md` |
| 22 | - **Governance**: summarize public-facing governance behavior only, in your own prose, on architecture and guide pages. The sole citable governance source is the public `governance/inventory.json` (counts). NEVER emit private governance file paths, § numbers, or Decision numbers into public pages — the private governance corpus may exist locally via the overlay, but it is not a citable source for the public site |
| 23 | - **Existing docs**: the `docs/` directory and `README.md` (do not duplicate; link or lift) |
| 24 | - **Source-of-truth counts**: `governance/inventory.json` `counts` — page tallies (agents, skills, rules, commands, hooks) must match it |
| 25 | |
| 26 | ```bash |
| 27 | # Key sources to examine in the hatch3r repo |
| 28 | ls src/cli/commands/*.ts |
| 29 | ls agents/ skills/ rules/ commands/ hooks/ |
| 30 | ls docs/ |
| 31 | jq '.name, .description' package.json |
| 32 | jq '.counts' governance/inventory.json |
| 33 | ``` |
| 34 | |
| 35 | ## Step 2: Map corpus to the existing site |
| 36 | |
| 37 | The site's page set and navigation are already defined. Read both before editing so regeneration lands in the right files instead of creating new ones: |
| 38 | |
| 39 | ```bash |
| 40 | # Existing page tree and navigation — read before regenerating |
| 41 | find website/docs -name '*.md' | sort |
| 42 | cat website/sidebars.ts # docsSidebar: category -> doc-id ordering |
| 43 | cat website/docusaurus.config.ts # routeBasePath 'docs', navbar/footer links, mermaid theme |
| 44 | ``` |
| 45 | |
| 46 | Current top-level groups in `website/sidebars.ts` (`docsSidebar`): `about`, **Getting Started**, **Guides**, **Reference** (with **Architecture** and **Commands** sub-categories), `troubleshooting`. Every doc id listed in `sidebars.ts` MUST resolve to a file under `website/docs/` — `onBrokenLinks: 'throw'` and the sidebar-id check fail the build otherwise. |
| 47 | |
| 48 | Mapping rule: a corpus change updates the **existing** page that already documents that surface. Add a new page only when a new artifact class or CLI command has no home; when you add one, add its doc id to the matching category in `website/sidebars.ts` in the same change. |
| 49 | |
| 50 | ## Step 3: Regenerate pages in place |
| 51 | |
| 52 | Rewrite the affected files under `website/docs/**`. Keep each page's existing frontmatter shape: |
| 53 | |
| 54 | ```markdown |
| 55 | --- |
| 56 | sidebar_position: 1 |
| 57 | title: Page Title |
| 58 | description: Brief description for SEO |
| 59 | --- |
| 60 | |
| 61 | # Page Title |
| 62 | |
| 63 | Content here... |
| 64 | ``` |
| 65 | |
| 66 | Content guidelines: |
| 67 | |
| 68 | - Write for hatch3r **users** (people running `npx hatch3r`), not framework contributors. |
| 69 | - Keep counts and artifact lists synchronized with `governance/inventory.json` `counts`. |
| 70 | - Link between related docs with relative doc paths (e.g. `[workflow](../guides/workflow)`), not absolute URLs, so the broken-link check covers them. |
| 71 | - Do not duplicate `README.md` or `docs/` prose — link to it or lift the canonical wording |