@arthai/agents 1.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 (390) hide show
  1. package/README.md +123 -0
  2. package/VERSION +1 -0
  3. package/agents/ai-consultant.md +999 -0
  4. package/agents/architect.md +174 -0
  5. package/agents/code-reviewer.md +115 -0
  6. package/agents/competitive-analyst.md +688 -0
  7. package/agents/content-strategist.md +607 -0
  8. package/agents/design-studio-create.md +304 -0
  9. package/agents/design-studio-critique.md +258 -0
  10. package/agents/design-studio-think.md +79 -0
  11. package/agents/domain-hunter.md +519 -0
  12. package/agents/explore-light.md +52 -0
  13. package/agents/frontend.md +261 -0
  14. package/agents/gtm-expert.md +811 -0
  15. package/agents/meeting-prep.md +318 -0
  16. package/agents/ops.md +149 -0
  17. package/agents/product-manager.md +563 -0
  18. package/agents/python-backend.md +286 -0
  19. package/agents/qa-baseline-updater.md +45 -0
  20. package/agents/qa-challenger.md +97 -0
  21. package/agents/qa-domain.md +145 -0
  22. package/agents/qa-e2e.md +184 -0
  23. package/agents/qa-test-promoter.md +97 -0
  24. package/agents/qa.md +226 -0
  25. package/agents/setup.md +134 -0
  26. package/agents/sre.md +165 -0
  27. package/agents/stakeholder-reporter.md +94 -0
  28. package/agents/user-researcher.md +602 -0
  29. package/bin/cli.js +322 -0
  30. package/bundles/canvas.json +16 -0
  31. package/bundles/compass.json +16 -0
  32. package/bundles/counsel.json +31 -0
  33. package/bundles/cruise.json +11 -0
  34. package/bundles/forge.json +26 -0
  35. package/bundles/prime.json +10 -0
  36. package/bundles/prism.json +23 -0
  37. package/bundles/scalpel.json +17 -0
  38. package/bundles/sentinel.json +19 -0
  39. package/bundles/shield.json +14 -0
  40. package/bundles/spark.json +19 -0
  41. package/compiler.sh +305 -0
  42. package/dist/plugins/canvas/.claude-plugin/plugin.json +6 -0
  43. package/dist/plugins/canvas/agents/design-studio-create.md +304 -0
  44. package/dist/plugins/canvas/agents/design-studio-critique.md +258 -0
  45. package/dist/plugins/canvas/agents/design-studio-think.md +79 -0
  46. package/dist/plugins/canvas/agents/frontend.md +261 -0
  47. package/dist/plugins/canvas/skills/planning/SKILL.md +436 -0
  48. package/dist/plugins/compass/.claude-plugin/plugin.json +6 -0
  49. package/dist/plugins/compass/agents/content-strategist.md +607 -0
  50. package/dist/plugins/compass/agents/gtm-expert.md +811 -0
  51. package/dist/plugins/compass/agents/product-manager.md +563 -0
  52. package/dist/plugins/compass/agents/user-researcher.md +602 -0
  53. package/dist/plugins/compass/skills/planning/SKILL.md +436 -0
  54. package/dist/plugins/counsel/.claude-plugin/plugin.json +6 -0
  55. package/dist/plugins/counsel/agents/ai-consultant.md +999 -0
  56. package/dist/plugins/counsel/agents/competitive-analyst.md +688 -0
  57. package/dist/plugins/counsel/agents/meeting-prep.md +318 -0
  58. package/dist/plugins/counsel/agents/stakeholder-reporter.md +94 -0
  59. package/dist/plugins/counsel/hooks/check-deliverable.sh +65 -0
  60. package/dist/plugins/counsel/hooks/ensure-client-dir.sh +59 -0
  61. package/dist/plugins/counsel/hooks/hooks.json +28 -0
  62. package/dist/plugins/counsel/skills/client-discovery/SKILL.md +266 -0
  63. package/dist/plugins/counsel/skills/consulting/SKILL.md +282 -0
  64. package/dist/plugins/counsel/skills/deliverable-builder/SKILL.md +928 -0
  65. package/dist/plugins/counsel/skills/engagement-tracker/SKILL.md +380 -0
  66. package/dist/plugins/counsel/skills/market-research/SKILL.md +300 -0
  67. package/dist/plugins/counsel/skills/opportunity-map/SKILL.md +307 -0
  68. package/dist/plugins/counsel/skills/pitch-generator/SKILL.md +378 -0
  69. package/dist/plugins/counsel/skills/roi-calculator/SKILL.md +469 -0
  70. package/dist/plugins/counsel/skills/share/SKILL.md +211 -0
  71. package/dist/plugins/counsel/skills/solution-architect/SKILL.md +566 -0
  72. package/dist/plugins/counsel/skills/templates/SKILL.md +194 -0
  73. package/dist/plugins/counsel/skills/welcome/SKILL.md +136 -0
  74. package/dist/plugins/counsel/skills/wizard/SKILL.md +411 -0
  75. package/dist/plugins/cruise/.claude-plugin/plugin.json +6 -0
  76. package/dist/plugins/cruise/skills/autopilot/SKILL.md +425 -0
  77. package/dist/plugins/forge/.claude-plugin/plugin.json +6 -0
  78. package/dist/plugins/forge/agents/architect.md +174 -0
  79. package/dist/plugins/forge/agents/code-reviewer.md +115 -0
  80. package/dist/plugins/forge/agents/frontend.md +261 -0
  81. package/dist/plugins/forge/agents/product-manager.md +563 -0
  82. package/dist/plugins/forge/agents/python-backend.md +286 -0
  83. package/dist/plugins/forge/agents/qa.md +226 -0
  84. package/dist/plugins/forge/hooks/hooks.json +28 -0
  85. package/dist/plugins/forge/hooks/post-test-summary.sh +115 -0
  86. package/dist/plugins/forge/hooks/triage-router.sh +740 -0
  87. package/dist/plugins/forge/skills/implement/SKILL.md +532 -0
  88. package/dist/plugins/forge/skills/planning/SKILL.md +436 -0
  89. package/dist/plugins/forge/skills/pr/SKILL.md +275 -0
  90. package/dist/plugins/forge/skills/precheck/SKILL.md +159 -0
  91. package/dist/plugins/forge/skills/qa/SKILL.md +127 -0
  92. package/dist/plugins/forge/skills/review-pr/SKILL.md +367 -0
  93. package/dist/plugins/prime/.claude-plugin/plugin.json +6 -0
  94. package/dist/plugins/prime/agents/ai-consultant.md +999 -0
  95. package/dist/plugins/prime/agents/architect.md +174 -0
  96. package/dist/plugins/prime/agents/code-reviewer.md +115 -0
  97. package/dist/plugins/prime/agents/competitive-analyst.md +688 -0
  98. package/dist/plugins/prime/agents/content-strategist.md +607 -0
  99. package/dist/plugins/prime/agents/design-studio-create.md +304 -0
  100. package/dist/plugins/prime/agents/design-studio-critique.md +258 -0
  101. package/dist/plugins/prime/agents/design-studio-think.md +79 -0
  102. package/dist/plugins/prime/agents/explore-light.md +52 -0
  103. package/dist/plugins/prime/agents/frontend.md +261 -0
  104. package/dist/plugins/prime/agents/gtm-expert.md +811 -0
  105. package/dist/plugins/prime/agents/meeting-prep.md +318 -0
  106. package/dist/plugins/prime/agents/ops.md +149 -0
  107. package/dist/plugins/prime/agents/product-manager.md +563 -0
  108. package/dist/plugins/prime/agents/python-backend.md +286 -0
  109. package/dist/plugins/prime/agents/qa-baseline-updater.md +45 -0
  110. package/dist/plugins/prime/agents/qa-challenger.md +97 -0
  111. package/dist/plugins/prime/agents/qa-domain.md +145 -0
  112. package/dist/plugins/prime/agents/qa-e2e.md +184 -0
  113. package/dist/plugins/prime/agents/qa-test-promoter.md +97 -0
  114. package/dist/plugins/prime/agents/qa.md +226 -0
  115. package/dist/plugins/prime/agents/setup.md +134 -0
  116. package/dist/plugins/prime/agents/sre.md +165 -0
  117. package/dist/plugins/prime/agents/stakeholder-reporter.md +94 -0
  118. package/dist/plugins/prime/agents/user-researcher.md +602 -0
  119. package/dist/plugins/prime/hooks/check-deliverable.sh +65 -0
  120. package/dist/plugins/prime/hooks/ensure-client-dir.sh +59 -0
  121. package/dist/plugins/prime/hooks/hooks.json +184 -0
  122. package/dist/plugins/prime/hooks/post-deploy-health.sh +83 -0
  123. package/dist/plugins/prime/hooks/post-diff-test-compare.sh +125 -0
  124. package/dist/plugins/prime/hooks/post-edit-lint.sh +92 -0
  125. package/dist/plugins/prime/hooks/post-git-state.sh +54 -0
  126. package/dist/plugins/prime/hooks/post-merge-cleanup.sh +101 -0
  127. package/dist/plugins/prime/hooks/post-test-summary.sh +115 -0
  128. package/dist/plugins/prime/hooks/pre-bash-guard.sh +142 -0
  129. package/dist/plugins/prime/hooks/pre-edit-guard.sh +121 -0
  130. package/dist/plugins/prime/hooks/pre-task-context.sh +113 -0
  131. package/dist/plugins/prime/hooks/session-bootstrap.sh +379 -0
  132. package/dist/plugins/prime/hooks/session-end.sh +107 -0
  133. package/dist/plugins/prime/hooks/session-summary.sh +97 -0
  134. package/dist/plugins/prime/hooks/sync-agents.sh +269 -0
  135. package/dist/plugins/prime/hooks/triage-router.sh +740 -0
  136. package/dist/plugins/prime/skills/arth/SKILL.md +165 -0
  137. package/dist/plugins/prime/skills/autopilot/SKILL.md +425 -0
  138. package/dist/plugins/prime/skills/calibrate/SKILL.md +1807 -0
  139. package/dist/plugins/prime/skills/ci-fix/SKILL.md +293 -0
  140. package/dist/plugins/prime/skills/client-discovery/SKILL.md +266 -0
  141. package/dist/plugins/prime/skills/consulting/SKILL.md +282 -0
  142. package/dist/plugins/prime/skills/custom-domain/SKILL.md +261 -0
  143. package/dist/plugins/prime/skills/deliverable-builder/SKILL.md +928 -0
  144. package/dist/plugins/prime/skills/discord-ops/SKILL.md +125 -0
  145. package/dist/plugins/prime/skills/engagement-tracker/SKILL.md +380 -0
  146. package/dist/plugins/prime/skills/explore.md +43 -0
  147. package/dist/plugins/prime/skills/fix/SKILL.md +1058 -0
  148. package/dist/plugins/prime/skills/implement/SKILL.md +532 -0
  149. package/dist/plugins/prime/skills/incident/SKILL.md +910 -0
  150. package/dist/plugins/prime/skills/issue/SKILL.md +134 -0
  151. package/dist/plugins/prime/skills/market-research/SKILL.md +300 -0
  152. package/dist/plugins/prime/skills/onboard/SKILL.md +344 -0
  153. package/dist/plugins/prime/skills/opportunity-map/SKILL.md +307 -0
  154. package/dist/plugins/prime/skills/pitch-generator/SKILL.md +378 -0
  155. package/dist/plugins/prime/skills/planning/SKILL.md +436 -0
  156. package/dist/plugins/prime/skills/pr/SKILL.md +275 -0
  157. package/dist/plugins/prime/skills/precheck/SKILL.md +159 -0
  158. package/dist/plugins/prime/skills/qa/SKILL.md +127 -0
  159. package/dist/plugins/prime/skills/qa-incident/SKILL.md +54 -0
  160. package/dist/plugins/prime/skills/qa-learn/SKILL.md +47 -0
  161. package/dist/plugins/prime/skills/restart/SKILL.md +70 -0
  162. package/dist/plugins/prime/skills/review-pr/SKILL.md +367 -0
  163. package/dist/plugins/prime/skills/roi-calculator/SKILL.md +469 -0
  164. package/dist/plugins/prime/skills/scan/SKILL.md +232 -0
  165. package/dist/plugins/prime/skills/setup/SKILL.md +691 -0
  166. package/dist/plugins/prime/skills/share/SKILL.md +211 -0
  167. package/dist/plugins/prime/skills/solution-architect/SKILL.md +566 -0
  168. package/dist/plugins/prime/skills/sre/SKILL.md +362 -0
  169. package/dist/plugins/prime/skills/sync/SKILL.md +188 -0
  170. package/dist/plugins/prime/skills/templates/SKILL.md +194 -0
  171. package/dist/plugins/prime/skills/welcome/SKILL.md +136 -0
  172. package/dist/plugins/prime/skills/wizard/SKILL.md +411 -0
  173. package/dist/plugins/prism/.claude-plugin/plugin.json +6 -0
  174. package/dist/plugins/prism/agents/qa-baseline-updater.md +45 -0
  175. package/dist/plugins/prism/agents/qa-challenger.md +97 -0
  176. package/dist/plugins/prism/agents/qa-domain.md +145 -0
  177. package/dist/plugins/prism/agents/qa-e2e.md +184 -0
  178. package/dist/plugins/prism/agents/qa-test-promoter.md +97 -0
  179. package/dist/plugins/prism/agents/qa.md +226 -0
  180. package/dist/plugins/prism/hooks/hooks.json +26 -0
  181. package/dist/plugins/prism/hooks/post-diff-test-compare.sh +125 -0
  182. package/dist/plugins/prism/hooks/post-test-summary.sh +115 -0
  183. package/dist/plugins/prism/skills/qa/SKILL.md +127 -0
  184. package/dist/plugins/prism/skills/qa-incident/SKILL.md +54 -0
  185. package/dist/plugins/prism/skills/qa-learn/SKILL.md +47 -0
  186. package/dist/plugins/scalpel/.claude-plugin/plugin.json +6 -0
  187. package/dist/plugins/scalpel/agents/code-reviewer.md +115 -0
  188. package/dist/plugins/scalpel/hooks/hooks.json +26 -0
  189. package/dist/plugins/scalpel/hooks/pre-edit-guard.sh +121 -0
  190. package/dist/plugins/scalpel/skills/ci-fix/SKILL.md +293 -0
  191. package/dist/plugins/scalpel/skills/fix/SKILL.md +1058 -0
  192. package/dist/plugins/scalpel/skills/issue/SKILL.md +134 -0
  193. package/dist/plugins/sentinel/.claude-plugin/plugin.json +6 -0
  194. package/dist/plugins/sentinel/agents/ops.md +149 -0
  195. package/dist/plugins/sentinel/agents/sre.md +165 -0
  196. package/dist/plugins/sentinel/hooks/hooks.json +26 -0
  197. package/dist/plugins/sentinel/hooks/post-deploy-health.sh +83 -0
  198. package/dist/plugins/sentinel/hooks/post-git-state.sh +54 -0
  199. package/dist/plugins/sentinel/skills/incident/SKILL.md +910 -0
  200. package/dist/plugins/sentinel/skills/restart/SKILL.md +70 -0
  201. package/dist/plugins/sentinel/skills/sre/SKILL.md +362 -0
  202. package/dist/plugins/shield/.claude-plugin/plugin.json +6 -0
  203. package/dist/plugins/shield/hooks/hooks.json +60 -0
  204. package/dist/plugins/shield/hooks/pre-bash-guard.sh +142 -0
  205. package/dist/plugins/shield/hooks/pre-edit-guard.sh +121 -0
  206. package/dist/plugins/shield/hooks/session-bootstrap.sh +379 -0
  207. package/dist/plugins/shield/hooks/triage-router.sh +740 -0
  208. package/dist/plugins/spark/.claude-plugin/plugin.json +6 -0
  209. package/dist/plugins/spark/agents/explore-light.md +52 -0
  210. package/dist/plugins/spark/agents/setup.md +134 -0
  211. package/dist/plugins/spark/hooks/hooks.json +16 -0
  212. package/dist/plugins/spark/hooks/session-bootstrap.sh +379 -0
  213. package/dist/plugins/spark/skills/calibrate/SKILL.md +1807 -0
  214. package/dist/plugins/spark/skills/onboard/SKILL.md +344 -0
  215. package/dist/plugins/spark/skills/scan/SKILL.md +232 -0
  216. package/dist/plugins/spark/skills/setup/SKILL.md +691 -0
  217. package/hook-defs.json +104 -0
  218. package/hooks/check-deliverable.sh +65 -0
  219. package/hooks/ensure-client-dir.sh +59 -0
  220. package/hooks/hooks.json +16 -0
  221. package/hooks/post-deploy-health.sh +83 -0
  222. package/hooks/post-diff-test-compare.sh +125 -0
  223. package/hooks/post-edit-lint.sh +92 -0
  224. package/hooks/post-git-state.sh +54 -0
  225. package/hooks/post-merge-cleanup.sh +101 -0
  226. package/hooks/post-test-summary.sh +115 -0
  227. package/hooks/pre-bash-guard.sh +142 -0
  228. package/hooks/pre-edit-guard.sh +121 -0
  229. package/hooks/pre-task-context.sh +113 -0
  230. package/hooks/session-bootstrap.sh +379 -0
  231. package/hooks/session-end.sh +107 -0
  232. package/hooks/session-start.sh +46 -0
  233. package/hooks/session-summary.sh +97 -0
  234. package/hooks/sync-agents.sh +269 -0
  235. package/hooks/triage-router.sh +740 -0
  236. package/install.sh +3185 -0
  237. package/package.json +40 -0
  238. package/portable.manifest +112 -0
  239. package/skills/arth/SKILL.md +165 -0
  240. package/skills/autopilot/SKILL.md +425 -0
  241. package/skills/calibrate/SKILL.md +1807 -0
  242. package/skills/ci-fix/SKILL.md +293 -0
  243. package/skills/client-discovery/SKILL.md +266 -0
  244. package/skills/consulting/SKILL.md +282 -0
  245. package/skills/continue/SKILL.md +174 -0
  246. package/skills/custom-domain/SKILL.md +261 -0
  247. package/skills/deliverable-builder/SKILL.md +928 -0
  248. package/skills/discord-ops/SKILL.md +125 -0
  249. package/skills/engagement-tracker/SKILL.md +380 -0
  250. package/skills/explore.md +43 -0
  251. package/skills/fix/SKILL.md +1058 -0
  252. package/skills/implement/SKILL.md +532 -0
  253. package/skills/incident/SKILL.md +910 -0
  254. package/skills/issue/SKILL.md +134 -0
  255. package/skills/market-research/SKILL.md +300 -0
  256. package/skills/onboard/SKILL.md +344 -0
  257. package/skills/opportunity-map/SKILL.md +307 -0
  258. package/skills/pitch-generator/SKILL.md +378 -0
  259. package/skills/planning/SKILL.md +436 -0
  260. package/skills/pr/SKILL.md +275 -0
  261. package/skills/precheck/SKILL.md +159 -0
  262. package/skills/qa/SKILL.md +127 -0
  263. package/skills/qa-incident/SKILL.md +54 -0
  264. package/skills/qa-learn/SKILL.md +47 -0
  265. package/skills/railway/central-station/SKILL.md +226 -0
  266. package/skills/railway/central-station/references/environment-config.md +183 -0
  267. package/skills/railway/central-station/references/monorepo.md +216 -0
  268. package/skills/railway/central-station/references/railpack.md +257 -0
  269. package/skills/railway/central-station/references/variables.md +170 -0
  270. package/skills/railway/database/SKILL.md +284 -0
  271. package/skills/railway/database/references/environment-config.md +183 -0
  272. package/skills/railway/database/references/monorepo.md +216 -0
  273. package/skills/railway/database/references/railpack.md +257 -0
  274. package/skills/railway/database/references/variables.md +170 -0
  275. package/skills/railway/database/scripts/railway-api.sh +41 -0
  276. package/skills/railway/deploy/SKILL.md +128 -0
  277. package/skills/railway/deploy/references/environment-config.md +183 -0
  278. package/skills/railway/deploy/references/monorepo.md +216 -0
  279. package/skills/railway/deploy/references/railpack.md +257 -0
  280. package/skills/railway/deploy/references/variables.md +170 -0
  281. package/skills/railway/deployment/SKILL.md +222 -0
  282. package/skills/railway/deployment/references/environment-config.md +183 -0
  283. package/skills/railway/deployment/references/monorepo.md +216 -0
  284. package/skills/railway/deployment/references/railpack.md +257 -0
  285. package/skills/railway/deployment/references/variables.md +170 -0
  286. package/skills/railway/domain/SKILL.md +137 -0
  287. package/skills/railway/domain/references/environment-config.md +183 -0
  288. package/skills/railway/domain/references/monorepo.md +216 -0
  289. package/skills/railway/domain/references/railpack.md +257 -0
  290. package/skills/railway/domain/references/variables.md +170 -0
  291. package/skills/railway/environment/SKILL.md +266 -0
  292. package/skills/railway/environment/references/environment-config.md +183 -0
  293. package/skills/railway/environment/references/monorepo.md +216 -0
  294. package/skills/railway/environment/references/railpack.md +257 -0
  295. package/skills/railway/environment/references/variables.md +170 -0
  296. package/skills/railway/metrics/SKILL.md +211 -0
  297. package/skills/railway/metrics/references/environment-config.md +183 -0
  298. package/skills/railway/metrics/references/monorepo.md +216 -0
  299. package/skills/railway/metrics/references/railpack.md +257 -0
  300. package/skills/railway/metrics/references/variables.md +170 -0
  301. package/skills/railway/metrics/scripts/railway-api.sh +41 -0
  302. package/skills/railway/new/SKILL.md +489 -0
  303. package/skills/railway/new/references/environment-config.md +183 -0
  304. package/skills/railway/new/references/monorepo.md +216 -0
  305. package/skills/railway/new/references/railpack.md +257 -0
  306. package/skills/railway/new/references/variables.md +170 -0
  307. package/skills/railway/projects/SKILL.md +142 -0
  308. package/skills/railway/projects/references/environment-config.md +183 -0
  309. package/skills/railway/projects/references/monorepo.md +216 -0
  310. package/skills/railway/projects/references/railpack.md +257 -0
  311. package/skills/railway/projects/references/variables.md +170 -0
  312. package/skills/railway/projects/scripts/railway-api.sh +41 -0
  313. package/skills/railway/railway-docs/SKILL.md +47 -0
  314. package/skills/railway/railway-docs/references/environment-config.md +183 -0
  315. package/skills/railway/railway-docs/references/monorepo.md +216 -0
  316. package/skills/railway/railway-docs/references/railpack.md +257 -0
  317. package/skills/railway/railway-docs/references/variables.md +170 -0
  318. package/skills/railway/service/SKILL.md +249 -0
  319. package/skills/railway/service/references/environment-config.md +183 -0
  320. package/skills/railway/service/references/monorepo.md +216 -0
  321. package/skills/railway/service/references/railpack.md +257 -0
  322. package/skills/railway/service/references/variables.md +170 -0
  323. package/skills/railway/service/scripts/railway-api.sh +41 -0
  324. package/skills/railway/status/SKILL.md +91 -0
  325. package/skills/railway/status/references/environment-config.md +183 -0
  326. package/skills/railway/status/references/monorepo.md +216 -0
  327. package/skills/railway/status/references/railpack.md +257 -0
  328. package/skills/railway/status/references/variables.md +170 -0
  329. package/skills/railway/templates/SKILL.md +275 -0
  330. package/skills/railway/templates/references/environment-config.md +183 -0
  331. package/skills/railway/templates/references/monorepo.md +216 -0
  332. package/skills/railway/templates/references/railpack.md +257 -0
  333. package/skills/railway/templates/references/variables.md +170 -0
  334. package/skills/railway/templates/scripts/railway-api.sh +41 -0
  335. package/skills/restart/SKILL.md +70 -0
  336. package/skills/review-pr/SKILL.md +367 -0
  337. package/skills/roi-calculator/SKILL.md +469 -0
  338. package/skills/scan/SKILL.md +232 -0
  339. package/skills/setup/SKILL.md +691 -0
  340. package/skills/share/SKILL.md +211 -0
  341. package/skills/solution-architect/SKILL.md +566 -0
  342. package/skills/sre/SKILL.md +362 -0
  343. package/skills/superpowers/brainstorming/SKILL.md +96 -0
  344. package/skills/superpowers/dispatching-parallel-agents/SKILL.md +180 -0
  345. package/skills/superpowers/executing-plans/SKILL.md +84 -0
  346. package/skills/superpowers/finishing-a-development-branch/SKILL.md +200 -0
  347. package/skills/superpowers/receiving-code-review/SKILL.md +213 -0
  348. package/skills/superpowers/requesting-code-review/SKILL.md +105 -0
  349. package/skills/superpowers/requesting-code-review/code-reviewer.md +146 -0
  350. package/skills/superpowers/subagent-driven-development/SKILL.md +242 -0
  351. package/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
  352. package/skills/superpowers/subagent-driven-development/implementer-prompt.md +78 -0
  353. package/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  354. package/skills/superpowers/systematic-debugging/CREATION-LOG.md +119 -0
  355. package/skills/superpowers/systematic-debugging/SKILL.md +296 -0
  356. package/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +158 -0
  357. package/skills/superpowers/systematic-debugging/condition-based-waiting.md +115 -0
  358. package/skills/superpowers/systematic-debugging/defense-in-depth.md +122 -0
  359. package/skills/superpowers/systematic-debugging/find-polluter.sh +63 -0
  360. package/skills/superpowers/systematic-debugging/root-cause-tracing.md +169 -0
  361. package/skills/superpowers/systematic-debugging/test-academic.md +14 -0
  362. package/skills/superpowers/systematic-debugging/test-pressure-1.md +58 -0
  363. package/skills/superpowers/systematic-debugging/test-pressure-2.md +68 -0
  364. package/skills/superpowers/systematic-debugging/test-pressure-3.md +69 -0
  365. package/skills/superpowers/test-driven-development/SKILL.md +371 -0
  366. package/skills/superpowers/test-driven-development/testing-anti-patterns.md +299 -0
  367. package/skills/superpowers/using-git-worktrees/SKILL.md +218 -0
  368. package/skills/superpowers/using-superpowers/SKILL.md +95 -0
  369. package/skills/superpowers/verification-before-completion/SKILL.md +139 -0
  370. package/skills/superpowers/writing-plans/SKILL.md +116 -0
  371. package/skills/superpowers/writing-skills/SKILL.md +655 -0
  372. package/skills/superpowers/writing-skills/anthropic-best-practices.md +1150 -0
  373. package/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  374. package/skills/superpowers/writing-skills/graphviz-conventions.dot +172 -0
  375. package/skills/superpowers/writing-skills/persuasion-principles.md +187 -0
  376. package/skills/superpowers/writing-skills/render-graphs.js +168 -0
  377. package/skills/superpowers/writing-skills/testing-skills-with-subagents.md +384 -0
  378. package/skills/sync/SKILL.md +188 -0
  379. package/skills/templates/SKILL.md +194 -0
  380. package/skills/welcome/SKILL.md +136 -0
  381. package/skills/wizard/SKILL.md +411 -0
  382. package/templates/CLAUDE.md.managed-block +123 -0
  383. package/templates/CLAUDE.md.template +111 -0
  384. package/templates/consulting/engagement-tracker-template.md +181 -0
  385. package/templates/consulting/executive-summary-template.md +83 -0
  386. package/templates/consulting/maturity-assessment-template.md +182 -0
  387. package/templates/consulting/proposal-template.md +209 -0
  388. package/templates/consulting/roi-model-template.md +139 -0
  389. package/templates/consulting/solution-architecture-template.md +313 -0
  390. package/templates/settings.json +130 -0
@@ -0,0 +1,101 @@
1
+ #!/bin/bash
2
+ # PostToolUse hook (Bash): Clean up fix/plan artifacts after PR merge.
3
+ # Detects gh pr merge, git merge, or git pull (with merge) and removes
4
+ # stale artifacts that could interfere with future work.
5
+ #
6
+ # Artifacts cleaned:
7
+ # .claude/.fix-scope-lock.json — scope lock from /fix
8
+ # .claude/.fix-behavior-contract.md — behavior contract from /fix
9
+ # .claude/.fix-baseline-*.txt — test baseline snapshots from /fix
10
+ # .claude/.toolkit-last-seen-sha — updated (not deleted) to current
11
+ #
12
+ # stdout is injected as context.
13
+
14
+ set -euo pipefail
15
+
16
+ COMMAND="${CLAUDE_TOOL_INPUT_COMMAND:-}"
17
+ if [ -z "$COMMAND" ] && [ -n "${CLAUDE_TOOL_INPUT:-}" ]; then
18
+ COMMAND=$(echo "$CLAUDE_TOOL_INPUT" | python3 -c "import json,sys; print(json.load(sys.stdin).get('command',''))" 2>/dev/null) || true
19
+ fi
20
+
21
+ [ -z "$COMMAND" ] && exit 0
22
+
23
+ PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
24
+
25
+ # ---------------------------------------------------------------------------
26
+ # Detect merge-related commands
27
+ # ---------------------------------------------------------------------------
28
+
29
+ IS_MERGE=false
30
+
31
+ # gh pr merge
32
+ if echo "$COMMAND" | grep -qE 'gh\s+pr\s+merge'; then
33
+ IS_MERGE=true
34
+ fi
35
+
36
+ # git merge (not --abort)
37
+ if echo "$COMMAND" | grep -qE 'git\s+merge\b' && ! echo "$COMMAND" | grep -q '\-\-abort'; then
38
+ IS_MERGE=true
39
+ fi
40
+
41
+ # git pull (often results in a merge)
42
+ if echo "$COMMAND" | grep -qE 'git\s+pull\b'; then
43
+ IS_MERGE=true
44
+ fi
45
+
46
+ $IS_MERGE || exit 0
47
+
48
+ # ---------------------------------------------------------------------------
49
+ # Check tool output for success (don't clean up if merge failed)
50
+ # ---------------------------------------------------------------------------
51
+
52
+ OUTPUT="${CLAUDE_TOOL_OUTPUT:-}"
53
+ if [ -n "$OUTPUT" ]; then
54
+ # If output contains error indicators, skip cleanup
55
+ if echo "$OUTPUT" | grep -qiE 'error|failed|conflict|abort|rejected|denied'; then
56
+ exit 0
57
+ fi
58
+ fi
59
+
60
+ # ---------------------------------------------------------------------------
61
+ # Clean up fix artifacts
62
+ # ---------------------------------------------------------------------------
63
+
64
+ cleaned=()
65
+
66
+ # Scope lock
67
+ if [ -f "$PROJECT_DIR/.claude/.fix-scope-lock.json" ]; then
68
+ rm -f "$PROJECT_DIR/.claude/.fix-scope-lock.json"
69
+ cleaned+=("scope lock")
70
+ fi
71
+
72
+ # Behavior contract
73
+ if [ -f "$PROJECT_DIR/.claude/.fix-behavior-contract.md" ]; then
74
+ rm -f "$PROJECT_DIR/.claude/.fix-behavior-contract.md"
75
+ cleaned+=("behavior contract")
76
+ fi
77
+
78
+ # Baseline test snapshots
79
+ for baseline in "$PROJECT_DIR/.claude/.fix-baseline-"*.txt; do
80
+ if [ -f "$baseline" ]; then
81
+ rm -f "$baseline"
82
+ cleaned+=("test baseline")
83
+ break # Only report once even if multiple files
84
+ fi
85
+ done
86
+
87
+ # Baseline summary
88
+ if [ -f "$PROJECT_DIR/.claude/.fix-baseline-summary.txt" ]; then
89
+ rm -f "$PROJECT_DIR/.claude/.fix-baseline-summary.txt"
90
+ # Don't add to cleaned — already covered by "test baseline"
91
+ fi
92
+
93
+ # ---------------------------------------------------------------------------
94
+ # Report what was cleaned
95
+ # ---------------------------------------------------------------------------
96
+
97
+ if [ ${#cleaned[@]} -gt 0 ]; then
98
+ echo "Post-merge cleanup: removed $(IFS=', '; echo "${cleaned[*]}") from previous /fix run"
99
+ fi
100
+
101
+ exit 0
@@ -0,0 +1,115 @@
1
+ #!/bin/bash
2
+ # PostToolUse hook (Bash): Summarize test results after test runs.
3
+ # Detects pytest, jest, vitest, playwright output and injects a compact summary.
4
+ #
5
+ # stdout is injected as context.
6
+
7
+ set -euo pipefail
8
+
9
+ # Extract the command that was run
10
+ COMMAND="${CLAUDE_TOOL_INPUT_COMMAND:-}"
11
+ if [ -z "$COMMAND" ] && [ -n "${CLAUDE_TOOL_INPUT:-}" ]; then
12
+ COMMAND=$(echo "$CLAUDE_TOOL_INPUT" | python3 -c "import json,sys; print(json.load(sys.stdin).get('command',''))" 2>/dev/null) || true
13
+ fi
14
+
15
+ # Get the tool output
16
+ OUTPUT="${CLAUDE_TOOL_OUTPUT:-}"
17
+
18
+ [ -z "$COMMAND" ] && exit 0
19
+ [ -z "$OUTPUT" ] && exit 0
20
+
21
+ # ---------------------------------------------------------------------------
22
+ # Detect test runner and parse results
23
+ # ---------------------------------------------------------------------------
24
+
25
+ # pytest
26
+ if echo "$COMMAND" | grep -qE '\bpytest\b|python\s+-m\s+pytest'; then
27
+ # Look for the summary line: "X passed, Y failed, Z errors in Ns"
28
+ summary_line=$(echo "$OUTPUT" | grep -oE '[0-9]+ passed|[0-9]+ failed|[0-9]+ error' | head -5) || true
29
+
30
+ if [ -n "$summary_line" ]; then
31
+ passed=$(echo "$summary_line" | grep -oE '[0-9]+ passed' | grep -oE '[0-9]+') || echo "0"
32
+ failed=$(echo "$summary_line" | grep -oE '[0-9]+ failed' | grep -oE '[0-9]+') || echo "0"
33
+ errors=$(echo "$summary_line" | grep -oE '[0-9]+ error' | grep -oE '[0-9]+') || echo "0"
34
+
35
+ echo "TEST SUMMARY (pytest): ${passed:-0} passed, ${failed:-0} failed, ${errors:-0} errors"
36
+
37
+ # Extract failure names (FAILED lines)
38
+ if [ "${failed:-0}" -gt 0 ] || [ "${errors:-0}" -gt 0 ]; then
39
+ echo " Failures:"
40
+ echo "$OUTPUT" | grep -E '^FAILED |^ERROR ' | head -5 | while read -r line; do
41
+ echo " ${line}"
42
+ done
43
+ fi
44
+ fi
45
+ exit 0
46
+ fi
47
+
48
+ # jest / vitest
49
+ if echo "$COMMAND" | grep -qE '\bnpm\s+test\b|\bnpx\s+(jest|vitest)\b|\bvitest\b'; then
50
+ # Jest summary: "Test Suites: X passed, Y failed" / "Tests: X passed, Y failed"
51
+ suite_line=$(echo "$OUTPUT" | grep -oE 'Test Suites:.*' | head -1) || true
52
+ test_line=$(echo "$OUTPUT" | grep -oE 'Tests:.*' | head -1) || true
53
+
54
+ if [ -n "$suite_line" ] || [ -n "$test_line" ]; then
55
+ echo "TEST SUMMARY (jest/vitest):"
56
+ [ -n "$suite_line" ] && echo " ${suite_line}"
57
+ [ -n "$test_line" ] && echo " ${test_line}"
58
+
59
+ # Extract failed test names
60
+ echo "$OUTPUT" | grep -E '✕|✗|FAIL ' | head -5 | while read -r line; do
61
+ echo " ${line}"
62
+ done
63
+ fi
64
+ exit 0
65
+ fi
66
+
67
+ # playwright
68
+ if echo "$COMMAND" | grep -qE '\bplaywright\s+test\b'; then
69
+ # Playwright summary: "X passed" / "X failed"
70
+ summary=$(echo "$OUTPUT" | grep -oE '[0-9]+ passed|[0-9]+ failed|[0-9]+ skipped' | head -5) || true
71
+
72
+ if [ -n "$summary" ]; then
73
+ passed=$(echo "$summary" | grep -oE '[0-9]+ passed' | grep -oE '[0-9]+') || echo "0"
74
+ failed=$(echo "$summary" | grep -oE '[0-9]+ failed' | grep -oE '[0-9]+') || echo "0"
75
+
76
+ echo "TEST SUMMARY (playwright): ${passed:-0} passed, ${failed:-0} failed"
77
+
78
+ if [ "${failed:-0}" -gt 0 ]; then
79
+ echo " Failed tests:"
80
+ echo "$OUTPUT" | grep -E '✘|FAILED|failed' | head -5 | while read -r line; do
81
+ echo " ${line}"
82
+ done
83
+ fi
84
+ fi
85
+ exit 0
86
+ fi
87
+
88
+ # Lint checks (ruff, eslint)
89
+ if echo "$COMMAND" | grep -qE '\bruff\s+check\b'; then
90
+ error_count=$(echo "$OUTPUT" | grep -cE '^\S+:\d+:\d+:' 2>/dev/null) || echo "0"
91
+ if [ "${error_count:-0}" -gt 0 ]; then
92
+ echo "LINT SUMMARY (ruff): ${error_count} issues found"
93
+ # Show first 3 errors
94
+ echo "$OUTPUT" | grep -E '^\S+:\d+:\d+:' | head -3 | while read -r line; do
95
+ echo " ${line}"
96
+ done
97
+ [ "$error_count" -gt 3 ] && echo " ... and $((error_count - 3)) more"
98
+ fi
99
+ exit 0
100
+ fi
101
+
102
+ # TypeScript type check
103
+ if echo "$COMMAND" | grep -qE '\btsc\s+--noEmit\b'; then
104
+ error_count=$(echo "$OUTPUT" | grep -cE '^.+\(\d+,\d+\): error' 2>/dev/null) || echo "0"
105
+ if [ "${error_count:-0}" -gt 0 ]; then
106
+ echo "TYPE CHECK SUMMARY (tsc): ${error_count} type errors"
107
+ echo "$OUTPUT" | grep -E '^.+\(\d+,\d+\): error' | head -3 | while read -r line; do
108
+ echo " ${line}"
109
+ done
110
+ [ "$error_count" -gt 3 ] && echo " ... and $((error_count - 3)) more"
111
+ fi
112
+ exit 0
113
+ fi
114
+
115
+ exit 0
@@ -0,0 +1,142 @@
1
+ #!/bin/bash
2
+ # PreToolUse hook (Bash): Guard rails for dangerous commands.
3
+ # Blocks known-destructive operations, warns on risky ones.
4
+ #
5
+ # Exit 0 = allow the command
6
+ # Exit 2 = block the command (stdout shown as reason)
7
+ # stdout = injected as context (warnings)
8
+ #
9
+ # Reads CLAUDE.md "Critical Rules" section for project-specific guards.
10
+
11
+ set -euo pipefail
12
+
13
+ # The tool input is JSON — extract the command field
14
+ COMMAND="${CLAUDE_TOOL_INPUT_COMMAND:-}"
15
+
16
+ # If no command available, try parsing from CLAUDE_TOOL_INPUT JSON
17
+ if [ -z "$COMMAND" ] && [ -n "${CLAUDE_TOOL_INPUT:-}" ]; then
18
+ COMMAND=$(echo "$CLAUDE_TOOL_INPUT" | python3 -c "import json,sys; print(json.load(sys.stdin).get('command',''))" 2>/dev/null) || true
19
+ fi
20
+
21
+ # Nothing to check
22
+ [ -z "$COMMAND" ] && exit 0
23
+
24
+ # ---------------------------------------------------------------------------
25
+ # Hard blocks (exit 2 = block the tool call)
26
+ # ---------------------------------------------------------------------------
27
+
28
+ # Block: railway up (uploads untracked files — known to cause crashes)
29
+ if echo "$COMMAND" | grep -qE '\brailway\s+up\b'; then
30
+ echo "⛔ BLOCKED: 'railway up' uploads untracked files and can crash services."
31
+ echo "Use 'git push' to deploy via Railway's auto-deploy instead."
32
+ exit 2
33
+ fi
34
+
35
+ # Block: git push directly to main/master (should use PR)
36
+ if echo "$COMMAND" | grep -qE 'git\s+push\s+.*\b(main|master)\b' && ! echo "$COMMAND" | grep -q '\-\-dry-run'; then
37
+ # Allow if pushing a branch that happens to contain "main" in the name
38
+ if echo "$COMMAND" | grep -qE 'git\s+push\s+(origin\s+)?(main|master)\s*$'; then
39
+ echo "⛔ BLOCKED: Never push directly to main. Create a PR instead."
40
+ echo "Use the /pr skill to create a pull request."
41
+ exit 2
42
+ fi
43
+ fi
44
+
45
+ # Block: git push --force to main/master
46
+ if echo "$COMMAND" | grep -qE 'git\s+push\s+--force' || echo "$COMMAND" | grep -qE 'git\s+push\s+-f\b'; then
47
+ if echo "$COMMAND" | grep -qE '\b(main|master)\b'; then
48
+ echo "⛔ BLOCKED: Force push to main is extremely dangerous."
49
+ exit 2
50
+ fi
51
+ fi
52
+
53
+ # Warn: pip uninstall (can break environments — but sometimes needed)
54
+ if echo "$COMMAND" | grep -qE '\bpip\s+uninstall\b'; then
55
+ echo "⚠️ pip uninstall can break the environment. Verify this is intentional."
56
+ echo "If resolving a dependency conflict, consider using a fresh virtualenv instead."
57
+ fi
58
+
59
+ # Block: rm -rf on common important directories
60
+ if echo "$COMMAND" | grep -qE 'rm\s+-rf\s+(/|~|\$HOME|\.git|node_modules/\.\.|backend|frontend|src|app)\b'; then
61
+ echo "⛔ BLOCKED: Destructive rm -rf on critical directory."
62
+ echo "This could delete important project files. Be more specific about what to remove."
63
+ exit 2
64
+ fi
65
+
66
+ # Block: git reset --hard (with nuance)
67
+ # Allow: git reset --hard HEAD (reset working tree to current commit — safe)
68
+ # Block: git reset --hard HEAD~N, origin/main, specific SHAs (loses commits)
69
+ if echo "$COMMAND" | grep -qE 'git\s+reset\s+--hard'; then
70
+ # Allow bare "git reset --hard" or "git reset --hard HEAD" (both = reset to current)
71
+ if echo "$COMMAND" | grep -qE 'git\s+reset\s+--hard\s*$' || echo "$COMMAND" | grep -qE 'git\s+reset\s+--hard\s+HEAD\s*$'; then
72
+ echo "⚠️ git reset --hard HEAD — this discards all uncommitted changes."
73
+ else
74
+ echo "⛔ BLOCKED: git reset --hard to a different commit discards work."
75
+ echo "If this is intentional, the user should run this command manually."
76
+ exit 2
77
+ fi
78
+ fi
79
+
80
+ # Block: git clean -fd on root (too broad)
81
+ if echo "$COMMAND" | grep -qE 'git\s+clean\s+-fd\s*$'; then
82
+ echo "⛔ BLOCKED: git clean -fd removes all untracked files."
83
+ echo "This could delete user's work-in-progress files. Be more specific."
84
+ exit 2
85
+ fi
86
+
87
+ # ---------------------------------------------------------------------------
88
+ # Soft warnings (exit 0, but inject context)
89
+ # ---------------------------------------------------------------------------
90
+
91
+ # Warn: ruff --fix on broad scope
92
+ if echo "$COMMAND" | grep -qE 'ruff\s+(check\s+)?--fix\s+\.' || echo "$COMMAND" | grep -qE 'ruff\s+format\s+\.'; then
93
+ echo "⚠️ Broad ruff --fix/format scope. Consider targeting specific files only."
94
+ echo "Broad auto-fixes can introduce unrelated changes."
95
+ fi
96
+
97
+ # Warn: commands that look like they target production
98
+ if echo "$COMMAND" | grep -qiE '(prod|production)' && ! echo "$COMMAND" | grep -qiE '(staging|test|dev|local)'; then
99
+ echo "⚠️ This command appears to target production. Verify this is intentional."
100
+ echo "DO NOT proceed without explicit user confirmation."
101
+ fi
102
+
103
+ # Warn: database operations on what looks like prod URLs
104
+ if echo "$COMMAND" | grep -qE 'psql.*railway\.net|pg_dump.*railway\.net|DATABASE_URL.*railway\.net'; then
105
+ echo "⚠️ Database command targeting Railway (possibly production). Double-check the target."
106
+ echo "DO NOT modify production data without explicit user confirmation."
107
+ fi
108
+
109
+ # Warn: CI/CD pipeline modifications
110
+ if echo "$COMMAND" | grep -qiE '(mv|cp|rm|edit|cat\s*>).*\.(github|gitlab|circleci|buildkite)' || \
111
+ echo "$COMMAND" | grep -qiE '(mv|cp|rm|edit|cat\s*>).*(Jenkinsfile|azure-pipelines|bitbucket-pipelines)'; then
112
+ echo "⚠️ Modifying CI/CD pipeline configuration. This affects the entire team's workflow."
113
+ echo "Verify this change is intentional and won't break existing pipelines."
114
+ fi
115
+
116
+ # Warn: deploy target or infrastructure config changes
117
+ if echo "$COMMAND" | grep -qiE '(mv|cp|rm|cat\s*>).*(railway\.(json|toml)|vercel\.json|fly\.toml|Dockerfile|docker-compose|terraform|k8s|helm)'; then
118
+ echo "⚠️ Modifying deployment/infrastructure configuration."
119
+ echo "Ask before changing deploy targets, service topology, or infrastructure."
120
+ fi
121
+
122
+ # Warn: npm/pip install of new packages (could affect lock files)
123
+ if echo "$COMMAND" | grep -qE '\b(npm|pip)\s+install\s+[a-zA-Z]' && ! echo "$COMMAND" | grep -qE '\-r\s+requirements'; then
124
+ echo "ℹ️ Installing new package — this will modify lock files."
125
+ fi
126
+
127
+ # ---------------------------------------------------------------------------
128
+ # Cascade detection: if .fix-attempt-count exists and is >= 3, warn
129
+ # ---------------------------------------------------------------------------
130
+ PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
131
+ ATTEMPT_FILE="$PROJECT_DIR/.claude/.fix-attempt-count"
132
+ if [ -f "$ATTEMPT_FILE" ]; then
133
+ ATTEMPTS=$(cat "$ATTEMPT_FILE" 2>/dev/null || echo "0")
134
+ if [ "${ATTEMPTS:-0}" -ge 3 ]; then
135
+ echo "🛑 CASCADE WARNING: ${ATTEMPTS} consecutive fix attempts detected."
136
+ echo "STOP chaining fixes. Step back and reassess the root cause from scratch."
137
+ echo "Read the original error, trace the code path, understand WHY before trying again."
138
+ echo "If this is intentional, delete .claude/.fix-attempt-count to reset."
139
+ fi
140
+ fi
141
+
142
+ exit 0
@@ -0,0 +1,121 @@
1
+ #!/bin/bash
2
+ # PreToolUse hook (Edit, Write): Warn on edits to protected files.
3
+ # Does NOT block — only injects warnings so Claude thinks twice.
4
+ #
5
+ # stdout is injected as context. Exit 0 always (warnings only).
6
+
7
+ set -euo pipefail
8
+
9
+ PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
10
+
11
+ # Extract file path from tool input
12
+ FILE_PATH="${CLAUDE_TOOL_INPUT_FILE_PATH:-}"
13
+ if [ -z "$FILE_PATH" ] && [ -n "${CLAUDE_TOOL_INPUT:-}" ]; then
14
+ FILE_PATH=$(echo "$CLAUDE_TOOL_INPUT" | python3 -c "import json,sys; print(json.load(sys.stdin).get('file_path',''))" 2>/dev/null) || true
15
+ fi
16
+
17
+ [ -z "$FILE_PATH" ] && exit 0
18
+
19
+ # Get just the filename and relative path
20
+ filename=$(basename "$FILE_PATH")
21
+ rel_path="${FILE_PATH#$PROJECT_DIR/}"
22
+
23
+ # ---------------------------------------------------------------------------
24
+ # Bug fix scope lock enforcement
25
+ # ---------------------------------------------------------------------------
26
+ # If /fix created a scope lock, enforce Fix Zone / Frozen Zone boundaries.
27
+ # Files in the Fix Zone are allowed. Watch Zone files get a warning.
28
+ # Frozen Zone files get a strong warning (not a hard block — hook can only warn).
29
+
30
+ SCOPE_LOCK="$PROJECT_DIR/.claude/.fix-scope-lock.json"
31
+ if [ -f "$SCOPE_LOCK" ]; then
32
+ # Check if the file being edited is in the fix zone
33
+ IN_FIX_ZONE=false
34
+ IN_WATCH_ZONE=false
35
+
36
+ FIX_ZONE=$(python3 -c "import json; print('\n'.join(json.load(open('$SCOPE_LOCK')).get('fix_zone',[])))" 2>/dev/null) || true
37
+ WATCH_ZONE=$(python3 -c "import json; print('\n'.join(json.load(open('$SCOPE_LOCK')).get('watch_zone',[])))" 2>/dev/null) || true
38
+ FROZEN_PATTERNS=$(python3 -c "import json; print('\n'.join(json.load(open('$SCOPE_LOCK')).get('frozen_zone_patterns',[])))" 2>/dev/null) || true
39
+
40
+ # Check fix zone
41
+ if [ -n "$FIX_ZONE" ]; then
42
+ echo "$FIX_ZONE" | while read zone_file; do
43
+ if [ "$rel_path" = "$zone_file" ] || echo "$rel_path" | grep -q "^$zone_file"; then
44
+ IN_FIX_ZONE=true
45
+ fi
46
+ done
47
+ fi
48
+
49
+ # Check watch zone
50
+ if ! $IN_FIX_ZONE && [ -n "$WATCH_ZONE" ]; then
51
+ echo "$WATCH_ZONE" | while read zone_file; do
52
+ if [ "$rel_path" = "$zone_file" ] || echo "$rel_path" | grep -q "^$zone_file"; then
53
+ IN_WATCH_ZONE=true
54
+ fi
55
+ done
56
+ fi
57
+
58
+ if $IN_FIX_ZONE; then
59
+ : # Allowed — in Fix Zone
60
+ elif $IN_WATCH_ZONE; then
61
+ echo "⚠️ SCOPE WARNING: ${rel_path} is in the WATCH ZONE for the current bug fix."
62
+ echo "This file is related to the fix but was not expected to need changes."
63
+ echo "Explain WHY this file needs modification before proceeding."
64
+ elif ! $IN_FIX_ZONE && ! $IN_WATCH_ZONE; then
65
+ BUG_DESC=$(python3 -c "import json; print(json.load(open('$SCOPE_LOCK')).get('bug','unknown'))" 2>/dev/null) || true
66
+ echo "🛑 SCOPE VIOLATION: ${rel_path} is in the FROZEN ZONE."
67
+ echo "Bug fix scope: ${BUG_DESC}"
68
+ echo "This file is NOT part of the fix and should NOT be modified."
69
+ echo "If you must modify it, remove .claude/.fix-scope-lock.json first and explain why the scope expanded."
70
+ echo "DO NOT edit this file unless the user explicitly approves the scope change."
71
+ fi
72
+ fi
73
+
74
+ # ---------------------------------------------------------------------------
75
+ # Protected file patterns
76
+ # ---------------------------------------------------------------------------
77
+
78
+ # Dependency lock files (modifications should be intentional)
79
+ case "$filename" in
80
+ requirements.txt)
81
+ echo "⚠️ Protected file: ${rel_path}"
82
+ echo "This file defines core dependencies. Removing packages can break the project."
83
+ echo "Only modify if explicitly asked by the user."
84
+ ;;
85
+ package-lock.json|yarn.lock|pnpm-lock.yaml)
86
+ echo "⚠️ Lock file: ${rel_path}"
87
+ echo "Lock files should be modified via npm/yarn/pnpm install, not directly."
88
+ ;;
89
+ Cargo.lock)
90
+ echo "⚠️ Lock file: ${rel_path}"
91
+ echo "Cargo.lock should be modified via cargo commands, not directly."
92
+ ;;
93
+ esac
94
+
95
+ # Environment files (may contain secrets)
96
+ case "$filename" in
97
+ .env|.env.local|.env.production|.env.staging)
98
+ echo "⚠️ Environment file: ${rel_path}"
99
+ echo "May contain secrets. Never commit to git. Verify changes are intentional."
100
+ ;;
101
+ esac
102
+
103
+ # Migration files (should not be auto-edited)
104
+ if echo "$rel_path" | grep -qE 'migrations/versions/|alembic/versions/|prisma/migrations/'; then
105
+ echo "⚠️ Migration file: ${rel_path}"
106
+ echo "Existing migrations should not be modified. Create a new migration instead."
107
+ fi
108
+
109
+ # CI/CD config files — match against rel_path for path-based patterns, filename for simple names
110
+ if echo "$rel_path" | grep -qE '\.github/workflows/|\.gitlab-ci\.yml|Jenkinsfile'; then
111
+ echo "ℹ️ Infrastructure file: ${rel_path}"
112
+ echo "Changes may affect CI/CD pipelines or deployments."
113
+ fi
114
+ case "$filename" in
115
+ Dockerfile|docker-compose.yml|docker-compose.yaml)
116
+ echo "ℹ️ Infrastructure file: ${rel_path}"
117
+ echo "Changes may affect container builds or service topology."
118
+ ;;
119
+ esac
120
+
121
+ exit 0
@@ -0,0 +1,113 @@
1
+ #!/bin/bash
2
+ # PreToolUse hook (Task): Inject project context when spawning agents.
3
+ # Gives every agent a warm start with project state awareness.
4
+ #
5
+ # v2: Reads from session-bootstrap's project state cache when available.
6
+ # Falls back to direct computation if cache is missing or stale (>5 min).
7
+ #
8
+ # stdout is injected as context into the conversation (visible to the spawned agent).
9
+
10
+ set -euo pipefail
11
+
12
+ PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
13
+
14
+ # Only act if we have a CLAUDE.md (otherwise nothing to inject)
15
+ [ ! -f "$PROJECT_DIR/CLAUDE.md" ] && exit 0
16
+
17
+ # Don't inject for explore-light or haiku agents (keep them fast/cheap)
18
+ SUBAGENT_TYPE="${CLAUDE_TOOL_INPUT_SUBAGENT_TYPE:-}"
19
+ if [ -z "$SUBAGENT_TYPE" ] && [ -n "${CLAUDE_TOOL_INPUT:-}" ]; then
20
+ SUBAGENT_TYPE=$(echo "$CLAUDE_TOOL_INPUT" | python3 -c "import json,sys; print(json.load(sys.stdin).get('subagent_type',''))" 2>/dev/null) || true
21
+ fi
22
+
23
+ case "$SUBAGENT_TYPE" in
24
+ explore-light|Explore|explore|claude-code-guide)
25
+ # These are lightweight/research agents — don't add overhead
26
+ exit 0
27
+ ;;
28
+ esac
29
+
30
+ # ---------------------------------------------------------------------------
31
+ # Try reading from project state cache (written by session-bootstrap.sh)
32
+ # ---------------------------------------------------------------------------
33
+
34
+ CACHE_FILE="$PROJECT_DIR/.claude/.project-state-cache.json"
35
+ use_cache=false
36
+
37
+ if [ -f "$CACHE_FILE" ]; then
38
+ # Check cache freshness (5 min = 300 seconds)
39
+ if [ "$(uname)" = "Darwin" ]; then
40
+ cache_age=$(( $(date +%s) - $(stat -f%m "$CACHE_FILE") ))
41
+ else
42
+ cache_age=$(( $(date +%s) - $(stat -c%Y "$CACHE_FILE") ))
43
+ fi
44
+ if [ "$cache_age" -lt 300 ]; then
45
+ use_cache=true
46
+ fi
47
+ fi
48
+
49
+ echo "AGENT CONTEXT (auto-injected by toolkit):"
50
+
51
+ if $use_cache; then
52
+ # Fast path: read from cache
53
+ branch=$(python3 -c "import json; d=json.load(open('$CACHE_FILE')); print(d.get('branch',''))" 2>/dev/null) || true
54
+ uncommitted=$(python3 -c "import json; d=json.load(open('$CACHE_FILE')); print(d.get('uncommitted',0))" 2>/dev/null) || true
55
+ docker_status=$(python3 -c "import json; d=json.load(open('$CACHE_FILE')); print(d.get('docker_status',''))" 2>/dev/null) || true
56
+ alembic_status=$(python3 -c "import json; d=json.load(open('$CACHE_FILE')); print(d.get('alembic_status',''))" 2>/dev/null) || true
57
+ active_plan=$(python3 -c "import json; d=json.load(open('$CACHE_FILE')); print(d.get('active_plan',''))" 2>/dev/null) || true
58
+
59
+ [ -n "$branch" ] && echo " Branch: ${branch} (${uncommitted:-0} uncommitted files)"
60
+ [ -n "$docker_status" ] && echo " Docker: ${docker_status}"
61
+ if [ "$alembic_status" = "⚠ pending migrations" ]; then
62
+ echo " ⚠ Alembic: local behind head (run 'alembic upgrade head')"
63
+ elif [ -n "$alembic_status" ] && [ "$alembic_status" != "✓" ]; then
64
+ echo " Alembic: ${alembic_status}"
65
+ fi
66
+ [ -n "$active_plan" ] && echo " Active plan: ${active_plan}"
67
+ else
68
+ # Slow path: compute directly (backward compatible)
69
+
70
+ # Git state
71
+ if [ -d "$PROJECT_DIR/.git" ]; then
72
+ branch=$(git -C "$PROJECT_DIR" rev-parse --abbrev-ref HEAD 2>/dev/null) || true
73
+ uncommitted=$(git -C "$PROJECT_DIR" status --short 2>/dev/null | wc -l | tr -d ' ') || true
74
+ [ -n "$branch" ] && echo " Branch: ${branch} (${uncommitted:-0} uncommitted files)"
75
+ fi
76
+
77
+ # Docker container status (if docker-compose exists)
78
+ if [ -f "$PROJECT_DIR/docker-compose.yml" ] && command -v docker &>/dev/null; then
79
+ running=$(docker ps --format '{{.Names}}' 2>/dev/null | tr '\n' ', ' | sed 's/,$//' ) || true
80
+ [ -n "$running" ] && echo " Docker running: ${running}"
81
+ fi
82
+
83
+ # Alembic status (if migration dir exists)
84
+ for alembic_dir in "$PROJECT_DIR/backend" "$PROJECT_DIR"; do
85
+ if [ -f "$alembic_dir/alembic.ini" ]; then
86
+ for v in "$alembic_dir/.venv/bin/activate" "$PROJECT_DIR/.venv/bin/activate" "$PROJECT_DIR/venv/bin/activate"; do
87
+ if [ -f "$v" ]; then
88
+ current=$(cd "$alembic_dir" && source "$v" && timeout 3 alembic current 2>/dev/null | head -1 | awk '{print $1}') || true
89
+ head_rev=$(cd "$alembic_dir" && source "$v" && timeout 3 alembic heads 2>/dev/null | head -1 | awk '{print $1}') || true
90
+ if [ -n "$current" ] && [ -n "$head_rev" ]; then
91
+ if [ "$current" = "$head_rev" ]; then
92
+ echo " Alembic: up to date"
93
+ else
94
+ echo " ⚠ Alembic: local behind head (run 'alembic upgrade head')"
95
+ fi
96
+ fi
97
+ break
98
+ fi
99
+ done
100
+ break
101
+ fi
102
+ done
103
+
104
+ # Active plan
105
+ if [ -d "$PROJECT_DIR/.claude/plans" ]; then
106
+ plan_file=$(ls -t "$PROJECT_DIR/.claude/plans/"*.md 2>/dev/null | head -1) || true
107
+ if [ -n "$plan_file" ]; then
108
+ echo " Active plan: $(basename "$plan_file")"
109
+ fi
110
+ fi
111
+ fi
112
+
113
+ exit 0