name: h4tcher-release-prep description: Prepare a hatch3r release — version bump, changelog completeness + sync, repo + website docs currency, quality gates, adapter output verification, and release-notes reconciliation with CI. effort: high allowed-tools: Read Grep Glob Bash(*) Write Edit
Last updated: 2026-05-29
Release Prep
Prepare a hatch3r framework release with full quality gates. The dev runs Steps 1-10 locally; CI (.github/workflows/release.yml) re-runs the publish-critical subset and extracts the CHANGELOG.md section authored here as the GitHub release body.
Step 0: P8 B1 Ambiguity Gate
Before any version bump or write, scan the release intent against the four B1 triggers from .claude/rules/clarification-default.md (verbatim directive from governance/CONSTITUTION.md §2 P8 B1):
- Ambiguous scope — release line unclear (patch vs minor vs major); breaking-change scope undeclared; whether website + plugin manifests bump in lock-step.
- Multiple valid interpretations — release notes grouping (Adapters/Content/CLI/Governance/Dependencies/Chore) when a PR could land in two groups; whether to roll up multiple unreleased patch PRs into a minor.
- Irreversible action —
npm publish, force-push of a tag, force-push to main, marketplace re-submission with a public manifest change. - Missing acceptance criteria — CHANGELOG section header absent or version-mismatched; orphan PRs missing from the new section; lockfile or audit gate failing without owner assignment.
If any trigger fires, ask via the platform-native question tool per agents/shared/user-question-protocol.md: one question per turn; bundle related sub-questions into a single multiple-choice prompt; 2-4 numbered options with one-line trade-offs; declare the default-if-no-response option. Do NOT proceed to Step 1 until the ambiguity is resolved or the user has confirmed the default. This block subsumes the ad-hoc Step 9.31 "Confirm with user before pushing" prompt.
Step 1: Determine Version
- Check current version:
node -e "console.log(require('./package.json').version)" - Review changes since last tag:
git log $(git describe --tags --abbrev=0)..HEAD --oneline - Apply semver:
- Major: Breaking adapter contract changes, breaking canonical format changes
- Minor: New adapter, new content type, new CLI command
- Patch: Bug fixes, documentation, dependency updates
Step 2: Update Version
- Update
package.jsonversion field (single source of truth) - Update
.claude-plugin/plugin.jsonversion field to the same semver - Update the embedded manifest copy in
docs/marketplace-submission.md(search for"version":inside the plugin-manifest JSON block) to the same semver - Run
npm installto refresh lockfile version - Run
npm run inventory:check-docsto verify no version drift (the version probes inscripts/inventory.tscomparepackage.jsonagainst the files above) .cursor-plugin/plugin.jsonversion is tracked independently (Cursor plugin release cadence can diverge from hatch3r package cadence); bump only if the Cursor plugin changes
Step 3: Quality Gates
Run all gates — ALL must pass:
npm test— 0 failed testsnpx tsc --noEmit— 0 type errorsnpm run lint— 0 lint errorsnpm run build— build succeeds, output indist/npx hatch3r validate— 0 validation errors
Step 4: Adapter Verification
- Verify all 3 supported adapters (claude, cursor, copilot) are registered in
src/adapters/index.ts(count tracked dynamically atgovernance/inventory.json::counts.adapters— auto-derived per CONSTITUTION §6 Decision 12) - Verify
ADAPTER_CAPABILITIESmatrix is complete (no undefined entries) - Check that
package.jsonfilesarray includes all content directories:agents/,checks/,commands/,rules/,skills/,prompts/,github-agents/,mcp/,hooks/
Step 5: Lockfile & Supply Chain
- Verify lockfile integrity:
npx lockfile-lint --type npm --allowed-schemes https: --path package-lock.json - Run security audit:
npm audit --audit-level=moderate --omit=dev(aligned with.github/workflows/release.yml— local stricter than CI is fine; never looser)
Step 6: Changelog + PR Completeness
- Generate CHANGELOG entries grouped by: Adapters, Content, CLI, Governance, Dependencies, Chore
- Verify the new section header matches
package.jsonversion exactly:## [{version}] - {YYYY-MM-DD}(Keep-a-Changelog format — required by Step 9 CI extraction) - PR-completeness probe (gate). Every merged PR since the last tag MUST appear in the new CHANGELOG section by its
#NNNreference, or be explicitly classified asChoreand noted as omitted with rationale. Detect orphans:
Any line inLAST=$(git describe --tags --abbrev=0) git log "$LAST"..HEAD --merges --pretty=format:"%s" | grep -oE "#[0-9]+" | sort -u > /tmp/prs-merged.txt awk '/^## \[/{n++} n==1' CHANGELOG.md | grep -oE "#[0-9]+" | sort -u > /tmp/prs-changelog.txt diff /tmp/prs-merged.txt /tmp/prs-changelog.txtprs-merged.txtnot present inprs-changelog.txtis an orphan PR. STOP and add the entry (or document the Chore omission inline) before proceeding. - Prepend the new section to
CHANGELOG.mddirectly after the file header. Stage withgit add CHANGELOG.md.
Step 7: Repo Docs Currency
- Adapter capability matrix (
docs/adapter-capability-matrix.md) MUST reflect currentADAPTER_CAPABILITIESinsrc/adapters/index.ts. Spot-check that every column key from the source object appears as a row/column in the matrix; new capabilities added this cycle that are missing from the matrix are a blocker. - Feature-surface grep: any command/adapter/skill renamed or removed in this release MUST NOT appear by old name in
README.md,docs/mcp-setup.md,docs/troubleshooting.md,docs/marketplace-submission.md. Grep each for the removed names; zero hits required. - Re-run
npm run inventory:check-docsafter CHANGELOG and docs edits — must still report 0 drift.
Step 8: Website Build & Sync (website/)
The canonical Docusaurus site lives in website/ and deploys to docs.hatch3r.com via .github/workflows/deploy-docs.yml on push to main. onBrokenLinks: 'throw' in website/docusaurus.config.ts means broken links fail the build.
- Build the website locally to catch broken links before tagging:
0 errors required.cd website && npm ci && NODE_OPTIONS=--max-old-space-size=4096 npm run build && cd .. - Inventory parity. For any new command/adapter/skill since the last tag, verify a corresponding
website/docs/**/*.mdpage exists or is updated. Comparegovernance/inventory.jsoncountsagainst the sidebar groupings inwebsite/sidebars.tsand the page set inwebsite/docs/. - If
website/has unstaged edits, commit them alongside the release (docs(website): sync to v{version}).
Step 9: Tag & Release Notes
- Create annotated git tag:
git tag -a v{version} -m "hatch3r v{version}" - Confirm with user before pushing. On push, CI runs
.github/workflows/release.ymlwhich:- Re-validates tag version ==
package.jsonversion - Re-runs
npm ci, build, test,npm audit --audit-level=moderate --omit=dev - Publishes to npm with provenance
- Extracts the new
CHANGELOG.mdsection (matchingv{version}) and passes it as the GitHub release body viabody_path
- Re-validates tag version ==
- If the CHANGELOG section is missing or malformed for the tag version, the CI release step fails — fix
CHANGELOG.md, retag, and force-push the tag only with explicit user approval.
Step 10: Post-Release Verification
- After CI green, verify:
- npm package is published at the expected version:
npm view hatch3r@{version} version - GitHub release exists and body matches the CHANGELOG section:
gh release view v{version} - Docs site rebuilt with the new version (deploy-docs workflow ran on the merge commit): https://docs.hatch3r.com
- npm package is published at the expected version: