bigpowers 2.82.4 → 2.83.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 (353) hide show
  1. package/.agents/skills/align-grid/SKILL.md +110 -0
  2. package/.agents/skills/assess-impact/SKILL.md +91 -0
  3. package/.agents/skills/audit-code/SKILL.md +187 -0
  4. package/.agents/skills/audit-plan/SKILL.md +89 -0
  5. package/.agents/skills/build-epic/SKILL.md +105 -0
  6. package/.agents/skills/change-request/SKILL.md +121 -0
  7. package/.agents/skills/commit-message/SKILL.md +140 -0
  8. package/.agents/skills/compose-workflow/SKILL.md +82 -0
  9. package/.agents/skills/context7-mcp/SKILL.md +55 -0
  10. package/.agents/skills/craft-skill/SKILL.md +179 -0
  11. package/.agents/skills/deepen-architecture/SKILL.md +260 -0
  12. package/.agents/skills/define-language/SKILL.md +80 -0
  13. package/.agents/skills/define-success/SKILL.md +65 -0
  14. package/.agents/skills/delegate-task/SKILL.md +91 -0
  15. package/.agents/skills/deploy/SKILL.md +198 -0
  16. package/.agents/skills/design-interface/SKILL.md +97 -0
  17. package/.agents/skills/develop-tdd/SKILL.md +406 -0
  18. package/.agents/skills/diagnose-root/SKILL.md +24 -0
  19. package/.agents/skills/diagnose-stall/SKILL.md +54 -0
  20. package/.agents/skills/dispatch-agents/SKILL.md +118 -0
  21. package/.agents/skills/edit-document/SKILL.md +23 -0
  22. package/.agents/skills/elaborate-spec/SKILL.md +101 -0
  23. package/.agents/skills/enforce-first/SKILL.md +32 -0
  24. package/.agents/skills/evolve-skill/SKILL.md +55 -0
  25. package/.agents/skills/execute-plan/SKILL.md +61 -0
  26. package/.agents/skills/extract-design/SKILL.md +132 -0
  27. package/.agents/skills/find-way/SKILL.md +191 -0
  28. package/.agents/skills/fix-bug/SKILL.md +67 -0
  29. package/.agents/skills/gate-trace/SKILL.md +88 -0
  30. package/.agents/skills/generate-allure-report/SKILL.md +285 -0
  31. package/.agents/skills/grill-me/SKILL.md +96 -0
  32. package/.agents/skills/grill-with-docs/SKILL.md +41 -0
  33. package/.agents/skills/guard-git/SKILL.md +231 -0
  34. package/.agents/skills/harden-vps/SKILL.md +288 -0
  35. package/.agents/skills/hook-commits/SKILL.md +94 -0
  36. package/.agents/skills/inspect-quality/SKILL.md +106 -0
  37. package/.agents/skills/investigate-bug/SKILL.md +127 -0
  38. package/.agents/skills/kickoff-branch/SKILL.md +143 -0
  39. package/.agents/skills/maintain-wiki/SKILL.md +64 -0
  40. package/.agents/skills/map-codebase/SKILL.md +71 -0
  41. package/.agents/skills/migrate-spec/SKILL.md +862 -0
  42. package/.agents/skills/model-domain/SKILL.md +232 -0
  43. package/.agents/skills/orchestrate-project/SKILL.md +174 -0
  44. package/.agents/skills/organize-workspace/SKILL.md +164 -0
  45. package/.agents/skills/plan-refactor/SKILL.md +87 -0
  46. package/.agents/skills/plan-release/SKILL.md +145 -0
  47. package/.agents/skills/plan-tests/SKILL.md +75 -0
  48. package/.agents/skills/plan-work/SKILL.md +260 -0
  49. package/.agents/skills/publish-package/SKILL.md +328 -0
  50. package/.agents/skills/quick-fix/SKILL.md +114 -0
  51. package/.agents/skills/release-branch/SKILL.md +298 -0
  52. package/.agents/skills/request-review/SKILL.md +112 -0
  53. package/.agents/skills/research-first/SKILL.md +87 -0
  54. package/.agents/skills/reset-baseline/SKILL.md +21 -0
  55. package/.agents/skills/respond-review/SKILL.md +71 -0
  56. package/.agents/skills/run-benchmark/SKILL.md +85 -0
  57. package/.agents/skills/run-evals/SKILL.md +80 -0
  58. package/.agents/skills/run-planning/SKILL.md +101 -0
  59. package/.agents/skills/scope-work/SKILL.md +63 -0
  60. package/.agents/skills/search-skills/SKILL.md +73 -0
  61. package/.agents/skills/security-review/SKILL.md +384 -0
  62. package/.agents/skills/seed-conventions/SKILL.md +285 -0
  63. package/.agents/skills/session-state/SKILL.md +146 -0
  64. package/.agents/skills/setup-environment/SKILL.md +39 -0
  65. package/.agents/skills/simulate-agents/SKILL.md +26 -0
  66. package/.agents/skills/slice-tasks/SKILL.md +68 -0
  67. package/.agents/skills/smoke-test/SKILL.md +242 -0
  68. package/.agents/skills/spike-prototype/SKILL.md +95 -0
  69. package/.agents/skills/stocktake-skills/SKILL.md +72 -0
  70. package/.agents/skills/survey-context/SKILL.md +135 -0
  71. package/.agents/skills/terse-mode/SKILL.md +42 -0
  72. package/.agents/skills/trace-requirement/SKILL.md +69 -0
  73. package/.agents/skills/using-bigpowers/SKILL.md +111 -0
  74. package/.agents/skills/validate-contracts/SKILL.md +309 -0
  75. package/.agents/skills/validate-fix/SKILL.md +106 -0
  76. package/.agents/skills/verify-work/SKILL.md +191 -0
  77. package/.agents/skills/visual-dashboard/SKILL.md +50 -0
  78. package/.agents/skills/wire-ci/SKILL.md +375 -0
  79. package/.agents/skills/wire-observability/SKILL.md +97 -0
  80. package/.agents/skills/write-document/SKILL.md +255 -0
  81. package/.hermes/skills/align-grid/SKILL.md +110 -0
  82. package/.hermes/skills/assess-impact/SKILL.md +91 -0
  83. package/.hermes/skills/audit-code/SKILL.md +187 -0
  84. package/.hermes/skills/audit-plan/SKILL.md +89 -0
  85. package/.hermes/skills/build-epic/SKILL.md +105 -0
  86. package/.hermes/skills/change-request/SKILL.md +121 -0
  87. package/.hermes/skills/commit-message/SKILL.md +140 -0
  88. package/.hermes/skills/compose-workflow/SKILL.md +82 -0
  89. package/.hermes/skills/context7-mcp/SKILL.md +55 -0
  90. package/.hermes/skills/craft-skill/SKILL.md +179 -0
  91. package/.hermes/skills/deepen-architecture/SKILL.md +260 -0
  92. package/.hermes/skills/define-language/SKILL.md +80 -0
  93. package/.hermes/skills/define-success/SKILL.md +65 -0
  94. package/.hermes/skills/delegate-task/SKILL.md +91 -0
  95. package/.hermes/skills/deploy/SKILL.md +198 -0
  96. package/.hermes/skills/design-interface/SKILL.md +97 -0
  97. package/.hermes/skills/develop-tdd/SKILL.md +406 -0
  98. package/.hermes/skills/diagnose-root/SKILL.md +24 -0
  99. package/.hermes/skills/diagnose-stall/SKILL.md +54 -0
  100. package/.hermes/skills/dispatch-agents/SKILL.md +118 -0
  101. package/.hermes/skills/edit-document/SKILL.md +23 -0
  102. package/.hermes/skills/elaborate-spec/SKILL.md +101 -0
  103. package/.hermes/skills/enforce-first/SKILL.md +32 -0
  104. package/.hermes/skills/evolve-skill/SKILL.md +55 -0
  105. package/.hermes/skills/execute-plan/SKILL.md +61 -0
  106. package/.hermes/skills/extract-design/SKILL.md +132 -0
  107. package/.hermes/skills/find-way/SKILL.md +191 -0
  108. package/.hermes/skills/fix-bug/SKILL.md +67 -0
  109. package/.hermes/skills/gate-trace/SKILL.md +88 -0
  110. package/.hermes/skills/generate-allure-report/SKILL.md +285 -0
  111. package/.hermes/skills/grill-me/SKILL.md +96 -0
  112. package/.hermes/skills/grill-with-docs/SKILL.md +41 -0
  113. package/.hermes/skills/guard-git/SKILL.md +231 -0
  114. package/.hermes/skills/harden-vps/SKILL.md +288 -0
  115. package/.hermes/skills/hook-commits/SKILL.md +94 -0
  116. package/.hermes/skills/inspect-quality/SKILL.md +106 -0
  117. package/.hermes/skills/investigate-bug/SKILL.md +127 -0
  118. package/.hermes/skills/kickoff-branch/SKILL.md +143 -0
  119. package/.hermes/skills/maintain-wiki/SKILL.md +64 -0
  120. package/.hermes/skills/map-codebase/SKILL.md +71 -0
  121. package/.hermes/skills/migrate-spec/SKILL.md +862 -0
  122. package/.hermes/skills/model-domain/SKILL.md +232 -0
  123. package/.hermes/skills/orchestrate-project/SKILL.md +174 -0
  124. package/.hermes/skills/organize-workspace/SKILL.md +164 -0
  125. package/.hermes/skills/plan-refactor/SKILL.md +87 -0
  126. package/.hermes/skills/plan-release/SKILL.md +145 -0
  127. package/.hermes/skills/plan-tests/SKILL.md +75 -0
  128. package/.hermes/skills/plan-work/SKILL.md +260 -0
  129. package/.hermes/skills/publish-package/SKILL.md +328 -0
  130. package/.hermes/skills/quick-fix/SKILL.md +114 -0
  131. package/.hermes/skills/release-branch/SKILL.md +298 -0
  132. package/.hermes/skills/request-review/SKILL.md +112 -0
  133. package/.hermes/skills/research-first/SKILL.md +87 -0
  134. package/.hermes/skills/reset-baseline/SKILL.md +21 -0
  135. package/.hermes/skills/respond-review/SKILL.md +71 -0
  136. package/.hermes/skills/run-benchmark/SKILL.md +85 -0
  137. package/.hermes/skills/run-evals/SKILL.md +80 -0
  138. package/.hermes/skills/run-planning/SKILL.md +101 -0
  139. package/.hermes/skills/scope-work/SKILL.md +63 -0
  140. package/.hermes/skills/search-skills/SKILL.md +73 -0
  141. package/.hermes/skills/security-review/SKILL.md +384 -0
  142. package/.hermes/skills/seed-conventions/SKILL.md +285 -0
  143. package/.hermes/skills/session-state/SKILL.md +146 -0
  144. package/.hermes/skills/setup-environment/SKILL.md +39 -0
  145. package/.hermes/skills/simulate-agents/SKILL.md +26 -0
  146. package/.hermes/skills/slice-tasks/SKILL.md +68 -0
  147. package/.hermes/skills/smoke-test/SKILL.md +242 -0
  148. package/.hermes/skills/spike-prototype/SKILL.md +95 -0
  149. package/.hermes/skills/stocktake-skills/SKILL.md +72 -0
  150. package/.hermes/skills/survey-context/SKILL.md +135 -0
  151. package/.hermes/skills/terse-mode/SKILL.md +42 -0
  152. package/.hermes/skills/trace-requirement/SKILL.md +69 -0
  153. package/.hermes/skills/using-bigpowers/SKILL.md +111 -0
  154. package/.hermes/skills/validate-contracts/SKILL.md +309 -0
  155. package/.hermes/skills/validate-fix/SKILL.md +106 -0
  156. package/.hermes/skills/verify-work/SKILL.md +191 -0
  157. package/.hermes/skills/visual-dashboard/SKILL.md +50 -0
  158. package/.hermes/skills/wire-ci/SKILL.md +375 -0
  159. package/.hermes/skills/wire-observability/SKILL.md +97 -0
  160. package/.hermes/skills/write-document/SKILL.md +255 -0
  161. package/.mimocode/skills/align-grid/SKILL.md +110 -0
  162. package/.mimocode/skills/assess-impact/SKILL.md +91 -0
  163. package/.mimocode/skills/audit-code/SKILL.md +187 -0
  164. package/.mimocode/skills/audit-plan/SKILL.md +89 -0
  165. package/.mimocode/skills/build-epic/SKILL.md +105 -0
  166. package/.mimocode/skills/change-request/SKILL.md +121 -0
  167. package/.mimocode/skills/commit-message/SKILL.md +140 -0
  168. package/.mimocode/skills/compose-workflow/SKILL.md +82 -0
  169. package/.mimocode/skills/context7-mcp/SKILL.md +55 -0
  170. package/.mimocode/skills/craft-skill/SKILL.md +179 -0
  171. package/.mimocode/skills/deepen-architecture/SKILL.md +260 -0
  172. package/.mimocode/skills/define-language/SKILL.md +80 -0
  173. package/.mimocode/skills/define-success/SKILL.md +65 -0
  174. package/.mimocode/skills/delegate-task/SKILL.md +91 -0
  175. package/.mimocode/skills/deploy/SKILL.md +198 -0
  176. package/.mimocode/skills/design-interface/SKILL.md +97 -0
  177. package/.mimocode/skills/develop-tdd/SKILL.md +406 -0
  178. package/.mimocode/skills/diagnose-root/SKILL.md +24 -0
  179. package/.mimocode/skills/diagnose-stall/SKILL.md +54 -0
  180. package/.mimocode/skills/dispatch-agents/SKILL.md +118 -0
  181. package/.mimocode/skills/edit-document/SKILL.md +23 -0
  182. package/.mimocode/skills/elaborate-spec/SKILL.md +101 -0
  183. package/.mimocode/skills/enforce-first/SKILL.md +32 -0
  184. package/.mimocode/skills/evolve-skill/SKILL.md +55 -0
  185. package/.mimocode/skills/execute-plan/SKILL.md +61 -0
  186. package/.mimocode/skills/extract-design/SKILL.md +132 -0
  187. package/.mimocode/skills/find-way/SKILL.md +191 -0
  188. package/.mimocode/skills/fix-bug/SKILL.md +67 -0
  189. package/.mimocode/skills/gate-trace/SKILL.md +88 -0
  190. package/.mimocode/skills/generate-allure-report/SKILL.md +285 -0
  191. package/.mimocode/skills/grill-me/SKILL.md +96 -0
  192. package/.mimocode/skills/grill-with-docs/SKILL.md +41 -0
  193. package/.mimocode/skills/guard-git/SKILL.md +231 -0
  194. package/.mimocode/skills/harden-vps/SKILL.md +288 -0
  195. package/.mimocode/skills/hook-commits/SKILL.md +94 -0
  196. package/.mimocode/skills/inspect-quality/SKILL.md +106 -0
  197. package/.mimocode/skills/investigate-bug/SKILL.md +127 -0
  198. package/.mimocode/skills/kickoff-branch/SKILL.md +143 -0
  199. package/.mimocode/skills/maintain-wiki/SKILL.md +64 -0
  200. package/.mimocode/skills/map-codebase/SKILL.md +71 -0
  201. package/.mimocode/skills/migrate-spec/SKILL.md +862 -0
  202. package/.mimocode/skills/model-domain/SKILL.md +232 -0
  203. package/.mimocode/skills/orchestrate-project/SKILL.md +174 -0
  204. package/.mimocode/skills/organize-workspace/SKILL.md +164 -0
  205. package/.mimocode/skills/plan-refactor/SKILL.md +87 -0
  206. package/.mimocode/skills/plan-release/SKILL.md +145 -0
  207. package/.mimocode/skills/plan-tests/SKILL.md +75 -0
  208. package/.mimocode/skills/plan-work/SKILL.md +260 -0
  209. package/.mimocode/skills/publish-package/SKILL.md +328 -0
  210. package/.mimocode/skills/quick-fix/SKILL.md +114 -0
  211. package/.mimocode/skills/release-branch/SKILL.md +298 -0
  212. package/.mimocode/skills/request-review/SKILL.md +112 -0
  213. package/.mimocode/skills/research-first/SKILL.md +87 -0
  214. package/.mimocode/skills/reset-baseline/SKILL.md +21 -0
  215. package/.mimocode/skills/respond-review/SKILL.md +71 -0
  216. package/.mimocode/skills/run-benchmark/SKILL.md +85 -0
  217. package/.mimocode/skills/run-evals/SKILL.md +80 -0
  218. package/.mimocode/skills/run-planning/SKILL.md +101 -0
  219. package/.mimocode/skills/scope-work/SKILL.md +63 -0
  220. package/.mimocode/skills/search-skills/SKILL.md +73 -0
  221. package/.mimocode/skills/security-review/SKILL.md +384 -0
  222. package/.mimocode/skills/seed-conventions/SKILL.md +285 -0
  223. package/.mimocode/skills/session-state/SKILL.md +146 -0
  224. package/.mimocode/skills/setup-environment/SKILL.md +39 -0
  225. package/.mimocode/skills/simulate-agents/SKILL.md +26 -0
  226. package/.mimocode/skills/slice-tasks/SKILL.md +68 -0
  227. package/.mimocode/skills/smoke-test/SKILL.md +242 -0
  228. package/.mimocode/skills/spike-prototype/SKILL.md +95 -0
  229. package/.mimocode/skills/stocktake-skills/SKILL.md +72 -0
  230. package/.mimocode/skills/survey-context/SKILL.md +135 -0
  231. package/.mimocode/skills/terse-mode/SKILL.md +42 -0
  232. package/.mimocode/skills/trace-requirement/SKILL.md +69 -0
  233. package/.mimocode/skills/using-bigpowers/SKILL.md +111 -0
  234. package/.mimocode/skills/validate-contracts/SKILL.md +309 -0
  235. package/.mimocode/skills/validate-fix/SKILL.md +106 -0
  236. package/.mimocode/skills/verify-work/SKILL.md +191 -0
  237. package/.mimocode/skills/visual-dashboard/SKILL.md +50 -0
  238. package/.mimocode/skills/wire-ci/SKILL.md +375 -0
  239. package/.mimocode/skills/wire-observability/SKILL.md +97 -0
  240. package/.mimocode/skills/write-document/SKILL.md +255 -0
  241. package/.pi/package.json +1 -1
  242. package/.zcode/skills/align-grid/SKILL.md +110 -0
  243. package/.zcode/skills/assess-impact/SKILL.md +91 -0
  244. package/.zcode/skills/audit-code/SKILL.md +187 -0
  245. package/.zcode/skills/audit-plan/SKILL.md +89 -0
  246. package/.zcode/skills/build-epic/SKILL.md +105 -0
  247. package/.zcode/skills/change-request/SKILL.md +121 -0
  248. package/.zcode/skills/commit-message/SKILL.md +140 -0
  249. package/.zcode/skills/compose-workflow/SKILL.md +82 -0
  250. package/.zcode/skills/context7-mcp/SKILL.md +55 -0
  251. package/.zcode/skills/craft-skill/SKILL.md +179 -0
  252. package/.zcode/skills/deepen-architecture/SKILL.md +260 -0
  253. package/.zcode/skills/define-language/SKILL.md +80 -0
  254. package/.zcode/skills/define-success/SKILL.md +65 -0
  255. package/.zcode/skills/delegate-task/SKILL.md +91 -0
  256. package/.zcode/skills/deploy/SKILL.md +198 -0
  257. package/.zcode/skills/design-interface/SKILL.md +97 -0
  258. package/.zcode/skills/develop-tdd/SKILL.md +406 -0
  259. package/.zcode/skills/diagnose-root/SKILL.md +24 -0
  260. package/.zcode/skills/diagnose-stall/SKILL.md +54 -0
  261. package/.zcode/skills/dispatch-agents/SKILL.md +118 -0
  262. package/.zcode/skills/edit-document/SKILL.md +23 -0
  263. package/.zcode/skills/elaborate-spec/SKILL.md +101 -0
  264. package/.zcode/skills/enforce-first/SKILL.md +32 -0
  265. package/.zcode/skills/evolve-skill/SKILL.md +55 -0
  266. package/.zcode/skills/execute-plan/SKILL.md +61 -0
  267. package/.zcode/skills/extract-design/SKILL.md +132 -0
  268. package/.zcode/skills/find-way/SKILL.md +191 -0
  269. package/.zcode/skills/fix-bug/SKILL.md +67 -0
  270. package/.zcode/skills/gate-trace/SKILL.md +88 -0
  271. package/.zcode/skills/generate-allure-report/SKILL.md +285 -0
  272. package/.zcode/skills/grill-me/SKILL.md +96 -0
  273. package/.zcode/skills/grill-with-docs/SKILL.md +41 -0
  274. package/.zcode/skills/guard-git/SKILL.md +231 -0
  275. package/.zcode/skills/harden-vps/SKILL.md +288 -0
  276. package/.zcode/skills/hook-commits/SKILL.md +94 -0
  277. package/.zcode/skills/inspect-quality/SKILL.md +106 -0
  278. package/.zcode/skills/investigate-bug/SKILL.md +127 -0
  279. package/.zcode/skills/kickoff-branch/SKILL.md +143 -0
  280. package/.zcode/skills/maintain-wiki/SKILL.md +64 -0
  281. package/.zcode/skills/map-codebase/SKILL.md +71 -0
  282. package/.zcode/skills/migrate-spec/SKILL.md +862 -0
  283. package/.zcode/skills/model-domain/SKILL.md +232 -0
  284. package/.zcode/skills/orchestrate-project/SKILL.md +174 -0
  285. package/.zcode/skills/organize-workspace/SKILL.md +164 -0
  286. package/.zcode/skills/plan-refactor/SKILL.md +87 -0
  287. package/.zcode/skills/plan-release/SKILL.md +145 -0
  288. package/.zcode/skills/plan-tests/SKILL.md +75 -0
  289. package/.zcode/skills/plan-work/SKILL.md +260 -0
  290. package/.zcode/skills/publish-package/SKILL.md +328 -0
  291. package/.zcode/skills/quick-fix/SKILL.md +114 -0
  292. package/.zcode/skills/release-branch/SKILL.md +298 -0
  293. package/.zcode/skills/request-review/SKILL.md +112 -0
  294. package/.zcode/skills/research-first/SKILL.md +87 -0
  295. package/.zcode/skills/reset-baseline/SKILL.md +21 -0
  296. package/.zcode/skills/respond-review/SKILL.md +71 -0
  297. package/.zcode/skills/run-benchmark/SKILL.md +85 -0
  298. package/.zcode/skills/run-evals/SKILL.md +80 -0
  299. package/.zcode/skills/run-planning/SKILL.md +101 -0
  300. package/.zcode/skills/scope-work/SKILL.md +63 -0
  301. package/.zcode/skills/search-skills/SKILL.md +73 -0
  302. package/.zcode/skills/security-review/SKILL.md +384 -0
  303. package/.zcode/skills/seed-conventions/SKILL.md +285 -0
  304. package/.zcode/skills/session-state/SKILL.md +146 -0
  305. package/.zcode/skills/setup-environment/SKILL.md +39 -0
  306. package/.zcode/skills/simulate-agents/SKILL.md +26 -0
  307. package/.zcode/skills/slice-tasks/SKILL.md +68 -0
  308. package/.zcode/skills/smoke-test/SKILL.md +242 -0
  309. package/.zcode/skills/spike-prototype/SKILL.md +95 -0
  310. package/.zcode/skills/stocktake-skills/SKILL.md +72 -0
  311. package/.zcode/skills/survey-context/SKILL.md +135 -0
  312. package/.zcode/skills/terse-mode/SKILL.md +42 -0
  313. package/.zcode/skills/trace-requirement/SKILL.md +69 -0
  314. package/.zcode/skills/using-bigpowers/SKILL.md +111 -0
  315. package/.zcode/skills/validate-contracts/SKILL.md +309 -0
  316. package/.zcode/skills/validate-fix/SKILL.md +106 -0
  317. package/.zcode/skills/verify-work/SKILL.md +191 -0
  318. package/.zcode/skills/visual-dashboard/SKILL.md +50 -0
  319. package/.zcode/skills/wire-ci/SKILL.md +375 -0
  320. package/.zcode/skills/wire-observability/SKILL.md +97 -0
  321. package/.zcode/skills/write-document/SKILL.md +255 -0
  322. package/CHANGELOG.md +20 -0
  323. package/bin/setup.js +13 -4
  324. package/package.json +1 -1
  325. package/scripts/adapters/agy.sh +44 -1
  326. package/scripts/adapters/gemini.sh +83 -0
  327. package/scripts/adapters/hermes.sh +53 -1
  328. package/scripts/adapters/mimo.sh +41 -0
  329. package/scripts/adapters/zcode.sh +37 -0
  330. package/scripts/hooks/hermes/gateway/session-log/HOOK.yaml +5 -0
  331. package/scripts/hooks/hermes/gateway/session-log/handler.py +7 -0
  332. package/scripts/hooks/hermes/plugin/guard-git-plugin.py +14 -0
  333. package/scripts/hooks/hermes/shell/block-dangerous-terminal.sh +23 -0
  334. package/scripts/hooks/hermes/shell/hooks-config.example.yaml +7 -0
  335. package/scripts/install-cursor-skills-local.sh +8 -6
  336. package/scripts/install-cursor-skills.sh +15 -25
  337. package/scripts/install.sh +211 -13
  338. package/scripts/lib/__pycache__/link_utils.cpython-312.pyc +0 -0
  339. package/scripts/lib/golden-suite-gates.sh +2 -1
  340. package/scripts/lib/install-helpers.js +199 -4
  341. package/scripts/lib/sync-render.sh +43 -0
  342. package/scripts/lib/target-contracts.sh +22 -0
  343. package/scripts/targets.yaml +31 -1
  344. package/scripts/test-agy-hub.sh +59 -0
  345. package/scripts/test-gemini-adapter.sh +70 -0
  346. package/scripts/test-gemini-hub.sh +55 -0
  347. package/scripts/test-hermes-adapter.sh +85 -0
  348. package/scripts/test-hermes-hub.sh +51 -0
  349. package/scripts/test-install-helpers.js +103 -0
  350. package/scripts/test-install-helpers.sh +7 -0
  351. package/scripts/test-mimo-hub.sh +51 -0
  352. package/scripts/test-zcode-hub.sh +51 -0
  353. package/scripts/verify-install.sh +31 -0
@@ -0,0 +1,198 @@
1
+ ---
2
+ name: deploy
3
+ model: sonnet
4
+ description: "Build → verify artifact → deploy → wait → smoke deployment pipeline. Platform-agnostic (MCP or CLI), with configurable timeout, retry with exponential backoff, and integrated health-check. The deploy half of CI/CD: run after build to push to production."
5
+ ---
6
+
7
+ # Deploy
8
+
9
+ > **HARD GATE** — Do not deploy without running tests first. Run `test` or your CI suite before this skill.
10
+ >
11
+ > **HARD GATE** — Use this skill from a CI/CD pipeline or post-merge on `main`/`master`. Never deploy from a feature branch.
12
+ >
13
+ > **HARD GATE** — The deploy skill orchestrates deployment; the `smoke-test` skill validates post-deploy health. Chain them: `deploy → smoke-test`.
14
+
15
+ Orchestrate a full build-to-deployment pipeline: build the artifact, verify it exists and is non-empty, invoke a platform deploy tool (MCP or CLI), poll until the deploy completes or times out, then run a baseline smoke test against the live URL.
16
+
17
+ ## Pipeline Stages
18
+
19
+ ```
20
+ build → verify artifact → deploy → wait/retry → smoke
21
+ ```
22
+
23
+ | Stage | Description | Failure mode |
24
+ |-------|-------------|-------------|
25
+ | Build | Execute the project's build command | Non-zero exit: report build error |
26
+ | Verify | Check artifact exists and is non-empty | Missing/empty: report artifact path |
27
+ | Deploy | Invoke platform deploy tool (MCP, Vercel CLI, rsync, etc.) | Non-zero exit: report deploy error |
28
+ | Wait | Poll deploy status every 30s up to `DEPLOY_TIMEOUT` (default 5 min) | Timeout: report exceeded |
29
+ | Smoke | `curl -sSf $DEPLOY_URL` as baseline health check | Non-200: report failure |
30
+
31
+ ## Process
32
+
33
+ ### 1. Detect build command
34
+
35
+ Read project manifest files in order to determine the build command:
36
+
37
+ | Manifest | Build command |
38
+ |----------|--------------|
39
+ | `package.json` | `npm run build` (or `scripts.build` value) |
40
+ | `Cargo.toml` | `cargo build --release` |
41
+ | `pyproject.toml` / `setup.py` | Depends on build backend (`poetry build`, `pip install -e .`, etc.) |
42
+ | `Makefile` | `make build` or first target named `build` |
43
+ | `AGENTS.md` / `CLAUDE.md` | Look for `build:` in project commands section |
44
+
45
+ If no manifest is found, prompt the user with: "No detected build command. Pass `--build 'npm run build'` or specify the command."
46
+
47
+ ### 2. Build the artifact
48
+
49
+ ```bash
50
+ npm run build
51
+ ```
52
+
53
+ Or the detected command from step 1. If the build fails, exit non-zero and report the build output.
54
+
55
+ ### 3. Verify the artifact
56
+
57
+ ```bash
58
+ ARTIFACT_DIR="${ARTIFACT_DIR:-dist}"
59
+ if [ ! -d "$ARTIFACT_DIR" ] || [ -z "$(ls -A "$ARTIFACT_DIR" 2>/dev/null)" ]; then
60
+ echo "FAIL: build artifact not found at $ARTIFACT_DIR"
61
+ exit 1
62
+ fi
63
+ ```
64
+
65
+ Configurable via `$ARTIFACT_DIR` environment variable (default: `dist/`).
66
+
67
+ ### 4. Deploy to platform
68
+
69
+ Platform-agnostic — supports multiple deployment targets via environment variables:
70
+
71
+ | Platform | Env var | Example |
72
+ |----------|---------|---------|
73
+ | Vercel | `VERCEL_TOKEN`, `VERCEL_PROJECT_ID` | `vercel deploy --prod --token $VERCEL_TOKEN` |
74
+ | Netlify | `NETLIFY_AUTH_TOKEN`, `NETLIFY_SITE_ID` | `netlify deploy --prod --auth $NETLIFY_AUTH_TOKEN --dir $ARTIFACT_DIR` |
75
+ | BigBase MCP | MCP tool call | `mcp deploy` via BigBase server |
76
+ | rsync/SSH | `DEPLOY_SSH_USER`, `DEPLOY_SSH_HOST`, `DEPLOY_SSH_PATH` | `rsync -avz $ARTIFACT_DIR/ $DEPLOY_SSH_USER@$DEPLOY_SSH_HOST:$DEPLOY_SSH_PATH` |
77
+ | Custom | `DEPLOY_COMMAND` | Run any deploy command string |
78
+
79
+ The deploy tool is selected by which environment variables are set. If none are configured:
80
+
81
+ ```bash
82
+ echo "No deploy target configured. Set one of: VERCEL_TOKEN, NETLIFY_AUTH_TOKEN, DEPLOY_SSH_USER+DEPLOY_SSH_HOST, DEPLOY_COMMAND, or MCP deploy tool."
83
+ exit 1
84
+ ```
85
+
86
+ ### 5. Wait and poll status
87
+
88
+ After invoking the deploy command, poll for completion:
89
+
90
+ See [REFERENCE.md](REFERENCE.md)
91
+
92
+ Use exponential backoff for retries on transient failures:
93
+
94
+ See [REFERENCE.md](REFERENCE.md)
95
+
96
+ ### 6. Baseline smoke test
97
+
98
+ See [REFERENCE.md](REFERENCE.md)
99
+
100
+ For comprehensive health-checking, chain to the `smoke-test` skill:
101
+
102
+ ```bash
103
+ # After deploy success
104
+ bash scripts/run-smoke.sh "$DEPLOY_URL"
105
+ ```
106
+
107
+ ### 7. Three-independent-facts verification (e45s15)
108
+
109
+ Before declaring deploy success, verify **three independent facts** — build artifact, platform accept, live/registry reachability. See [REFERENCE.md](REFERENCE.md#three-independent-facts).
110
+
111
+ ## Verify
112
+
113
+ → verify: `command -v curl >/dev/null 2>&1 && grep -qi 'three-independent-facts' skills/deploy/SKILL.md && echo OK || echo FAIL`
114
+
115
+ ---
116
+
117
+ # Deploy — Reference
118
+
119
+ ## Configuration
120
+
121
+ | Variable | Default | Description |
122
+ |----------|---------|-------------|
123
+ | `ARTIFACT_DIR` | `dist` | Build output directory |
124
+ | `DEPLOY_URL` | *(required)* | Live URL for smoke test |
125
+ | `DEPLOY_TIMEOUT` | `300` | Max wait for deploy completion (seconds) |
126
+ | `DEPLOY_POLL_INTERVAL` | `30` | Polling interval (seconds) |
127
+ | `RETRY_MAX` | `3` | Max deploy retry attempts |
128
+ | `BUILD_COMMAND` | *(auto-detect)* | Override build command |
129
+
130
+
131
+ ---
132
+
133
+ ## Verification
134
+
135
+ → verify: `test -f deploy/SKILL.md && grep -q 'name: deploy' deploy/SKILL.md && echo OK`
136
+ → verify: `grep -qi 'build\|artifact\|deploy\|smoke' deploy/SKILL.md && echo OK`
137
+ → verify: `grep -ci 'package.json\|Cargo.toml\|Makefile\|manifest' deploy/SKILL.md | awk '{if($1>=1) print "OK"; else print "FAIL"}'`
138
+ → verify: `grep -ci 'timeout\|poll\|status\|retry\|backoff' deploy/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`
139
+ → verify: `grep -q 'curl.*DEPLOY_URL\|smoke\|health' deploy/SKILL.md && echo OK`
140
+
141
+ ---
142
+
143
+ ## Reference block 1
144
+
145
+ ```bash
146
+ DEPLOY_TIMEOUT="${DEPLOY_TIMEOUT:-300}" # seconds (default 5 minutes)
147
+ DEPLOY_POLL_INTERVAL="${DEPLOY_POLL_INTERVAL:-30}" # seconds
148
+
149
+ start_time=$(date +%s)
150
+ while true; do
151
+ elapsed=$(( $(date +%s) - start_time ))
152
+ if [ "$elapsed" -ge "$DEPLOY_TIMEOUT" ]; then
153
+ echo "FAIL: deploy status polling timed out after ${DEPLOY_TIMEOUT}s"
154
+ exit 1
155
+ fi
156
+
157
+ status=$(get_deploy_status) # platform-specific status check
158
+ if [ "$status" = "ready" ] || [ "$status" = "done" ]; then
159
+ echo "Deploy completed in ${elapsed}s"
160
+ break
161
+ fi
162
+
163
+ sleep "$DEPLOY_POLL_INTERVAL"
164
+ done
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Reference block 2
170
+
171
+ ```bash
172
+ RETRY_MAX="${RETRY_MAX:-3}"
173
+ base_delay=2
174
+ for attempt in $(seq 1 "$RETRY_MAX"); do
175
+ if deploy_command; then
176
+ break
177
+ fi
178
+ if [ "$attempt" -eq "$RETRY_MAX" ]; then
179
+ echo "FAIL: deploy failed after ${RETRY_MAX} attempts"
180
+ exit 1
181
+ fi
182
+ sleep $(( base_delay * 2 ** (attempt - 1) ))
183
+ done
184
+ ```
185
+
186
+ ---
187
+
188
+ ## Reference block 3
189
+
190
+ ```bash
191
+ DEPLOY_URL="${DEPLOY_URL:?DEPLOY_URL must be set}"
192
+ if curl -sSf "$DEPLOY_URL" > /dev/null 2>&1; then
193
+ echo "OK: $DEPLOY_URL responds with HTTP 200"
194
+ else
195
+ echo "FAIL: $DEPLOY_URL is not responding with HTTP 200"
196
+ exit 1
197
+ fi
198
+ ```
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: design-interface
3
+ model: opus
4
+ description: "Generate multiple radically different interface designs for a module using parallel sub-agents, then compare trade-offs. Based on \"Design It Twice\" from A Philosophy of Software Design. Use when user wants to design an API, explore interface options, compare module shapes, or mentions \"design it twice\"."
5
+ ---
6
+
7
+ # Design Interface
8
+
9
+ Based on "Design It Twice" from "A Philosophy of Software Design": your first idea is unlikely to be the best. Generate multiple radically different designs, then compare.
10
+
11
+ > **HARD GATE** — Multiple design options must be explored. Do NOT settle on first idea. Compare trade-offs (UX, complexity, extensibility, performance) before committing.
12
+
13
+ ## Workflow
14
+
15
+ ### 1. Gather Requirements
16
+
17
+ Before designing, understand:
18
+
19
+ - [ ] What problem does this module solve?
20
+ - [ ] Who are the callers? (other modules, external users, tests)
21
+ - [ ] What are the key operations?
22
+ - [ ] Any constraints? (performance, compatibility, existing patterns)
23
+ - [ ] What should be hidden inside vs exposed?
24
+
25
+ Ask: "What does this module need to do? Who will use it?"
26
+
27
+ ### 2. Generate Designs (Parallel Sub-Agents)
28
+
29
+ Spawn 3+ sub-agents simultaneously using Task tool. Each must produce a **radically different** approach.
30
+
31
+ ```
32
+ Prompt template for each sub-agent:
33
+
34
+ Design an interface for: [module description]
35
+
36
+ Requirements: [gathered requirements]
37
+
38
+ Constraints for this design: [assign a different constraint to each agent]
39
+ - Agent 1: "Minimize method count - aim for 1-3 methods max"
40
+ - Agent 2: "Maximize flexibility - support many use cases"
41
+ - Agent 3: "Optimize for the most common case"
42
+ - Agent 4: "Take inspiration from [specific paradigm/library]"
43
+
44
+ Output format:
45
+ 1. Interface signature (types/methods)
46
+ 2. Usage example (how caller uses it)
47
+ 3. What this design hides internally
48
+ 4. Trade-offs of this approach
49
+ ```
50
+
51
+ ### 3. Present Designs
52
+
53
+ Show each design with:
54
+
55
+ 1. **Interface signature** — types, methods, params
56
+ 2. **Usage examples** — how callers actually use it in practice
57
+ 3. **What it hides** — complexity kept internal
58
+
59
+ Present designs sequentially so user can absorb each approach before comparison.
60
+
61
+ ### 4. Compare Designs
62
+
63
+ After showing all designs, compare them on:
64
+
65
+ - **Interface simplicity**: fewer methods, simpler params
66
+ - **General-purpose vs specialized**: flexibility vs focus
67
+ - **Implementation efficiency**: does shape allow efficient internals?
68
+ - **Depth**: small interface hiding significant complexity (good) vs large interface with thin implementation (bad)
69
+ - **Ease of correct use** vs **ease of misuse**
70
+
71
+ Discuss trade-offs in prose, not tables. Highlight where designs diverge most.
72
+
73
+ ### 5. Synthesize
74
+
75
+ Often the best design combines insights from multiple options. Ask:
76
+
77
+ - "Which design best fits your primary use case?"
78
+ - "Any elements from other designs worth incorporating?"
79
+
80
+ ## Evaluation Criteria
81
+
82
+ From "A Philosophy of Software Design":
83
+
84
+ **Interface simplicity**: Fewer methods, simpler params = easier to learn and use correctly.
85
+
86
+ **General-purpose**: Can handle future use cases without changes. But beware over-generalization.
87
+
88
+ **Implementation efficiency**: Does interface shape allow efficient implementation? Or force awkward internals?
89
+
90
+ **Depth**: Small interface hiding significant complexity = deep module (good). Large interface with thin implementation = shallow module (avoid).
91
+
92
+ ## Anti-Patterns
93
+
94
+ - Don't let sub-agents produce similar designs — enforce radical difference
95
+ - Don't skip comparison — the value is in contrast
96
+ - Don't implement — this is purely about interface shape
97
+ - Don't evaluate based on implementation effort
@@ -0,0 +1,406 @@
1
+ ---
2
+ name: develop-tdd
3
+ model: sonnet
4
+ description: "Test-driven development with red-green-refactor loop using vertical slices. Use for features (epic tasks) or bugs (specs/bugs/BUG-*.md)."
5
+ ---
6
+
7
+ # Develop TDD
8
+
9
+ > **HARD GATE** — Do NOT proceed if on `main` or `master`. Run `kickoff-branch` first to create a feature branch or worktree.
10
+ >
11
+ > **HARD GATE** — Do NOT write code before you have a plan. New feature: `plan-work` → epic capsule tasks. Bug: `investigate-bug` → `specs/bugs/BUG-*.md` (or use `fix-bug` orchestrator).
12
+ >
13
+ > **RECURSIVE DISCIPLINE** — This lifecycle applies to EVERY task, including updating these skills. Never skip planning because a task is "meta" or "just documentation."
14
+
15
+ ## Philosophy
16
+
17
+ Tests verify behavior through public interfaces, not implementation details. A good test reads like a specification. See [REFERENCE.md](REFERENCE.md) for the horizontal-slice anti-pattern and TDD phase detail.
18
+
19
+ ## Red Flags
20
+
21
+ If you catch yourself thinking these, stop and reconsider — you are likely deviating from production-grade craft.
22
+
23
+ | Red Flag | Reality |
24
+ | :--- | :--- |
25
+ | "This is too simple to need tests." | Simple code is where bugs hide. If it's simple, the test is cheap. |
26
+ | "I'll refactor this later." | "Later" is when technical debt becomes bankruptcy. Refactor while Green. |
27
+ | "The tests are already comprehensive." | If you're adding behavior, you need a new test. Coverage ≠ Correctness. |
28
+ | "I'm just fixing a small bug." | Small bugs often indicate deep interface flaws. Investigate root cause. |
29
+ | "I need to mock this internal class." | Mocking internals couples tests to implementation. Mock only I/O. |
30
+ | "This refactor is out of scope." | Leave the code cleaner than you found it (Boy Scout Rule). |
31
+ | "Preflight failed but it's unrelated." | **Always Green:** any reproducible gate failure routes **quick-fix → fix-bug** before forward work. Session boundaries do not waive Preflight. |
32
+ | "I'll note the red gate and continue." | Narrating a failure is banned. fix-or-log is mandatory per CONVENTIONS § Discovered Defects. |
33
+
34
+ ## Workflow
35
+
36
+ > **Timing:** `bash scripts/bp-timing.sh start develop-tdd` at invocation; `bash scripts/bp-timing.sh end develop-tdd` before handoff.
37
+
38
+ ### 1. Planning
39
+
40
+ - [ ] Read active `specs/epics/*/epic.yaml` story tasks or `specs/bugs/BUG-*.md` — understand verify steps
41
+ - [ ] If `specs/tech-architecture/eNN-TEST_PLAN_LATEST.md` exists for the active epic, read it before writing the first test. Implement P0 scenarios (`SC-*-P0-*`) before P1. P2/P3 scenarios are optional per time budget.
42
+ - [ ] Confirm interface changes and behaviors to test (prioritize)
43
+ - [ ] Design interfaces for testability — identify [deep modules](deep-modules.md) opportunities
44
+ - [ ] Get user approval on the plan
45
+
46
+ Apply the **enforce-first** F.I.R.S.T rubric: Fast, Independent, Repeatable, Self-Validating, Timely.
47
+
48
+ ### 2. Tracer Bullet
49
+
50
+ Write ONE test that confirms ONE thing about the system:
51
+
52
+ ```
53
+ RED: Write test for first behavior → test fails → commit: test(<scope>): ... (test-only; red in CI)
54
+ GREEN: Write minimal code to pass → test passes → commit: feat(<scope>): ... (fix commit; green)
55
+ REFACTOR (optional): clean up → commit: refactor(<scope>): ...
56
+ ```
57
+
58
+ > **Two-commit red/green policy (HARD GATE — e45s08)** — Each behavior cycle requires **two separate commits**: (1) test-only commit that fails in CI (RED), then (2) implementation commit that makes it pass (GREEN). Never combine test + fix in one commit. Show `git log -2 --oneline` as evidence before proceeding to the next behavior.
59
+
60
+ > **tasks.yaml ledger (e45s06)** — After each task's `verify:` exits 0, update `eNNsYY-tasks.yaml`: set that task's `status: passing`. Story-level `status: passing` only when all tasks pass.
61
+
62
+ ### 3. Incremental Loop
63
+
64
+ > **Snapshot-before-transition (e45s34):** Before each RED → GREEN or GREEN → REFACTOR transition, create a checkpoint so a failed transition can be rolled back cleanly:
65
+
66
+ ```bash
67
+ bash scripts/bp-yaml-snapshot.sh specs/state.yaml # if state changed this cycle
68
+ git stash push -m "tdd-checkpoint-$(git rev-parse --short HEAD)-red" --keep-index 2>/dev/null || true
69
+ ```
70
+
71
+ After GREEN passes and is committed, drop the stash (`git stash drop` if empty). Never refactor while RED.
72
+
73
+ For each remaining behavior: RED → GREEN → REFACTOR (optional). One test at a time. **Two commits per behavior** (test-only RED, then fix GREEN). Commit after every GREEN phase.
74
+
75
+ ### 4. Visual Slices (UI alternate workflow)
76
+
77
+ For UI components where behavioral unit testing is brittle: extract logic into a Controller/ViewModel/Hook (pure TDD), then use Visual Slices for the View layer. See [REFERENCE.md](REFERENCE.md) for the full Visual Slices procedure.
78
+
79
+ ### 5. Refactor
80
+
81
+ After all tests pass: extract duplication, deepen modules, apply SOLID principles. **Never refactor while RED.**
82
+
83
+ ### 6. Verify
84
+
85
+ After every behavior cycle, run the verify command from the active epic task. Show evidence before declaring the step done.
86
+
87
+ ### 7. Manual Verification Handover
88
+
89
+ Once all tests pass: locate the Verification Script in the active epic capsule, present it to the user step-by-step, and wait for confirmation of behavioral correctness.
90
+
91
+
92
+ ### 6a. CI dry-run sub-step
93
+
94
+ If this cycle modified files in `.github/workflows/`, run the CI dry-run procedure documented in [REFERENCE.md](REFERENCE.md#ci-dry-run).
95
+
96
+ ## Checklist Per Cycle
97
+
98
+ ```
99
+ [ ] Test describes behavior, not implementation
100
+ [ ] No test is ignored without an explicit ambiguity note (T4)
101
+ [ ] Boundary conditions tested: empty, max, min, off-by-one (T5)
102
+ [ ] Tests verify behavior through public interface only — no private methods (T8)
103
+ [ ] Test would survive internal refactor
104
+ [ ] Code is minimal for this test
105
+ [ ] No speculative features added
106
+ [ ] Every new abstraction has an explicit "Reason for Depth" justification
107
+ [ ] Progress committed (Conventional Commits)
108
+ [ ] verify: command passes
109
+ ```
110
+
111
+
112
+
113
+ ## Handoff
114
+
115
+ Gate: READY -> next: verify-work
116
+ Writes: state.yaml handoff.next_skill = verify-work
117
+
118
+ ## BCP Plus Integration
119
+
120
+ At story completion, if the story was sized with BCP Plus (13-dimension breakdown), log the `bcp_plus.total` alongside the standard `bcps:` count in the story's tasks.yaml. The breakdown is available from the epic capsule's `bcp_plus_breakdown` field. See `docs/references/bcp-plus.md` for the full methodology and NFR Gate pattern.
121
+
122
+
123
+ <!-- story: e02s04 -->
124
+
125
+ ---
126
+
127
+ # Develop TDD — Reference
128
+
129
+ ## Anti-Pattern: Horizontal Slices
130
+
131
+ **DO NOT write all tests first, then all implementation.** This is "horizontal slicing" — treating RED as "write all tests" and GREEN as "write all code."
132
+
133
+ This produces **crap tests**:
134
+ - Tests written in bulk test _imagined_ behavior, not _actual_ behavior
135
+ - You end up testing the _shape_ of things rather than user-facing behavior
136
+ - Tests become insensitive to real changes
137
+
138
+ **Correct approach**: Vertical slices via tracer bullets. One test → one implementation → repeat.
139
+
140
+ ```
141
+ WRONG (horizontal):
142
+ RED: test1, test2, test3, test4, test5
143
+ GREEN: impl1, impl2, impl3, impl4, impl5
144
+
145
+ RIGHT (vertical):
146
+ RED→GREEN: test1→impl1
147
+ RED→GREEN: test2→impl2
148
+ RED→GREEN: test3→impl3
149
+ ...
150
+ ```
151
+
152
+ > The Red Flags table lives in [SKILL.md](SKILL.md#red-flags) — it is core behavioral guidance, not reference detail.
153
+
154
+ ## TDD Phases (Detail)
155
+
156
+ ### Red Phase
157
+
158
+ Write a failing test first:
159
+ - Test describes the desired observable behavior through the public interface
160
+ - Run the test to confirm it fails for the right reason (not a syntax error, not a typo)
161
+ - Commit: `git commit -m "test(<scope>): <description>"`
162
+
163
+ ### Green Phase
164
+
165
+ Write the minimum code to make the test pass:
166
+ - No extra logic, no anticipated future cases, no premature optimization
167
+ - Focus only on making the current test pass
168
+ - Commit: `git commit -m "feat(<scope>): <description>"` or `"fix(<scope>): <description>"`
169
+
170
+ ### Refactor Phase
171
+
172
+ Improve structure without changing behavior:
173
+ - Extract duplication, apply SOLID principles where natural, deepen modules
174
+ - Run tests after each refactor step to ensure behavior is preserved
175
+ - Commit: `git commit -m "refactor(<scope>): <description>"`
176
+ - Apply the Boy Scout Rule: leave the code cleaner than you found it
177
+
178
+ ## Visual Slices (UI Alternate Workflow)
179
+
180
+ For UI components (SwiftUI, React, Flutter) where behavioral unit testing is brittle or low-signal:
181
+
182
+ 1. **Test-First Logic**: Extract logic (state transitions, formatting, validation) into a Controller, ViewModel, or Hook. This logic MUST follow pure TDD.
183
+ 2. **Visual Verification**: For the View/Component itself:
184
+ - **RED**: Write the component signature and a basic preview/snapshot that fails (or displays placeholder).
185
+ - **GREEN**: Implement the UI and verify visually via manual run, preview, or snapshot test.
186
+ - **REFINE**: Adjust styling and layout until it matches the design.
187
+ 3. **COMMIT**: `git commit -m "feat(ui): <component name> visual slice verified"`
188
+
189
+ ---
190
+
191
+ # Deep Modules
192
+
193
+ From "A Philosophy of Software Design":
194
+
195
+ **Deep module** = small interface + lots of implementation
196
+
197
+ ```
198
+ ┌─────────────────────┐
199
+ │ Small Interface │ ← Few methods, simple params
200
+ ├─────────────────────┤
201
+ │ │
202
+ │ │
203
+ │ Deep Implementation│ ← Complex logic hidden
204
+ │ │
205
+ │ │
206
+ └─────────────────────┘
207
+ ```
208
+
209
+ **Shallow module** = large interface + little implementation (avoid)
210
+
211
+ ```
212
+ ┌─────────────────────────────────┐
213
+ │ Large Interface │ ← Many methods, complex params
214
+ ├─────────────────────────────────┤
215
+ │ Thin Implementation │ ← Just passes through
216
+ └─────────────────────────────────┘
217
+ ```
218
+
219
+ When designing interfaces, ask:
220
+
221
+ - Can I reduce the number of methods?
222
+ - Can I simplify the parameters?
223
+ - Can I hide more complexity inside?
224
+
225
+ ---
226
+
227
+ # Interface Design for Testability
228
+
229
+ Good interfaces make testing natural:
230
+
231
+ 1. **Accept dependencies, don't create them**
232
+
233
+ ```typescript
234
+ // Testable
235
+ function processOrder(order, paymentGateway) {}
236
+
237
+ // Hard to test
238
+ function processOrder(order) {
239
+ const gateway = new StripeGateway();
240
+ }
241
+ ```
242
+
243
+ 2. **Return results, don't produce side effects**
244
+
245
+ ```typescript
246
+ // Testable
247
+ function calculateDiscount(cart): Discount {}
248
+
249
+ // Hard to test
250
+ function applyDiscount(cart): void {
251
+ cart.total -= discount;
252
+ }
253
+ ```
254
+
255
+ 3. **Small surface area**
256
+ - Fewer methods = fewer tests needed
257
+ - Fewer params = simpler test setup
258
+
259
+ ---
260
+
261
+ # When to Mock
262
+
263
+ Mock at **system boundaries** only:
264
+
265
+ - External APIs (payment, email, etc.)
266
+ - Databases (sometimes - prefer test DB)
267
+ - Time/randomness
268
+ - File system (sometimes)
269
+
270
+ Don't mock:
271
+
272
+ - Your own classes/modules
273
+ - Internal collaborators
274
+ - Anything you control
275
+
276
+ ## Designing for Mockability
277
+
278
+ At system boundaries, design interfaces that are easy to mock:
279
+
280
+ **1. Use dependency injection**
281
+
282
+ Pass external dependencies in rather than creating them internally:
283
+
284
+ ```typescript
285
+ // Easy to mock
286
+ function processPayment(order, paymentClient) {
287
+ return paymentClient.charge(order.total);
288
+ }
289
+
290
+ // Hard to mock
291
+ function processPayment(order) {
292
+ const client = new StripeClient(process.env.STRIPE_KEY);
293
+ return client.charge(order.total);
294
+ }
295
+ ```
296
+
297
+ **2. Prefer SDK-style interfaces over generic fetchers**
298
+
299
+ Create specific functions for each external operation instead of one generic function with conditional logic:
300
+
301
+ ```typescript
302
+ // GOOD: Each function is independently mockable
303
+ const api = {
304
+ getUser: (id) => fetch(`/users/${id}`),
305
+ getOrders: (userId) => fetch(`/users/${userId}/orders`),
306
+ createOrder: (data) => fetch('/orders', { method: 'POST', body: data }),
307
+ };
308
+
309
+ // BAD: Mocking requires conditional logic inside the mock
310
+ const api = {
311
+ fetch: (endpoint, options) => fetch(endpoint, options),
312
+ };
313
+ ```
314
+
315
+ The SDK approach means:
316
+ - Each mock returns one specific shape
317
+ - No conditional logic in test setup
318
+ - Easier to see which endpoints a test exercises
319
+ - Type safety per endpoint
320
+
321
+ ---
322
+
323
+ # Refactor Candidates
324
+
325
+ After TDD cycle, look for:
326
+
327
+ - **Duplication** → Extract function/class
328
+ - **Long methods** → Break into private helpers (keep tests on public interface)
329
+ - **Shallow modules** → Combine or deepen
330
+ - **Feature envy** → Move logic to where data lives
331
+ - **Primitive obsession** → Introduce value objects
332
+ - **Existing code** the new code reveals as problematic
333
+
334
+ ---
335
+
336
+ # Good and Bad Tests
337
+
338
+ ## Good Tests
339
+
340
+ **Integration-style**: Test through real interfaces, not mocks of internal parts.
341
+
342
+ ```typescript
343
+ // GOOD: Tests observable behavior
344
+ test("user can checkout with valid cart", async () => {
345
+ const cart = createCart();
346
+ cart.add(product);
347
+ const result = await checkout(cart, paymentMethod);
348
+ expect(result.status).toBe("confirmed");
349
+ });
350
+ ```
351
+
352
+ Characteristics:
353
+
354
+ - Tests behavior users/callers care about
355
+ - Uses public API only
356
+ - Survives internal refactors
357
+ - Describes WHAT, not HOW
358
+ - One logical assertion per test
359
+
360
+ ## Bad Tests
361
+
362
+ **Implementation-detail tests**: Coupled to internal structure.
363
+
364
+ ```typescript
365
+ // BAD: Tests implementation details
366
+ test("checkout calls paymentService.process", async () => {
367
+ const mockPayment = jest.mock(paymentService);
368
+ await checkout(cart, payment);
369
+ expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
370
+ });
371
+ ```
372
+
373
+ Red flags:
374
+
375
+ - Mocking internal collaborators
376
+ - Testing private methods
377
+ - Asserting on call counts/order
378
+ - Test breaks when refactoring without behavior change
379
+ - Test name describes HOW not WHAT
380
+ - Verifying through external means instead of interface
381
+
382
+ ```typescript
383
+ // BAD: Bypasses interface to verify
384
+ test("createUser saves to database", async () => {
385
+ await createUser({ name: "Alice" });
386
+ const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
387
+ expect(row).toBeDefined();
388
+ });
389
+
390
+ // GOOD: Verifies through interface
391
+ test("createUser makes user retrievable", async () => {
392
+ const user = await createUser({ name: "Alice" });
393
+ const retrieved = await getUser(user.id);
394
+ expect(retrieved.name).toBe("Alice");
395
+ });
396
+ ```
397
+
398
+ ## Clean Test Heuristics (Uncle Bob, Ch 17)
399
+
400
+ Apply these specific heuristics to maintain a high-quality suite:
401
+
402
+ - **T1: Insufficient Tests**: A test suite should test everything that could possibly break. Don't stop at "it seems to work."
403
+ - **T4: Ignored Tests**: Never ignore a test without documenting the ambiguity. An ignored test is a silent warning of a gap in understanding.
404
+ - **T5: Test Boundary Conditions**: Most bugs happen at the edges. Test the exact boundaries (e.g., empty strings, max integers, off-by-one indices).
405
+ - **T6: Exhaustively Test Near Bugs**: Bugs congregate. If you find one, there are likely others nearby; test that area thoroughly.
406
+ - **T9: Tests Should Be Fast**: Slow tests don't get run. Keep them fast so they remain part of the core developer loop.