hatch3r 1.9.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/README.md +52 -143
  2. package/dist/cli/index.js +28453 -15831
  3. package/dist/content/agents/hatch3r-architect.md +39 -9
  4. package/dist/content/agents/hatch3r-brownfield-spec.md +254 -0
  5. package/dist/content/agents/hatch3r-ci-watcher.md +8 -1
  6. package/dist/content/agents/hatch3r-context-rules.md +19 -1
  7. package/dist/content/agents/hatch3r-creator.md +65 -26
  8. package/dist/content/agents/hatch3r-dependency-drafter.md +162 -0
  9. package/dist/content/agents/hatch3r-devops.md +11 -1
  10. package/dist/content/agents/hatch3r-docs-writer.md +11 -1
  11. package/dist/content/agents/hatch3r-edge-case-analyst.md +134 -0
  12. package/dist/content/agents/hatch3r-enhancability.md +192 -0
  13. package/dist/content/agents/hatch3r-fixer.md +59 -8
  14. package/dist/content/agents/hatch3r-greenfield-spec.md +256 -0
  15. package/dist/content/agents/hatch3r-handoff-loader.md +29 -3
  16. package/dist/content/agents/hatch3r-handoff-preparer.md +10 -1
  17. package/dist/content/agents/hatch3r-implementer.md +139 -8
  18. package/dist/content/agents/hatch3r-incident-responder.md +96 -0
  19. package/dist/content/agents/hatch3r-learnings-loader.md +122 -88
  20. package/dist/content/agents/hatch3r-lint-fixer.md +15 -3
  21. package/dist/content/agents/hatch3r-maintainability.md +183 -0
  22. package/dist/content/agents/hatch3r-pack-installer.md +113 -0
  23. package/dist/content/agents/hatch3r-performance.md +179 -0
  24. package/dist/content/agents/hatch3r-reliability.md +193 -0
  25. package/dist/content/agents/hatch3r-researcher.md +27 -4
  26. package/dist/content/agents/hatch3r-reviewer.md +153 -103
  27. package/dist/content/agents/hatch3r-scalability.md +162 -0
  28. package/dist/content/agents/hatch3r-security.md +197 -0
  29. package/dist/content/agents/hatch3r-testability.md +204 -0
  30. package/dist/content/agents/hatch3r-ui.md +175 -0
  31. package/dist/content/agents/hatch3r-ux.md +160 -0
  32. package/dist/content/agents/modes/requirements-elicitation.md +1 -1
  33. package/dist/content/agents/modes/user-flows.md +2 -2
  34. package/dist/content/agents/shared/clarification-default-block.md +44 -0
  35. package/dist/content/agents/shared/confidence-gate.md +42 -0
  36. package/dist/content/agents/shared/cq-specialist-roster.md +26 -0
  37. package/dist/content/agents/shared/efficiency-patterns.md +32 -1
  38. package/dist/content/agents/shared/injection-patterns.md +18 -7
  39. package/dist/content/agents/shared/principles.md +60 -0
  40. package/dist/content/agents/shared/prompt-structure.md +7 -1
  41. package/dist/content/agents/shared/quality-charter.md +48 -12
  42. package/dist/content/agents/shared/quality-specialist-frame.md +141 -0
  43. package/dist/content/agents/shared/rigor-contract.md +151 -0
  44. package/dist/content/agents/shared/severity-mapping.md +92 -0
  45. package/dist/content/agents/shared/triage-vocabulary.md +46 -0
  46. package/dist/content/agents/shared/user-content-templates.md +34 -8
  47. package/dist/content/agents/shared/user-question-protocol.md +45 -3
  48. package/dist/content/checks/README.md +5 -0
  49. package/dist/content/checks/accessibility.md +14 -7
  50. package/dist/content/checks/code-quality.md +1 -1
  51. package/dist/content/checks/performance.md +7 -4
  52. package/dist/content/checks/security.md +6 -6
  53. package/dist/content/checks/testing.md +1 -1
  54. package/dist/content/commands/board/pickup-delegation-multi.md +37 -10
  55. package/dist/content/commands/board/pickup-delegation.md +7 -5
  56. package/dist/content/commands/board/pickup-modes.md +1 -0
  57. package/dist/content/commands/board/pickup-post-impl.md +1 -1
  58. package/dist/content/commands/hatch3r-api-spec.md +79 -2
  59. package/dist/content/commands/hatch3r-auth-scaffold.md +250 -0
  60. package/dist/content/commands/hatch3r-benchmark.md +90 -7
  61. package/dist/content/commands/hatch3r-board-fill.md +97 -11
  62. package/dist/content/commands/hatch3r-board-pickup.md +93 -9
  63. package/dist/content/commands/hatch3r-bug-pipeline.md +240 -0
  64. package/dist/content/commands/hatch3r-bug-plan.md +79 -3
  65. package/dist/content/commands/hatch3r-codebase-map.md +80 -4
  66. package/dist/content/commands/hatch3r-create.md +105 -7
  67. package/dist/content/commands/hatch3r-debug.md +102 -14
  68. package/dist/content/commands/hatch3r-diagnose.md +238 -0
  69. package/dist/content/commands/hatch3r-feature-plan.md +125 -5
  70. package/dist/content/commands/hatch3r-handoff.md +83 -3
  71. package/dist/content/commands/hatch3r-healthcheck.md +105 -5
  72. package/dist/content/commands/hatch3r-incident-response.md +228 -0
  73. package/dist/content/commands/hatch3r-migration-plan.md +79 -3
  74. package/dist/content/commands/hatch3r-onboard.md +94 -3
  75. package/dist/content/commands/hatch3r-pack-install.md +243 -0
  76. package/dist/content/commands/hatch3r-pr-resolve.md +106 -23
  77. package/dist/content/commands/hatch3r-project-spec.md +82 -6
  78. package/dist/content/commands/hatch3r-quick-change.md +108 -13
  79. package/dist/content/commands/hatch3r-refactor-plan.md +78 -2
  80. package/dist/content/commands/hatch3r-release.md +401 -0
  81. package/dist/content/commands/hatch3r-revision.md +98 -12
  82. package/dist/content/commands/hatch3r-roadmap.md +92 -10
  83. package/dist/content/commands/hatch3r-security-audit.md +105 -5
  84. package/dist/content/commands/hatch3r-slo-scaffold.md +246 -0
  85. package/dist/content/commands/hatch3r-spec.md +216 -0
  86. package/dist/content/commands/hatch3r-test-plan.md +85 -9
  87. package/dist/content/commands/hatch3r-workflow.md +165 -41
  88. package/dist/content/commands/revision/revision-delegation.md +6 -5
  89. package/dist/content/commands/revision/revision-modes.md +49 -4
  90. package/dist/content/commands/revision/revision-quality.md +10 -7
  91. package/dist/content/commands/shared/orchestration-frame.md +119 -0
  92. package/dist/content/github-agents/hatch3r-docs-agent.md +21 -1
  93. package/dist/content/github-agents/hatch3r-lint-agent.md +21 -1
  94. package/dist/content/github-agents/hatch3r-security-agent.md +21 -1
  95. package/dist/content/github-agents/hatch3r-test-agent.md +21 -1
  96. package/dist/content/hooks/hatch3r-file-save.md +1 -1
  97. package/dist/content/hooks/hatch3r-pre-push.md +4 -4
  98. package/dist/content/hooks/hatch3r-review-loop-cap.md +52 -0
  99. package/dist/content/mcp/mcp.json +7 -5
  100. package/dist/content/rules/hatch3r-accessibility-standards.md +14 -2
  101. package/dist/content/rules/hatch3r-accessibility-standards.mdc +12 -1
  102. package/dist/content/rules/hatch3r-agent-orchestration-detail.md +58 -19
  103. package/dist/content/rules/hatch3r-agent-orchestration-detail.mdc +58 -19
  104. package/dist/content/rules/hatch3r-agent-orchestration.md +87 -213
  105. package/dist/content/rules/hatch3r-agent-orchestration.mdc +87 -213
  106. package/dist/content/rules/hatch3r-ai-evals.md +5 -4
  107. package/dist/content/rules/hatch3r-ai-evals.mdc +3 -3
  108. package/dist/content/rules/hatch3r-ai-ux-patterns.md +6 -2
  109. package/dist/content/rules/hatch3r-ai-ux-patterns.mdc +4 -1
  110. package/dist/content/rules/hatch3r-android-patterns.md +107 -0
  111. package/dist/content/rules/hatch3r-android-patterns.mdc +102 -0
  112. package/dist/content/rules/hatch3r-anti-duplication.md +115 -0
  113. package/dist/content/rules/hatch3r-anti-duplication.mdc +115 -0
  114. package/dist/content/rules/hatch3r-api-design.md +5 -1
  115. package/dist/content/rules/hatch3r-api-design.mdc +3 -0
  116. package/dist/content/rules/hatch3r-api-versioning.md +2 -1
  117. package/dist/content/rules/hatch3r-auth-patterns.md +3 -1
  118. package/dist/content/rules/hatch3r-auth-patterns.mdc +1 -0
  119. package/dist/content/rules/hatch3r-browser-verification.md +2 -0
  120. package/dist/content/rules/hatch3r-browser-verification.mdc +2 -0
  121. package/dist/content/rules/hatch3r-capability-matrix.md +108 -0
  122. package/dist/content/rules/hatch3r-capability-matrix.mdc +108 -0
  123. package/dist/content/rules/hatch3r-ci-cd.md +8 -1
  124. package/dist/content/rules/hatch3r-ci-cd.mdc +6 -0
  125. package/dist/content/rules/hatch3r-clarification-default.md +73 -0
  126. package/dist/content/rules/hatch3r-clarification-default.mdc +73 -0
  127. package/dist/content/rules/hatch3r-code-standards.md +23 -47
  128. package/dist/content/rules/hatch3r-code-standards.mdc +22 -46
  129. package/dist/content/rules/hatch3r-component-conventions.md +3 -0
  130. package/dist/content/rules/hatch3r-component-conventions.mdc +3 -0
  131. package/dist/content/rules/hatch3r-container-hardening.md +11 -2
  132. package/dist/content/rules/hatch3r-container-hardening.mdc +9 -1
  133. package/dist/content/rules/hatch3r-contract-testing.md +2 -1
  134. package/dist/content/rules/hatch3r-cost-visibility.md +135 -0
  135. package/dist/content/rules/hatch3r-cost-visibility.mdc +135 -0
  136. package/dist/content/rules/hatch3r-cq-rule-frame.md +54 -0
  137. package/dist/content/rules/hatch3r-cq-rule-frame.mdc +49 -0
  138. package/dist/content/rules/hatch3r-data-classification.md +3 -1
  139. package/dist/content/rules/hatch3r-data-classification.mdc +2 -1
  140. package/dist/content/rules/hatch3r-deep-context.md +13 -13
  141. package/dist/content/rules/hatch3r-deep-context.mdc +13 -13
  142. package/dist/content/rules/hatch3r-dependency-management.md +16 -3
  143. package/dist/content/rules/hatch3r-dependency-management.mdc +15 -3
  144. package/dist/content/rules/hatch3r-design-system-detection.md +2 -1
  145. package/dist/content/rules/hatch3r-dotnet-patterns.md +104 -0
  146. package/dist/content/rules/hatch3r-dotnet-patterns.mdc +99 -0
  147. package/dist/content/rules/hatch3r-edge-case-discipline.md +65 -0
  148. package/dist/content/rules/hatch3r-edge-case-discipline.mdc +65 -0
  149. package/dist/content/rules/hatch3r-enhancability.md +147 -0
  150. package/dist/content/rules/hatch3r-enhancability.mdc +142 -0
  151. package/dist/content/rules/hatch3r-event-schema-evolution.md +2 -1
  152. package/dist/content/rules/hatch3r-fan-out-discipline.md +91 -0
  153. package/dist/content/rules/hatch3r-fan-out-discipline.mdc +91 -0
  154. package/dist/content/rules/hatch3r-feature-flags.md +2 -0
  155. package/dist/content/rules/hatch3r-feature-flags.mdc +2 -0
  156. package/dist/content/rules/hatch3r-flutter-patterns.md +88 -0
  157. package/dist/content/rules/hatch3r-flutter-patterns.mdc +83 -0
  158. package/dist/content/rules/hatch3r-git-conventions.md +4 -1
  159. package/dist/content/rules/hatch3r-git-conventions.mdc +2 -0
  160. package/dist/content/rules/hatch3r-go-patterns.md +98 -0
  161. package/dist/content/rules/hatch3r-go-patterns.mdc +93 -0
  162. package/dist/content/rules/hatch3r-handoff-readiness.md +10 -0
  163. package/dist/content/rules/hatch3r-handoff-readiness.mdc +10 -0
  164. package/dist/content/rules/hatch3r-i18n.md +2 -0
  165. package/dist/content/rules/hatch3r-i18n.mdc +2 -0
  166. package/dist/content/rules/hatch3r-iteration-summary.md +75 -57
  167. package/dist/content/rules/hatch3r-iteration-summary.mdc +77 -54
  168. package/dist/content/rules/hatch3r-learning-system.md +202 -0
  169. package/dist/content/rules/hatch3r-learning-system.mdc +202 -0
  170. package/dist/content/rules/hatch3r-maintainability.md +157 -0
  171. package/dist/content/rules/hatch3r-maintainability.mdc +152 -0
  172. package/dist/content/rules/hatch3r-migrations.md +2 -1
  173. package/dist/content/rules/hatch3r-observability-logging.md +1 -1
  174. package/dist/content/rules/hatch3r-observability-metrics.md +1 -1
  175. package/dist/content/rules/hatch3r-observability-tracing.md +45 -36
  176. package/dist/content/rules/hatch3r-observability-tracing.mdc +44 -35
  177. package/dist/content/rules/hatch3r-operability.md +2 -1
  178. package/dist/content/rules/hatch3r-passkey-server.md +2 -1
  179. package/dist/content/rules/hatch3r-performance-budgets.md +2 -0
  180. package/dist/content/rules/hatch3r-performance-budgets.mdc +2 -0
  181. package/dist/content/rules/hatch3r-php-laravel-patterns.md +109 -0
  182. package/dist/content/rules/hatch3r-php-laravel-patterns.mdc +104 -0
  183. package/dist/content/rules/hatch3r-progressive-delivery.md +5 -1
  184. package/dist/content/rules/hatch3r-progressive-delivery.mdc +3 -0
  185. package/dist/content/rules/hatch3r-proof-model.md +131 -0
  186. package/dist/content/rules/hatch3r-proof-model.mdc +131 -0
  187. package/dist/content/rules/hatch3r-python-patterns.md +70 -0
  188. package/dist/content/rules/hatch3r-python-patterns.mdc +65 -0
  189. package/dist/content/rules/hatch3r-react-native-patterns.md +83 -0
  190. package/dist/content/rules/hatch3r-react-native-patterns.mdc +78 -0
  191. package/dist/content/rules/hatch3r-resilience-patterns.md +2 -1
  192. package/dist/content/rules/hatch3r-reviewer-calibration.md +84 -0
  193. package/dist/content/rules/hatch3r-reviewer-calibration.mdc +84 -0
  194. package/dist/content/rules/hatch3r-right-sizing.md +68 -0
  195. package/dist/content/rules/hatch3r-right-sizing.mdc +66 -0
  196. package/dist/content/rules/hatch3r-ruby-rails-patterns.md +111 -0
  197. package/dist/content/rules/hatch3r-ruby-rails-patterns.mdc +106 -0
  198. package/dist/content/rules/hatch3r-rust-patterns.md +107 -0
  199. package/dist/content/rules/hatch3r-rust-patterns.mdc +102 -0
  200. package/dist/content/rules/hatch3r-scalability.md +137 -0
  201. package/dist/content/rules/hatch3r-scalability.mdc +132 -0
  202. package/dist/content/rules/hatch3r-secrets-management.md +10 -1
  203. package/dist/content/rules/hatch3r-secrets-management.mdc +8 -0
  204. package/dist/content/rules/hatch3r-security-patterns.md +36 -34
  205. package/dist/content/rules/hatch3r-security-patterns.mdc +35 -34
  206. package/dist/content/rules/hatch3r-security.md +97 -0
  207. package/dist/content/rules/hatch3r-security.mdc +92 -0
  208. package/dist/content/rules/hatch3r-swiftui-patterns.md +98 -0
  209. package/dist/content/rules/hatch3r-swiftui-patterns.mdc +93 -0
  210. package/dist/content/rules/hatch3r-testability.md +115 -0
  211. package/dist/content/rules/hatch3r-testability.mdc +110 -0
  212. package/dist/content/rules/hatch3r-testing.md +4 -1
  213. package/dist/content/rules/hatch3r-testing.mdc +2 -0
  214. package/dist/content/rules/hatch3r-theming.md +2 -0
  215. package/dist/content/rules/hatch3r-theming.mdc +2 -0
  216. package/dist/content/rules/hatch3r-tool-currency.md +91 -0
  217. package/dist/content/rules/hatch3r-tool-currency.mdc +86 -0
  218. package/dist/content/rules/hatch3r-tooling-hierarchy.md +29 -31
  219. package/dist/content/rules/hatch3r-tooling-hierarchy.mdc +27 -30
  220. package/dist/content/rules/hatch3r-typescript-patterns.md +58 -0
  221. package/dist/content/rules/hatch3r-typescript-patterns.mdc +53 -0
  222. package/dist/content/rules/hatch3r-ux-states-and-flows.md +11 -4
  223. package/dist/content/rules/hatch3r-ux-states-and-flows.mdc +9 -3
  224. package/dist/content/skills/hatch3r-a11y-audit/SKILL.md +10 -8
  225. package/dist/content/skills/hatch3r-a11y-audit/references/manual-audit-checklist.md +7 -5
  226. package/dist/content/skills/hatch3r-adhoc-orchestrate/SKILL.md +131 -0
  227. package/dist/content/skills/hatch3r-ai-feature/SKILL.md +4 -6
  228. package/dist/content/skills/hatch3r-api-spec/SKILL.md +27 -2
  229. package/dist/content/skills/hatch3r-architecture-review/SKILL.md +4 -7
  230. package/dist/content/skills/hatch3r-board-groom/SKILL.md +11 -0
  231. package/dist/content/skills/hatch3r-board-init/SKILL.md +17 -1
  232. package/dist/content/skills/hatch3r-board-refresh/SKILL.md +12 -1
  233. package/dist/content/skills/hatch3r-board-shared/SKILL.md +38 -1
  234. package/dist/content/skills/hatch3r-browser-verify/SKILL.md +307 -0
  235. package/dist/content/skills/hatch3r-bug-fix/SKILL.md +15 -2
  236. package/dist/content/skills/hatch3r-ci-pipeline/SKILL.md +17 -7
  237. package/dist/content/skills/hatch3r-cli-fd/SKILL.md +33 -1
  238. package/dist/content/skills/hatch3r-cli-fzf/SKILL.md +33 -1
  239. package/dist/content/skills/hatch3r-cli-gh/SKILL.md +50 -1
  240. package/dist/content/skills/hatch3r-cli-jq/SKILL.md +40 -6
  241. package/dist/content/skills/hatch3r-cli-ripgrep/SKILL.md +33 -1
  242. package/dist/content/skills/hatch3r-cli-toolbox/SKILL.md +130 -23
  243. package/dist/content/skills/hatch3r-containerize/SKILL.md +157 -0
  244. package/dist/content/skills/hatch3r-context-health/SKILL.md +9 -7
  245. package/dist/content/skills/hatch3r-cost-tracking/SKILL.md +37 -17
  246. package/dist/content/skills/hatch3r-customize/SKILL.md +5 -8
  247. package/dist/content/skills/hatch3r-dep-audit/SKILL.md +23 -7
  248. package/dist/content/skills/hatch3r-design-system-detect/SKILL.md +3 -7
  249. package/dist/content/skills/hatch3r-docs-writing/SKILL.md +159 -0
  250. package/dist/content/skills/hatch3r-enhancability-verify/SKILL.md +152 -0
  251. package/dist/content/skills/hatch3r-feature/SKILL.md +53 -3
  252. package/dist/content/skills/hatch3r-feedback/SKILL.md +103 -0
  253. package/dist/content/skills/hatch3r-gh-agentic-workflows/SKILL.md +10 -8
  254. package/dist/content/skills/hatch3r-handoff-prepare/SKILL.md +4 -7
  255. package/dist/content/skills/hatch3r-handoff-resume/SKILL.md +4 -7
  256. package/dist/content/{commands/hatch3r-hooks.md → skills/hatch3r-hooks/SKILL.md} +48 -137
  257. package/dist/content/skills/hatch3r-incident-response/SKILL.md +66 -7
  258. package/dist/content/skills/hatch3r-issue-workflow/SKILL.md +11 -0
  259. package/dist/content/skills/hatch3r-learn/SKILL.md +317 -0
  260. package/dist/content/skills/hatch3r-logical-refactor/SKILL.md +6 -7
  261. package/dist/content/skills/hatch3r-maintainability-verify/SKILL.md +146 -0
  262. package/dist/content/skills/hatch3r-migration/SKILL.md +8 -7
  263. package/dist/content/skills/hatch3r-observability-verify/SKILL.md +17 -12
  264. package/dist/content/skills/hatch3r-perf-audit/SKILL.md +13 -9
  265. package/dist/content/skills/hatch3r-pr-creation/SKILL.md +4 -7
  266. package/dist/content/skills/hatch3r-qa-validation/SKILL.md +6 -5
  267. package/dist/content/skills/hatch3r-recipe/SKILL.md +63 -60
  268. package/dist/content/skills/hatch3r-refactor/SKILL.md +6 -7
  269. package/dist/content/skills/hatch3r-release/SKILL.md +123 -11
  270. package/dist/content/skills/hatch3r-reliability-verify/SKILL.md +9 -5
  271. package/dist/content/{commands/hatch3r-report.md → skills/hatch3r-report/SKILL.md} +20 -17
  272. package/dist/content/skills/hatch3r-scalability-verify/SKILL.md +145 -0
  273. package/dist/content/skills/hatch3r-security-verify/SKILL.md +144 -0
  274. package/dist/content/skills/hatch3r-team-convention-author/SKILL.md +126 -0
  275. package/dist/content/skills/hatch3r-testability-verify/SKILL.md +147 -0
  276. package/dist/content/skills/hatch3r-ui-ux-verify/SKILL.md +19 -11
  277. package/dist/content/skills/hatch3r-visual-refactor/SKILL.md +11 -7
  278. package/package.json +50 -31
  279. package/dist/cli/index.d.ts +0 -2
  280. package/dist/cli/index.js.map +0 -1
  281. package/dist/content/agents/hatch3r-a11y-auditor.md +0 -159
  282. package/dist/content/agents/hatch3r-dependency-auditor.md +0 -219
  283. package/dist/content/agents/hatch3r-perf-profiler.md +0 -166
  284. package/dist/content/agents/hatch3r-security-auditor.md +0 -180
  285. package/dist/content/agents/hatch3r-test-writer.md +0 -171
  286. package/dist/content/commands/hatch3r-learn.md +0 -312
  287. package/dist/content/rules/hatch3r-learning-consult.md +0 -42
  288. package/dist/content/rules/hatch3r-learning-consult.mdc +0 -38
@@ -0,0 +1,93 @@
1
+ ---
2
+ description: SwiftUI and Swift conventions covering Swift 6 concurrency, @Observable + @Bindable, navigation stacks, Swift Package Manager, modular architecture, and XCTest
3
+ globs: ["**/*.swift", "**/*.swiftinterface", "**/Package.swift", "**/Package.resolved", "**/*.xcodeproj/**", "**/*.xcworkspace/**", "**/Info.plist", "**/*.entitlements", "**/Tuist/**", "**/Project.swift", "**/Workspace.swift", "**/ios/**", "**/macos/**", "**/visionOS/**", "**/watchOS/**", "**/tvOS/**"]
4
+ alwaysApply: false
5
+ ---
6
+ # SwiftUI Patterns
7
+
8
+ **Pillars:** P2 (Scientific & Practical Quality), CQ8 (Maintainability Quality)
9
+
10
+ > Applies when the project ships a SwiftUI/UIKit app or Swift package. Detection signals: `Package.swift`, `*.xcodeproj`, `*.xcworkspace`, or `*.swift` files at repo root.
11
+
12
+ ## Swift Language Floor
13
+
14
+ - Target Swift 6.0+ with strict concurrency checking enabled (`SWIFT_STRICT_CONCURRENCY=complete`). Data-race-safety is the default; opt-out (`@unchecked Sendable`) requires a code comment justifying thread-safety reasoning.
15
+ - Adopt `async/await` throughout. Wrap legacy completion-handler APIs with `withCheckedThrowingContinuation` at the boundary; do not propagate completion-handler signatures into new code.
16
+ - Use `Sendable` conformance for types crossing actor boundaries. `actor` for shared mutable state; `MainActor`-isolated types for UI state.
17
+ - Strict typing: no `Any` outside of bridging code. Prefer `some Protocol` (opaque return types) over existential `any Protocol` when the concrete type is known at compile time.
18
+
19
+ ## SwiftUI App Architecture
20
+
21
+ - Use `@Observable` macro (Swift 5.9+) for view-model state classes; `@Bindable` for two-way binding in views. `ObservableObject` + `@Published` is legacy — migrate during regular refactors.
22
+ - Pick ONE app-state pattern per app and document it in `docs/architecture.md`:
23
+ - **MV (Model–View) with `@Observable`** — recommended default. View-models are simple `@Observable` classes; views observe by reference.
24
+ - **TCA (The Composable Architecture)** — when the team wants unidirectional data flow with reducers + effects.
25
+ - **MVVM with Combine** — when the team already has heavy Combine investment. Avoid in greenfield code.
26
+ - View body is a pure function of state. Never perform side effects in `body`; use `.task { ... }` or `.onChange(of:) { ... }` modifiers.
27
+ - Compose small `View` types — a view exceeding 200 lines is a refactor signal. Extract subviews and use `@ViewBuilder` for conditional content.
28
+
29
+ ## Navigation
30
+
31
+ - Use `NavigationStack` (iOS 16+) with path-driven navigation: bind a `[Destination]` path to the stack and push routes by appending to the array. `NavigationView` is deprecated — migrate.
32
+ - Type the navigation destination via `navigationDestination(for:)` modifiers. Avoid `NavigationLink(destination:)` for stack-pushed views — it bypasses path binding.
33
+ - Deep links: parse incoming URLs in the `.onOpenURL { ... }` modifier on the root view and update the navigation path. Test universal links on a real device — simulators do not honor associated-domains entitlements reliably.
34
+ - Sheets and popovers via `.sheet(item:)` with an `Identifiable` payload — never pass a `Bool` and a separate state variable.
35
+
36
+ ## Concurrency
37
+
38
+ - Long-running work: `Task { ... }` for fire-and-forget, `await Task { ... }.value` for cancelable async work. Always check `Task.isCancelled` inside loops.
39
+ - Detached tasks (`Task.detached`) only when you need to escape MainActor isolation; document why in a comment. They inherit no priority or actor isolation.
40
+ - `TaskGroup` for parallel fan-out: prefer `withThrowingTaskGroup` for error propagation. Limit concurrency explicitly (`group.addTask` with a semaphore) when the workload could overload the network or disk.
41
+ - Use AsyncStream / AsyncSequence for event streams. Wrap delegate-based APIs (CLLocationManager, etc.) with `AsyncStream.makeStream(of:)` rather than maintaining ad-hoc callback caches.
42
+
43
+ ## Modular Architecture
44
+
45
+ - Swift Package Manager (SPM) is the dependency floor. Vendor packages via local Swift packages, not CocoaPods or Carthage (both in maintenance for new projects).
46
+ - Project structure (Tuist or hand-rolled):
47
+ - `App/` — main app target (UI + composition root only).
48
+ - `Features/<Feature>/` — feature modules, each its own SwiftPM target.
49
+ - `Core/` — shared utilities, networking, persistence.
50
+ - Each feature module exports a public API via `public` types; everything else is `internal`. Cross-feature imports go through `Core/` interfaces.
51
+ - Tuist (`Project.swift`, `Workspace.swift`) for multi-target projects above 5 modules. Hand-managed `.xcodeproj` files are merge-conflict prone — Tuist regenerates them deterministically.
52
+
53
+ ## Performance
54
+
55
+ - Profile with Instruments (Time Profiler, Allocations, SwiftUI). Target 60fps on the oldest supported device class.
56
+ - Avoid heavy work in `View.body`. Cache derived values with `@State` initialized via `init` or compute once in `.task { ... }`.
57
+ - Lists: `List` with stable `Identifiable` IDs and `id: \.id` explicit key paths. Use `LazyVStack` inside `ScrollView` for non-Sectioned lists.
58
+ - Images: `AsyncImage` for network images, `Image(systemName:)` for SF Symbols. For high-frequency reload, use `nuke` or `Kingfisher` with disk cache configured.
59
+ - View identity: stable IDs prevent SwiftUI from re-creating views on every state change. `ForEach(items, id: \.id)` — never use `ForEach(items.indices)` for mutable arrays.
60
+
61
+ ## Accessibility
62
+
63
+ - Every interactive view has an `.accessibilityLabel(_:)`, `.accessibilityHint(_:)`, and an appropriate `.accessibilityIdentifier(_:)` for UI tests.
64
+ - Group decorative views with `.accessibilityElement(children: .ignore)` so VoiceOver does not stop on every visual element.
65
+ - Dynamic Type: prefer `.font(.body)` and the semantic font modifiers over fixed-point sizes. Test with the largest accessibility size (`accessibility5`).
66
+ - Reduced Motion: gate animations on `@Environment(\.accessibilityReduceMotion)` — disable parallax, springy bounces, and decorative transitions when set.
67
+
68
+ ## Testing
69
+
70
+ - Unit tests with XCTest (`*Tests/`). Use `swift-testing` (Swift 6) for new test suites when you need parameterized tests, traits, or parallel execution semantics.
71
+ - UI tests with XCUITest under `*UITests/`. Use accessibility identifiers for query stability — never use text labels for selectors.
72
+ - Snapshot tests via `swift-snapshot-testing` (pointfreeco) for SwiftUI view regressions. Configure per-device snapshots in CI.
73
+ - Mock HTTP with `URLProtocol` subclass or `swift-openapi-generator` mock transport. Never hit real network in unit tests.
74
+
75
+ ## Builds & Distribution
76
+
77
+ - Sign with App Store Connect API keys, not Apple ID password. Configure via `xcrun altool --apiKey` or fastlane `app_store_connect_api_key`.
78
+ - Bitcode is removed (Xcode 14+) — do not enable. dSYM archive every release for crash symbolication; upload to Crashlytics / Sentry / TestFlight automatically in CI.
79
+ - App size: enable `SWIFT_OPTIMIZATION_LEVEL=-O` for release builds. Track size via `xcodebuild -resultBundlePath` JSON output in CI.
80
+ - TestFlight for beta distribution. Use external groups for QA, internal groups for engineering — never share builds via plain `.ipa` files.
81
+
82
+ ## References
83
+
84
+ - Swift 6 concurrency: https://www.swift.org/migration/documentation/migrationguide/ (accessed 2026-05-27, official-docs)
85
+ - SwiftUI `@Observable`: https://developer.apple.com/documentation/observation (accessed 2026-05-27, official-docs)
86
+ - NavigationStack: https://developer.apple.com/documentation/swiftui/navigationstack (accessed 2026-05-27, official-docs)
87
+ - swift-testing: https://developer.apple.com/xcode/swift-testing/ (accessed 2026-05-27, official-docs)
88
+
89
+ ## Cross-References
90
+
91
+ - `rules/hatch3r-component-conventions.md` — four-state surface contract maps to SwiftUI `phase`-based async views.
92
+ - `rules/hatch3r-testing.md` — coverage thresholds and determinism rules apply to XCTest / swift-testing.
93
+ - `rules/hatch3r-accessibility-standards.md` — WCAG mapping for SwiftUI `accessibility*` modifiers.
@@ -0,0 +1,115 @@
1
+ ---
2
+ id: hatch3r-testability-rule
3
+ type: rule
4
+ description: CQ5 Testability Quality measurement rule — per-feature test-class mandate map, real-deal ratio floor, AI eval coverage, mutation kill rate, specialist routing to hatch3r-testability
5
+ scope: conditional
6
+ globs: "src/**,**/__tests__/**,**/tests/**,**/test/**,**/*.test.*,**/*.spec.*,**/vitest.config.*,**/jest.config.*,**/cypress.config.*"
7
+ tags: [review, testing, floor:content-quality]
8
+ precedence: high
9
+ quality_charter: agents/shared/quality-charter.md
10
+ cache_friendly: true
11
+ ---
12
+ # Testability Quality (CQ5)
13
+
14
+ **Pillars:** P2 (Scientific & Practical Quality), CQ5 (Testability Quality)
15
+
16
+ ## Scope
17
+
18
+ This rule binds the CQ5 measurement set across end-user code that hatch3r generates AND the framework's own test tree. It complements (does not duplicate) `rules/hatch3r-testing.md` (broad coverage + determinism + flaky-test policy). This rule owns:
19
+
20
+ - The per-feature test-class mandate map.
21
+ - The real-deal-first ratio floor.
22
+ - The AI feature eval coverage gate.
23
+ - The mutation-kill-rate gate on critical paths.
24
+ - Specialist routing to `agents/hatch3r-testability.md` (CQ5 reviewer / gate + test authoring).
25
+
26
+ ## Per-Feature Test-Class Mandate Map
27
+
28
+ Source: pillar CQ5 (see `agents/shared/principles.md`) + `rules/hatch3r-testing.md` mandate table. Every changed feature is classified, and the mandated test class MUST be present. Missing the mandated class is a CRITICAL finding from the specialist.
29
+
30
+ | Feature class | Mandated test class | Tooling per ecosystem |
31
+ |---------------|---------------------|-----------------------|
32
+ | Parser (input deserialization, file format, protocol) | Fuzz | jazzer.js (JS), libfuzzer (Rust), atheris (Python), Jazzer (JVM) |
33
+ | Payment (settlement, refund, ledger) | Mutation | Stryker (JS/TS), Pitest (JVM), mutmut (Python), mutpy (Python) |
34
+ | RPC boundary (gRPC, GraphQL, REST consumer/provider) | Contract | Pact (cross-language), Schemathesis (OpenAPI), buf curl (protobuf) |
35
+ | State machine (workflow, transition graph) | Property | fast-check (JS/TS), Hypothesis (Python), ScalaCheck (JVM) |
36
+ | UI (component, page render) | Visual regression | Playwright with toHaveScreenshot, Percy, Chromatic, Loki |
37
+ | AI feature (prompt-driven, model-driven) | Golden + adversarial + regression eval | Inspect AI, promptfoo, Anthropic Workbench evals, Braintrust |
38
+
39
+ ## Real-Deal-First Ratio
40
+
41
+ The floor: ≥80% of integration tests use real services (test database, in-process emulator, sandboxed external API) rather than mocks. Mocks are admitted only with a `// MOCK: <reason>` comment naming a specific reason from this allowlist:
42
+
43
+ - `// MOCK: External service has no sandbox (vendor confirmed)`
44
+ - `// MOCK: Network unreachable in CI (offline build)`
45
+ - `// MOCK: Time-source isolation (controlled clock)`
46
+ - `// MOCK: Side-effect quarantine (irreversible operation)`
47
+ - `// MOCK: Performance budget (test pack must run <5min)`
48
+
49
+ Reasons outside the allowlist fail the audit-checklist item 2. Framework-level mock helpers (`vi.mock`, `jest.mock`, `unittest.mock.patch`, `mockito.when`) are detected by import-statement grep against the per-language pattern map.
50
+
51
+ ## AI Feature Eval Coverage
52
+
53
+ Every AI feature surface (prompt-driven, model-driven, agent-driven) MUST carry three eval sets per `rules/hatch3r-ai-evals.md`, at 100% coverage:
54
+
55
+ - **Golden set** — known-good inputs with expected outputs; regression marker on every model/prompt change.
56
+ - **Adversarial set** — prompt injections, boundary inputs, malformed payloads; verifies refusal + safe-failure behavior.
57
+ - **Regression set** — historical bug reproductions; ensures fixed bugs stay fixed.
58
+
59
+ CI wires the evals on prompt/model changes; the CI gate exits non-zero on regression. Hallucination is tracked as an SLI per Anthropic engineering guidance (cited under References on the source rule).
60
+
61
+ ## Mutation Kill Rate
62
+
63
+ On critical paths (payment, auth, anything labelled `critical` per maturity tier), the mutation kill-rate floor is read from repo config (not from this rule's defaults). Default per-tier floors per CONSTITUTION §6 Decision 4:
64
+
65
+ | Tier | Mutation kill-rate floor on critical paths |
66
+ |------|--------------------------------------------|
67
+ | solo | Not required |
68
+ | team | ≥60% |
69
+ | scaleup | ≥75% |
70
+ | enterprise | ≥85% |
71
+
72
+ Tier escalation raises the floor; the previous baseline does not survive without re-measurement. Out-of-cycle floor changes require a documented baseline reset to keep wave-to-wave comparison valid.
73
+
74
+ ## Specialist Agent Routing
75
+
76
+ | Trigger | Route to |
77
+ |---------|----------|
78
+ | Test code added, modified, or removed | `agents/hatch3r-testability.md` (CQ5 reviewer / gate) |
79
+ | New feature in a mandate-map class needs test authoring | `agents/hatch3r-testability.md` (author + gate) |
80
+ | Coverage threshold or test-runner config modified | `agents/hatch3r-testability.md` |
81
+ | AI feature surface added or model/prompt change | `agents/hatch3r-testability.md` + `rules/hatch3r-ai-evals.md` |
82
+ | Mutation kill-rate floor change proposed | `agents/hatch3r-testability.md` with baseline-reset documentation |
83
+
84
+ The CQ5 specialist authors mandated tests, reviews coverage, and gates releases; `agents/hatch3r-testability.md` writes tests AND measures mandate compliance, blocking releases that miss the floor.
85
+
86
+ ## Per-Finding Output Format
87
+
88
+ 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>` = CQ5. The `proof_trace` excerpt is the test-file:line citation + runner-output for the measurement that produced the finding.
89
+
90
+ ## Severity Mapping
91
+
92
+ 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`. CQ5 Action per status:
93
+
94
+ - `CRITICAL`: Block release on mandate-map miss OR AI-eval-coverage <100%.
95
+ - `FINDINGS`: Block merge on real-deal-ratio drop, coverage threshold miss, mutation kill-rate floor breach, or unowned flaky test.
96
+ - `PASS`: Surface in iteration summary.
97
+
98
+ ## When to Invoke
99
+
100
+ - Every PR that modifies test code, removes tests, or introduces a feature in a mandate-map class.
101
+ - Every Implementer pre-write check — confirms the mandated test class before writing so `agents/hatch3r-testability.md` produces the right shape on first pass.
102
+ - Every Verifier pre-merge gate immediately before `gh pr merge` on protected branches; status must be PASS to allow merge on auth/payment paths.
103
+ - D03 or D22 audit cycles, and any maturity-tier escalation per `hatch3r config maturity`.
104
+ - AI feature release gate before a prompt/model bump ships to production traffic.
105
+ - Quarterly audit on real-deal ratio drift — even with no PRs to test code, mock accretion over time silently degrades the ratio against the 80% floor.
106
+
107
+ ## References
108
+
109
+ - Pillar CQ5 (measurement set + specialist owner; see `agents/shared/principles.md`).
110
+ - The test-coverage-quality audit domain (testability domain).
111
+ - `agents/hatch3r-testability.md` (CQ5 reviewer / gate).
112
+ - `agents/hatch3r-testability.md` (CQ5 test-authoring + gate agent — single owner).
113
+ - `rules/hatch3r-testing.md` (broad coverage + determinism + flaky policy).
114
+ - `rules/hatch3r-ai-evals.md` (golden + adversarial + regression eval requirements).
115
+ - `rules/hatch3r-contract-testing.md` (Pact + Schemathesis pattern).
@@ -0,0 +1,110 @@
1
+ ---
2
+ description: CQ5 Testability Quality measurement rule — per-feature test-class mandate map, real-deal ratio floor, AI eval coverage, mutation kill rate, specialist routing to hatch3r-testability
3
+ globs: ["src/**", "**/__tests__/**", "**/tests/**", "**/test/**", "**/*.test.*", "**/*.spec.*", "**/vitest.config.*", "**/jest.config.*", "**/cypress.config.*"]
4
+ alwaysApply: false
5
+ precedence: high
6
+ ---
7
+ # Testability Quality (CQ5)
8
+
9
+ **Pillars:** P2 (Scientific & Practical Quality), CQ5 (Testability Quality)
10
+
11
+ ## Scope
12
+
13
+ This rule binds the CQ5 measurement set across end-user code that hatch3r generates AND the framework's own test tree. It complements (does not duplicate) `rules/hatch3r-testing.md` (broad coverage + determinism + flaky-test policy). This rule owns:
14
+
15
+ - The per-feature test-class mandate map.
16
+ - The real-deal-first ratio floor.
17
+ - The AI feature eval coverage gate.
18
+ - The mutation-kill-rate gate on critical paths.
19
+ - Specialist routing to `agents/hatch3r-testability.md` (CQ5 reviewer / gate + test authoring).
20
+
21
+ ## Per-Feature Test-Class Mandate Map
22
+
23
+ Source: pillar CQ5 (see `agents/shared/principles.md`) + `rules/hatch3r-testing.md` mandate table. Every changed feature is classified, and the mandated test class MUST be present. Missing the mandated class is a CRITICAL finding from the specialist.
24
+
25
+ | Feature class | Mandated test class | Tooling per ecosystem |
26
+ |---------------|---------------------|-----------------------|
27
+ | Parser (input deserialization, file format, protocol) | Fuzz | jazzer.js (JS), libfuzzer (Rust), atheris (Python), Jazzer (JVM) |
28
+ | Payment (settlement, refund, ledger) | Mutation | Stryker (JS/TS), Pitest (JVM), mutmut (Python), mutpy (Python) |
29
+ | RPC boundary (gRPC, GraphQL, REST consumer/provider) | Contract | Pact (cross-language), Schemathesis (OpenAPI), buf curl (protobuf) |
30
+ | State machine (workflow, transition graph) | Property | fast-check (JS/TS), Hypothesis (Python), ScalaCheck (JVM) |
31
+ | UI (component, page render) | Visual regression | Playwright with toHaveScreenshot, Percy, Chromatic, Loki |
32
+ | AI feature (prompt-driven, model-driven) | Golden + adversarial + regression eval | Inspect AI, promptfoo, Anthropic Workbench evals, Braintrust |
33
+
34
+ ## Real-Deal-First Ratio
35
+
36
+ The floor: ≥80% of integration tests use real services (test database, in-process emulator, sandboxed external API) rather than mocks. Mocks are admitted only with a `// MOCK: <reason>` comment naming a specific reason from this allowlist:
37
+
38
+ - `// MOCK: External service has no sandbox (vendor confirmed)`
39
+ - `// MOCK: Network unreachable in CI (offline build)`
40
+ - `// MOCK: Time-source isolation (controlled clock)`
41
+ - `// MOCK: Side-effect quarantine (irreversible operation)`
42
+ - `// MOCK: Performance budget (test pack must run <5min)`
43
+
44
+ Reasons outside the allowlist fail the audit-checklist item 2. Framework-level mock helpers (`vi.mock`, `jest.mock`, `unittest.mock.patch`, `mockito.when`) are detected by import-statement grep against the per-language pattern map.
45
+
46
+ ## AI Feature Eval Coverage
47
+
48
+ Every AI feature surface (prompt-driven, model-driven, agent-driven) MUST carry three eval sets per `rules/hatch3r-ai-evals.md`, at 100% coverage:
49
+
50
+ - **Golden set** — known-good inputs with expected outputs; regression marker on every model/prompt change.
51
+ - **Adversarial set** — prompt injections, boundary inputs, malformed payloads; verifies refusal + safe-failure behavior.
52
+ - **Regression set** — historical bug reproductions; ensures fixed bugs stay fixed.
53
+
54
+ CI wires the evals on prompt/model changes; the CI gate exits non-zero on regression. Hallucination is tracked as an SLI per Anthropic engineering guidance (cited under References on the source rule).
55
+
56
+ ## Mutation Kill Rate
57
+
58
+ On critical paths (payment, auth, anything labelled `critical` per maturity tier), the mutation kill-rate floor is read from repo config (not from this rule's defaults). Default per-tier floors per CONSTITUTION §6 Decision 4:
59
+
60
+ | Tier | Mutation kill-rate floor on critical paths |
61
+ |------|--------------------------------------------|
62
+ | solo | Not required |
63
+ | team | ≥60% |
64
+ | scaleup | ≥75% |
65
+ | enterprise | ≥85% |
66
+
67
+ Tier escalation raises the floor; the previous baseline does not survive without re-measurement. Out-of-cycle floor changes require a documented baseline reset to keep wave-to-wave comparison valid.
68
+
69
+ ## Specialist Agent Routing
70
+
71
+ | Trigger | Route to |
72
+ |---------|----------|
73
+ | Test code added, modified, or removed | `agents/hatch3r-testability.md` (CQ5 reviewer / gate) |
74
+ | New feature in a mandate-map class needs test authoring | `agents/hatch3r-testability.md` (author + gate) |
75
+ | Coverage threshold or test-runner config modified | `agents/hatch3r-testability.md` |
76
+ | AI feature surface added or model/prompt change | `agents/hatch3r-testability.md` + `rules/hatch3r-ai-evals.md` |
77
+ | Mutation kill-rate floor change proposed | `agents/hatch3r-testability.md` with baseline-reset documentation |
78
+
79
+ The CQ5 specialist authors mandated tests, reviews coverage, and gates releases; `agents/hatch3r-testability.md` writes tests AND measures mandate compliance, blocking releases that miss the floor.
80
+
81
+ ## Per-Finding Output Format
82
+
83
+ 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>` = CQ5. The `proof_trace` excerpt is the test-file:line citation + runner-output for the measurement that produced the finding.
84
+
85
+ ## Severity Mapping
86
+
87
+ 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`. CQ5 Action per status:
88
+
89
+ - `CRITICAL`: Block release on mandate-map miss OR AI-eval-coverage <100%.
90
+ - `FINDINGS`: Block merge on real-deal-ratio drop, coverage threshold miss, mutation kill-rate floor breach, or unowned flaky test.
91
+ - `PASS`: Surface in iteration summary.
92
+
93
+ ## When to Invoke
94
+
95
+ - Every PR that modifies test code, removes tests, or introduces a feature in a mandate-map class.
96
+ - Every Implementer pre-write check — confirms the mandated test class before writing so `agents/hatch3r-testability.md` produces the right shape on first pass.
97
+ - Every Verifier pre-merge gate immediately before `gh pr merge` on protected branches; status must be PASS to allow merge on auth/payment paths.
98
+ - D03 or D22 audit cycles, and any maturity-tier escalation per `hatch3r config maturity`.
99
+ - AI feature release gate before a prompt/model bump ships to production traffic.
100
+ - Quarterly audit on real-deal ratio drift — even with no PRs to test code, mock accretion over time silently degrades the ratio against the 80% floor.
101
+
102
+ ## References
103
+
104
+ - Pillar CQ5 (measurement set + specialist owner; see `agents/shared/principles.md`).
105
+ - The test-coverage-quality audit domain (testability domain).
106
+ - `agents/hatch3r-testability.md` (CQ5 reviewer / gate).
107
+ - `agents/hatch3r-testability.md` (CQ5 test-authoring + gate agent — single owner).
108
+ - `rules/hatch3r-testing.md` (broad coverage + determinism + flaky policy).
109
+ - `rules/hatch3r-ai-evals.md` (golden + adversarial + regression eval requirements).
110
+ - `rules/hatch3r-contract-testing.md` (Pact + Schemathesis pattern).
@@ -2,7 +2,8 @@
2
2
  id: hatch3r-testing
3
3
  type: rule
4
4
  description: Coverage thresholds, mocking strategy, property-based testing, mutation-score targets, flaky test quarantine, and snapshot test discipline
5
- scope: "**/*.test.*,**/*.spec.*,**/__tests__/**,**/tests/**,**/test/**,**/*.cy.*,**/playwright/**,**/vitest.config.*,**/jest.config.*,**/cypress.config.*"
5
+ scope: conditional
6
+ globs: "**/*.test.*,**/*.spec.*,**/__tests__/**,**/tests/**,**/test/**,**/*.cy.*,**/playwright/**,**/vitest.config.*,**/jest.config.*,**/cypress.config.*"
6
7
  tags: [review, orchestration]
7
8
  precedence: high
8
9
  quality_charter: agents/shared/quality-charter.md
@@ -187,6 +188,8 @@ Reviewers verify each PR satisfies the required test classes for the code class
187
188
  | LLM feature | eval (via `hatch3r-ai-feature`) + unit on adapter + integration on fallback chain |
188
189
  | Background job | unit + integration with poison-message handling |
189
190
 
191
+ Each edge case enumerated per `rules/hatch3r-edge-case-discipline.md` (and the Edge-Case Ledger from `agents/hatch3r-edge-case-analyst.md`) maps to a required test class in the mandate map above — a feature whose suite exercises only the happy path is a coverage gap.
192
+
190
193
  ## References
191
194
 
192
195
  - Stryker (mutation testing): https://stryker-mutator.io/
@@ -183,6 +183,8 @@ Reviewers verify each PR satisfies the required test classes for the code class
183
183
  | LLM feature | eval (via `hatch3r-ai-feature`) + unit on adapter + integration on fallback chain |
184
184
  | Background job | unit + integration with poison-message handling |
185
185
 
186
+ Each edge case enumerated per `rules/hatch3r-edge-case-discipline.md` (and the Edge-Case Ledger from `agents/hatch3r-edge-case-analyst.md`) maps to a required test class in the mandate map above — a feature whose suite exercises only the happy path is a coverage gap.
187
+
186
188
  ## References
187
189
 
188
190
  - Stryker (mutation testing): https://stryker-mutator.io/
@@ -10,6 +10,8 @@ cache_friendly: true
10
10
  ---
11
11
  # Theming & Dark Mode
12
12
 
13
+ **Pillars:** P2 (Scientific & Practical Quality), CQ1 (UI Quality)
14
+
13
15
  ## Color System
14
16
 
15
17
  - Define all colors as semantic CSS custom properties (`--color-surface`, `--color-text-primary`, `--color-text-secondary`, `--color-border`, `--color-brand`, `--color-error`, `--color-success`, `--color-warning`).
@@ -5,6 +5,8 @@ alwaysApply: false
5
5
  ---
6
6
  # Theming & Dark Mode
7
7
 
8
+ **Pillars:** P2 (Scientific & Practical Quality), CQ1 (UI Quality)
9
+
8
10
  ## Color System
9
11
 
10
12
  - Define all colors as semantic CSS custom properties (`--color-surface`, `--color-text-primary`, `--color-text-secondary`, `--color-border`, `--color-brand`, `--color-error`, `--color-success`, `--color-warning`).
@@ -0,0 +1,91 @@
1
+ ---
2
+ id: hatch3r-tool-currency
3
+ type: rule
4
+ description: CLI-tool version pinning, vendor-release research cadence (≤90 days), CVE feed acknowledgement (≤90 days), and release-readiness gate for any new tool added to src/cliTools/
5
+ scope: conditional
6
+ globs: "src/cliTools/**,skills/hatch3r-cli-*/SKILL.md,.audit-workspace/**"
7
+ tags: [security, currency, maintenance]
8
+ precedence: high
9
+ quality_charter: agents/shared/quality-charter.md
10
+ cache_friendly: true
11
+ ---
12
+ # CLI Tool Currency
13
+
14
+ **Pillars:** P3 (Adapter & External Tool Currency), CQ3 (Security Quality)
15
+
16
+ ## Scope
17
+
18
+ This rule binds every CLI tool entry in `src/cliTools/registry.ts::AVAILABLE_CLI_TOOLS` and every per-tool skill under `skills/hatch3r-cli-{id}/SKILL.md`. Tier-1 entries are unconditionally installed; tier-2 entries are conditional per `src/cliTools/triggers.ts`; tier-3 entries are user-opt-in. The currency policy below applies tier-wide; only the staleness threshold varies per tier.
19
+
20
+ ## Vendor-Release Research Cadence
21
+
22
+ Source of truth: pillar P3 (see `agents/shared/principles.md`) — "vendor changelogs ≤12 months old, CVE feeds ≤90 days old, staleness >90 days for any tier-1 tool is a Medium finding". The CLI-tooling-recency audit domain owns the per-cycle verification.
23
+
24
+ Per-cycle research-date promotion is required for every tool listed in the registry. The audit workspace `.audit-workspace/current-insights.json::d21_tool_research_dates.{tool_id}` must carry an ISO date ≤90 days from cycle start. Records >120 days from cycle start trigger a regression-gate failure per the audit Regression Gates table.
25
+
26
+ | Tier | Staleness threshold | Action on breach |
27
+ |------|---------------------|------------------|
28
+ | Tier 1 (unconditional, e.g. `ripgrep`, `fd`, `jq`, `gh`, `delta`) | 90 days | Medium finding; block cycle close until research-date updated |
29
+ | Tier 2 (conditional, e.g. `qsv`, `playwright`, `duckdb`) | 120 days | Medium finding when trigger fires; Info otherwise |
30
+ | Tier 3 (opt-in) | 180 days | Low finding; surface for cycle backlog |
31
+
32
+ ## CVE Feed Acknowledgement
33
+
34
+ Every cycle MUST inspect the upstream advisory feed for each registered tool:
35
+
36
+ - GitHub Security Advisories (`https://github.com/{owner}/{repo}/security/advisories`) — primary feed for tools published on GitHub.
37
+ - NVD CVE feed (`https://nvd.nist.gov/vuln/search/results?form_type=Basic&search_type=all&query={tool}`) — backstop for non-GitHub tools.
38
+ - Vendor security mailing lists where the vendor publishes there in preference to GHSA (e.g. `oss-security@lists.openwall.com`).
39
+
40
+ The `securityNote` field on the registry entry MUST be populated when an unfixed advisory ≤90 days old applies, with the GHSA-id and required mitigation. Existing examples to mirror: `jq` (advisory roster on `jqlang/jq`), `gh` (GHSA-crc3-h8v6-qh57 pre-2.92.0). Missing CVE check is a High finding per CONSTITUTION §2 P3.
41
+
42
+ ## Version Pinning Policy
43
+
44
+ Registry entries declare install commands per OS / package manager (`brew`, `apt`, `scoop`, `cargo`, etc.). The pinning rules:
45
+
46
+ - Production CI workflows MUST pin the tool's binary version when the install command supports it (e.g. `brew install jq@1.7`, `cargo install ripgrep --version 14.1.0 --locked`, `gh ext install owner/repo@v1.2.3`).
47
+ - GitHub Actions step entries that consume a CLI tool MUST SHA-pin the action emitting the install (40-char commit SHA), per `rules/hatch3r-secrets-management.md` and CONSTITUTION §2B CQ3 supply-chain floor.
48
+ - Local-developer install commands MAY omit a version pin (homebrew tracks vendor-current); the registry MUST document the last-verified vendor release tag in `lastVendorReleaseTag` (proposal field — populate when adding the tool) so audit cycles can detect drift.
49
+ - A tool whose vendor stops publishing releases (cadence `stable` + last release >18 months) is escalated to D21 SA21.7 for replacement evaluation; the alternative-tool monitor in `src/cliTools/triggers.ts` records candidate replacements.
50
+
51
+ ## Release-Readiness Gate for New Tools
52
+
53
+ Adding a new tool to `src/cliTools/registry.ts::AVAILABLE_CLI_TOOLS` MUST satisfy every gate below before the PR merges. The gate set is enforced by the D21 audit checklist and the `validate-cli-skills.ts` CI gate:
54
+
55
+ 1. **Vendor verification** — record the upstream repository URL, current release tag, release date (ISO), and license SPDX identifier on the registry entry.
56
+ 2. **Web-research recency** — the audit-workspace research-date for the tool MUST be ≤14 days from PR open date; older research requires re-verification.
57
+ 3. **CVE scan** — inspect GHSA + NVD for advisories ≤180 days old; populate `securityNote` if any unfixed advisory matches, else record `null` with a comment citing the search date.
58
+ 4. **Skill parity** — a matching `skills/hatch3r-cli-{id}/SKILL.md` with frontmatter (`id`, `type=skill`, `description`, `tags`), Quick Start, and Step pattern exists; `npm run validate:cli-skills` exits 0.
59
+ 5. **Tier assignment justification** — the registry entry's `tier` field is documented inline: Tier 1 needs evidence of unconditional value (>80% of recommended workflows); Tier 2 needs at least one named trigger from `Tier2Trigger`; Tier 3 needs a use-case statement.
60
+ 6. **Install-command coverage** — install commands present for `mac` / `linux` / `win` keys covering the CI matrix (`ubuntu-latest`, `macos-latest`, `windows-latest`); WSL is treated as `linux`.
61
+ 7. **Capability matrix** — `src/adapters/canonical.ts` renders the skill to all 3 adapter outputs (cursor, claude, copilot); the per-adapter render path is tested in `src/__tests__/adapters/{name}.test.ts`.
62
+ 8. **Alternative-tool comparison** — the PR body lists at least 2 named alternatives considered (with rejection rationale citing measurable trade-offs); avoids tool-duplication per `rules/hatch3r-anti-duplication.md`.
63
+ 9. **Probe binary registration** — the `probe` field on the registry entry names the binary used by `detectInstalled()`; the probe MUST be the exact executable name printed by the install command output (e.g. `rg` for ripgrep, `fd` for fd, `jq` for jq).
64
+ 10. **Iteration-summary entry** — the addition emits one row in `rules/hatch3r-iteration-summary.md` §Changes Made with the registry-entry diff link, per the iteration-summary template.
65
+
66
+ ## Removing or Demoting a Tool
67
+
68
+ A tool moves to `deprecated: true` (proposal field) or out of `AVAILABLE_CLI_TOOLS` only when ALL hold:
69
+
70
+ - Vendor archived the upstream repository OR last release >24 months AND cadence `stable` no longer holds.
71
+ - A named alternative tool already in the registry covers ≥95% of the same use cases.
72
+ - A documented migration note in `skills/hatch3r-cli-{old}/SKILL.md` points users to the replacement and lists at least 1 example of the replacement command for each top-level recipe.
73
+
74
+ Demotion is irreversible at the audit-cycle granularity per `rules/hatch3r-clarification-default.md` B1 — confirm with the framework owner via the user-question protocol before merging the PR.
75
+
76
+ ## Cross-Cycle Currency Records
77
+
78
+ The audit execution-insights store (key `d21_tool_research_dates`) holds the per-cycle research-date promotion log; per pillar P3 and the CLI-tooling-recency domain's SA21.7, the promotion is the only audit artifact that survives between cycles. Wave-level findings in `.audit-workspace/wave-{N}/` are ephemeral.
79
+
80
+ ## D09 + D21 Boundary
81
+
82
+ The platform-adapters audit domain (D09) audits the per-adapter render of `hatch3r-cli-{id}` skills. The CLI-tooling-recency domain (D21) audits whether the underlying tool registry is current, accurate, and safe. A render-path bug routes to D09; a stale-tool finding routes to D21. Cross-cycle escalation between D09 and D21 happens via the registry-vs-skills drift check in D21 SA21.7 — drift is a Medium finding regardless of which side is out of sync.
83
+
84
+ ## References
85
+
86
+ - Pillar P3 (currency policy + Decision 21 capability matrix metric; see `agents/shared/principles.md`).
87
+ - Decision 26 (Conventional Commits + supply-chain floor + CI matrix).
88
+ - The CLI-tooling-recency audit domain (per-category sub-agent checklists).
89
+ - `src/cliTools/registry.ts` (`AVAILABLE_CLI_TOOLS` schema + tier definitions + cadence enum).
90
+ - `src/cliTools/triggers.ts` (tier-2 conditional evaluation + alternative-tool monitor).
91
+ - `scripts/validate-cli-skills.ts` (CI gate verifying registry-vs-skill drift).
@@ -0,0 +1,86 @@
1
+ ---
2
+ description: CLI-tool version pinning, vendor-release research cadence (≤90 days), CVE feed acknowledgement (≤90 days), and release-readiness gate for any new tool added to src/cliTools/
3
+ globs: ["src/cliTools/**", "skills/hatch3r-cli-*/SKILL.md", ".audit-workspace/**"]
4
+ alwaysApply: false
5
+ precedence: high
6
+ ---
7
+ # CLI Tool Currency
8
+
9
+ **Pillars:** P3 (Adapter & External Tool Currency), CQ3 (Security Quality)
10
+
11
+ ## Scope
12
+
13
+ This rule binds every CLI tool entry in `src/cliTools/registry.ts::AVAILABLE_CLI_TOOLS` and every per-tool skill under `skills/hatch3r-cli-{id}/SKILL.md`. Tier-1 entries are unconditionally installed; tier-2 entries are conditional per `src/cliTools/triggers.ts`; tier-3 entries are user-opt-in. The currency policy below applies tier-wide; only the staleness threshold varies per tier.
14
+
15
+ ## Vendor-Release Research Cadence
16
+
17
+ Source of truth: pillar P3 (see `agents/shared/principles.md`) — "vendor changelogs ≤12 months old, CVE feeds ≤90 days old, staleness >90 days for any tier-1 tool is a Medium finding". The CLI-tooling-recency audit domain owns the per-cycle verification.
18
+
19
+ Per-cycle research-date promotion is required for every tool listed in the registry. The audit workspace `.audit-workspace/current-insights.json::d21_tool_research_dates.{tool_id}` must carry an ISO date ≤90 days from cycle start. Records >120 days from cycle start trigger a regression-gate failure per the audit Regression Gates table.
20
+
21
+ | Tier | Staleness threshold | Action on breach |
22
+ |------|---------------------|------------------|
23
+ | Tier 1 (unconditional, e.g. `ripgrep`, `fd`, `jq`, `gh`, `delta`) | 90 days | Medium finding; block cycle close until research-date updated |
24
+ | Tier 2 (conditional, e.g. `qsv`, `playwright`, `duckdb`) | 120 days | Medium finding when trigger fires; Info otherwise |
25
+ | Tier 3 (opt-in) | 180 days | Low finding; surface for cycle backlog |
26
+
27
+ ## CVE Feed Acknowledgement
28
+
29
+ Every cycle MUST inspect the upstream advisory feed for each registered tool:
30
+
31
+ - GitHub Security Advisories (`https://github.com/{owner}/{repo}/security/advisories`) — primary feed for tools published on GitHub.
32
+ - NVD CVE feed (`https://nvd.nist.gov/vuln/search/results?form_type=Basic&search_type=all&query={tool}`) — backstop for non-GitHub tools.
33
+ - Vendor security mailing lists where the vendor publishes there in preference to GHSA (e.g. `oss-security@lists.openwall.com`).
34
+
35
+ The `securityNote` field on the registry entry MUST be populated when an unfixed advisory ≤90 days old applies, with the GHSA-id and required mitigation. Existing examples to mirror: `jq` (advisory roster on `jqlang/jq`), `gh` (GHSA-crc3-h8v6-qh57 pre-2.92.0). Missing CVE check is a High finding per CONSTITUTION §2 P3.
36
+
37
+ ## Version Pinning Policy
38
+
39
+ Registry entries declare install commands per OS / package manager (`brew`, `apt`, `scoop`, `cargo`, etc.). The pinning rules:
40
+
41
+ - Production CI workflows MUST pin the tool's binary version when the install command supports it (e.g. `brew install jq@1.7`, `cargo install ripgrep --version 14.1.0 --locked`, `gh ext install owner/repo@v1.2.3`).
42
+ - GitHub Actions step entries that consume a CLI tool MUST SHA-pin the action emitting the install (40-char commit SHA), per `rules/hatch3r-secrets-management.md` and CONSTITUTION §2B CQ3 supply-chain floor.
43
+ - Local-developer install commands MAY omit a version pin (homebrew tracks vendor-current); the registry MUST document the last-verified vendor release tag in `lastVendorReleaseTag` (proposal field — populate when adding the tool) so audit cycles can detect drift.
44
+ - A tool whose vendor stops publishing releases (cadence `stable` + last release >18 months) is escalated to D21 SA21.7 for replacement evaluation; the alternative-tool monitor in `src/cliTools/triggers.ts` records candidate replacements.
45
+
46
+ ## Release-Readiness Gate for New Tools
47
+
48
+ Adding a new tool to `src/cliTools/registry.ts::AVAILABLE_CLI_TOOLS` MUST satisfy every gate below before the PR merges. The gate set is enforced by the D21 audit checklist and the `validate-cli-skills.ts` CI gate:
49
+
50
+ 1. **Vendor verification** — record the upstream repository URL, current release tag, release date (ISO), and license SPDX identifier on the registry entry.
51
+ 2. **Web-research recency** — the audit-workspace research-date for the tool MUST be ≤14 days from PR open date; older research requires re-verification.
52
+ 3. **CVE scan** — inspect GHSA + NVD for advisories ≤180 days old; populate `securityNote` if any unfixed advisory matches, else record `null` with a comment citing the search date.
53
+ 4. **Skill parity** — a matching `skills/hatch3r-cli-{id}/SKILL.md` with frontmatter (`id`, `type=skill`, `description`, `tags`), Quick Start, and Step pattern exists; `npm run validate:cli-skills` exits 0.
54
+ 5. **Tier assignment justification** — the registry entry's `tier` field is documented inline: Tier 1 needs evidence of unconditional value (>80% of recommended workflows); Tier 2 needs at least one named trigger from `Tier2Trigger`; Tier 3 needs a use-case statement.
55
+ 6. **Install-command coverage** — install commands present for `mac` / `linux` / `win` keys covering the CI matrix (`ubuntu-latest`, `macos-latest`, `windows-latest`); WSL is treated as `linux`.
56
+ 7. **Capability matrix** — `src/adapters/canonical.ts` renders the skill to all 3 adapter outputs (cursor, claude, copilot); the per-adapter render path is tested in `src/__tests__/adapters/{name}.test.ts`.
57
+ 8. **Alternative-tool comparison** — the PR body lists at least 2 named alternatives considered (with rejection rationale citing measurable trade-offs); avoids tool-duplication per `rules/hatch3r-anti-duplication.md`.
58
+ 9. **Probe binary registration** — the `probe` field on the registry entry names the binary used by `detectInstalled()`; the probe MUST be the exact executable name printed by the install command output (e.g. `rg` for ripgrep, `fd` for fd, `jq` for jq).
59
+ 10. **Iteration-summary entry** — the addition emits one row in `rules/hatch3r-iteration-summary.md` §Changes Made with the registry-entry diff link, per the iteration-summary template.
60
+
61
+ ## Removing or Demoting a Tool
62
+
63
+ A tool moves to `deprecated: true` (proposal field) or out of `AVAILABLE_CLI_TOOLS` only when ALL hold:
64
+
65
+ - Vendor archived the upstream repository OR last release >24 months AND cadence `stable` no longer holds.
66
+ - A named alternative tool already in the registry covers ≥95% of the same use cases.
67
+ - A documented migration note in `skills/hatch3r-cli-{old}/SKILL.md` points users to the replacement and lists at least 1 example of the replacement command for each top-level recipe.
68
+
69
+ Demotion is irreversible at the audit-cycle granularity per `rules/hatch3r-clarification-default.md` B1 — confirm with the framework owner via the user-question protocol before merging the PR.
70
+
71
+ ## Cross-Cycle Currency Records
72
+
73
+ The audit execution-insights store (key `d21_tool_research_dates`) holds the per-cycle research-date promotion log; per pillar P3 and the CLI-tooling-recency domain's SA21.7, the promotion is the only audit artifact that survives between cycles. Wave-level findings in `.audit-workspace/wave-{N}/` are ephemeral.
74
+
75
+ ## D09 + D21 Boundary
76
+
77
+ The platform-adapters audit domain (D09) audits the per-adapter render of `hatch3r-cli-{id}` skills. The CLI-tooling-recency domain (D21) audits whether the underlying tool registry is current, accurate, and safe. A render-path bug routes to D09; a stale-tool finding routes to D21. Cross-cycle escalation between D09 and D21 happens via the registry-vs-skills drift check in D21 SA21.7 — drift is a Medium finding regardless of which side is out of sync.
78
+
79
+ ## References
80
+
81
+ - Pillar P3 (currency policy + Decision 21 capability matrix metric; see `agents/shared/principles.md`).
82
+ - Decision 26 (Conventional Commits + supply-chain floor + CI matrix).
83
+ - The CLI-tooling-recency audit domain (per-category sub-agent checklists).
84
+ - `src/cliTools/registry.ts` (`AVAILABLE_CLI_TOOLS` schema + tier definitions + cadence enum).
85
+ - `src/cliTools/triggers.ts` (tier-2 conditional evaluation + alternative-tool monitor).
86
+ - `scripts/validate-cli-skills.ts` (CI gate verifying registry-vs-skill drift).