hatch3r 1.8.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -178
- package/dist/cli/index.js +26966 -15942
- package/{agents → dist/content/agents}/hatch3r-architect.md +39 -9
- package/dist/content/agents/hatch3r-brownfield-spec.md +254 -0
- package/{agents → dist/content/agents}/hatch3r-ci-watcher.md +10 -3
- package/{agents → dist/content/agents}/hatch3r-context-rules.md +24 -6
- package/{agents → dist/content/agents}/hatch3r-creator.md +78 -39
- package/dist/content/agents/hatch3r-dependency-drafter.md +162 -0
- package/{agents → dist/content/agents}/hatch3r-devops.md +14 -4
- package/{agents → dist/content/agents}/hatch3r-docs-writer.md +11 -1
- package/dist/content/agents/hatch3r-edge-case-analyst.md +134 -0
- package/dist/content/agents/hatch3r-enhancability.md +192 -0
- package/{agents → dist/content/agents}/hatch3r-fixer.md +61 -10
- package/dist/content/agents/hatch3r-greenfield-spec.md +256 -0
- package/{agents → dist/content/agents}/hatch3r-handoff-loader.md +40 -14
- package/{agents → dist/content/agents}/hatch3r-handoff-preparer.md +17 -8
- package/dist/content/agents/hatch3r-implementer.md +409 -0
- package/dist/content/agents/hatch3r-incident-responder.md +96 -0
- package/dist/content/agents/hatch3r-learnings-loader.md +377 -0
- package/{agents → dist/content/agents}/hatch3r-lint-fixer.md +16 -4
- package/dist/content/agents/hatch3r-maintainability.md +183 -0
- package/dist/content/agents/hatch3r-pack-installer.md +113 -0
- package/dist/content/agents/hatch3r-performance.md +179 -0
- package/dist/content/agents/hatch3r-reliability.md +193 -0
- package/{agents → dist/content/agents}/hatch3r-researcher.md +30 -7
- package/dist/content/agents/hatch3r-reviewer.md +364 -0
- package/dist/content/agents/hatch3r-scalability.md +162 -0
- package/dist/content/agents/hatch3r-security.md +197 -0
- package/dist/content/agents/hatch3r-testability.md +204 -0
- package/dist/content/agents/hatch3r-ui.md +175 -0
- package/dist/content/agents/hatch3r-ux.md +160 -0
- package/{agents → dist/content/agents}/modes/requirements-elicitation.md +1 -1
- package/{agents → dist/content/agents}/modes/user-flows.md +2 -2
- package/dist/content/agents/shared/clarification-default-block.md +44 -0
- package/dist/content/agents/shared/confidence-gate.md +42 -0
- package/dist/content/agents/shared/cq-specialist-roster.md +26 -0
- package/{agents → dist/content/agents}/shared/efficiency-patterns.md +32 -1
- package/{agents → dist/content/agents}/shared/external-knowledge.md +1 -1
- package/{agents → dist/content/agents}/shared/injection-patterns.md +19 -8
- package/dist/content/agents/shared/principles.md +60 -0
- package/{agents → dist/content/agents}/shared/prompt-structure.md +7 -1
- package/{agents → dist/content/agents}/shared/quality-charter.md +73 -9
- package/dist/content/agents/shared/quality-specialist-frame.md +141 -0
- package/dist/content/agents/shared/rigor-contract.md +151 -0
- package/dist/content/agents/shared/severity-mapping.md +92 -0
- package/dist/content/agents/shared/triage-vocabulary.md +46 -0
- package/{agents → dist/content/agents}/shared/user-content-templates.md +40 -14
- package/dist/content/agents/shared/user-question-protocol.md +139 -0
- package/{checks → dist/content/checks}/README.md +5 -0
- package/{checks → dist/content/checks}/accessibility.md +14 -7
- package/{checks → dist/content/checks}/code-quality.md +1 -1
- package/{checks → dist/content/checks}/performance.md +7 -4
- package/{checks → dist/content/checks}/security.md +6 -6
- package/{checks → dist/content/checks}/testing.md +1 -1
- package/{commands → dist/content/commands}/board/pickup-azure-devops.md +1 -1
- package/{commands → dist/content/commands}/board/pickup-delegation-multi.md +41 -14
- package/{commands → dist/content/commands}/board/pickup-delegation.md +10 -8
- package/{commands → dist/content/commands}/board/pickup-github.md +1 -1
- package/{commands → dist/content/commands}/board/pickup-gitlab.md +1 -1
- package/{commands → dist/content/commands}/board/pickup-modes.md +1 -0
- package/{commands → dist/content/commands}/board/pickup-post-impl.md +2 -2
- package/{commands → dist/content/commands}/board/shared-azure-devops.md +1 -1
- package/{commands → dist/content/commands}/board/shared-github.md +2 -2
- package/{commands → dist/content/commands}/board/shared-gitlab.md +1 -1
- package/{commands → dist/content/commands}/hatch3r-api-spec.md +80 -3
- package/dist/content/commands/hatch3r-auth-scaffold.md +250 -0
- package/{commands → dist/content/commands}/hatch3r-benchmark.md +91 -8
- package/{commands → dist/content/commands}/hatch3r-board-fill.md +104 -18
- package/{commands → dist/content/commands}/hatch3r-board-pickup.md +99 -15
- package/dist/content/commands/hatch3r-bug-pipeline.md +240 -0
- package/{commands → dist/content/commands}/hatch3r-bug-plan.md +84 -8
- package/{commands → dist/content/commands}/hatch3r-codebase-map.md +82 -6
- package/{commands → dist/content/commands}/hatch3r-create.md +116 -18
- package/{commands → dist/content/commands}/hatch3r-debug.md +112 -24
- package/dist/content/commands/hatch3r-diagnose.md +238 -0
- package/{commands → dist/content/commands}/hatch3r-feature-plan.md +130 -10
- package/dist/content/commands/hatch3r-handoff.md +213 -0
- package/{commands → dist/content/commands}/hatch3r-healthcheck.md +106 -6
- package/dist/content/commands/hatch3r-incident-response.md +228 -0
- package/{commands → dist/content/commands}/hatch3r-migration-plan.md +81 -5
- package/{commands → dist/content/commands}/hatch3r-onboard.md +100 -9
- package/dist/content/commands/hatch3r-pack-install.md +243 -0
- package/{commands → dist/content/commands}/hatch3r-pr-resolve.md +114 -31
- package/{commands → dist/content/commands}/hatch3r-project-spec.md +85 -9
- package/{commands → dist/content/commands}/hatch3r-quick-change.md +115 -20
- package/{commands → dist/content/commands}/hatch3r-refactor-plan.md +82 -6
- package/dist/content/commands/hatch3r-release.md +401 -0
- package/{commands → dist/content/commands}/hatch3r-revision.md +104 -18
- package/{commands → dist/content/commands}/hatch3r-roadmap.md +94 -12
- package/{commands → dist/content/commands}/hatch3r-security-audit.md +107 -7
- package/dist/content/commands/hatch3r-slo-scaffold.md +246 -0
- package/dist/content/commands/hatch3r-spec.md +216 -0
- package/{commands → dist/content/commands}/hatch3r-test-plan.md +90 -14
- package/dist/content/commands/hatch3r-workflow.md +628 -0
- package/{commands → dist/content/commands}/revision/revision-delegation.md +8 -7
- package/{commands → dist/content/commands}/revision/revision-modes.md +49 -4
- package/{commands → dist/content/commands}/revision/revision-quality.md +12 -9
- package/dist/content/commands/shared/orchestration-frame.md +119 -0
- package/{github-agents → dist/content/github-agents}/hatch3r-docs-agent.md +22 -2
- package/dist/content/github-agents/hatch3r-lint-agent.md +66 -0
- package/{github-agents → dist/content/github-agents}/hatch3r-security-agent.md +22 -2
- package/{github-agents → dist/content/github-agents}/hatch3r-test-agent.md +22 -2
- package/{hooks → dist/content/hooks}/hatch3r-ci-failure.md +3 -3
- package/{hooks → dist/content/hooks}/hatch3r-file-save.md +4 -4
- package/{hooks → dist/content/hooks}/hatch3r-post-merge.md +1 -1
- package/{hooks → dist/content/hooks}/hatch3r-pre-commit.md +1 -1
- package/{hooks → dist/content/hooks}/hatch3r-pre-push.md +7 -7
- package/dist/content/hooks/hatch3r-review-loop-cap.md +52 -0
- package/{hooks → dist/content/hooks}/hatch3r-session-start.md +3 -3
- package/{mcp → dist/content/mcp}/mcp.json +7 -5
- package/{rules → dist/content/rules}/hatch3r-accessibility-standards.md +16 -3
- package/{rules → dist/content/rules}/hatch3r-accessibility-standards.mdc +13 -1
- package/dist/content/rules/hatch3r-agent-orchestration-detail.md +250 -0
- package/dist/content/rules/hatch3r-agent-orchestration-detail.mdc +245 -0
- package/dist/content/rules/hatch3r-agent-orchestration.md +250 -0
- package/dist/content/rules/hatch3r-agent-orchestration.mdc +245 -0
- package/{rules → dist/content/rules}/hatch3r-ai-evals.md +7 -5
- package/{rules → dist/content/rules}/hatch3r-ai-evals.mdc +5 -4
- package/{rules → dist/content/rules}/hatch3r-ai-ux-patterns.md +7 -3
- package/{rules → dist/content/rules}/hatch3r-ai-ux-patterns.mdc +4 -1
- package/dist/content/rules/hatch3r-android-patterns.md +107 -0
- package/dist/content/rules/hatch3r-android-patterns.mdc +102 -0
- package/dist/content/rules/hatch3r-anti-duplication.md +115 -0
- package/dist/content/rules/hatch3r-anti-duplication.mdc +115 -0
- package/{rules → dist/content/rules}/hatch3r-api-design.md +5 -1
- package/{rules → dist/content/rules}/hatch3r-api-design.mdc +3 -0
- package/{rules → dist/content/rules}/hatch3r-api-versioning.md +3 -1
- package/{rules → dist/content/rules}/hatch3r-api-versioning.mdc +1 -0
- package/{rules → dist/content/rules}/hatch3r-auth-patterns.md +5 -2
- package/{rules → dist/content/rules}/hatch3r-auth-patterns.mdc +2 -0
- package/{rules → dist/content/rules}/hatch3r-browser-verification.md +8 -10
- package/{rules → dist/content/rules}/hatch3r-browser-verification.mdc +8 -10
- package/dist/content/rules/hatch3r-capability-matrix.md +108 -0
- package/dist/content/rules/hatch3r-capability-matrix.mdc +108 -0
- package/{rules → dist/content/rules}/hatch3r-ci-cd.md +9 -1
- package/{rules → dist/content/rules}/hatch3r-ci-cd.mdc +7 -0
- package/dist/content/rules/hatch3r-clarification-default.md +73 -0
- package/dist/content/rules/hatch3r-clarification-default.mdc +73 -0
- package/{rules → dist/content/rules}/hatch3r-code-standards.md +23 -47
- package/{rules → dist/content/rules}/hatch3r-code-standards.mdc +22 -46
- package/{rules → dist/content/rules}/hatch3r-component-conventions.md +4 -1
- package/{rules → dist/content/rules}/hatch3r-component-conventions.mdc +3 -0
- package/{rules → dist/content/rules}/hatch3r-container-hardening.md +13 -3
- package/{rules → dist/content/rules}/hatch3r-container-hardening.mdc +10 -1
- package/{rules → dist/content/rules}/hatch3r-contract-testing.md +3 -1
- package/{rules → dist/content/rules}/hatch3r-contract-testing.mdc +1 -0
- package/dist/content/rules/hatch3r-cost-visibility.md +135 -0
- package/dist/content/rules/hatch3r-cost-visibility.mdc +135 -0
- package/dist/content/rules/hatch3r-cq-rule-frame.md +54 -0
- package/dist/content/rules/hatch3r-cq-rule-frame.mdc +49 -0
- package/{rules → dist/content/rules}/hatch3r-data-classification.md +5 -2
- package/{rules → dist/content/rules}/hatch3r-data-classification.mdc +3 -1
- package/{rules → dist/content/rules}/hatch3r-deep-context.md +14 -14
- package/{rules → dist/content/rules}/hatch3r-deep-context.mdc +13 -13
- package/{rules → dist/content/rules}/hatch3r-dependency-management.md +18 -4
- package/{rules → dist/content/rules}/hatch3r-dependency-management.mdc +16 -3
- package/{rules → dist/content/rules}/hatch3r-design-system-detection.md +4 -2
- package/{rules → dist/content/rules}/hatch3r-design-system-detection.mdc +1 -0
- package/dist/content/rules/hatch3r-dotnet-patterns.md +104 -0
- package/dist/content/rules/hatch3r-dotnet-patterns.mdc +99 -0
- package/dist/content/rules/hatch3r-edge-case-discipline.md +65 -0
- package/dist/content/rules/hatch3r-edge-case-discipline.mdc +65 -0
- package/dist/content/rules/hatch3r-enhancability.md +147 -0
- package/dist/content/rules/hatch3r-enhancability.mdc +142 -0
- package/{rules → dist/content/rules}/hatch3r-event-schema-evolution.md +3 -1
- package/{rules → dist/content/rules}/hatch3r-event-schema-evolution.mdc +1 -0
- package/dist/content/rules/hatch3r-fan-out-discipline.md +91 -0
- package/dist/content/rules/hatch3r-fan-out-discipline.mdc +91 -0
- package/{rules → dist/content/rules}/hatch3r-feature-flags.md +2 -0
- package/{rules → dist/content/rules}/hatch3r-feature-flags.mdc +2 -0
- package/dist/content/rules/hatch3r-flutter-patterns.md +88 -0
- package/dist/content/rules/hatch3r-flutter-patterns.mdc +83 -0
- package/{rules → dist/content/rules}/hatch3r-git-conventions.md +5 -2
- package/{rules → dist/content/rules}/hatch3r-git-conventions.mdc +2 -0
- package/dist/content/rules/hatch3r-go-patterns.md +98 -0
- package/dist/content/rules/hatch3r-go-patterns.mdc +93 -0
- package/{rules → dist/content/rules}/hatch3r-handoff-readiness.md +14 -4
- package/{rules → dist/content/rules}/hatch3r-handoff-readiness.mdc +13 -3
- package/{rules → dist/content/rules}/hatch3r-i18n.md +3 -1
- package/{rules → dist/content/rules}/hatch3r-i18n.mdc +2 -0
- package/dist/content/rules/hatch3r-iteration-summary.md +108 -0
- package/dist/content/rules/hatch3r-iteration-summary.mdc +108 -0
- package/dist/content/rules/hatch3r-learning-system.md +202 -0
- package/dist/content/rules/hatch3r-learning-system.mdc +202 -0
- package/dist/content/rules/hatch3r-maintainability.md +157 -0
- package/dist/content/rules/hatch3r-maintainability.mdc +152 -0
- package/{rules → dist/content/rules}/hatch3r-migrations.md +4 -2
- package/{rules → dist/content/rules}/hatch3r-migrations.mdc +1 -0
- package/{rules → dist/content/rules}/hatch3r-observability-logging.md +2 -1
- package/{rules → dist/content/rules}/hatch3r-observability-logging.mdc +1 -0
- package/{rules → dist/content/rules}/hatch3r-observability-metrics.md +2 -1
- package/{rules → dist/content/rules}/hatch3r-observability-metrics.mdc +1 -0
- package/{rules → dist/content/rules}/hatch3r-observability-tracing.md +46 -36
- package/{rules → dist/content/rules}/hatch3r-observability-tracing.mdc +45 -35
- package/{rules → dist/content/rules}/hatch3r-operability.md +3 -1
- package/{rules → dist/content/rules}/hatch3r-operability.mdc +1 -0
- package/{rules → dist/content/rules}/hatch3r-passkey-server.md +4 -2
- package/{rules → dist/content/rules}/hatch3r-passkey-server.mdc +1 -0
- package/{rules → dist/content/rules}/hatch3r-performance-budgets.md +3 -1
- package/{rules → dist/content/rules}/hatch3r-performance-budgets.mdc +3 -1
- package/dist/content/rules/hatch3r-php-laravel-patterns.md +109 -0
- package/dist/content/rules/hatch3r-php-laravel-patterns.mdc +104 -0
- package/{rules → dist/content/rules}/hatch3r-progressive-delivery.md +5 -1
- package/{rules → dist/content/rules}/hatch3r-progressive-delivery.mdc +3 -0
- package/dist/content/rules/hatch3r-proof-model.md +131 -0
- package/dist/content/rules/hatch3r-proof-model.mdc +131 -0
- package/dist/content/rules/hatch3r-python-patterns.md +70 -0
- package/dist/content/rules/hatch3r-python-patterns.mdc +65 -0
- package/dist/content/rules/hatch3r-react-native-patterns.md +83 -0
- package/dist/content/rules/hatch3r-react-native-patterns.mdc +78 -0
- package/{rules → dist/content/rules}/hatch3r-resilience-patterns.md +3 -1
- package/{rules → dist/content/rules}/hatch3r-resilience-patterns.mdc +1 -0
- package/dist/content/rules/hatch3r-reviewer-calibration.md +84 -0
- package/dist/content/rules/hatch3r-reviewer-calibration.mdc +84 -0
- package/dist/content/rules/hatch3r-right-sizing.md +68 -0
- package/dist/content/rules/hatch3r-right-sizing.mdc +66 -0
- package/dist/content/rules/hatch3r-ruby-rails-patterns.md +111 -0
- package/dist/content/rules/hatch3r-ruby-rails-patterns.mdc +106 -0
- package/dist/content/rules/hatch3r-rust-patterns.md +107 -0
- package/dist/content/rules/hatch3r-rust-patterns.mdc +102 -0
- package/dist/content/rules/hatch3r-scalability.md +137 -0
- package/dist/content/rules/hatch3r-scalability.mdc +132 -0
- package/{rules → dist/content/rules}/hatch3r-secrets-management.md +12 -2
- package/{rules → dist/content/rules}/hatch3r-secrets-management.mdc +9 -0
- package/{rules → dist/content/rules}/hatch3r-security-patterns.md +38 -35
- package/{rules → dist/content/rules}/hatch3r-security-patterns.mdc +36 -34
- package/dist/content/rules/hatch3r-security.md +97 -0
- package/dist/content/rules/hatch3r-security.mdc +92 -0
- package/dist/content/rules/hatch3r-swiftui-patterns.md +98 -0
- package/dist/content/rules/hatch3r-swiftui-patterns.mdc +93 -0
- package/dist/content/rules/hatch3r-testability.md +115 -0
- package/dist/content/rules/hatch3r-testability.mdc +110 -0
- package/{rules → dist/content/rules}/hatch3r-testing.md +6 -2
- package/{rules → dist/content/rules}/hatch3r-testing.mdc +3 -0
- package/{rules → dist/content/rules}/hatch3r-theming.md +3 -1
- package/{rules → dist/content/rules}/hatch3r-theming.mdc +2 -0
- package/dist/content/rules/hatch3r-tool-currency.md +91 -0
- package/dist/content/rules/hatch3r-tool-currency.mdc +86 -0
- package/{rules → dist/content/rules}/hatch3r-tooling-hierarchy.md +30 -32
- package/{rules → dist/content/rules}/hatch3r-tooling-hierarchy.mdc +28 -31
- package/dist/content/rules/hatch3r-typescript-patterns.md +58 -0
- package/dist/content/rules/hatch3r-typescript-patterns.mdc +53 -0
- package/{rules → dist/content/rules}/hatch3r-ux-states-and-flows.md +13 -5
- package/{rules → dist/content/rules}/hatch3r-ux-states-and-flows.mdc +10 -3
- package/{skills → dist/content/skills}/hatch3r-a11y-audit/SKILL.md +11 -9
- package/{skills → dist/content/skills}/hatch3r-a11y-audit/references/manual-audit-checklist.md +7 -5
- package/dist/content/skills/hatch3r-adhoc-orchestrate/SKILL.md +131 -0
- package/{skills → dist/content/skills}/hatch3r-ai-feature/SKILL.md +4 -6
- package/{skills → dist/content/skills}/hatch3r-api-spec/SKILL.md +27 -2
- package/{skills → dist/content/skills}/hatch3r-architecture-review/SKILL.md +5 -8
- package/{commands/hatch3r-board-groom.md → dist/content/skills/hatch3r-board-groom/SKILL.md} +16 -18
- package/{commands/hatch3r-board-init.md → dist/content/skills/hatch3r-board-init/SKILL.md} +34 -31
- package/{commands/hatch3r-board-refresh.md → dist/content/skills/hatch3r-board-refresh/SKILL.md} +17 -19
- package/{commands/hatch3r-board-shared.md → dist/content/skills/hatch3r-board-shared/SKILL.md} +45 -15
- package/dist/content/skills/hatch3r-browser-verify/SKILL.md +307 -0
- package/{skills → dist/content/skills}/hatch3r-bug-fix/SKILL.md +16 -3
- package/{skills → dist/content/skills}/hatch3r-ci-pipeline/SKILL.md +17 -7
- package/{skills → dist/content/skills}/hatch3r-cli-fd/SKILL.md +34 -2
- package/{skills → dist/content/skills}/hatch3r-cli-fzf/SKILL.md +34 -2
- package/dist/content/skills/hatch3r-cli-gh/SKILL.md +139 -0
- package/{skills → dist/content/skills}/hatch3r-cli-jq/SKILL.md +43 -9
- package/{skills → dist/content/skills}/hatch3r-cli-ripgrep/SKILL.md +36 -4
- package/dist/content/skills/hatch3r-cli-toolbox/SKILL.md +376 -0
- package/dist/content/skills/hatch3r-containerize/SKILL.md +157 -0
- package/{skills → dist/content/skills}/hatch3r-context-health/SKILL.md +27 -9
- package/dist/content/skills/hatch3r-cost-tracking/SKILL.md +164 -0
- package/{skills → dist/content/skills}/hatch3r-customize/SKILL.md +9 -13
- package/{skills → dist/content/skills}/hatch3r-dep-audit/SKILL.md +29 -9
- package/{skills → dist/content/skills}/hatch3r-design-system-detect/SKILL.md +4 -8
- package/dist/content/skills/hatch3r-docs-writing/SKILL.md +159 -0
- package/dist/content/skills/hatch3r-enhancability-verify/SKILL.md +152 -0
- package/{skills → dist/content/skills}/hatch3r-feature/SKILL.md +54 -4
- package/dist/content/skills/hatch3r-feedback/SKILL.md +103 -0
- package/{skills → dist/content/skills}/hatch3r-gh-agentic-workflows/SKILL.md +14 -12
- package/{skills → dist/content/skills}/hatch3r-gh-agentic-workflows/references/azure-devops.md +2 -2
- package/{skills → dist/content/skills}/hatch3r-gh-agentic-workflows/references/gitlab-ci.md +1 -1
- package/{skills → dist/content/skills}/hatch3r-handoff-prepare/SKILL.md +12 -15
- package/{skills → dist/content/skills}/hatch3r-handoff-resume/SKILL.md +5 -8
- package/{commands/hatch3r-hooks.md → dist/content/skills/hatch3r-hooks/SKILL.md} +59 -148
- package/dist/content/skills/hatch3r-incident-response/SKILL.md +174 -0
- package/{skills → dist/content/skills}/hatch3r-issue-workflow/SKILL.md +15 -4
- package/dist/content/skills/hatch3r-learn/SKILL.md +317 -0
- package/{skills → dist/content/skills}/hatch3r-logical-refactor/SKILL.md +6 -7
- package/dist/content/skills/hatch3r-maintainability-verify/SKILL.md +146 -0
- package/{skills → dist/content/skills}/hatch3r-migration/SKILL.md +9 -8
- package/{skills → dist/content/skills}/hatch3r-observability-verify/SKILL.md +17 -13
- package/{skills → dist/content/skills}/hatch3r-perf-audit/SKILL.md +14 -10
- package/{skills → dist/content/skills}/hatch3r-pr-creation/SKILL.md +8 -11
- package/{skills → dist/content/skills}/hatch3r-qa-validation/SKILL.md +8 -7
- package/dist/content/skills/hatch3r-recipe/SKILL.md +174 -0
- package/{skills → dist/content/skills}/hatch3r-refactor/SKILL.md +7 -8
- package/dist/content/skills/hatch3r-release/SKILL.md +265 -0
- package/{skills → dist/content/skills}/hatch3r-reliability-verify/SKILL.md +9 -5
- package/{commands/hatch3r-report.md → dist/content/skills/hatch3r-report/SKILL.md} +21 -18
- package/dist/content/skills/hatch3r-scalability-verify/SKILL.md +145 -0
- package/dist/content/skills/hatch3r-security-verify/SKILL.md +144 -0
- package/dist/content/skills/hatch3r-team-convention-author/SKILL.md +126 -0
- package/dist/content/skills/hatch3r-testability-verify/SKILL.md +147 -0
- package/{skills → dist/content/skills}/hatch3r-ui-ux-verify/SKILL.md +20 -12
- package/{skills → dist/content/skills}/hatch3r-visual-refactor/SKILL.md +12 -8
- package/package.json +53 -46
- package/agents/hatch3r-a11y-auditor.md +0 -159
- package/agents/hatch3r-dependency-auditor.md +0 -219
- package/agents/hatch3r-implementer.md +0 -278
- package/agents/hatch3r-learnings-loader.md +0 -343
- package/agents/hatch3r-perf-profiler.md +0 -166
- package/agents/hatch3r-reviewer.md +0 -314
- package/agents/hatch3r-security-auditor.md +0 -180
- package/agents/hatch3r-test-writer.md +0 -171
- package/agents/shared/user-question-protocol.md +0 -95
- package/commands/hatch3r-agent-customize.md +0 -201
- package/commands/hatch3r-command-customize.md +0 -113
- package/commands/hatch3r-context-health.md +0 -147
- package/commands/hatch3r-cost-tracking.md +0 -163
- package/commands/hatch3r-dep-audit.md +0 -188
- package/commands/hatch3r-handoff.md +0 -133
- package/commands/hatch3r-learn.md +0 -312
- package/commands/hatch3r-recipe.md +0 -194
- package/commands/hatch3r-release.md +0 -350
- package/commands/hatch3r-rule-customize.md +0 -133
- package/commands/hatch3r-skill-customize.md +0 -112
- package/commands/hatch3r-workflow.md +0 -504
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.js.map +0 -1
- package/github-agents/hatch3r-lint-agent.md +0 -46
- package/prompts/hatch3r-bug-triage.md +0 -158
- package/prompts/hatch3r-code-review.md +0 -134
- package/prompts/hatch3r-pr-description.md +0 -176
- package/rules/hatch3r-agent-orchestration-detail.md +0 -211
- package/rules/hatch3r-agent-orchestration-detail.mdc +0 -206
- package/rules/hatch3r-agent-orchestration.md +0 -376
- package/rules/hatch3r-agent-orchestration.mdc +0 -371
- package/rules/hatch3r-iteration-summary.md +0 -90
- package/rules/hatch3r-iteration-summary.mdc +0 -85
- package/rules/hatch3r-learning-consult.md +0 -42
- package/rules/hatch3r-learning-consult.mdc +0 -38
- package/rules/hatch3r-observability-tracing-detail.md +0 -20
- package/rules/hatch3r-observability-tracing-detail.mdc +0 -14
- package/rules/hatch3r-observability.md +0 -20
- package/rules/hatch3r-observability.mdc +0 -14
- package/skills/hatch3r-agent-customize/SKILL.md +0 -23
- package/skills/hatch3r-cli-aichat/SKILL.md +0 -84
- package/skills/hatch3r-cli-ast-grep/SKILL.md +0 -85
- package/skills/hatch3r-cli-az-devops/SKILL.md +0 -89
- package/skills/hatch3r-cli-bat/SKILL.md +0 -85
- package/skills/hatch3r-cli-comby/SKILL.md +0 -85
- package/skills/hatch3r-cli-csvkit/SKILL.md +0 -84
- package/skills/hatch3r-cli-delta/SKILL.md +0 -86
- package/skills/hatch3r-cli-difftastic/SKILL.md +0 -84
- package/skills/hatch3r-cli-docker/SKILL.md +0 -89
- package/skills/hatch3r-cli-duckdb/SKILL.md +0 -84
- package/skills/hatch3r-cli-gh/SKILL.md +0 -90
- package/skills/hatch3r-cli-glab/SKILL.md +0 -89
- package/skills/hatch3r-cli-lazygit/SKILL.md +0 -78
- package/skills/hatch3r-cli-llm/SKILL.md +0 -84
- package/skills/hatch3r-cli-miller/SKILL.md +0 -84
- package/skills/hatch3r-cli-mods/SKILL.md +0 -84
- package/skills/hatch3r-cli-overview/SKILL.md +0 -60
- package/skills/hatch3r-cli-playwright/SKILL.md +0 -89
- package/skills/hatch3r-cli-podman/SKILL.md +0 -84
- package/skills/hatch3r-cli-qsv/SKILL.md +0 -91
- package/skills/hatch3r-cli-rtk/SKILL.md +0 -91
- package/skills/hatch3r-cli-sd/SKILL.md +0 -85
- package/skills/hatch3r-cli-stagehand/SKILL.md +0 -111
- package/skills/hatch3r-cli-taplo/SKILL.md +0 -84
- package/skills/hatch3r-cli-yq/SKILL.md +0 -85
- package/skills/hatch3r-cli-zstd/SKILL.md +0 -85
- package/skills/hatch3r-command-customize/SKILL.md +0 -23
- package/skills/hatch3r-cost-tracking/SKILL.md +0 -92
- package/skills/hatch3r-incident-response/SKILL.md +0 -115
- package/skills/hatch3r-recipe/SKILL.md +0 -91
- package/skills/hatch3r-release/SKILL.md +0 -120
- package/skills/hatch3r-rule-customize/SKILL.md +0 -23
- package/skills/hatch3r-skill-customize/SKILL.md +0 -23
- /package/{agents → dist/content/agents}/modes/architecture.md +0 -0
- /package/{agents → dist/content/agents}/modes/boundary-analysis.md +0 -0
- /package/{agents → dist/content/agents}/modes/codebase-impact.md +0 -0
- /package/{agents → dist/content/agents}/modes/complexity-risk.md +0 -0
- /package/{agents → dist/content/agents}/modes/coverage-analysis.md +0 -0
- /package/{agents → dist/content/agents}/modes/current-state.md +0 -0
- /package/{agents → dist/content/agents}/modes/feature-design.md +0 -0
- /package/{agents → dist/content/agents}/modes/impact-analysis.md +0 -0
- /package/{agents → dist/content/agents}/modes/library-docs.md +0 -0
- /package/{agents → dist/content/agents}/modes/migration-path.md +0 -0
- /package/{agents → dist/content/agents}/modes/prior-art.md +0 -0
- /package/{agents → dist/content/agents}/modes/refactoring-strategy.md +0 -0
- /package/{agents → dist/content/agents}/modes/regression.md +0 -0
- /package/{agents → dist/content/agents}/modes/risk-assessment.md +0 -0
- /package/{agents → dist/content/agents}/modes/risk-prioritization.md +0 -0
- /package/{agents → dist/content/agents}/modes/root-cause.md +0 -0
- /package/{agents → dist/content/agents}/modes/similar-implementation.md +0 -0
- /package/{agents → dist/content/agents}/modes/symptom-trace.md +0 -0
- /package/{agents → dist/content/agents}/modes/test-pattern.md +0 -0
- /package/{commands → dist/content/commands}/board/shared-board-overview.md +0 -0
- /package/{commands → dist/content/commands}/revision/revision-board-integration.md +0 -0
- /package/{skills → dist/content/skills}/hatch3r-issue-workflow/references/delegation-patterns.md +0 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-bug-pipeline
|
|
3
|
+
type: command
|
|
4
|
+
orchestrator: true
|
|
5
|
+
agentPipeline: [hatch3r-researcher, hatch3r-implementer, hatch3r-reviewer, hatch3r-fixer]
|
|
6
|
+
description: Run a known-cause bug fix through a 3-phase test-first pipeline -- reproduce + root-cause, regression-test + fix together, then root-cause-depth review -- with full sub-agent delegation.
|
|
7
|
+
tags: [implementation, orchestration]
|
|
8
|
+
quality_charter: agents/shared/quality-charter.md
|
|
9
|
+
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
10
|
+
cache_friendly: true
|
|
11
|
+
parallel_tool_default: true
|
|
12
|
+
efficiency_tier: standard
|
|
13
|
+
triage_tiers: [1, 2, 3]
|
|
14
|
+
supports_resume: true
|
|
15
|
+
sub_agents_spawned:
|
|
16
|
+
count: 4
|
|
17
|
+
rationale: One researcher (merged reproduce + root-cause), one implementer (regression test + fix authored together, TDD-style), then a reviewer ↔ fixer loop on root-cause depth; the canonical four-phase Final Quality specialists collapse onto the implementer's bundled regression test plus the reviewer's root-cause-depth gate. Cost-dominance per CONSTITUTION §2 P8 — token cost never serializes independent work.
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## §0 Detect Ambiguity (P8 B1)
|
|
21
|
+
|
|
22
|
+
Before any action, scan the bug report for unresolved questions in scope, acceptance criteria, irreversibility, or constraint conflicts (no reproduction steps, expected-vs-actual behavior unstated, severity unclear, affected environment unknown, or a fix that touches a schema / public API with downstream consumers). If any are found, ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md` — do not proceed under silent assumption. This is the default path, not an exception. Acceptable to proceed without asking ONLY when the bug is single-module, reproduction is known, and the brief alone is testable. Residual ambiguity discovered mid-pipeline invokes the same protocol.
|
|
23
|
+
|
|
24
|
+
## Agent Pipeline
|
|
25
|
+
|
|
26
|
+
| Stage | Agent(s) | Parallel | Required |
|
|
27
|
+
|-------|----------|----------|----------|
|
|
28
|
+
| 1. Reproduce + Root-Cause | `hatch3r-researcher` (modes: `symptom-trace`, `root-cause`; `codebase-impact` for Tier 3) | Per mode | Yes |
|
|
29
|
+
| 2. Regression-Test + Fix | `hatch3r-implementer` (failing test first, then minimal fix) | Per independent module | Yes |
|
|
30
|
+
| 3. Root-Cause-Depth Review | `hatch3r-reviewer` -> `hatch3r-fixer` (max 4 iterations) | No (sequential) | Yes |
|
|
31
|
+
|
|
32
|
+
**Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): every parallel fan-out above holds all three — read-only or disjoint writes, deterministic aggregation, no shared mutable state.
|
|
33
|
+
|
|
34
|
+
# Bug Pipeline — Test-First 3-Phase Fix Delegation
|
|
35
|
+
|
|
36
|
+
A bug-shaped variant of the four-phase pipeline for the case where the symptom is known and the fix is in hand but the change still needs full delegation rigor. The default four-phase pipeline writes the regression test in Phase 4, *after* the fix already landed; for a bug the regression test should drive the fix. This command compresses the pipeline to the bug's natural shape: **reproduce + root-cause (Phase 1) → regression-test + fix authored together, TDD-style (Phase 2) → root-cause-depth review (Phase 3)**, with security as the primary review lens because regressions frequently sit on a validation or auth edge.
|
|
37
|
+
|
|
38
|
+
**When to use this command vs. the `hatch3r-bug-fix` skill vs. `hatch3r-bug-plan`:**
|
|
39
|
+
|
|
40
|
+
- Use `hatch3r-bug-pipeline` when: the root cause is known or strongly hypothesized, a fix is in hand, but the change is nontrivial (multi-file, behavior change, security-adjacent) and must go through delegated implementer + reviewer ↔ fixer rigor rather than inline edits.
|
|
41
|
+
- Use the `hatch3r-bug-fix` skill when: the fix is localized and trivial enough for single-pass inline work (single file, clear root cause, low risk).
|
|
42
|
+
- Use `hatch3r-bug-plan` when: the root cause is unknown, multiple modules might be involved, or the fix needs multi-PR phasing — that command produces an investigation report, not a fix.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Token-Saving Directives
|
|
47
|
+
|
|
48
|
+
1. **Do not re-read cached files.** Once researcher output (symptom trace + ranked root cause) is collected, reference it in memory — do not re-invoke.
|
|
49
|
+
2. **Targeted reads only.** Read only files on the failure path identified by the researcher.
|
|
50
|
+
3. **Structured output only.** Every sub-agent prompt requires structured markdown output — no prose dumps.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Confidence Propagation Contract
|
|
55
|
+
|
|
56
|
+
Every sub-agent delegation prompt in this command MUST include the confidence expression requirement below (verbatim). Sub-agents are invoked with the `quality_charter: agents/shared/quality-charter.md` reference in their frontmatter, but the orchestrator repeats the directive to override runtime prompt defaults per the charter §1 rule.
|
|
57
|
+
|
|
58
|
+
> Confidence expression requirement: rate every recommendation and finding as high/medium/low confidence per the quality charter (`agents/shared/quality-charter.md`). High = verified against current code. Medium = pattern-based, not fully verified. Low = best judgment, recommend human review.
|
|
59
|
+
|
|
60
|
+
Downstream propagation: every ASK checkpoint that reports verification quality, every gate that evaluates a sub-agent verdict, and every output block that surfaces fix-readiness MUST carry a high/medium/low confidence rating sourced from the upstream sub-agent. Dropping the signal between stages is a gate failure.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Workflow
|
|
65
|
+
|
|
66
|
+
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK, using the platform-native question tool per `agents/shared/user-question-protocol.md`.
|
|
67
|
+
|
|
68
|
+
## Step 0: Triage
|
|
69
|
+
|
|
70
|
+
Classify the bug before delegating:
|
|
71
|
+
|
|
72
|
+
- **Tier 1 (trivial)**: single-file, clear root cause, reproduction known. Route to the `hatch3r-bug-fix` skill and exit — this pipeline's delegation overhead is not warranted.
|
|
73
|
+
- **Tier 2 (standard)**: multi-file or behavior-changing fix with a known or strongly-hypothesized root cause. Run the full 3-phase pipeline below.
|
|
74
|
+
- **Tier 3 (deep)**: multi-module, security-adjacent, or high blast-radius fix. Run the full pipeline with researcher depth `deep`, the `codebase-impact` mode added in Phase 1, and a user scope confirmation before Phase 2.
|
|
75
|
+
|
|
76
|
+
If the root cause is genuinely unknown, recommend `hatch3r-bug-plan` (investigation-first) instead and exit.
|
|
77
|
+
|
|
78
|
+
### Step 0.5: Emit Pre-Execution Cost Preview
|
|
79
|
+
|
|
80
|
+
Before the first sub-agent dispatch (Step 2), surface the cost preview so a delegated bug fix is never started blind. Emit the `cost_estimate` block per `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate, calibrated to the Step 0 triage tier:
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
cost_estimate:
|
|
84
|
+
expected_sa_count: <Tier 1 routes out (0), Tier 2 ~3, Tier 3 ~4>
|
|
85
|
+
estimated_input_tokens_static_frame: <int>
|
|
86
|
+
estimated_web_research_queries: <int> # 0 when no research is needed
|
|
87
|
+
triage_tier: light | standard | deep
|
|
88
|
+
estimated_duration_min: <int>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Post-execution actuals + delta land in the iteration summary's Fan-out + Cost section per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`; estimation primitives from `src/pipeline/costEstimator.ts`.
|
|
92
|
+
|
|
93
|
+
### Effort Override (Decision 17)
|
|
94
|
+
|
|
95
|
+
Auto-tiering can misclassify — a single-module bug scored Deep, or a multi-module regression scored Light. The user override is the recovery path mandated by hatch3r's universal `--effort` override contract ("User overridable via `--effort` flag"):
|
|
96
|
+
|
|
97
|
+
- `--effort=light|standard|deep` forces the named tier, bypassing the Step 0 auto-classification. `--effort=light` routes to the `hatch3r-bug-fix` skill.
|
|
98
|
+
- The override wins over the auto-detected tier; record both the auto-detected tier and the override in the run context so the cost estimate block reports the budget delta.
|
|
99
|
+
- No override passed → the Step 0 auto-classification stands.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### Step 1: Reproduce + Root-Cause (Phase 1)
|
|
104
|
+
|
|
105
|
+
Spawn `hatch3r-researcher` following the **hatch3r-researcher agent protocol** with the merged reproduce-and-diagnose modes. This single phase replaces the default pipeline's separate research and blast-radius passes — for a bug, "where does it diverge" and "why" are one investigation.
|
|
106
|
+
|
|
107
|
+
**Modes:** `symptom-trace` (execution path from user action to the divergence point) and `root-cause` (ranked hypotheses with code evidence). For Tier 3, add `codebase-impact` (blast radius across modules + data-integrity risk).
|
|
108
|
+
|
|
109
|
+
**Depth:** `quick` for Tier 1 (if it was not routed out), `standard` for Tier 2, `deep` for Tier 3.
|
|
110
|
+
|
|
111
|
+
The researcher prompt MUST include: the bug brief (symptoms, expected behavior, reproduction context, severity, prior attempts), the assigned modes + depth, the **hatch3r-researcher agent protocol** instruction, a `correlation_id` (UUID v4 per `rules/hatch3r-agent-orchestration.md` → Correlation ID), and the confidence expression requirement above.
|
|
112
|
+
|
|
113
|
+
Apply the **Research Completeness Checklist** (`rules/hatch3r-agent-orchestration.md`) before handing off to Phase 2: affected files identified, blast radius assessed (Tier 3), existing tests located (or absence noted), dependencies mapped. If any item is unconfirmed, re-run the researcher with additional modes or surface to the user.
|
|
114
|
+
|
|
115
|
+
**ASK:** "Top root-cause hypothesis: {hypothesis} (confidence {high/medium/low}). Reproduction path: {summary}. Proceed to author a failing regression test + fix? (yes / adjust hypothesis / re-run researcher)"
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### Step 2: Regression-Test + Fix Authored Together (Phase 2)
|
|
120
|
+
|
|
121
|
+
Spawn `hatch3r-implementer` via the Task tool (`subagent_type: "generalPurpose"`). Unlike the default pipeline — where hatch3r-testability runs in Phase 4 after the fix — this phase authors the failing regression test FIRST, then the minimal fix that makes it pass.
|
|
122
|
+
|
|
123
|
+
The implementer prompt MUST include the confirmed root cause + reproduction path from Step 1, all `scope: always` rule directives from `rules/`, the `correlation_id`, the confidence expression requirement, an explicit instruction NOT to create branches / commits / PRs, and the following test-first contract (verbatim):
|
|
124
|
+
|
|
125
|
+
> Test-first contract: (1) Write a regression test that reproduces the exact bug scenario and FAILS against current code with the reported symptom — not a setup error. (2) Confirm the test fails for the right reason. (3) Implement the minimal fix at the root cause; do not refactor unrelated code, do not suppress the symptom (no `eslint-disable`, no `as any`, no `test.skip`). (4) Confirm the regression test now passes and no existing test regressed. (5) Return the failing-then-passing evidence in your structured result.
|
|
126
|
+
|
|
127
|
+
The implementer also returns the **midpoint research-gap checkpoint** result per `rules/hatch3r-agent-orchestration.md` → Mid-Implementation Research Gap Checkpoint: if the fix touches a file outside the researcher's affected-files set, an undocumented dependency, or confidence drops below medium, log the gap and either request a targeted researcher re-run (blocking) or document the assumption for Phase 3 reviewer attention (non-blocking).
|
|
128
|
+
|
|
129
|
+
If the fix spans **independent modules** (no shared files), spawn one implementer per module and run them in parallel. **Overlapping files** run sequentially through a single implementer to avoid conflicts.
|
|
130
|
+
|
|
131
|
+
Await the implementer result. If it reports BLOCKED, **ASK** the user for guidance.
|
|
132
|
+
|
|
133
|
+
After the implementer returns, run the project quality gates (lint, typecheck, full test suite — see `package.json` scripts). The regression test must pass and the existing suite must stay green before Phase 3.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### Step 3: Root-Cause-Depth Review (Phase 3)
|
|
138
|
+
|
|
139
|
+
Run an iterative review loop (max 4 iterations, matching `DEFAULT_MAX_REVIEW_ITERATIONS` in `src/pipeline/reviewLoop.ts`) until 0 Critical + 0 Warning findings remain. The review lens for a bug fix is **root-cause depth and regression-test validity**, not feature completeness.
|
|
140
|
+
|
|
141
|
+
1. Spawn `hatch3r-reviewer` via the Task tool. The prompt MUST include the working-tree diff (`git diff`), the confirmed root cause from Step 1, the failing-then-passing test evidence from Step 2, all `scope: always` rule directives, the iteration number + prior findings (if not the first pass), the `correlation_id`, the confidence expression requirement, and a top-level `confidence: high | medium | low` output requirement so the gate can evaluate it deterministically. Focus the reviewer on:
|
|
142
|
+
- **Root-cause depth** — does the fix address the cause or only mask the symptom? Reject suppression patterns (`eslint-disable`, `as any`, `as unknown as`, `@ts-ignore`, `test.skip`, empty catch blocks) per `rules/hatch3r-agent-orchestration.md` → Root-Cause Depth Requirements.
|
|
143
|
+
- **Regression-test validity** — does the test actually fail without the fix and assert the corrected behavior, not an incidental side effect?
|
|
144
|
+
- **Security edge** — regressions frequently sit on a validation, auth, or input-handling boundary; verify the fix does not open one.
|
|
145
|
+
|
|
146
|
+
2. Process reviewer output:
|
|
147
|
+
- **0 Critical + 0 Warning AND reviewer confidence != low** → review loop clean; proceed to Step 4.
|
|
148
|
+
- **0 Critical + 0 Warning AND reviewer confidence == low** → trigger a second reviewer pass before exiting; do not proceed until it returns non-low confidence OR the user explicitly accepts the low-confidence PASS.
|
|
149
|
+
- **Critical or Warning findings remain** → spawn `hatch3r-fixer` with the full reviewer output + all `scope: always` directives + the confidence expression requirement, then re-run the reviewer (next iteration). After fixes, re-run quality gates.
|
|
150
|
+
|
|
151
|
+
3. If 4 iterations complete and findings remain, surface a structured summary (iteration count, remaining Critical findings with file:line, remaining Warnings, fix-manually-vs-accept-risk recommendation) and **ASK** the user whether to proceed or fix manually. Never present raw reviewer output unsummarized.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### Step 4: Summary + Git Action
|
|
156
|
+
|
|
157
|
+
1. Present a concise completion summary:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
Bug Pipeline Complete:
|
|
161
|
+
Root cause: {one-line root cause}
|
|
162
|
+
Regression test: {test name/path — failed before, passes after}
|
|
163
|
+
Files changed: {file list}
|
|
164
|
+
Quality: lint {pass/fail}, types {pass/fail}, tests {pass/fail}
|
|
165
|
+
Review: {N iterations, clean}
|
|
166
|
+
Confidence: {high/medium/low — overall assessment of fix correctness}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
2. **ASK:** "All changes complete. Quality gates pass. How should I handle git? (a) commit only, (b) commit and push, (c) skip git — leave changes in working tree"
|
|
170
|
+
|
|
171
|
+
Commit message format: `fix: {short root-cause-oriented description}`. For pushes, fall back to `git push -u origin {branch}` when no upstream exists.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Resumability (Decision 27/30)
|
|
176
|
+
|
|
177
|
+
bug-pipeline is multi-phase — a Tier 2/3 run dispatches a researcher (Step 1), one or more implementers authoring regression test + fix (Step 2), and a reviewer ↔ fixer loop (Step 3). Per hatch3r's workspace-checkpointed resumability contract, checkpoint progress so an interrupted run re-enters at the last completed step rather than re-running the researcher or re-implementing a fix that already landed.
|
|
178
|
+
|
|
179
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.bug-pipeline-workspace/`; step range the Step 0 → Step 4 progression; `wave` = review-loop iteration index in Step 3; snapshot/rollback paths the working-tree state. Write points: after Step 1 researcher returns and the root-cause ASK is confirmed, after each Step 2 implementer returns per module (so a landed fix + regression test survive a crash), after Step 2 quality gates pass, after each Step 3 review-loop iteration, and after the Step 4 git action.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Per-Turn Pipeline-State Header (Bypass Protection)
|
|
184
|
+
|
|
185
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for bug-pipeline: `1` = reproduce + root-cause (researcher), `2` = regression-test + fix (implementer), `3` = root-cause-depth review (reviewer ↔ fixer), `4` = summary + git + iteration-summary. Tier 1 runs route out to the `hatch3r-bug-fix` skill and are exempt per the Tier 1 exemption.
|
|
186
|
+
|
|
187
|
+
## End-of-Turn Delegation Attestation (Bypass Protection)
|
|
188
|
+
|
|
189
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: regression test, fix, fixer changes. This command has no Tier-1 inline carve-out: Tier 1 bugs route to the `hatch3r-bug-fix` skill, so every mutation here flows through a sub-agent.
|
|
190
|
+
|
|
191
|
+
## Iteration Summary (mandatory output)
|
|
192
|
+
|
|
193
|
+
Emit the canonical 9-section iteration summary per `rules/hatch3r-iteration-summary.md` as the final user-facing output. The validation gate at `.claude/rules/capability-lifecycle.md` blocks SUCCESS declarations without this block (CONSTITUTION §6 Decision 23).
|
|
194
|
+
|
|
195
|
+
The 9 sections:
|
|
196
|
+
|
|
197
|
+
1. **Request** — verbatim restatement of the user's ask in one sentence.
|
|
198
|
+
2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
|
|
199
|
+
3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
|
|
200
|
+
4. **Files Mutated** — list with diff summary (lines added / removed / files created).
|
|
201
|
+
5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
|
|
202
|
+
6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
|
|
203
|
+
7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
|
|
204
|
+
8. **Open Questions / Blockers** — explicit `None` if fully closed.
|
|
205
|
+
9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
|
|
206
|
+
|
|
207
|
+
### Cost Visibility (Decision 24)
|
|
208
|
+
|
|
209
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Cost Estimate for the 5-field `cost_estimate` schema and the post-execution `cost_actuals` + `delta` contract; both land in Section 2 above.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Error Handling
|
|
214
|
+
|
|
215
|
+
- **Researcher cannot confirm a root cause:** if all hypotheses are low-confidence, do not author a speculative fix. State the verdict ("Root cause unconfirmed; top hypothesis confidence=low") and recommend switching to `hatch3r-bug-plan` for a full investigation. **ASK** how to proceed.
|
|
216
|
+
- **Regression test passes before the fix:** the test does not reproduce the bug. Halt Phase 2, return to Step 1, and re-derive the reproduction path with the researcher — a test that cannot fail proves nothing.
|
|
217
|
+
- **Implementer sub-agent failure:** retry once. If the retry fails, present the partial state and **ASK** (provide the missing context manually / route to `hatch3r-bug-plan` / abort).
|
|
218
|
+
- **Reviewer flags a superficial fix:** the fixer must address the root cause, not re-suppress the symptom. If the same suppression pattern reappears across two iterations, surface it to the user — do not let it ship.
|
|
219
|
+
- **Quality gate failure after fixer:** re-run gates after every fixer pass. After 2 unresolved retries within Step 3, surface the specific failures and **ASK** (fix manually / keep iterating / abort).
|
|
220
|
+
- **File write failure:** report the error and provide the full file content so the user can apply it manually.
|
|
221
|
+
|
|
222
|
+
## Guardrails
|
|
223
|
+
|
|
224
|
+
- **Never skip the regression test.** A bug fix without a failing-then-passing test is incomplete — the test is the proof the fix works and the guard against recurrence.
|
|
225
|
+
- **Never suppress the symptom.** Reject `eslint-disable`, `as any`, `test.skip`, and empty catch blocks as fixes per `rules/hatch3r-agent-orchestration.md` → Root-Cause Depth Requirements.
|
|
226
|
+
- **Always delegate code mutation.** All code changes flow through `hatch3r-implementer` (Phase 2) or `hatch3r-fixer` (Phase 3) via the Task tool — no inline edits from the orchestrator turn.
|
|
227
|
+
- **Never skip quality gates.** Lint, typecheck, and the full test suite run after Phase 2 and after every fixer pass.
|
|
228
|
+
- **Never auto-commit without ASK (Step 4).** The user always decides the git action.
|
|
229
|
+
- **Stay within the bug scope.** Do not expand the fix into adjacent refactors or feature work. Flag tangential findings but do not act on them without explicit approval.
|
|
230
|
+
- **This command composes existing hatch3r agents** (researcher, implementer, reviewer, fixer) — it does not replace them or the default four-phase pipeline; it is the bug-shaped variant for known-cause, fix-in-hand work.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## References
|
|
235
|
+
|
|
236
|
+
- `commands/hatch3r-bug-plan.md` — sibling investigation-first command (unknown root cause); accessed 2026-05-31; trust tier: official-docs (in-repo canonical).
|
|
237
|
+
- `commands/hatch3r-quick-change.md` — orchestrator command structure + Per-Turn Header / Delegation Attestation / Iteration Summary block patterns mirrored here; accessed 2026-05-31; trust tier: official-docs (in-repo canonical).
|
|
238
|
+
- `rules/hatch3r-agent-orchestration.md` — four-phase pipeline definition, Mandatory Delegation Directives, Root-Cause Depth Requirements, Mid-Implementation Research Gap Checkpoint; accessed 2026-05-31; trust tier: official-docs (in-repo canonical).
|
|
239
|
+
- `skills/hatch3r-bug-fix/SKILL.md` — Step 2c test-first (TDD) approach this pipeline promotes to a first-class phase; accessed 2026-05-31; trust tier: official-docs (in-repo canonical).
|
|
240
|
+
- hatch3r orchestration-domain analysis — source rationale for the bug-fix workflow's natural 3-phase shape; accessed 2026-05-31; trust tier: official-docs (in-repo canonical).
|
|
@@ -4,20 +4,22 @@ type: command
|
|
|
4
4
|
orchestrator: true
|
|
5
5
|
agentPipeline: [hatch3r-researcher, hatch3r-docs-writer]
|
|
6
6
|
description: Diagnose a complex incident -- reproduce the symptom, rank root-cause hypotheses, design the fix path, and emit regression coverage items as a board-ready investigation
|
|
7
|
-
tags: [
|
|
7
|
+
tags: [planning, orchestration]
|
|
8
8
|
quality_charter: agents/shared/quality-charter.md
|
|
9
9
|
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
10
10
|
cache_friendly: true
|
|
11
11
|
parallel_tool_default: true
|
|
12
|
+
efficiency_tier: deep
|
|
12
13
|
triage_tiers: [1, 2, 3]
|
|
14
|
+
supports_resume: true
|
|
13
15
|
sub_agents_spawned:
|
|
14
16
|
count: 4
|
|
15
|
-
rationale: Four parallel hatch3r-researcher modes per bug brief — symptom-trace, root-cause-hypothesis, impact-assessment, regression-research — dispatched concurrently in Step 3; a docs-writer assembles the investigation report on their merged output.
|
|
17
|
+
rationale: Four parallel hatch3r-researcher modes per bug brief — symptom-trace, root-cause-hypothesis, impact-assessment, regression-research — dispatched concurrently in Step 3; a docs-writer assembles the investigation report on their merged output. Cost-dominance per CONSTITUTION §2 P8 — token cost never serializes independent work.
|
|
16
18
|
---
|
|
17
19
|
|
|
18
20
|
## §0 Detect Ambiguity (P8 B1)
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → §0 Detect Ambiguity (P8 B1). Triggers: contradictory inputs, missing target, unknown convention.
|
|
21
23
|
|
|
22
24
|
## Agent Pipeline
|
|
23
25
|
|
|
@@ -27,6 +29,8 @@ Before any action, scan the user's request and provided context for unresolved q
|
|
|
27
29
|
| 2. Document Generation | `hatch3r-docs-writer` (investigation report, ADRs) | Yes | Yes |
|
|
28
30
|
| 3. Todo Generation | Orchestrator (inline) | No | Yes |
|
|
29
31
|
|
|
32
|
+
**Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): every parallel fan-out above holds all three — read-only or disjoint writes, deterministic aggregation, no shared mutable state.
|
|
33
|
+
|
|
30
34
|
# Bug Plan — Complex Bug Investigation from Symptom to Board-Ready Fix Items
|
|
31
35
|
|
|
32
36
|
Take a complex or ambiguous bug report and produce a structured investigation report (`docs/investigations/`), architectural decision records (`docs/adr/`) when the fix requires significant design choices, and structured `todo.md` entries (scoped fix items) ready for `hatch3r-board-fill`. Spawns parallel researcher sub-agents (symptom tracing, root cause investigation, impact assessment, regression research) to diagnose the bug from multiple angles before generating artifacts. AI proposes all outputs; user confirms before any files are written. Optionally chains into `hatch3r-board-fill` to create GitHub issues immediately.
|
|
@@ -40,7 +44,7 @@ Take a complex or ambiguous bug report and produce a structured investigation re
|
|
|
40
44
|
|
|
41
45
|
## Shared Context
|
|
42
46
|
|
|
43
|
-
**Read the `hatch3r-board-shared`
|
|
47
|
+
**Read the `hatch3r-board-shared` skill at the start of the run** if it exists. While this command does not perform board operations directly, it establishes patterns and context (GitHub owner/repo, tooling directives) that downstream commands like `hatch3r-board-fill` rely on. Cache any values found.
|
|
44
48
|
|
|
45
49
|
## Token-Saving Directives
|
|
46
50
|
|
|
@@ -50,6 +54,12 @@ Take a complex or ambiguous bug report and produce a structured investigation re
|
|
|
50
54
|
|
|
51
55
|
---
|
|
52
56
|
|
|
57
|
+
## Confidence Propagation Contract
|
|
58
|
+
|
|
59
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Confidence Propagation Contract. Readiness kind: investigation.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
53
63
|
## Workflow
|
|
54
64
|
|
|
55
65
|
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
|
|
@@ -64,6 +74,25 @@ Classify the bug investigation before delegating:
|
|
|
64
74
|
|
|
65
75
|
If Tier 1, recommend the `hatch3r-bug-fix` skill and exit. If Tier 2, run the standard parallel-researcher pipeline below. If Tier 3, run the full pipeline including ADR generation in Step 6 and confirm fix phases with the user before writing files.
|
|
66
76
|
|
|
77
|
+
### Step 0.5: Emit Pre-Execution Cost Preview
|
|
78
|
+
|
|
79
|
+
Before the first sub-agent dispatch (Step 3), surface the cost preview so a multi-researcher investigation is never started blind. Emit the `cost_estimate` block per `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate, calibrated to the Step 0 triage tier:
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
cost_estimate:
|
|
83
|
+
expected_sa_count: <triage tier → Tier 1 routes out (0), Tier 2 ~4, Tier 3 up to 5>
|
|
84
|
+
estimated_input_tokens_static_frame: <int>
|
|
85
|
+
estimated_web_research_queries: <int>
|
|
86
|
+
triage_tier: light | standard | deep
|
|
87
|
+
estimated_duration_min: <int>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Post-execution actuals + delta land in the iteration summary's Fan-out + Cost section per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
|
|
91
|
+
|
|
92
|
+
### Effort Override (Decision 17)
|
|
93
|
+
|
|
94
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Effort Override (Decision 17). Misclassification example: a clear single-module bug scored as Deep, or a multi-module incident scored as Light.
|
|
95
|
+
|
|
67
96
|
---
|
|
68
97
|
|
|
69
98
|
### Step 1: Gather Bug Report
|
|
@@ -102,10 +131,10 @@ Bug Brief:
|
|
|
102
131
|
- `docs/adr/` — architectural decision records (scan for decisions relevant to the affected area)
|
|
103
132
|
- `docs/investigations/` — prior investigation reports (check for related or recurring bugs)
|
|
104
133
|
- `README.md` — project overview
|
|
105
|
-
- `.
|
|
134
|
+
- `.hatch3r/hatch.json` — board configuration
|
|
106
135
|
- Existing `todo.md` — current backlog (check for overlap or related items)
|
|
107
136
|
2. Scan GitHub issues via `search_issues` for existing work related to the bug. Note duplicates, related bugs, or prior investigations.
|
|
108
|
-
3. If `.
|
|
137
|
+
3. If `.hatch3r/learnings/` exists, scan for learnings relevant to the affected area. Match by area and tags against the bug brief.
|
|
109
138
|
4. Present a context summary:
|
|
110
139
|
|
|
111
140
|
```
|
|
@@ -423,15 +452,62 @@ If yes, instruct the user to invoke the `hatch3r-board-fill` command. Note that
|
|
|
423
452
|
|
|
424
453
|
---
|
|
425
454
|
|
|
455
|
+
## Resumability (Decision 27/30)
|
|
456
|
+
|
|
457
|
+
bug-plan is long-running — a Tier 2/3 investigation fans out four parallel hatch3r-researcher modes (symptom-trace, root-cause-hypothesis, impact-assessment, regression-research) in Step 3, then assembles the investigation report under `docs/investigations/`, ADRs under `docs/adr/`, and structured `todo.md` entries via the docs-writer. Per hatch3r's workspace-checkpointed resumability contract, checkpoint progress so an interrupted run re-enters at the last completed step rather than re-running the four-researcher fan-out.
|
|
458
|
+
|
|
459
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.bug-plan-workspace/`; step range the Step 0 → Step 8 progression; `wave` = researcher-batch index across the 4 parallel modes; snapshot/rollback paths `docs/investigations/`, `docs/adr/`, and `todo.md`; `meta` adds `bugSlug`. Write points: after Step 1 bug-brief context locks, after Step 2 hypothesis space ASK, after the Step 3 four-researcher fan-out returns (all modes complete), after Step 4 root-cause synthesis is confirmed by ASK, after each Step 5 file write (investigation report, ADRs) so already-generated artifacts survive a crash, after Step 6 todo.md entry generation, and after the optional Step 7 chain-to-`hatch3r-board-fill` handoff.
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## Per-Turn Pipeline-State Header (Bypass Protection)
|
|
464
|
+
|
|
465
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for bug-plan: `1` = reproduction + scope detection, `2` = researcher/debugger dispatch, `3` = root-cause synthesis + fix-plan drafting, `4` = plan write + iteration-summary. Tier 1 runs are exempt per the Tier 1 exemption.
|
|
466
|
+
|
|
467
|
+
## End-of-Turn Delegation Attestation (Bypass Protection)
|
|
468
|
+
|
|
469
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: plan document, fix-spec, regression-test scaffolding.
|
|
470
|
+
|
|
471
|
+
## Iteration Summary (mandatory output)
|
|
472
|
+
|
|
473
|
+
Emit the canonical 9-section iteration summary per `rules/hatch3r-iteration-summary.md` as the final user-facing output. The validation gate at `.claude/rules/capability-lifecycle.md` blocks SUCCESS declarations without this block (CONSTITUTION §6 Decision 23).
|
|
474
|
+
|
|
475
|
+
The 9 sections:
|
|
476
|
+
|
|
477
|
+
1. **Request** — verbatim restatement of the user's ask in one sentence.
|
|
478
|
+
2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
|
|
479
|
+
3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
|
|
480
|
+
4. **Files Mutated** — list with diff summary (lines added / removed / files created).
|
|
481
|
+
5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
|
|
482
|
+
6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
|
|
483
|
+
7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
|
|
484
|
+
8. **Open Questions / Blockers** — explicit `None` if fully closed.
|
|
485
|
+
9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
|
|
486
|
+
|
|
487
|
+
### Cost Visibility (Decision 24)
|
|
488
|
+
|
|
489
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Cost Estimate for the 5-field `cost_estimate` schema and the post-execution `cost_actuals` + `delta` contract; both land in Section 2 above.
|
|
490
|
+
|
|
491
|
+
## Cost estimate (Decision 24)
|
|
492
|
+
|
|
493
|
+
This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
|
|
494
|
+
|
|
495
|
+
- **Pre-execution `cost_estimate`** — emitted in Step 0.5 before the first researcher dispatch.
|
|
496
|
+
- **Post-execution `cost_actuals` + `delta`** — appended to the iteration summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
|
|
497
|
+
|
|
498
|
+
Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 4` × tier heuristic in `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate): Tier 1 routes to the `hatch3r-bug-fix` skill (no fanout); Tier 2/3 spawn up to 4 parallel researcher modes plus the docs-writer. Deltas beyond 25% absolute value carry `flagged_for_review: true`. Token telemetry sources from `src/pipeline/observability.ts`; estimation primitives from `src/pipeline/costEstimator.ts`.
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
426
502
|
## Error Handling
|
|
427
503
|
|
|
428
504
|
- **Sub-agent failure:** Retry the failed sub-agent once. If it fails again, present partial results from the remaining sub-agents and ask the user how to proceed (continue without that researcher's input / provide the missing information manually / abort).
|
|
429
505
|
- **Conflicting researcher outputs:** Present both options side by side with trade-offs. Ask the user to decide. Do not silently pick one.
|
|
430
506
|
- **File write failure:** Report the error and provide the full file content so the user can create the file manually.
|
|
431
|
-
- **Missing project context:** If no `hatch3r-board-shared` or `.
|
|
507
|
+
- **Missing project context:** If no `hatch3r-board-shared` or `.hatch3r/hatch.json` exists, proceed without board context — this command does not require board configuration.
|
|
432
508
|
- **No existing specs or docs:** Proceed without spec references. Warn that the investigation will be less contextualized without existing project documentation. Recommend running `hatch3r-project-spec` or `hatch3r-codebase-map` first for best results.
|
|
433
509
|
- **Duplicate detection:** If the bug overlaps significantly with existing todo.md items, GitHub issues, or prior investigation reports found in Step 2, present the overlap and ASK whether to proceed (augment existing / replace / abort).
|
|
434
|
-
- **No clear root cause:** If all hypotheses are low-confidence, state this
|
|
510
|
+
- **No clear root cause:** If all hypotheses are low-confidence, state this in the report (named verdict: "Root cause unconfirmed; top hypothesis confidence=low"). Recommend a focused debugging session (using `hatch3r-bug-fix` skill with the top hypothesis) rather than generating speculative fix items. ASK the user how to proceed.
|
|
435
511
|
|
|
436
512
|
## Guardrails
|
|
437
513
|
|
|
@@ -4,20 +4,22 @@ type: command
|
|
|
4
4
|
orchestrator: true
|
|
5
5
|
agentPipeline: [hatch3r-researcher, hatch3r-docs-writer]
|
|
6
6
|
description: Reverse-engineer a brownfield codebase into current-state module boundaries, integration-point inventory, tech-debt register, and dependency graph via static analysis
|
|
7
|
-
tags: [planning, brownfield]
|
|
7
|
+
tags: [planning, ctx:brownfield-only]
|
|
8
8
|
quality_charter: agents/shared/quality-charter.md
|
|
9
9
|
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
10
10
|
cache_friendly: true
|
|
11
11
|
parallel_tool_default: true
|
|
12
|
+
efficiency_tier: deep
|
|
12
13
|
triage_tiers: [1, 2, 3]
|
|
14
|
+
supports_resume: true
|
|
13
15
|
sub_agents_spawned:
|
|
14
16
|
count: 8
|
|
15
|
-
rationale: Eight parallel analyzer domains in Step 3 across business + technical dimensions (modules, dependencies, conventions, stack, technical-debt, business-domain, market-context, production-readiness); docs-writers fan out in a second parallel batch in Step 7 (one per document category).
|
|
17
|
+
rationale: Eight parallel analyzer domains in Step 3 across business + technical dimensions (modules, dependencies, conventions, stack, technical-debt, business-domain, market-context, production-readiness); docs-writers fan out in a second parallel batch in Step 7 (one per document category). Cost-dominance per CONSTITUTION §2 P8 — token cost never serializes independent work.
|
|
16
18
|
---
|
|
17
19
|
|
|
18
20
|
## §0 Detect Ambiguity (P8 B1)
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → §0 Detect Ambiguity (P8 B1). Triggers: contradictory inputs, missing target, unknown convention.
|
|
21
23
|
|
|
22
24
|
# Codebase Map — Brownfield Codebase Analysis & Spec Generation
|
|
23
25
|
|
|
@@ -31,6 +33,8 @@ Analyze an existing codebase to reverse-engineer project documentation across **
|
|
|
31
33
|
| 2. Document Generation | `hatch3r-docs-writer` (parallel: technical spec, business spec, ADRs, health report) | Yes | Yes |
|
|
32
34
|
| 3. AGENTS.md | `hatch3r-docs-writer` (AGENTS.md generation/rework) | No | Yes |
|
|
33
35
|
|
|
36
|
+
**Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): every parallel fan-out above holds all three — read-only or disjoint writes, deterministic aggregation, no shared mutable state.
|
|
37
|
+
|
|
34
38
|
---
|
|
35
39
|
|
|
36
40
|
## Shared Context
|
|
@@ -46,6 +50,12 @@ Analyze an existing codebase to reverse-engineer project documentation across **
|
|
|
46
50
|
|
|
47
51
|
---
|
|
48
52
|
|
|
53
|
+
## Confidence Propagation Contract
|
|
54
|
+
|
|
55
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Confidence Propagation Contract. Readiness kind: map.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
49
59
|
## Workflow
|
|
50
60
|
|
|
51
61
|
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK. When in doubt, **ASK** — it is better to ask one question too many than to make one wrong assumption. Discovery questions are never wasted.
|
|
@@ -60,6 +70,25 @@ Classify the codebase analysis request before delegating:
|
|
|
60
70
|
|
|
61
71
|
If Tier 1, run the reduced analyzer set and skip Step 5 (ADRs) unless decisions are obvious. If Tier 2, run the standard pipeline below. If Tier 3, run the full pipeline including the production-readiness scorecard and confirm scope with the user before file writes.
|
|
62
72
|
|
|
73
|
+
### Step 0.5: Emit Pre-Execution Cost Preview
|
|
74
|
+
|
|
75
|
+
Before the first analyzer dispatch (Step 1), surface the cost preview so a multi-analyzer scan is never started blind. Emit the `cost_estimate` block per `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate, calibrated to the Step 0 triage tier:
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
cost_estimate:
|
|
79
|
+
expected_sa_count: <triage tier → Tier 1 ~2, Tier 2 ~6, Tier 3 up to 8>
|
|
80
|
+
estimated_input_tokens_static_frame: <int>
|
|
81
|
+
estimated_web_research_queries: <int>
|
|
82
|
+
triage_tier: light | standard | deep
|
|
83
|
+
estimated_duration_min: <int>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Post-execution actuals + delta land in the iteration summary's Fan-out + Cost section per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
|
|
87
|
+
|
|
88
|
+
### Effort Override (Decision 17)
|
|
89
|
+
|
|
90
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Effort Override (Decision 17). Misclassification example: a single-subsystem map scored as Deep, or a monorepo scored as Light.
|
|
91
|
+
|
|
63
92
|
---
|
|
64
93
|
|
|
65
94
|
### Step 1: Initial Scan, Scope & Discovery
|
|
@@ -105,7 +134,7 @@ From config files and top-level imports, identify:
|
|
|
105
134
|
- Check for `docs/specs/` — if exists, note contents (including `business/` and `technical/` subdirectories)
|
|
106
135
|
- Check for `docs/adr/` — if exists, note contents
|
|
107
136
|
- Check for `README.md`, `CONTRIBUTING.md`, `ARCHITECTURE.md`, or similar
|
|
108
|
-
- Check for `.
|
|
137
|
+
- Check for `.hatch3r/hatch.json` — if exists, this project already has hatch3r configuration
|
|
109
138
|
- Check for root `AGENTS.md` — if exists, note its contents
|
|
110
139
|
|
|
111
140
|
If `docs/specs/` or `docs/adr/` already exist:
|
|
@@ -640,7 +669,7 @@ Grading Baseline: {what "good" looks like for this stage}
|
|
|
640
669
|
3. {risk} — {mitigation}
|
|
641
670
|
|
|
642
671
|
## Stage-Appropriate Recommendations
|
|
643
|
-
{Ordered list of actions calibrated to the company stage — do not recommend enterprise-
|
|
672
|
+
{Ordered list of actions calibrated to the company stage — do not recommend enterprise-tier (per CONSTITUTION §6 Decision 4) solutions for solo-tier pre-revenue startups}
|
|
644
673
|
```
|
|
645
674
|
|
|
646
675
|
---
|
|
@@ -1214,6 +1243,53 @@ Which would you like to run next? (or none)"
|
|
|
1214
1243
|
|
|
1215
1244
|
---
|
|
1216
1245
|
|
|
1246
|
+
## Resumability (Decision 27/30)
|
|
1247
|
+
|
|
1248
|
+
codebase-map is long-running — a Tier 3 brownfield analysis fans out eight parallel hatch3r-researcher analyzer domains in Step 3 (modules, dependencies, conventions, stack, technical-debt, business-domain, market-context, production-readiness), then runs a second parallel batch of docs-writers in Step 7 (one per document category: technical spec, business spec, ADRs, health report) plus a single AGENTS.md generation pass. Per hatch3r's workspace-checkpointed resumability contract, checkpoint progress so an interrupted run re-enters at the last completed step rather than re-running the eight-analyzer + docs-writer-batch fan-out.
|
|
1249
|
+
|
|
1250
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.codebase-map-workspace/`; step range the Step 0 → Step 9 progression; `wave` = analyzer-batch index across the 8 parallel domains, then docs-writer-batch index; snapshot/rollback paths `docs/specs/business/`, `docs/specs/technical/`, `docs/adr/`, and `AGENTS.md`. Write points: after Step 1 repo fingerprint locks, after Step 2 scope ASK, after the Step 3 eight-analyzer fan-out returns (all domains complete), after Step 4 synthesis confirmed by ASK, after each Step 5 file write under `docs/specs/business/` and `docs/specs/technical/`, after Step 6 ADR generation, after the Step 7 docs-writer batch returns, and after Step 8 AGENTS.md regeneration.
|
|
1251
|
+
|
|
1252
|
+
---
|
|
1253
|
+
|
|
1254
|
+
## Per-Turn Pipeline-State Header (Bypass Protection)
|
|
1255
|
+
|
|
1256
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for codebase-map: `1` = repo discovery + scope detection, `2` = explore sub-agent dispatch + module enumeration, `3` = aggregation + cross-reference graph build, `4` = map write + iteration-summary. Tier 1 runs are exempt per the Tier 1 exemption.
|
|
1257
|
+
|
|
1258
|
+
## End-of-Turn Delegation Attestation (Bypass Protection)
|
|
1259
|
+
|
|
1260
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: map document, module index, dependency-graph artifacts.
|
|
1261
|
+
|
|
1262
|
+
## Iteration Summary (mandatory output)
|
|
1263
|
+
|
|
1264
|
+
Emit the canonical 9-section iteration summary per `rules/hatch3r-iteration-summary.md` as the final user-facing output. The validation gate at `.claude/rules/capability-lifecycle.md` blocks SUCCESS declarations without this block (CONSTITUTION §6 Decision 23).
|
|
1265
|
+
|
|
1266
|
+
The 9 sections:
|
|
1267
|
+
|
|
1268
|
+
1. **Request** — verbatim restatement of the user's ask in one sentence.
|
|
1269
|
+
2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
|
|
1270
|
+
3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
|
|
1271
|
+
4. **Files Mutated** — list with diff summary (lines added / removed / files created).
|
|
1272
|
+
5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
|
|
1273
|
+
6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
|
|
1274
|
+
7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
|
|
1275
|
+
8. **Open Questions / Blockers** — explicit `None` if fully closed.
|
|
1276
|
+
9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
|
|
1277
|
+
|
|
1278
|
+
### Cost Visibility (Decision 24)
|
|
1279
|
+
|
|
1280
|
+
> Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Cost Estimate for the 5-field `cost_estimate` schema and the post-execution `cost_actuals` + `delta` contract; both land in Section 2 above.
|
|
1281
|
+
|
|
1282
|
+
## Cost estimate (Decision 24)
|
|
1283
|
+
|
|
1284
|
+
This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
|
|
1285
|
+
|
|
1286
|
+
- **Pre-execution `cost_estimate`** — emitted in Step 0.5 before the first analyzer dispatch.
|
|
1287
|
+
- **Post-execution `cost_actuals` + `delta`** — appended to the iteration summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
|
|
1288
|
+
|
|
1289
|
+
Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 8` × tier heuristic in `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate): Tier 1 ≈ 2 (reduced analyzer set); Tier 2 ≈ 6; Tier 3 up to 8 parallel analyzers. Deltas beyond 25% absolute value carry `flagged_for_review: true`. Token telemetry sources from `src/pipeline/observability.ts`; estimation primitives from `src/pipeline/costEstimator.ts`.
|
|
1290
|
+
|
|
1291
|
+
---
|
|
1292
|
+
|
|
1217
1293
|
## Error Handling
|
|
1218
1294
|
|
|
1219
1295
|
- **Sub-agent failure:** Retry the failed analyzer once with the same prompt. If it fails again, present partial results from the other analyzers and note the gap. Ask the user whether to continue with partial data or abort.
|
|
@@ -1237,6 +1313,6 @@ Which would you like to run next? (or none)"
|
|
|
1237
1313
|
- **Handle monorepos by detecting workspace configuration** (`workspaces` in `package.json`, `pnpm-workspace.yaml`, `turbo.json`, `nx.json`, `lerna.json`, Cargo workspaces, Go workspaces) and analyzing each package as a separate module.
|
|
1238
1314
|
- **If `todo.md` already exists,** ASK before overwriting or appending.
|
|
1239
1315
|
- **Sub-agents must not create files.** They return structured text results to the orchestrator. Only the orchestrator writes files in Step 7.
|
|
1240
|
-
- **Stage-adaptive recommendations.** Never recommend enterprise-
|
|
1316
|
+
- **Stage-adaptive recommendations.** Never recommend enterprise-tier (per CONSTITUTION §6 Decision 4) solutions for solo-tier pre-revenue startups. Never recommend MVP shortcuts for scaleup-tier or enterprise-tier companies. Calibrate all recommendations to the company stage from Step 1g.
|
|
1241
1317
|
- **Business specs must cross-reference technical specs.** Use stable IDs from both glossaries to link business entities to technical modules.
|
|
1242
1318
|
- **Never overwrite `AGENTS.md`** without explicit user confirmation.
|