hatch3r 1.8.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.md +68 -178
  2. package/dist/cli/index.js +26966 -15942
  3. package/{agents → dist/content/agents}/hatch3r-architect.md +39 -9
  4. package/dist/content/agents/hatch3r-brownfield-spec.md +254 -0
  5. package/{agents → dist/content/agents}/hatch3r-ci-watcher.md +10 -3
  6. package/{agents → dist/content/agents}/hatch3r-context-rules.md +24 -6
  7. package/{agents → dist/content/agents}/hatch3r-creator.md +78 -39
  8. package/dist/content/agents/hatch3r-dependency-drafter.md +162 -0
  9. package/{agents → dist/content/agents}/hatch3r-devops.md +14 -4
  10. package/{agents → 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/{agents → dist/content/agents}/hatch3r-fixer.md +61 -10
  14. package/dist/content/agents/hatch3r-greenfield-spec.md +256 -0
  15. package/{agents → dist/content/agents}/hatch3r-handoff-loader.md +40 -14
  16. package/{agents → dist/content/agents}/hatch3r-handoff-preparer.md +17 -8
  17. package/dist/content/agents/hatch3r-implementer.md +409 -0
  18. package/dist/content/agents/hatch3r-incident-responder.md +96 -0
  19. package/dist/content/agents/hatch3r-learnings-loader.md +377 -0
  20. package/{agents → dist/content/agents}/hatch3r-lint-fixer.md +16 -4
  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/{agents → dist/content/agents}/hatch3r-researcher.md +30 -7
  26. package/dist/content/agents/hatch3r-reviewer.md +364 -0
  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/{agents → dist/content/agents}/modes/requirements-elicitation.md +1 -1
  33. package/{agents → 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/{agents → dist/content/agents}/shared/efficiency-patterns.md +32 -1
  38. package/{agents → dist/content/agents}/shared/external-knowledge.md +1 -1
  39. package/{agents → dist/content/agents}/shared/injection-patterns.md +19 -8
  40. package/dist/content/agents/shared/principles.md +60 -0
  41. package/{agents → dist/content/agents}/shared/prompt-structure.md +7 -1
  42. package/{agents → dist/content/agents}/shared/quality-charter.md +73 -9
  43. package/dist/content/agents/shared/quality-specialist-frame.md +141 -0
  44. package/dist/content/agents/shared/rigor-contract.md +151 -0
  45. package/dist/content/agents/shared/severity-mapping.md +92 -0
  46. package/dist/content/agents/shared/triage-vocabulary.md +46 -0
  47. package/{agents → dist/content/agents}/shared/user-content-templates.md +40 -14
  48. package/dist/content/agents/shared/user-question-protocol.md +139 -0
  49. package/{checks → dist/content/checks}/README.md +5 -0
  50. package/{checks → dist/content/checks}/accessibility.md +14 -7
  51. package/{checks → dist/content/checks}/code-quality.md +1 -1
  52. package/{checks → dist/content/checks}/performance.md +7 -4
  53. package/{checks → dist/content/checks}/security.md +6 -6
  54. package/{checks → dist/content/checks}/testing.md +1 -1
  55. package/{commands → dist/content/commands}/board/pickup-azure-devops.md +1 -1
  56. package/{commands → dist/content/commands}/board/pickup-delegation-multi.md +41 -14
  57. package/{commands → dist/content/commands}/board/pickup-delegation.md +10 -8
  58. package/{commands → dist/content/commands}/board/pickup-github.md +1 -1
  59. package/{commands → dist/content/commands}/board/pickup-gitlab.md +1 -1
  60. package/{commands → dist/content/commands}/board/pickup-modes.md +1 -0
  61. package/{commands → dist/content/commands}/board/pickup-post-impl.md +2 -2
  62. package/{commands → dist/content/commands}/board/shared-azure-devops.md +1 -1
  63. package/{commands → dist/content/commands}/board/shared-github.md +2 -2
  64. package/{commands → dist/content/commands}/board/shared-gitlab.md +1 -1
  65. package/{commands → dist/content/commands}/hatch3r-api-spec.md +80 -3
  66. package/dist/content/commands/hatch3r-auth-scaffold.md +250 -0
  67. package/{commands → dist/content/commands}/hatch3r-benchmark.md +91 -8
  68. package/{commands → dist/content/commands}/hatch3r-board-fill.md +104 -18
  69. package/{commands → dist/content/commands}/hatch3r-board-pickup.md +99 -15
  70. package/dist/content/commands/hatch3r-bug-pipeline.md +240 -0
  71. package/{commands → dist/content/commands}/hatch3r-bug-plan.md +84 -8
  72. package/{commands → dist/content/commands}/hatch3r-codebase-map.md +82 -6
  73. package/{commands → dist/content/commands}/hatch3r-create.md +116 -18
  74. package/{commands → dist/content/commands}/hatch3r-debug.md +112 -24
  75. package/dist/content/commands/hatch3r-diagnose.md +238 -0
  76. package/{commands → dist/content/commands}/hatch3r-feature-plan.md +130 -10
  77. package/dist/content/commands/hatch3r-handoff.md +213 -0
  78. package/{commands → dist/content/commands}/hatch3r-healthcheck.md +106 -6
  79. package/dist/content/commands/hatch3r-incident-response.md +228 -0
  80. package/{commands → dist/content/commands}/hatch3r-migration-plan.md +81 -5
  81. package/{commands → dist/content/commands}/hatch3r-onboard.md +100 -9
  82. package/dist/content/commands/hatch3r-pack-install.md +243 -0
  83. package/{commands → dist/content/commands}/hatch3r-pr-resolve.md +114 -31
  84. package/{commands → dist/content/commands}/hatch3r-project-spec.md +85 -9
  85. package/{commands → dist/content/commands}/hatch3r-quick-change.md +115 -20
  86. package/{commands → dist/content/commands}/hatch3r-refactor-plan.md +82 -6
  87. package/dist/content/commands/hatch3r-release.md +401 -0
  88. package/{commands → dist/content/commands}/hatch3r-revision.md +104 -18
  89. package/{commands → dist/content/commands}/hatch3r-roadmap.md +94 -12
  90. package/{commands → dist/content/commands}/hatch3r-security-audit.md +107 -7
  91. package/dist/content/commands/hatch3r-slo-scaffold.md +246 -0
  92. package/dist/content/commands/hatch3r-spec.md +216 -0
  93. package/{commands → dist/content/commands}/hatch3r-test-plan.md +90 -14
  94. package/dist/content/commands/hatch3r-workflow.md +628 -0
  95. package/{commands → dist/content/commands}/revision/revision-delegation.md +8 -7
  96. package/{commands → dist/content/commands}/revision/revision-modes.md +49 -4
  97. package/{commands → dist/content/commands}/revision/revision-quality.md +12 -9
  98. package/dist/content/commands/shared/orchestration-frame.md +119 -0
  99. package/{github-agents → dist/content/github-agents}/hatch3r-docs-agent.md +22 -2
  100. package/dist/content/github-agents/hatch3r-lint-agent.md +66 -0
  101. package/{github-agents → dist/content/github-agents}/hatch3r-security-agent.md +22 -2
  102. package/{github-agents → dist/content/github-agents}/hatch3r-test-agent.md +22 -2
  103. package/{hooks → dist/content/hooks}/hatch3r-ci-failure.md +3 -3
  104. package/{hooks → dist/content/hooks}/hatch3r-file-save.md +4 -4
  105. package/{hooks → dist/content/hooks}/hatch3r-post-merge.md +1 -1
  106. package/{hooks → dist/content/hooks}/hatch3r-pre-commit.md +1 -1
  107. package/{hooks → dist/content/hooks}/hatch3r-pre-push.md +7 -7
  108. package/dist/content/hooks/hatch3r-review-loop-cap.md +52 -0
  109. package/{hooks → dist/content/hooks}/hatch3r-session-start.md +3 -3
  110. package/{mcp → dist/content/mcp}/mcp.json +7 -5
  111. package/{rules → dist/content/rules}/hatch3r-accessibility-standards.md +16 -3
  112. package/{rules → dist/content/rules}/hatch3r-accessibility-standards.mdc +13 -1
  113. package/dist/content/rules/hatch3r-agent-orchestration-detail.md +250 -0
  114. package/dist/content/rules/hatch3r-agent-orchestration-detail.mdc +245 -0
  115. package/dist/content/rules/hatch3r-agent-orchestration.md +250 -0
  116. package/dist/content/rules/hatch3r-agent-orchestration.mdc +245 -0
  117. package/{rules → dist/content/rules}/hatch3r-ai-evals.md +7 -5
  118. package/{rules → dist/content/rules}/hatch3r-ai-evals.mdc +5 -4
  119. package/{rules → dist/content/rules}/hatch3r-ai-ux-patterns.md +7 -3
  120. package/{rules → dist/content/rules}/hatch3r-ai-ux-patterns.mdc +4 -1
  121. package/dist/content/rules/hatch3r-android-patterns.md +107 -0
  122. package/dist/content/rules/hatch3r-android-patterns.mdc +102 -0
  123. package/dist/content/rules/hatch3r-anti-duplication.md +115 -0
  124. package/dist/content/rules/hatch3r-anti-duplication.mdc +115 -0
  125. package/{rules → dist/content/rules}/hatch3r-api-design.md +5 -1
  126. package/{rules → dist/content/rules}/hatch3r-api-design.mdc +3 -0
  127. package/{rules → dist/content/rules}/hatch3r-api-versioning.md +3 -1
  128. package/{rules → dist/content/rules}/hatch3r-api-versioning.mdc +1 -0
  129. package/{rules → dist/content/rules}/hatch3r-auth-patterns.md +5 -2
  130. package/{rules → dist/content/rules}/hatch3r-auth-patterns.mdc +2 -0
  131. package/{rules → dist/content/rules}/hatch3r-browser-verification.md +8 -10
  132. package/{rules → dist/content/rules}/hatch3r-browser-verification.mdc +8 -10
  133. package/dist/content/rules/hatch3r-capability-matrix.md +108 -0
  134. package/dist/content/rules/hatch3r-capability-matrix.mdc +108 -0
  135. package/{rules → dist/content/rules}/hatch3r-ci-cd.md +9 -1
  136. package/{rules → dist/content/rules}/hatch3r-ci-cd.mdc +7 -0
  137. package/dist/content/rules/hatch3r-clarification-default.md +73 -0
  138. package/dist/content/rules/hatch3r-clarification-default.mdc +73 -0
  139. package/{rules → dist/content/rules}/hatch3r-code-standards.md +23 -47
  140. package/{rules → dist/content/rules}/hatch3r-code-standards.mdc +22 -46
  141. package/{rules → dist/content/rules}/hatch3r-component-conventions.md +4 -1
  142. package/{rules → dist/content/rules}/hatch3r-component-conventions.mdc +3 -0
  143. package/{rules → dist/content/rules}/hatch3r-container-hardening.md +13 -3
  144. package/{rules → dist/content/rules}/hatch3r-container-hardening.mdc +10 -1
  145. package/{rules → dist/content/rules}/hatch3r-contract-testing.md +3 -1
  146. package/{rules → dist/content/rules}/hatch3r-contract-testing.mdc +1 -0
  147. package/dist/content/rules/hatch3r-cost-visibility.md +135 -0
  148. package/dist/content/rules/hatch3r-cost-visibility.mdc +135 -0
  149. package/dist/content/rules/hatch3r-cq-rule-frame.md +54 -0
  150. package/dist/content/rules/hatch3r-cq-rule-frame.mdc +49 -0
  151. package/{rules → dist/content/rules}/hatch3r-data-classification.md +5 -2
  152. package/{rules → dist/content/rules}/hatch3r-data-classification.mdc +3 -1
  153. package/{rules → dist/content/rules}/hatch3r-deep-context.md +14 -14
  154. package/{rules → dist/content/rules}/hatch3r-deep-context.mdc +13 -13
  155. package/{rules → dist/content/rules}/hatch3r-dependency-management.md +18 -4
  156. package/{rules → dist/content/rules}/hatch3r-dependency-management.mdc +16 -3
  157. package/{rules → dist/content/rules}/hatch3r-design-system-detection.md +4 -2
  158. package/{rules → dist/content/rules}/hatch3r-design-system-detection.mdc +1 -0
  159. package/dist/content/rules/hatch3r-dotnet-patterns.md +104 -0
  160. package/dist/content/rules/hatch3r-dotnet-patterns.mdc +99 -0
  161. package/dist/content/rules/hatch3r-edge-case-discipline.md +65 -0
  162. package/dist/content/rules/hatch3r-edge-case-discipline.mdc +65 -0
  163. package/dist/content/rules/hatch3r-enhancability.md +147 -0
  164. package/dist/content/rules/hatch3r-enhancability.mdc +142 -0
  165. package/{rules → dist/content/rules}/hatch3r-event-schema-evolution.md +3 -1
  166. package/{rules → dist/content/rules}/hatch3r-event-schema-evolution.mdc +1 -0
  167. package/dist/content/rules/hatch3r-fan-out-discipline.md +91 -0
  168. package/dist/content/rules/hatch3r-fan-out-discipline.mdc +91 -0
  169. package/{rules → dist/content/rules}/hatch3r-feature-flags.md +2 -0
  170. package/{rules → dist/content/rules}/hatch3r-feature-flags.mdc +2 -0
  171. package/dist/content/rules/hatch3r-flutter-patterns.md +88 -0
  172. package/dist/content/rules/hatch3r-flutter-patterns.mdc +83 -0
  173. package/{rules → dist/content/rules}/hatch3r-git-conventions.md +5 -2
  174. package/{rules → dist/content/rules}/hatch3r-git-conventions.mdc +2 -0
  175. package/dist/content/rules/hatch3r-go-patterns.md +98 -0
  176. package/dist/content/rules/hatch3r-go-patterns.mdc +93 -0
  177. package/{rules → dist/content/rules}/hatch3r-handoff-readiness.md +14 -4
  178. package/{rules → dist/content/rules}/hatch3r-handoff-readiness.mdc +13 -3
  179. package/{rules → dist/content/rules}/hatch3r-i18n.md +3 -1
  180. package/{rules → dist/content/rules}/hatch3r-i18n.mdc +2 -0
  181. package/dist/content/rules/hatch3r-iteration-summary.md +108 -0
  182. package/dist/content/rules/hatch3r-iteration-summary.mdc +108 -0
  183. package/dist/content/rules/hatch3r-learning-system.md +202 -0
  184. package/dist/content/rules/hatch3r-learning-system.mdc +202 -0
  185. package/dist/content/rules/hatch3r-maintainability.md +157 -0
  186. package/dist/content/rules/hatch3r-maintainability.mdc +152 -0
  187. package/{rules → dist/content/rules}/hatch3r-migrations.md +4 -2
  188. package/{rules → dist/content/rules}/hatch3r-migrations.mdc +1 -0
  189. package/{rules → dist/content/rules}/hatch3r-observability-logging.md +2 -1
  190. package/{rules → dist/content/rules}/hatch3r-observability-logging.mdc +1 -0
  191. package/{rules → dist/content/rules}/hatch3r-observability-metrics.md +2 -1
  192. package/{rules → dist/content/rules}/hatch3r-observability-metrics.mdc +1 -0
  193. package/{rules → dist/content/rules}/hatch3r-observability-tracing.md +46 -36
  194. package/{rules → dist/content/rules}/hatch3r-observability-tracing.mdc +45 -35
  195. package/{rules → dist/content/rules}/hatch3r-operability.md +3 -1
  196. package/{rules → dist/content/rules}/hatch3r-operability.mdc +1 -0
  197. package/{rules → dist/content/rules}/hatch3r-passkey-server.md +4 -2
  198. package/{rules → dist/content/rules}/hatch3r-passkey-server.mdc +1 -0
  199. package/{rules → dist/content/rules}/hatch3r-performance-budgets.md +3 -1
  200. package/{rules → dist/content/rules}/hatch3r-performance-budgets.mdc +3 -1
  201. package/dist/content/rules/hatch3r-php-laravel-patterns.md +109 -0
  202. package/dist/content/rules/hatch3r-php-laravel-patterns.mdc +104 -0
  203. package/{rules → dist/content/rules}/hatch3r-progressive-delivery.md +5 -1
  204. package/{rules → dist/content/rules}/hatch3r-progressive-delivery.mdc +3 -0
  205. package/dist/content/rules/hatch3r-proof-model.md +131 -0
  206. package/dist/content/rules/hatch3r-proof-model.mdc +131 -0
  207. package/dist/content/rules/hatch3r-python-patterns.md +70 -0
  208. package/dist/content/rules/hatch3r-python-patterns.mdc +65 -0
  209. package/dist/content/rules/hatch3r-react-native-patterns.md +83 -0
  210. package/dist/content/rules/hatch3r-react-native-patterns.mdc +78 -0
  211. package/{rules → dist/content/rules}/hatch3r-resilience-patterns.md +3 -1
  212. package/{rules → dist/content/rules}/hatch3r-resilience-patterns.mdc +1 -0
  213. package/dist/content/rules/hatch3r-reviewer-calibration.md +84 -0
  214. package/dist/content/rules/hatch3r-reviewer-calibration.mdc +84 -0
  215. package/dist/content/rules/hatch3r-right-sizing.md +68 -0
  216. package/dist/content/rules/hatch3r-right-sizing.mdc +66 -0
  217. package/dist/content/rules/hatch3r-ruby-rails-patterns.md +111 -0
  218. package/dist/content/rules/hatch3r-ruby-rails-patterns.mdc +106 -0
  219. package/dist/content/rules/hatch3r-rust-patterns.md +107 -0
  220. package/dist/content/rules/hatch3r-rust-patterns.mdc +102 -0
  221. package/dist/content/rules/hatch3r-scalability.md +137 -0
  222. package/dist/content/rules/hatch3r-scalability.mdc +132 -0
  223. package/{rules → dist/content/rules}/hatch3r-secrets-management.md +12 -2
  224. package/{rules → dist/content/rules}/hatch3r-secrets-management.mdc +9 -0
  225. package/{rules → dist/content/rules}/hatch3r-security-patterns.md +38 -35
  226. package/{rules → dist/content/rules}/hatch3r-security-patterns.mdc +36 -34
  227. package/dist/content/rules/hatch3r-security.md +97 -0
  228. package/dist/content/rules/hatch3r-security.mdc +92 -0
  229. package/dist/content/rules/hatch3r-swiftui-patterns.md +98 -0
  230. package/dist/content/rules/hatch3r-swiftui-patterns.mdc +93 -0
  231. package/dist/content/rules/hatch3r-testability.md +115 -0
  232. package/dist/content/rules/hatch3r-testability.mdc +110 -0
  233. package/{rules → dist/content/rules}/hatch3r-testing.md +6 -2
  234. package/{rules → dist/content/rules}/hatch3r-testing.mdc +3 -0
  235. package/{rules → dist/content/rules}/hatch3r-theming.md +3 -1
  236. package/{rules → dist/content/rules}/hatch3r-theming.mdc +2 -0
  237. package/dist/content/rules/hatch3r-tool-currency.md +91 -0
  238. package/dist/content/rules/hatch3r-tool-currency.mdc +86 -0
  239. package/{rules → dist/content/rules}/hatch3r-tooling-hierarchy.md +30 -32
  240. package/{rules → dist/content/rules}/hatch3r-tooling-hierarchy.mdc +28 -31
  241. package/dist/content/rules/hatch3r-typescript-patterns.md +58 -0
  242. package/dist/content/rules/hatch3r-typescript-patterns.mdc +53 -0
  243. package/{rules → dist/content/rules}/hatch3r-ux-states-and-flows.md +13 -5
  244. package/{rules → dist/content/rules}/hatch3r-ux-states-and-flows.mdc +10 -3
  245. package/{skills → dist/content/skills}/hatch3r-a11y-audit/SKILL.md +11 -9
  246. package/{skills → dist/content/skills}/hatch3r-a11y-audit/references/manual-audit-checklist.md +7 -5
  247. package/dist/content/skills/hatch3r-adhoc-orchestrate/SKILL.md +131 -0
  248. package/{skills → dist/content/skills}/hatch3r-ai-feature/SKILL.md +4 -6
  249. package/{skills → dist/content/skills}/hatch3r-api-spec/SKILL.md +27 -2
  250. package/{skills → dist/content/skills}/hatch3r-architecture-review/SKILL.md +5 -8
  251. package/{commands/hatch3r-board-groom.md → dist/content/skills/hatch3r-board-groom/SKILL.md} +16 -18
  252. package/{commands/hatch3r-board-init.md → dist/content/skills/hatch3r-board-init/SKILL.md} +34 -31
  253. package/{commands/hatch3r-board-refresh.md → dist/content/skills/hatch3r-board-refresh/SKILL.md} +17 -19
  254. package/{commands/hatch3r-board-shared.md → dist/content/skills/hatch3r-board-shared/SKILL.md} +45 -15
  255. package/dist/content/skills/hatch3r-browser-verify/SKILL.md +307 -0
  256. package/{skills → dist/content/skills}/hatch3r-bug-fix/SKILL.md +16 -3
  257. package/{skills → dist/content/skills}/hatch3r-ci-pipeline/SKILL.md +17 -7
  258. package/{skills → dist/content/skills}/hatch3r-cli-fd/SKILL.md +34 -2
  259. package/{skills → dist/content/skills}/hatch3r-cli-fzf/SKILL.md +34 -2
  260. package/dist/content/skills/hatch3r-cli-gh/SKILL.md +139 -0
  261. package/{skills → dist/content/skills}/hatch3r-cli-jq/SKILL.md +43 -9
  262. package/{skills → dist/content/skills}/hatch3r-cli-ripgrep/SKILL.md +36 -4
  263. package/dist/content/skills/hatch3r-cli-toolbox/SKILL.md +376 -0
  264. package/dist/content/skills/hatch3r-containerize/SKILL.md +157 -0
  265. package/{skills → dist/content/skills}/hatch3r-context-health/SKILL.md +27 -9
  266. package/dist/content/skills/hatch3r-cost-tracking/SKILL.md +164 -0
  267. package/{skills → dist/content/skills}/hatch3r-customize/SKILL.md +9 -13
  268. package/{skills → dist/content/skills}/hatch3r-dep-audit/SKILL.md +29 -9
  269. package/{skills → dist/content/skills}/hatch3r-design-system-detect/SKILL.md +4 -8
  270. package/dist/content/skills/hatch3r-docs-writing/SKILL.md +159 -0
  271. package/dist/content/skills/hatch3r-enhancability-verify/SKILL.md +152 -0
  272. package/{skills → dist/content/skills}/hatch3r-feature/SKILL.md +54 -4
  273. package/dist/content/skills/hatch3r-feedback/SKILL.md +103 -0
  274. package/{skills → dist/content/skills}/hatch3r-gh-agentic-workflows/SKILL.md +14 -12
  275. package/{skills → dist/content/skills}/hatch3r-gh-agentic-workflows/references/azure-devops.md +2 -2
  276. package/{skills → dist/content/skills}/hatch3r-gh-agentic-workflows/references/gitlab-ci.md +1 -1
  277. package/{skills → dist/content/skills}/hatch3r-handoff-prepare/SKILL.md +12 -15
  278. package/{skills → dist/content/skills}/hatch3r-handoff-resume/SKILL.md +5 -8
  279. package/{commands/hatch3r-hooks.md → dist/content/skills/hatch3r-hooks/SKILL.md} +59 -148
  280. package/dist/content/skills/hatch3r-incident-response/SKILL.md +174 -0
  281. package/{skills → dist/content/skills}/hatch3r-issue-workflow/SKILL.md +15 -4
  282. package/dist/content/skills/hatch3r-learn/SKILL.md +317 -0
  283. package/{skills → dist/content/skills}/hatch3r-logical-refactor/SKILL.md +6 -7
  284. package/dist/content/skills/hatch3r-maintainability-verify/SKILL.md +146 -0
  285. package/{skills → dist/content/skills}/hatch3r-migration/SKILL.md +9 -8
  286. package/{skills → dist/content/skills}/hatch3r-observability-verify/SKILL.md +17 -13
  287. package/{skills → dist/content/skills}/hatch3r-perf-audit/SKILL.md +14 -10
  288. package/{skills → dist/content/skills}/hatch3r-pr-creation/SKILL.md +8 -11
  289. package/{skills → dist/content/skills}/hatch3r-qa-validation/SKILL.md +8 -7
  290. package/dist/content/skills/hatch3r-recipe/SKILL.md +174 -0
  291. package/{skills → dist/content/skills}/hatch3r-refactor/SKILL.md +7 -8
  292. package/dist/content/skills/hatch3r-release/SKILL.md +265 -0
  293. package/{skills → dist/content/skills}/hatch3r-reliability-verify/SKILL.md +9 -5
  294. package/{commands/hatch3r-report.md → dist/content/skills/hatch3r-report/SKILL.md} +21 -18
  295. package/dist/content/skills/hatch3r-scalability-verify/SKILL.md +145 -0
  296. package/dist/content/skills/hatch3r-security-verify/SKILL.md +144 -0
  297. package/dist/content/skills/hatch3r-team-convention-author/SKILL.md +126 -0
  298. package/dist/content/skills/hatch3r-testability-verify/SKILL.md +147 -0
  299. package/{skills → dist/content/skills}/hatch3r-ui-ux-verify/SKILL.md +20 -12
  300. package/{skills → dist/content/skills}/hatch3r-visual-refactor/SKILL.md +12 -8
  301. package/package.json +53 -46
  302. package/agents/hatch3r-a11y-auditor.md +0 -159
  303. package/agents/hatch3r-dependency-auditor.md +0 -219
  304. package/agents/hatch3r-implementer.md +0 -278
  305. package/agents/hatch3r-learnings-loader.md +0 -343
  306. package/agents/hatch3r-perf-profiler.md +0 -166
  307. package/agents/hatch3r-reviewer.md +0 -314
  308. package/agents/hatch3r-security-auditor.md +0 -180
  309. package/agents/hatch3r-test-writer.md +0 -171
  310. package/agents/shared/user-question-protocol.md +0 -95
  311. package/commands/hatch3r-agent-customize.md +0 -201
  312. package/commands/hatch3r-command-customize.md +0 -113
  313. package/commands/hatch3r-context-health.md +0 -147
  314. package/commands/hatch3r-cost-tracking.md +0 -163
  315. package/commands/hatch3r-dep-audit.md +0 -188
  316. package/commands/hatch3r-handoff.md +0 -133
  317. package/commands/hatch3r-learn.md +0 -312
  318. package/commands/hatch3r-recipe.md +0 -194
  319. package/commands/hatch3r-release.md +0 -350
  320. package/commands/hatch3r-rule-customize.md +0 -133
  321. package/commands/hatch3r-skill-customize.md +0 -112
  322. package/commands/hatch3r-workflow.md +0 -504
  323. package/dist/cli/index.d.ts +0 -2
  324. package/dist/cli/index.js.map +0 -1
  325. package/github-agents/hatch3r-lint-agent.md +0 -46
  326. package/prompts/hatch3r-bug-triage.md +0 -158
  327. package/prompts/hatch3r-code-review.md +0 -134
  328. package/prompts/hatch3r-pr-description.md +0 -176
  329. package/rules/hatch3r-agent-orchestration-detail.md +0 -211
  330. package/rules/hatch3r-agent-orchestration-detail.mdc +0 -206
  331. package/rules/hatch3r-agent-orchestration.md +0 -376
  332. package/rules/hatch3r-agent-orchestration.mdc +0 -371
  333. package/rules/hatch3r-iteration-summary.md +0 -90
  334. package/rules/hatch3r-iteration-summary.mdc +0 -85
  335. package/rules/hatch3r-learning-consult.md +0 -42
  336. package/rules/hatch3r-learning-consult.mdc +0 -38
  337. package/rules/hatch3r-observability-tracing-detail.md +0 -20
  338. package/rules/hatch3r-observability-tracing-detail.mdc +0 -14
  339. package/rules/hatch3r-observability.md +0 -20
  340. package/rules/hatch3r-observability.mdc +0 -14
  341. package/skills/hatch3r-agent-customize/SKILL.md +0 -23
  342. package/skills/hatch3r-cli-aichat/SKILL.md +0 -84
  343. package/skills/hatch3r-cli-ast-grep/SKILL.md +0 -85
  344. package/skills/hatch3r-cli-az-devops/SKILL.md +0 -89
  345. package/skills/hatch3r-cli-bat/SKILL.md +0 -85
  346. package/skills/hatch3r-cli-comby/SKILL.md +0 -85
  347. package/skills/hatch3r-cli-csvkit/SKILL.md +0 -84
  348. package/skills/hatch3r-cli-delta/SKILL.md +0 -86
  349. package/skills/hatch3r-cli-difftastic/SKILL.md +0 -84
  350. package/skills/hatch3r-cli-docker/SKILL.md +0 -89
  351. package/skills/hatch3r-cli-duckdb/SKILL.md +0 -84
  352. package/skills/hatch3r-cli-gh/SKILL.md +0 -90
  353. package/skills/hatch3r-cli-glab/SKILL.md +0 -89
  354. package/skills/hatch3r-cli-lazygit/SKILL.md +0 -78
  355. package/skills/hatch3r-cli-llm/SKILL.md +0 -84
  356. package/skills/hatch3r-cli-miller/SKILL.md +0 -84
  357. package/skills/hatch3r-cli-mods/SKILL.md +0 -84
  358. package/skills/hatch3r-cli-overview/SKILL.md +0 -60
  359. package/skills/hatch3r-cli-playwright/SKILL.md +0 -89
  360. package/skills/hatch3r-cli-podman/SKILL.md +0 -84
  361. package/skills/hatch3r-cli-qsv/SKILL.md +0 -91
  362. package/skills/hatch3r-cli-rtk/SKILL.md +0 -91
  363. package/skills/hatch3r-cli-sd/SKILL.md +0 -85
  364. package/skills/hatch3r-cli-stagehand/SKILL.md +0 -111
  365. package/skills/hatch3r-cli-taplo/SKILL.md +0 -84
  366. package/skills/hatch3r-cli-yq/SKILL.md +0 -85
  367. package/skills/hatch3r-cli-zstd/SKILL.md +0 -85
  368. package/skills/hatch3r-command-customize/SKILL.md +0 -23
  369. package/skills/hatch3r-cost-tracking/SKILL.md +0 -92
  370. package/skills/hatch3r-incident-response/SKILL.md +0 -115
  371. package/skills/hatch3r-recipe/SKILL.md +0 -91
  372. package/skills/hatch3r-release/SKILL.md +0 -120
  373. package/skills/hatch3r-rule-customize/SKILL.md +0 -23
  374. package/skills/hatch3r-skill-customize/SKILL.md +0 -23
  375. /package/{agents → dist/content/agents}/modes/architecture.md +0 -0
  376. /package/{agents → dist/content/agents}/modes/boundary-analysis.md +0 -0
  377. /package/{agents → dist/content/agents}/modes/codebase-impact.md +0 -0
  378. /package/{agents → dist/content/agents}/modes/complexity-risk.md +0 -0
  379. /package/{agents → dist/content/agents}/modes/coverage-analysis.md +0 -0
  380. /package/{agents → dist/content/agents}/modes/current-state.md +0 -0
  381. /package/{agents → dist/content/agents}/modes/feature-design.md +0 -0
  382. /package/{agents → dist/content/agents}/modes/impact-analysis.md +0 -0
  383. /package/{agents → dist/content/agents}/modes/library-docs.md +0 -0
  384. /package/{agents → dist/content/agents}/modes/migration-path.md +0 -0
  385. /package/{agents → dist/content/agents}/modes/prior-art.md +0 -0
  386. /package/{agents → dist/content/agents}/modes/refactoring-strategy.md +0 -0
  387. /package/{agents → dist/content/agents}/modes/regression.md +0 -0
  388. /package/{agents → dist/content/agents}/modes/risk-assessment.md +0 -0
  389. /package/{agents → dist/content/agents}/modes/risk-prioritization.md +0 -0
  390. /package/{agents → dist/content/agents}/modes/root-cause.md +0 -0
  391. /package/{agents → dist/content/agents}/modes/similar-implementation.md +0 -0
  392. /package/{agents → dist/content/agents}/modes/symptom-trace.md +0 -0
  393. /package/{agents → dist/content/agents}/modes/test-pattern.md +0 -0
  394. /package/{commands → dist/content/commands}/board/shared-board-overview.md +0 -0
  395. /package/{commands → dist/content/commands}/revision/revision-board-integration.md +0 -0
  396. /package/{skills → dist/content/skills}/hatch3r-issue-workflow/references/delegation-patterns.md +0 -0
@@ -4,20 +4,22 @@ type: command
4
4
  orchestrator: true
5
5
  agentPipeline: [hatch3r-researcher, hatch3r-docs-writer]
6
6
  description: Sequence delivery phases over time into a dependency-ordered milestone plan with business and technical lenses, emitting a todo.md rollout schedule rather than design docs
7
- tags: [planning, greenfield]
7
+ tags: [planning, ctx:greenfield-only]
8
8
  quality_charter: agents/shared/quality-charter.md
9
9
  efficiency_patterns: agents/shared/efficiency-patterns.md
10
10
  cache_friendly: true
11
11
  parallel_tool_default: true
12
+ efficiency_tier: deep
12
13
  triage_tiers: [1, 2, 3]
14
+ supports_resume: true
13
15
  sub_agents_spawned:
14
16
  count: 2
15
- rationale: Two parallel hatch3r-researcher modes (business-priority + technical-readiness) in Step 3 to inform sequencing; one hatch3r-docs-writer in Step 6 assembles todo.md on their merged output (serialized on the research → assembly dependency edge).
17
+ rationale: Two parallel hatch3r-researcher modes (business-priority + technical-readiness) in Step 3 to inform sequencing; one hatch3r-docs-writer in Step 6 assembles todo.md on their merged output (serialized on the research → assembly dependency edge). 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
  # Roadmap — Generate Phased Roadmap from Specs & Vision
23
25
 
@@ -31,16 +33,26 @@ Generate a dependency-aware, priority-ordered roadmap with **two parallel dimens
31
33
  | 2. Document Generation | `hatch3r-docs-writer` (todo.md generation) | No | Yes |
32
34
  | 3. AGENTS.md | `hatch3r-docs-writer` (AGENTS.md generation/rework) | No | Yes |
33
35
 
36
+ **Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): every parallel fan-out above holds all three — read-only or disjoint writes, deterministic aggregation, no shared mutable state.
37
+
34
38
  ---
35
39
 
36
40
  ## Shared Context
37
41
 
38
- **Read the `hatch3r-board-shared` command at the start of the run.** It contains Board Configuration, GitHub Context, Project Reference, Projects v2 sync procedure, and tooling directives. Cache all values for the duration of this run.
42
+ **Read the `hatch3r-board-shared` skill at the start of the run.** It contains Board Configuration, GitHub Context, Project Reference, Projects v2 sync procedure, and tooling directives. Cache all values for the duration of this run.
39
43
 
40
44
  ## Token-Saving Directives
41
45
 
42
46
  Follow the **Token-Saving Directives** in `hatch3r-board-shared`.
43
47
 
48
+ ## Confidence Propagation Contract
49
+
50
+ 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.
51
+
52
+ > 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.
53
+
54
+ Downstream propagation: every business-priority and technical-readiness recommendation (market-timing, revenue-impact ordering, debt-velocity estimate) carries a high/medium/low confidence rating sourced from the researcher sub-agent — web-sourced market estimates are medium at best unless tied to a cited benchmark. The Step 4 roadmap presentation and Step 6 summary MUST preserve the signal. Dropping it between stages is a gate failure.
55
+
44
56
  ---
45
57
 
46
58
  ## Workflow
@@ -57,6 +69,29 @@ Classify the roadmap request before delegating:
57
69
 
58
70
  If Tier 1, run the reduced researcher set and skip Step 7 (AGENTS.md) unless requested. If Tier 2, run the standard pipeline below. If Tier 3, run the full pipeline with deep research, surface market-timing intelligence, and confirm phased plan with the user before file writes.
59
71
 
72
+ ### Step 0.5: Emit Pre-Execution Cost Preview
73
+
74
+ Before the first sub-agent dispatch (Step 3 parallel researchers), surface the cost preview so a deep-research roadmap 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 ~1 (technical-readiness only), Tier 2 ~2-3, Tier 3 up to 3 (+ AGENTS.md docs-writer)>
79
+ estimated_input_tokens_static_frame: <int>
80
+ estimated_web_research_queries: <int> # market + benchmark research; Tier 3 is web-heavy
81
+ triage_tier: light | standard | deep
82
+ estimated_duration_min: <int>
83
+ ```
84
+
85
+ The Step 1 business-discovery interview is user-driven and excluded from the duration estimate. Post-execution actuals + delta land in the Step 6 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
+ Auto-tiering can misclassify — a focused single-dimension roadmap scored as Deep, or an enterprise multi-quarter roadmap scored as Light. The user override is the recovery path mandated by hatch3r's universal `--effort` override contract ("User overridable via `--effort` flag"):
90
+
91
+ - `--effort=light|standard|deep` forces the named tier, bypassing the Step 0 auto-classification (which controls researcher count and web-research depth).
92
+ - 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.
93
+ - No override passed → the Step 0 auto-classification stands.
94
+
60
95
  ---
61
96
 
62
97
  ### Step 1: Load Project Context & Business Discovery
@@ -159,7 +194,7 @@ Gaps: {list any missing context}
159
194
  | **Impact** | critical path, quality of life, nice-to-have, revenue-blocking, scale-blocking |
160
195
  | **Dependencies** | What must come first? (both technical and business dependencies) |
161
196
 
162
- 7. Present a categorized summary table of all extracted work items, clearly separated into business-driven, technically-driven, and cross-cutting.
197
+ 7. Present a categorized summary table of all extracted work items, with separate sections for business-driven, technically-driven, and cross-cutting items.
163
198
 
164
199
  ---
165
200
 
@@ -326,7 +361,7 @@ Map technically-driven milestones across the timeline:
326
361
 
327
362
  | Milestone Type | Examples |
328
363
  |---------------|---------|
329
- | **Infrastructure readiness** | MVP infra, scaling infra, multi-region, enterprise-grade |
364
+ | **Infrastructure readiness** | MVP infra (solo tier), scaling infra (team/scaleup tier), multi-region, enterprise tier per CONSTITUTION §6 Decision 4 |
330
365
  | **Production hardening** | Monitoring, alerting, incident response, SLA readiness |
331
366
  | **Technical debt paydown** | Prioritized by business impact (velocity improvement) |
332
367
  | **Platform capabilities** | APIs, integrations, extensibility, developer experience |
@@ -388,7 +423,7 @@ Business-Critical Path: {biz milestone 1} → {biz milestone 2} → {launch}
388
423
 
389
424
  ### Step 5: Generate todo.md
390
425
 
391
- Write `todo.md` in the exact format that `hatch3r-board-fill` expects, with `[BIZ]`/`[TECH]`/`[BOTH]` tags.
426
+ Write `todo.md` in the canonical **Todo Grammar** defined in `hatch3r-board-shared` — the single source of truth that `hatch3r-board-fill` Step 1 parses. Emit `## P{N} — {Label}` priority headers and `- [ ] **[BIZ|TECH|BOTH] {title}**: {description}. Ref: {path}.` item lines exactly as the grammar specifies; the template below is the authoring example for this command.
392
427
 
393
428
  **Format specification:**
394
429
 
@@ -563,6 +598,53 @@ Which would you like to run next? (or none)"
563
598
 
564
599
  ---
565
600
 
601
+ ## Resumability (Decision 27/30)
602
+
603
+ roadmap is long-running — a Tier 3 brownfield discovery fans out parallel researcher sub-agents across Business-Priority and Technical-Readiness intelligence (Steps 2–3), then generates a dual-lens phased roadmap, todo.md, AGENTS.md, and a cross-command handoff (Steps 4–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 multi-mode researcher fan-out.
604
+
605
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.roadmap-workspace/`; step range the Step 0 → Step 8 progression; `wave` = researcher-batch index across business + technical lenses; snapshot/rollback paths `docs/roadmap/`, `todo.md`, and `AGENTS.md`; `meta` adds `roadmapSlug`. Write points: after Step 1 context + business discovery completes, after Step 2 categorization locks, after Step 3 researcher fan-out returns, after the Step 4 dual-lens roadmap synthesis is confirmed by ASK, and after each Step 5–7 file write (roadmap doc, todo.md, AGENTS.md) so already-generated artifacts survive a crash and are not regenerated on resume. Also after Step 8 cross-command handoff dispatch.
606
+
607
+ ---
608
+
609
+ ## Per-Turn Pipeline-State Header (Bypass Protection)
610
+
611
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for roadmap: `1` = vision intake + horizon scoping, `2` = researcher/spec sub-agent dispatch (themes, milestones, dependencies), `3` = roadmap synthesis + sequencing, `4` = roadmap write + iteration-summary. Tier 1 runs are exempt per the Tier 1 exemption.
612
+
613
+ ## End-of-Turn Delegation Attestation (Bypass Protection)
614
+
615
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: roadmap doc, milestone files, theme specs.
616
+
617
+ ## Iteration Summary (mandatory output)
618
+
619
+ 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).
620
+
621
+ The 9 sections:
622
+
623
+ 1. **Request** — verbatim restatement of the user's ask in one sentence.
624
+ 2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
625
+ 3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
626
+ 4. **Files Mutated** — list with diff summary (lines added / removed / files created).
627
+ 5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
628
+ 6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
629
+ 7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
630
+ 8. **Open Questions / Blockers** — explicit `None` if fully closed.
631
+ 9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
632
+
633
+ ### Cost Visibility (Decision 24)
634
+
635
+ > 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.
636
+
637
+ ## Cost estimate (Decision 24)
638
+
639
+ This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
640
+
641
+ - **Pre-execution `cost_estimate`** — emitted in Step 0.5 before the first researcher dispatch (Step 3).
642
+ - **Post-execution `cost_actuals` + `delta`** — appended to the Step 6 summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
643
+
644
+ Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 2` × tier heuristic in `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate): Tier 1 ≈ 1 (technical-readiness researcher only, condensed todo.md); Tier 2 ≈ 2-3 (both researchers + todo.md docs-writer); Tier 3 up to 3 (both researchers with deep web research + AGENTS.md docs-writer). This command is web-research-heavy at Tier 3 — `estimated_web_research_queries` typically dominates the cost delta. 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`.
645
+
646
+ ---
647
+
566
648
  ## Error Handling
567
649
 
568
650
  - **No specs or docs found:** Fall back to user-provided vision. Warn that the roadmap will be less detailed without structured specs. Offer to run `hatch3r-project-spec` or `hatch3r-codebase-map` first.
@@ -575,9 +657,9 @@ Which would you like to run next? (or none)"
575
657
  - **Stage assessment unclear:** Default to "early-revenue" if the user is unsure. This provides balanced prioritization without over- or under-engineering the roadmap.
576
658
  - **No business specs found:** If only technical specs exist (legacy layout), generate a technical-only roadmap and recommend running `hatch3r-project-spec` or `hatch3r-codebase-map` to create business specs.
577
659
 
578
- ## Adapter Breadth as Differentiation
660
+ ## Adapter Parity Within the Supported Set
579
661
 
580
- Hatch3r's breadth across 13+ adapters (Claude, Cursor, Windsurf, Cline, Copilot, Codex, Gemini, Amp, Aider, Goose, Kiro, OpenCode, Zed) is a core differentiation strategy. To maintain this moat, recommend periodic adapter parity audits as part of any roadmap that includes hatch3r-internal work. The audit should verify that no adapter has fallen behind in feature support (e.g., missing MCP, hooks, or skills support that other adapters already handle). Adapter parity gaps should be tracked as `[TECH]` items at P2 priority or higher.
662
+ hatch3r supports 3 adapters as of 1.9.0 (Cursor, Claude Code, Copilot). Adapter parity within that supported set is enforced by capability-matrix tests; no adapter-parity work should land in roadmaps unless those tests detect a regression. If a regression is detected, track the gap as a `[TECH]` item at P2 priority or higher.
581
663
 
582
664
  ## Guardrails
583
665
 
@@ -585,13 +667,13 @@ Hatch3r's breadth across 13+ adapters (Claude, Cursor, Windsurf, Cline, Copilot,
585
667
  - **When in doubt, ASK.** It is better to ask one question too many than to make one wrong assumption. Discovery questions are never wasted.
586
668
  - **Never write files without user review and confirmation.** All generated content is presented first.
587
669
  - **Never overwrite todo.md without explicit user confirmation.**
588
- - **todo.md format must be compatible with board-fill**markdown checklist with bold titles, priority headers matching `## P{N} — {Label}`, items tagged with `[BIZ]`/`[TECH]`/`[BOTH]`.
670
+ - **todo.md format must match the canonical Todo Grammar** in `hatch3r-board-shared`the single source of truth `hatch3r-board-fill` Step 1 parses (`## P{N} — {Label}` headers; `- [ ] **[BIZ|TECH|BOTH] {title}**: {description}` items).
589
671
  - **Keep items at the right granularity** — epic-level for complex features (XL effort), standalone for simple tasks (S/M effort).
590
672
  - **Always reference source documentation** (specs, ADRs) where items were derived from. Use `docs/specs/business/` or `docs/specs/technical/` paths matching the item's category.
591
673
  - **Do not duplicate work already tracked in GitHub issues.**
592
- - **Effort estimates are rough and clearly labeled as estimates.**
674
+ - **Effort estimates are rough; label each estimate explicitly with the `(estimate)` suffix.**
593
675
  - **Respect existing priority conventions in the project.**
594
- - **Stage-adaptive prioritization.** Never recommend enterprise-grade solutions for pre-revenue startups. Never recommend MVP shortcuts for scale/enterprise companies. Calibrate all prioritization to the company stage from Step 1d.
676
+ - **Stage-adaptive prioritization.** Never recommend enterprise-tier (per CONSTITUTION §6 Decision 4) solutions for solo-tier pre-revenue startups. Never recommend MVP shortcuts for scaleup-tier or enterprise-tier companies. Calibrate all prioritization to the company stage from Step 1d.
595
677
  - **Business milestones must map to technical enablers.** Every business milestone should have its technical prerequisites identified and scheduled ahead of it.
596
678
  - **Technical items must justify business impact.** Every technical item (refactor, debt paydown, infrastructure) should state what business outcome it enables or unblocks.
597
679
  - **Never overwrite `AGENTS.md`** without explicit user confirmation.
@@ -1,31 +1,84 @@
1
1
  ---
2
2
  id: hatch3r-security-audit
3
3
  type: command
4
- orchestrator: false
4
+ orchestrator: true
5
+ agentPipeline: [hatch3r-implementer, hatch3r-security]
5
6
  description: Open an OWASP ASI security epic reviewing auth boundaries, input validation, and supply-chain risks with one hardening sub-issue per module plus trust-boundary audit
6
- tags: [maintenance, security]
7
+ tags: [maintenance, floor:security]
7
8
  quality_charter: agents/shared/quality-charter.md
8
9
  efficiency_patterns: agents/shared/efficiency-patterns.md
9
10
  cache_friendly: true
10
11
  parallel_tool_default: true
12
+ efficiency_tier: deep
13
+ triage_tiers: [2, 3]
14
+ supports_resume: true
15
+ sub_agents_spawned:
16
+ count: 2
17
+ rationale: Module-taxonomy discovery and audit-sub-issue authoring delegate to `hatch3r-implementer`; the cross-cutting security axis fans out in parallel to `hatch3r-security` (CQ3 OWASP ASI01-10 coverage + supply-chain + dependency-CVE posture). Fan-out is disjoint across module and cross-cutting axes; serialization would violate P8 B2 task decomposition. Cost-dominance per CONSTITUTION §2 P8 — token cost never serializes independent work.
11
18
  ---
12
19
 
13
20
  ## §0 Detect Ambiguity (P8 B1)
14
21
 
15
- 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.
16
23
 
17
24
  ## Agent Pipeline
18
25
 
19
- This command creates audit issues and epics. It does not spawn implementation sub-agents.
26
+ This command discovers the module taxonomy via static analysis, then delegates security-audit sub-issue authoring and two cross-cutting security axes to parallel sub-agents via the Task tool. Pipeline:
20
27
 
21
28
  | Stage | Agent(s) | Parallel | Required |
22
29
  |-------|----------|----------|----------|
23
30
  | 1. Context & Pre-flight | Orchestrator (inline) | No | Yes |
24
- | 2. Issue Creation | Orchestrator (GitHub MCP) | No | Yes |
25
- | 3. Board Sync | Orchestrator (Projects v2 sync) | No | Yes |
31
+ | 2. Module Audit Authoring | `hatch3r-implementer` (one Task call per module sub-issue body) | Yes (across modules) | Yes |
32
+ | 3. Cross-Cutting Security Axis | `hatch3r-security` (sub-issue authoring covering OWASP ASI01-10 + supply-chain) | No | Yes |
33
+ | 4. Issue Creation | Orchestrator (GitHub MCP) | No | Yes |
34
+ | 5. Board Sync | Orchestrator (Projects v2 sync) | No | Yes |
35
+
36
+ **Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): every parallel fan-out above holds all three — read-only or disjoint writes, deterministic aggregation, no shared mutable state.
26
37
 
27
38
  All issue operations MUST follow the Projects v2 Enforcement rules defined in `hatch3r-board-shared`.
28
39
 
40
+ Sub-agent fan-out scales with module count per `rules/fan-out-discipline.md` (P8 B2). For each discovered module, a `hatch3r-implementer` Task call authors that module's security-audit sub-issue body in parallel; the cross-cutting audit (`hatch3r-security` for OWASP ASI01-10 + supply-chain) runs alongside the module batch.
41
+
42
+ ## Triage
43
+
44
+ Classify the security-audit request before fan-out:
45
+
46
+ - **Tier 2 (standard)**: single repository with discovered module count <=8; parallel module sub-agents bounded by `max_phase4_parallel`.
47
+ - **Tier 3 (deep)**: monorepo with module count >8 OR cross-module trust-boundary depth >=3; same fan-out shape, longer review loop.
48
+
49
+ Tier is derived from Module Discovery output (Step 2). Tier 1 is not supported — single-target security fixes belong to `hatch3r-quick-change` with a `hatch3r-security` Phase 4 gate.
50
+
51
+ ### Pre-Execution Cost Preview
52
+
53
+ Before the first sub-agent dispatch (Step 4 module audit-authoring fan-out), surface the cost preview so a wide module fan-out is never started blind. Emit the `cost_estimate` block per `rules/hatch3r-cost-visibility.md` Pre-Execution Estimate, calibrated to the Tier derived from module count:
54
+
55
+ ```yaml
56
+ cost_estimate:
57
+ expected_sa_count: <module count + 2 cross-cutting axes; Tier 2 ~module-count<=8, Tier 3 module-count>8, bounded by max_phase4_parallel per batch>
58
+ estimated_input_tokens_static_frame: <int>
59
+ estimated_web_research_queries: <int>
60
+ triage_tier: standard | deep
61
+ estimated_duration_min: <int>
62
+ ```
63
+
64
+ Post-execution actuals + delta land in the Step 6 finalization summary's Fan-out + Cost section per `rules/hatch3r-cost-visibility.md` Post-Execution Actuals. Token telemetry sources from `src/pipeline/observability.ts`.
65
+
66
+ ### Effort Override (Decision 17)
67
+
68
+ Auto-tiering derives from discovered module count, which can misclassify — a monorepo with many small modules over-scored, or a dense single-package repo under-scored. The user override is the recovery path mandated by hatch3r's universal `--effort` override contract ("User overridable via `--effort` flag"):
69
+
70
+ - `--effort=standard|deep` forces the named tier, bypassing the module-count auto-classification. `--effort=light` is rejected — Tier 1 is unsupported here (single-target security fixes route to `hatch3r-quick-change`).
71
+ - 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.
72
+ - No override passed → the module-count auto-classification stands.
73
+
74
+ ## Confidence Propagation Contract
75
+
76
+ 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.
77
+
78
+ > 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.
79
+
80
+ Downstream propagation: every authored module-audit sub-issue body and each cross-cutting axis finding MUST carry a high/medium/low confidence rating sourced from the authoring sub-agent. Severity classifications (critical/high/medium/low) are distinct from and additional to this confidence signal. Dropping the confidence signal between stages is a gate failure.
81
+
29
82
  # Security Audit — Full Product Security Audit
30
83
 
31
84
  Create a security audit epic on **{owner}/{repo}** with one sub-issue per logical project module, plus cross-module trust boundary and OWASP alignment audits. Each sub-issue is a deep static-analysis security audit task that, when picked up by the board workflow, produces a findings epic with actionable sub-issues for hardening application security. The command only creates the initial audit epic — it does NOT execute any audits.
@@ -34,7 +87,7 @@ Create a security audit epic on **{owner}/{repo}** with one sub-issue per logica
34
87
 
35
88
  ## Shared Context
36
89
 
37
- **Read the project's shared board context at the start of the run** (e.g., `.agents/commands/hatch3r-board-shared.md` or equivalent). It contains GitHub Context, Project Reference, Projects v2 sync procedure, and Board Overview template. Cache all values for the duration of this run.
90
+ **Read the project's shared board context at the start of the run** (e.g., `commands/hatch3r-board-shared/SKILL.md` or equivalent). It contains GitHub Context, Project Reference, Projects v2 sync procedure, and Board Overview template. Cache all values for the duration of this run.
38
91
 
39
92
  ## Token-Saving Directives
40
93
 
@@ -373,6 +426,53 @@ All issue and epic operations in this command MUST follow the Projects v2 Enforc
373
426
 
374
427
  ---
375
428
 
429
+ ## Resumability (Decision 27/30)
430
+
431
+ security-audit is long-running — a Tier 2/3 audit fans out across N module sub-issues plus cross-cutting OWASP ASI controls, creates a security epic + sub-issues on the board, and synchronizes Projects v2 state. Per hatch3r's workspace-checkpointed resumability contract, checkpoint progress so an interrupted run re-enters at the last completed step rather than re-creating already-created issues or re-running the module scan.
432
+
433
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.security-audit-workspace/`; step range the Step 0 → Step 7 progression; `wave` = per-module sub-issue batch index for Step 4; snapshot/rollback paths board-touching state. Write points: after Step 2 module enumeration locks, after Step 3 epic creation returns the epic issue number, after each Step 4 module sub-issue is created (one write per sub-issue so a mid-batch crash preserves prior issue numbers), after each Step 5 cross-cutting sub-issue is created, after Step 6 dependency linking, and after Step 7 Projects v2 sync.
434
+
435
+ ---
436
+
437
+ ## Per-Turn Pipeline-State Header (Bypass Protection)
438
+
439
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping for security-audit: `1` = scope + threat-model intake, `2` = hatch3r-security sub-agent dispatch across security domains (auth / webauthn / supply-chain / OWASP ASI / CVE), `3` = severity-graded aggregation + finding-registry update, `4` = findings-epic write + iteration-summary. Tier 1 runs are exempt per the Tier 1 exemption.
440
+
441
+ ## End-of-Turn Delegation Attestation (Bypass Protection)
442
+
443
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: findings epic, child issues, registry updates, security advisories.
444
+
445
+ ## Iteration Summary (mandatory output)
446
+
447
+ 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).
448
+
449
+ The 9 sections:
450
+
451
+ 1. **Request** — verbatim restatement of the user's ask in one sentence.
452
+ 2. **Fan-out + Cost** — `sub_agents_spawned: { count, rationale }` plus the `cost_estimate` / `cost_actuals` / `delta` blocks (see Cost Visibility below).
453
+ 3. **Web Research** — every URL fetched with access date + trust tier per `agents/shared/rigor-contract.md` (0 acceptable when no research was needed).
454
+ 4. **Files Mutated** — list with diff summary (lines added / removed / files created).
455
+ 5. **Gates Passed / Failed** — explicit list per `.claude/rules/capability-lifecycle.md` Gate Checklist.
456
+ 6. **Pillar Impact Attribution** — `progress_toward_pillar: <axis>.<pillar_id>+<delta>` per CONSTITUTION §6 Decision 17.
457
+ 7. **Verification Commands** — exact commands run with exit codes plus key output lines (≤200 chars).
458
+ 8. **Open Questions / Blockers** — explicit `None` if fully closed.
459
+ 9. **Learnings Captured** — IDs of any learnings written to `.hatch3r/learnings/` this run per `rules/hatch3r-learning-system.md`.
460
+
461
+ ### Cost Visibility (Decision 24)
462
+
463
+ > 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.
464
+
465
+ ## Cost estimate (Decision 24)
466
+
467
+ This command emits cost transparency per `rules/hatch3r-cost-visibility.md` and CONSTITUTION §6 Decision 24/29:
468
+
469
+ - **Pre-execution `cost_estimate`** — emitted in the Pre-Execution Cost Preview above before the first module audit-authoring dispatch (Step 4).
470
+ - **Post-execution `cost_actuals` + `delta`** — appended to the Step 6 finalization summary's Fan-out + Cost section per `rules/hatch3r-iteration-summary.md` §2.
471
+
472
+ Per-tier `expected_sa_count` calibration (from frontmatter `sub_agents_spawned.count: 2`, which is the static floor; actual fan-out scales with discovered module count per `rules/fan-out-discipline.md` P8 B2): one `hatch3r-implementer` Task per module sub-issue body + `hatch3r-security` for the cross-cutting axis (OWASP ASI01-10 + supply-chain). Tier 2 (module count ≤8) and Tier 3 (module count >8) both bound the parallel module batch by `max_phase4_parallel`. 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`.
473
+
474
+ ---
475
+
376
476
  ## Error Handling
377
477
 
378
478
  - `search_issues` failure: retry once, then warn and proceed (assume no existing security audit).
@@ -0,0 +1,246 @@
1
+ ---
2
+ id: hatch3r-slo-scaffold
3
+ type: command
4
+ orchestrator: true
5
+ agentPipeline: [hatch3r-implementer, hatch3r-reliability]
6
+ description: "Generate baseline SLI/SLO scaffolding for a user-facing service — availability + latency p95/p99 objectives, 28-day error budget, and Google-SRE multi-window multi-burn-rate alert rules in OpenSLO openslo/v1. Implementer writes the files; hatch3r-reliability gates them against the CQ4 floor."
7
+ argument-hint: "[service-name]"
8
+ tags: [devops, reliability, floor:content-quality]
9
+ quality_charter: agents/shared/quality-charter.md
10
+ efficiency_patterns: agents/shared/efficiency-patterns.md
11
+ cache_friendly: true
12
+ parallel_tool_default: true
13
+ efficiency_tier: standard
14
+ triage_tiers: [1, 2, 3]
15
+ sub_agents_spawned:
16
+ count: 2
17
+ rationale: One hatch3r-implementer writes the SLI/SLO/alert scaffold files (code mutation flows through the implementer per the Mandatory Delegation Directive); one hatch3r-reliability gates the result against the CQ4 floor (SLO completeness, multi-burn-rate alert correctness). N services fan out to N parallel implementers; the implement -> gate edge is the only serialization. Cost-dominance per CONSTITUTION §2 P8.
18
+ ---
19
+
20
+ ## §0 Detect Ambiguity (P8 B1)
21
+
22
+ Before any action, scan the request for unresolved questions in service scope, SLI source, and objective targets. If the request names two or more services, or omits the availability/latency targets, or does not name the metric source (Prometheus, OTel-derived, or platform-native), ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md` — the burn-rate alert math depends on the target and window, so a guessed target produces an alert rule that fires wrong. Proceed without asking ONLY when one service, one metric source, and explicit availability + latency targets are all given. Source: `.claude/rules/clarification-default.md`.
23
+
24
+ ## Agent Pipeline
25
+
26
+ | Stage | Agent(s) | Parallel | Required |
27
+ |-------|----------|----------|----------|
28
+ | 1. Parse service spec + targets | Orchestrator (inline) | No | Yes |
29
+ | 2. Confirm targets + ASK gate | Orchestrator (inline) | No | Yes |
30
+ | 3. Generate scaffold | `hatch3r-implementer` | Per service | Yes |
31
+ | 4. Gate against CQ4 floor | `hatch3r-reliability` | Per service | Yes |
32
+ | 5. Verify + Iteration Summary | Orchestrator (inline) | No | Yes |
33
+
34
+ **Parallel-safety conditions** (per `rules/hatch3r-agent-orchestration.md` §Parallel Safety): when the spec covers two or more services, fan out one `hatch3r-implementer` per service — each writes a disjoint SLO file set, aggregation is deterministic (union of generated paths), no shared mutable state. The `hatch3r-reliability` gate runs once per generated service after its implementer returns.
35
+
36
+ ---
37
+
38
+ # SLO Scaffold -- Baseline SLI/SLO + Burn-Rate Alerts for a Service
39
+
40
+ Generates a versioned baseline reliability scaffold for one or more user-facing services: an availability SLI/SLO, a latency p95 and p99 SLI/SLO, a 28-day rolling error budget, and the Google-SRE multi-window multi-burn-rate alert rules that consume them. Output is OpenSLO `openslo/v1` (vendor-neutral, Git-reviewable) plus the matching Prometheus alert-rule expressions.
41
+
42
+ Use `/hatch3r-slo-scaffold` when a service has no SLO definition and you want the CQ4 baseline (one of the CONSTITUTION §2B reliability floors: "User-facing service SLO defined: 100%"). Use the `hatch3r-reliability-verify` skill to re-verify an existing SLO config without regenerating it; use `/hatch3r-benchmark` for performance measurement rather than SLO authoring.
43
+
44
+ ---
45
+
46
+ ## Argument Parsing
47
+
48
+ Optional positional argument: `<service-name>`.
49
+
50
+ - If supplied: seed Step 1 with that service.
51
+ - If omitted: ASK for the service name(s), metric source, and targets before delegating — generating an SLO without a target is meaningless.
52
+
53
+ ---
54
+
55
+ ## Step 0: Triage
56
+
57
+ Classify the scaffold before delegating, using the Light / Standard / Deep vocabulary in `agents/shared/triage-vocabulary.md` (the `triage_tiers: [1, 2, 3]` array maps `1 = Light`, `2 = Standard`, `3 = Deep`). The chosen tier sets the Step 2 `Tier {1|2|3}` label and the Step 0.5 cost preview.
58
+
59
+ - **Tier 1 (Light)** — one user-facing service with explicit availability + p95 + p99 targets and one named metric source (e.g. Prometheus). Fan-out: one `hatch3r-implementer` + one `hatch3r-reliability` gate.
60
+ - **Tier 2 (Standard)** — one service with a non-obvious SLI definition (a composite or multi-route service) where the good-event query must be derived rather than read off the RED defaults. Fan-out: one `hatch3r-implementer` at standard depth + one `hatch3r-reliability` gate.
61
+ - **Tier 3 (Deep)** — two or more services, OR a mixed metric-source fleet (some Prometheus, some OTel-derived). Fan-out: one `hatch3r-implementer` per service in parallel + one `hatch3r-reliability` gate per generated service.
62
+
63
+ A missing availability/latency target or an unnamed metric source fires the §0 B1 gate (`agents/shared/user-question-protocol.md`) before tiering — the burn-rate math derives from the target + window, so a guessed target produces an alert rule that fires wrong. Classify upward on uncertainty (a signal that could read as Tier 2 or Tier 3 takes Tier 3, per the highest-tier rule in `agents/shared/triage-vocabulary.md`).
64
+
65
+ ---
66
+
67
+ ## Step 1: Parse Service Spec + Targets
68
+
69
+ Collect the inputs that determine the objective values and the alert-rule constants. Cache them for the Step 3 implementer prompt.
70
+
71
+ | Input | Default if unspecified | Notes |
72
+ |-------|------------------------|-------|
73
+ | Service name | (required — ASK) | becomes OpenSLO `spec.service` |
74
+ | Availability target | (required — ASK) | e.g. `99.9` → `target: 0.999`; drives the budget |
75
+ | Latency p95 target | (required — ASK) | e.g. p95 ≤ 300 ms |
76
+ | Latency p99 target | (required — ASK) | e.g. p99 ≤ 800 ms |
77
+ | Metric source | Prometheus | OpenSLO `metricSource.type`: Prometheus, OpenTelemetry-derived, or platform-native |
78
+ | SLI definition | ratioMetric (good/total) | RED-derived: good = non-5xx requests, total = all requests |
79
+ | Time window | 28d rolling | OpenSLO `timeWindow.duration: 28d`, `isRolling: true` |
80
+ | Output directory | `slo/` | one `<service>.slo.yaml` per service |
81
+
82
+ The availability target sets the error budget: budget = (1 − target) × window. The burn-rate alert thresholds are derived from the budget per the Google SRE Workbook recipe (Step 3) — they are NOT free parameters.
83
+
84
+ ---
85
+
86
+ ## Step 2: Confirm Targets + ASK Checkpoint (only mutation gate)
87
+
88
+ Present the resolved spec and the derived budget so the maintainer confirms before files are written.
89
+
90
+ ```
91
+ hatch3r-slo-scaffold — service: {name} (Tier {1|2|3})
92
+
93
+ Resolved spec:
94
+ availability target: 99.9% → 28-day error budget: 0.1% (≈ 40m19s downtime / 28d)
95
+ latency p95: ≤ 300 ms
96
+ latency p99: ≤ 800 ms
97
+ metric source: Prometheus (ratioMetric good/total)
98
+ window: 28d rolling
99
+ output: slo/{name}.slo.yaml + slo/{name}.alerts.yaml
100
+
101
+ Burn-rate alert tiers (Google SRE Workbook ch. 5):
102
+ page — 2% budget / 1h → 14.4x burn (1h long + 5m short windows both breach)
103
+ page — 5% budget / 6h → 6x burn (6h long + 30m short)
104
+ ticket — 10% budget / 3d → 1x burn (3d long + 6h short)
105
+
106
+ Tier: 1
107
+ ```
108
+
109
+ ASK (only gate), per `agents/shared/user-question-protocol.md`:
110
+
111
+ > Generate the SLO scaffold for {name} with the targets above?
112
+ > - `accept` — generate the scaffold and run the CQ4 gate
113
+ > - `edit` — change a target, window, or metric source first
114
+ > - `skip` — cancel; write nothing
115
+ >
116
+ > (accept / edit / skip)
117
+
118
+ After the user accepts, the run is autonomous through Step 5.
119
+
120
+ ### Step 0.5: Emit Pre-Execution Cost Preview
121
+
122
+ Before the Step 2 ASK gate, emit the cost preview per `rules/hatch3r-cost-visibility.md`:
123
+
124
+ ```yaml
125
+ cost_estimate:
126
+ expected_sa_count: <N services × 1 implementer + N × 1 reliability gate>
127
+ estimated_input_tokens_static_frame: <int>
128
+ estimated_web_research_queries: <int> # 0 — the burn-rate recipe is fixed by the references below
129
+ triage_tier: light | standard | deep
130
+ estimated_duration_min: <int>
131
+ ```
132
+
133
+ Post-execution actuals + delta land in the Step 5 Iteration Summary's Fan-out + Cost section. `--effort=light|standard|deep` (Decision 17) forces the tier; record both auto and override.
134
+
135
+ ---
136
+
137
+ ## Step 3: Generate Scaffold (sub-agent delegation)
138
+
139
+ Delegate to `hatch3r-implementer` via the Task tool, one per service. Code mutation flows through the implementer per the Mandatory Delegation Directive — the orchestrator does not write files inline.
140
+
141
+ Each implementer prompt MUST include the resolved spec, the target file paths, and this scaffold contract:
142
+
143
+ **SLI/SLO (`slo/<service>.slo.yaml`, OpenSLO `openslo/v1`):**
144
+
145
+ 1. One `kind: SLO` per objective: availability, latency-p95, latency-p99. Each carries `spec.service`, `spec.timeWindow` (`duration: 28d`, `isRolling: true`), `spec.budgetingMethod: Occurrences`, and `spec.objectives[].target`.
146
+ 2. Availability SLI is a `ratioMetric` (`good`/`total` counters: good = non-5xx responses, total = all responses) per the RED method. Latency SLIs are `ratioMetric` where good = requests faster than the threshold (e.g. `histogram_quantile`-backed good-event count) — never an averaged latency, because an average hides the tail the p95/p99 objective targets.
147
+ 3. `metricSource.type` set from Step 1; the metric query left as a `# TODO: project metric name` placeholder so the implementer does not invent a metric that does not exist (a low-confidence guess flagged in Notes per the implementer's confidence contract).
148
+
149
+ **Alert rules (`slo/<service>.alerts.yaml`, Prometheus):** the Google SRE Workbook multi-window multi-burn-rate recipe — three tiers, each requiring BOTH a long-window and a short-window burn-rate breach so a transient spike does not page:
150
+
151
+ | Tier | Budget consumed | Long window | Short window | Burn rate | Severity |
152
+ |------|-----------------|-------------|--------------|-----------|----------|
153
+ | Fast | 2% / 1h | 1h | 5m | 14.4× | page |
154
+ | Mid | 5% / 6h | 6h | 30m | 6× | page |
155
+ | Slow | 10% / 3d | 3d | 6h | 1× | ticket |
156
+
157
+ The burn-rate constants (14.4×, 6×, 1×) are fixed by the recipe for a 28-day window — they are not tunable per service; the per-service input is only the SLO target that scales the budget. Every alert rule annotation carries a `runbook_url` placeholder (a rule without a runbook is a CQ4 finding per `agents/hatch3r-reliability.md` Boundaries).
158
+
159
+ Also include in the prompt: all `scope: always` rule directives; the confidence expression requirement (verbatim, high/medium/low per `agents/shared/quality-charter.md` §1); and the explicit boundary "do NOT create branches, commits, or PRs". Await the implementer's structured result; capture `Files changed` and the `Delegation proof ID` per file.
160
+
161
+ ---
162
+
163
+ ## Step 4: Gate Against CQ4 Floor (sub-agent delegation)
164
+
165
+ After each service's implementer returns, delegate to `hatch3r-reliability` via the Task tool to gate the generated scaffold against the CQ4 reliability floor — the SLO-definition-review invocation in that agent's "When to invoke".
166
+
167
+ The reliability prompt MUST include the generated file paths and require these checklist items (from `agents/hatch3r-reliability.md` Audit checklist):
168
+
169
+ 1. **SLO completeness** — availability + latency p95 + latency p99 all declared in the versioned file (checklist item 2).
170
+ 2. **Multi-burn-rate alert correctness** — exactly 3 tiers, each with a long + short window pair, constants 14.4×/6×/1× for the 28-day window per Google SRE Workbook ch. 5 (checklist item 2); naked single-threshold alerts are rejected.
171
+ 3. **Latency SLI is a histogram-backed ratio, not an average** (checklist item 3).
172
+ 4. **Every alert carries a `runbook_url` annotation** (Boundaries: "Never deploy an alert rule without a runbook URL").
173
+
174
+ The reliability gate validates syntax where tooling is available (`promtool check rules` on the alert file, `sloth validate`/OpenSLO validation on the SLO file) and returns its `proof_trace` + verdict. If the gate returns Critical or High findings, surface them and route the fix back through `hatch3r-implementer` (max 1 regeneration pass), then re-gate. A persistent High finding ends the run at `PARTIAL`.
175
+
176
+ ---
177
+
178
+ ## Step 5: Verify + Iteration Summary
179
+
180
+ Run the available validation commands and record exit codes: `promtool check rules slo/<service>.alerts.yaml`, and OpenSLO/`sloth validate` on the SLO file when the tool is present (note "tool absent" otherwise — do not claim a pass you did not run).
181
+
182
+ ### End-of-Turn Delegation Attestation (Bypass Protection)
183
+
184
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → End-of-Turn Delegation Attestation. Per-command mutated-file slot: `slo/<service>.slo.yaml`, `slo/<service>.alerts.yaml` — both `via hatch3r-implementer`.
185
+
186
+ ### Iteration Summary (mandatory output)
187
+
188
+ Emit the canonical iteration summary per `rules/hatch3r-iteration-summary.md`:
189
+
190
+ ```markdown
191
+ ## Iteration Summary
192
+
193
+ **Status:** SUCCESS | PARTIAL | FAILED | BLOCKED
194
+ **Outcome:** {one sentence — e.g., "Scaffolded availability + p95 + p99 SLOs and 3-tier burn-rate alerts for checkout-service; reliability gate PASS."}
195
+
196
+ **Done:**
197
+ - slo/{service}.slo.yaml → 3 SLOs (availability, p95, p99) via hatch3r-implementer (proof: {id})
198
+ - slo/{service}.alerts.yaml → 3-tier multi-burn-rate alerts via hatch3r-implementer (proof: {id})
199
+
200
+ **Not Done / Deferred / Unverified:**
201
+ - Metric-name placeholders (`# TODO`) — fill with the project's real metric names before deploy
202
+ - (or: `None — full scope completed`)
203
+
204
+ **Open Questions / Blockers:**
205
+ - (or: `None`)
206
+
207
+ **Fan-out + Cost:** sub_agents_spawned: { count, rationale } + cost_estimate / cost_actuals / delta
208
+ **Pillar Impact Attribution:** progress_toward_pillar: content-quality.CQ4+{delta}
209
+ **Confidence:** {high | medium | low} — {basis from implementer output + reliability gate verdict}
210
+ **Suggested Next Action:** {one line — e.g., "Replace metric-name TODOs, then wire slo/*.alerts.yaml into the Prometheus rule_files."}
211
+ ```
212
+
213
+ Status decision rules:
214
+ - **SUCCESS** — scaffold generated, reliability gate PASS, validation commands (where tooling exists) exit 0.
215
+ - **PARTIAL** — generated but the reliability gate left a residual High finding, or validation tooling reported a syntax issue not yet resolved.
216
+ - **FAILED** — the implementer returned BLOCKED on every service; nothing written.
217
+ - **BLOCKED** — targets contradictory or a metric source the maintainer must decide on.
218
+
219
+ ---
220
+
221
+ ## Per-Turn Pipeline-State Header (Bypass Protection)
222
+
223
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Per-Turn Pipeline-State Header. Phase mapping: `1` = spec parse + confirm, `2` = implementer scaffold generation, `3` = reliability gate + verify + summary. Tier 1 single-service runs are exempt per the Tier 1 exemption.
224
+
225
+ ---
226
+
227
+ ## Guardrails
228
+
229
+ 1. **One ASK gate.** Step 2 is the only user-facing checkpoint; after `accept`, the run proceeds through Step 5.
230
+ 2. **No commit or push.** Generated files are left staged for human review; git operations are out of scope.
231
+ 3. **Burn-rate constants are fixed by the recipe.** Do not invent per-service burn rates — the 28-day-window 14.4×/6×/1× tiers come from the Google SRE Workbook; only the SLO target (which scales the budget) is a per-service input.
232
+ 4. **No averaged latency SLIs.** Latency objectives are histogram-backed ratios (good = under-threshold request count); an average hides the tail the p95/p99 objective exists to bound.
233
+ 5. **Runbook URL required on every alert.** A scaffold whose alert rules lack a `runbook_url` annotation fails the Step 4 CQ4 gate.
234
+
235
+ ## Resumability (Decision 27/30)
236
+
237
+ slo-scaffold fans out one implementer per service, so checkpoint at the per-service boundary — an interrupted multi-service run re-enters at the first un-scaffolded service rather than regenerating the SLO/alert file sets it already wrote.
238
+
239
+ > Orchestration boilerplate: see `commands/shared/orchestration-frame.md` → Checkpoint Contract. Per-command slots: workspace `.slo-scaffold-workspace/`; step range the Step 1 → Step 5 progression; `wave` = the per-service index in Step 3/4; snapshot/rollback paths every `slo/<service>.slo.yaml` / `slo/<service>.alerts.yaml` a Step 3 implementer touches. Write points: after the Step 1 spec parse, after the Step 2 accept gate, after each Step 3 implementer return (per service), and after each Step 4 reliability gate.
240
+
241
+ ## References
242
+
243
+ - [Google SRE — "Alerting on SLOs" (Site Reliability Workbook ch. 5)](https://sre.google/workbook/alerting-on-slos/) (accessed 2026-06-02, Google SRE, official-docs) — the multi-window multi-burn-rate recipe: 2%/1h @ 14.4×, 5%/6h @ 6×, 10%/3d @ 1× for a 30-day budget, each tier requiring a long + short window breach; source for the Step 3 alert table and the "no naked single-threshold alert" guardrail.
244
+ - [OpenSLO — specification README (`openslo/v1`)](https://github.com/OpenSLO/OpenSLO/blob/main/README.md) (accessed 2026-06-02, OpenSLO project, established-library) — the `apiVersion: openslo/v1`, `kind: SLO`, `spec.service`, `timeWindow` (`duration` + `isRolling`), `budgetingMethod`, `objectives[].target`, and `ratioMetric` (good/total) vs `thresholdMetric` field shapes used by the Step 3 SLI/SLO scaffold contract.
245
+ - [Grafana Labs — "How to implement multi-window, multi-burn-rate alerts"](https://grafana.com/blog/how-to-implement-multi-window-multi-burn-rate-alerts-with-grafana-cloud/) (accessed 2026-06-02, Grafana Labs, vendor-note) — cross-vendor confirmation of the Google SRE long+short window pairing and burn-rate constants applied to Prometheus-style rules; corroborates the second source per Decision 14's ≥2-independent-source requirement.
246
+ - `agents/hatch3r-reliability.md` -> Audit checklist items 2-3, Boundaries (accessed 2026-06-02, in-repo canonical, official-docs) — the CQ4 floor the Step 4 gate enforces.