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
@@ -1,23 +1,34 @@
1
1
  ---
2
2
  id: hatch3r-report
3
- type: command
4
- orchestrator: false
5
- description: Generate an in-chat session report from the active or named transcript — every tool call, sub-agent delegation, and file edit, with diagnostics for missed parallelism, redundant work, and over-serialization.
3
+ name: hatch3r-report
4
+ type: skill
5
+ description: Generates an in-chat session report from the active or named transcript — every tool call, sub-agent delegation, and file edit, with diagnostics for missed parallelism, redundant work, and over-serialization. Default = current session, executive summary, in-chat.
6
6
  tags: [maintenance]
7
7
  quality_charter: agents/shared/quality-charter.md
8
8
  efficiency_patterns: agents/shared/efficiency-patterns.md
9
9
  cache_friendly: true
10
- parallel_tool_default: true
11
10
  ---
12
- ## Agent Pipeline
13
-
14
- This command runs inline and does not spawn sub-agents. Parsing is driven by Bash + jq over the on-disk session transcript; the LLM only sees aggregated counts and triggered-heuristic evidence, never the raw JSONL. This keeps the command efficient (P7) even on 1000+ record sessions.
15
11
 
16
12
  # Session Report — Agentic Action Replay
17
13
 
18
14
  Render an in-chat report of what happened in a Claude Code session: every tool call, every sub-agent `Agent` delegation, every file edit, every hook event. Default = current session, executive summary, in-chat. Flags extend scope and depth. Two audiences: (a) users who want to understand the session end-to-end; (b) maintainers investigating runtime shape for framework-level optimizations.
19
15
 
20
- ---
16
+ ## Quick Start
17
+
18
+ ```
19
+ Task Progress:
20
+ - [ ] Step 0: Detect ambiguity (P8 B1) — only if invocation arguments are ambiguous
21
+ - [ ] Step 1: Discover the session
22
+ - [ ] Step 2: Aggregate via jq
23
+ - [ ] Step 3: Compute diagnostics
24
+ - [ ] Step 4: Render executive summary
25
+ - [ ] Step 5: Render verbose timeline (--verbose only)
26
+ - [ ] Step 6: Save to disk (--save only)
27
+ ```
28
+
29
+ ## Step 0 — Detect Ambiguity (P8 B1)
30
+
31
+ This skill is read-only over local transcripts and produces no file mutations outside `.hatch3r/reports/` (and only with `--save`). The platform-native question tool is invoked only when the user's `--session <value>` argument fails to resolve to a readable file or when `--save` would overwrite an existing report — see Error Handling. Otherwise the skill runs without an ASK gate.
21
32
 
22
33
  ## Argument Parsing
23
34
 
@@ -80,8 +91,6 @@ Append `## Timeline`. For each assistant turn containing ≥1 tool_use, emit a n
80
91
 
81
92
  Create `.hatch3r/reports/` if missing. Write the rendered markdown (executive summary + timeline if `--verbose` set) to `.hatch3r/reports/{sessionId-short8}-{YYYYMMDD-HHMMSS}.md`. Append a `## Raw Counts (machine-readable)` section containing the jq-aggregated JSON in a fenced ```json``` block — this lets future tooling grep across sessions without re-parsing the source JSONL. Print the file path back to chat. The `.hatch3r/` directory is gitignored.
82
93
 
83
- ---
84
-
85
94
  ## Output Format
86
95
 
87
96
  ```markdown
@@ -125,8 +134,6 @@ Create `.hatch3r/reports/` if missing. Write the rendered markdown (executive su
125
134
  Re-run `/hatch3r-report --verbose` for the chronological timeline.
126
135
  ```
127
136
 
128
- ---
129
-
130
137
  ## Diagnostic Heuristics
131
138
 
132
139
  | ID | Heuristic | Trigger | Severity |
@@ -143,8 +150,6 @@ Re-run `/hatch3r-report --verbose` for the chronological timeline.
143
150
 
144
151
  Each fired record: `{id, severity, turns:[n,...], evidence, suggestion}`. Consolidate same-rule fires into one record per session.
145
152
 
146
- ---
147
-
148
153
  ## Error Handling
149
154
 
150
155
  | Condition | Action |
@@ -156,12 +161,10 @@ Each fired record: `{id, severity, turns:[n,...], evidence, suggestion}`. Consol
156
161
  | Malformed JSONL record encountered | Skip the record; increment a `skipped` counter; surface the count in the executive summary footer when non-zero. |
157
162
  | Read access denied to a transcript file | Print: "Cannot read {path}: permission denied." Exit. |
158
163
 
159
- ---
160
-
161
164
  ## Guardrails
162
165
 
163
166
  - **Never modify the JSONL.** Read-only access. All scratch files go to `$(mktemp)` and are deleted at end-of-run.
164
167
  - **Mask obvious secret patterns** (`sk-`, `ghp_`, `xoxb-`, `AIza`, `Bearer `) in any rendered tool_use input — substitute `{REDACTED-{prefix}}`. The transcript may contain ephemeral tokens from user pastes.
165
168
  - **Never write outside `.hatch3r/reports/`.** The `--save` target is fixed; do not honor flags or env vars that redirect output to other paths.
166
169
  - **Never abort on a malformed record.** Skip-and-count is the contract; aborting would hide the rest of the session from the operator (Silent Failure Contract — surface the skip count rather than swallowing it).
167
- - **Honor the iteration summary contract** (`rules/hatch3r-iteration-summary.md`) at the end of the parent assistant turn that invoked this command. The report content is not a substitute for the canonical Status / Outcome / Done block.
170
+ - **Honor the iteration summary contract** (`rules/hatch3r-iteration-summary.md`) at the end of the parent assistant turn that invoked this skill. The report content is not a substitute for the canonical Status / Outcome / Done block.
@@ -0,0 +1,145 @@
1
+ ---
2
+ id: hatch3r-scalability-verify
3
+ name: hatch3r-scalability-verify
4
+ type: skill
5
+ description: Scalability verification gate before commit/release — stateless-handler ratio, back-pressure patterns, idempotency-key adoption, queue-based offloading, pool sizing, bulkheads, load-test pass at target scale
6
+ tags: [review, scalability, floor:content-quality]
7
+ scope: conditional
8
+ globs: "src/handlers/**,src/routes/**,src/services/**,src/workers/**,**/k8s/**,**/manifests/**,**/k6/**,**/locust/**,**/gatling/**"
9
+ precedence: normal
10
+ quality_charter: agents/shared/quality-charter.md
11
+ efficiency_patterns: agents/shared/efficiency-patterns.md
12
+ cache_friendly: true
13
+ ---
14
+ # Scalability Verification Gate
15
+
16
+ ## Quick Start
17
+
18
+ This skill defines what "done" means for any feature shipping service code on horizontally-scaled tiers. Run before declaring a feature complete. The 8 gates below mix automated checks (machine-checkable on every PR) with one release-cadence gate (load test at target scale). Skipping any gate = the feature is not done. Functional tests passing alone do not satisfy this bar — a stateful handler on a horizontally-scaled tier breaks on the Nth request; a POST endpoint without `Idempotency-Key` duplicates side effects under retry storm.
19
+
20
+ Inputs the skill expects:
21
+
22
+ - A repository with `src/` (handlers, routes, services, workers).
23
+ - A connection-pool config file (`pgbouncer.ini`, `knexfile.js`, `prisma.schema`, `application.yml` with HikariCP, `database.yml`).
24
+ - A queue client configuration (SQS, Kafka, Redis Streams, Bull/BullMQ, Sidekiq, Celery).
25
+ - A load-test script under `k6/`, `locust/`, or Gatling sims when claiming horizontal scaling.
26
+ - A documented concurrency profile naming target RPS, peak RPS, and burst multiplier.
27
+
28
+ Outputs the skill produces: an 8-line verdict block written to the PR conversation, plus a JSON artifact at `.audit-workspace/scalability-verify-<sha>.json` for downstream consumption by `hatch3r-release`.
29
+
30
+ ## Step 0 — Detect Ambiguity (P8 B1)
31
+
32
+ Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md`. Default path, not exception. Triggers for THIS skill: service / handler scope, target scale (current p99 vs 10x vs named load-test peak), gate selection (back-pressure vs idempotency vs pool-sizing vs full), concurrency envelope (steady-state RPS, peak RPS, burst multiplier), and topology (single-zone vs multi-region). Pool-size increases, queue-topology changes, and sticky-session removals are irreversible at production traffic — these MUST go through the protocol before action.
33
+
34
+ ## Fan-out Discipline (P8 B2)
35
+
36
+ Fan-out scales with task size; token cost never justifies serializing independent work (`rules/hatch3r-fan-out-discipline.md` P8 B2; `agents/shared/efficiency-patterns.md`). Emit `sub_agents_spawned: { count, rationale }` in your output.
37
+
38
+ ## Invoked by
39
+
40
+ This skill is the verification HARNESS — it declares HOW each scalability gate is checked. The DISPATCHER that decides WHEN to run it is the CQ specialist agent:
41
+
42
+ - `agents/hatch3r-scalability.md` — invokes this skill as the closing scalability gate (CQ6) on PRs touching service code or scaling config. The agent contributes the review trigger and Phase-4 dispatch; this skill contributes the 8-gate procedure.
43
+
44
+ No duplication: the agent decides WHEN, this skill defines HOW.
45
+
46
+ ## Gate 1: Stateless-handler ratio ≥95%
47
+
48
+ - Handler scan reports no in-memory session state, no module-level mutable globals, no sticky-session assumption on horizontally-scaled tiers.
49
+ - Verified by AST grep against handler entry points: `req.session`, module-scope `let`/`var` mutables, in-process LRU caches keyed by `userId`.
50
+ - Session storage externalized to Redis / JWT / signed-cookie.
51
+ - <95% on user-facing routes → CRITICAL (load balancer round-robins break user state on every Nth request).
52
+
53
+ ## Gate 2: Request-coalescing + back-pressure on high-fan-out endpoints
54
+
55
+ - Named pattern (semaphore via `p-limit`/`async-sem`, queue-depth limit via reverse-proxy LimitReqZone, token-bucket via Envoy `local_ratelimit`).
56
+ - Documented rejection threshold and queue-depth telemetry.
57
+ - Reject with HTTP 429 + `Retry-After` when threshold exceeded; never silently buffer beyond `max_inflight`.
58
+ - Coalesce duplicate in-flight requests by request-key hash (singleflight pattern).
59
+
60
+ ## Gate 3: Database connection pool sizing per concurrency profile
61
+
62
+ - `pool_size = ceil(expected_concurrent_requests × avg_query_time_ms / target_p99_ms)` documented in config alongside the inputs.
63
+ - Hard cap below the database's `max_connections × 0.7` for admin sessions + replicas.
64
+ - PgBouncer in `transaction` mode where pool-per-connection cost is the constraint.
65
+ - Pool sized to dependency, not to handler concurrency. Mis-sizing → FINDINGS at High when pool exhaustion observed in load test.
66
+
67
+ ## Gate 4: Idempotency-Key on every POST/PUT/PATCH
68
+
69
+ - Header acceptance + dedup-result storage per Stripe pattern.
70
+ - Dedup window ≥24h (Stripe default), key length up to 255 chars, stored result returned on retry regardless of original success/failure.
71
+ - Conflict semantics defined: same key + different request body → HTTP 422 with `idempotency_key_conflict`.
72
+ - Missing on irreversible POST endpoint (payment, account creation) → CRITICAL.
73
+
74
+ ## Gate 5: Queue-based offloading for >1s operations
75
+
76
+ - Background-job system (SQS / Kafka / Redis Streams / BullMQ / Sidekiq / Celery) with retry policy (decorrelated jitter per AWS Architecture Blog).
77
+ - DLQ binding (max 3-5 attempts) + per-job idempotency at the handler level.
78
+ - Enqueuer commits the database transaction before publishing (staged-jobs pattern); no synchronous >1s work on user-facing paths.
79
+ - Visibility timeout ≥ p99 job duration × 2.
80
+
81
+ ## Gate 6: Bulkheading — resource pools isolated by tenant or critical path
82
+
83
+ - Separate connection pools (or pool partitions) for tenant tiers (free / paid / enterprise) or critical-vs-batch paths.
84
+ - Documented limits per pool prevent cascade failure when one tenant or one downstream dependency saturates.
85
+ - Pattern: Netflix Hystrix-style bulkhead with `maxConcurrentExecutions` per dependency.
86
+ - Missing bulkhead between tenant tiers → Medium FINDINGS (one large tenant's burst impacts every other tenant's p99).
87
+
88
+ ## Gate 7: Connection-pool exhaustion monitored (USE method)
89
+
90
+ - Pool queue depth (`pool.waiting`), pool wait time (`pool.acquire_duration_p99`), and pool saturation (`active / max`) emit metrics per Google SRE USE method (Utilization, Saturation, Errors).
91
+ - Saturation alerts wired with multi-window multi-burn-rate (2%/5%/10% per Google SRE workbook).
92
+ - Alert when `pool.waiting > 0` for >30s OR `active/max > 0.8` for >2min.
93
+ - Telemetry harness reuse: `skills/hatch3r-observability-verify` Gate 4 (RED+USE metrics).
94
+
95
+ ## Gate 8: Horizontal scaling validated via load test
96
+
97
+ - k6 / Locust / Gatling run at named target RPS captures p99 latency, error rate, and pool-saturation metrics.
98
+ - p99 within the documented budget; zero pool exhaustion events; idempotency-key dedup verified by replaying ≥10% of requests at peak.
99
+ - Replicas auto-scale within target time (HPA / KEDA reaching target replica count within 2min on CPU > 70% or queue-depth threshold).
100
+ - Load-test result attached to the PR or release notes.
101
+
102
+ ## Pass criteria
103
+
104
+ All 8 gates pass = the feature is "done" enough to ship to production. Anything less = not done.
105
+
106
+ - Stateless-handler ratio: ≥95% on user-facing routes.
107
+ - Back-pressure pattern: named + documented threshold on every high-fan-out endpoint.
108
+ - Pool sizing formula: documented + inputs visible in config.
109
+ - Idempotency-Key adoption: 100% on POST/PUT/PATCH; dedup window ≥24h.
110
+ - Queue offload: 100% of >1s operations; DLQ + decorrelated jitter + visibility ≥ p99 × 2.
111
+ - Bulkhead: present on multi-tenant or critical-vs-batch surfaces.
112
+ - Pool-saturation metrics + alerts: present per USE method.
113
+ - Load test at target RPS: p99 within budget, 0 pool exhaustion, ≥10% dedup replay verified.
114
+
115
+ ## On fail
116
+
117
+ The orchestrator running this skill emits a single-line verdict per gate (`GATE_N: PASS|FAIL <evidence-path>`) and aggregates them. One FAIL on a required gate blocks the merge regardless of functional-test status.
118
+
119
+ Failure escalation per `agents/hatch3r-scalability.md` severity calibration: Gate 1 fail (stateful handler on horizontally-scaled tier without sticky-session strategy) → CRITICAL; Gate 4 fail (POST without Idempotency-Key on irreversible side effects) → CRITICAL; Gate 5 fail (>1s synchronous work on user-facing route) → High; Gates 3/6/7 → Medium; Gate 8 incomplete (no load test) → headroom-unstated Info but ship-block High when target unmet.
120
+
121
+ ## When this skill runs
122
+
123
+ - Reviewer pass on PRs that add or modify request handlers, route definitions, queue clients, or connection-pool config.
124
+ - Implementer pre-write for any new endpoint that performs >1s work, accepts POST/PUT/PATCH, or runs on a horizontally-scaled tier.
125
+ - Verifier pre-merge gate for changes touching session storage, cache layers, or background-job systems.
126
+ - Capacity-planning audit when service traffic projections change.
127
+ - Load-test pre-release before any release claiming horizontal-scaling capability.
128
+
129
+ ## Cross-References
130
+
131
+ - `rules/hatch3r-api-design.md` — idempotency requirement.
132
+ - `rules/hatch3r-resilience-patterns.md` — bulkheads section.
133
+ - `rules/hatch3r-observability-metrics.md` — USE method + burn-rate alerts.
134
+ - `skills/hatch3r-observability-verify` — telemetry harness reuse for Gate 7.
135
+ - `agents/shared/quality-charter.md` §Reliability quality + §API quality.
136
+
137
+ ## References
138
+
139
+ - Stripe Idempotent Requests — `docs.stripe.com/api/idempotent_requests`
140
+ - Stripe staged-jobs pattern — `stripe.com/blog/idempotency`
141
+ - Brandur Leach Idempotency Keys in Postgres — `brandur.org/idempotency-keys`
142
+ - Google SRE USE method (Brendan Gregg) — `www.brendangregg.com/usemethod.html`
143
+ - AWS Architecture Blog decorrelated jitter — `aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/`
144
+ - k6 documentation — `k6.io/docs/`
145
+ - Stateless services failure modes — `medium.com/codeelevation/why-stateless-services-quietly-break-in-real-systems-and-how-to-fix-them-24fc20951046`
@@ -0,0 +1,144 @@
1
+ ---
2
+ id: hatch3r-security-verify
3
+ name: hatch3r-security-verify
4
+ type: skill
5
+ description: Security verification gate before commit/release — OAuth 2.1 + OIDC + DPoP + WebAuthn server-side, supply-chain floor (SBOM + provenance + SHA-pin + cosign), OWASP ASI01-10 control coverage, CVE acknowledgement
6
+ tags: [review, security, supply-chain, floor:security, floor:content-quality]
7
+ scope: conditional
8
+ globs: "src/auth/**,**/.github/workflows/*.yml,**/Dockerfile,**/package.json,**/package-lock.json,**/pnpm-lock.yaml,**/yarn.lock"
9
+ precedence: normal
10
+ quality_charter: agents/shared/quality-charter.md
11
+ efficiency_patterns: agents/shared/efficiency-patterns.md
12
+ cache_friendly: true
13
+ ---
14
+ # Security Verification Gate
15
+
16
+ ## Quick Start
17
+
18
+ This skill defines what "done" means for any feature shipping security-sensitive code or release-touching artifacts. Run before declaring a feature complete. The 8 gates below mix automated checks (machine-checkable on every PR) with one release-cadence gate (CVE acknowledgement at release-cut). Skipping any gate = the feature is not done. Reviewer approval and passing functional tests alone do not satisfy this bar — a missing PKCE flag, an unpinned action SHA, or an `alg: none` JWT verifier ships exploitable code.
19
+
20
+ Inputs the skill expects:
21
+
22
+ - A repository with `src/auth/` (or equivalent path), `.github/workflows/`, lockfiles (`package-lock.json` / `pnpm-lock.yaml` / `yarn.lock`), and release manifests (`Dockerfile`, `kubernetes/*.yaml`).
23
+ - Access to the project's CVE alert feed (`gh api repos/{owner}/{repo}/dependabot/alerts`) for Gate 8.
24
+ - Access to the JWT verification configuration (the file or module that names `algorithms`, `audience`, `issuer`).
25
+
26
+ Outputs the skill produces: an 8-line verdict block written to the PR conversation, plus a JSON artifact at `.audit-workspace/security-verify-<sha>.json` for downstream consumption by `hatch3r-release`.
27
+
28
+ ## Step 0 — Detect Ambiguity (P8 B1)
29
+
30
+ Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md`. Default path, not exception. Triggers for THIS skill: auth-flow scope (sign-in vs refresh vs step-up vs M2M), release-surface scope (workflow YAML vs container manifests vs SBOM tooling), gate selection (auth-only vs supply-chain-only vs full), threat-model assumptions (DPoP-bound browser tokens vs mTLS-bound service tokens vs bare bearer), and fix authority (fixes-in-scope vs audit-only).
31
+
32
+ ## Fan-out Discipline (P8 B2)
33
+
34
+ Fan-out scales with task size; token cost never justifies serializing independent work (`rules/hatch3r-fan-out-discipline.md` P8 B2; `agents/shared/efficiency-patterns.md`). Emit `sub_agents_spawned: { count, rationale }` in your output.
35
+
36
+ ## Invoked by
37
+
38
+ This skill is the verification HARNESS — it declares HOW each security gate is checked. The DISPATCHER that decides WHEN to run it is the CQ specialist agent:
39
+
40
+ - `agents/hatch3r-security.md` — invokes this skill as the closing security gate (CQ3) on auth-touching PRs and release-prep flows. The agent contributes the review trigger and Phase-4 dispatch; this skill contributes the 8-gate procedure.
41
+
42
+ No duplication: the agent decides WHEN, this skill defines HOW.
43
+
44
+ ## Gate 1: OAuth 2.1 grant hygiene
45
+
46
+ - PKCE on every public AND confidential client; `response_type=code` only; implicit grant absent; ROPC grant absent.
47
+ - Exact-string `redirect_uri` allowlist (no wildcards); refresh-token rotation with reuse detection that revokes the entire token family on reuse.
48
+ - Check: `rg -n "response_type=code" src/auth/ | rg -v "code_challenge"` — any match fails this gate (auth-code flow without PKCE).
49
+ - Check: `rg -n "grant_type=(implicit|password)" src/auth/` — any match fails this gate.
50
+ - Reference: `draft-ietf-oauth-v2-1-15`.
51
+
52
+ ## Gate 2: OIDC ID-token validation
53
+
54
+ - Verifier validates `iss`, `aud`, `azp` (when `aud` is multi-valued), `exp`, `nonce`, and JWKS signature before session creation.
55
+ - Clock-skew window documented (≤300s); RP-initiated logout (`end_session_endpoint`) and back-channel logout wired for SSO sessions.
56
+ - Check: `rg -n "jwt\.(verify|decode)" src/auth/ | rg -v "audience|issuer"` — any match fails this gate (validator missing `aud` or `iss`).
57
+ - Reference: OpenID Connect Core 1.0 §3.1.3.7.
58
+
59
+ ## Gate 3: Sender-constrained tokens (DPoP / mTLS)
60
+
61
+ - DPoP (RFC 9449) for browser/mobile access tokens — proof JWT carrying `htm`/`htu`/`iat`/`jti` claims and access token bound via `cnf.jkt` thumbprint.
62
+ - OR mTLS-bound tokens (RFC 8705) for service-to-service. Bare bearer tokens for browser clients fail this gate (High).
63
+ - Check: `rg -n "Bearer " src/ | rg -v "DPoP|mTLS|cnf\.jkt"` — any browser-issued bearer without sender constraint fails the gate.
64
+
65
+ ## Gate 4: JWT BCP conformance
66
+
67
+ - `alg` pinned per issuer; `alg: none` rejected at the verifier; `alg: HS*` rejected when verification key is asymmetric (key-confusion guard).
68
+ - `kid` resolved against JWKS endpoint with cache TTL 1-24h; no PII in payload; revocation strategy named (introspection OR token-version table).
69
+ - Check: `rg -n "alg.*none|jwt\.verify\([^,]+,[^,)]+\)$" src/` — any match fails this gate (`alg: none` accepted OR no `algorithms` option pinned).
70
+ - Reference: RFC 8725.
71
+
72
+ ## Gate 5: Supply-chain floor (SBOM + provenance + SHA-pin + cosign)
73
+
74
+ - SBOM attached to every release in CycloneDX 1.6+ (preferred per ECMA-424) or SPDX 3.0.1.
75
+ - npm publication via OIDC trusted publishing with `--provenance`; every GitHub Action reference is a 40-char commit SHA.
76
+ - Production container images consumed by digest and cosign-signed (keyless OIDC via sigstore).
77
+ - Check: `rg -nE "uses: [^@]+@v?[0-9]+(\.[0-9]+)*$" .github/workflows/` — any match fails this gate (tag instead of 40-char SHA).
78
+ - Check: `gh release view --json assets --jq '.assets[].name' | rg -i "(cyclonedx|spdx)"` — empty output on tagged release fails this gate.
79
+
80
+ ## Gate 6: WebAuthn server ceremony
81
+
82
+ - Challenge cached server-side with TTL ≤300s and single-use marker; `origin` allowlist verified at assertion; RP-ID hash matched.
83
+ - Signature validated against credential public key; signature counter strictly greater than stored value (replay guard); `user.id` is a server-side opaque identifier (NOT email or username).
84
+ - Check: `rg -n "signCount" src/ | rg -v "[><]"` — any match fails this gate (counter stored without strict-monotonic check).
85
+ - Reference: W3C WebAuthn Level 3 §7. Skip when no WebAuthn surface present.
86
+
87
+ ## Gate 7: Cookie security flags
88
+
89
+ - Every auth cookie carries `__Host-` prefix + `HttpOnly` + `Secure` + `SameSite=Strict|Lax`.
90
+ - `SameSite=None` paired with `Partitioned` (CHIPS) only when the cross-site context is documented.
91
+ - Check: `rg -n "Set-Cookie" src/ | rg -v "__Host-|HttpOnly|Secure|SameSite"` — any auth cookie missing any flag fails this gate.
92
+ - Reference: RFC 6265bis + CHIPS draft.
93
+
94
+ ## Gate 8: OWASP ASI01-10 + CVE acknowledgement
95
+
96
+ - Every agent-produced module passes the current OWASP ASI revision check (100% control coverage).
97
+ - CVE advisories ≤90 days old that match any project dependency are acknowledged in the finding registry with a `mitigated` OR `accepted` verdict + evidence URL.
98
+ - Check: `gh api repos/{owner}/{repo}/dependabot/alerts --jq '.[] | select(.state=="open")'` — any unacknowledged alert ≤90 days old fails this gate.
99
+ - Reference: OWASP Foundation + GitHub Security Advisories + OSV. Hardcoded secrets count: 0 per `rules/hatch3r-secrets-management.md`.
100
+
101
+ ## Pass criteria
102
+
103
+ All 8 gates pass = the feature is "done". Anything less = not done.
104
+
105
+ - Hardcoded secrets in `src/`: 0 (CRITICAL on any hit).
106
+ - Supply-chain floor coverage: 100% (SBOM present + provenance + SHA-pinned actions + cosign-signed containers).
107
+ - OWASP ASI01-10 controls: 100% coverage.
108
+ - OAuth 2.1 PKCE: 100% of public + confidential clients.
109
+ - JWT `alg: none` acceptance: 0 occurrences in `src/`.
110
+ - Cookie flag coverage on auth cookies: 100% (`__Host-` + `HttpOnly` + `Secure` + `SameSite`).
111
+ - Open CVE alerts ≤90 days unacknowledged: 0.
112
+
113
+ ## On fail
114
+
115
+ The orchestrator running this skill emits a single-line verdict per gate (`GATE_N: PASS|FAIL <evidence-path>`) and aggregates them. One FAIL on a required gate blocks the merge regardless of reviewer approval status.
116
+
117
+ Failure escalation per `agents/hatch3r-security.md` Status discipline table: Gate 4 fail (`alg: none` accepted) → CRITICAL; Gate 1 fail (refresh-token rotation absent) → CRITICAL; Gate 5 fail (production container by tag) → CRITICAL; Gate 6/3/7/2 → High; Gate 8 → Medium escalating to High when exploitable.
118
+
119
+ ## When this skill runs
120
+
121
+ - Reviewer pass on any PR touching `src/auth/*`, JWT verification, cookie wiring, OAuth client config, WebAuthn ceremony, or release workflow under `.github/workflows/*.yml`.
122
+ - Verifier pre-merge gate on changes with `tags: floor:security` or `tags: floor:content-quality`.
123
+ - Release-prep audit before publishing to confirm Gate 5 (supply-chain floor) on every release artifact.
124
+ - CVE response when a ≤90-day advisory matches a project dependency.
125
+
126
+ ## Cross-References
127
+
128
+ - `rules/hatch3r-auth-patterns.md`
129
+ - `rules/hatch3r-passkey-server.md`
130
+ - `rules/hatch3r-security-patterns.md`
131
+ - `rules/hatch3r-secrets-management.md`
132
+ - `rules/hatch3r-dependency-management.md`
133
+ - `rules/hatch3r-container-hardening.md`
134
+
135
+ ## References
136
+
137
+ - OAuth 2.1 (`draft-ietf-oauth-v2-1-15`) — `datatracker.ietf.org/doc/draft-ietf-oauth-v2-1/`
138
+ - OpenID Connect Core 1.0 — `openid.net/specs/openid-connect-core-1_0.html`
139
+ - RFC 9449 DPoP — `www.rfc-editor.org/rfc/rfc9449.html`
140
+ - RFC 8725 JWT BCP — `www.rfc-editor.org/rfc/rfc8725.html`
141
+ - W3C WebAuthn Level 3 — `www.w3.org/TR/webauthn-3/`
142
+ - OWASP CycloneDX (ECMA-424) — `owasp.org/www-project-cyclonedx/`
143
+ - sigstore / cosign — `sigstore.dev`
144
+ - OWASP ASI — `owasp.org/www-project-application-security-verification-standard/`
@@ -0,0 +1,126 @@
1
+ ---
2
+ id: hatch3r-team-convention-author
3
+ name: hatch3r-team-convention-author
4
+ type: skill
5
+ description: Interactive workflow to elicit, draft, align, and persist a team's coding conventions and working agreements as a versioned project rule or convention doc. Use when a team is setting up shared norms, codifying tacit practices, or reconciling conflicting style decisions.
6
+ tags: [maintenance, board]
7
+ quality_charter: agents/shared/quality-charter.md
8
+ efficiency_patterns: agents/shared/efficiency-patterns.md
9
+ cache_friendly: true
10
+ ---
11
+
12
+ # Team Convention Author — Elicit, Draft, Align, Persist
13
+
14
+ Captures a team's tacit coding conventions and working agreements into a single versioned artifact the whole team can read and an agent can enforce. Two output shapes: a **convention doc** (`docs/process/` markdown — for human-facing working agreements: ownership, review norms, communication) and a **project rule** (`.hatch3r/overrides/rules/` — for machine-enforceable code conventions: naming, structure, lint deltas — so the rule is tracked by `hatch3r status`/`verify` and regenerated into the adapter surfaces on `sync`, not written drift-invisibly into a generated file). The load-bearing step is Step 1: a convention written FOR a team by one person decays; a convention written BY the team through elicitation holds (team-charter methodology — see References).
15
+
16
+ ## Quick Start
17
+
18
+ ```
19
+ Task Progress:
20
+ - [ ] Step 0: Detect ambiguity (P8 B1)
21
+ - [ ] Step 1: Elicit the team's conventions and working agreements
22
+ - [ ] Step 2: Classify each item — code convention (rule) vs working agreement (doc)
23
+ - [ ] Step 3: Cross-check against existing project rules and style guides
24
+ - [ ] Step 4: Draft to the matching template
25
+ - [ ] Step 5: Review with the team, then persist as a versioned artifact
26
+ ```
27
+
28
+ ## Step 0 — Detect Ambiguity (P8 B1)
29
+
30
+ Before any write, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target surface, or irreversibility. If any are found, ask the user via the platform-native question tool per `agents/shared/user-question-protocol.md`. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: which convention class is wanted (machine-enforceable code rule vs human working agreement); whether an existing convention doc/rule is being amended (a section rewrite that drops prior agreements is irreversible to readers who relied on them); the authoritative style guide for the stack (a new convention that contradicts an adopted style guide needs an explicit override decision); and who ratifies (one maintainer's preference is not a team agreement — see Step 5).
31
+
32
+ ## Fan-out Discipline (P8 B2)
33
+
34
+ Fan-out scales with task size; token cost never justifies serializing independent work (`rules/hatch3r-fan-out-discipline.md` P8 B2; `agents/shared/efficiency-patterns.md`). Tier boundaries for THIS skill:
35
+ - Tier 1 (single convention class, one stack): inline.
36
+ - Tier 2 (both a code-rule set AND a working-agreement doc, or conventions spanning ≥2 stacks): spawn one sub-agent per disjoint artifact via the Task tool; each drafts its own file.
37
+ - Tier 3 (full team-handbook codification across many domains — frontend, backend, infra, review process): one fresh sub-agent per domain; orchestrator integrates the index only.
38
+
39
+ Emit `sub_agents_spawned: { count, rationale }` in your output.
40
+
41
+ ## Step 1: Elicit the Team's Conventions and Working Agreements
42
+
43
+ A convention is only adopted if the team shaped it. Elicit, do not dictate. Ask the team (or the maintainer relaying for the team) across these prompts, one focused question per turn:
44
+
45
+ 1. **Code conventions** — naming (files, types, functions), module/folder structure, import ordering, error-handling shape, test-file placement, comment style. Pull candidates from the existing codebase rather than from memory: a convention the code already follows in 80%+ of cases is a documented-default candidate, not a debate.
46
+ 2. **Working agreements** — review turnaround expectation, branch/PR naming, merge policy (squash vs merge-commit), required approvals, what blocks a merge, how disagreements are resolved, communication norms (where decisions are recorded).
47
+ 3. **Authority and overrides** — which published style guide is the tie-breaker for pure-style points (per Google eng-practices: the style guide is the absolute authority on style, and any style point not in the guide is personal preference — see References). Record the chosen style guide by name and URL.
48
+
49
+ For each candidate, capture: the convention, one concrete example, and the rationale (why this over the alternative). A convention with no rationale is a preference, not an agreement — flag it for Step 5 ratification.
50
+
51
+ ## Step 2: Classify — Code Convention vs Working Agreement
52
+
53
+ Route each elicited item to its output shape. The distinction drives where the artifact lands and how it is enforced.
54
+
55
+ | Item type | Output shape | Lands in | Enforcement |
56
+ |-----------|--------------|----------|-------------|
57
+ | Machine-checkable code rule (naming, structure, import order, lint delta) | Project rule | `.hatch3r/overrides/rules/<id>.md` (+ `.mdc` companion) so `hatch3r status`/`verify` track it and `sync` regenerates it into the adapter surfaces; OR a linter config | Agent reads the rule each session; linter where expressible |
58
+ | Human working agreement (review norms, merge policy, communication, decision-recording) | Convention doc | `docs/process/<topic>.md` | Read by humans; cited in PR templates and onboarding |
59
+ | Pure-style point already owned by an adopted style guide | Neither — link to the style guide | The convention doc's "Authority" section | The style guide is the source of truth; do not restate it |
60
+
61
+ Do not duplicate a rule the adopted style guide or an existing linter config already enforces — link to it instead (single-source-of-truth; restating drifts). A code convention that a linter can check belongs in the linter config with a one-line pointer from the rule, not as prose the agent must interpret.
62
+
63
+ Write a machine rule into `.hatch3r/overrides/rules/`, not directly into a generated adapter surface such as `.cursor/rules/*.mdc` or `docs/process/`. A rule authored straight into the adapter output is invisible to `hatch3r status`/`verify` drift detection and is overwritten on the next `sync` regeneration (SA14.3-F6). The overrides subtree is the user-content surface `hatch3r` re-emits with overrides on every sync; `docs/process/` stays the home for human working agreements only.
64
+
65
+ ## Step 3: Cross-Check Against Existing Project Rules and Style Guides
66
+
67
+ Before drafting, reconcile against what already exists:
68
+
69
+ 1. **Read the current rule surface** — list every existing rule file and its `description`. A new convention that overlaps an existing rule is an amendment to that rule, not a new file (per content-authoring duplication check).
70
+ 2. **Read the adopted style guide** — if a candidate convention contradicts the team's published style guide, surface the conflict to the team with both positions and a recommended resolution; do not silently override. Record the resolution as an explicit override decision with rationale.
71
+ 3. **Detect internal contradictions** — two elicited agreements that conflict (e.g., "squash all PRs" vs "preserve commit history for releases") are a Step 5 ratification blocker, not a draft-time guess.
72
+
73
+ Output of this step: a reconciliation list — `{ candidate, status: new | amends:<rule-id> | conflicts:<source> | duplicate-drop }`.
74
+
75
+ ## Step 4: Draft to the Matching Template
76
+
77
+ **Project rule** (machine-enforceable code convention):
78
+ - Target path: `.hatch3r/overrides/rules/<id>.md` plus the `.mdc` companion (same body bytes; `scope: always` → `alwaysApply: true`, `scope: conditional` + `globs` → `globs: [...]` + `alwaysApply: false`). This is the user-content override surface `hatch3r` tracks for drift and regenerates on sync — the same path the `cursor` rule importer writes to.
79
+ - Frontmatter: `id`, `description` (one line, what the rule enforces), scope (`always` for repo-wide, or a glob for path-scoped).
80
+ - Body: each convention as `Convention → one concrete example → rationale`. State the passing condition concretely ("test files live next to source as `*.test.ts`", not "tests organized well").
81
+ - Link, do not restate, anything a linter or the adopted style guide already enforces.
82
+
83
+ **Convention doc** (`docs/process/<topic>.md`, working agreement):
84
+ 1. Purpose — one sentence: what this agreement governs and who it binds.
85
+ 2. Agreements — a table or numbered list, each row: the agreement, the rationale, and how it is verified or observed.
86
+ 3. Authority — the adopted style guide (name + URL) that wins on pure-style points; the decision-recording location.
87
+ 4. Review and revision — how the team amends this doc (so it stays a living agreement, not a frozen edict).
88
+ 5. Ownership footer — owner, ratifying team, last-updated date.
89
+
90
+ Both shapes: every agreement carries a rationale; no agreement is stated as an unexplained mandate. Use measurable passing conditions, not subjective adjectives ("PR description states the change and the why", not "good PR descriptions").
91
+
92
+ ## Step 5: Review With the Team, Then Persist
93
+
94
+ A convention written for a team is weaker than one written by a team; ownership is built, not delegated (team-charter methodology — see References). Before persisting:
95
+
96
+ 1. **Present the draft to the team for ratification** — every flagged item (no-rationale preferences, internal contradictions, style-guide overrides) is resolved by the team, not assumed. Surface them as explicit decisions.
97
+ 2. **Confirm scope** — repo-wide rule vs path-scoped; project doc vs shared-across-repos.
98
+ 3. **Persist each output to its tracked surface:**
99
+ - **Machine rule** → write `.hatch3r/overrides/rules/<id>.md` + its `.mdc` companion. This registers the rule in the user-content override surface, so `hatch3r status`/`verify` report drift on it and `hatch3r sync` regenerates it into the adapter outputs (`.cursor/rules/`, `CLAUDE.md`, Copilot instructions). A convention written straight into a generated adapter file instead is drift-invisible and is clobbered on the next sync (SA14.3-F6) — never persist there. If the team is instead amending an existing canonical rule rather than adding a new one, register the delta in `.hatch3r/hatch.json` `customization` (or the `.customize.md` layer) for that rule id, not a fresh override file.
100
+ - **Working agreement** → write the doc to `docs/process/<topic>.md` (human-facing; not a drift-tracked machine artifact).
101
+ Set the ownership footer (owner, ratifying team, last-updated) on each. Link the doc from the contributing guide or PR template so it is discoverable; an unlinked convention doc is not adopted.
102
+ 4. **Record the decision trail** — note which conventions were team-ratified and which are documented codebase-defaults, so a later reader knows what is negotiable.
103
+
104
+ ## Error Handling
105
+
106
+ - **Maintainer relays for an absent team and cannot ratify:** persist the draft marked `status: proposed — pending team ratification` and list the unresolved items; do not stamp it as an adopted agreement.
107
+ - **Candidate convention contradicts the adopted style guide:** surface both positions and a recommended resolution to the team; record the chosen override as an explicit decision with rationale. Never silently override the style guide.
108
+ - **Two elicited agreements conflict:** stop at Step 3, present both with trade-offs, and require a team decision before drafting. Do not guess the winner.
109
+ - **Overlap with an existing rule:** amend the existing rule rather than create a near-duplicate; cite the rule id in your output (duplication check).
110
+ - **Convention has no rationale:** flag it as a preference at Step 5 for the team to either justify or drop; do not persist unexplained mandates.
111
+
112
+ ## Definition of Done
113
+
114
+ - [ ] Conventions elicited from the team (or relayed) with one concrete example + rationale each
115
+ - [ ] Each item classified to its output shape (project rule vs working-agreement doc vs style-guide link)
116
+ - [ ] Reconciled against existing rules and the adopted style guide; conflicts and overrides resolved by the team, not assumed
117
+ - [ ] Drafted to the matching template with measurable passing conditions and per-agreement rationale
118
+ - [ ] Team-ratified (or marked `proposed — pending ratification`); ownership + last-updated footer present
119
+ - [ ] Machine rules written to `.hatch3r/overrides/rules/<id>.md` (+ `.mdc`) — or registered via `.hatch3r/hatch.json` `customization` when amending a canonical rule — so `hatch3r status`/`verify` track them and `sync` regenerates them; not authored straight into a generated adapter file
120
+ - [ ] Working agreements persisted to `docs/process/`, linked from contributing guide / PR template, and the negotiable-vs-default decision trail recorded
121
+ - [ ] No duplication of a rule an adopted style guide or linter already enforces
122
+
123
+ ## References
124
+
125
+ - Google. "Google's Engineering Practices documentation — The Standard of Code Review." `https://google.github.io/eng-practices/review/reviewer/standard.html` (accessed 2026-06-02, google.github.io, established-library / official-docs; CC-BY 3.0). Source for Step 1's authority principle (the style guide is the absolute authority on pure-style points; any style point not in the guide is personal preference) and the improvement-over-perfection framing applied to convention adoption. Repository: `https://github.com/google/eng-practices`.
126
+ - Atlassian. "How to Create a Team Charter — The Workstream." `https://www.atlassian.com/work-management/project-collaboration/team-charter` (accessed 2026-06-02, atlassian.com, established-library). Source for Step 1's elicitation stance and Step 5's ratification principle (a charter written BY the team holds; one written FOR the team decays — ownership is built, not delegated) and the purpose/values/roles/communication-norm component set behind the convention-doc template. Corroborated by Easy Agile, "Team Charter, Working Agreement, & Social Contract — Template and Guide." `https://www.easyagile.com/blog/team-charter-working-agreement-social-contract-template-guide` (accessed 2026-06-02, easyagile.com, established-library).