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,157 @@
1
+ ---
2
+ id: hatch3r-containerize
3
+ name: hatch3r-containerize
4
+ type: skill
5
+ description: Containerizes an application through a repeatable workflow — multi-stage Dockerfile, non-root hardening, minimal base image, .dockerignore, healthcheck, local docker-compose, Kubernetes manifest basics, and an image-scan gate. Use when adding or hardening container artifacts.
6
+ tags: [devops]
7
+ quality_charter: agents/shared/quality-charter.md
8
+ efficiency_patterns: agents/shared/efficiency-patterns.md
9
+ cache_friendly: true
10
+ ---
11
+
12
+ # Containerization Workflow
13
+
14
+ Companion workflow to the `hatch3r-devops` agent: that agent reviews and authors infrastructure across CI/CD, IaC, and orchestration with apply-step gating; this skill is the focused step-by-step procedure for producing a hardened container image and its local + orchestration manifests. Use this skill when the task is "containerize this service" or "harden this Dockerfile"; escalate to the agent when the work spans pipelines, cloud IaC, or a deployment strategy.
15
+
16
+ ## Quick Start
17
+
18
+ ```
19
+ Task Progress:
20
+ - [ ] Step 0: Detect ambiguity (P8 B1)
21
+ - [ ] Step 1: Pick a minimal base image + plan build/runtime split
22
+ - [ ] Step 2: Write the multi-stage Dockerfile
23
+ - [ ] Step 3: Harden — non-root USER, dropped privileges, HEALTHCHECK
24
+ - [ ] Step 4: Add .dockerignore + verify build context size
25
+ - [ ] Step 5: Author docker-compose for local dev
26
+ - [ ] Step 6: Author Kubernetes manifest with securityContext
27
+ - [ ] Step 7: Scan the image and gate on findings
28
+ ```
29
+
30
+ Two invariants bound every image this workflow produces: it runs as a non-root user, and it ships only runtime artifacts (no build toolchain, no secrets). Steps 2–3 establish both; Step 7 verifies them.
31
+
32
+ ## Step 0 — Detect Ambiguity (P8 B1)
33
+
34
+ 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`. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: language/runtime + version (drives base-image choice), whether the target is local-dev-only or production orchestration, the orchestrator (plain Docker vs docker-compose vs Kubernetes), whether secrets are needed at build time vs runtime (build-time secrets are an irreversible leak risk), and the registry the final image pushes to.
35
+
36
+ ## Fan-out Discipline (P8 B2)
37
+
38
+ 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:
39
+ - Tier 1 (one service, Dockerfile only): inline.
40
+ - Tier 2 (Dockerfile + compose + one K8s manifest for one service): spawn one sub-agent per artifact via the Task tool.
41
+ - Tier 3 (multi-service repo, one image set per service): one fresh sub-agent per service; orchestrator integrates the compose/manifest set only.
42
+
43
+ Emit `sub_agents_spawned: { count, rationale }` in your output.
44
+
45
+ ## Step 1: Pick a Minimal Base Image and Plan the Build/Runtime Split
46
+
47
+ - Choose the smallest base that runs the app: a `-slim` variant, a distroless image, or Alpine where the libc difference is acceptable. A smaller base shrinks attack surface and pull time (Docker best-practices — see References).
48
+ - Plan two stages: a build stage that carries the full toolchain (compilers, dev dependencies, test runners) and a runtime stage that carries only the built artifact plus its runtime dependencies (Docker multi-stage — see References).
49
+ - Pin the base image to a specific tag or digest (`node:22.5.1-slim`, not `node:latest`). A mutable tag makes the build non-reproducible.
50
+
51
+ ## Step 2: Write the Multi-Stage Dockerfile
52
+
53
+ Structure the Dockerfile so each `FROM` begins a stage and the final stage copies only the runtime output:
54
+
55
+ ```dockerfile
56
+ # --- build stage ---
57
+ FROM node:22.5.1-slim AS build
58
+ WORKDIR /app
59
+ COPY package.json package-lock.json ./
60
+ RUN npm ci
61
+ COPY . .
62
+ RUN npm run build && npm prune --omit=dev
63
+
64
+ # --- runtime stage ---
65
+ FROM node:22.5.1-slim AS runtime
66
+ WORKDIR /app
67
+ COPY --from=build /app/node_modules ./node_modules
68
+ COPY --from=build /app/dist ./dist
69
+ ```
70
+
71
+ - Order instructions stalest-to-freshest: copy the lockfile and install dependencies before copying source, so a code edit does not bust the dependency-install layer cache.
72
+ - `COPY --from=build` only the artifacts the app needs at runtime — never the source tree, build cache, or dev dependencies.
73
+ - Never write a secret into a layer. Use BuildKit build secrets (`RUN --mount=type=secret,...`) for build-time credentials and runtime environment injection for runtime credentials; a secret in any layer is recoverable from the image (OWASP Docker Security — see References).
74
+
75
+ ## Step 3: Harden — Non-Root, Dropped Privileges, Healthcheck
76
+
77
+ - Create a dedicated unprivileged user with an explicit UID/GID and switch to it before the run command. An explicit UID survives rebuilds and maps to a Kubernetes `runAsUser` (Docker best-practices — see References):
78
+
79
+ ```dockerfile
80
+ RUN groupadd -r app --gid=10001 && useradd -r -g app --uid=10001 app
81
+ USER app
82
+ ```
83
+
84
+ - Running as root is the most common dangerous container misconfiguration: a container escape inherits host root (OWASP Docker Security — see References). The non-root `USER` line is mandatory output of this step.
85
+ - Add a `HEALTHCHECK` so the orchestrator can detect and restart an unhealthy container — this is CIS Docker Benchmark control 4.6 (CIS — see References):
86
+
87
+ ```dockerfile
88
+ HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
89
+ CMD node ./dist/healthcheck.js || exit 1
90
+ ```
91
+
92
+ - Do not install `sudo`; its TTY and signal-forwarding behavior is unpredictable. If privilege elevation is unavoidable, use `gosu` (Docker best-practices — see References).
93
+ - Use `COPY` not `ADD` (ADD's URL-fetch and auto-extract behavior is a footgun); set `ENV NODE_ENV=production` (or the runtime equivalent) so the app does not load dev tooling.
94
+
95
+ ## Step 4: Add .dockerignore and Verify Build Context Size
96
+
97
+ - Author a `.dockerignore` excluding `.git`, `node_modules` (rebuilt in-image), `.env*`, test artifacts, CI config, and local build output. This keeps secrets out of the build context and shrinks the upload sent to the daemon.
98
+ - A `.env` file reaching the build context is a credential-leak path even if a layer does not copy it — exclude it explicitly.
99
+ - Verify: run the build and confirm the "transferring context" size is small (kilobytes, not the whole repo). A large context means the `.dockerignore` missed something.
100
+
101
+ ## Step 5: Author docker-compose for Local Dev
102
+
103
+ - Write a `docker-compose.yml` (or `compose.yaml`) that builds the image and wires backing services (database, cache, queue) for local development.
104
+ - Inject configuration via `environment:` / `env_file:` referencing a gitignored `.env`; never inline secrets in the compose file.
105
+ - Add a `healthcheck:` per service and use `depends_on:` with `condition: service_healthy` so the app waits for its database to be ready.
106
+ - Pin backing-service images to specific tags, mirroring the Dockerfile base-pin policy.
107
+ - Mount source as a volume only in the local-dev compose, never in the production image build.
108
+
109
+ ## Step 6: Author the Kubernetes Manifest with securityContext
110
+
111
+ - Author a Deployment + Service. Set a `securityContext` that enforces the Dockerfile hardening at the orchestrator layer (Kubernetes hardening — see References):
112
+
113
+ ```yaml
114
+ securityContext:
115
+ runAsNonRoot: true
116
+ runAsUser: 10001
117
+ allowPrivilegeEscalation: false
118
+ readOnlyRootFilesystem: true
119
+ capabilities:
120
+ drop: ["ALL"]
121
+ ```
122
+
123
+ - Set resource `requests` and `limits` (CPU + memory) so a runaway container cannot starve the node.
124
+ - Map the Dockerfile `HEALTHCHECK` to a `readinessProbe` and `livenessProbe` so Kubernetes gates traffic and restarts on the same signal.
125
+ - Reference secrets via a `Secret` object or external secret store; never inline credentials in the manifest.
126
+ - Drop all Linux capabilities and add back only what the workload requires (OWASP Docker Top 10 — see References).
127
+
128
+ ## Step 7: Scan the Image and Gate on Findings
129
+
130
+ - Build the image, then scan it with a vulnerability scanner (Trivy, Grype, or `docker scout`) before pushing. Trivy also runs CIS Docker/Kubernetes benchmark checks (Trivy / CIS — see References).
131
+ - Gate: block the push on any fixable HIGH or CRITICAL CVE. For an unfixable CVE with no upstream patch, record an explicit accepted-risk note with the CVE id and a re-check date rather than silently shipping.
132
+ - Re-scan after a base-image bump — a new base introduces a new CVE set.
133
+ - Optionally run a config linter (`hadolint` for the Dockerfile, Docker Bench for Security against the host) and surface findings alongside the CVE report.
134
+
135
+ ## Error Handling
136
+
137
+ - **Final image is unexpectedly large:** confirm the runtime stage copies only artifacts (Step 2), the base is a `-slim`/distroless variant (Step 1), and `.dockerignore` excludes `node_modules`/build output (Step 4). A multi-hundred-MB image usually means the build toolchain leaked into the runtime stage.
138
+ - **App fails to start as non-root:** the process is binding a privileged port (<1024) or writing to a path it no longer owns. Bind a high port and map it at the orchestrator, or `chown` the writable path to the app UID in the build stage. Do not revert to root.
139
+ - **`readOnlyRootFilesystem: true` breaks the app:** mount an `emptyDir` volume at the specific writable path (cache, tmp) the app needs rather than disabling the read-only root.
140
+ - **Scanner reports a CVE with no fix:** do not silently ship. Record the CVE id, affected package, and a re-evaluation date as an accepted-risk note; escalate if it is on the request path and exploitable.
141
+ - **Build needs a secret:** never `COPY` or `ARG` it into a layer. Use a BuildKit secret mount (`RUN --mount=type=secret`); if that is unavailable, build the artifact outside the image and `COPY` only the result.
142
+
143
+ ## Definition of Done
144
+
145
+ - [ ] Multi-stage Dockerfile: build stage and a runtime stage carrying only runtime artifacts
146
+ - [ ] Runs as a non-root user with an explicit UID; no `sudo`; `HEALTHCHECK` present
147
+ - [ ] Minimal pinned base image (no `latest`); `.dockerignore` verified to shrink the build context
148
+ - [ ] docker-compose for local dev with per-service healthchecks and gitignored secret injection
149
+ - [ ] Kubernetes manifest with `securityContext` (runAsNonRoot, dropped capabilities, read-only root), resource limits, and probes
150
+ - [ ] Image scanned; build/push gated on fixable HIGH/CRITICAL CVEs; accepted-risk notes recorded for unfixable findings
151
+ - [ ] No secret in any image layer, compose file, or manifest
152
+
153
+ ## References
154
+
155
+ - Docker, Inc. "Building best practices — Dockerfile." `https://docs.docker.com/build/building/best-practices/` (accessed 2026-06-02, Docker Docs, official-docs). Source for the minimal-base-image guidance (Step 1), the non-root `USER` with explicit UID and the no-`sudo`/`gosu` rule (Step 3), and `COPY`-over-`ADD`. Multi-stage build mechanics (Step 2): `https://docs.docker.com/build/building/multi-stage/`.
156
+ - OWASP Foundation. "Docker Security Cheat Sheet." `https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html` (accessed 2026-06-02, OWASP, official-docs). Source for the drop-all-capabilities-then-add-back posture (Steps 6), the no-secrets-in-layers rule (Steps 2–4), and the root-escape blast-radius rationale behind the mandatory non-root user (Step 3). Container-environment controls: OWASP Docker Top 10 `https://owasp.org/www-project-docker-top-10/`.
157
+ - Center for Internet Security / Aqua Security (Trivy). "CIS Docker Benchmark — HEALTHCHECK (control 4.6) and Trivy CIS benchmark scanning." `https://www.cisecurity.org/benchmark/docker` and `https://www.aquasec.com/blog/trivy-kubernetes-cis-benchmark-scanning/` (accessed 2026-06-02, CIS official-docs + Aqua Security established-library). Source for the `HEALTHCHECK` requirement (Step 3), the Kubernetes `securityContext` hardening fields (Step 6), and the Trivy CIS-benchmark image-scan gate (Step 7).
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  id: hatch3r-context-health
3
- description: Monitor and maintain conversation context health during long sessions. Use when context may be degrading, after many turns, or when experiencing repeated errors.
3
+ name: hatch3r-context-health
4
+ type: skill
5
+ description: Monitors and maintains conversation context health during long sessions. Use when context may be degrading, after many turns, or when experiencing repeated errors.
4
6
  tags: [maintenance]
5
7
  quality_charter: agents/shared/quality-charter.md
6
8
  efficiency_patterns: agents/shared/efficiency-patterns.md
@@ -25,12 +27,7 @@ Before any work, scan the invocation for unresolved questions in scope, intent,
25
27
 
26
28
  ## Fan-out Discipline (P8 B2)
27
29
 
28
- This skill delegates per task size:
29
- - Tier 1 (trivial single-file): inline execution acceptable.
30
- - Tier 2 (multi-file or multi-concern): spawn parallel sub-agents per concern via the Task tool.
31
- - Tier 3 (multi-module / high-risk): one fresh sub-agent per independent module or gate; orchestrator integrates only.
32
-
33
- Never under-fan-out to save tokens. Token cost is dominated by quality and completeness gains. Emit `sub_agents_spawned: { count, rationale }` in your output.
30
+ 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.
34
31
 
35
32
  ## Step 1: Assess Context Health
36
33
 
@@ -128,3 +125,8 @@ When `board-pickup` operates in auto-advance mode, context health is checked bet
128
125
  ## Related Skills & Agents
129
126
 
130
127
  - **Command**: `hatch3r-board-pickup` -- auto-advance mode uses context health for session management
128
+
129
+ ## References
130
+
131
+ - [Token counting — Anthropic API docs](https://docs.anthropic.com/en/docs/build-with-claude/token-counting) — accessed 2026-05-31, official-docs (Anthropic). Source for treating the 1-token-per-4-characters figure as an approximation when the platform does not expose exact token counts (Error Handling, Step 1).
132
+ - [Effective context engineering for AI agents — Anthropic engineering](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) — accessed 2026-05-31, official-docs (Anthropic). Source for the context-degradation and context-window-pressure signals behind the model-aware threshold profiles and the context-poisoning detection table.
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  id: hatch3r-cost-tracking
3
- description: Track token usage and estimate costs for agent sessions. Use when monitoring spend, approaching budget limits, or generating cost reports.
3
+ name: hatch3r-cost-tracking
4
+ type: skill
5
+ description: Tracks token usage and estimate costs for agent sessions. Use when monitoring spend, approaching budget limits, or generating cost reports.
4
6
  tags: [maintenance]
5
7
  quality_charter: agents/shared/quality-charter.md
6
8
  efficiency_patterns: agents/shared/efficiency-patterns.md
@@ -10,11 +12,14 @@ cache_friendly: true
10
12
 
11
13
  ## Quick Start
12
14
 
15
+ **Applies when:** the project tracks cloud/LLM spend against a budget. On a project with no cost-accounting need, skip (per `rules/hatch3r-right-sizing.md`).
16
+
13
17
  ```
14
18
  Task Progress:
15
19
  - [ ] Step 0: Detect ambiguity (P8 B1)
16
20
  - [ ] Step 1: Review cost tracking configuration
17
21
  - [ ] Step 2: Estimate current session token usage
22
+ - [ ] Step 2a: Re-fetch pricing before reporting (currency gate)
18
23
  - [ ] Step 3: Identify cost optimization opportunities
19
24
  - [ ] Step 4: Generate cost report
20
25
  ```
@@ -25,12 +30,7 @@ Before any work, scan the invocation for unresolved questions in scope, intent,
25
30
 
26
31
  ## Fan-out Discipline (P8 B2)
27
32
 
28
- This skill delegates per task size:
29
- - Tier 1 (trivial single-file): inline execution acceptable.
30
- - Tier 2 (multi-file or multi-concern): spawn parallel sub-agents per concern via the Task tool.
31
- - Tier 3 (multi-module / high-risk): one fresh sub-agent per independent module or gate; orchestrator integrates only.
32
-
33
- Never under-fan-out to save tokens. Token cost is dominated by quality and completeness gains. Emit `sub_agents_spawned: { count, rationale }` in your output.
33
+ 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.
34
34
 
35
35
  ## Step 1: Review Configuration
36
36
 
@@ -53,13 +53,25 @@ Estimate tokens for the current session using these rules:
53
53
 
54
54
  **Subagent cost multiplier.** Each subagent spawn carries a base cost for the agent protocol, included rules, and context. A pipeline with 8 subagents (researcher + implementer + reviewer + fixer + 4 Phase 4 specialists) has significant overhead from context re-transmission. Factor this into budget estimates.
55
55
 
56
- Calculate estimated cost using these model tier rates (reference ratesupdate based on actual provider pricing):
56
+ Calculate estimated cost using named-model rates tied to model IDs. Published-vendor rates drift between model releases re-fetch before every report per Step 2a; the `accessed:` date marks when each row was last verified.
57
+
58
+ | Model | Model ID | Input (per 1M) | Output (per 1M) | accessed |
59
+ |-------|----------|---------------:|----------------:|----------|
60
+ | Claude Haiku 4.5 | `claude-haiku-4-5` | $1.00 | $5.00 | 2026-06-05 |
61
+ | Claude Sonnet 4.6 | `claude-sonnet-4-6` | $3.00 | $15.00 | 2026-06-05 |
62
+ | Claude Opus 4.8 | `claude-opus-4-8` | $5.00 | $25.00 | 2026-06-05 |
63
+
64
+ **Cache-read multiplier.** Cached input tokens (`cache_read_input_tokens` in the API `usage` block) bill at ~0.1× the model's base input rate; cache writes bill at 1.25× (5-minute TTL) or 2× (1-hour TTL). When a session reuses a large cached prefix, price `cache_read_input_tokens` separately at 0.1× base input — counting them at full input rate overstates spend by up to 10× on cache-heavy agent loops. Total prompt size = `input_tokens` (uncached) + `cache_creation_input_tokens` + `cache_read_input_tokens`.
65
+
66
+ ### Step 2a: Re-fetch Pricing Before Reporting (currency gate)
57
67
 
58
- | Model Tier | Input (per 1M tokens) | Output (per 1M tokens) |
59
- |-----------|----------------------|----------------------|
60
- | Fast | $0.25 | $1.00 |
61
- | Standard | $3.00 | $15.00 |
62
- | Premium | $15.00 | $75.00 |
68
+ Published per-token rates change between model releases. Before emitting a cost figure, verify the rate table is current:
69
+
70
+ 1. If any row's `accessed:` date is older than 30 days, re-fetch the vendor's current pricing (Anthropic: https://www.anthropic.com/pricing, or the live `claude-api` skill's models/pricing reference) and update the row's rates + `accessed:` date in place.
71
+ 2. Confirm the model the session actually ran on maps to a named row. If the session used a model ID absent from the table (e.g. an older or non-Anthropic model), add a row with its published rates and `accessed:` date rather than defaulting to the nearest tier.
72
+ 3. State the `accessed:` date of the rate used directly in the report (see Step 4). A cost figure with no rate-provenance date is unverifiable — never report a dollar amount without it.
73
+
74
+ If pricing cannot be re-fetched (offline, vendor page unreachable), proceed with the on-file rates but flag the figure as `(rates as of <accessed-date>, not re-verified)` in the report.
63
75
 
64
76
  ### Default Budgets
65
77
 
@@ -102,11 +114,13 @@ Produce a cost report in this format:
102
114
  **Period:** {session/issue/sprint}
103
115
 
104
116
  **Token Usage:**
105
- - Input tokens: ~{n}
117
+ - Input tokens (uncached): ~{n}
118
+ - Cache-read tokens: ~{n} (billed ~0.1x base input)
119
+ - Cache-write tokens: ~{n} (billed 1.25x / 2x by TTL)
106
120
  - Output tokens: ~{n}
107
121
  - Total tokens: ~{n}
108
122
 
109
- **Estimated Cost:** ${amount}
123
+ **Estimated Cost:** ${amount} ({model-id}, rates accessed {YYYY-MM-DD})
110
124
 
111
125
  **Budget Status:** {amount} / {budget} ({percentage}%)
112
126
 
@@ -124,7 +138,7 @@ Produce a cost report in this format:
124
138
  - {suggestions based on usage patterns}
125
139
  ```
126
140
 
127
- Include total estimated tokens (input + output), estimated cost at current model tier, budget status (if configured), and top optimization opportunities. Always present estimated values with the `~` prefix. Never suppress threshold alerts.
141
+ Include total estimated tokens (uncached input + cache-read + cache-write + output), estimated cost at the named-model rate with its `accessed:` date, budget status (if configured), and top optimization opportunities. Always present estimated values with the `~` prefix. Never report a dollar figure without the model ID and rate-access date. Never suppress threshold alerts.
128
142
 
129
143
  ## Error Handling
130
144
 
@@ -135,10 +149,16 @@ Include total estimated tokens (input + output), estimated cost at current model
135
149
  ## Definition of Done
136
150
 
137
151
  - [ ] Cost configuration reviewed (or report-only mode noted)
138
- - [ ] Token usage estimated for current session
152
+ - [ ] Token usage estimated for current session (uncached input / cache-read / cache-write / output split)
153
+ - [ ] Pricing rates verified current per Step 2a; report cites model ID + rate `accessed:` date
139
154
  - [ ] Optimization opportunities identified
140
155
  - [ ] Cost report generated with budget status
141
156
 
142
157
  ## Related Skills & Agents
143
158
 
144
159
  - **Skill**: `hatch3r-context-health` — context health monitoring complements cost tracking for session management
160
+
161
+ ## References
162
+
163
+ - [Anthropic API pricing](https://www.anthropic.com/pricing) — accessed 2026-06-05, official-docs (Anthropic). Source for the per-million-token input/output rates per named model (Haiku 4.5 $1/$5, Sonnet 4.6 $3/$15, Opus 4.8 $5/$25) and the cache-read 0.1x / cache-write 1.25x-2x multipliers in Step 2; these drift between model releases — re-verify per Step 2a when running a cost report.
164
+ - [Token counting — Anthropic API docs](https://docs.anthropic.com/en/docs/build-with-claude/token-counting) — accessed 2026-06-05, official-docs (Anthropic). Source for treating the ~4-characters-per-token figure as an approximation; the documented count-tokens endpoint is authoritative when exact counts are required.
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  id: hatch3r-customize
3
- description: Create and manage customization files for any hatch3r artifact type (agents, commands, rules, skills). Supports model overrides, description changes, scope overrides, enable/disable control, and project-specific markdown instructions.
3
+ name: hatch3r-customize
4
+ type: skill
5
+ description: Creates and manages customization files for any hatch3r artifact type (agents, commands, rules, skills). Supports model overrides, description changes, scope overrides, enable/disable control, and project-specific markdown instructions.
4
6
  tags: [customize]
5
7
  quality_charter: agents/shared/quality-charter.md
6
8
  efficiency_patterns: agents/shared/efficiency-patterns.md
@@ -8,7 +10,7 @@ cache_friendly: true
8
10
  ---
9
11
  # Artifact Customization Management
10
12
 
11
- > **Canonical entry point.** This is the single skill for all per-artifact customization (agents, commands, rules, skills). The four prior type-specific skill stubs were removed in v1.9.0 per the Decision #13 Command-vs-Skill criterion; `governance/audit/domains/D16-compound-system.md` SA 16.3 documents the rejected-merge alternative.
13
+ > **Canonical entry point.** This is the single skill for all per-artifact customization (agents, commands, rules, skills). The four prior type-specific skill stubs were removed in v1.9.0 per the Decision #13 Command-vs-Skill criterion; hatch3r's artifact-inventory and redundancy analysis documents the rejected-merge alternative.
12
14
 
13
15
  ## Quick Start
14
16
 
@@ -29,12 +31,7 @@ Before any work, scan the invocation for unresolved questions in scope, intent,
29
31
 
30
32
  ## Fan-out Discipline (P8 B2)
31
33
 
32
- This skill delegates per task size:
33
- - Tier 1 (trivial single-file): inline execution acceptable.
34
- - Tier 2 (multi-file or multi-concern): spawn parallel sub-agents per concern via the Task tool.
35
- - Tier 3 (multi-module / high-risk): one fresh sub-agent per independent module or gate; orchestrator integrates only.
36
-
37
- Never under-fan-out to save tokens. Token cost is dominated by quality and completeness gains. Emit `sub_agents_spawned: { count, rationale }` in your output.
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.
38
35
 
39
36
  ## Artifact Types
40
37
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  id: hatch3r-dep-audit
3
- description: Audit and update npm dependencies for security, freshness, and bundle impact. Use when auditing dependencies, responding to CVEs, or upgrading packages.
3
+ name: hatch3r-dep-audit
4
+ type: skill
5
+ description: Audits and updates npm dependencies for security, freshness, and bundle impact. Use when auditing dependencies, responding to CVEs, or upgrading packages.
4
6
  tags: [maintenance, floor:security]
5
7
  quality_charter: agents/shared/quality-charter.md
6
8
  efficiency_patterns: agents/shared/efficiency-patterns.md
@@ -29,12 +31,19 @@ Before any work, scan the invocation for unresolved questions in scope, intent,
29
31
 
30
32
  ## Fan-out Discipline (P8 B2)
31
33
 
32
- This skill delegates per task size:
33
- - Tier 1 (trivial single-file): inline execution acceptable.
34
- - Tier 2 (multi-file or multi-concern): spawn parallel sub-agents per concern via the Task tool.
35
- - Tier 3 (multi-module / high-risk): one fresh sub-agent per independent module or gate; orchestrator integrates only.
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.
36
35
 
37
- Never under-fan-out to save tokens. Token cost is dominated by quality and completeness gains. Emit `sub_agents_spawned: { count, rationale }` in your output.
36
+ ## Required Agent Delegation
37
+
38
+ > **Note:** When this skill is invoked via an orchestration pipeline (a `commands/hatch3r-*.md` flow), skip this section — the orchestrator handles agent delegation.
39
+
40
+ This skill realizes the two-agent dependency pattern (governance PRD Decision 13, F13.1-F04): the agent that *assesses* upgrade risk is distinct from the agent that *applies* it. Spawn these agents via the Task tool (`subagent_type: "generalPurpose"`) at the points below:
41
+
42
+ - **`hatch3r-dependency-drafter`** (analysis phase, Steps 1–3) — MUST spawn to inventory the dependency surface, classify each candidate by SemVer band, cross-check advisories, and draft the per-dependency proposal (current pin → proposed pin, band, driver, risk, consumer call sites, verification gate). The drafter is read-only (its `tools.deny` forbids manifest edits and installs), so its proposal is a reviewable decision artifact, not a mutation. Skip only for a trivial single-package patch already scoped by the invocation.
43
+ - **`hatch3r-fixer`** (apply phase, Step 4) — MUST spawn under reviewer authority to perform the manifest edit + `npm install` + per-upgrade verification the drafter's proposal names. The fixer flips each proposal from `drafted` to `applied` after its row's verification gate passes.
44
+ - **`hatch3r-devops`** (apply phase, Step 4 — CI-wiring variant) — spawn instead of `hatch3r-fixer` when the upgrade requires CI manifest wiring (lockfile-cache keys, build-matrix version pins, Renovate/Dependabot config) rather than only a source-tree dependency bump.
45
+
46
+ The drafter never applies and the fixer/devops never re-assess risk — the split keeps risk assessment separate from risk acceptance.
38
47
 
39
48
  ## Step 1: Gather Findings
40
49
 
@@ -75,10 +84,12 @@ Before changing anything:
75
84
  ## Step 5: Verify
76
85
 
77
86
  ```bash
78
- npm run lint && npm run typecheck && npm run test
87
+ ${HATCH3R:VERIFY_GATE_ALL}
79
88
  npm run build
80
89
  ```
81
90
 
91
+ The gate line is resolved to the project's language-aware command set at sync time (fallback when detection is unknown: `npm run lint && npm run typecheck && npm run test`); the build line is illustrative — substitute the project's build command.
92
+
82
93
  - Confirm bundle size within budget (if defined).
83
94
  - Run `npm audit` — no critical or high vulnerabilities remaining.
84
95
  - Verify `package-lock.json` is committed by checking `git status` for untracked or modified lockfile.
@@ -111,3 +122,8 @@ For CVEs or outdated packages not addressed in this session, create a tracking i
111
122
  - [ ] `package-lock.json` committed
112
123
  - [ ] PR includes upgrade rationale and bundle impact
113
124
  - [ ] No duplicate packages; unused deps removed
125
+
126
+ ## References
127
+
128
+ - [npm audit — npm CLI docs](https://docs.npmjs.com/cli/v10/commands/npm-audit) — accessed 2026-05-31, official-docs (npm, Inc.). Source for the `npm audit` severity buckets (critical/high/moderate/low) and `npm outdated` semantics used in Step 1.
129
+ - [GitHub security advisories REST API](https://docs.github.com/en/rest/security-advisories/repository-advisories) — accessed 2026-05-31, official-docs (GitHub). Source for the `gh api /repos/{owner}/{repo}/security-advisories` CVE-research path in Step 2.
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  id: hatch3r-design-system-detect
3
+ name: hatch3r-design-system-detect
3
4
  type: skill
4
- description: Detect existing design tokens, component library, and theming convention in a project before authoring new UI primitives — output a concise inventory for downstream implementers
5
+ description: Detects existing design tokens, component library, and theming convention in a project before authoring new UI primitives — output a concise inventory for downstream implementers
5
6
  tags: [implementation, floor:ui-ux, ui, design-system, frontend]
6
7
  quality_charter: agents/shared/quality-charter.md
7
8
  efficiency_patterns: agents/shared/efficiency-patterns.md
@@ -29,12 +30,7 @@ Before any work, scan the invocation for unresolved questions in scope, intent,
29
30
 
30
31
  ## Fan-out Discipline (P8 B2)
31
32
 
32
- This skill delegates per task size:
33
- - Tier 1 (trivial single-file): inline execution acceptable.
34
- - Tier 2 (multi-file or multi-concern): spawn parallel sub-agents per concern via the Task tool.
35
- - Tier 3 (multi-module / high-risk): one fresh sub-agent per independent module or gate; orchestrator integrates only.
36
-
37
- Never under-fan-out to save tokens. Token cost is dominated by quality and completeness gains. Emit `sub_agents_spawned: { count, rationale }` in your output.
33
+ 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.
38
34
 
39
35
  ## Step 1: Scan package.json for design-system signals
40
36
 
@@ -0,0 +1,159 @@
1
+ ---
2
+ id: hatch3r-docs-writing
3
+ name: hatch3r-docs-writing
4
+ type: skill
5
+ description: Authors technical documentation through a repeatable workflow — audience analysis, Diátaxis-mode selection, structure, draft, review, publish. Covers READMEs, ADRs, API docs, and runbooks. Use when writing or restructuring any project documentation.
6
+ tags: [maintenance]
7
+ quality_charter: agents/shared/quality-charter.md
8
+ efficiency_patterns: agents/shared/efficiency-patterns.md
9
+ cache_friendly: true
10
+ ---
11
+
12
+ # Technical Documentation Workflow
13
+
14
+ Companion workflow to the `hatch3r-docs-writer` agent: that agent is the Phase-4 specialist invoked to update specs after a code change; this skill is the step-by-step procedure a human or agent follows to author a documentation artifact from scratch. Use the agent when documentation must track a `src/` diff; use this skill when authoring a new doc and you need the audience-analysis-through-publish sequence.
15
+
16
+ ## Quick Start
17
+
18
+ ```
19
+ Task Progress:
20
+ - [ ] Step 0: Detect ambiguity (P8 B1)
21
+ - [ ] Step 1: Classify the doc by Diátaxis mode + name the audience
22
+ - [ ] Step 2: Pick the structure template for the chosen mode
23
+ - [ ] Step 3: Draft to the template, one mode per document
24
+ - [ ] Step 4: Run the review checklist (audience, accuracy, style, structure)
25
+ - [ ] Step 5: Publish — link from an index, set owner + last-updated, verify cross-references
26
+ ```
27
+
28
+ The load-bearing decision is Step 1: a document serves exactly one of four user needs. Mixing learning content into a reference table, or burying a how-to procedure inside an explanation, is the most common defect this workflow prevents (Diátaxis — see References).
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 audience, 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 doc type is wanted (README vs ADR vs API reference vs runbook), the reader's existing competence (new user vs maintainer vs on-call), whether an existing doc is being restructured (irreversible section moves), and where the published doc is linked from.
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`). Tier boundaries for THIS skill:
37
+ - Tier 1 (single doc, single mode): inline.
38
+ - Tier 2 (multi-doc set, e.g. README + API reference + runbook for one feature): spawn one sub-agent per document via the Task tool; each authors to its own Diátaxis mode.
39
+ - Tier 3 (full docs-site restructure across many modes): one fresh sub-agent per top-level section; orchestrator integrates the index only.
40
+
41
+ Emit `sub_agents_spawned: { count, rationale }` in your output.
42
+
43
+ ## Step 1: Classify by Diátaxis Mode and Name the Audience
44
+
45
+ Every document answers exactly one of four user needs. Pick one mode before writing a single sentence; if a request spans two, split it into two documents.
46
+
47
+ | Mode | User need | Reader state | Writing stance |
48
+ |------|-----------|--------------|----------------|
49
+ | Tutorial | Learning by doing | Newcomer, no prior context | Lesson — guarantee a working result, hide edge cases |
50
+ | How-to guide | Achieving a stated goal | Already competent, has a task | Recipe — numbered steps to one outcome, no theory |
51
+ | Reference | Looking up a fact | Working, needs accuracy | Description — complete, dry, structured, no narrative |
52
+ | Explanation | Understanding why | Studying, off-task | Discussion — context, trade-offs, alternatives, rationale |
53
+
54
+ Map common artifacts to modes:
55
+
56
+ | Artifact | Primary mode | Note |
57
+ |----------|--------------|------|
58
+ | README | How-to (quickstart) + Reference (config) | Lead with the 60-second "get it running" path; link out to deep docs |
59
+ | API docs | Reference | Endpoint, params, request/response shapes, error codes, auth — one entry per endpoint |
60
+ | Runbook | How-to | Operational procedure: prerequisites, numbered steps, verification, rollback |
61
+ | ADR | Explanation | A decision and its rationale — context, decision, consequences |
62
+
63
+ Name the audience explicitly in one sentence (e.g., "on-call engineer mid-incident, has shell access, has not seen this service before"). Write to a US-English global-audience reader: short unambiguous sentences, active voice, direct address with "you" (Google dev-docs style — see References). The audience sentence drives every later choice — vocabulary, assumed prerequisites, depth.
64
+
65
+ ## Step 2: Pick the Structure Template
66
+
67
+ Use the template for the mode chosen in Step 1.
68
+
69
+ **README (how-to + reference):**
70
+ 1. One-line description of what the project is.
71
+ 2. Quickstart — the shortest verified path from clone to a running result.
72
+ 3. Prerequisites (versions, accounts, tools).
73
+ 4. Configuration reference (table: option, type, default, description).
74
+ 5. Links to deeper docs (tutorial, full reference, contributing).
75
+
76
+ **ADR (Nygard format — see References):**
77
+ 1. Title (`NNNN-short-decision-name`).
78
+ 2. Status (proposed | accepted | rejected | deprecated | superseded by NNNN).
79
+ 3. Context (the forces and problem that motivate the decision).
80
+ 4. Decision (the change, stated as "we will…").
81
+ 5. Consequences (positive and negative effects, including new obligations).
82
+
83
+ **API reference (one block per endpoint):**
84
+ - Method + path; one-line purpose.
85
+ - Authentication required (scheme + scope).
86
+ - Request: path/query/body params (table: name, type, required, description).
87
+ - Response: success shape + status, paginated where applicable.
88
+ - Errors: status code + meaning + when it fires.
89
+
90
+ **Runbook (how-to):**
91
+ 1. Trigger — what condition this runbook handles.
92
+ 2. Prerequisites — access, tools, on-call context.
93
+ 3. Numbered steps — each step one action with the exact command.
94
+ 4. Verification — the observable signal that confirms success.
95
+ 5. Rollback — how to undo if a step fails.
96
+ 6. Escalation — who to page if the runbook does not resolve it.
97
+
98
+ ## Step 3: Draft to the Template
99
+
100
+ - Write to the one chosen mode. If you reach for "but first, some background" inside a how-to, that background belongs in a separate explanation doc — link to it instead.
101
+ - Use a descriptive heading that matches the content type: a bare infinitive for a task heading ("Configure the database"), a noun phrase for a concept heading ("Database configuration") — Google dev-docs style.
102
+ - Put structured facts in tables (config options, params, error codes, invariants), not prose.
103
+ - Put acceptance criteria and operational steps in checklists or numbered lists.
104
+ - Use stable IDs from the project glossary (event IDs, invariant IDs) so the doc survives renames.
105
+ - Every code example uses a current, non-deprecated API — verify against the library's docs at draft time.
106
+ - State confidence on any claim you could not verify against source: mark it `[unverified]` and recommend a maintainer check before publish (quality charter — confidence levels).
107
+
108
+ ## Step 4: Review Checklist
109
+
110
+ Run all four lenses before publishing. A failure on any line is a blocker.
111
+
112
+ **Audience:**
113
+ - [ ] The named reader can act on this doc with only the prerequisites it lists — no unstated assumed knowledge.
114
+ - [ ] Depth matches the audience: a tutorial hides edge cases; a reference omits none.
115
+
116
+ **Accuracy:**
117
+ - [ ] Every command, code block, and config value was run or read against the current source — no copy-from-memory.
118
+ - [ ] Cross-references resolve (no dead links, no renamed-away anchors).
119
+ - [ ] Stable IDs match the glossary.
120
+
121
+ **Style:**
122
+ - [ ] Active voice, second person, short sentences (Google dev-docs style).
123
+ - [ ] No filler ("it is important to note", "simply", "just"); state the fact directly.
124
+ - [ ] Headings match content type (infinitive for task, noun phrase for concept).
125
+
126
+ **Structure:**
127
+ - [ ] One Diátaxis mode per document — no learning content in a reference, no theory in a how-to.
128
+ - [ ] Findable from an index or parent doc.
129
+ - [ ] README leads with a runnable quickstart; runbook ends with verification + rollback; ADR records consequences.
130
+
131
+ ## Step 5: Publish
132
+
133
+ - Link the new doc from its index or parent (a doc no one can find does not exist).
134
+ - Add an ownership footer: owner, reviewers, last-updated date.
135
+ - Re-verify cross-references after the file lands at its final path (anchors shift when filenames change).
136
+ - For docs that mirror code (API reference, config reference), note the source-of-truth file path so the next editor knows what to re-check against.
137
+ - Lint markdown before declaring done (e.g., `npx markdownlint <path>`); a broken table or heading level is a structure defect.
138
+
139
+ ## Error Handling
140
+
141
+ - **Source code contradicts the existing doc:** the code is the source of truth for behavior. Update the doc to match observed behavior and flag the stale section in the change summary; do not document the intended-but-absent behavior.
142
+ - **Request spans two Diátaxis modes:** do not blend them. Split into two documents (e.g., a how-to guide plus a linked explanation) and state the split in your output.
143
+ - **Cannot verify a code example against source:** mark the example `[unverified]`, recommend a maintainer run it, and lower the document's stated confidence to medium rather than publishing an unverified example as fact.
144
+ - **No index or parent to link from:** create or identify the index entry as part of this work — an unlinked doc fails Step 5.
145
+
146
+ ## Definition of Done
147
+
148
+ - [ ] Document classified to exactly one Diátaxis mode with a one-sentence named audience
149
+ - [ ] Authored to the matching structure template
150
+ - [ ] All four review-checklist lenses pass (audience, accuracy, style, structure)
151
+ - [ ] Linked from an index/parent; ownership + last-updated footer present
152
+ - [ ] Cross-references resolve and code examples verified against current source (or marked `[unverified]`)
153
+ - [ ] No secrets, tokens, or internal-only URLs in the published text
154
+
155
+ ## References
156
+
157
+ - Procida, Daniele. "Diátaxis — Start here." `https://diataxis.fr/start-here/` (accessed 2026-06-02, diataxis.fr, peer-reviewed-methodology). Source for the four-mode classification in Step 1 (tutorial / how-to / reference / explanation) and the one-mode-per-document discipline enforced in Steps 3–4.
158
+ - Google. "Google developer documentation style guide — Highlights." `https://developers.google.com/style/highlights` (accessed 2026-06-02, Google for Developers, official-docs). Source for the global-audience writing stance (active voice, second person, short sentences) and the task-vs-concept heading rule (bare infinitive vs noun phrase) in Steps 1–4. Procedures guidance: `https://developers.google.com/style/procedures`.
159
+ - Nygard, Michael. "Documenting Architecture Decisions." `https://www.cognitect.com/blog/2011/11/15/documenting-architecture-decisions` (accessed 2026-06-02, Cognitect, established-library; ADR template used in 723+ open-source repositories per `https://adr.github.io/`). Source for the ADR structure template in Step 2 (Title / Status / Context / Decision / Consequences).