hatch3r 1.9.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.
Files changed (288) hide show
  1. package/README.md +52 -143
  2. package/dist/cli/index.js +28453 -15831
  3. package/dist/content/agents/hatch3r-architect.md +39 -9
  4. package/dist/content/agents/hatch3r-brownfield-spec.md +254 -0
  5. package/dist/content/agents/hatch3r-ci-watcher.md +8 -1
  6. package/dist/content/agents/hatch3r-context-rules.md +19 -1
  7. package/dist/content/agents/hatch3r-creator.md +65 -26
  8. package/dist/content/agents/hatch3r-dependency-drafter.md +162 -0
  9. package/dist/content/agents/hatch3r-devops.md +11 -1
  10. package/dist/content/agents/hatch3r-docs-writer.md +11 -1
  11. package/dist/content/agents/hatch3r-edge-case-analyst.md +134 -0
  12. package/dist/content/agents/hatch3r-enhancability.md +192 -0
  13. package/dist/content/agents/hatch3r-fixer.md +59 -8
  14. package/dist/content/agents/hatch3r-greenfield-spec.md +256 -0
  15. package/dist/content/agents/hatch3r-handoff-loader.md +29 -3
  16. package/dist/content/agents/hatch3r-handoff-preparer.md +10 -1
  17. package/dist/content/agents/hatch3r-implementer.md +139 -8
  18. package/dist/content/agents/hatch3r-incident-responder.md +96 -0
  19. package/dist/content/agents/hatch3r-learnings-loader.md +122 -88
  20. package/dist/content/agents/hatch3r-lint-fixer.md +15 -3
  21. package/dist/content/agents/hatch3r-maintainability.md +183 -0
  22. package/dist/content/agents/hatch3r-pack-installer.md +113 -0
  23. package/dist/content/agents/hatch3r-performance.md +179 -0
  24. package/dist/content/agents/hatch3r-reliability.md +193 -0
  25. package/dist/content/agents/hatch3r-researcher.md +27 -4
  26. package/dist/content/agents/hatch3r-reviewer.md +153 -103
  27. package/dist/content/agents/hatch3r-scalability.md +162 -0
  28. package/dist/content/agents/hatch3r-security.md +197 -0
  29. package/dist/content/agents/hatch3r-testability.md +204 -0
  30. package/dist/content/agents/hatch3r-ui.md +175 -0
  31. package/dist/content/agents/hatch3r-ux.md +160 -0
  32. package/dist/content/agents/modes/requirements-elicitation.md +1 -1
  33. package/dist/content/agents/modes/user-flows.md +2 -2
  34. package/dist/content/agents/shared/clarification-default-block.md +44 -0
  35. package/dist/content/agents/shared/confidence-gate.md +42 -0
  36. package/dist/content/agents/shared/cq-specialist-roster.md +26 -0
  37. package/dist/content/agents/shared/efficiency-patterns.md +32 -1
  38. package/dist/content/agents/shared/injection-patterns.md +18 -7
  39. package/dist/content/agents/shared/principles.md +60 -0
  40. package/dist/content/agents/shared/prompt-structure.md +7 -1
  41. package/dist/content/agents/shared/quality-charter.md +48 -12
  42. package/dist/content/agents/shared/quality-specialist-frame.md +141 -0
  43. package/dist/content/agents/shared/rigor-contract.md +151 -0
  44. package/dist/content/agents/shared/severity-mapping.md +92 -0
  45. package/dist/content/agents/shared/triage-vocabulary.md +46 -0
  46. package/dist/content/agents/shared/user-content-templates.md +34 -8
  47. package/dist/content/agents/shared/user-question-protocol.md +45 -3
  48. package/dist/content/checks/README.md +5 -0
  49. package/dist/content/checks/accessibility.md +14 -7
  50. package/dist/content/checks/code-quality.md +1 -1
  51. package/dist/content/checks/performance.md +7 -4
  52. package/dist/content/checks/security.md +6 -6
  53. package/dist/content/checks/testing.md +1 -1
  54. package/dist/content/commands/board/pickup-delegation-multi.md +37 -10
  55. package/dist/content/commands/board/pickup-delegation.md +7 -5
  56. package/dist/content/commands/board/pickup-modes.md +1 -0
  57. package/dist/content/commands/board/pickup-post-impl.md +1 -1
  58. package/dist/content/commands/hatch3r-api-spec.md +79 -2
  59. package/dist/content/commands/hatch3r-auth-scaffold.md +250 -0
  60. package/dist/content/commands/hatch3r-benchmark.md +90 -7
  61. package/dist/content/commands/hatch3r-board-fill.md +97 -11
  62. package/dist/content/commands/hatch3r-board-pickup.md +93 -9
  63. package/dist/content/commands/hatch3r-bug-pipeline.md +240 -0
  64. package/dist/content/commands/hatch3r-bug-plan.md +79 -3
  65. package/dist/content/commands/hatch3r-codebase-map.md +80 -4
  66. package/dist/content/commands/hatch3r-create.md +105 -7
  67. package/dist/content/commands/hatch3r-debug.md +102 -14
  68. package/dist/content/commands/hatch3r-diagnose.md +238 -0
  69. package/dist/content/commands/hatch3r-feature-plan.md +125 -5
  70. package/dist/content/commands/hatch3r-handoff.md +83 -3
  71. package/dist/content/commands/hatch3r-healthcheck.md +105 -5
  72. package/dist/content/commands/hatch3r-incident-response.md +228 -0
  73. package/dist/content/commands/hatch3r-migration-plan.md +79 -3
  74. package/dist/content/commands/hatch3r-onboard.md +94 -3
  75. package/dist/content/commands/hatch3r-pack-install.md +243 -0
  76. package/dist/content/commands/hatch3r-pr-resolve.md +106 -23
  77. package/dist/content/commands/hatch3r-project-spec.md +82 -6
  78. package/dist/content/commands/hatch3r-quick-change.md +108 -13
  79. package/dist/content/commands/hatch3r-refactor-plan.md +78 -2
  80. package/dist/content/commands/hatch3r-release.md +401 -0
  81. package/dist/content/commands/hatch3r-revision.md +98 -12
  82. package/dist/content/commands/hatch3r-roadmap.md +92 -10
  83. package/dist/content/commands/hatch3r-security-audit.md +105 -5
  84. package/dist/content/commands/hatch3r-slo-scaffold.md +246 -0
  85. package/dist/content/commands/hatch3r-spec.md +216 -0
  86. package/dist/content/commands/hatch3r-test-plan.md +85 -9
  87. package/dist/content/commands/hatch3r-workflow.md +165 -41
  88. package/dist/content/commands/revision/revision-delegation.md +6 -5
  89. package/dist/content/commands/revision/revision-modes.md +49 -4
  90. package/dist/content/commands/revision/revision-quality.md +10 -7
  91. package/dist/content/commands/shared/orchestration-frame.md +119 -0
  92. package/dist/content/github-agents/hatch3r-docs-agent.md +21 -1
  93. package/dist/content/github-agents/hatch3r-lint-agent.md +21 -1
  94. package/dist/content/github-agents/hatch3r-security-agent.md +21 -1
  95. package/dist/content/github-agents/hatch3r-test-agent.md +21 -1
  96. package/dist/content/hooks/hatch3r-file-save.md +1 -1
  97. package/dist/content/hooks/hatch3r-pre-push.md +4 -4
  98. package/dist/content/hooks/hatch3r-review-loop-cap.md +52 -0
  99. package/dist/content/mcp/mcp.json +7 -5
  100. package/dist/content/rules/hatch3r-accessibility-standards.md +14 -2
  101. package/dist/content/rules/hatch3r-accessibility-standards.mdc +12 -1
  102. package/dist/content/rules/hatch3r-agent-orchestration-detail.md +58 -19
  103. package/dist/content/rules/hatch3r-agent-orchestration-detail.mdc +58 -19
  104. package/dist/content/rules/hatch3r-agent-orchestration.md +87 -213
  105. package/dist/content/rules/hatch3r-agent-orchestration.mdc +87 -213
  106. package/dist/content/rules/hatch3r-ai-evals.md +5 -4
  107. package/dist/content/rules/hatch3r-ai-evals.mdc +3 -3
  108. package/dist/content/rules/hatch3r-ai-ux-patterns.md +6 -2
  109. package/dist/content/rules/hatch3r-ai-ux-patterns.mdc +4 -1
  110. package/dist/content/rules/hatch3r-android-patterns.md +107 -0
  111. package/dist/content/rules/hatch3r-android-patterns.mdc +102 -0
  112. package/dist/content/rules/hatch3r-anti-duplication.md +115 -0
  113. package/dist/content/rules/hatch3r-anti-duplication.mdc +115 -0
  114. package/dist/content/rules/hatch3r-api-design.md +5 -1
  115. package/dist/content/rules/hatch3r-api-design.mdc +3 -0
  116. package/dist/content/rules/hatch3r-api-versioning.md +2 -1
  117. package/dist/content/rules/hatch3r-auth-patterns.md +3 -1
  118. package/dist/content/rules/hatch3r-auth-patterns.mdc +1 -0
  119. package/dist/content/rules/hatch3r-browser-verification.md +2 -0
  120. package/dist/content/rules/hatch3r-browser-verification.mdc +2 -0
  121. package/dist/content/rules/hatch3r-capability-matrix.md +108 -0
  122. package/dist/content/rules/hatch3r-capability-matrix.mdc +108 -0
  123. package/dist/content/rules/hatch3r-ci-cd.md +8 -1
  124. package/dist/content/rules/hatch3r-ci-cd.mdc +6 -0
  125. package/dist/content/rules/hatch3r-clarification-default.md +73 -0
  126. package/dist/content/rules/hatch3r-clarification-default.mdc +73 -0
  127. package/dist/content/rules/hatch3r-code-standards.md +23 -47
  128. package/dist/content/rules/hatch3r-code-standards.mdc +22 -46
  129. package/dist/content/rules/hatch3r-component-conventions.md +3 -0
  130. package/dist/content/rules/hatch3r-component-conventions.mdc +3 -0
  131. package/dist/content/rules/hatch3r-container-hardening.md +11 -2
  132. package/dist/content/rules/hatch3r-container-hardening.mdc +9 -1
  133. package/dist/content/rules/hatch3r-contract-testing.md +2 -1
  134. package/dist/content/rules/hatch3r-cost-visibility.md +135 -0
  135. package/dist/content/rules/hatch3r-cost-visibility.mdc +135 -0
  136. package/dist/content/rules/hatch3r-cq-rule-frame.md +54 -0
  137. package/dist/content/rules/hatch3r-cq-rule-frame.mdc +49 -0
  138. package/dist/content/rules/hatch3r-data-classification.md +3 -1
  139. package/dist/content/rules/hatch3r-data-classification.mdc +2 -1
  140. package/dist/content/rules/hatch3r-deep-context.md +13 -13
  141. package/dist/content/rules/hatch3r-deep-context.mdc +13 -13
  142. package/dist/content/rules/hatch3r-dependency-management.md +16 -3
  143. package/dist/content/rules/hatch3r-dependency-management.mdc +15 -3
  144. package/dist/content/rules/hatch3r-design-system-detection.md +2 -1
  145. package/dist/content/rules/hatch3r-dotnet-patterns.md +104 -0
  146. package/dist/content/rules/hatch3r-dotnet-patterns.mdc +99 -0
  147. package/dist/content/rules/hatch3r-edge-case-discipline.md +65 -0
  148. package/dist/content/rules/hatch3r-edge-case-discipline.mdc +65 -0
  149. package/dist/content/rules/hatch3r-enhancability.md +147 -0
  150. package/dist/content/rules/hatch3r-enhancability.mdc +142 -0
  151. package/dist/content/rules/hatch3r-event-schema-evolution.md +2 -1
  152. package/dist/content/rules/hatch3r-fan-out-discipline.md +91 -0
  153. package/dist/content/rules/hatch3r-fan-out-discipline.mdc +91 -0
  154. package/dist/content/rules/hatch3r-feature-flags.md +2 -0
  155. package/dist/content/rules/hatch3r-feature-flags.mdc +2 -0
  156. package/dist/content/rules/hatch3r-flutter-patterns.md +88 -0
  157. package/dist/content/rules/hatch3r-flutter-patterns.mdc +83 -0
  158. package/dist/content/rules/hatch3r-git-conventions.md +4 -1
  159. package/dist/content/rules/hatch3r-git-conventions.mdc +2 -0
  160. package/dist/content/rules/hatch3r-go-patterns.md +98 -0
  161. package/dist/content/rules/hatch3r-go-patterns.mdc +93 -0
  162. package/dist/content/rules/hatch3r-handoff-readiness.md +10 -0
  163. package/dist/content/rules/hatch3r-handoff-readiness.mdc +10 -0
  164. package/dist/content/rules/hatch3r-i18n.md +2 -0
  165. package/dist/content/rules/hatch3r-i18n.mdc +2 -0
  166. package/dist/content/rules/hatch3r-iteration-summary.md +75 -57
  167. package/dist/content/rules/hatch3r-iteration-summary.mdc +77 -54
  168. package/dist/content/rules/hatch3r-learning-system.md +202 -0
  169. package/dist/content/rules/hatch3r-learning-system.mdc +202 -0
  170. package/dist/content/rules/hatch3r-maintainability.md +157 -0
  171. package/dist/content/rules/hatch3r-maintainability.mdc +152 -0
  172. package/dist/content/rules/hatch3r-migrations.md +2 -1
  173. package/dist/content/rules/hatch3r-observability-logging.md +1 -1
  174. package/dist/content/rules/hatch3r-observability-metrics.md +1 -1
  175. package/dist/content/rules/hatch3r-observability-tracing.md +45 -36
  176. package/dist/content/rules/hatch3r-observability-tracing.mdc +44 -35
  177. package/dist/content/rules/hatch3r-operability.md +2 -1
  178. package/dist/content/rules/hatch3r-passkey-server.md +2 -1
  179. package/dist/content/rules/hatch3r-performance-budgets.md +2 -0
  180. package/dist/content/rules/hatch3r-performance-budgets.mdc +2 -0
  181. package/dist/content/rules/hatch3r-php-laravel-patterns.md +109 -0
  182. package/dist/content/rules/hatch3r-php-laravel-patterns.mdc +104 -0
  183. package/dist/content/rules/hatch3r-progressive-delivery.md +5 -1
  184. package/dist/content/rules/hatch3r-progressive-delivery.mdc +3 -0
  185. package/dist/content/rules/hatch3r-proof-model.md +131 -0
  186. package/dist/content/rules/hatch3r-proof-model.mdc +131 -0
  187. package/dist/content/rules/hatch3r-python-patterns.md +70 -0
  188. package/dist/content/rules/hatch3r-python-patterns.mdc +65 -0
  189. package/dist/content/rules/hatch3r-react-native-patterns.md +83 -0
  190. package/dist/content/rules/hatch3r-react-native-patterns.mdc +78 -0
  191. package/dist/content/rules/hatch3r-resilience-patterns.md +2 -1
  192. package/dist/content/rules/hatch3r-reviewer-calibration.md +84 -0
  193. package/dist/content/rules/hatch3r-reviewer-calibration.mdc +84 -0
  194. package/dist/content/rules/hatch3r-right-sizing.md +68 -0
  195. package/dist/content/rules/hatch3r-right-sizing.mdc +66 -0
  196. package/dist/content/rules/hatch3r-ruby-rails-patterns.md +111 -0
  197. package/dist/content/rules/hatch3r-ruby-rails-patterns.mdc +106 -0
  198. package/dist/content/rules/hatch3r-rust-patterns.md +107 -0
  199. package/dist/content/rules/hatch3r-rust-patterns.mdc +102 -0
  200. package/dist/content/rules/hatch3r-scalability.md +137 -0
  201. package/dist/content/rules/hatch3r-scalability.mdc +132 -0
  202. package/dist/content/rules/hatch3r-secrets-management.md +10 -1
  203. package/dist/content/rules/hatch3r-secrets-management.mdc +8 -0
  204. package/dist/content/rules/hatch3r-security-patterns.md +36 -34
  205. package/dist/content/rules/hatch3r-security-patterns.mdc +35 -34
  206. package/dist/content/rules/hatch3r-security.md +97 -0
  207. package/dist/content/rules/hatch3r-security.mdc +92 -0
  208. package/dist/content/rules/hatch3r-swiftui-patterns.md +98 -0
  209. package/dist/content/rules/hatch3r-swiftui-patterns.mdc +93 -0
  210. package/dist/content/rules/hatch3r-testability.md +115 -0
  211. package/dist/content/rules/hatch3r-testability.mdc +110 -0
  212. package/dist/content/rules/hatch3r-testing.md +4 -1
  213. package/dist/content/rules/hatch3r-testing.mdc +2 -0
  214. package/dist/content/rules/hatch3r-theming.md +2 -0
  215. package/dist/content/rules/hatch3r-theming.mdc +2 -0
  216. package/dist/content/rules/hatch3r-tool-currency.md +91 -0
  217. package/dist/content/rules/hatch3r-tool-currency.mdc +86 -0
  218. package/dist/content/rules/hatch3r-tooling-hierarchy.md +29 -31
  219. package/dist/content/rules/hatch3r-tooling-hierarchy.mdc +27 -30
  220. package/dist/content/rules/hatch3r-typescript-patterns.md +58 -0
  221. package/dist/content/rules/hatch3r-typescript-patterns.mdc +53 -0
  222. package/dist/content/rules/hatch3r-ux-states-and-flows.md +11 -4
  223. package/dist/content/rules/hatch3r-ux-states-and-flows.mdc +9 -3
  224. package/dist/content/skills/hatch3r-a11y-audit/SKILL.md +10 -8
  225. package/dist/content/skills/hatch3r-a11y-audit/references/manual-audit-checklist.md +7 -5
  226. package/dist/content/skills/hatch3r-adhoc-orchestrate/SKILL.md +131 -0
  227. package/dist/content/skills/hatch3r-ai-feature/SKILL.md +4 -6
  228. package/dist/content/skills/hatch3r-api-spec/SKILL.md +27 -2
  229. package/dist/content/skills/hatch3r-architecture-review/SKILL.md +4 -7
  230. package/dist/content/skills/hatch3r-board-groom/SKILL.md +11 -0
  231. package/dist/content/skills/hatch3r-board-init/SKILL.md +17 -1
  232. package/dist/content/skills/hatch3r-board-refresh/SKILL.md +12 -1
  233. package/dist/content/skills/hatch3r-board-shared/SKILL.md +38 -1
  234. package/dist/content/skills/hatch3r-browser-verify/SKILL.md +307 -0
  235. package/dist/content/skills/hatch3r-bug-fix/SKILL.md +15 -2
  236. package/dist/content/skills/hatch3r-ci-pipeline/SKILL.md +17 -7
  237. package/dist/content/skills/hatch3r-cli-fd/SKILL.md +33 -1
  238. package/dist/content/skills/hatch3r-cli-fzf/SKILL.md +33 -1
  239. package/dist/content/skills/hatch3r-cli-gh/SKILL.md +50 -1
  240. package/dist/content/skills/hatch3r-cli-jq/SKILL.md +40 -6
  241. package/dist/content/skills/hatch3r-cli-ripgrep/SKILL.md +33 -1
  242. package/dist/content/skills/hatch3r-cli-toolbox/SKILL.md +130 -23
  243. package/dist/content/skills/hatch3r-containerize/SKILL.md +157 -0
  244. package/dist/content/skills/hatch3r-context-health/SKILL.md +9 -7
  245. package/dist/content/skills/hatch3r-cost-tracking/SKILL.md +37 -17
  246. package/dist/content/skills/hatch3r-customize/SKILL.md +5 -8
  247. package/dist/content/skills/hatch3r-dep-audit/SKILL.md +23 -7
  248. package/dist/content/skills/hatch3r-design-system-detect/SKILL.md +3 -7
  249. package/dist/content/skills/hatch3r-docs-writing/SKILL.md +159 -0
  250. package/dist/content/skills/hatch3r-enhancability-verify/SKILL.md +152 -0
  251. package/dist/content/skills/hatch3r-feature/SKILL.md +53 -3
  252. package/dist/content/skills/hatch3r-feedback/SKILL.md +103 -0
  253. package/dist/content/skills/hatch3r-gh-agentic-workflows/SKILL.md +10 -8
  254. package/dist/content/skills/hatch3r-handoff-prepare/SKILL.md +4 -7
  255. package/dist/content/skills/hatch3r-handoff-resume/SKILL.md +4 -7
  256. package/dist/content/{commands/hatch3r-hooks.md → skills/hatch3r-hooks/SKILL.md} +48 -137
  257. package/dist/content/skills/hatch3r-incident-response/SKILL.md +66 -7
  258. package/dist/content/skills/hatch3r-issue-workflow/SKILL.md +11 -0
  259. package/dist/content/skills/hatch3r-learn/SKILL.md +317 -0
  260. package/dist/content/skills/hatch3r-logical-refactor/SKILL.md +6 -7
  261. package/dist/content/skills/hatch3r-maintainability-verify/SKILL.md +146 -0
  262. package/dist/content/skills/hatch3r-migration/SKILL.md +8 -7
  263. package/dist/content/skills/hatch3r-observability-verify/SKILL.md +17 -12
  264. package/dist/content/skills/hatch3r-perf-audit/SKILL.md +13 -9
  265. package/dist/content/skills/hatch3r-pr-creation/SKILL.md +4 -7
  266. package/dist/content/skills/hatch3r-qa-validation/SKILL.md +6 -5
  267. package/dist/content/skills/hatch3r-recipe/SKILL.md +63 -60
  268. package/dist/content/skills/hatch3r-refactor/SKILL.md +6 -7
  269. package/dist/content/skills/hatch3r-release/SKILL.md +123 -11
  270. package/dist/content/skills/hatch3r-reliability-verify/SKILL.md +9 -5
  271. package/dist/content/{commands/hatch3r-report.md → skills/hatch3r-report/SKILL.md} +20 -17
  272. package/dist/content/skills/hatch3r-scalability-verify/SKILL.md +145 -0
  273. package/dist/content/skills/hatch3r-security-verify/SKILL.md +144 -0
  274. package/dist/content/skills/hatch3r-team-convention-author/SKILL.md +126 -0
  275. package/dist/content/skills/hatch3r-testability-verify/SKILL.md +147 -0
  276. package/dist/content/skills/hatch3r-ui-ux-verify/SKILL.md +19 -11
  277. package/dist/content/skills/hatch3r-visual-refactor/SKILL.md +11 -7
  278. package/package.json +50 -31
  279. package/dist/cli/index.d.ts +0 -2
  280. package/dist/cli/index.js.map +0 -1
  281. package/dist/content/agents/hatch3r-a11y-auditor.md +0 -159
  282. package/dist/content/agents/hatch3r-dependency-auditor.md +0 -219
  283. package/dist/content/agents/hatch3r-perf-profiler.md +0 -166
  284. package/dist/content/agents/hatch3r-security-auditor.md +0 -180
  285. package/dist/content/agents/hatch3r-test-writer.md +0 -171
  286. package/dist/content/commands/hatch3r-learn.md +0 -312
  287. package/dist/content/rules/hatch3r-learning-consult.md +0 -42
  288. package/dist/content/rules/hatch3r-learning-consult.mdc +0 -38
@@ -2,22 +2,24 @@
2
2
  id: hatch3r-board-pickup
3
3
  type: command
4
4
  orchestrator: true
5
- agentPipeline: [hatch3r-researcher, hatch3r-implementer, hatch3r-reviewer, hatch3r-fixer, hatch3r-test-writer, hatch3r-security-auditor, hatch3r-docs-writer, hatch3r-lint-fixer, hatch3r-a11y-auditor, hatch3r-perf-profiler]
6
- description: Pick up one or more epics/issues from the project board for development. Handles dependency-aware selection, collision detection, branching, parallel sub-agent delegation, and batch execution. Supports GitHub, Azure DevOps, and GitLab. Platform-specific details are in commands/board/pickup-{platform}.md.
5
+ agentPipeline: [hatch3r-researcher, hatch3r-implementer, hatch3r-reviewer, hatch3r-fixer, hatch3r-testability, hatch3r-security, hatch3r-docs-writer, hatch3r-lint-fixer, hatch3r-ui, hatch3r-ux, hatch3r-performance]
6
+ description: "Pick up epics/issues from the project board: dependency-aware selection, collision detection, branching, batch execution. Multi-platform."
7
7
  tags: [board, ctx:team-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: standard
12
13
  triage_tiers: [1, 2, 3]
14
+ supports_resume: true
13
15
  sub_agents_spawned:
14
- count: 10
15
- rationale: Full delivery pipeline — researcher, implementer (one per independent issue in batch mode), reviewer ↔ fixer review loop, then a parallel final-quality batch (test-writer, security-auditor, docs-writer, lint-fixer, a11y-auditor, perf-profiler) bounded by max_phase4_parallel.
16
+ count: 11
17
+ rationale: Full delivery pipeline — researcher, implementer (one per independent issue in batch mode), reviewer ↔ fixer review loop, then a parallel final-quality batch (testability (CQ5), security (CQ3), docs-writer, lint-fixer, hatch3r-ui (CQ1), hatch3r-ux (CQ2), performance (CQ7)) bounded by max_phase4_parallel. 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
- Before any action, scan the user's request and provided context for unresolved questions in scope, acceptance criteria, irreversibility, or constraint conflicts (contradictory inputs, missing target, unknown convention). 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 scope is single-target, single-concern, and the brief alone is testable. Any residual ambiguity discovered mid-workflow invokes the same protocol.
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
  # Board Pickup -- Develop Issues from the Project Board
23
25
 
@@ -32,10 +34,12 @@ Pick up an epic (with all sub-issues), a single sub-issue, a standalone issue, o
32
34
  | 1. Research | `hatch3r-researcher` (modes by task type) | Per issue | Yes |
33
35
  | 2. Implementation | `hatch3r-implementer` (one per issue) | Yes (per dependency level) | Yes |
34
36
  | 3a. Review Loop | `hatch3r-reviewer` -> `hatch3r-fixer` (max 3 iterations until clean) | No (sequential loop) | Yes |
35
- | 3b. Final Quality — Testing | `hatch3r-test-writer` | Yes | Yes (code changes) |
36
- | 3c. Final Quality — Security | `hatch3r-security-auditor` | Yes | Yes (code changes) |
37
+ | 3b. Final Quality — Testing | `hatch3r-testability` | Yes | Yes (code changes) |
38
+ | 3c. Final Quality — Security | `hatch3r-security` | Yes | Yes (code changes) |
37
39
  | 3d. Final Quality — Docs | `hatch3r-docs-writer` | Yes | When APIs/architecture/UX affected |
38
- | 3e. Final Quality — Conditional | `hatch3r-lint-fixer`, `hatch3r-a11y-auditor`, `hatch3r-perf-profiler` | Yes | When triggered |
40
+ | 3e. Final Quality — Conditional | `hatch3r-lint-fixer`, `hatch3r-ui`, `hatch3r-performance` | Yes | When triggered |
41
+
42
+ **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.
39
43
 
40
44
  ## Browser Automation
41
45
 
@@ -93,6 +97,35 @@ Classify the pickup request before delegating:
93
97
 
94
98
  If Tier 1, run the standard delegation path (Step 6a) with reduced research depth. If Tier 2, run the standard pipeline below with parallel fanout where dependencies allow. If Tier 3, run the full pipeline with deep research and confirm batch composition with the user before branching.
95
99
 
100
+ ### Step 0.5: Emit Pre-Execution Cost Preview
101
+
102
+ Before the first sub-agent dispatch (Step 6 delegation), surface the cost preview so a multi-issue batch pickup 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 and the selected batch size:
103
+
104
+ ```yaml
105
+ cost_estimate:
106
+ expected_sa_count: <triage tier → Tier 1 ~2, Tier 2 ~6, Tier 3 up to 12 × batch-issue count>
107
+ estimated_input_tokens_static_frame: <int>
108
+ estimated_web_research_queries: <int>
109
+ triage_tier: light | standard | deep
110
+ estimated_duration_min: <int>
111
+ ```
112
+
113
+ Post-execution actuals + delta land in the Step 7 / post-impl iteration summary's Fan-out + Cost section per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
114
+
115
+ ### Effort Override (Decision 17)
116
+
117
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Effort Override (Decision 17). Misclassification example: an isolated sub-issue scored as Deep, or a cross-cutting epic scored as Light.
118
+
119
+ ### Confidence Floor (Decision 16 / D13-SA13.3-F13.3.3)
120
+
121
+ `--effort` calibrates work-effort depth; `--confidence-floor` calibrates the confidence threshold at which the Step 7 review gate (the canonical **Confidence-Aware Review Gate** in `agents/shared/confidence-gate.md`, run by `commands/board/pickup-delegation.md` / `pickup-delegation-multi.md`) blocks. They are orthogonal. This is the user's pre-flight assertiveness knob — the forced-second-pass on low confidence is post-hoc; the floor sets the bar before the run:
122
+
123
+ - `--confidence-floor=any|medium|high` (default `any`). Resolution order: explicit flag wins over the persisted `hatch3r config confidence_floor=...` default, which wins over the built-in `any`.
124
+ - **`any`** (current behavior): force a second reviewer pass only when reviewer confidence `== low` with 0 Critical + 0 Warning.
125
+ - **`medium`**: force a second pass on ANY finding rated `confidence == low`, even with 0 Critical + 0 Warning.
126
+ - **`high`**: force a second pass on any finding rated `confidence != high`, AND ASK the user on every low-confidence finding regardless of severity.
127
+ - Per P1 maturity tier (Decision 16): solo defaults `any`, enterprise defaults `high`. Pass the resolved floor verbatim into the Step 7 review-gate evaluation (`agents/shared/confidence-gate.md`, which the delegation sub-files run) alongside the confidence value sourced from the upstream reviewer (Confidence Propagation Contract). The floor never relaxes a Safety Guardrail.
128
+
96
129
  ---
97
130
 
98
131
  ### Step 1: List Available Work (Dependency-Aware)
@@ -295,6 +328,8 @@ Use the issue type to select the appropriate hatch3r skill: `type:bug` → the h
295
328
 
296
329
  Before delegating: scan `.hatch3r/learnings/` for matching `area`/`tags`, include relevant learnings (especially `pitfall` category) in sub-agent context. Skip silently if no learnings directory exists.
297
330
 
331
+ **Cross-PR finding memory (D13-SA13.1-F08).** Also scan `.hatch3r/review-findings/` (skip silently if absent) for entries whose `applies-to` glob matches the issue's target files; carry the 5 most-recent matches (by `created` descending) forward into the Step 7a reviewer prompt as a `## Cross-PR Findings` block so the reviewer — which declares `consults_cross_pr_findings: true` — weighs prior same-file findings as organisational memory. After the Step 7a review loop terminates clean, append one `.hatch3r/review-findings/<id>.md` entry per Critical/Warning finding resolved (atomic write via `src/merge/safeWrite.ts`), mirroring the Step 10 learnings-capture pattern.
332
+
298
333
  > **Audit epics:** Audit epics produce findings (issues) rather than code changes — adjust delegation and skip Steps 7-8a if no code changes.
299
334
 
300
335
  **Do NOT execute the skill's PR creation steps.** Steps 7-8 handle board-specific requirements (epic linking, label transitions, board sync).
@@ -313,7 +348,7 @@ Before delegating: scan `.hatch3r/learnings/` for matching `area`/`tags`, includ
313
348
 
314
349
  Execute Steps 7-10 in order after all implementation completes:
315
350
 
316
- - **Step 7:** Quality verification (lint, type check, tests, AC).
351
+ - **Step 7:** Quality verification (lint, type check, tests, AC). **Post-write duplication scan (Decision 21 / D13-SA13.2-F7):** when batch mode ran 2+ parallel implementers (Step 6c), run `npx jscpd --min-lines 40 --threshold 80 --reporters json --silent <changed-paths>` on the combined diff before the review gate clears — parallel implementers can each emit near-duplicate code that passes its own review independently. Any cross-file clone **≥40 lines OR ≥80% byte-similar** routes back to `hatch3r-fixer` for a DRY refactor (max 1 iteration), then re-runs the quality check. Skip when a single issue/implementer ran.
317
352
  - **Step 7a:** Commit and push all changes to the remote branch.
318
353
  - **Step 8:** Create PR/MR with proper `Closes #N` references. See platform sub-files for CLI commands.
319
354
  - **Step 8a:** Transition labels to `status:in-review` and sync board. See platform sub-files.
@@ -322,8 +357,57 @@ Execute Steps 7-10 in order after all implementation completes:
322
357
 
323
358
  ---
324
359
 
360
+ ## Resumability (Decision 27/30)
361
+
362
+ board-pickup is long-running — a Tier 3 batch picks up multiple epics/sub-issues, branches, delegates parallel implementers per dependency level (Step 6), runs the reviewer ↔ fixer review loop (Step 7a), and fans out the Phase 4 specialist batch (Step 7b–7c) across 11 sub-agents in `agentPipeline`. Per hatch3r's workspace-checkpointed resumability contract, checkpoint progress so an interrupted run re-enters at the last completed step rather than re-claiming issues, re-creating branches, or repeating implementer work that already wrote code.
363
+
364
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.board-pickup-workspace/`; step range the Step 0 → Step 10 progression; `wave` = dependency-level batch index when parallel implementers run; snapshot/rollback paths `.hatch3r/handoffs/` entries written by `hatch3r-handoff` and pre-commit working-tree state. Write points: after Step 1 work selection ASK, after Step 2 scope + dependency lock, after Step 3 collision detection, after Step 4 board-status update (issues moved to In Progress), after Step 5 branch creation (atomic with `branchName` persistence), after each Step 6 implementer batch returns per dependency level (so completed implementations survive a crash and are not re-implemented on resume), after each Step 7a review-loop iteration, after each Step 7b/7c parallel-specialist batch completes, after Step 8 git commit, and after Step 9 PR-readiness gate.
365
+
366
+ ---
367
+
368
+ ## Per-Turn Pipeline-State Header (Bypass Protection)
369
+
370
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for board-pickup: `1` = ready-queue selection + branch checkout, `2` = researcher + implementer dispatch, `3` = reviewer/fixer review-loop + Phase 4 specialists, `4` = PR creation + board sync + iteration-summary. Tier 1 runs are exempt per the Tier 1 exemption.
371
+
372
+ ## End-of-Turn Delegation Attestation (Bypass Protection)
373
+
374
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: implementer code changes, test additions, fixer corrections.
375
+
376
+ ## Iteration Summary (mandatory output)
377
+
378
+ 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).
379
+
380
+ The 9 sections:
381
+
382
+ 1. **Request** — verbatim restatement of the user's ask in one sentence.
383
+ 2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
384
+ 3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
385
+ 4. **Files Mutated** — list with diff summary (lines added / removed / files created).
386
+ 5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
387
+ 6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
388
+ 7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
389
+ 8. **Open Questions / Blockers** — explicit `None` if fully closed.
390
+ 9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
391
+
392
+ ### Cost Visibility (Decision 24)
393
+
394
+ > 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.
395
+
396
+ ## Cost estimate (Decision 24)
397
+
398
+ This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
399
+
400
+ - **Pre-execution `cost_estimate`** — emitted in Step 0.5 before the first sub-agent dispatch (Step 6 delegation).
401
+ - **Post-execution `cost_actuals` + `delta`** — appended to the Step 7 / post-impl iteration summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
402
+
403
+ Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 11` × tier heuristic in `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate): Tier 1 ≈ 2 (researcher + implementer, reviewer/fixer/testability/security when triggered); Tier 2 ≈ 6 (researcher + implementer + review loop + mandatory final-quality); Tier 3 up to 11 per issue (full pipeline including the Phase-4b CQ specialist batch bounded by `max_phase4_parallel`), scaling with batch-issue count. 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`.
404
+
405
+ ---
406
+
325
407
  ## Auto-Advance Mode, Error Handling, and Guardrails
326
408
 
327
409
  > Full details: see `commands/board/pickup-modes.md`
328
410
 
329
411
  The modes file contains: auto-advance mode (`--auto`/`--unattended`), safety guardrails, error handling, and operational guardrails for board-pickup.
412
+
413
+ **Concurrent invocation guardrail:** before Step 6 delegation, acquire `.hatch3r/.lock` and detect-then-warn on a conflicting active pipeline (same branch / open `.hatch3r/hatch.json` board transaction) per `rules/hatch3r-agent-orchestration.md` → Parallel Safety → Concurrent Invocation Handling. Batch-mode parallel implementers (Step 6c) are one pipeline by design; the guardrail governs a *second* concurrent top-level invocation against the same repo. Cross-task learnings consolidate at completion, never mid-pipeline.
@@ -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).
@@ -9,15 +9,17 @@ 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
- Before any action, scan the user's request and provided context for unresolved questions in scope, acceptance criteria, irreversibility, or constraint conflicts (contradictory inputs, missing target, unknown convention). 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 scope is single-target, single-concern, and the brief alone is testable. Any residual ambiguity discovered mid-workflow invokes the same protocol.
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.
@@ -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
@@ -423,6 +452,53 @@ 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).
@@ -431,7 +507,7 @@ If yes, instruct the user to invoke the `hatch3r-board-fill` command. Note that
431
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 clearly. 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.
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