hatch3r 1.8.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.md +68 -178
  2. package/dist/cli/index.js +26966 -15942
  3. package/{agents → dist/content/agents}/hatch3r-architect.md +39 -9
  4. package/dist/content/agents/hatch3r-brownfield-spec.md +254 -0
  5. package/{agents → dist/content/agents}/hatch3r-ci-watcher.md +10 -3
  6. package/{agents → dist/content/agents}/hatch3r-context-rules.md +24 -6
  7. package/{agents → dist/content/agents}/hatch3r-creator.md +78 -39
  8. package/dist/content/agents/hatch3r-dependency-drafter.md +162 -0
  9. package/{agents → dist/content/agents}/hatch3r-devops.md +14 -4
  10. package/{agents → dist/content/agents}/hatch3r-docs-writer.md +11 -1
  11. package/dist/content/agents/hatch3r-edge-case-analyst.md +134 -0
  12. package/dist/content/agents/hatch3r-enhancability.md +192 -0
  13. package/{agents → dist/content/agents}/hatch3r-fixer.md +61 -10
  14. package/dist/content/agents/hatch3r-greenfield-spec.md +256 -0
  15. package/{agents → dist/content/agents}/hatch3r-handoff-loader.md +40 -14
  16. package/{agents → dist/content/agents}/hatch3r-handoff-preparer.md +17 -8
  17. package/dist/content/agents/hatch3r-implementer.md +409 -0
  18. package/dist/content/agents/hatch3r-incident-responder.md +96 -0
  19. package/dist/content/agents/hatch3r-learnings-loader.md +377 -0
  20. package/{agents → dist/content/agents}/hatch3r-lint-fixer.md +16 -4
  21. package/dist/content/agents/hatch3r-maintainability.md +183 -0
  22. package/dist/content/agents/hatch3r-pack-installer.md +113 -0
  23. package/dist/content/agents/hatch3r-performance.md +179 -0
  24. package/dist/content/agents/hatch3r-reliability.md +193 -0
  25. package/{agents → dist/content/agents}/hatch3r-researcher.md +30 -7
  26. package/dist/content/agents/hatch3r-reviewer.md +364 -0
  27. package/dist/content/agents/hatch3r-scalability.md +162 -0
  28. package/dist/content/agents/hatch3r-security.md +197 -0
  29. package/dist/content/agents/hatch3r-testability.md +204 -0
  30. package/dist/content/agents/hatch3r-ui.md +175 -0
  31. package/dist/content/agents/hatch3r-ux.md +160 -0
  32. package/{agents → dist/content/agents}/modes/requirements-elicitation.md +1 -1
  33. package/{agents → dist/content/agents}/modes/user-flows.md +2 -2
  34. package/dist/content/agents/shared/clarification-default-block.md +44 -0
  35. package/dist/content/agents/shared/confidence-gate.md +42 -0
  36. package/dist/content/agents/shared/cq-specialist-roster.md +26 -0
  37. package/{agents → dist/content/agents}/shared/efficiency-patterns.md +32 -1
  38. package/{agents → dist/content/agents}/shared/external-knowledge.md +1 -1
  39. package/{agents → dist/content/agents}/shared/injection-patterns.md +19 -8
  40. package/dist/content/agents/shared/principles.md +60 -0
  41. package/{agents → dist/content/agents}/shared/prompt-structure.md +7 -1
  42. package/{agents → dist/content/agents}/shared/quality-charter.md +73 -9
  43. package/dist/content/agents/shared/quality-specialist-frame.md +141 -0
  44. package/dist/content/agents/shared/rigor-contract.md +151 -0
  45. package/dist/content/agents/shared/severity-mapping.md +92 -0
  46. package/dist/content/agents/shared/triage-vocabulary.md +46 -0
  47. package/{agents → dist/content/agents}/shared/user-content-templates.md +40 -14
  48. package/dist/content/agents/shared/user-question-protocol.md +139 -0
  49. package/{checks → dist/content/checks}/README.md +5 -0
  50. package/{checks → dist/content/checks}/accessibility.md +14 -7
  51. package/{checks → dist/content/checks}/code-quality.md +1 -1
  52. package/{checks → dist/content/checks}/performance.md +7 -4
  53. package/{checks → dist/content/checks}/security.md +6 -6
  54. package/{checks → dist/content/checks}/testing.md +1 -1
  55. package/{commands → dist/content/commands}/board/pickup-azure-devops.md +1 -1
  56. package/{commands → dist/content/commands}/board/pickup-delegation-multi.md +41 -14
  57. package/{commands → dist/content/commands}/board/pickup-delegation.md +10 -8
  58. package/{commands → dist/content/commands}/board/pickup-github.md +1 -1
  59. package/{commands → dist/content/commands}/board/pickup-gitlab.md +1 -1
  60. package/{commands → dist/content/commands}/board/pickup-modes.md +1 -0
  61. package/{commands → dist/content/commands}/board/pickup-post-impl.md +2 -2
  62. package/{commands → dist/content/commands}/board/shared-azure-devops.md +1 -1
  63. package/{commands → dist/content/commands}/board/shared-github.md +2 -2
  64. package/{commands → dist/content/commands}/board/shared-gitlab.md +1 -1
  65. package/{commands → dist/content/commands}/hatch3r-api-spec.md +80 -3
  66. package/dist/content/commands/hatch3r-auth-scaffold.md +250 -0
  67. package/{commands → dist/content/commands}/hatch3r-benchmark.md +91 -8
  68. package/{commands → dist/content/commands}/hatch3r-board-fill.md +104 -18
  69. package/{commands → dist/content/commands}/hatch3r-board-pickup.md +99 -15
  70. package/dist/content/commands/hatch3r-bug-pipeline.md +240 -0
  71. package/{commands → dist/content/commands}/hatch3r-bug-plan.md +84 -8
  72. package/{commands → dist/content/commands}/hatch3r-codebase-map.md +82 -6
  73. package/{commands → dist/content/commands}/hatch3r-create.md +116 -18
  74. package/{commands → dist/content/commands}/hatch3r-debug.md +112 -24
  75. package/dist/content/commands/hatch3r-diagnose.md +238 -0
  76. package/{commands → dist/content/commands}/hatch3r-feature-plan.md +130 -10
  77. package/dist/content/commands/hatch3r-handoff.md +213 -0
  78. package/{commands → dist/content/commands}/hatch3r-healthcheck.md +106 -6
  79. package/dist/content/commands/hatch3r-incident-response.md +228 -0
  80. package/{commands → dist/content/commands}/hatch3r-migration-plan.md +81 -5
  81. package/{commands → dist/content/commands}/hatch3r-onboard.md +100 -9
  82. package/dist/content/commands/hatch3r-pack-install.md +243 -0
  83. package/{commands → dist/content/commands}/hatch3r-pr-resolve.md +114 -31
  84. package/{commands → dist/content/commands}/hatch3r-project-spec.md +85 -9
  85. package/{commands → dist/content/commands}/hatch3r-quick-change.md +115 -20
  86. package/{commands → dist/content/commands}/hatch3r-refactor-plan.md +82 -6
  87. package/dist/content/commands/hatch3r-release.md +401 -0
  88. package/{commands → dist/content/commands}/hatch3r-revision.md +104 -18
  89. package/{commands → dist/content/commands}/hatch3r-roadmap.md +94 -12
  90. package/{commands → dist/content/commands}/hatch3r-security-audit.md +107 -7
  91. package/dist/content/commands/hatch3r-slo-scaffold.md +246 -0
  92. package/dist/content/commands/hatch3r-spec.md +216 -0
  93. package/{commands → dist/content/commands}/hatch3r-test-plan.md +90 -14
  94. package/dist/content/commands/hatch3r-workflow.md +628 -0
  95. package/{commands → dist/content/commands}/revision/revision-delegation.md +8 -7
  96. package/{commands → dist/content/commands}/revision/revision-modes.md +49 -4
  97. package/{commands → dist/content/commands}/revision/revision-quality.md +12 -9
  98. package/dist/content/commands/shared/orchestration-frame.md +119 -0
  99. package/{github-agents → dist/content/github-agents}/hatch3r-docs-agent.md +22 -2
  100. package/dist/content/github-agents/hatch3r-lint-agent.md +66 -0
  101. package/{github-agents → dist/content/github-agents}/hatch3r-security-agent.md +22 -2
  102. package/{github-agents → dist/content/github-agents}/hatch3r-test-agent.md +22 -2
  103. package/{hooks → dist/content/hooks}/hatch3r-ci-failure.md +3 -3
  104. package/{hooks → dist/content/hooks}/hatch3r-file-save.md +4 -4
  105. package/{hooks → dist/content/hooks}/hatch3r-post-merge.md +1 -1
  106. package/{hooks → dist/content/hooks}/hatch3r-pre-commit.md +1 -1
  107. package/{hooks → dist/content/hooks}/hatch3r-pre-push.md +7 -7
  108. package/dist/content/hooks/hatch3r-review-loop-cap.md +52 -0
  109. package/{hooks → dist/content/hooks}/hatch3r-session-start.md +3 -3
  110. package/{mcp → dist/content/mcp}/mcp.json +7 -5
  111. package/{rules → dist/content/rules}/hatch3r-accessibility-standards.md +16 -3
  112. package/{rules → dist/content/rules}/hatch3r-accessibility-standards.mdc +13 -1
  113. package/dist/content/rules/hatch3r-agent-orchestration-detail.md +250 -0
  114. package/dist/content/rules/hatch3r-agent-orchestration-detail.mdc +245 -0
  115. package/dist/content/rules/hatch3r-agent-orchestration.md +250 -0
  116. package/dist/content/rules/hatch3r-agent-orchestration.mdc +245 -0
  117. package/{rules → dist/content/rules}/hatch3r-ai-evals.md +7 -5
  118. package/{rules → dist/content/rules}/hatch3r-ai-evals.mdc +5 -4
  119. package/{rules → dist/content/rules}/hatch3r-ai-ux-patterns.md +7 -3
  120. package/{rules → dist/content/rules}/hatch3r-ai-ux-patterns.mdc +4 -1
  121. package/dist/content/rules/hatch3r-android-patterns.md +107 -0
  122. package/dist/content/rules/hatch3r-android-patterns.mdc +102 -0
  123. package/dist/content/rules/hatch3r-anti-duplication.md +115 -0
  124. package/dist/content/rules/hatch3r-anti-duplication.mdc +115 -0
  125. package/{rules → dist/content/rules}/hatch3r-api-design.md +5 -1
  126. package/{rules → dist/content/rules}/hatch3r-api-design.mdc +3 -0
  127. package/{rules → dist/content/rules}/hatch3r-api-versioning.md +3 -1
  128. package/{rules → dist/content/rules}/hatch3r-api-versioning.mdc +1 -0
  129. package/{rules → dist/content/rules}/hatch3r-auth-patterns.md +5 -2
  130. package/{rules → dist/content/rules}/hatch3r-auth-patterns.mdc +2 -0
  131. package/{rules → dist/content/rules}/hatch3r-browser-verification.md +8 -10
  132. package/{rules → dist/content/rules}/hatch3r-browser-verification.mdc +8 -10
  133. package/dist/content/rules/hatch3r-capability-matrix.md +108 -0
  134. package/dist/content/rules/hatch3r-capability-matrix.mdc +108 -0
  135. package/{rules → dist/content/rules}/hatch3r-ci-cd.md +9 -1
  136. package/{rules → dist/content/rules}/hatch3r-ci-cd.mdc +7 -0
  137. package/dist/content/rules/hatch3r-clarification-default.md +73 -0
  138. package/dist/content/rules/hatch3r-clarification-default.mdc +73 -0
  139. package/{rules → dist/content/rules}/hatch3r-code-standards.md +23 -47
  140. package/{rules → dist/content/rules}/hatch3r-code-standards.mdc +22 -46
  141. package/{rules → dist/content/rules}/hatch3r-component-conventions.md +4 -1
  142. package/{rules → dist/content/rules}/hatch3r-component-conventions.mdc +3 -0
  143. package/{rules → dist/content/rules}/hatch3r-container-hardening.md +13 -3
  144. package/{rules → dist/content/rules}/hatch3r-container-hardening.mdc +10 -1
  145. package/{rules → dist/content/rules}/hatch3r-contract-testing.md +3 -1
  146. package/{rules → dist/content/rules}/hatch3r-contract-testing.mdc +1 -0
  147. package/dist/content/rules/hatch3r-cost-visibility.md +135 -0
  148. package/dist/content/rules/hatch3r-cost-visibility.mdc +135 -0
  149. package/dist/content/rules/hatch3r-cq-rule-frame.md +54 -0
  150. package/dist/content/rules/hatch3r-cq-rule-frame.mdc +49 -0
  151. package/{rules → dist/content/rules}/hatch3r-data-classification.md +5 -2
  152. package/{rules → dist/content/rules}/hatch3r-data-classification.mdc +3 -1
  153. package/{rules → dist/content/rules}/hatch3r-deep-context.md +14 -14
  154. package/{rules → dist/content/rules}/hatch3r-deep-context.mdc +13 -13
  155. package/{rules → dist/content/rules}/hatch3r-dependency-management.md +18 -4
  156. package/{rules → dist/content/rules}/hatch3r-dependency-management.mdc +16 -3
  157. package/{rules → dist/content/rules}/hatch3r-design-system-detection.md +4 -2
  158. package/{rules → dist/content/rules}/hatch3r-design-system-detection.mdc +1 -0
  159. package/dist/content/rules/hatch3r-dotnet-patterns.md +104 -0
  160. package/dist/content/rules/hatch3r-dotnet-patterns.mdc +99 -0
  161. package/dist/content/rules/hatch3r-edge-case-discipline.md +65 -0
  162. package/dist/content/rules/hatch3r-edge-case-discipline.mdc +65 -0
  163. package/dist/content/rules/hatch3r-enhancability.md +147 -0
  164. package/dist/content/rules/hatch3r-enhancability.mdc +142 -0
  165. package/{rules → dist/content/rules}/hatch3r-event-schema-evolution.md +3 -1
  166. package/{rules → dist/content/rules}/hatch3r-event-schema-evolution.mdc +1 -0
  167. package/dist/content/rules/hatch3r-fan-out-discipline.md +91 -0
  168. package/dist/content/rules/hatch3r-fan-out-discipline.mdc +91 -0
  169. package/{rules → dist/content/rules}/hatch3r-feature-flags.md +2 -0
  170. package/{rules → dist/content/rules}/hatch3r-feature-flags.mdc +2 -0
  171. package/dist/content/rules/hatch3r-flutter-patterns.md +88 -0
  172. package/dist/content/rules/hatch3r-flutter-patterns.mdc +83 -0
  173. package/{rules → dist/content/rules}/hatch3r-git-conventions.md +5 -2
  174. package/{rules → dist/content/rules}/hatch3r-git-conventions.mdc +2 -0
  175. package/dist/content/rules/hatch3r-go-patterns.md +98 -0
  176. package/dist/content/rules/hatch3r-go-patterns.mdc +93 -0
  177. package/{rules → dist/content/rules}/hatch3r-handoff-readiness.md +14 -4
  178. package/{rules → dist/content/rules}/hatch3r-handoff-readiness.mdc +13 -3
  179. package/{rules → dist/content/rules}/hatch3r-i18n.md +3 -1
  180. package/{rules → dist/content/rules}/hatch3r-i18n.mdc +2 -0
  181. package/dist/content/rules/hatch3r-iteration-summary.md +108 -0
  182. package/dist/content/rules/hatch3r-iteration-summary.mdc +108 -0
  183. package/dist/content/rules/hatch3r-learning-system.md +202 -0
  184. package/dist/content/rules/hatch3r-learning-system.mdc +202 -0
  185. package/dist/content/rules/hatch3r-maintainability.md +157 -0
  186. package/dist/content/rules/hatch3r-maintainability.mdc +152 -0
  187. package/{rules → dist/content/rules}/hatch3r-migrations.md +4 -2
  188. package/{rules → dist/content/rules}/hatch3r-migrations.mdc +1 -0
  189. package/{rules → dist/content/rules}/hatch3r-observability-logging.md +2 -1
  190. package/{rules → dist/content/rules}/hatch3r-observability-logging.mdc +1 -0
  191. package/{rules → dist/content/rules}/hatch3r-observability-metrics.md +2 -1
  192. package/{rules → dist/content/rules}/hatch3r-observability-metrics.mdc +1 -0
  193. package/{rules → dist/content/rules}/hatch3r-observability-tracing.md +46 -36
  194. package/{rules → dist/content/rules}/hatch3r-observability-tracing.mdc +45 -35
  195. package/{rules → dist/content/rules}/hatch3r-operability.md +3 -1
  196. package/{rules → dist/content/rules}/hatch3r-operability.mdc +1 -0
  197. package/{rules → dist/content/rules}/hatch3r-passkey-server.md +4 -2
  198. package/{rules → dist/content/rules}/hatch3r-passkey-server.mdc +1 -0
  199. package/{rules → dist/content/rules}/hatch3r-performance-budgets.md +3 -1
  200. package/{rules → dist/content/rules}/hatch3r-performance-budgets.mdc +3 -1
  201. package/dist/content/rules/hatch3r-php-laravel-patterns.md +109 -0
  202. package/dist/content/rules/hatch3r-php-laravel-patterns.mdc +104 -0
  203. package/{rules → dist/content/rules}/hatch3r-progressive-delivery.md +5 -1
  204. package/{rules → dist/content/rules}/hatch3r-progressive-delivery.mdc +3 -0
  205. package/dist/content/rules/hatch3r-proof-model.md +131 -0
  206. package/dist/content/rules/hatch3r-proof-model.mdc +131 -0
  207. package/dist/content/rules/hatch3r-python-patterns.md +70 -0
  208. package/dist/content/rules/hatch3r-python-patterns.mdc +65 -0
  209. package/dist/content/rules/hatch3r-react-native-patterns.md +83 -0
  210. package/dist/content/rules/hatch3r-react-native-patterns.mdc +78 -0
  211. package/{rules → dist/content/rules}/hatch3r-resilience-patterns.md +3 -1
  212. package/{rules → dist/content/rules}/hatch3r-resilience-patterns.mdc +1 -0
  213. package/dist/content/rules/hatch3r-reviewer-calibration.md +84 -0
  214. package/dist/content/rules/hatch3r-reviewer-calibration.mdc +84 -0
  215. package/dist/content/rules/hatch3r-right-sizing.md +68 -0
  216. package/dist/content/rules/hatch3r-right-sizing.mdc +66 -0
  217. package/dist/content/rules/hatch3r-ruby-rails-patterns.md +111 -0
  218. package/dist/content/rules/hatch3r-ruby-rails-patterns.mdc +106 -0
  219. package/dist/content/rules/hatch3r-rust-patterns.md +107 -0
  220. package/dist/content/rules/hatch3r-rust-patterns.mdc +102 -0
  221. package/dist/content/rules/hatch3r-scalability.md +137 -0
  222. package/dist/content/rules/hatch3r-scalability.mdc +132 -0
  223. package/{rules → dist/content/rules}/hatch3r-secrets-management.md +12 -2
  224. package/{rules → dist/content/rules}/hatch3r-secrets-management.mdc +9 -0
  225. package/{rules → dist/content/rules}/hatch3r-security-patterns.md +38 -35
  226. package/{rules → dist/content/rules}/hatch3r-security-patterns.mdc +36 -34
  227. package/dist/content/rules/hatch3r-security.md +97 -0
  228. package/dist/content/rules/hatch3r-security.mdc +92 -0
  229. package/dist/content/rules/hatch3r-swiftui-patterns.md +98 -0
  230. package/dist/content/rules/hatch3r-swiftui-patterns.mdc +93 -0
  231. package/dist/content/rules/hatch3r-testability.md +115 -0
  232. package/dist/content/rules/hatch3r-testability.mdc +110 -0
  233. package/{rules → dist/content/rules}/hatch3r-testing.md +6 -2
  234. package/{rules → dist/content/rules}/hatch3r-testing.mdc +3 -0
  235. package/{rules → dist/content/rules}/hatch3r-theming.md +3 -1
  236. package/{rules → dist/content/rules}/hatch3r-theming.mdc +2 -0
  237. package/dist/content/rules/hatch3r-tool-currency.md +91 -0
  238. package/dist/content/rules/hatch3r-tool-currency.mdc +86 -0
  239. package/{rules → dist/content/rules}/hatch3r-tooling-hierarchy.md +30 -32
  240. package/{rules → dist/content/rules}/hatch3r-tooling-hierarchy.mdc +28 -31
  241. package/dist/content/rules/hatch3r-typescript-patterns.md +58 -0
  242. package/dist/content/rules/hatch3r-typescript-patterns.mdc +53 -0
  243. package/{rules → dist/content/rules}/hatch3r-ux-states-and-flows.md +13 -5
  244. package/{rules → dist/content/rules}/hatch3r-ux-states-and-flows.mdc +10 -3
  245. package/{skills → dist/content/skills}/hatch3r-a11y-audit/SKILL.md +11 -9
  246. package/{skills → dist/content/skills}/hatch3r-a11y-audit/references/manual-audit-checklist.md +7 -5
  247. package/dist/content/skills/hatch3r-adhoc-orchestrate/SKILL.md +131 -0
  248. package/{skills → dist/content/skills}/hatch3r-ai-feature/SKILL.md +4 -6
  249. package/{skills → dist/content/skills}/hatch3r-api-spec/SKILL.md +27 -2
  250. package/{skills → dist/content/skills}/hatch3r-architecture-review/SKILL.md +5 -8
  251. package/{commands/hatch3r-board-groom.md → dist/content/skills/hatch3r-board-groom/SKILL.md} +16 -18
  252. package/{commands/hatch3r-board-init.md → dist/content/skills/hatch3r-board-init/SKILL.md} +34 -31
  253. package/{commands/hatch3r-board-refresh.md → dist/content/skills/hatch3r-board-refresh/SKILL.md} +17 -19
  254. package/{commands/hatch3r-board-shared.md → dist/content/skills/hatch3r-board-shared/SKILL.md} +45 -15
  255. package/dist/content/skills/hatch3r-browser-verify/SKILL.md +307 -0
  256. package/{skills → dist/content/skills}/hatch3r-bug-fix/SKILL.md +16 -3
  257. package/{skills → dist/content/skills}/hatch3r-ci-pipeline/SKILL.md +17 -7
  258. package/{skills → dist/content/skills}/hatch3r-cli-fd/SKILL.md +34 -2
  259. package/{skills → dist/content/skills}/hatch3r-cli-fzf/SKILL.md +34 -2
  260. package/dist/content/skills/hatch3r-cli-gh/SKILL.md +139 -0
  261. package/{skills → dist/content/skills}/hatch3r-cli-jq/SKILL.md +43 -9
  262. package/{skills → dist/content/skills}/hatch3r-cli-ripgrep/SKILL.md +36 -4
  263. package/dist/content/skills/hatch3r-cli-toolbox/SKILL.md +376 -0
  264. package/dist/content/skills/hatch3r-containerize/SKILL.md +157 -0
  265. package/{skills → dist/content/skills}/hatch3r-context-health/SKILL.md +27 -9
  266. package/dist/content/skills/hatch3r-cost-tracking/SKILL.md +164 -0
  267. package/{skills → dist/content/skills}/hatch3r-customize/SKILL.md +9 -13
  268. package/{skills → dist/content/skills}/hatch3r-dep-audit/SKILL.md +29 -9
  269. package/{skills → dist/content/skills}/hatch3r-design-system-detect/SKILL.md +4 -8
  270. package/dist/content/skills/hatch3r-docs-writing/SKILL.md +159 -0
  271. package/dist/content/skills/hatch3r-enhancability-verify/SKILL.md +152 -0
  272. package/{skills → dist/content/skills}/hatch3r-feature/SKILL.md +54 -4
  273. package/dist/content/skills/hatch3r-feedback/SKILL.md +103 -0
  274. package/{skills → dist/content/skills}/hatch3r-gh-agentic-workflows/SKILL.md +14 -12
  275. package/{skills → dist/content/skills}/hatch3r-gh-agentic-workflows/references/azure-devops.md +2 -2
  276. package/{skills → dist/content/skills}/hatch3r-gh-agentic-workflows/references/gitlab-ci.md +1 -1
  277. package/{skills → dist/content/skills}/hatch3r-handoff-prepare/SKILL.md +12 -15
  278. package/{skills → dist/content/skills}/hatch3r-handoff-resume/SKILL.md +5 -8
  279. package/{commands/hatch3r-hooks.md → dist/content/skills/hatch3r-hooks/SKILL.md} +59 -148
  280. package/dist/content/skills/hatch3r-incident-response/SKILL.md +174 -0
  281. package/{skills → dist/content/skills}/hatch3r-issue-workflow/SKILL.md +15 -4
  282. package/dist/content/skills/hatch3r-learn/SKILL.md +317 -0
  283. package/{skills → dist/content/skills}/hatch3r-logical-refactor/SKILL.md +6 -7
  284. package/dist/content/skills/hatch3r-maintainability-verify/SKILL.md +146 -0
  285. package/{skills → dist/content/skills}/hatch3r-migration/SKILL.md +9 -8
  286. package/{skills → dist/content/skills}/hatch3r-observability-verify/SKILL.md +17 -13
  287. package/{skills → dist/content/skills}/hatch3r-perf-audit/SKILL.md +14 -10
  288. package/{skills → dist/content/skills}/hatch3r-pr-creation/SKILL.md +8 -11
  289. package/{skills → dist/content/skills}/hatch3r-qa-validation/SKILL.md +8 -7
  290. package/dist/content/skills/hatch3r-recipe/SKILL.md +174 -0
  291. package/{skills → dist/content/skills}/hatch3r-refactor/SKILL.md +7 -8
  292. package/dist/content/skills/hatch3r-release/SKILL.md +265 -0
  293. package/{skills → dist/content/skills}/hatch3r-reliability-verify/SKILL.md +9 -5
  294. package/{commands/hatch3r-report.md → dist/content/skills/hatch3r-report/SKILL.md} +21 -18
  295. package/dist/content/skills/hatch3r-scalability-verify/SKILL.md +145 -0
  296. package/dist/content/skills/hatch3r-security-verify/SKILL.md +144 -0
  297. package/dist/content/skills/hatch3r-team-convention-author/SKILL.md +126 -0
  298. package/dist/content/skills/hatch3r-testability-verify/SKILL.md +147 -0
  299. package/{skills → dist/content/skills}/hatch3r-ui-ux-verify/SKILL.md +20 -12
  300. package/{skills → dist/content/skills}/hatch3r-visual-refactor/SKILL.md +12 -8
  301. package/package.json +53 -46
  302. package/agents/hatch3r-a11y-auditor.md +0 -159
  303. package/agents/hatch3r-dependency-auditor.md +0 -219
  304. package/agents/hatch3r-implementer.md +0 -278
  305. package/agents/hatch3r-learnings-loader.md +0 -343
  306. package/agents/hatch3r-perf-profiler.md +0 -166
  307. package/agents/hatch3r-reviewer.md +0 -314
  308. package/agents/hatch3r-security-auditor.md +0 -180
  309. package/agents/hatch3r-test-writer.md +0 -171
  310. package/agents/shared/user-question-protocol.md +0 -95
  311. package/commands/hatch3r-agent-customize.md +0 -201
  312. package/commands/hatch3r-command-customize.md +0 -113
  313. package/commands/hatch3r-context-health.md +0 -147
  314. package/commands/hatch3r-cost-tracking.md +0 -163
  315. package/commands/hatch3r-dep-audit.md +0 -188
  316. package/commands/hatch3r-handoff.md +0 -133
  317. package/commands/hatch3r-learn.md +0 -312
  318. package/commands/hatch3r-recipe.md +0 -194
  319. package/commands/hatch3r-release.md +0 -350
  320. package/commands/hatch3r-rule-customize.md +0 -133
  321. package/commands/hatch3r-skill-customize.md +0 -112
  322. package/commands/hatch3r-workflow.md +0 -504
  323. package/dist/cli/index.d.ts +0 -2
  324. package/dist/cli/index.js.map +0 -1
  325. package/github-agents/hatch3r-lint-agent.md +0 -46
  326. package/prompts/hatch3r-bug-triage.md +0 -158
  327. package/prompts/hatch3r-code-review.md +0 -134
  328. package/prompts/hatch3r-pr-description.md +0 -176
  329. package/rules/hatch3r-agent-orchestration-detail.md +0 -211
  330. package/rules/hatch3r-agent-orchestration-detail.mdc +0 -206
  331. package/rules/hatch3r-agent-orchestration.md +0 -376
  332. package/rules/hatch3r-agent-orchestration.mdc +0 -371
  333. package/rules/hatch3r-iteration-summary.md +0 -90
  334. package/rules/hatch3r-iteration-summary.mdc +0 -85
  335. package/rules/hatch3r-learning-consult.md +0 -42
  336. package/rules/hatch3r-learning-consult.mdc +0 -38
  337. package/rules/hatch3r-observability-tracing-detail.md +0 -20
  338. package/rules/hatch3r-observability-tracing-detail.mdc +0 -14
  339. package/rules/hatch3r-observability.md +0 -20
  340. package/rules/hatch3r-observability.mdc +0 -14
  341. package/skills/hatch3r-agent-customize/SKILL.md +0 -23
  342. package/skills/hatch3r-cli-aichat/SKILL.md +0 -84
  343. package/skills/hatch3r-cli-ast-grep/SKILL.md +0 -85
  344. package/skills/hatch3r-cli-az-devops/SKILL.md +0 -89
  345. package/skills/hatch3r-cli-bat/SKILL.md +0 -85
  346. package/skills/hatch3r-cli-comby/SKILL.md +0 -85
  347. package/skills/hatch3r-cli-csvkit/SKILL.md +0 -84
  348. package/skills/hatch3r-cli-delta/SKILL.md +0 -86
  349. package/skills/hatch3r-cli-difftastic/SKILL.md +0 -84
  350. package/skills/hatch3r-cli-docker/SKILL.md +0 -89
  351. package/skills/hatch3r-cli-duckdb/SKILL.md +0 -84
  352. package/skills/hatch3r-cli-gh/SKILL.md +0 -90
  353. package/skills/hatch3r-cli-glab/SKILL.md +0 -89
  354. package/skills/hatch3r-cli-lazygit/SKILL.md +0 -78
  355. package/skills/hatch3r-cli-llm/SKILL.md +0 -84
  356. package/skills/hatch3r-cli-miller/SKILL.md +0 -84
  357. package/skills/hatch3r-cli-mods/SKILL.md +0 -84
  358. package/skills/hatch3r-cli-overview/SKILL.md +0 -60
  359. package/skills/hatch3r-cli-playwright/SKILL.md +0 -89
  360. package/skills/hatch3r-cli-podman/SKILL.md +0 -84
  361. package/skills/hatch3r-cli-qsv/SKILL.md +0 -91
  362. package/skills/hatch3r-cli-rtk/SKILL.md +0 -91
  363. package/skills/hatch3r-cli-sd/SKILL.md +0 -85
  364. package/skills/hatch3r-cli-stagehand/SKILL.md +0 -111
  365. package/skills/hatch3r-cli-taplo/SKILL.md +0 -84
  366. package/skills/hatch3r-cli-yq/SKILL.md +0 -85
  367. package/skills/hatch3r-cli-zstd/SKILL.md +0 -85
  368. package/skills/hatch3r-command-customize/SKILL.md +0 -23
  369. package/skills/hatch3r-cost-tracking/SKILL.md +0 -92
  370. package/skills/hatch3r-incident-response/SKILL.md +0 -115
  371. package/skills/hatch3r-recipe/SKILL.md +0 -91
  372. package/skills/hatch3r-release/SKILL.md +0 -120
  373. package/skills/hatch3r-rule-customize/SKILL.md +0 -23
  374. package/skills/hatch3r-skill-customize/SKILL.md +0 -23
  375. /package/{agents → dist/content/agents}/modes/architecture.md +0 -0
  376. /package/{agents → dist/content/agents}/modes/boundary-analysis.md +0 -0
  377. /package/{agents → dist/content/agents}/modes/codebase-impact.md +0 -0
  378. /package/{agents → dist/content/agents}/modes/complexity-risk.md +0 -0
  379. /package/{agents → dist/content/agents}/modes/coverage-analysis.md +0 -0
  380. /package/{agents → dist/content/agents}/modes/current-state.md +0 -0
  381. /package/{agents → dist/content/agents}/modes/feature-design.md +0 -0
  382. /package/{agents → dist/content/agents}/modes/impact-analysis.md +0 -0
  383. /package/{agents → dist/content/agents}/modes/library-docs.md +0 -0
  384. /package/{agents → dist/content/agents}/modes/migration-path.md +0 -0
  385. /package/{agents → dist/content/agents}/modes/prior-art.md +0 -0
  386. /package/{agents → dist/content/agents}/modes/refactoring-strategy.md +0 -0
  387. /package/{agents → dist/content/agents}/modes/regression.md +0 -0
  388. /package/{agents → dist/content/agents}/modes/risk-assessment.md +0 -0
  389. /package/{agents → dist/content/agents}/modes/risk-prioritization.md +0 -0
  390. /package/{agents → dist/content/agents}/modes/root-cause.md +0 -0
  391. /package/{agents → dist/content/agents}/modes/similar-implementation.md +0 -0
  392. /package/{agents → dist/content/agents}/modes/symptom-trace.md +0 -0
  393. /package/{agents → dist/content/agents}/modes/test-pattern.md +0 -0
  394. /package/{commands → dist/content/commands}/board/shared-board-overview.md +0 -0
  395. /package/{commands → dist/content/commands}/revision/revision-board-integration.md +0 -0
  396. /package/{skills → dist/content/skills}/hatch3r-issue-workflow/references/delegation-patterns.md +0 -0
@@ -0,0 +1,376 @@
1
+ ---
2
+ id: hatch3r-cli-toolbox
3
+ name: hatch3r-cli-toolbox
4
+ type: skill
5
+ description: "Category-indexed reference for 29 specialist CLI tools beyond the always-on five (ripgrep, jq, gh, fd, fzf). Use to pick the right tool for HTTP clients, ai-chat, structural-search, sed-style edits, data ops, browser automation, container ops, and more."
6
+ tags: [cli-tools, reference, orchestration, maintenance]
7
+ quality_charter: agents/shared/quality-charter.md
8
+ efficiency_patterns: agents/shared/efficiency-patterns.md
9
+ cache_friendly: true
10
+ ---
11
+ # CLI Toolbox
12
+
13
+ Compact decision reference for 29 specialist CLI tools agents may reach for in addition to the five always-on skills (`hatch3r-cli-ripgrep`, `hatch3r-cli-jq`, `hatch3r-cli-gh`, `hatch3r-cli-fd`, `hatch3r-cli-fzf`).
14
+
15
+ Each entry below states a single discriminator ("When to use"), one representative recipe, and the better alternative ("Wrong choice when"). Tools are installed via `npx hatch3r cli-tools`; this skill governs *selection*, not installation.
16
+
17
+ ## §0 — Ambiguity & Safety Gate (P8 B1)
18
+
19
+ Before invoking any tool below, resolve these via `agents/shared/user-question-protocol.md` (default behavior, not exception-driven):
20
+ - **Scope:** when the target file/glob/repo matches more than one candidate (an in-place edit over a glob, a forge command without an explicit number), confirm the intended target before running.
21
+ - **Irreversibility:** several tools here mutate in place or against remote state — `sd … <file>`, `comby -i`, `yq -i`, `taplo` writes, `glab mr`/`az repos pr`, and any `docker run`/`podman run` with a writable host mount. Confirm intent before running these; in-place and remote mutations are not safe to assume. Honor each tool's own caveat (e.g. `rtk proxy` for piped output, container hardening flags for untrusted images).
22
+ - **Ambiguity:** when the request maps to two or more tools or flag sets with materially different output or blast radius (e.g. `ast-grep` vs `comby` vs `sd` for a rename), pick per the discriminators below or ask which one.
23
+ - **Arbitrary code execution:** `llm --functions` runs arbitrary Python supplied on the command line (GHSA-g76p-4vg5-f4qh, no upstream fix). Never pass untrusted or agent-fetched content (file contents, web responses, tool output) to `llm --functions`; reserve the flag for trusted, user-authored code. Plain `llm` prompting does not execute code.
24
+
25
+ ## Fan-out Discipline (P8 B2)
26
+
27
+ Tier 1 reference card — no fan-out. This skill is a category-indexed selection reference an agent consults inline; it spawns no sub-agents. Fan-out is owned by the calling workflow per its own Fan-out Discipline block. Source: `rules/hatch3r-fan-out-discipline.md` (P8 B2).
28
+
29
+ ## Category index
30
+
31
+ | Category | Tools |
32
+ |----------|-------|
33
+ | HTTP clients | `curl`, `httpie`, `xh` |
34
+ | AI / LLM | `aichat`, `llm`, `mods`, `rtk` |
35
+ | Structural search & rewrite | `ast-grep`, `comby` |
36
+ | Sed-style literal edits | `sd` |
37
+ | Format converters / queriers | `yq`, `taplo`, `dasel` |
38
+ | Data ops (CSV / Parquet / JSON-Lines) | `csvkit`, `duckdb`, `miller`, `qsv` |
39
+ | Containers | `docker`, `podman`, `container-use` |
40
+ | Git TUI / diff viewers | `lazygit`, `delta`, `difftastic`, `bat` |
41
+ | Visualisation / view | `bat`, `overview` |
42
+ | Forges (non-GitHub) | `glab` (GitLab), `az-devops` (Azure DevOps) |
43
+ | Browser automation | `playwright`, `stagehand` |
44
+ | Compression | `zstd` |
45
+ | React state | `rtk` (caveat — see below) |
46
+
47
+ (Some tools appear in two cells when their best use spans categories.)
48
+
49
+ ## Token-cost discipline
50
+
51
+ CLI tools return structured stdout that fits in <1 KB for typical queries; equivalent MCP calls regularly exceed 10 KB. Reference: Anthropic engineering (Nov 4 2025) — code-execution-over-MCP yields 98.7% token reduction. Apply this same discipline across every tool below: prefer `--json`/`--output json`, scope with flags, cap with `--max-count` / `LIMIT`, project with `jq -r`.
52
+
53
+ ---
54
+
55
+ ## HTTP clients
56
+
57
+ ### curl
58
+ - **When to use:** scripted HTTP/S transfers across any platform — file upload (`--upload-file`), header injection (`-H`), cookie sessions (`-b`/`-c`), OAuth flows, custom write-out templates (`-w`). Tier-1 default-on.
59
+ - **Recipe:** `curl -sS -H "Authorization: Bearer $TOKEN" https://api.example.com/v1/runs | jq '.runs[] | {id, status}'`
60
+ - **Wrong choice when:** quick exploratory request that you want highlighted — use `httpie`; HTTP/2 / HTTP/3 throughput-sensitive bulk transfers — use `xh`. **Version floor:** >=8.20.0 (released 2026-04-29) clears the cumulative advisory backlog of every earlier release. The advisories specific to 8.20.0 are CVE-2026-5773 / CVE-2026-5545 / CVE-2026-4873; earlier builds also carry a High-severity advisory (CVE-2026-6253) plus credential-leak and connection-reuse issues fixed across 8.17.0–8.19.0. See curl.se/docs/security.html for the per-version roster.
61
+
62
+ ### httpie
63
+ - **When to use:** human-readable HTTP/S exploration — JSON-first defaults, syntax highlighting, persistent named sessions, intuitive expression DSL for query params and headers.
64
+ - **Recipe:** `http --session=staging POST api.example.com/v1/auth username=admin password=$PW Content-Type:application/json`
65
+ - **Wrong choice when:** large-volume scripting where the colour codes confuse downstream consumers — use plain `curl`; HTTP/2 + HTTP/3 throughput — use `xh`. **Version floor:** >=3.2.3 — earlier builds carry CVE-2023-48052 (GHSA-8r96-8889-qg2x) + CVE-2019-10751 (GHSA-xjjg-vmw6-c2p9), both fixed in httpie 3.2.3. **Note:** latest release 3.2.4 (2024-11-01); the repo has had zero commits since, so it is dormant — prefer `xh` (actively maintained, HTTPie-compatible) for new web-project work.
66
+
67
+ ### xh
68
+ - **When to use:** fast Rust client with HTTPie-compatible syntax — single static binary (no Python runtime), HTTP/2 default, HTTP/3 opt-in via `--http3`, JSON output (`--json`), resume-on-416 download recovery.
69
+ - **Recipe:** `xh --http3 GET api.example.com/v1/runs Authorization:"Bearer $TOKEN" | jq '.runs[] | {id, status}'`
70
+ - **Install (D21-SA21.4-F07):** mac `brew install xh`; linux `cargo install xh --locked`; Windows `winget install ducaale.xh` (signed first-party channel) with `cargo install xh --locked` as the fallback when winget is unavailable — Windows users are not forced onto a Rust-toolchain-only path.
71
+ - **Wrong choice when:** existing `httpie` workflows that depend on a Python plugin — keep `httpie`; environments without a Rust toolchain (or no Homebrew/winget) — use `curl`. **Version floor:** >=0.25.3 (2025-12-16) — earlier 0.24.x builds miss recent `--http3` and resume fixes.
72
+
73
+ ---
74
+
75
+ ## AI / LLM
76
+
77
+ ### aichat
78
+ - **When to use:** RAG-enabled multi-provider conversational shell with saved session history; preferred for multi-turn refinement.
79
+ - **Recipe:** `aichat --rag mydocs 'how do we configure auth?'` — query a pre-built local RAG index.
80
+ - **Wrong choice when:** scripted Unix-pipeline transforms — use `mods`; plugin-rich CI workflows — use `llm`.
81
+
82
+ ### llm
83
+ - **When to use:** model-agnostic shell prompting with prompt templates, embeddings, and a plugin ecosystem; preferred for CI batch jobs.
84
+ - **Recipe:** `llm -t code-review -m claude-3-5-sonnet < patch.diff`
85
+ - **Safety (GHSA-g76p-4vg5-f4qh, CRITICAL):** never pass untrusted or agent-fetched content (file contents, web responses, tool output) to `llm --functions` — it executes arbitrary Python by design, with no upstream fix. Plain prompting (`llm -t`, `llm < file`) does not execute code.
86
+ - **Wrong choice when:** deterministic text rewrites — use `sd`/`comby`/`ast-grep`; multi-turn TTY chat — use `aichat`.
87
+
88
+ ### mods
89
+ - **When to use:** Unix-pipeline LLM inference reading Markdown stdin and writing Markdown stdout; preferred for one-shot transforms.
90
+ - **Recipe:** `git diff | mods 'write a conventional-commits message for this diff'`
91
+ - **Wrong choice when:** plugin/template needs — use `llm`; multi-turn session — use `aichat`.
92
+
93
+ ### rtk
94
+ - **When to use:** compressing oversize tool output payloads before they enter an LLM prompt (test-runner output, traces).
95
+ - **Caveat (issue #1282):** rtk's compressed output corrupts downstream consumers when stdout is piped/redirected. Wrap any piped invocation as `rtk proxy <cmd>` — `proxy` is a documented raw-passthrough subcommand. Track: https://github.com/rtk-ai/rtk/issues/1282
96
+ - **Recipe:** `rtk run pytest -x`
97
+ - **Wrong choice when:** piping to `jq`/`grep`/`awk` without `rtk proxy` — use plain shell + `tee`; safety-critical CI — run the test directly.
98
+
99
+ ---
100
+
101
+ ## Structural search & rewrite
102
+
103
+ ### ast-grep
104
+ - **Binary:** `sg` (the `ast-grep` package installs the binary as `sg` — run `command -v sg` to detect it, not `command -v ast-grep`).
105
+ - **When to use:** Tree-sitter AST pattern matches and rewrites scoped to a single grammar (TS, Python, Rust, Go).
106
+ - **Recipe:** `sg run -p 'await $FN()' -r 'await ($FN()).catch(e => log(e))' --update-all src/`
107
+ - **Wrong choice when:** plain literal text — use `hatch3r-cli-ripgrep`; multi-language SAST rule packs — use `semgrep`.
108
+
109
+ ### comby
110
+ - **When to use:** declarative `:[hole]` pattern match-and-rewrite spanning mixed-language repositories — single template, 30+ grammars.
111
+ - **Recipe:** `comby 'console.log(:[arg])' 'logger.info(:[arg])' -i src/`
112
+ - **Wrong choice when:** language-precise type-aware refactor — use `ast-grep`; plain text — use `sd`. **Install posture:** the linux `bash <(curl -sL get.comby.dev)` recipe is an unsigned channel (no signature or checksum gate, no signed Linux package repo) — prefer the signed brew (mac) / scoop (win) channels, or verify the release binary's SHA-256 before executing.
113
+
114
+ ---
115
+
116
+ ## Sed-style literal edits
117
+
118
+ ### sd
119
+ - **When to use:** literal-string stream substitution with no regex foot-guns — defaults to regex but `-s` switches to literal mode.
120
+ - **Recipe:** `rg --files-with-matches 'oldName' -tts | xargs sd 'oldName' 'newName'`
121
+ - **Version floor:** `>=1.1.0` — the line-by-line default and the `-A`/`--across` flag are 1.1.0 features. On Linux use `cargo binstall sd` (fetches the v1.1.0 GitHub-release binary); `cargo install sd` resolves to crates.io, whose max published version is 1.0.0.
122
+ - **Wrong choice when:** identifier-aware rename — use `ast-grep`; multi-step transforms — use `sed -e`.
123
+
124
+ ---
125
+
126
+ ## Format converters & queriers
127
+
128
+ ### yq
129
+ - **When to use:** editing Kubernetes manifests, Helm values, or GitHub-Actions workflows in place — preserves comments/anchors with `-P`.
130
+ - **Recipe:** `yq -i '.version = "1.7.5"' .hatch3r/hatch.json`
131
+ - **Wrong choice when:** JSON input — use `hatch3r-cli-jq`; TOML — use `taplo`. **Tested-against version:** 4.53.2 (cycle-verified documentation pin, not a CVE floor).
132
+
133
+ ### taplo
134
+ - **When to use:** formatting, linting, and querying TOML (`pyproject.toml`, `Cargo.toml`); bundled schemas for both.
135
+ - **Recipe:** `taplo get -f Cargo.toml package.version`
136
+ - **Wrong choice when:** YAML/JSON — use `yq`/`jq`; cross-format conversion — use `dasel` (pin >=3.11.0).
137
+
138
+ ### dasel
139
+ - **When to use:** single binary spanning JSON / YAML / TOML / XML / CSV under one path-query DSL — handy in CI where you do not want jq+yq+taplo and the input format is not known up-front. NDJSON read support added in v3.11.0.
140
+ - **Recipe:** `dasel -r yaml -w json -f config.yaml '.services.app.env'`
141
+ - **Wrong choice when:** format-specific in-place edits with comment preservation — use `yq` (YAML) or `taplo` (TOML); stream-friendly JSON filtering — use `jq` with its richer filter language. **Version floor:** >=3.11.0 (the current stable) — earlier builds carry CVE-2026-33320 (YAML alias DoS, fixed in 3.3.2), CVE-2026-46378 (selector-lexer DoS, fixed in 3.10.1), and CVE-2026-46377 (index-out-of-range panic, fixed in 3.10.1); pinning >=3.11.0 clears all three.
142
+
143
+ ---
144
+
145
+ ## Data ops (CSV / Parquet / JSON-Lines)
146
+
147
+ ### csvkit
148
+ - **When to use:** Python-powered CSV toolkit covering `csvlook`, `csvsql`, `csvjoin`, `csvstat` — best for ad-hoc EDA and SQL-over-CSV.
149
+ - **Recipe:** `csvsql --query 'SELECT name FROM data WHERE active = 1' data.csv`
150
+ - **Wrong choice when:** files >1M rows — use `duckdb`; single-column slice — use `qsv`. **Tested-against version:** 2.2.0 (cycle-verified documentation pin, not a CVE floor).
151
+
152
+ ### duckdb
153
+ - **When to use:** ad-hoc analytical SQL over local Parquet, CSV, JSON; streams reads so memory stays bounded.
154
+ - **Recipe:** `duckdb -c "SELECT count(*) FROM 'data/*.parquet'"`
155
+ - **Wrong choice when:** <10k rows and column slice only — use `qsv`; transactional writes — use SQLite/Postgres. **Install posture:** the linux `curl https://install.duckdb.org | sh` recipe is an unsigned channel (no signature or checksum gate) — prefer the signed brew (mac) / winget (win) channels, or verify the release binary's published SHA-256 before executing.
156
+
157
+ ### miller
158
+ - **When to use:** `awk`-like record processing across CSV/TSV/JSON-Lines streams with the `put`/`filter` DSL.
159
+ - **Recipe:** `mlr --icsv --ojson put '$tax = $amount * 0.07' transactions.csv`
160
+ - **Wrong choice when:** multi-GB analytical joins — use `duckdb`; trivial slicing — use `qsv`. **Tested-against version:** 6.18.1 (cycle-verified documentation pin, not a CVE floor).
161
+
162
+ ### qsv
163
+ - **When to use:** fast CSV toolkit (slice, search, join, stats, 80+ commands) — actively-maintained `xsv` successor (`BurntSushi/xsv` archived 2025-04-24, `jqnatividad/qsv` is the active fork).
164
+ - **Recipe:** `qsv search -s email '@example\.com$' users.csv`
165
+ - **Wrong choice when:** Parquet/JSON or window functions — use `duckdb`; per-record DSL transforms — use `miller`.
166
+
167
+ ---
168
+
169
+ ## Containers
170
+
171
+ ### docker
172
+ - **When to use:** image build, container run, exec inspection, registry push against a running Docker Engine daemon.
173
+ - **Recipe (trusted image, repo workload):** `docker run --rm -v "$PWD":/app -w /app node:22 npm test`
174
+ - **Recipe (untrusted image OR agent-generated command, default for AI runs):** prefer the hardened equivalent below — read-only filesystem, dropped capabilities, `:ro` sub-tree bind.
175
+ - **Wrong choice when:** rootless / daemonless required — use `podman`; Kubernetes deploy — use `kubectl`/`helm`. **Version floor:** >=29.5.2 — earlier engines carry CVE-2026-32288 (manifest DoS) plus CVE-2026-41567 / CVE-2026-41568 / CVE-2026-42306 (`docker cp` host-root TOCTOU, fixed in 29.5.1; 29.5.2 fixes the 29.5.1 `docker cp` regression). **Install posture:** the linux `curl -fsSL https://get.docker.com | sudo sh` recipe is an unsigned channel — prefer Docker's signed apt repository (download.docker.com, signed-by GPG key) or the signed brew (mac) / winget (win) channels.
176
+
177
+ #### Sandbox callout — host-mount + privilege
178
+
179
+ The default recipe above bind-mounts the entire repo root read-write, which exposes `.env*`, `.git/`, `.aws/`, `.npmrc`, `.docker/config.json`, `~/.kube/config`, `.hatch3r/learnings/`, and `node_modules` to a compromised post-install script inside the container (D15-M15). On Linux, a process running as root inside a non-rootless container can write back through that mount with host-root semantics. F15.7-H5 (Cycle 10 D15-SA15.7) + D15-M15 hardening — copy the relevant flags into your runs when the workload comes from untrusted sources (third-party image, agent-generated `docker run` command, public Dockerfile):
180
+
181
+ - Read-only filesystem: `--read-only --tmpfs /tmp` keeps the container from writing back to the host even via `/app`.
182
+ - Drop root: `--user "$(id -u):$(id -g)"` or rely on the image's non-root `USER` directive. Without it, a process inside the container runs as host root on Linux when Docker Desktop's user remapping is disabled.
183
+ - Block privilege escalation: `--security-opt no-new-privileges:true` neutralises setuid binaries inside the image.
184
+ - Mount the smallest necessary sub-tree: `-v "$PWD/src:/app/src:ro"` instead of the full repo root. Never bind-mount `~`, `/`, or `/var/run/docker.sock` to an untrusted container — the socket grants host root.
185
+ - Reference: https://docs.docker.com/engine/security/rootless/ (rootless Docker Engine), https://docs.docker.com/engine/reference/run/#security-configuration (no-new-privileges + capability drop).
186
+
187
+ Hardened equivalent of the recipe above:
188
+ ```
189
+ docker run --rm --read-only --tmpfs /tmp \
190
+ --user "$(id -u):$(id -g)" \
191
+ --security-opt no-new-privileges:true \
192
+ --cap-drop ALL \
193
+ -v "$PWD/src:/app/src:ro" -w /app node:22 npm test
194
+ ```
195
+
196
+ ### podman
197
+ - **When to use:** rootless OCI-image execution without a privileged daemon — ideal for hardened CI workers.
198
+ - **Recipe:** `podman run --rm -v "$PWD:/app:Z" -w /app node:22 npm test` (`:Z` triggers SELinux relabel on Fedora/RHEL).
199
+ - **Wrong choice when:** Swarm / Docker-Desktop integration — use `docker`; tools that hard-code `/var/run/docker.sock` (unless `podman system service` is running). **Version floor (Windows only):** >=5.8.2 — earlier Windows builds carry CVE-2026-33414 (PowerShell command injection in `podman machine init --image` on the Hyper-V backend); mac and linux builds are unaffected.
200
+
201
+ ### container-use
202
+ - **Caveat (pre-1.0 stale upstream):** v0.4.2 shipped 2025-08-19; no further tagged release at 2026-05-27 (281-day gap) and no `SECURITY.md` is published. Adopt only if you accept undefined CVE disclosure paths. Track: https://github.com/dagger/container-use/releases.
203
+ - **When to use:** spinning up Dagger-managed sandbox containers for agentic coding environments — single-tenant CLI mode, git-reference checkout, lock-scoped concurrent runs.
204
+ - **Recipe:** `container-use env create --git-ref refs/heads/main --image node:22 --workdir /repo` then `cu exec npm test`.
205
+ - **Wrong choice when:** general-purpose container runtime — use `docker` or `podman`; stable D15 sandbox-escape boundary required — use `podman` rootless + selinux relabel.
206
+
207
+ ---
208
+
209
+ ## Git TUI / diff viewers
210
+
211
+ ### lazygit
212
+ - **When to use:** keyboard-driven terminal UI for staging, rebasing, branch switching — humans only; agents should call plain `git`.
213
+ - **Recipe:** `lazygit -p path/to/repo` (TTY required; hangs in non-TTY).
214
+ - **Wrong choice when:** autonomous agent or CI — use plain `git status`/`add`/`commit` for parseable stdout.
215
+
216
+ ### delta
217
+ - **When to use:** viewing unified git diffs with side-by-side syntax-coloured hunks (ANSI pager).
218
+ - **Recipe:** `git config --global core.pager delta` then `git config --global interactive.diffFilter 'delta --color-only'`.
219
+ - **Wrong choice when:** scripted consumers — ANSI breaks parsers; semantic refactor review — use `difftastic`. **Version floor:** >=0.8.3 — earlier builds carry CVE-2021-36376 (GHSA-5xg3-j2j6-rcx4 path traversal, fixed in git-delta 0.8.3).
220
+
221
+ ### difftastic
222
+ - **When to use:** syntax-aware diffing that reports semantic edits (rename of block does not show as wholesale rewrite).
223
+ - **Recipe:** `git -c diff.external=difft diff HEAD~1 HEAD`
224
+ - **Wrong choice when:** stable POSIX diff output for scripts — use `diff -u`; quick unified-diff pager — use `delta`.
225
+
226
+ ### bat
227
+ - **When to use:** scrolling one source file with syntax colours, line numbers, git modification markers.
228
+ - **Recipe:** `bat --plain --line-range 50:100 src/adapters/cursor.ts`
229
+ - **Wrong choice when:** binary files (use `xxd | bat --language=hex`); strict POSIX pipelines (use `cat`); two-file compare (use `delta`). **Version floor:** >=0.18.2 — earlier builds carry CVE-2021-36753 (GHSA-p24j-h477-76q3 uncontrolled search path, fixed in bat 0.18.2).
230
+
231
+ ---
232
+
233
+ ## Visualisation
234
+
235
+ ### overview
236
+ - **When to use:** legacy umbrella catalog of all CLI tools — this `hatch3r-cli-toolbox` skill replaces it. Retained as a category cell for back-references in user content; if you see hatch3r-cli-overview mentioned anywhere (un-backticked here to keep the cross-reference scanner clean), treat it as a synonym for this toolbox.
237
+
238
+ ---
239
+
240
+ ## Forges (non-GitHub)
241
+
242
+ ### glab
243
+ - **When to use:** GitLab merge-request review, pipeline retries, issue triage with native PAT/OAuth auth.
244
+ - **Recipe:** `glab mr list --assignee=@me --output json | jq '.[] | {iid, title, web_url}'`
245
+ - **Wrong choice when:** GitHub-hosted — use `hatch3r-cli-gh`; Azure Repos — use `az-devops`. **Tested version:** 1.99.0 (documentation pin, not a CVE floor) — the verified baseline at last audit.
246
+
247
+ ### az-devops
248
+ - **When to use:** Azure DevOps work-item edits, repo pushes, pipeline runs via the `az` CLI extension.
249
+ - **Recipe:** `az repos pr list --status active --query '[].pullRequestId' --output tsv`
250
+ - **Wrong choice when:** GitHub — use `hatch3r-cli-gh`; GitLab — use `glab`. **Tested version:** az-devops extension 1.0.4 (documentation pin; the extension floats under `az extension update`). **Install posture:** the linux `curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash` recipe is an unsigned channel that runs as root — prefer Microsoft's signed apt repository (packages.microsoft.com, signed-by GPG key) or the signed winget (win) / brew (mac) channels.
251
+
252
+ ---
253
+
254
+ ## Browser automation
255
+
256
+ ### playwright
257
+ - **When to use:** end-to-end browser test execution capturing screenshots and traces; deterministic locators, multi-browser.
258
+ - **Recipe:** `npx playwright test --grep '@smoke' --workers=1 --reporter=line`
259
+ - **Version floor:** `>=1.55.1` — earlier `npx playwright install` builds carry CVE-2025-59288 (installer man-in-the-middle, CVSS 8.7). Keep current beyond the floor so the bundled Chromium rolls the CVE-2026-2441 fix; pin the sandbox container image to a current `*-noble` tag.
260
+ - **Wrong choice when:** API-only system — use `curl` + `jq`; agent-driven natural-language browsing — use `stagehand`.
261
+
262
+ #### Sandbox callout — credential isolation when navigating untrusted URLs
263
+
264
+ Playwright launches real Chrome / Firefox / WebKit processes that inherit the host user's environment (`HOME`, `~/.aws`, browser profiles under `~/.config/google-chrome/`). Visiting an attacker-controlled URL with the host user's credential store is the equivalent of granting that URL read access to every site you are logged into. F15.7-H5 (Cycle 10 D15-SA15.7) hardening — apply when navigating to URLs the agent has not vetted:
265
+
266
+ - Disposable profile: pass `userDataDir: tmp.dirSync().name` (or `--user-data-dir=$(mktemp -d)`) so the browser sees no saved sessions, no autofill, no cookies from the host profile.
267
+ - Run inside the official sandbox image: Microsoft maintains pinned, signed Playwright containers — `mcr.microsoft.com/playwright:v1.60.0-noble` (pin a current tag; keep it current so the bundled Chromium carries the CVE-2026-2441 fix — an 18-month-stale tag like `v1.49.0-jammy` ships an unpatched browser-engine RCE). The image preinstalls every browser binary and isolates filesystem + network from the host. Reference: https://playwright.dev/docs/docker (Microsoft's official Playwright image is the maintained surface; pin to the immutable digest of a current release).
268
+ - Disable hardware acceleration / GPU access on untrusted runs: `args: ['--disable-gpu', '--no-sandbox']` is acceptable inside a hardened container, never on the host.
269
+ - Reset between scenarios: `await context.close(); context = await browser.newContext();` between unvetted URLs so cookie state does not leak across hops.
270
+ - **D15-M14: `playwright codegen <url>` against an authed site.** `npx playwright codegen` opens a browser session the user logs into, then writes the captured locators and credentials into a test file on disk. Running codegen against a host browser profile bakes the live session cookie / Authorization header into the emitted test, exposing the credential in any artefact the test is checked into. Mitigation: always pass `--save-storage=storageState.json` to capture state into a single named file you can scrub or `.gitignore` (instead of writing inline credentials), pass `--user-data-dir=$(mktemp -d)` so codegen does not start from the host's logged-in profile, and review the emitted test for any literal token, bearer string, or `cookie:` header before committing. Reference: https://playwright.dev/docs/codegen#preserve-authenticated-state (preserve auth via the storage-state file rather than inline credentials).
271
+ - Reference: https://playwright.dev/docs/release-notes (current release surface), https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/ (AAI04 untrusted-input handling).
272
+
273
+ Hardened equivalent of the recipe above (inside Microsoft's pinned image):
274
+ ```
275
+ docker run --rm --network none -v "$PWD:/work:ro" -w /work \
276
+ mcr.microsoft.com/playwright:v1.60.0-noble \
277
+ npx playwright test --grep '@smoke' --workers=1 --reporter=line
278
+ ```
279
+
280
+ ### stagehand
281
+ - **When to use:** natural-language browser steering with on-the-fly DOM reasoning; v3 (2025-10-29) talks Chrome DevTools Protocol directly. Drivers (`playwright-core`, `puppeteer-core`, `patchright-core`) are peer deps — install only the one you need.
282
+ - **Recipe:** `npx create-browser-app` scaffolds a v3 project; runtime: `stagehand.act("click the login button")`.
283
+ - **Driver trust (D15-SA15.7-F-15.7-08):** prefer `playwright-core` (Microsoft) as the default driver. `puppeteer-core` (Google) is also vendor-maintained; `patchright-core` is a less-vetted community detection-bypass fork with a different supply-chain trust profile. Pin whichever driver you install.
284
+ - **Wrong choice when:** high-volume scraping — use Browserbase managed browsers or v3 action cache; air-gapped CI — pre-record then replay; existing stable Playwright suite — keep it.
285
+
286
+ ---
287
+
288
+ ## Compression
289
+
290
+ ### zstd
291
+ - **When to use:** high-ratio compression with single-digit-millisecond decompress speeds — cold-storage payloads, CI artifact upload.
292
+ - **Recipe:** `tar --zstd -cf bundle.tar.zst dist/ docs/`
293
+ - **Wrong choice when:** distribution where every byte counts and decompress speed is irrelevant — use `xz -9e`; legacy Windows recipients — use `zip`; already-compressed payloads — skip compression.
294
+
295
+ ---
296
+
297
+ ## Detection & install
298
+
299
+ Verify each tool with `command -v <bin>`. Install commands.
300
+
301
+ #### D15-M16: provenance / signature posture per channel
302
+
303
+ Each install command below resolves to one of four trust postures. Read the posture before running any install command on an end-user machine — `cargo install` and `bash <(curl … | sh)` channels lack vendor-signed artefacts and require additional vetting.
304
+
305
+ | Posture | Channels | What it means | Mitigation when posture is "unsigned" |
306
+ |---------|----------|---------------|---------------------------------------|
307
+ | Signed | `brew` (homebrew/cask), `apt` (signed repo + `Signed-By`), `snap`, `npm` with `--provenance` / `npm audit signatures`, Microsoft Store, Mac App Store | Channel verifies a vendor signature against a pinned key before installing | (none) |
308
+ | Vendor-pinned | `pipx`, `pip` (lockfile + `--require-hashes`), `go install` against `proxy.golang.org` + `GOSUMDB=on` | Channel checksums or transparency log verifies that the resolved tarball matches the version's pinned hash | Verify lockfile committed, `GOSUMDB=sum.golang.org` not set to `off` |
309
+ | Unsigned | `cargo install <crate>` (crates.io publishes tarballs without per-release Sigstore signatures), `pipx install` directly from PyPI without `--require-hashes` | Channel ships the resolved tarball but does not verify it against a vendor signature; integrity is per-channel checksum only | Pin the version, verify SHA-256 against the project's published release, prefer `--locked` (cargo) or `--require-hashes` (pip); avoid running on a credential-bearing machine |
310
+ | Curl-piped-shell | `bash <(curl … get.comby.dev)`, `curl -fsSL … install.sh \| bash` | No checksum, no signature, attacker who controls the URL gets shell on your machine. Vendor maintained but unsigned at the channel level | Download the script first (`curl -fsSL <url> -o install.sh`), inspect it, optionally pin to a committed SHA via `git show <ref>:install.sh \| bash`, never `\| bash` straight from an untrusted network |
311
+
312
+ Install commands:
313
+
314
+ | Tool | mac (`brew`) | linux (`apt` / `pip` / other) |
315
+ |------|--------------|--------------------------------|
316
+ | `aichat` | `brew install aichat` | `cargo install aichat` |
317
+ | `ast-grep` | `brew install ast-grep` | `cargo install ast-grep --locked` |
318
+ | `az-devops` | `brew install azure-cli && az extension add --name azure-devops` | `apt install azure-cli && az extension add --name azure-devops` |
319
+ | `bat` | `brew install bat` | `apt install bat` (binary may be `batcat`) |
320
+ | `comby` | `brew install comby` | `bash <(curl -sL get.comby.dev)` |
321
+ | `container-use` | `brew install dagger/tap/container-use` | `curl -fsSL https://raw.githubusercontent.com/dagger/container-use/main/install.sh \| bash` |
322
+ | `csvkit` | `pipx install csvkit` | `pipx install csvkit` |
323
+ | `curl` | `brew install curl` (pin >=8.20.0) | `apt install curl` (verify >=8.20.0) |
324
+ | `dasel` | `brew install dasel` (pin >=3.11.0) | `go install github.com/tomwright/dasel/v3/cmd/dasel@latest` |
325
+ | `delta` | `brew install git-delta` | `apt install git-delta` (or download release) |
326
+ | `difftastic` | `brew install difftastic` | `cargo install difftastic` |
327
+ | `docker` | `brew install --cask docker` | `apt install docker.io` |
328
+ | `duckdb` | `brew install duckdb` | download from https://duckdb.org/ |
329
+ | `glab` | `brew install glab` | `snap install glab` (only in Ubuntu universe 24.04+; or GitLab release `.deb`) |
330
+ | `httpie` | `brew install httpie` | `snap install httpie` (or `pipx install httpie`) |
331
+ | `lazygit` | `brew install lazygit` | `apt install lazygit` |
332
+ | `llm` | `brew install llm` | `pipx install llm` |
333
+ | `miller` | `brew install miller` | `apt install miller` |
334
+ | `mods` | `brew install charmbracelet/tap/mods` | `apt install mods` (Charm repo) |
335
+ | `playwright` | `npm install -D @playwright/test && npx playwright install` (pin >=1.55.1) | same (verify >=1.55.1; sandbox image `mcr.microsoft.com/playwright:v1.60.0-noble`) |
336
+ | `podman` | `brew install podman` | `apt install podman` |
337
+ | `qsv` | `brew install qsv` | `cargo install qsv` |
338
+ | `rtk` | `brew install rtk-ai/tap/rtk` | check upstream release |
339
+ | `sd` | `brew install sd` (1.1.0) | `cargo binstall sd` (v1.1.0 GitHub release; `cargo install sd` pins crates.io 1.0.0 — older, no `-A`/`--across`) |
340
+ | `stagehand` | `npm install -g @browserbasehq/stagehand` | same |
341
+ | `taplo` | `brew install taplo` | `cargo install taplo-cli --locked` |
342
+ | `xh` | `brew install xh` (pin >=0.25.3) | `cargo install xh --locked` |
343
+ | `yq` | `brew install yq` | `apt install yq` (verify mikefarah Go build, not python wrapper) |
344
+ | `zstd` | `brew install zstd` | `apt install zstd` |
345
+
346
+ ## References
347
+
348
+ This skill synthesizes 25 pre-existing in-repo per-tool skills (collapsed in v1.9.0 per the Decision #14 toolbox criterion in `.claude/rules/content-authoring.md`). The original source files (now removed) lived at the following paths (IDs intentionally un-backticked here so the cross-reference scanner does not treat removed standalone skills as broken canonical IDs):
349
+
350
+ - skills/hatch3r-cli-aichat/SKILL.md
351
+ - skills/hatch3r-cli-ast-grep/SKILL.md
352
+ - skills/hatch3r-cli-az-devops/SKILL.md
353
+ - skills/hatch3r-cli-bat/SKILL.md
354
+ - skills/hatch3r-cli-comby/SKILL.md
355
+ - skills/hatch3r-cli-csvkit/SKILL.md
356
+ - skills/hatch3r-cli-delta/SKILL.md
357
+ - skills/hatch3r-cli-difftastic/SKILL.md
358
+ - skills/hatch3r-cli-docker/SKILL.md
359
+ - skills/hatch3r-cli-duckdb/SKILL.md
360
+ - skills/hatch3r-cli-glab/SKILL.md
361
+ - skills/hatch3r-cli-lazygit/SKILL.md
362
+ - skills/hatch3r-cli-llm/SKILL.md
363
+ - skills/hatch3r-cli-miller/SKILL.md
364
+ - skills/hatch3r-cli-mods/SKILL.md
365
+ - skills/hatch3r-cli-overview/SKILL.md
366
+ - skills/hatch3r-cli-playwright/SKILL.md
367
+ - skills/hatch3r-cli-podman/SKILL.md
368
+ - skills/hatch3r-cli-qsv/SKILL.md
369
+ - skills/hatch3r-cli-rtk/SKILL.md
370
+ - skills/hatch3r-cli-sd/SKILL.md
371
+ - skills/hatch3r-cli-stagehand/SKILL.md
372
+ - skills/hatch3r-cli-taplo/SKILL.md
373
+ - skills/hatch3r-cli-yq/SKILL.md
374
+ - skills/hatch3r-cli-zstd/SKILL.md
375
+
376
+ Per hatch3r's artifact-inventory and redundancy analysis, the rejected merge alternative (keep every tool as a standalone skill) was rejected because the 25 collapsed entries averaged 75 lines each (1.9k lines total) with >70% structural duplication of the same "When to Use / Token Cost / Recipes / Wrong Choice / Alternatives / Install" frame — collapse into a single category-indexed reference cuts the surface to ~250 lines while preserving the discriminator that picks one tool over another.
@@ -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
 
@@ -42,6 +39,19 @@ Run through the self-assessment checklist:
42
39
  4. **File currency**: List files you've modified — when did you last read each one?
43
40
  5. **Scope check**: Compare your current work to the original issue description.
44
41
 
42
+ ### Model-Aware Threshold Profiles
43
+
44
+ Default thresholds assume a large-context model. When the active model is known, apply the matching profile to adjust thresholds:
45
+
46
+ | Model Tier | Context Window | Token Warning | Turn Limit | File Staleness |
47
+ |-----------|---------------|---------------|------------|----------------|
48
+ | Small (< 32K) | ~32K tokens | > 60% of window | > 15 turns | > 10 turns |
49
+ | Medium (32K--128K) | ~128K tokens | > 70% of window | > 25 turns | > 15 turns |
50
+ | Large (128K--200K) | ~200K tokens | > 80% of window | > 30 turns | > 20 turns |
51
+ | Extended (> 200K) | 200K+ tokens | > 85% of window | > 40 turns | > 25 turns |
52
+
53
+ Profile resolution: read `models` in `.hatch3r/hatch.json`; default to **Large** if unset. A `contextHealth` section in `hatch.json` with explicit thresholds overrides the profile. Log the active profile at the start of each check: `"Context health using <tier> profile (<window_size> tokens)"`.
54
+
45
55
  ## Step 2: Identify Degradation
46
56
 
47
57
  | Check | Healthy | Degraded |
@@ -71,7 +81,7 @@ Run through the self-assessment checklist:
71
81
  ### If 5 checks degraded (Red): Checkpoint and Stop
72
82
  1. Save all progress (files changed, tests written)
73
83
  2. Document remaining work and blockers
74
- 3. Post progress on the issue/work item (GitHub Issue, ADO Work Item, or GitLab Issue — check `platform` in `.agents/hatch.json`)
84
+ 3. Post progress on the issue/work item (GitHub Issue, ADO Work Item, or GitLab Issue — check `platform` in `.hatch3r/hatch.json`)
75
85
  4. Recommend fresh conversation
76
86
 
77
87
  ## Step 4: Verify Improvement
@@ -108,7 +118,15 @@ Context poisoning is more dangerous than missing context because it leads to con
108
118
  - [ ] Appropriate corrective action taken
109
119
  - [ ] Health verified at Green or Yellow after correction
110
120
 
121
+ ## Board Pickup Integration
122
+
123
+ When `board-pickup` operates in auto-advance mode, context health is checked between issues. Orange completes the current issue then a fresh agent handles the next; Red mid-issue marks the issue PARTIAL and moves it back to Ready.
124
+
111
125
  ## Related Skills & Agents
112
126
 
113
- - **Command**: `hatch3r-context-health` -- full monitoring protocol with integration points
114
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.