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,147 @@
1
+ ---
2
+ id: hatch3r-enhancability-rule
3
+ type: rule
4
+ description: CQ9 Enhancability Quality measurement rule — feature-flag adoption on user-visible behavior, config externalization, API versioning + deprecation policy, forward-compat patterns, extension-point definition
5
+ scope: conditional
6
+ globs: "src/**,**/config/**,**/openapi.yaml,**/openapi.json,**/*.proto,**/schema.graphql,**/asyncapi.yaml,**/flags*,**/plugins/**,**/extensions/**"
7
+ tags: [review, enhancability, code-standards, floor:content-quality]
8
+ precedence: high
9
+ quality_charter: agents/shared/quality-charter.md
10
+ cache_friendly: true
11
+ ---
12
+ # Enhancability Quality (CQ9)
13
+
14
+ **Pillars:** P4 (Comprehensive Lean Coverage), CQ9 (Enhancability Quality)
15
+
16
+ ## Scope
17
+
18
+ This rule binds the CQ9 measurement set across end-user code that hatch3r-generated agents produce. It owns:
19
+
20
+ - The feature-flag adoption floor on user-visible behavior changes.
21
+ - The configuration-externalization floor on environment-dependent values.
22
+ - The API versioning + deprecation policy on stable endpoints.
23
+ - The forward-compatibility pattern gate (additive schema, Deprecation + Sunset headers, contract tests).
24
+ - The extension-point definition gate for cross-cutting concerns.
25
+ - Specialist routing to `agents/hatch3r-enhancability.md`.
26
+
27
+ This complements (does not duplicate) `rules/hatch3r-feature-flags.md` (flag-system implementation pattern), `rules/hatch3r-api-versioning.md` (semver + deprecation timeline), and `rules/hatch3r-progressive-delivery.md` (rollout strategy).
28
+
29
+ ## CQ9 Threshold Set
30
+
31
+ Source: pillar CQ9 (see `agents/shared/principles.md`). Every threshold below is measurable per audit cycle.
32
+
33
+ | Threshold | Target | Measurement source |
34
+ |-----------|--------|--------------------|
35
+ | Feature-flag adoption | 100% on user-visible behavior changes | Diff scan vs flag-key inventory (`flags.yaml` or in-code registry) |
36
+ | Configuration externalization | 100% on environment-dependent values | Grep diff for hardcoded URLs, timeouts, retry counts, batch sizes, toggles, credentials |
37
+ | API versioning compliance | Semver 2.0.0 per release | MAJOR/MINOR/PATCH bump matches diff classification |
38
+ | Forward-compat patterns | 100% on stable endpoints | Additive schema; Deprecation (RFC 9745) + Sunset (RFC 8594) headers; consumer-driven contract tests |
39
+ | Extension-point definition | Per cross-cutting concern | Named interface; plugin registry; documented lifecycle hooks (onInit, onShutdown, onConfigChange); `## Stability` block |
40
+ | Spec-diff CI gate | Exit-zero per release | `oasdiff`, `buf breaking`, `graphql-inspector diff` CI step active |
41
+
42
+ ## Feature-Flag Adoption
43
+
44
+ Every user-visible behavior change MUST ship behind an OpenFeature (or vendor-equivalent) flag. The rule:
45
+
46
+ 1. **Provider registration** — application code wires a flag provider via `OpenFeature.setProvider()` (vendor SDK: LaunchDarkly, flagd, Unleash, Flagsmith, Split). Provider config lives in env-overridable settings.
47
+ 2. **Flag-key inventory** — every flag key is registered in `flags.yaml` (or equivalent) with metadata: owner, description, default-value, kill-switch flag.
48
+ 3. **Evaluation context** — flag evaluations carry a documented attribute schema (user-id, account-id, org-id, environment, locale, beta-cohort).
49
+ 4. **Kill-switch** — every behavior-changing flag has a documented kill-switch path: setting the flag to OFF reverts to the previous behavior without code rollback.
50
+ 5. **Cleanup window** — flags retired ≤90 days after 100% rollout per `rules/hatch3r-feature-flags.md`.
51
+
52
+ Behavior changes shipped without a flag are CRITICAL findings.
53
+
54
+ ## Configuration Externalization
55
+
56
+ Every environment-dependent value MUST be externalized — hardcoded values in `src/` paths are FINDINGS minimum. Externalize via:
57
+
58
+ - **Schema-validated env** — Zod (`z.object({...}).parse(process.env)`), Joi (`Joi.object({...}).validate()`), Pydantic (`class Settings(BaseSettings)`), envalid (`cleanEnv()`).
59
+ - **Dotenv-flow** — `.env.development`, `.env.production`; secrets via secret-manager not file.
60
+ - **Startup-time validation** — config schema parsed once at boot; mis-config fails fast with named missing field.
61
+
62
+ Forbidden in `src/` paths:
63
+
64
+ - Hardcoded URLs to external services.
65
+ - Hardcoded timeouts, retry counts, batch sizes.
66
+ - Hardcoded feature toggles (`if (true)` ahead of a feature).
67
+ - Hardcoded credentials, API keys, tokens (see also `rules/hatch3r-secrets-management.md`).
68
+ - Silent fallback on config-validation error (catch + log + continue) — fail fast or document the explicit recovery path.
69
+
70
+ ## API Versioning + Deprecation
71
+
72
+ Source: semver 2.0.0 (semver.org) + `rules/hatch3r-api-versioning.md`. The diff classification determines the version bump:
73
+
74
+ | Diff classification | Required bump |
75
+ |---------------------|---------------|
76
+ | Breaking change (removed field, changed type, renamed endpoint, semantics change) | MAJOR |
77
+ | Additive (new field, new endpoint, new method, new enum value) | MINOR |
78
+ | Fix (clarification, doc-only, bug-fix matching documented behavior) | PATCH |
79
+
80
+ The OpenAPI / AsyncAPI / GraphQL SDL `info.version` MUST be aligned to the release tag. Skipping a MAJOR bump on a breaking change is CRITICAL.
81
+
82
+ ## Forward-Compatibility Patterns
83
+
84
+ On stable endpoints:
85
+
86
+ - **Additive schema** — new fields are optional; default values are documented; consumers ignore unknown fields. Removing a field is breaking; renaming is breaking.
87
+ - **Deprecation header (RFC 9745)** — emit `Deprecation: @1735689600` (Unix-time) or `Deprecation: Tue, 20 May 2025 00:00:00 GMT` (IMF-fixdate) on retiring endpoints.
88
+ - **Sunset header (RFC 8594)** — emit `Sunset: Tue, 31 Dec 2025 23:59:59 GMT` (IMF-fixdate only) on retiring endpoints. Sunset date MUST be later than Deprecation date.
89
+ - **Migration link** — emit `Link: <https://api.example.com/docs/migration>; rel="deprecation"` + `Link: <…>; rel="sunset"`.
90
+ - **Consumer-driven contract tests** — every public surface has a Pact (or equivalent) contract test from the consumer side; provider verification CI step exits-zero.
91
+ - **Spec-diff CI gate** — `oasdiff breaking --fail-on-diff` (REST), `buf breaking --against` (protobuf), `graphql-inspector diff` (GraphQL); the gate exits non-zero on breaks.
92
+
93
+ ## Extension-Point Definition
94
+
95
+ Cross-cutting concerns (logging, auth, persistence, telemetry, error handling) get a named extension point:
96
+
97
+ - **Plugin interface** — exported TypeScript interface (`export interface AuthPlugin { ... }`) or Python protocol (`class AuthPlugin(Protocol)`).
98
+ - **Plugin registry** — central registration via `Plugin.register('auth', new MyAuthPlugin())` or dependency-injection container.
99
+ - **Lifecycle hooks** — `onInit(config)`, `onShutdown()`, `onConfigChange(newConfig)`.
100
+ - **Stability block** — `## Stability: stable | experimental | deprecated` block in the plugin's documentation.
101
+ - **Version-stable contract** — once a plugin interface is `stable`, the contract is bound to the deprecation policy and semver rules.
102
+
103
+ ## Specialist Agent Routing
104
+
105
+ | Trigger | Route to |
106
+ |---------|----------|
107
+ | User-visible behavior modified | `agents/hatch3r-enhancability.md` (flag adoption gate) |
108
+ | Public API surface modified (OpenAPI / GraphQL SDL / AsyncAPI / protobuf) | `agents/hatch3r-enhancability.md` (versioning + forward-compat gate) |
109
+ | Config schema or feature-flag definition modified | `agents/hatch3r-enhancability.md` (externalization gate) |
110
+ | Extension-point interface modified | `agents/hatch3r-enhancability.md` (plugin contract gate) |
111
+ | Release-prep audit | `agents/hatch3r-enhancability.md` |
112
+
113
+ ## Per-Finding Output Format
114
+
115
+ Every finding emitted under this rule uses the CQ per-finding rigor-field schema per `rules/hatch3r-cq-rule-frame.md` → Per-Finding Output Format (rigor-contract fields per `agents/shared/rigor-contract.md`), with `<N>` = CQ9. The `proof_trace` excerpt is the file:line citation + spec-diff/grep output for the threshold that produced the finding.
116
+
117
+ ## Severity Mapping
118
+
119
+ The Specialist-Status to canonical-severity map (`CRITICAL` → Critical, `FINDINGS` → High + Medium, `PASS` → Low + Info) is the shared CQ frame per `rules/hatch3r-cq-rule-frame.md` → Specialist-Status to Canonical-Severity Map, sourced from `agents/shared/severity-mapping.md`. CQ9 Action per status:
120
+
121
+ - `CRITICAL`: Behavior change shipped without a flag; breaking change on stable endpoint without major-version bump; hardcoded credential or secret; silent fallback on config-validation error; missing CI spec-diff gate.
122
+ - `FINDINGS`: Externalization gap (hardcoded URL/timeout/batch-size); missing Deprecation/Sunset header; semver-policy gap; under-documented extension point.
123
+ - `PASS`: All thresholds met; surface in iteration summary.
124
+
125
+ ## Irreversibility Trigger
126
+
127
+ Retiring a feature flag, dropping an API endpoint, or hardcoding a previously-externalized value is irreversible at production traffic. Each MUST go through `agents/shared/user-question-protocol.md` per `rules/hatch3r-clarification-default.md` B1 before action, with its own ask cycle.
128
+
129
+ ## When to Invoke
130
+
131
+ - Every PR that modifies user-visible behavior, public API surfaces, config schema, or extension-point interfaces.
132
+ - Implementer pre-write check when authoring a new user-visible behavior — confirms the flag-gating + config-externalization plan before code is written.
133
+ - Verifier pre-merge gate on protected branches that touch the public API or behavior-toggle surface.
134
+ - API change audit during a D14 or forthcoming D22 cycle, or whenever the maturity tier escalates.
135
+ - Plugin / extension-point surface review before declaring an interface stable.
136
+
137
+ ## References
138
+
139
+ - Pillar CQ9 (measurement set + specialist owner; see `agents/shared/principles.md`).
140
+ - The extensibility audit domain (enhancability domain).
141
+ - `agents/hatch3r-enhancability.md` (CQ9 reviewer / gate).
142
+ - `rules/hatch3r-feature-flags.md` (flag-system implementation pattern).
143
+ - `rules/hatch3r-api-versioning.md` (semver + deprecation timeline).
144
+ - `rules/hatch3r-progressive-delivery.md` (rollout strategy).
145
+ - `rules/hatch3r-secrets-management.md` (secret hygiene — paired with externalization).
146
+ - RFC 9745 (Deprecation header), RFC 8594 (Sunset header), semver 2.0.0 (semver.org).
147
+ - OpenFeature spec (https://openfeature.dev/specification/) — vendor-neutral flag SDK pattern.
@@ -0,0 +1,142 @@
1
+ ---
2
+ description: CQ9 Enhancability Quality measurement rule — feature-flag adoption on user-visible behavior, config externalization, API versioning + deprecation policy, forward-compat patterns, extension-point definition
3
+ globs: ["src/**", "**/config/**", "**/openapi.yaml", "**/openapi.json", "**/*.proto", "**/schema.graphql", "**/asyncapi.yaml", "**/flags*", "**/plugins/**", "**/extensions/**"]
4
+ alwaysApply: false
5
+ precedence: high
6
+ ---
7
+ # Enhancability Quality (CQ9)
8
+
9
+ **Pillars:** P4 (Comprehensive Lean Coverage), CQ9 (Enhancability Quality)
10
+
11
+ ## Scope
12
+
13
+ This rule binds the CQ9 measurement set across end-user code that hatch3r-generated agents produce. It owns:
14
+
15
+ - The feature-flag adoption floor on user-visible behavior changes.
16
+ - The configuration-externalization floor on environment-dependent values.
17
+ - The API versioning + deprecation policy on stable endpoints.
18
+ - The forward-compatibility pattern gate (additive schema, Deprecation + Sunset headers, contract tests).
19
+ - The extension-point definition gate for cross-cutting concerns.
20
+ - Specialist routing to `agents/hatch3r-enhancability.md`.
21
+
22
+ This complements (does not duplicate) `rules/hatch3r-feature-flags.md` (flag-system implementation pattern), `rules/hatch3r-api-versioning.md` (semver + deprecation timeline), and `rules/hatch3r-progressive-delivery.md` (rollout strategy).
23
+
24
+ ## CQ9 Threshold Set
25
+
26
+ Source: pillar CQ9 (see `agents/shared/principles.md`). Every threshold below is measurable per audit cycle.
27
+
28
+ | Threshold | Target | Measurement source |
29
+ |-----------|--------|--------------------|
30
+ | Feature-flag adoption | 100% on user-visible behavior changes | Diff scan vs flag-key inventory (`flags.yaml` or in-code registry) |
31
+ | Configuration externalization | 100% on environment-dependent values | Grep diff for hardcoded URLs, timeouts, retry counts, batch sizes, toggles, credentials |
32
+ | API versioning compliance | Semver 2.0.0 per release | MAJOR/MINOR/PATCH bump matches diff classification |
33
+ | Forward-compat patterns | 100% on stable endpoints | Additive schema; Deprecation (RFC 9745) + Sunset (RFC 8594) headers; consumer-driven contract tests |
34
+ | Extension-point definition | Per cross-cutting concern | Named interface; plugin registry; documented lifecycle hooks (onInit, onShutdown, onConfigChange); `## Stability` block |
35
+ | Spec-diff CI gate | Exit-zero per release | `oasdiff`, `buf breaking`, `graphql-inspector diff` CI step active |
36
+
37
+ ## Feature-Flag Adoption
38
+
39
+ Every user-visible behavior change MUST ship behind an OpenFeature (or vendor-equivalent) flag. The rule:
40
+
41
+ 1. **Provider registration** — application code wires a flag provider via `OpenFeature.setProvider()` (vendor SDK: LaunchDarkly, flagd, Unleash, Flagsmith, Split). Provider config lives in env-overridable settings.
42
+ 2. **Flag-key inventory** — every flag key is registered in `flags.yaml` (or equivalent) with metadata: owner, description, default-value, kill-switch flag.
43
+ 3. **Evaluation context** — flag evaluations carry a documented attribute schema (user-id, account-id, org-id, environment, locale, beta-cohort).
44
+ 4. **Kill-switch** — every behavior-changing flag has a documented kill-switch path: setting the flag to OFF reverts to the previous behavior without code rollback.
45
+ 5. **Cleanup window** — flags retired ≤90 days after 100% rollout per `rules/hatch3r-feature-flags.md`.
46
+
47
+ Behavior changes shipped without a flag are CRITICAL findings.
48
+
49
+ ## Configuration Externalization
50
+
51
+ Every environment-dependent value MUST be externalized — hardcoded values in `src/` paths are FINDINGS minimum. Externalize via:
52
+
53
+ - **Schema-validated env** — Zod (`z.object({...}).parse(process.env)`), Joi (`Joi.object({...}).validate()`), Pydantic (`class Settings(BaseSettings)`), envalid (`cleanEnv()`).
54
+ - **Dotenv-flow** — `.env.development`, `.env.production`; secrets via secret-manager not file.
55
+ - **Startup-time validation** — config schema parsed once at boot; mis-config fails fast with named missing field.
56
+
57
+ Forbidden in `src/` paths:
58
+
59
+ - Hardcoded URLs to external services.
60
+ - Hardcoded timeouts, retry counts, batch sizes.
61
+ - Hardcoded feature toggles (`if (true)` ahead of a feature).
62
+ - Hardcoded credentials, API keys, tokens (see also `rules/hatch3r-secrets-management.md`).
63
+ - Silent fallback on config-validation error (catch + log + continue) — fail fast or document the explicit recovery path.
64
+
65
+ ## API Versioning + Deprecation
66
+
67
+ Source: semver 2.0.0 (semver.org) + `rules/hatch3r-api-versioning.md`. The diff classification determines the version bump:
68
+
69
+ | Diff classification | Required bump |
70
+ |---------------------|---------------|
71
+ | Breaking change (removed field, changed type, renamed endpoint, semantics change) | MAJOR |
72
+ | Additive (new field, new endpoint, new method, new enum value) | MINOR |
73
+ | Fix (clarification, doc-only, bug-fix matching documented behavior) | PATCH |
74
+
75
+ The OpenAPI / AsyncAPI / GraphQL SDL `info.version` MUST be aligned to the release tag. Skipping a MAJOR bump on a breaking change is CRITICAL.
76
+
77
+ ## Forward-Compatibility Patterns
78
+
79
+ On stable endpoints:
80
+
81
+ - **Additive schema** — new fields are optional; default values are documented; consumers ignore unknown fields. Removing a field is breaking; renaming is breaking.
82
+ - **Deprecation header (RFC 9745)** — emit `Deprecation: @1735689600` (Unix-time) or `Deprecation: Tue, 20 May 2025 00:00:00 GMT` (IMF-fixdate) on retiring endpoints.
83
+ - **Sunset header (RFC 8594)** — emit `Sunset: Tue, 31 Dec 2025 23:59:59 GMT` (IMF-fixdate only) on retiring endpoints. Sunset date MUST be later than Deprecation date.
84
+ - **Migration link** — emit `Link: <https://api.example.com/docs/migration>; rel="deprecation"` + `Link: <…>; rel="sunset"`.
85
+ - **Consumer-driven contract tests** — every public surface has a Pact (or equivalent) contract test from the consumer side; provider verification CI step exits-zero.
86
+ - **Spec-diff CI gate** — `oasdiff breaking --fail-on-diff` (REST), `buf breaking --against` (protobuf), `graphql-inspector diff` (GraphQL); the gate exits non-zero on breaks.
87
+
88
+ ## Extension-Point Definition
89
+
90
+ Cross-cutting concerns (logging, auth, persistence, telemetry, error handling) get a named extension point:
91
+
92
+ - **Plugin interface** — exported TypeScript interface (`export interface AuthPlugin { ... }`) or Python protocol (`class AuthPlugin(Protocol)`).
93
+ - **Plugin registry** — central registration via `Plugin.register('auth', new MyAuthPlugin())` or dependency-injection container.
94
+ - **Lifecycle hooks** — `onInit(config)`, `onShutdown()`, `onConfigChange(newConfig)`.
95
+ - **Stability block** — `## Stability: stable | experimental | deprecated` block in the plugin's documentation.
96
+ - **Version-stable contract** — once a plugin interface is `stable`, the contract is bound to the deprecation policy and semver rules.
97
+
98
+ ## Specialist Agent Routing
99
+
100
+ | Trigger | Route to |
101
+ |---------|----------|
102
+ | User-visible behavior modified | `agents/hatch3r-enhancability.md` (flag adoption gate) |
103
+ | Public API surface modified (OpenAPI / GraphQL SDL / AsyncAPI / protobuf) | `agents/hatch3r-enhancability.md` (versioning + forward-compat gate) |
104
+ | Config schema or feature-flag definition modified | `agents/hatch3r-enhancability.md` (externalization gate) |
105
+ | Extension-point interface modified | `agents/hatch3r-enhancability.md` (plugin contract gate) |
106
+ | Release-prep audit | `agents/hatch3r-enhancability.md` |
107
+
108
+ ## Per-Finding Output Format
109
+
110
+ Every finding emitted under this rule uses the CQ per-finding rigor-field schema per `rules/hatch3r-cq-rule-frame.md` → Per-Finding Output Format (rigor-contract fields per `agents/shared/rigor-contract.md`), with `<N>` = CQ9. The `proof_trace` excerpt is the file:line citation + spec-diff/grep output for the threshold that produced the finding.
111
+
112
+ ## Severity Mapping
113
+
114
+ The Specialist-Status to canonical-severity map (`CRITICAL` → Critical, `FINDINGS` → High + Medium, `PASS` → Low + Info) is the shared CQ frame per `rules/hatch3r-cq-rule-frame.md` → Specialist-Status to Canonical-Severity Map, sourced from `agents/shared/severity-mapping.md`. CQ9 Action per status:
115
+
116
+ - `CRITICAL`: Behavior change shipped without a flag; breaking change on stable endpoint without major-version bump; hardcoded credential or secret; silent fallback on config-validation error; missing CI spec-diff gate.
117
+ - `FINDINGS`: Externalization gap (hardcoded URL/timeout/batch-size); missing Deprecation/Sunset header; semver-policy gap; under-documented extension point.
118
+ - `PASS`: All thresholds met; surface in iteration summary.
119
+
120
+ ## Irreversibility Trigger
121
+
122
+ Retiring a feature flag, dropping an API endpoint, or hardcoding a previously-externalized value is irreversible at production traffic. Each MUST go through `agents/shared/user-question-protocol.md` per `rules/hatch3r-clarification-default.md` B1 before action, with its own ask cycle.
123
+
124
+ ## When to Invoke
125
+
126
+ - Every PR that modifies user-visible behavior, public API surfaces, config schema, or extension-point interfaces.
127
+ - Implementer pre-write check when authoring a new user-visible behavior — confirms the flag-gating + config-externalization plan before code is written.
128
+ - Verifier pre-merge gate on protected branches that touch the public API or behavior-toggle surface.
129
+ - API change audit during a D14 or forthcoming D22 cycle, or whenever the maturity tier escalates.
130
+ - Plugin / extension-point surface review before declaring an interface stable.
131
+
132
+ ## References
133
+
134
+ - Pillar CQ9 (measurement set + specialist owner; see `agents/shared/principles.md`).
135
+ - The extensibility audit domain (enhancability domain).
136
+ - `agents/hatch3r-enhancability.md` (CQ9 reviewer / gate).
137
+ - `rules/hatch3r-feature-flags.md` (flag-system implementation pattern).
138
+ - `rules/hatch3r-api-versioning.md` (semver + deprecation timeline).
139
+ - `rules/hatch3r-progressive-delivery.md` (rollout strategy).
140
+ - `rules/hatch3r-secrets-management.md` (secret hygiene — paired with externalization).
141
+ - RFC 9745 (Deprecation header), RFC 8594 (Sunset header), semver 2.0.0 (semver.org).
142
+ - OpenFeature spec (https://openfeature.dev/specification/) — vendor-neutral flag SDK pattern.
@@ -2,8 +2,10 @@
2
2
  id: hatch3r-event-schema-evolution
3
3
  type: rule
4
4
  description: Event and message schema evolution patterns for Kafka / Kinesis / Pub-Sub / event store — backward + forward + full compatibility modes, schema registry, consumer-side defaults
5
- scope: "**/events/**,**/schemas/**,**/*.avsc,**/*.proto,**/messaging/**,**/kafka/**,**/pubsub/**"
5
+ scope: conditional
6
+ globs: "**/events/**,**/schemas/**,**/*.avsc,**/*.proto,**/messaging/**,**/kafka/**,**/pubsub/**"
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: Event and message schema evolution patterns for Kafka / Kinesis / Pub-Sub / event store — backward + forward + full compatibility modes, schema registry, consumer-side defaults
3
3
  globs: ["**/events/**", "**/schemas/**", "**/*.avsc", "**/*.proto", "**/messaging/**", "**/kafka/**", "**/pubsub/**"]
4
4
  alwaysApply: false
5
+ precedence: high
5
6
  ---
6
7
  # Event Schema Evolution
7
8
 
@@ -0,0 +1,91 @@
1
+ ---
2
+ id: hatch3r-fan-out-discipline
3
+ type: rule
4
+ description: "P8 B2 floor: sub-agent fan-out scales with task size; serialization is valid only on dependency edges; token cost never justifies under-fan-out. Delegating artifacts emit sub-agent count + rationale as a first-class output field."
5
+ tags: [orchestration, floor:protocol]
6
+ scope: always
7
+ precedence: high
8
+ quality_charter: agents/shared/quality-charter.md
9
+ cache_friendly: true
10
+ ---
11
+ # hatch3r Fan-out Discipline
12
+
13
+ **Pillars:** P8 (Clarification & Fan-out Discipline)
14
+
15
+ Canonical reference for the *mechanics* of parallel dispatch: `rules/hatch3r-agent-orchestration.md` → Parallel Safety. This rule is the corpus-wide, always-on floor that every adapter ships to the end-user repo, so the B2 directive binds runtime agents directly and not only by inheritance through the orchestration rule.
16
+
17
+ ## B2 directive (verbatim)
18
+
19
+ > Sub-agent fan-out scales with task size; serialization is only valid on dependency edges. Token cost is never a valid reason to serialize independent work. Delegating artifacts emit sub-agent count + rationale as a first-class output field.
20
+
21
+ ## Scaling heuristic
22
+
23
+ Sub-agent count tracks task decomposition, not a fixed cap:
24
+
25
+ - N independent modules → N parallel Phase-2 implementers.
26
+ - M specialist gates → M parallel Phase-4 specialists.
27
+ - K independent research questions → K parallel researcher modes.
28
+
29
+ When work is independent under the three parallel-safety conditions below, fan out. Only a true dependency edge — where stage B consumes stage A's output — justifies serialization.
30
+
31
+ The count derived above sets WHETHER to spawn each sub-agent. Past roughly 8 concurrent sub-agents, the count also sets the SHAPE: a single orchestrator that integrates 11–15 concurrent results in one context becomes the reviewability bottleneck. At that width, keep the full task-derived count but split it across a two-level tree (see Hierarchical delegation) rather than collapsing it to a narrower flat fan-out — collapsing the count to ease integration is the P8 violation the cost-dominance clause already forbids.
32
+
33
+ ## Hierarchical delegation
34
+
35
+ The flat model — one orchestrator fans out to N workers and integrates all N results itself — is the default and is correct up to roughly 8 concurrent sub-agents (the empirical lead-agent ceiling cited in References, and the `max_phase4_parallel` default in `rules/hatch3r-agent-orchestration.md`). Beyond that width, prefer a two-level tree over a flat 11–15-wide fan-out:
36
+
37
+ - The root orchestrator decomposes the task into ≤8 disjoint groups and spawns one sub-orchestrator per group.
38
+ - Each sub-orchestrator fans out to its group's workers, integrates that group's results, and returns a single group-level summary.
39
+ - The root integrates ≤8 group summaries — not 11–15 raw worker results — so per-context integration load stays inside the reviewability ceiling at every level.
40
+
41
+ This preserves the task-derived total fan-out (no work is serialized): the same N workers still run concurrently, redistributed across sub-orchestrators. The grouping boundary MUST honor the three parallel-safety conditions both within a group and across groups, so a two-level tree carries no extra merge risk over the equivalent flat fan-out. High-fan-out commands are the trigger case — `commands/hatch3r-workflow.md` (`count: 15`) and the batch-mode `commands/hatch3r-board-fill.md` / `commands/hatch3r-board-pickup.md` (`count: 11` × issue count) otherwise concentrate every result on one orchestrator context.
42
+
43
+ Cost-dominance and reviewability govern different axes and never trade against each other: cost-dominance governs WHETHER to spawn a sub-agent (always spawn when work is independent; token cost never serializes it), reviewability governs the SHAPE of the resulting tree (flat ≤8, two-level beyond). Neither axis ever justifies dropping the task-derived count.
44
+
45
+ ## Three parallel-safety conditions
46
+
47
+ Fan out only when ALL three hold (per `rules/hatch3r-agent-orchestration.md` → Three Conditions to Parallelize):
48
+
49
+ 1. **Read-only or disjoint writes** — no two sub-agents write the same file or region.
50
+ 2. **Deterministic aggregation** — outputs merge without orchestrator intervention (tests pass-if-all-pass; findings union).
51
+ 3. **No shared mutable state** — agents that mutate shared state serialize; parallel agents only READ.
52
+
53
+ A fan-out that fails any condition is serialized or gated by a merge-conflict check — that is the only valid reason to drop below the task-derived count.
54
+
55
+ ## Cost-dominance clause
56
+
57
+ Token cost of sub-agent invocation never justifies under-fan-out. Cost governs HOW MUCH context each sub-agent receives (the P7 static-first prompt frame); it does not govern WHETHER to spawn the sub-agent at all. P8 dominates P7: when an edit would compress fan-out to save tokens, reject it. When in doubt, fan out. Reviewability is a separate, non-cost axis: it governs the SHAPE of the fan-out tree (flat vs two-level per Hierarchical delegation), never WHETHER to spawn — so reviewability never serializes independent work either.
58
+
59
+ ## Required output field
60
+
61
+ Delegating artifacts (orchestrator commands, fan-out skills, delegating agents) emit a first-class output field:
62
+
63
+ ```
64
+ sub_agents_spawned:
65
+ count: <integer>
66
+ rationale: <one-sentence task-decomposition justification>
67
+ ```
68
+
69
+ Omitting the field on a delegating artifact is a P8 B2 violation (D07 fan-out-discipline audit). The `rationale` states the decomposition basis (module count, specialist-gate count, research-question count) so a reviewer can check the count against the task without re-deriving it.
70
+
71
+ ## Static intent vs runtime attestation
72
+
73
+ The `sub_agents_spawned` frontmatter field declares fan-out intent at config time; it does not prove the orchestrator delegated at run time. The pair is closed by the End-of-Turn Delegation Attestation (`rules/hatch3r-agent-orchestration.md` → End-of-Turn Delegation Attestation): the per-file `delegation_proof_id` returned by the implementer or fixer sub-agent is forgery-resistant, because an orchestrator that skipped delegation has no token to quote. Static frontmatter declares; the runtime block verifies.
74
+
75
+ ## Scope
76
+
77
+ Binds every hatch3r-invoked workflow that delegates via the Task tool in the end-user repo — every `commands/hatch3r-*.md` with `orchestrator: true`, every delegating `agents/hatch3r-*.md`, and every fan-out `skills/hatch3r-*/SKILL.md`. Tier 1 reference-card skills that neither spawn sub-agents nor mutate files carry no fan-out obligation; they state `Tier 1 reference card — no fan-out` instead.
78
+
79
+ How each class emits the field differs because the count is known at a different time:
80
+
81
+ - **Commands** declare it as a static frontmatter key — a command's fan-out is fixed by its `agentPipeline`, so `sub_agents_spawned: {count, rationale}` is a config-time value. `scripts/validate-fanout-emission.ts` enforces the key on every `orchestrator: true` command (CI gate `npm run validate:efficiency`).
82
+ - **Skills** carry the runtime-emission directive in the body — a skill's count is task-derived (Tier 1 inline / Tier 2 per-concern / Tier 3 per-module), so a static integer would misstate it. A skill whose body holds a Tier-2/3 Task-tool delegation contract MUST state `` Emit `sub_agents_spawned: { count, rationale }` in your output. ``; the same validator flags `P8-FANOUT-SKILL-MISS` on a delegating, non-exempt skill that omits it.
83
+ - **Agents** are prose-bound: their delegation is inherited from `rules/hatch3r-agent-orchestration.md` and they carry no `orchestrator` frontmatter marker, so no separate validator trigger applies; the worker agents that mention the Task tool delegate on behalf of a parent orchestrator, not as a fan-out root.
84
+
85
+ ## References
86
+
87
+ - Pillar P8 B2 (source directive; see `agents/shared/principles.md`).
88
+ - `rules/hatch3r-agent-orchestration.md` → Parallel Safety, Scaling Heuristic, Cost-Dominance Principle, End-of-Turn Delegation Attestation (mechanics this rule references).
89
+ - The orchestration audit domain audits the B2 contract per cycle.
90
+ - Anthropic, "Multi-agent orchestration" (Managed Agents) — `https://platform.claude.com/docs/en/managed-agents/multi-agent` (accessed 2026-05-26, official-docs): a lead agent decomposes a job and delegates pieces to specialist sub-agents working in parallel over a shared file system, up to ~10 simultaneous — the lead-agent ceiling that anchors the ~8 flat-vs-hierarchical threshold above; beyond it a lead agent itself acts as a sub-orchestrator over its own workers.
91
+ - Augment Code, "Multi-Agent Orchestration Architecture Guide" — `https://www.augmentcode.com/guides/multi-agent-orchestration-architecture-guide` (accessed 2026-05-26, independent-analysis): structured context objects pass only relevant fields per worker; graph-based message passing structures communication along declared dependency edges.
@@ -0,0 +1,91 @@
1
+ ---
2
+ id: hatch3r-fan-out-discipline
3
+ type: rule
4
+ description: "P8 B2 floor: sub-agent fan-out scales with task size; serialization is valid only on dependency edges; token cost never justifies under-fan-out. Delegating artifacts emit sub-agent count + rationale as a first-class output field."
5
+ tags: [orchestration, floor:protocol]
6
+ alwaysApply: true
7
+ precedence: high
8
+ quality_charter: agents/shared/quality-charter.md
9
+ cache_friendly: true
10
+ ---
11
+ # hatch3r Fan-out Discipline
12
+
13
+ **Pillars:** P8 (Clarification & Fan-out Discipline)
14
+
15
+ Canonical reference for the *mechanics* of parallel dispatch: `rules/hatch3r-agent-orchestration.md` → Parallel Safety. This rule is the corpus-wide, always-on floor that every adapter ships to the end-user repo, so the B2 directive binds runtime agents directly and not only by inheritance through the orchestration rule.
16
+
17
+ ## B2 directive (verbatim)
18
+
19
+ > Sub-agent fan-out scales with task size; serialization is only valid on dependency edges. Token cost is never a valid reason to serialize independent work. Delegating artifacts emit sub-agent count + rationale as a first-class output field.
20
+
21
+ ## Scaling heuristic
22
+
23
+ Sub-agent count tracks task decomposition, not a fixed cap:
24
+
25
+ - N independent modules → N parallel Phase-2 implementers.
26
+ - M specialist gates → M parallel Phase-4 specialists.
27
+ - K independent research questions → K parallel researcher modes.
28
+
29
+ When work is independent under the three parallel-safety conditions below, fan out. Only a true dependency edge — where stage B consumes stage A's output — justifies serialization.
30
+
31
+ The count derived above sets WHETHER to spawn each sub-agent. Past roughly 8 concurrent sub-agents, the count also sets the SHAPE: a single orchestrator that integrates 11–15 concurrent results in one context becomes the reviewability bottleneck. At that width, keep the full task-derived count but split it across a two-level tree (see Hierarchical delegation) rather than collapsing it to a narrower flat fan-out — collapsing the count to ease integration is the P8 violation the cost-dominance clause already forbids.
32
+
33
+ ## Hierarchical delegation
34
+
35
+ The flat model — one orchestrator fans out to N workers and integrates all N results itself — is the default and is correct up to roughly 8 concurrent sub-agents (the empirical lead-agent ceiling cited in References, and the `max_phase4_parallel` default in `rules/hatch3r-agent-orchestration.md`). Beyond that width, prefer a two-level tree over a flat 11–15-wide fan-out:
36
+
37
+ - The root orchestrator decomposes the task into ≤8 disjoint groups and spawns one sub-orchestrator per group.
38
+ - Each sub-orchestrator fans out to its group's workers, integrates that group's results, and returns a single group-level summary.
39
+ - The root integrates ≤8 group summaries — not 11–15 raw worker results — so per-context integration load stays inside the reviewability ceiling at every level.
40
+
41
+ This preserves the task-derived total fan-out (no work is serialized): the same N workers still run concurrently, redistributed across sub-orchestrators. The grouping boundary MUST honor the three parallel-safety conditions both within a group and across groups, so a two-level tree carries no extra merge risk over the equivalent flat fan-out. High-fan-out commands are the trigger case — `commands/hatch3r-workflow.md` (`count: 15`) and the batch-mode `commands/hatch3r-board-fill.md` / `commands/hatch3r-board-pickup.md` (`count: 11` × issue count) otherwise concentrate every result on one orchestrator context.
42
+
43
+ Cost-dominance and reviewability govern different axes and never trade against each other: cost-dominance governs WHETHER to spawn a sub-agent (always spawn when work is independent; token cost never serializes it), reviewability governs the SHAPE of the resulting tree (flat ≤8, two-level beyond). Neither axis ever justifies dropping the task-derived count.
44
+
45
+ ## Three parallel-safety conditions
46
+
47
+ Fan out only when ALL three hold (per `rules/hatch3r-agent-orchestration.md` → Three Conditions to Parallelize):
48
+
49
+ 1. **Read-only or disjoint writes** — no two sub-agents write the same file or region.
50
+ 2. **Deterministic aggregation** — outputs merge without orchestrator intervention (tests pass-if-all-pass; findings union).
51
+ 3. **No shared mutable state** — agents that mutate shared state serialize; parallel agents only READ.
52
+
53
+ A fan-out that fails any condition is serialized or gated by a merge-conflict check — that is the only valid reason to drop below the task-derived count.
54
+
55
+ ## Cost-dominance clause
56
+
57
+ Token cost of sub-agent invocation never justifies under-fan-out. Cost governs HOW MUCH context each sub-agent receives (the P7 static-first prompt frame); it does not govern WHETHER to spawn the sub-agent at all. P8 dominates P7: when an edit would compress fan-out to save tokens, reject it. When in doubt, fan out. Reviewability is a separate, non-cost axis: it governs the SHAPE of the fan-out tree (flat vs two-level per Hierarchical delegation), never WHETHER to spawn — so reviewability never serializes independent work either.
58
+
59
+ ## Required output field
60
+
61
+ Delegating artifacts (orchestrator commands, fan-out skills, delegating agents) emit a first-class output field:
62
+
63
+ ```
64
+ sub_agents_spawned:
65
+ count: <integer>
66
+ rationale: <one-sentence task-decomposition justification>
67
+ ```
68
+
69
+ Omitting the field on a delegating artifact is a P8 B2 violation (D07 fan-out-discipline audit). The `rationale` states the decomposition basis (module count, specialist-gate count, research-question count) so a reviewer can check the count against the task without re-deriving it.
70
+
71
+ ## Static intent vs runtime attestation
72
+
73
+ The `sub_agents_spawned` frontmatter field declares fan-out intent at config time; it does not prove the orchestrator delegated at run time. The pair is closed by the End-of-Turn Delegation Attestation (`rules/hatch3r-agent-orchestration.md` → End-of-Turn Delegation Attestation): the per-file `delegation_proof_id` returned by the implementer or fixer sub-agent is forgery-resistant, because an orchestrator that skipped delegation has no token to quote. Static frontmatter declares; the runtime block verifies.
74
+
75
+ ## Scope
76
+
77
+ Binds every hatch3r-invoked workflow that delegates via the Task tool in the end-user repo — every `commands/hatch3r-*.md` with `orchestrator: true`, every delegating `agents/hatch3r-*.md`, and every fan-out `skills/hatch3r-*/SKILL.md`. Tier 1 reference-card skills that neither spawn sub-agents nor mutate files carry no fan-out obligation; they state `Tier 1 reference card — no fan-out` instead.
78
+
79
+ How each class emits the field differs because the count is known at a different time:
80
+
81
+ - **Commands** declare it as a static frontmatter key — a command's fan-out is fixed by its `agentPipeline`, so `sub_agents_spawned: {count, rationale}` is a config-time value. `scripts/validate-fanout-emission.ts` enforces the key on every `orchestrator: true` command (CI gate `npm run validate:efficiency`).
82
+ - **Skills** carry the runtime-emission directive in the body — a skill's count is task-derived (Tier 1 inline / Tier 2 per-concern / Tier 3 per-module), so a static integer would misstate it. A skill whose body holds a Tier-2/3 Task-tool delegation contract MUST state `` Emit `sub_agents_spawned: { count, rationale }` in your output. ``; the same validator flags `P8-FANOUT-SKILL-MISS` on a delegating, non-exempt skill that omits it.
83
+ - **Agents** are prose-bound: their delegation is inherited from `rules/hatch3r-agent-orchestration.md` and they carry no `orchestrator` frontmatter marker, so no separate validator trigger applies; the worker agents that mention the Task tool delegate on behalf of a parent orchestrator, not as a fan-out root.
84
+
85
+ ## References
86
+
87
+ - Pillar P8 B2 (source directive; see `agents/shared/principles.md`).
88
+ - `rules/hatch3r-agent-orchestration.md` → Parallel Safety, Scaling Heuristic, Cost-Dominance Principle, End-of-Turn Delegation Attestation (mechanics this rule references).
89
+ - The orchestration audit domain audits the B2 contract per cycle.
90
+ - Anthropic, "Multi-agent orchestration" (Managed Agents) — `https://platform.claude.com/docs/en/managed-agents/multi-agent` (accessed 2026-05-26, official-docs): a lead agent decomposes a job and delegates pieces to specialist sub-agents working in parallel over a shared file system, up to ~10 simultaneous — the lead-agent ceiling that anchors the ~8 flat-vs-hierarchical threshold above; beyond it a lead agent itself acts as a sub-orchestrator over its own workers.
91
+ - Augment Code, "Multi-Agent Orchestration Architecture Guide" — `https://www.augmentcode.com/guides/multi-agent-orchestration-architecture-guide` (accessed 2026-05-26, independent-analysis): structured context objects pass only relevant fields per worker; graph-based message passing structures communication along declared dependency edges.
@@ -10,6 +10,8 @@ cache_friendly: true
10
10
  ---
11
11
  # Feature Flags
12
12
 
13
+ **Pillars:** P2 (Scientific & Practical Quality), CQ9 (Enhancability Quality)
14
+
13
15
  - Use flags for gradual rollout of user-facing changes. Not for A/B experiments without tracking.
14
16
  - Naming: `FF_{AREA}_{FEATURE}` (e.g., `FF_PET_NEW_CELEBRATION`).
15
17
  - Store flags in remote config or user document in your backend.
@@ -5,6 +5,8 @@ alwaysApply: false
5
5
  ---
6
6
  # Feature Flags
7
7
 
8
+ **Pillars:** P2 (Scientific & Practical Quality), CQ9 (Enhancability Quality)
9
+
8
10
  - Use flags for gradual rollout of user-facing changes. Not for A/B experiments without tracking.
9
11
  - Naming: `FF_{AREA}_{FEATURE}` (e.g., `FF_PET_NEW_CELEBRATION`).
10
12
  - Store flags in remote config or user document in your backend.
@@ -0,0 +1,88 @@
1
+ ---
2
+ id: hatch3r-flutter-patterns
3
+ type: rule
4
+ description: Flutter and Dart conventions covering null safety, state management (Riverpod/Bloc), Material 3, FFI, performance, platform channels, and integration testing
5
+ scope: conditional
6
+ globs: "**/*.dart,**/pubspec.yaml,**/pubspec.lock,**/analysis_options.yaml,**/build.yaml,**/lib/**,**/test/**,**/integration_test/**,**/ios/Runner/**,**/android/app/**,**/windows/runner/**,**/macos/Runner/**,**/linux/**,**/web/index.html"
7
+ tags: [implementation]
8
+ quality_charter: agents/shared/quality-charter.md
9
+ cache_friendly: true
10
+ ---
11
+ # Flutter Patterns
12
+
13
+ **Pillars:** P2 (Scientific & Practical Quality), CQ8 (Maintainability Quality)
14
+
15
+ > Applies when the project ships a Flutter app or Dart package. Detection signals: `pubspec.yaml` with `flutter:` block, `lib/main.dart` entrypoint, or `pubspec.yaml` at repo root.
16
+
17
+ ## Dart Language Floor
18
+
19
+ - Use Dart 3.5+ with sound null safety. Every nullable field is explicit (`String?`), every late variable initialized before access. No `!` (bang operator) outside of test fixtures or proven-non-null hot paths.
20
+ - Records and patterns: prefer records (`(int, String)`) and pattern matching (`switch (value) { ... }`) over tuple classes and visitor patterns for simple variant returns.
21
+ - Sealed classes for closed-set hierarchies (state, events, errors): `sealed class AuthState { ... }` + `final class Authenticated extends AuthState { ... }` so the analyzer enforces exhaustive switches.
22
+ - Enable strict analyzer mode in `analysis_options.yaml` with `flutter_lints` plus `very_good_analysis`. Treat warnings as errors in CI.
23
+
24
+ ## Project Structure
25
+
26
+ - Feature-first layout under `lib/`: `lib/features/<feature>/{data,domain,presentation}/` with a `lib/core/` for shared utilities. Avoid `lib/widgets/` / `lib/screens/` flat layouts beyond toy apps.
27
+ - Single entrypoint per flavor: `lib/main_dev.dart`, `lib/main_staging.dart`, `lib/main_prod.dart`. Each delegates to a shared `lib/bootstrap.dart` after environment binding.
28
+ - Public APIs documented with `///` doc comments. `dartdoc` runs in CI for the `lib/` public surface — undocumented public APIs are a warning.
29
+
30
+ ## State Management
31
+
32
+ - Pick ONE state-management approach per app and document it in `docs/architecture.md`:
33
+ - **Riverpod 2.x** (`flutter_riverpod` + `riverpod_generator`) — recommended default. Code-gen typed providers via `@riverpod` annotations.
34
+ - **Bloc** (`flutter_bloc`) — when the team prefers event-sourcing semantics.
35
+ - **InheritedNotifier / ChangeNotifier** — only for trivial widget-local state. Provider package is in maintenance — do not adopt for new code.
36
+ - Riverpod: prefer `@riverpod`-generated providers over manual `Provider`/`StateProvider`. Async providers return `AsyncValue<T>` — surface `loading` / `error` / `data` states in the UI.
37
+ - Bloc: separate events (input) from states (output). Avoid `setState` inside `BlocBuilder` — all mutation flows via `add(event)` to the bloc.
38
+ - Never call `notifyListeners()` inside `build()`. Never read providers in a constructor.
39
+
40
+ ## UI & Material 3
41
+
42
+ - Material 3 (Material You) is the default for Android-leaning apps: `ThemeData(useMaterial3: true)`. Configure `colorSchemeSeed` rather than ad-hoc primary/accent colors so dynamic color works.
43
+ - For iOS-leaning apps, use Cupertino widgets directly or `flutter_platform_widgets` for hybrid surfaces. Do not use `Material` on a `CupertinoPageScaffold`.
44
+ - Responsive layout: use `LayoutBuilder`, `MediaQuery.sizeOf(context)`, and `Flexible`/`Expanded` for breakpoints. Avoid hard-coded pixel widths.
45
+ - Accessibility: every interactive widget has a `Semantics(label: ...)` wrapper or uses a built-in widget that emits semantics. Test with TalkBack (Android) and VoiceOver (iOS); the `flutter_test` semantics tester catches static violations.
46
+
47
+ ## Performance
48
+
49
+ - Avoid expensive work in `build()`. Lift `MaterialPageRoute` factories, regex literals, and constant widgets to `const` constructors so Flutter can skip the rebuild.
50
+ - Use `const` constructors aggressively — `const SizedBox(height: 8)` is allocation-free and a major frame-budget win.
51
+ - For long scrollable lists, use `ListView.builder` with `itemExtent` set when row height is uniform. `ListView()` (default) builds every child up-front.
52
+ - Image loading: `cached_network_image` or `flutter_image_compress` for network images. The default `Image.network` does not persist a disk cache.
53
+ - Profile with DevTools: target 60fps on mid-range Android (Pixel 4a class). Frame times above 16ms are regressions; profile the Timeline view for jank.
54
+
55
+ ## Platform Channels & FFI
56
+
57
+ - Native interop: prefer `dart:ffi` for synchronous C/C++ bindings (≥10x faster than channels). Use platform channels only when the API is event-driven or requires UI-thread context.
58
+ - `package:ffigen` generates Dart bindings from C headers — never hand-roll `Pointer<Native...>` signatures.
59
+ - Pigeon (`package:pigeon`) generates type-safe platform-channel code from a Dart interface declaration. Stop writing raw `MethodChannel` calls — Pigeon-generated code prevents schema drift.
60
+
61
+ ## Testing
62
+
63
+ - Three test layers in `test/` (unit + widget) and `integration_test/` (full app on real device or emulator):
64
+ - Unit tests: pure Dart logic, no Flutter binding. Run with `flutter test`.
65
+ - Widget tests: pumped `WidgetTester` flows with mocked dependencies. Use `find.byKey` over `find.text` for resilience to copy changes.
66
+ - Integration tests: `integration_test/` with `IntegrationTestWidgetsFlutterBinding`. Run on devices via `flutter drive` and on CI matrices.
67
+ - Coverage: `flutter test --coverage` + `lcov` reports. Floor: 80% line coverage in `lib/features/**`; critical features (auth, payments) 90%.
68
+ - Golden tests for visual regressions: `goldenFileComparator` with the `alchemist` package for multi-platform/multi-device goldens. Update goldens via PR review, never blanket-update.
69
+ - Mock HTTP: `package:http_mock_adapter` for Dio, `nock` for `package:http`. Never hit real network in tests.
70
+
71
+ ## Builds & Distribution
72
+
73
+ - Flavors via `--flavor` flag + matching Android/iOS configs (`android/app/build.gradle` flavors, `ios/Runner/Configurations`). Bake the API base URL per flavor.
74
+ - App size: enable `--obfuscate --split-debug-info=<path>` for release builds. Track size regressions via `flutter build apk --analyze-size` in CI.
75
+ - Use Codemagic, Bitrise, or Fastlane for store deploys. Sign Android with Play App Signing; iOS via App Store Connect API keys (avoid Apple ID password auth — deprecated).
76
+
77
+ ## References
78
+
79
+ - Dart 3 release notes: https://dart.dev/guides/whats-new (accessed 2026-05-27, official-docs)
80
+ - Flutter Material 3: https://docs.flutter.dev/ui/design/material (accessed 2026-05-27, official-docs)
81
+ - Riverpod 2.x: https://riverpod.dev/docs/introduction/getting_started (accessed 2026-05-27, official-docs)
82
+ - Pigeon: https://pub.dev/packages/pigeon (accessed 2026-05-27, official-docs)
83
+
84
+ ## Cross-References
85
+
86
+ - `rules/hatch3r-component-conventions.md` — four-state surface contract maps to Flutter `AsyncValue` patterns.
87
+ - `rules/hatch3r-testing.md` — coverage thresholds and determinism rules apply to Dart tests.
88
+ - `rules/hatch3r-accessibility-standards.md` — WCAG mapping for `Semantics` widget usage.