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
@@ -0,0 +1,131 @@
1
+ ---
2
+ id: hatch3r-proof-model
3
+ type: rule
4
+ description: Mandatory citation per factual claim + pre-execution verification gates + proof_trace block schema. Hallucination prevention via verifiable proof, not citation alone.
5
+ tags: [proof, verification, citation, floor:content-quality]
6
+ precedence: high
7
+ alwaysApply: true
8
+ ---
9
+ # hatch3r Proof Model
10
+
11
+ **Pillars:** P2 (Scientific Quality), P5 (Governance Self-Quality)
12
+
13
+ This rule operationalises Decision #19 (CONSTITUTION §6): hallucination prevention via verifiable proof, not citation alone. It defines WHEN proof is required, WHAT schema each proof emits, and WHICH gates a hatch3r-driven agent must pass before issuing a factual assertion.
14
+
15
+ ## When Proof Trace Is Required
16
+
17
+ Emit a `proof_trace:` block under any state-dependent claim:
18
+ - File existence or absence
19
+ - File content matching a pattern (specific bytes, frontmatter field, exported symbol)
20
+ - grep match presence/count (zero matches is itself a state-dependent claim)
21
+ - Type-check pass/fail (`npx tsc --noEmit` exit code)
22
+ - Test exit code + output (`npm test` per-suite pass/fail counts)
23
+ - Command exit code + output (any shell invocation whose result the agent is about to cite)
24
+ - Web fetch success + content matching (URL resolves AND target string present)
25
+
26
+ State-independent claims (definitional, axiomatic, design-rationale) do NOT require proof_trace — citing the file:line where the definition lives is sufficient.
27
+
28
+ ## Proof Trace Schema
29
+
30
+ ```yaml
31
+ proof_trace:
32
+ claim: <one-sentence assertion>
33
+ command: <bash invocation OR Read tool call OR grep pattern>
34
+ expected: <pattern OR quoted output>
35
+ actual: <verbatim ≤200 chars from command output>
36
+ verdict: matched | mismatched
37
+ accessed: YYYY-MM-DD
38
+ ```
39
+
40
+ Field rules:
41
+ - `claim` — one sentence; what the proof verifies. Never a multi-clause assertion.
42
+ - `command` — runnable verbatim by a reviewer. No paraphrase.
43
+ - `expected` — either a regex/pattern OR the verbatim string the command should emit.
44
+ - `actual` — verbatim slice of the command output, truncated to 200 characters with `…` suffix if longer.
45
+ - `verdict` — `matched` when actual satisfies expected; `mismatched` otherwise. A `mismatched` verdict still belongs in the proof trace — it documents that verification was attempted.
46
+ - `accessed` — ISO-8601 date when the command was run.
47
+
48
+ ## Pre-Execution Verification Gates
49
+
50
+ Before issuing any agent-generated assertion that affects a downstream decision, the agent passes these gates in order:
51
+
52
+ 1. **State-dependent claim?** If yes, prepare a `proof_trace` block — do not emit the claim without it.
53
+ 2. **External dependency claim** (library version, API behavior, platform feature)? Verify against current documentation per `agents/shared/quality-charter.md` §15 Currency Verification (≤180 days). Cite URL + access date + trust tier per `agents/shared/rigor-contract.md` §Web Research Mandate.
54
+ 3. **Cross-file claim** (file X imports file Y, function A calls function B)? Run grep + cite file:line. Do not infer from filename or directory.
55
+ 4. **Behavioral claim** (function does X under condition Y)? Either point to a test that exercises Y → X, or write one before asserting.
56
+ 5. **Negative claim** (X does NOT exist, Y does NOT happen)? Run the search command and emit the zero-match output in `actual:`. Absence is harder to prove than presence — make the search command explicit.
57
+
58
+ A claim that fails its gate is either dropped, or downgraded to confidence `low` per `agents/shared/quality-charter.md` §1 with the gap explicitly named.
59
+
60
+ ## Citation Alone Is Insufficient
61
+
62
+ Per CONSTITUTION §6 Decision #19: "Citation alone insufficient — verification commands close the loop." Documents become stale; commands return current state. A citation without a verification command is a Medium-minimum finding under D24 self-audit.
63
+
64
+ Concrete failure modes citation-alone leaves open:
65
+ - File path moved or renamed since the cited revision
66
+ - Section heading rewritten such that the citation refers to absent content
67
+ - Behavior changed in a way the prose has not yet caught up to
68
+ - Reviewer reading the citation does not have the cited file open
69
+
70
+ A proof_trace defeats all four — the command runs against current state at review time.
71
+
72
+ ## Acceptable Failure Modes
73
+
74
+ - **Verification impossible at write time** (e.g., production database state from local dev) — explicitly state the verification gap + lower confidence to medium per quality-charter §1.
75
+ - **Verification cost prohibitive** (e.g., 30-minute integration suite for a docs typo) — log a `verification_skipped: <reason>` field; flag for downstream check. The skip must be documented, not silent.
76
+ - **Source 404 / withdrawn** — re-research before relying; do not cite a dead URL per rigor-contract.md §Web Research Mandate. Re-running the fetch with a `accessed:` date earlier than the 404 does not rescue the citation.
77
+ - **Verification command itself unreliable** (flaky test, intermittent network) — note the unreliability + run the command N≥3 times + cite the majority outcome.
78
+
79
+ ## Examples
80
+
81
+ State-dependent claim WITH proof_trace:
82
+
83
+ ```yaml
84
+ proof_trace:
85
+ claim: rigor-contract.md defines a Proof Trace Contract section
86
+ command: grep -n "Proof Trace Contract" agents/shared/rigor-contract.md
87
+ expected: line-numbered match referencing "Proof Trace Contract"
88
+ actual: "84:## Proof Trace Contract (Decision 9 — added 2026-05-26)"
89
+ verdict: matched
90
+ accessed: 2026-05-26
91
+ ```
92
+
93
+ Negative claim WITH proof_trace:
94
+
95
+ ```yaml
96
+ proof_trace:
97
+ claim: no occurrences of "TODO" remain in src/content/contentRoot.ts
98
+ command: grep -c "TODO" src/content/contentRoot.ts
99
+ expected: "0"
100
+ actual: "0"
101
+ verdict: matched
102
+ accessed: 2026-05-26
103
+ ```
104
+
105
+ External dependency claim WITH proof_trace:
106
+
107
+ ```yaml
108
+ proof_trace:
109
+ claim: Commander.js 12.x supports async action handlers
110
+ command: WebFetch https://github.com/tj/commander.js/blob/master/Readme.md#action-handler
111
+ expected: section "Action handler" describes async support
112
+ actual: "Action handler functions can also be async. Use parseAsync()…"
113
+ verdict: matched
114
+ accessed: 2026-05-26
115
+ ```
116
+
117
+ ## Enforcement
118
+
119
+ The audit prompt's Behavioral Charter directive 20 (added 2.0.0) and `agents/shared/rigor-contract.md` §Proof Trace Contract (added 2026-05-26) operationalise this rule at audit time. Findings missing proof_trace on state-dependent claims are dropped at SA output time per the charter's directive 20 + rigor-contract §Schema Enforcement.
120
+
121
+ Reviewer-class artifacts (`agents/hatch3r-reviewer.md`, future Reviewer Pass 1.5 per rigor-contract §Proof Trace Contract) read proof_trace blocks to verify implementation against documented runtime state. Implementer-class artifacts (`agents/hatch3r-implementer.md`) emit proof_trace blocks before declaring task completion.
122
+
123
+ ## Pillar Service
124
+ - P2 — every factual claim becomes verifiable; placeholder findings are detectable and retryable.
125
+ - P5 — governance system applies proof to itself; the rule that mandates proof is itself bound by proof at audit time.
126
+
127
+ ## Cross-References
128
+ - Decision #19 — proof-trace + mandatory citation as 2.0.0 hallucination-prevention floor
129
+ - `agents/shared/rigor-contract.md` §Proof Trace Contract — schema canonical location + Shallow Finding Detector linkage
130
+ - The audit prompt's Behavioral Charter directive 20 — audit-time enforcement at SA output time
131
+ - `agents/shared/quality-charter.md` §15 Currency Verification — external-dependency claim freshness window (≤180 days)
@@ -0,0 +1,70 @@
1
+ ---
2
+ id: hatch3r-python-patterns
3
+ type: rule
4
+ description: Python 3.12+ conventions covering uv project management, Ruff lint+format, mypy strict typing, pytest parametrize, and the FastAPI/Django request-path + ORM N+1 floor
5
+ scope: conditional
6
+ globs: "**/*.py,**/pyproject.toml,**/requirements.txt,**/manage.py,**/setup.cfg,**/tox.ini,**/Pipfile,**/conftest.py"
7
+ tags: [implementation, lang:python]
8
+ quality_charter: agents/shared/quality-charter.md
9
+ cache_friendly: true
10
+ ---
11
+ # Python Patterns
12
+
13
+ **Pillars:** P2 (Scientific & Practical Quality), CQ8 (Maintainability Quality)
14
+
15
+ > Applies when the project ships Python. Detection signals: `pyproject.toml`, `setup.py`, `requirements.txt`, `Pipfile`, `setup.cfg`, or `tox.ini` at repo root, or `manage.py` for Django.
16
+
17
+ ## Python Language Floor
18
+
19
+ - Target Python 3.12+. Declare `requires-python = ">=3.12"` in `pyproject.toml`. Drop Python 2 idioms (`from __future__`, `six`, `u""` prefixes) entirely.
20
+ - Centralize all tool config in `pyproject.toml` — single source of truth for build, Ruff, mypy, and pytest. Do not split config across `setup.cfg` + `.flake8` + `.isort.cfg`.
21
+ - Use `uv` for dependency + environment management. Commit `uv.lock`. Run every tool through `uv run <tool>` so the resolved environment is deterministic across machines; never activate a virtualenv manually in CI.
22
+ - Treat lint, format-check, type, and test as four separate gates: `uv run ruff check`, `uv run ruff format --check`, `uv run mypy src/`, `uv run pytest`. Any non-zero exit blocks merge.
23
+
24
+ ## Linting & Formatting (Ruff)
25
+
26
+ - Use Ruff for both linting and formatting — it replaces flake8 + isort + black + pyupgrade in one tool with drop-in Black formatting parity.
27
+ - Enable at minimum these rule families in `[tool.ruff.lint]` `select`: `E`/`F` (pyflakes + pycodestyle), `I` (import sort), `B` (bugbear), `UP` (pyupgrade), `SIM` (flake8-simplify), `RUF` (Ruff-native). Add `ASYNC` for async codebases.
28
+ - Run `ruff format` (not standalone black). Set `line-length = 100` (or the team standard) once in `[tool.ruff]` so the linter and formatter agree.
29
+ - Wire `astral-sh/ruff-pre-commit` so lint + format run before every commit; CI re-runs the same checks as the authoritative gate.
30
+
31
+ ## Typing (mypy)
32
+
33
+ - Enable `strict = true` in `[tool.mypy]` from day one — adding strict typing to a typed-from-the-start codebase is cheaper than retrofitting it later.
34
+ - Type every public function signature: parameters and return. Prefer `X | None` over `Optional[X]` (3.10+ union syntax). Use `collections.abc` protocols (`Sequence`, `Mapping`, `Iterable`) for parameters, concrete types for returns.
35
+ - Exclude the test directory from strict mode only when test fixtures fight the type checker — keep `src/` strict. Never blanket-suppress with `# type: ignore` without a specific error code (`# type: ignore[arg-type]`).
36
+ - For data shapes, prefer `@dataclass(slots=True)` or Pydantic v2 `BaseModel` over untyped dicts. Pydantic v2 validates at the boundary; dataclasses are zero-overhead internal records.
37
+
38
+ ## Testing (pytest)
39
+
40
+ - pytest is the floor — do not use `unittest.TestCase` for new suites. Test files `test_*.py`, functions `test_*`.
41
+ - Use `@pytest.mark.parametrize` for input-table tests instead of loops — each case reports independently, mirroring Go table-driven subtests.
42
+ - Fixtures over `setUp`/`tearDown`: scope fixtures (`function`/`module`/`session`) deliberately. Put shared fixtures in `conftest.py`.
43
+ - Coverage floor: `pytest --cov=src --cov-fail-under=80`. Critical paths (auth, billing, migrations) at 90%. Use `pytest-randomly` to surface inter-test state leakage.
44
+ - Mark slow/integration tests (`@pytest.mark.slow`) and gate them behind `-m "not slow"` in the fast pre-commit loop; run the full set in CI.
45
+
46
+ ## Async & Web (FastAPI / Django)
47
+
48
+ - In an async request path use async all the way down: `httpx` over `requests`, `asyncio.sleep` over `time.sleep`, an async ORM/driver (`asyncpg`, SQLAlchemy `AsyncSession`, or SQLModel) over a blocking one. A single blocking call stalls the event loop for every concurrent request.
49
+ - FastAPI runs plain `def` handlers in a threadpool automatically — only mark a handler `async def` when it actually awaits async I/O. Do not put blocking DB calls inside an `async def` without an async driver.
50
+ - Prevent N+1 queries: Django `select_related()` (FK / one-to-one) and `prefetch_related()` (reverse FK / M2M); SQLAlchemy `selectinload()` / `joinedload()`. Accessing a related attribute inside a loop over N rows silently issues N+1 queries.
51
+ - Validate every request body and response with Pydantic v2 models (FastAPI) or DRF serializers (Django) — never trust raw request dicts. Keep request/response schemas distinct from ORM models.
52
+ - Django: run `manage.py check --deploy` in CI; never ship with `DEBUG = True`; load secrets from the environment, not `settings.py`.
53
+
54
+ ## Dependency Hygiene
55
+
56
+ - Pin direct dependencies in `pyproject.toml` and lock the full graph in `uv.lock`. Reproducible installs (`uv sync --frozen`) in CI.
57
+ - Vulnerability scanning: `pip-audit` (or `uv`'s audit) in CI against the locked graph. Block merge on known CVE matches.
58
+ - Keep runtime and dev dependencies separate (`[project.dependencies]` vs `[dependency-groups]` / `[project.optional-dependencies]`). Production images install runtime-only.
59
+
60
+ ## References
61
+
62
+ - Ruff documentation: https://docs.astral.sh/ruff/ (accessed 2026-06-05, official-docs)
63
+ - Modern Python tooling (uv + Ruff + mypy), 2026: https://softaims.com/blog/modern-python-tooling-uv-ruff-mypy-2026 (accessed 2026-06-05, established-practitioner)
64
+ - FastAPI async patterns + ORM N+1, 2025: https://shiladityamajumder.medium.com/async-apis-with-fastapi-patterns-pitfalls-best-practices-2d72b2b66f25 (accessed 2026-06-05, established-practitioner)
65
+
66
+ ## Cross-References
67
+
68
+ - `rules/hatch3r-api-design.md` — REST/GraphQL/gRPC contract floors apply to FastAPI / Django services.
69
+ - `rules/hatch3r-testing.md` — coverage thresholds carry over to `pytest --cov`.
70
+ - `rules/hatch3r-observability-logging.md` — structured-logging contract applies to Python `logging` / `structlog`.
@@ -0,0 +1,65 @@
1
+ ---
2
+ description: Python 3.12+ conventions covering uv project management, Ruff lint+format, mypy strict typing, pytest parametrize, and the FastAPI/Django request-path + ORM N+1 floor
3
+ globs: ["**/*.py", "**/pyproject.toml", "**/requirements.txt", "**/manage.py", "**/setup.cfg", "**/tox.ini", "**/Pipfile", "**/conftest.py"]
4
+ alwaysApply: false
5
+ ---
6
+ # Python Patterns
7
+
8
+ **Pillars:** P2 (Scientific & Practical Quality), CQ8 (Maintainability Quality)
9
+
10
+ > Applies when the project ships Python. Detection signals: `pyproject.toml`, `setup.py`, `requirements.txt`, `Pipfile`, `setup.cfg`, or `tox.ini` at repo root, or `manage.py` for Django.
11
+
12
+ ## Python Language Floor
13
+
14
+ - Target Python 3.12+. Declare `requires-python = ">=3.12"` in `pyproject.toml`. Drop Python 2 idioms (`from __future__`, `six`, `u""` prefixes) entirely.
15
+ - Centralize all tool config in `pyproject.toml` — single source of truth for build, Ruff, mypy, and pytest. Do not split config across `setup.cfg` + `.flake8` + `.isort.cfg`.
16
+ - Use `uv` for dependency + environment management. Commit `uv.lock`. Run every tool through `uv run <tool>` so the resolved environment is deterministic across machines; never activate a virtualenv manually in CI.
17
+ - Treat lint, format-check, type, and test as four separate gates: `uv run ruff check`, `uv run ruff format --check`, `uv run mypy src/`, `uv run pytest`. Any non-zero exit blocks merge.
18
+
19
+ ## Linting & Formatting (Ruff)
20
+
21
+ - Use Ruff for both linting and formatting — it replaces flake8 + isort + black + pyupgrade in one tool with drop-in Black formatting parity.
22
+ - Enable at minimum these rule families in `[tool.ruff.lint]` `select`: `E`/`F` (pyflakes + pycodestyle), `I` (import sort), `B` (bugbear), `UP` (pyupgrade), `SIM` (flake8-simplify), `RUF` (Ruff-native). Add `ASYNC` for async codebases.
23
+ - Run `ruff format` (not standalone black). Set `line-length = 100` (or the team standard) once in `[tool.ruff]` so the linter and formatter agree.
24
+ - Wire `astral-sh/ruff-pre-commit` so lint + format run before every commit; CI re-runs the same checks as the authoritative gate.
25
+
26
+ ## Typing (mypy)
27
+
28
+ - Enable `strict = true` in `[tool.mypy]` from day one — adding strict typing to a typed-from-the-start codebase is cheaper than retrofitting it later.
29
+ - Type every public function signature: parameters and return. Prefer `X | None` over `Optional[X]` (3.10+ union syntax). Use `collections.abc` protocols (`Sequence`, `Mapping`, `Iterable`) for parameters, concrete types for returns.
30
+ - Exclude the test directory from strict mode only when test fixtures fight the type checker — keep `src/` strict. Never blanket-suppress with `# type: ignore` without a specific error code (`# type: ignore[arg-type]`).
31
+ - For data shapes, prefer `@dataclass(slots=True)` or Pydantic v2 `BaseModel` over untyped dicts. Pydantic v2 validates at the boundary; dataclasses are zero-overhead internal records.
32
+
33
+ ## Testing (pytest)
34
+
35
+ - pytest is the floor — do not use `unittest.TestCase` for new suites. Test files `test_*.py`, functions `test_*`.
36
+ - Use `@pytest.mark.parametrize` for input-table tests instead of loops — each case reports independently, mirroring Go table-driven subtests.
37
+ - Fixtures over `setUp`/`tearDown`: scope fixtures (`function`/`module`/`session`) deliberately. Put shared fixtures in `conftest.py`.
38
+ - Coverage floor: `pytest --cov=src --cov-fail-under=80`. Critical paths (auth, billing, migrations) at 90%. Use `pytest-randomly` to surface inter-test state leakage.
39
+ - Mark slow/integration tests (`@pytest.mark.slow`) and gate them behind `-m "not slow"` in the fast pre-commit loop; run the full set in CI.
40
+
41
+ ## Async & Web (FastAPI / Django)
42
+
43
+ - In an async request path use async all the way down: `httpx` over `requests`, `asyncio.sleep` over `time.sleep`, an async ORM/driver (`asyncpg`, SQLAlchemy `AsyncSession`, or SQLModel) over a blocking one. A single blocking call stalls the event loop for every concurrent request.
44
+ - FastAPI runs plain `def` handlers in a threadpool automatically — only mark a handler `async def` when it actually awaits async I/O. Do not put blocking DB calls inside an `async def` without an async driver.
45
+ - Prevent N+1 queries: Django `select_related()` (FK / one-to-one) and `prefetch_related()` (reverse FK / M2M); SQLAlchemy `selectinload()` / `joinedload()`. Accessing a related attribute inside a loop over N rows silently issues N+1 queries.
46
+ - Validate every request body and response with Pydantic v2 models (FastAPI) or DRF serializers (Django) — never trust raw request dicts. Keep request/response schemas distinct from ORM models.
47
+ - Django: run `manage.py check --deploy` in CI; never ship with `DEBUG = True`; load secrets from the environment, not `settings.py`.
48
+
49
+ ## Dependency Hygiene
50
+
51
+ - Pin direct dependencies in `pyproject.toml` and lock the full graph in `uv.lock`. Reproducible installs (`uv sync --frozen`) in CI.
52
+ - Vulnerability scanning: `pip-audit` (or `uv`'s audit) in CI against the locked graph. Block merge on known CVE matches.
53
+ - Keep runtime and dev dependencies separate (`[project.dependencies]` vs `[dependency-groups]` / `[project.optional-dependencies]`). Production images install runtime-only.
54
+
55
+ ## References
56
+
57
+ - Ruff documentation: https://docs.astral.sh/ruff/ (accessed 2026-06-05, official-docs)
58
+ - Modern Python tooling (uv + Ruff + mypy), 2026: https://softaims.com/blog/modern-python-tooling-uv-ruff-mypy-2026 (accessed 2026-06-05, established-practitioner)
59
+ - FastAPI async patterns + ORM N+1, 2025: https://shiladityamajumder.medium.com/async-apis-with-fastapi-patterns-pitfalls-best-practices-2d72b2b66f25 (accessed 2026-06-05, established-practitioner)
60
+
61
+ ## Cross-References
62
+
63
+ - `rules/hatch3r-api-design.md` — REST/GraphQL/gRPC contract floors apply to FastAPI / Django services.
64
+ - `rules/hatch3r-testing.md` — coverage thresholds carry over to `pytest --cov`.
65
+ - `rules/hatch3r-observability-logging.md` — structured-logging contract applies to Python `logging` / `structlog`.
@@ -0,0 +1,83 @@
1
+ ---
2
+ id: hatch3r-react-native-patterns
3
+ type: rule
4
+ description: React Native conventions covering New Architecture (Fabric + TurboModules), Hermes, Expo Router/SDK, native module bridging, performance, and platform-specific UI
5
+ scope: conditional
6
+ globs: "**/App.tsx,**/App.jsx,**/index.js,**/metro.config.js,**/metro.config.ts,**/babel.config.js,**/app.json,**/app.config.ts,**/app.config.js,**/ios/**,**/android/**,**/expo-env.d.ts,**/.expo/**,**/*.native.tsx,**/*.native.jsx,**/*.native.ts"
7
+ tags: [implementation, lang:typescript]
8
+ quality_charter: agents/shared/quality-charter.md
9
+ cache_friendly: true
10
+ ---
11
+ # React Native Patterns
12
+
13
+ **Pillars:** P2 (Scientific & Practical Quality), CQ8 (Maintainability Quality)
14
+
15
+ > Applies when the project ships a React Native or Expo app. Detection signals: `react-native` in `package.json` dependencies, `app.json` / `app.config.{ts,js}`, `metro.config.js`, `ios/` + `android/` workspace folders, or `.expo/` directory.
16
+
17
+ ## New Architecture (Fabric + TurboModules)
18
+
19
+ - Target React Native 0.76+ with the New Architecture enabled (`newArchEnabled: true` in `app.json` for Expo, or `RCT_NEW_ARCH_ENABLED=1` for bare workflow). The New Architecture is on by default in 0.76 and is the only supported path for Expo SDK 52+.
20
+ - Use Fabric renderer (synchronous, type-safe) for new native components. Legacy Paper renderer is for backward compatibility only — do not write new components against it.
21
+ - Author native modules as TurboModules via `codegen` schemas. Stop adding `RCTBridgeModule`-style legacy modules — they bypass type-safety and force a full bridge serialization.
22
+ - Run `react-native codegen` in CI to regenerate JSI specs from the schema files. Spec drift between TS and native side is a merge blocker.
23
+ - Hermes is the default JS engine — keep it on. Avoid JSC unless a specific dependency requires it; document the reason in `README.md`.
24
+
25
+ ## Expo (Managed + Bare Workflow)
26
+
27
+ - Prefer the Expo Managed workflow for new apps under SDK 52+. Expo Router 4 (file-system routing in `app/`) is the routing default; do not introduce React Navigation directly when Expo Router already covers the route surface.
28
+ - Use EAS Build for production binaries (Apple App Store, Google Play). Local `expo run:ios` / `expo run:android` is for development only.
29
+ - Pin the Expo SDK in `app.json` (`expo.sdkVersion`) and lock the matching `expo` package version. SDK upgrades go through `npx expo install --fix` — never edit `package.json` versions manually for Expo packages.
30
+ - For OTA updates, use EAS Update (CodePush is sunset for RN). Channel and runtime version policy: pin `runtimeVersion` per binary release; never push a runtime-incompatible JS bundle.
31
+
32
+ ## Bridging & Native Modules
33
+
34
+ - New native modules: author TurboModule specs in TypeScript first (`*.spec.ts`), run codegen, then implement Swift/Kotlin handlers. Spec-first prevents type drift.
35
+ - Fabric native components: declare the spec via `codegenNativeComponent<Props>('ComponentName')`; never call the legacy `requireNativeComponent` for new code.
36
+ - Use the `react-native-nitro-modules` or `expo-modules-core` API when authoring shared native code — both target the New Architecture and avoid the legacy bridge.
37
+ - Cross-platform native APIs: prefer existing Expo modules (`expo-camera`, `expo-file-system`, `expo-secure-store`) over hand-rolled bridges. Do not duplicate community-maintained bindings.
38
+
39
+ ## Navigation
40
+
41
+ - File-system routing via Expo Router 4 (`app/_layout.tsx`, `app/(tabs)/index.tsx`, `app/[id].tsx`). Use typed routes (`expo-router/typed-routes`) for compile-time link safety.
42
+ - Deep links: define the URL scheme in `app.json` (`scheme`) and register the universal/app-link domain pair for both platforms. Test universal links on a real device — simulators do not honor associated-domains entitlements reliably.
43
+ - For non-Expo apps, use React Navigation 7 with `@react-navigation/native-stack` (native UIKit/Fragment stack). JS-based stack (`@react-navigation/stack`) is for prototypes only.
44
+
45
+ ## Performance
46
+
47
+ - Replace `FlatList` / `SectionList` with `@shopify/flash-list` for lists over 50 rows. FlashList recycles cells natively and outperforms FlatList by 5-10x on mid-range Android.
48
+ - Memoize render functions in lists: every `renderItem` is wrapped in `React.memo` with stable equality. Inline arrow functions in `renderItem` re-render the whole list.
49
+ - Use `InteractionManager.runAfterInteractions` to defer non-critical work until animations and gestures complete; never schedule heavy work on the JS thread during a transition.
50
+ - Image loading: use `expo-image` (managed) or `react-native-fast-image` (bare). The default `<Image>` lacks caching and progressive decode.
51
+ - Lazy-load screens with `React.lazy` + `Suspense` inside Expo Router layouts. Code-split heavy native screens behind navigation events.
52
+
53
+ ## Platform-Specific UI
54
+
55
+ - Branch on `Platform.OS === 'ios' | 'android' | 'web'` only when the platform mandates a different UX (haptic patterns, header back gesture, status bar contrast). Avoid platform branching for layout — use flex + responsive units.
56
+ - iOS: use `react-native-screens` with `enableScreens()` so the navigator renders native `UIViewController` stacks. Without this, all screens are JS Views.
57
+ - Android: target SDK 35 (Android 15) per Google Play 2025 requirement. Configure edge-to-edge content (`android:windowOptOutEdgeToEdgeEnforcement="false"`) and respect insets via `react-native-safe-area-context`.
58
+ - Accessibility: every touchable surface has `accessibilityRole`, `accessibilityLabel`, and `accessibilityHint`. Test with VoiceOver (iOS) and TalkBack (Android) before merge — simulator a11y is not equivalent.
59
+
60
+ ## State & Data
61
+
62
+ - Use TanStack Query (`@tanstack/react-query`) for server state. Avoid Redux unless the app has cross-screen optimistic UI requirements not served by Query mutations.
63
+ - Local persistent state: `@react-native-async-storage/async-storage` for non-secret values, `expo-secure-store` for tokens. Never store auth tokens in AsyncStorage on iOS (Keychain via SecureStore is the floor).
64
+ - Background sync: use Expo's `expo-task-manager` + `expo-background-fetch` (managed) or `react-native-background-fetch` (bare). Document the platform-specific minimum interval (iOS ~15 min minimum, Android ~15 min minimum on Doze).
65
+
66
+ ## Testing
67
+
68
+ - Unit + component tests with `jest-expo` (Expo) or `@testing-library/react-native` (bare). Run on the host Node runtime — no simulator boot for unit tests.
69
+ - Integration tests with Detox (gray-box) or Maestro (black-box). Detox is preferred for apps with native modules; Maestro for pure-JS flows.
70
+ - Snapshot tests for every screen at multiple viewport sizes (iPhone SE, iPhone 16 Pro Max, Pixel 8a) — guard against layout regressions on small devices.
71
+ - E2E on EAS: configure `eas-cli` matrix builds against real devices via BrowserStack App Live or Sauce Labs Real Device Cloud.
72
+
73
+ ## References
74
+
75
+ - React Native New Architecture overview: https://reactnative.dev/docs/the-new-architecture/landing-page (accessed 2026-05-27, official-docs)
76
+ - Expo SDK 52 release notes: https://expo.dev/changelog/2024-11-12-sdk-52 (accessed 2026-05-27, official-docs)
77
+ - Expo Router 4: https://docs.expo.dev/router/introduction/ (accessed 2026-05-27, official-docs)
78
+
79
+ ## Cross-References
80
+
81
+ - `rules/hatch3r-component-conventions.md` — shared four-state surface contract applies to RN screens.
82
+ - `rules/hatch3r-accessibility-standards.md` — WCAG mapping carries to React Native via `accessibilityRole` props.
83
+ - `rules/hatch3r-testing.md` — coverage thresholds and determinism rules apply to RN tests.
@@ -0,0 +1,78 @@
1
+ ---
2
+ description: React Native conventions covering New Architecture (Fabric + TurboModules), Hermes, Expo Router/SDK, native module bridging, performance, and platform-specific UI
3
+ globs: ["**/App.tsx", "**/App.jsx", "**/index.js", "**/metro.config.js", "**/metro.config.ts", "**/babel.config.js", "**/app.json", "**/app.config.ts", "**/app.config.js", "**/ios/**", "**/android/**", "**/expo-env.d.ts", "**/.expo/**", "**/*.native.tsx", "**/*.native.jsx", "**/*.native.ts"]
4
+ alwaysApply: false
5
+ ---
6
+ # React Native Patterns
7
+
8
+ **Pillars:** P2 (Scientific & Practical Quality), CQ8 (Maintainability Quality)
9
+
10
+ > Applies when the project ships a React Native or Expo app. Detection signals: `react-native` in `package.json` dependencies, `app.json` / `app.config.{ts,js}`, `metro.config.js`, `ios/` + `android/` workspace folders, or `.expo/` directory.
11
+
12
+ ## New Architecture (Fabric + TurboModules)
13
+
14
+ - Target React Native 0.76+ with the New Architecture enabled (`newArchEnabled: true` in `app.json` for Expo, or `RCT_NEW_ARCH_ENABLED=1` for bare workflow). The New Architecture is on by default in 0.76 and is the only supported path for Expo SDK 52+.
15
+ - Use Fabric renderer (synchronous, type-safe) for new native components. Legacy Paper renderer is for backward compatibility only — do not write new components against it.
16
+ - Author native modules as TurboModules via `codegen` schemas. Stop adding `RCTBridgeModule`-style legacy modules — they bypass type-safety and force a full bridge serialization.
17
+ - Run `react-native codegen` in CI to regenerate JSI specs from the schema files. Spec drift between TS and native side is a merge blocker.
18
+ - Hermes is the default JS engine — keep it on. Avoid JSC unless a specific dependency requires it; document the reason in `README.md`.
19
+
20
+ ## Expo (Managed + Bare Workflow)
21
+
22
+ - Prefer the Expo Managed workflow for new apps under SDK 52+. Expo Router 4 (file-system routing in `app/`) is the routing default; do not introduce React Navigation directly when Expo Router already covers the route surface.
23
+ - Use EAS Build for production binaries (Apple App Store, Google Play). Local `expo run:ios` / `expo run:android` is for development only.
24
+ - Pin the Expo SDK in `app.json` (`expo.sdkVersion`) and lock the matching `expo` package version. SDK upgrades go through `npx expo install --fix` — never edit `package.json` versions manually for Expo packages.
25
+ - For OTA updates, use EAS Update (CodePush is sunset for RN). Channel and runtime version policy: pin `runtimeVersion` per binary release; never push a runtime-incompatible JS bundle.
26
+
27
+ ## Bridging & Native Modules
28
+
29
+ - New native modules: author TurboModule specs in TypeScript first (`*.spec.ts`), run codegen, then implement Swift/Kotlin handlers. Spec-first prevents type drift.
30
+ - Fabric native components: declare the spec via `codegenNativeComponent<Props>('ComponentName')`; never call the legacy `requireNativeComponent` for new code.
31
+ - Use the `react-native-nitro-modules` or `expo-modules-core` API when authoring shared native code — both target the New Architecture and avoid the legacy bridge.
32
+ - Cross-platform native APIs: prefer existing Expo modules (`expo-camera`, `expo-file-system`, `expo-secure-store`) over hand-rolled bridges. Do not duplicate community-maintained bindings.
33
+
34
+ ## Navigation
35
+
36
+ - File-system routing via Expo Router 4 (`app/_layout.tsx`, `app/(tabs)/index.tsx`, `app/[id].tsx`). Use typed routes (`expo-router/typed-routes`) for compile-time link safety.
37
+ - Deep links: define the URL scheme in `app.json` (`scheme`) and register the universal/app-link domain pair for both platforms. Test universal links on a real device — simulators do not honor associated-domains entitlements reliably.
38
+ - For non-Expo apps, use React Navigation 7 with `@react-navigation/native-stack` (native UIKit/Fragment stack). JS-based stack (`@react-navigation/stack`) is for prototypes only.
39
+
40
+ ## Performance
41
+
42
+ - Replace `FlatList` / `SectionList` with `@shopify/flash-list` for lists over 50 rows. FlashList recycles cells natively and outperforms FlatList by 5-10x on mid-range Android.
43
+ - Memoize render functions in lists: every `renderItem` is wrapped in `React.memo` with stable equality. Inline arrow functions in `renderItem` re-render the whole list.
44
+ - Use `InteractionManager.runAfterInteractions` to defer non-critical work until animations and gestures complete; never schedule heavy work on the JS thread during a transition.
45
+ - Image loading: use `expo-image` (managed) or `react-native-fast-image` (bare). The default `<Image>` lacks caching and progressive decode.
46
+ - Lazy-load screens with `React.lazy` + `Suspense` inside Expo Router layouts. Code-split heavy native screens behind navigation events.
47
+
48
+ ## Platform-Specific UI
49
+
50
+ - Branch on `Platform.OS === 'ios' | 'android' | 'web'` only when the platform mandates a different UX (haptic patterns, header back gesture, status bar contrast). Avoid platform branching for layout — use flex + responsive units.
51
+ - iOS: use `react-native-screens` with `enableScreens()` so the navigator renders native `UIViewController` stacks. Without this, all screens are JS Views.
52
+ - Android: target SDK 35 (Android 15) per Google Play 2025 requirement. Configure edge-to-edge content (`android:windowOptOutEdgeToEdgeEnforcement="false"`) and respect insets via `react-native-safe-area-context`.
53
+ - Accessibility: every touchable surface has `accessibilityRole`, `accessibilityLabel`, and `accessibilityHint`. Test with VoiceOver (iOS) and TalkBack (Android) before merge — simulator a11y is not equivalent.
54
+
55
+ ## State & Data
56
+
57
+ - Use TanStack Query (`@tanstack/react-query`) for server state. Avoid Redux unless the app has cross-screen optimistic UI requirements not served by Query mutations.
58
+ - Local persistent state: `@react-native-async-storage/async-storage` for non-secret values, `expo-secure-store` for tokens. Never store auth tokens in AsyncStorage on iOS (Keychain via SecureStore is the floor).
59
+ - Background sync: use Expo's `expo-task-manager` + `expo-background-fetch` (managed) or `react-native-background-fetch` (bare). Document the platform-specific minimum interval (iOS ~15 min minimum, Android ~15 min minimum on Doze).
60
+
61
+ ## Testing
62
+
63
+ - Unit + component tests with `jest-expo` (Expo) or `@testing-library/react-native` (bare). Run on the host Node runtime — no simulator boot for unit tests.
64
+ - Integration tests with Detox (gray-box) or Maestro (black-box). Detox is preferred for apps with native modules; Maestro for pure-JS flows.
65
+ - Snapshot tests for every screen at multiple viewport sizes (iPhone SE, iPhone 16 Pro Max, Pixel 8a) — guard against layout regressions on small devices.
66
+ - E2E on EAS: configure `eas-cli` matrix builds against real devices via BrowserStack App Live or Sauce Labs Real Device Cloud.
67
+
68
+ ## References
69
+
70
+ - React Native New Architecture overview: https://reactnative.dev/docs/the-new-architecture/landing-page (accessed 2026-05-27, official-docs)
71
+ - Expo SDK 52 release notes: https://expo.dev/changelog/2024-11-12-sdk-52 (accessed 2026-05-27, official-docs)
72
+ - Expo Router 4: https://docs.expo.dev/router/introduction/ (accessed 2026-05-27, official-docs)
73
+
74
+ ## Cross-References
75
+
76
+ - `rules/hatch3r-component-conventions.md` — shared four-state surface contract applies to RN screens.
77
+ - `rules/hatch3r-accessibility-standards.md` — WCAG mapping carries to React Native via `accessibilityRole` props.
78
+ - `rules/hatch3r-testing.md` — coverage thresholds and determinism rules apply to RN tests.
@@ -2,8 +2,10 @@
2
2
  id: hatch3r-resilience-patterns
3
3
  type: rule
4
4
  description: Resilience patterns in user code — circuit breakers, retry with decorrelated jitter, timeouts with deadline propagation, idempotency keys, bulkheads, hedged requests
5
- scope: "**/services/**,**/handlers/**,**/clients/**,**/integrations/**,**/api/**,**/middleware/**,**/circuit*,**/retry*,**/resilience*"
5
+ scope: conditional
6
+ globs: "**/services/**,**/handlers/**,**/clients/**,**/integrations/**,**/api/**,**/middleware/**,**/circuit*,**/retry*,**/resilience*"
6
7
  tags: [implementation, devops]
8
+ precedence: high
7
9
  quality_charter: agents/shared/quality-charter.md
8
10
  cache_friendly: true
9
11
  ---
@@ -2,6 +2,7 @@
2
2
  description: Resilience patterns in user code — circuit breakers, retry with decorrelated jitter, timeouts with deadline propagation, idempotency keys, bulkheads, hedged requests
3
3
  globs: ["**/services/**", "**/handlers/**", "**/clients/**", "**/integrations/**", "**/api/**", "**/middleware/**", "**/circuit*", "**/retry*", "**/resilience*"]
4
4
  alwaysApply: false
5
+ precedence: high
5
6
  ---
6
7
  # Resilience Patterns
7
8
 
@@ -0,0 +1,84 @@
1
+ ---
2
+ id: hatch3r-reviewer-calibration
3
+ type: rule
4
+ description: "Reviewer runtime confidence-calibration contract: every Nth (default N=5) consecutive clean PASS triggers an out-of-band second-pass review before loop exit; divergence reverts to REQUEST CHANGES; each second pass logs to .hatch3r/calibration-log.jsonl. Canonical source of the N-default and the directive that agents/hatch3r-reviewer.md and calibration-protocol.md reference."
5
+ tags: [review, orchestration, floor:protocol]
6
+ scope: always
7
+ precedence: high
8
+ quality_charter: agents/shared/quality-charter.md
9
+ cache_friendly: true
10
+ ---
11
+ # hatch3r Reviewer Confidence Calibration
12
+
13
+ **Pillars:** P2 (Scientific & Practical Quality), P5 (Governance Self-Quality)
14
+
15
+ A reviewer's `confidence` rating is self-assigned by the same model that produced the verdict. Without an out-of-band check it is structurally over-trusted: LLM judges systematically overstate confidence — predicted confidence significantly exceeds realized correctness (Tian et al. 2025, arxiv:2508.06225) — so a self-reported clean PASS carries a non-zero, unmeasured miscalibration probability at runtime. This rule is the canonical, always-on source for the **runtime** (within-loop) bound that closes that gap before the review loop exits on a clean PASS. It owns the N-default and the directive that `agents/hatch3r-reviewer.md` §Runtime Confidence Calibration and the across-cycle calibration protocol cite.
16
+
17
+ Scope split (do not duplicate across the two artifacts):
18
+
19
+ - **Runtime, within-loop (this rule + `agents/hatch3r-reviewer.md`):** bounds an unbounded run of self-trusted clean verdicts inside one review-loop session. Fires before loop exit.
20
+ - **Across-cycle measurement (the across-cycle calibration protocol):** samples N=20 prior-cycle PASS findings at cycle close and scores realized over-claim rate. Fires at cycle archive time.
21
+
22
+ The two are complements, not substitutes — neither replaces the other.
23
+
24
+ ## Directive (verbatim)
25
+
26
+ > Every Nth consecutive clean PASS verdict on a review-loop exit triggers one out-of-band second-pass review of the same diff. If the second pass surfaces any Critical or Warning the first pass did not, the loop does NOT exit clean — it reverts to REQUEST CHANGES. Each second pass appends one record to `.hatch3r/calibration-log.jsonl`.
27
+
28
+ ## N-default (authoritative)
29
+
30
+ `N = 5` consecutive clean PASS verdicts for general diffs; `N = 1` for safety-class diffs (auth / security / migration — see the high-risk fast path in Trigger). These are the single source of truth for the defaults; `agents/hatch3r-reviewer.md` and the across-cycle calibration protocol cite these values rather than redeclaring them. The lowered safety-class default fires the second pass on the first clean PASS so an auth, security, or migration change never merges on a single self-trusted verdict (D23-2).
31
+
32
+ - **Counter owner — the orchestrator, NOT the reviewer.** The reviewer sub-agent is spawned stateless per iteration and the review loop exits on the first clean verdict, so a reviewer-owned counter can never exceed 1 and the second pass would never fire. The orchestrator owns `consecutive_clean_pass_count` and reads/writes it; the reviewer only reports its per-verdict outcome.
33
+ - **Counter scope — across top-level runs, persisted.** Count consecutive clean PASS verdicts across top-level pipeline runs, not within one loop and not per-iteration (the loop exits on the first clean verdict, so within a single loop the count advances by at most 1). The orchestrator persists the running count to project-local `.hatch3r/calibration-state.json` (`{ "consecutive_clean_pass_count": <int>, "updated_at": "<ISO-8601>" }`), written atomically via `src/merge/safeWrite.ts`. On each top-level run the orchestrator reads the prior count, increments on a would-be-clean exit, and resets to 0 on any REQUEST CHANGES or DESIGN_OBJECTION verdict. A missing/unparseable file is treated as count 0.
34
+ - **Project override:** a project may set a different cadence via its own config; the override widens or narrows the cadence but never disables the second pass while a second pass remains available (see Unavailability below).
35
+
36
+ ## Trigger
37
+
38
+ The orchestrator evaluates the trigger at the would-be-clean loop exit (the point where the loop would return a clean PASS — 0 Critical + 0 Warning — to Phase 4), using the cross-run counter it persisted per N-default above. Either branch fires the second pass:
39
+
40
+ - **Cadence branch (default):** the post-increment `consecutive_clean_pass_count` (prior persisted count + 1 for this run) is a multiple of `N`.
41
+ - **High-risk fast path (safety-class, N=1):** the reviewed diff touches any safety-class surface — a file tagged `floor:security`, auth/authn code (the `hatch3r-security` (CQ3) dispatch set in `agents/hatch3r-reviewer.md`: `src/auth/**`, OAuth/OIDC config, WebAuthn/passkey server, release-pipeline files, dependency manifest/lockfile), any change that triggers the CQ3 security specialist, OR a schema/event-schema migration (the `migration.review` surface — schema DDL, backfills, event-schema changes). For a safety-class diff, fire the second pass on the **first** clean PASS, independent of the cadence counter (do not wait for the Nth). The fast-path branch still increments and persists the cross-run counter; it only lowers the firing threshold to `N=1` for that run.
42
+
43
+ ## Action
44
+
45
+ Run one second-pass review of the same diff with an independent judge:
46
+
47
+ 1. **Documented setup recommendation — a different model class.** A same-model-family critique shares the generator's blind spot, so a same-family second pass cannot detect the error classes the family is systematically biased to produce (Huang et al., ICLR 2024, "Large Language Models Cannot Self-Correct Reasoning Yet"). Route the second pass to a different model class wherever the deployment can — this is the recommended project setup, not best-effort. The second pass renders its own independent verdict + confidence.
48
+ 2. **Fallback — same model class re-rolled at higher temperature,** used ONLY when no second model class is routable. Because this fallback does not break the shared-blind-spot, it is a weaker check: emit `calibration: degraded (same-family re-roll)` in the verdict for that run so the weakened independence is visible and never asserted as a clean cross-family check. Record the model class used in the log (`second_pass_model_class: re-roll`).
49
+
50
+ The second pass applies the same Review Checklist as the first (`agents/hatch3r-reviewer.md` → Review Checklist); it is a full re-review, not a spot check.
51
+
52
+ ## Divergence handling
53
+
54
+ - **Divergent** — the second pass surfaces any Critical or Warning the first pass did not: do NOT exit clean. Revert the loop verdict to REQUEST CHANGES, record both verdicts, and feed the divergence to the next fixer iteration.
55
+ - **Aligned** — both passes agree (both clean): exit clean and record alignment.
56
+
57
+ A divergent second pass is the failure mode of interest — it is the runtime signal that the first pass was over-confident.
58
+
59
+ ## Logging
60
+
61
+ Append exactly one record per second pass to `.hatch3r/calibration-log.jsonl` (project-local, JSON Lines) via the atomic append path in `src/merge/safeWrite.ts`. One JSON object per line:
62
+
63
+ ```json
64
+ {"timestamp":"<ISO-8601>","first_pass_verdict":"PASS","second_pass_verdict":"PASS|REQUEST CHANGES","divergent":false,"second_pass_model_class":"different|re-roll","consecutive_clean_count":5,"trigger":"cadence|high-risk"}
65
+ ```
66
+
67
+ `consecutive_clean_count` is the post-increment cross-run count at firing time; `trigger` records which Trigger branch fired (`high-risk` when the diff touched a safety-class surface and the second pass fired on the first clean PASS under the `N=1` fast path). `second_pass_model_class` is `different` for a cross-family second pass or `re-roll` for the same-family fallback; a `re-roll` record corresponds to a `calibration: degraded (same-family re-roll)` verdict annotation per Action. The project-local over-claim rate derived from this log feeds the iteration-summary `Confidence` field per `rules/hatch3r-iteration-summary.md`.
68
+
69
+ ## Unavailability (visible skip, never silent)
70
+
71
+ Skip the second pass ONLY when no second model class is available AND the orchestrator has disabled same-model re-roll. In that case emit `calibration: skipped (no second pass available)` in the verdict so the gap is visible rather than silent — a silent skip is a Silent-Failure-Contract violation. A skip does NOT reset the consecutive-clean-PASS counter; the next eligible exit re-attempts the second pass.
72
+
73
+ ## Pillar Service
74
+
75
+ - **P2 Scientific & Practical Quality (primary).** Adds an adversarial out-of-band check to a self-assigned confidence value; over-claimed clean verdicts become detectable at runtime, not just at cycle close.
76
+ - **P5 Governance Self-Quality (supporting).** Removes the "reviewer as sole judge of its own confidence" structural over-trust pattern from the within-loop path, mirroring the across-cycle loop that `calibration-protocol.md` adds at cycle scope.
77
+
78
+ ## References
79
+
80
+ - `agents/hatch3r-reviewer.md` §Runtime Confidence Calibration — the consuming agent body that invokes this contract (accessed 2026-05-28, trust tier: canonical).
81
+ - The across-cycle calibration protocol §Runtime complement (F13.2-F1) — the across-cycle measurement loop this runtime bound complements (accessed 2026-05-28, trust tier: canonical).
82
+ - `rules/hatch3r-iteration-summary.md` — consumes the project-local over-claim rate for the `Confidence` field (accessed 2026-05-28, trust tier: canonical).
83
+ - Tian, Z. et al. "Overconfidence in LLM-as-a-Judge: Diagnosis and Confidence-Driven Solution" (arxiv:2508.06225). `https://arxiv.org/abs/2508.06225` (accessed 2026-06-09, peer-reviewed-methodology). Evidence that an LLM judge's predicted confidence significantly overstates realized correctness (the Overconfidence Phenomenon), so a self-reported clean PASS is structurally over-trusted — motivating the out-of-band second pass.
84
+ - Huang, J. et al. "Large Language Models Cannot Self-Correct Reasoning Yet." ICLR 2024 (arxiv:2310.01798). `https://arxiv.org/abs/2310.01798` (accessed 2026-06-06, peer-reviewed-methodology). Evidence that same-model self-critique shares the generator's blind spot, motivating the different-model-class setup recommendation in Action and the lowered safety-class `N=1` second-pass cadence (D23-2).