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
@@ -0,0 +1,216 @@
1
+ ---
2
+ id: hatch3r-spec
3
+ type: command
4
+ orchestrator: true
5
+ agentPipeline: [hatch3r-greenfield-spec, hatch3r-brownfield-spec]
6
+ description: Spec orchestrator — detects greenfield vs brownfield project state and runs the corresponding spec agent to produce requirements, acceptance criteria, risk inventory, and test plan (greenfield adds market/competitive/persona/tech-stack; brownfield adds codebase-map/pattern-detection/integration/migration).
7
+ tags: [spec, planning, orchestrator]
8
+ pillars:
9
+ governance: [P1, P2, P8]
10
+ content-quality: [CQ8, CQ9]
11
+ triage_tiers: [1, 2, 3]
12
+ supports_resume: true
13
+ quality_charter: agents/shared/quality-charter.md
14
+ efficiency_patterns: agents/shared/efficiency-patterns.md
15
+ efficiency_tier: standard
16
+ cache_friendly: true
17
+ parallel_tool_default: true
18
+ sub_agents_spawned:
19
+ count: 1
20
+ rationale: "one spec sub-agent per invocation — chosen between greenfield/brownfield by project-state detection (not parallel; mutually exclusive)"
21
+ ---
22
+
23
+ # /hatch3r-spec
24
+
25
+ Spec orchestrator that detects project state, picks the matching spec agent (`hatch3r-greenfield-spec` or `hatch3r-brownfield-spec`), and aggregates the 8-deliverable contract — shared core (requirements, acceptance criteria, risk inventory, test plan) plus state-specific deliverables (greenfield: market/competitive/persona/tech-stack; brownfield: codebase-map/pattern-detection/integration/migration). Routing is mutually exclusive — exactly one spec agent runs per invocation.
26
+
27
+ ## §0 Detect Ambiguity (P8 B1)
28
+
29
+ Before any action, scan the user's request for unresolved questions per `agents/shared/user-question-protocol.md`. Ask via the platform-native question tool — do not proceed under silent assumption. Orchestrator-level ambiguities to resolve up front:
30
+
31
+ 1. **Subsystem scope** — does the spec cover the whole project, a named module, or a single feature? If the request says "spec the project" without a scope marker, ask which slice and offer three options (full / named-subsystem / feature-only).
32
+ 2. **MVP vs full vision** — for greenfield, ask whether the spec targets a shippable MVP (CQ8 surface area minimized) or the full envisioned product. Default `MVP` if no response.
33
+ 3. **Triage tier** — Light (single-feature), Standard (subsystem), Deep (full-project). Auto-classify from scope answer; ask only if the request explicitly overrides.
34
+
35
+ Acceptable to proceed without asking ONLY when the brief alone is single-target, single-concern, and produces a testable acceptance criterion.
36
+
37
+ ## Phase 0 — Project state detection
38
+
39
+ Detect greenfield vs brownfield from the working directory. Run these read-only probes in parallel:
40
+
41
+ | Signal | Source | Brownfield score |
42
+ |--------|--------|------------------|
43
+ | Tracked source files | `git ls-files` count under `src/`, `lib/`, `app/`, language-default dirs | +1 per ≥10 files |
44
+ | Manifest present | `package.json`, `go.mod`, `Cargo.toml`, `pom.xml`, `pyproject.toml`, `Gemfile`, `composer.json` | +1 per manifest found |
45
+ | Commit count | `git rev-list --count HEAD` | +1 if ≥5 |
46
+ | Test suite | tests/`, `__tests__/`, `spec/`, `*_test.go`, `*.test.ts` | +1 if present |
47
+ | Existing README with body | README.md ≥30 lines and not the npm/cargo init template | +1 |
48
+ | Adapter outputs already present | `.cursor/`, `CLAUDE.md`, `.github/copilot-instructions.md` | +1 |
49
+
50
+ **Classification:** brownfield score ≥3 → brownfield. Otherwise → greenfield. Threshold configurable via `--state=greenfield|brownfield` to override the heuristic.
51
+
52
+ Cache the score, the matched signals, and the resolved state in the run context. Report to the user before delegating.
53
+
54
+ ## Triage
55
+
56
+ Resolve the triage tier from scope answer (or auto-detect):
57
+
58
+ - **Light** — single-feature spec. Skip optional deliverables (market sizing for greenfield, migration plan for brownfield) unless the user opts in. Default sub-agent input budget ~6,000 tokens.
59
+ - **Standard** — subsystem-level spec covering a coherent module. All 8 deliverables produced. Default budget ~12,000 tokens.
60
+ - **Deep** — full-project spec, multi-domain. All 8 deliverables plus depth on risk inventory (≥5 named risks with mitigation owners) and test plan (per-layer coverage matrix). Default budget ~24,000 tokens.
61
+
62
+ ## Effort Override (Decision 17)
63
+
64
+ Auto-tiering can misclassify — a trivial brief scored as Deep, or a multi-domain brief scored as Light. The user override is the recovery path mandated by hatch3r's universal `--effort` override contract ("User overridable via `--effort` flag"):
65
+
66
+ - `--effort=light|standard|deep` forces the named tier, bypassing the Triage auto-classification above.
67
+ - 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.
68
+ - When `--effort=deep` lands on a Light-classified scope (or `--effort=light` on a Deep-classified scope), accept the override and emit the resized `estimated_input_tokens_static_frame` in the Cost estimate block.
69
+ - No override passed → the Triage auto-classification stands.
70
+
71
+ ## Confidence Propagation Contract
72
+
73
+ 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.
74
+
75
+ > 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.
76
+
77
+ Downstream propagation: the Phase 0 project-state classification (already scored against the brownfield-signal table), each of the 8 deliverables' risk and acceptance-criteria confidence, and the Phase 6 iteration-summary Confidence field MUST carry a high/medium/low rating sourced from the spec agent. Market-research figures (greenfield) are medium at best unless tied to a cited source per Decision 14. Every ASK checkpoint that reports verification quality, every gate that evaluates a sub-agent verdict, and every output block that surfaces merge-readiness MUST carry a high/medium/low confidence rating sourced from the upstream sub-agent. Dropping the signal between stages is a gate failure.
78
+
79
+ ## Phase 1.5 — Emit Pre-Execution Cost Preview
80
+
81
+ Before the Phase 2 dispatch, surface the `cost_estimate` block (the pre-execution half of the Cost estimate section below) so the spec run is never started blind. The Phase 0 detection + §0 ASK gate are user-driven and excluded from the duration estimate. This is the explicit pre-execution emission point mandated by `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate.
82
+
83
+ ## Phase 2 — Delegate to chosen spec agent
84
+
85
+ Spawn exactly one spec agent via the Task tool. Routing is mutually exclusive:
86
+
87
+ - `brownfield` → `hatch3r-brownfield-spec`
88
+ - `greenfield` → `hatch3r-greenfield-spec`
89
+
90
+ **Inputs passed to the sub-agent:**
91
+
92
+ | Field | Source |
93
+ |-------|--------|
94
+ | `project_state` | Phase 0 result (greenfield or brownfield + matched signals) |
95
+ | `triage_tier` | Phase 1 result (light, standard, deep) |
96
+ | `scope` | §0 answer (full project / named subsystem / single feature) |
97
+ | `output_root` | `.hatch3r/spec/<ISO-8601-timestamp>/` |
98
+ | `mvp_or_full` | §0 answer (greenfield only); brownfield ignores |
99
+ | `maturity_tier` | Read from `.hatch3r/hatch.json::maturity` (defaults to `solo` per Decision 16) |
100
+
101
+ No inline mutations from this orchestrator turn — the spec agent owns all file writes.
102
+
103
+ ## Phase 3 — Aggregate deliverables
104
+
105
+ Wait for the spec agent's structured result. Verify all 8 deliverables landed:
106
+
107
+ **Shared core (both states):**
108
+ 1. `requirements.md` — functional + non-functional requirements with priority labels.
109
+ 2. `acceptance-criteria.md` — testable acceptance criteria, one block per requirement.
110
+ 3. `risk-inventory.md` — named risks with likelihood × impact, mitigation owner, residual risk.
111
+ 4. `test-plan.md` — coverage by layer (unit / integration / E2E / contract / mutation per `rules/hatch3r-testing.md` mandate-map).
112
+
113
+ **Greenfield-specific (`hatch3r-greenfield-spec`):**
114
+
115
+ 5. `market-research.md` — addressable market, growth signals, ≥2 reputable sources ≤12 months old per `agents/shared/rigor-contract.md` (Web Research Mandate).
116
+ 6. `competitive-analysis.md` — named competitors, capability matrix, differentiation hypothesis.
117
+ 7. `personas.md` — ≥2 personas with jobs-to-be-done, current workaround, acceptance signal.
118
+ 8. `tech-stack.md` — chosen stack with rationale citing CQ7 (performance budgets) and CQ6 (scalability) impact.
119
+
120
+ **Brownfield-specific (`hatch3r-brownfield-spec`):**
121
+
122
+ 5. `codebase-map.md` — directory tree summary, top 10 modules by LOC + churn, public interface inventory.
123
+ 6. `pattern-detection.md` — recurring patterns (naming, error handling, test style) the new work must follow per CQ8.
124
+ 7. `integration-plan.md` — touchpoint inventory (which existing files extend or wrap), expand-contract migration shape per CQ8.
125
+ 8. `migration-notes.md` — pre/post snapshot diff plan, rollback path, observability touchpoints per CQ4.
126
+
127
+ If any deliverable is missing or empty, halt and surface the gap to the user — do not silently accept a partial spec. Resume via `--resume` per the resumability contract (Decision 27).
128
+
129
+ ## Phase 4 — Per-Turn Pipeline-State Header
130
+
131
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping: `1` = detection + triage, `2` = spec-agent delegation, `3` = aggregation + verification, `4` = summary. Light runs are exempt from the header per the Tier 1 exemption.
132
+
133
+ ## Phase 5 — End-of-Turn Delegation Attestation
134
+
135
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: the artifacts this command writes.
136
+
137
+ ## Phase 6 — Iteration Summary
138
+
139
+ Emit the canonical 9-section iteration summary per `rules/hatch3r-iteration-summary.md`. Sections required: Status, Outcome, Done, Not Done / Deferred / Unverified, Open Questions / Blockers, Confidence, Artifacts Touched (the 8 deliverable paths), Verifications Run (deliverable-presence checks), Suggested Next Action (typically `/hatch3r-board-fill` to convert acceptance criteria into a board).
140
+
141
+ ## Output paths
142
+
143
+ All deliverables land in a single timestamped directory:
144
+
145
+ ```
146
+ .hatch3r/spec/<ISO-8601-timestamp>/
147
+ ├── requirements.md
148
+ ├── acceptance-criteria.md
149
+ ├── risk-inventory.md
150
+ ├── test-plan.md
151
+ └── {state-specific 4 files per Phase 3}
152
+ ```
153
+
154
+ The directory is the unit of versioning — re-running `/hatch3r-spec` produces a new timestamped tree, never overwriting prior runs.
155
+
156
+ ## Iteration Summary (mandatory output)
157
+
158
+ Emit the canonical 9-section iteration summary per `rules/hatch3r-iteration-summary.md` as the final user-facing output (the Phase 6 Iteration Summary above is the spec-specific rendering — both the Phase 6 block and the 9-section canonical contract apply). The validation gate at `.claude/rules/capability-lifecycle.md` blocks SUCCESS declarations without this block (CONSTITUTION §6 Decision 23).
159
+
160
+ The 9 sections:
161
+
162
+ 1. **Request** — verbatim restatement of the user's ask in one sentence.
163
+ 2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
164
+ 3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
165
+ 4. **Files Mutated** — list with diff summary (lines added / removed / files created).
166
+ 5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
167
+ 6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
168
+ 7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
169
+ 8. **Open Questions / Blockers** — explicit `None` if fully closed.
170
+ 9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
171
+
172
+ ### Cost Visibility (Decision 24)
173
+
174
+ > 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.
175
+
176
+ ## Cost estimate (Decision 24)
177
+
178
+ Field names match the canonical contract in `rules/hatch3r-cost-visibility.md` (Pre-Execution Estimate + Post-Execution Actuals). Emit the pre-execution block before Phase 2 dispatch:
179
+
180
+ ```yaml
181
+ cost_estimate:
182
+ expected_sa_count: 1
183
+ estimated_input_tokens_static_frame: 12000 # standard tier; light ~6000, deep ~24000
184
+ estimated_web_research_queries: 4 # greenfield 2-6; brownfield is local-only (0)
185
+ triage_tier: light | standard | deep
186
+ estimated_duration_min: 8 # standard tier; light ~4, deep ~12
187
+ ```
188
+
189
+ Post-execution: emit the actuals + delta block per `rules/hatch3r-cost-visibility.md` before declaring iteration-summary status. Token telemetry sources from `src/pipeline/observability.ts`:
190
+
191
+ ```yaml
192
+ cost_actuals:
193
+ actual_sa_count: <int>
194
+ actual_input_tokens: <int>
195
+ actual_output_tokens: <int>
196
+ actual_web_research_queries: <int>
197
+ actual_duration_min: <float>
198
+ delta:
199
+ sa_count_delta: <int>
200
+ input_tokens_delta_percent: <float>
201
+ duration_delta_percent: <float>
202
+ ```
203
+
204
+ Both blocks land in the iteration summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2. Deltas beyond 25% absolute value carry `flagged_for_review: true`.
205
+
206
+ ## References
207
+
208
+ - hatch3r design decisions: reputable-source mandate (Decision #14) and the 2-spec-agents-with-shared-core split (Decision #23)
209
+ - hatch3r design decisions: C8-D5-M1 orchestrator-marker contract (`orchestrator: true` + `agentPipeline`) and the Command-vs-Skill authoring criterion (Decision #13)
210
+ - `agents/shared/user-question-protocol.md` (B1 gate)
211
+ - `agents/shared/quality-charter.md` §1, §3, §7, §8 (confidence, ambiguity, measurable criteria)
212
+ - `rules/hatch3r-agent-orchestration.md` (Per-Turn Pipeline-State Header, End-of-Turn Delegation Attestation, Mandatory Delegation Directive)
213
+ - `rules/hatch3r-iteration-summary.md` (canonical end-of-turn block)
214
+ - `rules/hatch3r-cost-visibility.md` (Decision 24 cost_estimate / cost_actuals / delta field contract)
215
+ - hatch3r design decision: `--effort` universal override + triage_tiers (Decision 17)
216
+ - `commands/hatch3r-board-fill.md` (orchestrator pattern reference)
@@ -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: 5
15
- rationale: Five parallel hatch3r-researcher modes per test-planning brief — coverage-analysis, complexity-and-risk, test-pattern, boundary-analysis, risk-prioritization — dispatched concurrently in Step 3; a docs-writer composes the test plan on their merged output.
17
+ rationale: Five parallel hatch3r-researcher modes per test-planning brief — coverage-analysis, complexity-and-risk, test-pattern, boundary-analysis, risk-prioritization — dispatched concurrently in Step 3; a docs-writer composes the test plan 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,9 +29,11 @@ Before any action, scan the user's request and provided context for unresolved q
27
29
  | 2. Document Generation | `hatch3r-docs-writer` (test plan spec, 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
  # Test Plan -- Comprehensive Test Strategy from Scope to Board-Ready Epic
31
35
 
32
- Take a test planning scope (feature, module, or codebase area) and produce a complete test plan specification (`docs/specs/`), architectural decision records (`docs/adr/`) when significant testing infrastructure decisions are involved, and structured `todo.md` entries (epic + sub-items) ready for `hatch3r-board-fill`. Spawns parallel researcher sub-agents (coverage analysis, complexity & risk mapping, test pattern extraction, boundary analysis, risk-based prioritization) to analyze the testing landscape from multiple angles before generating artifacts. AI proposes all outputs; user confirms before any files are written. Supports two modes: feature-scoped test planning (plan tests for a specific feature) and module/codebase-level coverage auditing (assess and improve test coverage across an area). Optionally chains into `hatch3r-test-writer` for immediate test implementation or `hatch3r-board-fill` to create tracking issues.
36
+ Take a test planning scope (feature, module, or codebase area) and produce a complete test plan specification (`docs/specs/`), architectural decision records (`docs/adr/`) when significant testing infrastructure decisions are involved, and structured `todo.md` entries (epic + sub-items) ready for `hatch3r-board-fill`. Spawns parallel researcher sub-agents (coverage analysis, complexity & risk mapping, test pattern extraction, boundary analysis, risk-based prioritization) to analyze the testing landscape from multiple angles before generating artifacts. AI proposes all outputs; user confirms before any files are written. Supports two modes: feature-scoped test planning (plan tests for a specific feature) and module/codebase-level coverage auditing (assess and improve test coverage across an area). Optionally chains into `hatch3r-testability` for CQ5 mandate verification or `hatch3r-board-fill` to create tracking issues.
33
37
 
34
38
  ---
35
39
 
@@ -45,6 +49,12 @@ Take a test planning scope (feature, module, or codebase area) and produce a com
45
49
 
46
50
  ---
47
51
 
52
+ ## Confidence Propagation Contract
53
+
54
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Confidence Propagation Contract. Readiness kind: plan.
55
+
56
+ ---
57
+
48
58
  ## Workflow
49
59
 
50
60
  Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
@@ -59,6 +69,25 @@ Classify the test-planning request before delegating:
59
69
 
60
70
  If Tier 1, run the reduced researcher set and skip Step 6 (ADRs). If Tier 2, run the standard pipeline below. If Tier 3, run the full pipeline including ADR generation for testing infrastructure decisions and confirm scope with the user before writing files.
61
71
 
72
+ ### Step 0.5: Emit Pre-Execution Cost Preview
73
+
74
+ Before the first researcher dispatch (Step 3), surface the cost preview so a multi-researcher test-planning run 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:
75
+
76
+ ```yaml
77
+ cost_estimate:
78
+ expected_sa_count: <triage tier → Tier 1 ~2, Tier 2 ~5, Tier 3 up to 5>
79
+ estimated_input_tokens_static_frame: <int>
80
+ estimated_web_research_queries: <int>
81
+ triage_tier: light | standard | deep
82
+ estimated_duration_min: <int>
83
+ ```
84
+
85
+ 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`.
86
+
87
+ ### Effort Override (Decision 17)
88
+
89
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Effort Override (Decision 17). Misclassification example: a single-module test plan scored as Deep, or a full-suite restructure scored as Light.
90
+
62
91
  ---
63
92
 
64
93
  ### Step 1: Gather Test Planning Scope
@@ -100,7 +129,7 @@ After the test planning brief is confirmed, probe for missing requirements acros
100
129
  - **Test data requirements**: Data generation approach? Fixture vs factory preference? Seeding requirements? PII concerns in test data?
101
130
  - **Browser/E2E scope**: Which user flows need E2E coverage? Browser matrix? Mobile viewport testing?
102
131
  - **Flaky test tolerance**: Existing flaky tests? Quarantine process in place? Retry budget in CI?
103
- 3. Skip dimensions that the brief already addresses clearly.
132
+ 3. Skip dimensions that the brief already addresses with a stated answer.
104
133
 
105
134
  **ASK:** "Before research begins, I have {N} questions to confirm the test plan covers all relevant dimensions:
106
135
  {numbered question list -- each with the dimension label and why the answer matters}
@@ -175,7 +204,7 @@ The `coverage-analysis` sub-agent establishes the baseline -- its output tells u
175
204
 
176
205
  The `risk-prioritization` sub-agent's output is critical for ordering the test plan -- it determines which tests should be written first for maximum risk reduction.
177
206
 
178
- The `test-pattern` sub-agent ensures the plan aligns with existing conventions, so new tests fit naturally into the codebase.
207
+ The `test-pattern` sub-agent ensures the plan aligns with existing conventions, so new tests fit the codebase's existing patterns (file layout, fixture style, assertion idiom).
179
208
 
180
209
  **Each sub-agent prompt must also include** the Resolved Requirements from Step 1b (user's answers to dimension-probing questions) so researchers can factor in the user's explicit decisions.
181
210
 
@@ -340,7 +369,7 @@ Reference conventions from `hatch3r-testing` rule:
340
369
  | Deterministic (no wall clock) | {aligned / needs attention} | {details} |
341
370
  | Isolated (own setup/teardown) | {aligned / needs attention} | {details} |
342
371
  | Fast (unit < 50ms, integration < 2s) | {aligned / needs attention} | {details} |
343
- | Named clearly (behavior descriptions) | {aligned / needs attention} | {details} |
372
+ | Named per behavior description (verb + outcome) | {aligned / needs attention} | {details} |
344
373
  | No network in unit tests | {aligned / needs attention} | {details} |
345
374
  | Fakes > stubs > mocks hierarchy | {aligned / needs attention} | {details} |
346
375
  | Factory over fixtures | {aligned / needs attention} | {details} |
@@ -519,16 +548,63 @@ Files Created/Updated:
519
548
  ### Step 9 (Optional): Chain into Test Writer or Board-Fill
520
549
 
521
550
  **ASK:** "All files written. What would you like to do next?
522
- - **Run `hatch3r-test-writer`** to implement the highest-priority (P0) tests immediately
551
+ - **Run `hatch3r-testability`** to verify the highest-priority (P0) tests meet the CQ5 mandate map / coverage floor
523
552
  - **Run `hatch3r-board-fill`** to create GitHub issues from the new todo.md entries
524
553
  - **Neither** -- I'll take it from here"
525
554
 
526
- If `hatch3r-test-writer`: instruct the user to invoke `hatch3r-test-writer`, passing the P0 test cases from the test plan spec as the scope.
555
+ If `hatch3r-testability`: instruct the user to invoke `hatch3r-testability`, passing the P0 test cases from the test plan spec as the scope.
527
556
 
528
557
  If `hatch3r-board-fill`: instruct the user to invoke `hatch3r-board-fill`. Note that board-fill will perform its own deduplication, grouping, dependency analysis, and readiness assessment on the entries.
529
558
 
530
559
  ---
531
560
 
561
+ ## Resumability (Decision 27/30)
562
+
563
+ test-plan is long-running — a Tier 3 plan fans out parallel researcher sub-agents across coverage, framework, and convention modes (Step 3), drives an ASK synthesis (Step 4), then writes a multi-file test plan spec + ADRs + todo.md (Steps 5–8). 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 batch.
564
+
565
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.test-plan-workspace/`; step range the Step 0 → Step 9 progression; `wave` = researcher-batch index; snapshot/rollback paths `docs/specs/`, `docs/adr/`, and `todo.md`; `meta` adds `testPlanSlug`. Write points: after Step 1 scope confirmation, after Step 2 context load, after Step 3 researcher fan-out completes, after the Step 4 ASK synthesis is confirmed, and after each Step 5–8 file write (test plan spec, ADRs, todo.md) so already-generated artifacts survive a crash and are not regenerated on resume.
566
+
567
+ ---
568
+
569
+ ## Per-Turn Pipeline-State Header (Bypass Protection)
570
+
571
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for test-plan: `1` = feature/diff intake + mandate-class detection, `2` = hatch3r-testability sub-agent dispatch (fuzz / mutation / contract / property / visual / AI-eval), `3` = plan synthesis + coverage analysis, `4` = plan write + iteration-summary. Tier 1 runs are exempt per the Tier 1 exemption.
572
+
573
+ ## End-of-Turn Delegation Attestation (Bypass Protection)
574
+
575
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: test-plan doc, mandate matrix, coverage spec.
576
+
577
+ ## Iteration Summary (mandatory output)
578
+
579
+ 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).
580
+
581
+ The 9 sections:
582
+
583
+ 1. **Request** — verbatim restatement of the user's ask in one sentence.
584
+ 2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
585
+ 3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
586
+ 4. **Files Mutated** — list with diff summary (lines added / removed / files created).
587
+ 5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
588
+ 6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
589
+ 7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
590
+ 8. **Open Questions / Blockers** — explicit `None` if fully closed.
591
+ 9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
592
+
593
+ ### Cost Visibility (Decision 24)
594
+
595
+ > 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.
596
+
597
+ ## Cost estimate (Decision 24)
598
+
599
+ This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
600
+
601
+ - **Pre-execution `cost_estimate`** -- emitted in Step 0.5 before the first researcher dispatch.
602
+ - **Post-execution `cost_actuals` + `delta`** -- appended to the iteration summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
603
+
604
+ Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 5` × tier heuristic in `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate): Tier 1 ≈ 2 (coverage-analysis + risk-prioritization); Tier 2/3 spawn up to 5 parallel researcher modes. 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`.
605
+
606
+ ---
607
+
532
608
  ## Error Handling
533
609
 
534
610
  - **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).
@@ -549,7 +625,7 @@ If `hatch3r-board-fill`: instruct the user to invoke `hatch3r-board-fill`. Note
549
625
  - **Stay within the test planning scope** defined by the user in Step 1. Do not invent test areas the user did not describe or imply. Flag coverage expansion opportunities but do not act on them without explicit approval.
550
626
  - **Coverage targets must align with `hatch3r-testing` rule thresholds.** Statement 80%, branch 70%, critical modules 90%/85%. If the user requests lower targets, note the divergence explicitly.
551
627
  - **Test cases must follow the convention hierarchy.** Fakes > stubs > mocks, as specified in `hatch3r-testing` rule. If the codebase uses a different convention, note the divergence and recommend gradual alignment.
552
- - **Do not prescribe implementation details.** The test plan specifies what to test, not how to implement the tests. Implementation details are `hatch3r-test-writer`'s responsibility. Test case outlines include behavior descriptions and acceptance criteria, not code.
628
+ - **Do not prescribe implementation details.** The test plan specifies what to test, not how to implement the tests. Implementation details are the implementer's responsibility, gated by `hatch3r-testability` (CQ5). Test case outlines include behavior descriptions and acceptance criteria, not code.
553
629
  - **Property-based and mutation testing are opt-in.** Only include these in the plan if the user opts in during Step 1b or the codebase already uses them.
554
630
  - **All 5 researchers must complete before proceeding to Step 4.** Do not generate specs from partial research.
555
631
  - **todo.md must be compatible with board-fill format** -- markdown checklist with bold titles, grouped by priority, referencing source specs.