@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,1807 @@
1
+ ---
2
+ name: calibrate
3
+ description: "Deep-learn a project and configure the full toolkit — scans code patterns, recommends MCP servers/agents/skills/workflows, installs everything. The single entry point for project adaptation. Usage: /calibrate <full|rescan|recommend|status>"
4
+ user-invocable: true
5
+ arguments: "<full|rescan|recommend|status>"
6
+ ---
7
+
8
+ # /calibrate — Project Learning & Toolkit Adaptation
9
+
10
+ The single entry point that makes the toolkit deeply understand a new project and configures
11
+ everything to fit. Goes far beyond `/scan` — reads actual source code to learn architecture
12
+ patterns, coding conventions, domain language, and testing style. Then recommends and installs
13
+ the exact MCP servers, agents, skills, and workflows the project needs.
14
+
15
+ **This is what makes the toolkit feel alive for a new project.**
16
+
17
+ ## When to Use
18
+
19
+ - **First time**: New user installs the toolkit on their project → run `/calibrate`
20
+ - **Rescan**: Project has evolved significantly → run `/calibrate rescan`
21
+ - **After major changes**: New framework, new service, new team member → `/calibrate rescan`
22
+
23
+ ## Argument Parsing
24
+
25
+ | Input | Action |
26
+ |-------|--------|
27
+ | `/calibrate` | Full calibration if never run; **auto-rescan** if already calibrated |
28
+ | `/calibrate full` | Force full calibration even if already calibrated |
29
+ | `/calibrate rescan` | Explicit rescan — update project-profile.md, show what changed |
30
+ | `/calibrate recommend` | Show recommendations without installing (read-only) |
31
+ | `/calibrate status` | Show current calibration state — what's installed, what's stale |
32
+
33
+ ## Execution Steps
34
+
35
+ ### Phase 0: Prior Calibration Detection (MANDATORY — runs before anything else)
36
+
37
+ Before starting ANY work, check if this project has already been calibrated:
38
+
39
+ ```bash
40
+ # Check for existing calibration
41
+ test -f "$CLAUDE_PROJECT_DIR/.claude/project-profile.md"
42
+ ```
43
+
44
+ **If `project-profile.md` EXISTS and user ran `/calibrate` (no argument):**
45
+
46
+ 1. Read the first 5 lines of `project-profile.md` to get the calibration date
47
+ 2. Tell the user:
48
+ ```
49
+ This project was already calibrated on {date}.
50
+
51
+ Running /calibrate rescan to update — not a full re-calibration.
52
+ To force a full re-calibration, run: /calibrate full
53
+ ```
54
+ 3. **Automatically switch to rescan mode** — jump to the "## `/calibrate rescan`" section below. Do NOT run the full Phase 1-6 pipeline.
55
+
56
+ **If `project-profile.md` DOES NOT exist:**
57
+ - Proceed with full calibration (Phase 1 below)
58
+
59
+ **If user explicitly ran `/calibrate full`:**
60
+ - Proceed with full calibration even if profile exists (user wants a clean re-do)
61
+
62
+ | Input | project-profile.md exists? | Action |
63
+ |-------|---------------------------|--------|
64
+ | `/calibrate` | No | Full calibration (Phase 1-6) |
65
+ | `/calibrate` | Yes | **Auto-switch to rescan** |
66
+ | `/calibrate full` | Either | Force full calibration |
67
+ | `/calibrate rescan` | Either | Rescan (diff + update) |
68
+ | `/calibrate recommend` | Either | Read-only recommendations |
69
+ | `/calibrate status` | Either | Show calibration health |
70
+
71
+ ### Phase 1: Deep Project Scan
72
+
73
+ This goes far deeper than `/scan`. Read **actual source code** to understand HOW the team builds, not just WHAT tools they use.
74
+
75
+ #### Step 1.1: Foundation Scan
76
+
77
+ Run `/scan` first if CLAUDE.md has `<!-- TODO -->` placeholders or doesn't exist. This populates
78
+ the basics (tech stack, services, test commands, infrastructure). Then proceed to deep scan.
79
+
80
+ #### Step 1.2: Architecture Pattern Analysis
81
+
82
+ Read 8-12 key source files to understand the project's architecture:
83
+
84
+ #### Step 1.2a: Platform Detection (FIRST — determines everything else)
85
+
86
+ Before reading source code, detect what KIND of project this is. The toolkit must handle
87
+ ANY platform, not just web apps.
88
+
89
+ **Platform detection signals:**
90
+
91
+ | Signal Files | Platform | Category |
92
+ |-------------|----------|----------|
93
+ | `*.xcodeproj/`, `*.xcworkspace/`, `Package.swift` | **iOS / macOS (Swift)** | Mobile/Desktop native |
94
+ | `*.swift` files + `Info.plist` | **iOS / macOS (Swift)** | Mobile/Desktop native |
95
+ | `Podfile`, `Cartfile` | **iOS (CocoaPods/Carthage)** | Mobile native |
96
+ | `android/`, `build.gradle`, `build.gradle.kts` | **Android (Kotlin/Java)** | Mobile native |
97
+ | `AndroidManifest.xml` | **Android** | Mobile native |
98
+ | `pubspec.yaml` + `lib/` + `*.dart` | **Flutter** | Mobile cross-platform |
99
+ | `react-native.config.js`, `metro.config.js` | **React Native** | Mobile cross-platform |
100
+ | `ios/` + `android/` + `package.json` | **React Native / Expo** | Mobile cross-platform |
101
+ | `app.json` + `expo` in package.json | **Expo (React Native)** | Mobile cross-platform |
102
+ | `*.sln`, `*.csproj` | **.NET / C#** | Desktop/Web/Game |
103
+ | `*.unitypackage`, `Assets/`, `ProjectSettings/` | **Unity (C#)** | Game |
104
+ | `project.godot` | **Godot** | Game |
105
+ | `CMakeLists.txt`, `Makefile` + `*.c`/`*.cpp` | **C/C++** | Systems/Embedded |
106
+ | `platformio.ini` | **Embedded (PlatformIO)** | Embedded |
107
+ | `setup.py`/`pyproject.toml` + no web framework | **Python library/CLI** | Library |
108
+ | `Cargo.toml` + no web framework | **Rust library/CLI** | Library |
109
+ | `package.json` + no web framework | **Node library/CLI** | Library |
110
+ | `*.tf`, `*.tfvars` | **Terraform** | Infrastructure |
111
+ | `helm/`, `Chart.yaml` | **Kubernetes Helm** | Infrastructure |
112
+ | `serverless.yml` | **Serverless** | Cloud functions |
113
+ | `package.json` + `electron` | **Electron** | Desktop cross-platform |
114
+ | `package.json` + `tauri` | **Tauri** | Desktop cross-platform |
115
+ | `*.ipynb` files dominant | **Data Science / ML** | Data/ML |
116
+ | `dvc.yaml`, `mlflow` in requirements | **ML Pipeline** | Data/ML |
117
+
118
+ **Store the detected platform as `PLATFORM_TYPE`** — this drives which discovery patterns to use below.
119
+
120
+ #### Step 1.2b: Platform-Specific Discovery
121
+
122
+ Based on `PLATFORM_TYPE`, use the appropriate discovery sequence:
123
+
124
+ ##### Web Backend/Frontend (existing — FastAPI, Django, Next.js, Go, Rust, etc.)
125
+
126
+ 1. Find entry points:
127
+ - Python: `main.py`, `app/main.py`, `manage.py`, `wsgi.py`, `asgi.py`
128
+ - Node: `src/index.ts`, `src/app.ts`, `server.ts`, `pages/_app.tsx`, `app/layout.tsx`
129
+ - Go: `cmd/*/main.go`, `main.go`
130
+ - Rust: `src/main.rs`, `src/lib.rs`
131
+
132
+ 2. Find route/API definitions:
133
+ - FastAPI: files with `@router.` or `@app.` decorators
134
+ - Django: `urls.py` files, `views.py` files
135
+ - Express/Hono/Fastify: files with `router.get/post/put/delete`
136
+ - Next.js: `app/api/*/route.ts` files
137
+ - Go: files with `http.HandleFunc` or router setup
138
+ - GraphQL: `schema.graphql`, `*.graphql`, resolvers
139
+
140
+ 3. Find model/entity definitions:
141
+ - SQLAlchemy: `models/*.py` or `models.py` — classes inheriting `Base`
142
+ - Django: `*/models.py` — classes inheriting `models.Model`
143
+ - Prisma: `prisma/schema.prisma`
144
+ - Drizzle: `drizzle/schema.ts` or `db/schema.ts`
145
+ - TypeORM: `entities/*.ts`
146
+ - Go: `models/*.go` or struct definitions
147
+ - Rust: files with `#[derive(` macros
148
+
149
+ 4. Find service/business logic layer:
150
+ - `services/*.py`, `services/*.ts`, `internal/service/*.go`
151
+ - `lib/*.ts`, `utils/*.py`, `helpers/`
152
+ - Look for the pattern: do files import from models AND get imported by routes?
153
+
154
+ 5. Find middleware/auth:
155
+ - `middleware/`, `auth/`, `guards/`, `decorators/`
156
+ - Files containing `authenticate`, `authorize`, `protect`, `require_auth`
157
+
158
+ ##### iOS / macOS (Swift/Objective-C)
159
+
160
+ 1. Find entry points:
161
+ - `*App.swift` (SwiftUI app lifecycle) or `AppDelegate.swift` (UIKit lifecycle)
162
+ - `SceneDelegate.swift` (UIKit scene-based)
163
+ - `ContentView.swift` (SwiftUI root view)
164
+ - `main.swift` or `@main` attribute
165
+
166
+ 2. Find UI layer:
167
+ - **SwiftUI**: files with `import SwiftUI`, `struct *View: View`, `@State`, `@Binding`, `@Observable`
168
+ - **UIKit**: files with `import UIKit`, `class *ViewController: UIViewController`, storyboards (`.storyboard`)
169
+ - **Navigation**: `NavigationStack`, `NavigationView`, `UINavigationController`, coordinators
170
+ - **Design system**: shared styles, color assets (`Assets.xcassets`), custom components
171
+
172
+ 3. Find data layer:
173
+ - **Core Data**: `*.xcdatamodeld`, `NSManagedObject` subclasses, `@FetchRequest`
174
+ - **SwiftData**: `@Model` macro, `ModelContainer`, `ModelContext`
175
+ - **Realm**: `import RealmSwift`, `Object` subclasses
176
+ - **Network layer**: `URLSession` wrappers, Alamofire/Moya usage, API client classes
177
+ - **Combine/async**: `Publishers`, `async/await` patterns, `@Published`
178
+
179
+ 4. Find architecture pattern:
180
+ - **MVVM**: `*ViewModel` classes/structs, `@ObservableObject`, `@Published`
181
+ - **MVC**: ViewControllers with direct model access
182
+ - **TCA (Composable Architecture)**: `Reducer`, `Store`, `Effect`, `import ComposableArchitecture`
183
+ - **VIPER**: `*Router`, `*Interactor`, `*Presenter`, `*Entity`
184
+ - **Clean Architecture**: `UseCases/`, `Repositories/`, `Entities/`, `Interfaces/`
185
+
186
+ 5. Find dependency management:
187
+ - `Package.swift` → Swift Package Manager (read dependencies)
188
+ - `Podfile` → CocoaPods (read pods)
189
+ - `Cartfile` → Carthage
190
+ - `.xcodeproj/project.pbxproj` → frameworks, build settings
191
+
192
+ 6. Find testing:
193
+ - `*Tests/` directory → XCTest
194
+ - `*UITests/` directory → XCUITest (UI testing)
195
+ - `@testable import` → which modules are tested
196
+ - Snapshot tests: `swift-snapshot-testing` in Package.swift
197
+
198
+ 7. Find CI/CD:
199
+ - `fastlane/` directory → Fastlane for builds/deployment
200
+ - `.github/workflows/` with `xcodebuild` → GitHub Actions CI
201
+ - `Gymfile`, `Matchfile`, `Appfile` → Fastlane config
202
+ - Xcode Cloud configuration
203
+
204
+ ##### Android (Kotlin/Java)
205
+
206
+ 1. Find entry points:
207
+ - `*Application.kt` or `*Application.java` (Application class)
208
+ - `MainActivity.kt` (main Activity)
209
+ - `AndroidManifest.xml` (manifest — registered activities, permissions, services)
210
+
211
+ 2. Find UI layer:
212
+ - **Jetpack Compose**: `@Composable` functions, `import androidx.compose.*`
213
+ - **XML layouts**: `res/layout/*.xml`, `res/values/*.xml`
214
+ - **Navigation**: `NavController`, `NavHost`, `Navigation.xml`
215
+ - **Fragments**: `*Fragment.kt` files
216
+
217
+ 3. Find architecture pattern:
218
+ - **MVVM**: `*ViewModel` classes extending `ViewModel()`
219
+ - **MVI**: `sealed interface *Intent`, `*State` data classes
220
+ - **Clean Architecture**: `domain/`, `data/`, `presentation/` layers
221
+ - **Repository pattern**: `*Repository` interfaces + `*RepositoryImpl`
222
+
223
+ 4. Find data layer:
224
+ - **Room**: `@Entity`, `@Dao`, `@Database` annotations
225
+ - **Retrofit**: `@GET`, `@POST`, `interface *Api`
226
+ - **Hilt/Dagger**: `@Inject`, `@Module`, `@Provides`
227
+ - **DataStore**: `DataStore<Preferences>`, protobuf schemas
228
+
229
+ 5. Find dependency management:
230
+ - `build.gradle.kts` or `build.gradle` → dependencies block
231
+ - `libs.versions.toml` → version catalog
232
+ - `settings.gradle.kts` → module structure
233
+
234
+ ##### Flutter (Dart)
235
+
236
+ 1. Find entry points: `lib/main.dart`, `lib/app.dart`
237
+ 2. Find UI layer: `Widget` subclasses, `StatefulWidget`, `StatelessWidget`
238
+ 3. Find state management: Riverpod (`@riverpod`), BLoC (`*Bloc`, `*Cubit`), Provider, GetX
239
+ 4. Find data layer: `*Repository`, `*DataSource`, `*Model`, Hive/Isar/Drift
240
+ 5. Find packages: `pubspec.yaml` dependencies
241
+
242
+ ##### React Native / Expo
243
+
244
+ 1. Find entry points: `App.tsx`, `app/_layout.tsx` (Expo Router), `index.js`
245
+ 2. Find navigation: React Navigation (`@react-navigation/*`), Expo Router
246
+ 3. Find state: Redux, Zustand, Jotai, React Query
247
+ 4. Find native modules: `ios/`, `android/` dirs, `*.podspec`, native bridge files
248
+ 5. Find packages: `package.json` dependencies
249
+
250
+ ##### Data Science / ML
251
+
252
+ 1. Find entry points: `*.ipynb` notebooks, `train.py`, `predict.py`, `pipeline.py`
253
+ 2. Find models: `models/`, `*.pkl`, `*.pt`, `*.h5`, model configs
254
+ 3. Find data pipeline: `data/`, `scripts/`, DVC files, feature engineering
255
+ 4. Find experiment tracking: MLflow, Weights & Biases, TensorBoard configs
256
+ 5. Find packages: `requirements.txt`, `environment.yml`, `pyproject.toml`
257
+
258
+ ##### Unknown Platform — Adaptive Learning (see Step 1.2c)
259
+
260
+ If the project doesn't match any known platform, trigger the adaptive learning protocol.
261
+
262
+ #### Step 1.2c: Adaptive Learning for Unknown Platforms
263
+
264
+ When `/calibrate` encounters a project it doesn't have built-in patterns for, it MUST
265
+ learn what it needs rather than giving up or forcing web patterns onto a non-web project.
266
+
267
+ **Adaptive learning protocol:**
268
+
269
+ 1. **Read the codebase structure** — Glob for all file extensions, directory patterns,
270
+ config files. Build a map of what's there without assuming what it means.
271
+ ```bash
272
+ # What languages are in this project?
273
+ find . -name "*.swift" -o -name "*.kt" -o -name "*.dart" -o -name "*.cs" \
274
+ -o -name "*.cpp" -o -name "*.rs" -o -name "*.go" -o -name "*.py" \
275
+ -o -name "*.ts" -o -name "*.js" -o -name "*.java" -o -name "*.rb" \
276
+ | sed 's/.*\.//' | sort | uniq -c | sort -rn
277
+
278
+ # What config files hint at the platform?
279
+ ls -la *.json *.yaml *.yml *.toml *.xml *.plist *.gradle* *.sln *.csproj 2>/dev/null
280
+
281
+ # What does the README say?
282
+ head -50 README.md
283
+ ```
284
+
285
+ 2. **Read the project's own documentation** — The project's README, CONTRIBUTING.md,
286
+ docs/ folder, and comments often explain the architecture and conventions better
287
+ than any external source.
288
+
289
+ 3. **Search the web for platform patterns** (using WebSearch tool):
290
+ - Query: "{detected framework} project structure best practices"
291
+ - Query: "{detected language} {detected framework} architecture patterns"
292
+ - Query: "{detected framework} testing conventions"
293
+ - Query: "{detected framework} CI/CD setup"
294
+
295
+ **Why web search**: When the toolkit encounters an iPhone app using SwiftUI with TCA
296
+ (The Composable Architecture), it doesn't know TCA patterns. But it can search for
297
+ "SwiftUI TCA project structure" and learn the conventions (Reducers, Features, Store).
298
+
299
+ 4. **Query MCP servers for platform knowledge** — If the project has MCP servers configured
300
+ that might have relevant knowledge (e.g., a Notion wiki about the project's architecture),
301
+ query them for platform-specific docs.
302
+
303
+ 5. **Read package/dependency manifests deeply** — The dependency list tells you what patterns
304
+ are in use. Each dependency implies conventions:
305
+ ```
306
+ Package.swift contains:
307
+ - "ComposableArchitecture" → TCA pattern (Reducers, Features, Store)
308
+ - "swift-snapshot-testing" → snapshot-based UI testing
309
+ - "Kingfisher" → async image loading
310
+ - "SwiftLint" → code style enforcement (read .swiftlint.yml for rules)
311
+
312
+ build.gradle contains:
313
+ - "hilt" → dependency injection via Hilt (look for @Inject, @Module)
314
+ - "room" → local database (look for @Entity, @Dao)
315
+ - "compose" → Jetpack Compose UI (look for @Composable)
316
+ - "mockk" → mocking library for tests
317
+ ```
318
+
319
+ 6. **Synthesize into the standard profile format** — Even for an unknown platform, the
320
+ output is the same: architecture patterns, coding conventions, testing style, domain model.
321
+ The categories are universal; only the specifics change.
322
+
323
+ 7. **Generate platform-specific custom agents** — For platforms without built-in agents:
324
+ ```
325
+ Detected: iOS app using SwiftUI + TCA + Core Data
326
+
327
+ Existing agents that partially apply:
328
+ - code-reviewer (universal) → ESSENTIAL
329
+ - architect (universal) → ESSENTIAL
330
+ - qa (universal) → ESSENTIAL, but needs iOS test knowledge
331
+ - frontend (React-focused) → NOT relevant for iOS
332
+
333
+ Custom agents to generate:
334
+ - ios-developer.md → SwiftUI/TCA patterns, Core Data, Swift conventions
335
+ - ios-qa.md → XCTest, XCUITest, snapshot testing, TestFlight
336
+ - ios-ops.md → Fastlane, Xcode Cloud, App Store Connect, provisioning profiles
337
+ ```
338
+
339
+ When generating custom agents for unknown platforms, the agent definition should include
340
+ the web-searched best practices so the agent can follow them without searching again.
341
+
342
+ **What to extract (universal across ALL platforms):**
343
+
344
+ ```
345
+ Architecture:
346
+ - Layering pattern: flat | 2-layer | 3-layer | clean architecture | MVVM | MVC | TCA | VIPER
347
+ - Dependency direction: which modules import which?
348
+ - Shared abstractions: base classes, protocols, generics, shared interfaces
349
+ - Error handling pattern: exceptions | Result types | error codes | throwing functions
350
+ - Auth pattern: where and how is authentication handled?
351
+ - Data access pattern: local DB | network API | both | offline-first
352
+ - Navigation pattern: stack | tab | coordinator | router
353
+ - State management: observable objects | Redux-like | reactive streams
354
+ ```
355
+
356
+ #### Step 1.3: Coding Convention Extraction
357
+
358
+ Read 5+ source files across different parts of the codebase. For each, note:
359
+
360
+ ```
361
+ File naming:
362
+ - kebab-case.ts | PascalCase.ts | snake_case.py | camelCase.ts
363
+ - Feature-based dirs (user/user.service.ts) | type-based dirs (services/user.ts) | flat
364
+
365
+ Naming conventions:
366
+ - Variables: camelCase | snake_case | PascalCase
367
+ - Functions/methods: camelCase | snake_case
368
+ - Classes/types: PascalCase | SCREAMING_CASE for constants
369
+ - Private members: _prefix | #private | no convention
370
+
371
+ Import style:
372
+ - Absolute from root (import { x } from '@/lib/x') | relative (import { x } from '../lib/x')
373
+ - Barrel files (index.ts re-exports) | direct imports
374
+ - Import grouping order: stdlib → external → internal → relative
375
+ - Type imports separate (import type { X }) | mixed
376
+
377
+ Error handling:
378
+ - Custom error classes (AppError, NotFoundError) | framework errors (HTTPException) | raw Error
379
+ - Try/catch with specific types | catch-all | Result/Either pattern
380
+ - Error response format: { error: string } | { message, code } | { errors: [] }
381
+
382
+ Logging:
383
+ - Structured (logger.info({ key: val })) | console.log | framework logger | none
384
+ - Log levels used: debug/info/warn/error
385
+
386
+ Comments/docs:
387
+ - JSDoc/docstrings on public functions | inline comments | none
388
+ - Type annotations: strict (all functions) | partial | none
389
+ ```
390
+
391
+ #### Step 1.4: Testing Pattern Analysis
392
+
393
+ Find and read 3-5 existing test files:
394
+
395
+ ```bash
396
+ # Look for test files
397
+ # Python: test_*.py, *_test.py, tests/*.py
398
+ # JS/TS: *.test.ts, *.spec.ts, __tests__/*.ts
399
+ # Go: *_test.go
400
+ # Rust: tests/*.rs, #[cfg(test)] modules
401
+ ```
402
+
403
+ Extract:
404
+ ```
405
+ Testing style:
406
+ - Test framework: pytest | unittest | Jest | Vitest | Mocha | testing-library | Go testing | cargo test
407
+ - Mock strategy: real DB | in-memory DB | mocks (unittest.mock/jest.mock) | MSW | test containers
408
+ - Fixture strategy: factory functions | factory_boy | fixtures/ dir | beforeEach setup | conftest.py
409
+ - Assertion style: assert x == y | expect(x).toBe(y) | assert.Equal | custom matchers
410
+ - Test naming: test_what_when_then | describe/it blocks | test('should...') | TestFunctionName
411
+ - Test organization: mirror source structure | flat tests/ dir | colocated with source
412
+ - Coverage enforcement: yes (threshold) | no | CI-only
413
+ - E2E tests: Playwright | Cypress | Selenium | none
414
+ - API tests: httpx/TestClient | supertest | go httptest | none
415
+ ```
416
+
417
+ #### Step 1.5: Domain Model Deep Scan
418
+
419
+ Go beyond entity names — understand the business:
420
+
421
+ ```
422
+ Domain entities:
423
+ - List all model/entity classes with their fields
424
+ - Identify relationships (foreign keys, many-to-many, embedded)
425
+ - Find enum types and their values (these encode business states)
426
+ - Find validators/constraints (min/max, regex, required fields)
427
+
428
+ State machines:
429
+ - Find fields like `status`, `state`, `phase` with enum values
430
+ - Map allowed transitions (look for validation logic, if/match statements)
431
+ - Identify terminal states (completed, cancelled, archived)
432
+
433
+ Business rules:
434
+ - Find validation functions, guard clauses, business logic checks
435
+ - Look for comments explaining WHY (not just what)
436
+ - Identify invariants (things that must always be true)
437
+
438
+ Domain vocabulary:
439
+ - What does the team call things? (e.g., "workspace" in UI vs "organization" in DB)
440
+ - Abbreviations used in code (e.g., "txn" for transaction)
441
+ - Domain-specific terms that agents need to know
442
+ ```
443
+
444
+ #### Step 1.6: Integration & External Service Scan
445
+
446
+ Detect what external services the project integrates with:
447
+
448
+ ```bash
449
+ # Check env files for service hints
450
+ cat .env.example .env.local .env 2>/dev/null | grep -E '^[A-Z_]+=' | sed 's/=.*//'
451
+
452
+ # Check package files for SDK imports
453
+ grep -r "import.*from" --include="*.ts" --include="*.py" --include="*.go" -l | head -20
454
+
455
+ # Check docker-compose for services
456
+ cat docker-compose.yml docker-compose.yaml 2>/dev/null
457
+ ```
458
+
459
+ **Map env vars and imports to services:**
460
+
461
+ | Signal | Service | MCP Server Available |
462
+ |--------|---------|---------------------|
463
+ | `DATABASE_URL` contains `postgres` | PostgreSQL | `@modelcontextprotocol/server-postgres` |
464
+ | `DATABASE_URL` contains `mysql` | MySQL | `@benborla29/mcp-server-mysql` |
465
+ | `DATABASE_URL` contains `sqlite` | SQLite | `@modelcontextprotocol/server-sqlite` |
466
+ | `MONGODB_URI` or `MONGO_URL` | MongoDB | `@modelcontextprotocol/server-mongodb` |
467
+ | `REDIS_URL` or `REDIS_HOST` | Redis | `redis-mcp-server` |
468
+ | `SUPABASE_URL` or `@supabase/` import | Supabase | `@supabase/mcp-server-supabase` |
469
+ | `NEON_DATABASE_URL` or `@neondatabase/` | Neon | `@neondatabase/mcp-server-neon` |
470
+ | `GITHUB_TOKEN` or `@octokit/` import | GitHub | `@modelcontextprotocol/server-github` |
471
+ | `GITLAB_TOKEN` or `gitlab` import | GitLab | `gitlab-mcp-server` |
472
+ | `LINEAR_API_KEY` or `@linear/` import | Linear | `mcp-linear` |
473
+ | `JIRA_*` or `jira` import | Jira | `@anthropic/mcp-server-jira` (if available) |
474
+ | `NOTION_*` or `@notionhq/` import | Notion | `notion-mcp-server` |
475
+ | `SLACK_*` or `@slack/` import | Slack | Claude Code Slack plugin (enabledPlugins) |
476
+ | `DISCORD_*` or `discord.js` import | Discord | `discord-mcp` (local build) |
477
+ | `SENTRY_DSN` or `@sentry/` import | Sentry | `@anthropic/mcp-server-sentry` (if available) |
478
+ | `STRIPE_*` or `stripe` import | Stripe | `@anthropic/mcp-server-stripe` (if available) |
479
+ | `AWS_*` or `boto3`/`@aws-sdk/` import | AWS | `@anthropic/mcp-server-aws` |
480
+ | `CLOUDFLARE_*` or `wrangler` | Cloudflare | `@anthropic/mcp-server-cloudflare` |
481
+ | `VERCEL_*` or `vercel.json` | Vercel | `@anthropic/mcp-server-vercel` |
482
+ | `FIREBASE_*` or `firebase` import | Firebase | `firebase-mcp-server` |
483
+ | `DOCKER_*` or `Dockerfile` exists | Docker | `@modelcontextprotocol/server-docker` |
484
+ | Playwright config exists | Playwright | Browser automation (claude-in-chrome already available) |
485
+ | `FIGMA_*` or Figma references | Figma | `@anthropic/mcp-server-figma` |
486
+ | `TWILIO_*` or `twilio` import | Twilio | `twilio-mcp-server` |
487
+ | `SENDGRID_*` or `@sendgrid/` import | SendGrid | `sendgrid-mcp-server` |
488
+ | `OPENAI_API_KEY` or `openai` import | OpenAI | N/A (SDK direct) |
489
+ | `ANTHROPIC_API_KEY` or `anthropic` import | Anthropic | N/A (SDK direct) |
490
+ | `PINECONE_*` or `pinecone` import | Pinecone | `pinecone-mcp-server` |
491
+ | `WEAVIATE_*` or `weaviate` import | Weaviate | `weaviate-mcp-server` |
492
+ | `ELASTICSEARCH_*` or `elasticsearch` import | Elasticsearch | `elasticsearch-mcp-server` |
493
+ | `RAILWAY_*` or `railway.json` | Railway | Railway MCP (toolkit has Railway skills) |
494
+
495
+ **Mobile/Native platform tools:**
496
+
497
+ | Signal | Service/Tool | Recommendation |
498
+ |--------|-------------|---------------|
499
+ | `*.xcodeproj` or `Package.swift` | **Xcode / Swift** | Recommend: SwiftLint (if not present), Fastlane, xcbeautify |
500
+ | `Podfile` | **CocoaPods** | Note: pods detected, document pod install in profile |
501
+ | `fastlane/` directory | **Fastlane** | Document lanes, recommend CI integration |
502
+ | `build.gradle` + `kotlin` | **Android / Kotlin** | Recommend: ktlint, detekt, Gradle build scans |
503
+ | `pubspec.yaml` | **Flutter / Dart** | Recommend: dart_code_metrics, flutter_lints |
504
+ | `expo` in package.json | **Expo** | Recommend: EAS Build, expo-dev-client |
505
+ | `.swiftlint.yml` | **SwiftLint** | Read rules — these ARE the project's coding conventions |
506
+ | `*.xctestplan` | **Xcode Test Plans** | Document test targets and schemes |
507
+ | `Matchfile` or `Appfile` | **Fastlane Match** | Code signing managed via Match |
508
+ | `GoogleService-Info.plist` | **Firebase (iOS)** | Firebase MCP or Firebase console |
509
+ | `google-services.json` | **Firebase (Android)** | Firebase MCP or Firebase console |
510
+ | `*.entitlements` | **iOS Capabilities** | Document entitlements (push, sign-in, etc.) |
511
+ | App Store Connect API key in env | **App Store Connect** | Recommend: Fastlane for automated distribution |
512
+ | `TestFlight` references | **TestFlight** | Document beta distribution workflow |
513
+
514
+ **Data Science / ML tools:**
515
+
516
+ | Signal | Service/Tool | Recommendation |
517
+ |--------|-------------|---------------|
518
+ | `dvc.yaml` or `.dvc/` | **DVC** | Data version control — document pipeline |
519
+ | `mlflow` in requirements | **MLflow** | Experiment tracking — document server URL |
520
+ | `wandb` in requirements | **Weights & Biases** | Experiment tracking |
521
+ | `*.ipynb` files | **Jupyter** | Recommend: notebook MCP for Claude interaction |
522
+ | `environment.yml` | **Conda** | Document conda env setup |
523
+ | `Dockerfile` + ML packages | **ML Container** | Docker-based training/serving |
524
+
525
+ **Also check for CLI tools and build systems the project uses:**
526
+ - `Makefile` → project has make targets (document them)
527
+ - `Taskfile.yml` → project uses Task runner
528
+ - `justfile` → project uses Just runner
529
+ - `turbo.json` → project uses Turborepo
530
+ - `nx.json` → project uses Nx monorepo
531
+ - `pnpm-workspace.yaml` → pnpm monorepo
532
+ - `lerna.json` → Lerna monorepo
533
+ - `fastlane/Fastfile` → Fastlane lanes (document each lane)
534
+ - `Earthfile` → Earthly build system
535
+ - `Bazel` / `BUILD` files → Bazel build system
536
+ - `xcodebuild` in CI → Xcode command-line builds
537
+
538
+ #### Step 1.6b: Environment Discovery
539
+
540
+ After detecting what services the project uses (Step 1.6), discover what **environments** those services run in. This builds on the service scan — environments are WHERE services run, not WHAT they are.
541
+
542
+ **Tiered auto-detection signals (ordered by confidence):**
543
+
544
+ **Tier 1 — Explicit environment config files (high confidence):**
545
+
546
+ | Signal | Environment Name | Type |
547
+ |--------|-----------------|------|
548
+ | `.env.staging` | staging | staging |
549
+ | `.env.production` or `.env.prod` | production | production |
550
+ | `.env.preview` | preview | preview |
551
+ | `docker-compose.staging.yml` or `docker-compose.prod.yml` | staging / production | staging / production |
552
+ | GitHub Actions workflow with `environment:` key | value of `environment:` | infer from name |
553
+ | `terraform/environments/staging/`, `terraform/environments/prod/` | staging / production | staging / production |
554
+ | `k8s/overlays/staging/`, `k8s/overlays/production/` | staging / production | staging / production |
555
+ | `helm/values-staging.yaml`, `helm/values-production.yaml` | staging / production | staging / production |
556
+ | `vercel.json` exists | preview + production | preview + production (Vercel always has both) |
557
+ | `fly.staging.toml` or multiple `fly.*.toml` | per-file | infer from filename |
558
+
559
+ **Tier 2 — CI/CD pipeline analysis (medium confidence):**
560
+
561
+ | Signal | What it tells us |
562
+ |--------|-----------------|
563
+ | GitHub Actions jobs named `deploy-staging`, `deploy-production` | Two deploy targets |
564
+ | CI workflow with different secrets blocks per environment | Named deploy environments |
565
+ | Branch protection rules on `main` + `staging` branches | Branch-per-environment model |
566
+ | Netlify/Vercel preview deploy configuration | Preview environment exists |
567
+
568
+ **Tier 3 — Env var naming patterns (low confidence — needs confirmation):**
569
+
570
+ | Signal | What it tells us |
571
+ |--------|-----------------|
572
+ | `STAGING_DATABASE_URL`, `PROD_DATABASE_URL` in `.env.example` | Env-prefixed vars suggest multiple environments |
573
+ | `DATABASE_URL` with no prefix | Single environment or env set at deploy time |
574
+
575
+ **Tier 4 — Platform-specific detection (query if available):**
576
+
577
+ | Platform | How to detect environments |
578
+ |----------|--------------------------|
579
+ | Railway | Query Railway MCP for project environments (Railway has first-class environment support) |
580
+ | Vercel | Always has production + preview; check for custom domains per environment |
581
+ | Fly.io | Check for `fly.staging.toml` or `FLY_APP_NAME` variants |
582
+ | AWS / Terraform | Scan for workspace names, account IDs, or `var.environment` in .tf files |
583
+ | Kubernetes | Check namespace names via kustomize overlays or `kubectl get namespaces` |
584
+ | Heroku | Check for pipeline stages via `heroku pipelines:info` |
585
+
586
+ **Discovery algorithm:**
587
+
588
+ 1. Scan for `.env.*` files → extract environment names from suffixes
589
+ 2. Scan CI/CD configs (`.github/workflows/*.yml`) → extract deploy target names and `environment:` values
590
+ 3. Scan IaC configs (Terraform, Kubernetes, Helm) → extract environment names from directory/file names
591
+ 4. Scan deploy platform configs (`railway.json`, `vercel.json`, `fly.toml`) → extract environments
592
+ 5. Query platform MCP servers if available (Railway MCP, Vercel CLI) → get live environment list
593
+ 6. Cross-reference all sources and deduplicate environment names
594
+ 7. For each discovered environment, gather:
595
+ - Type (development / staging / production / preview / canary — infer from name)
596
+ - URL (from deploy config, env vars, or domain settings)
597
+ - Health endpoint (from CLAUDE.md Infrastructure or `/health` convention)
598
+ - Deploy trigger (from CI/CD config — branch name, manual, auto)
599
+ - Branch (from CI/CD config — which branch triggers deploy, or `—` if not branch-based)
600
+ - Env var source (which `.env` file or secret store)
601
+ - Platform (from deploy config)
602
+ 8. ALWAYS include `local` as a `development` environment (populated from Local Dev Services scan in CLAUDE.md)
603
+ 9. Present findings to user for confirmation (see prompt below)
604
+
605
+ **Files-first, MCP-second**: Always run Tier 1-3 (offline, file-based) detection before Tier 4 (MCP/CLI queries). This ensures discovery works even without platform MCP servers connected.
606
+
607
+ **User confirmation prompt:**
608
+
609
+ Use AskUserQuestion with one of these prompts based on detection results:
610
+
611
+ **If 0 remote environments detected (only local):**
612
+ ```
613
+ I found your local development environment but no remote environments.
614
+ What environments does this project deploy to? (e.g., staging, production, preview)
615
+ List them, or say 'none' if this is local-only:
616
+ ```
617
+
618
+ **If 1+ remote environments detected:**
619
+ ```
620
+ I detected these environments:
621
+
622
+ 1. local (development) — {platform}, {url}
623
+ 2. {name} ({type}) — {platform}, {url}
624
+ 3. {name} ({type}) — {platform}, {url}
625
+
626
+ Are there other environments I missed? (e.g., preview, canary, QA)
627
+ Type environment names to add, or 'confirm' to proceed: [confirm]
628
+ ```
629
+
630
+ **If greenfield project (< 5 source files, < 3 git commits):**
631
+ Skip environment discovery entirely. Add note to project-profile.md:
632
+ ```
633
+ ## Environments
634
+ No remote environments detected (greenfield project). Run `/calibrate rescan` after deploying.
635
+ ```
636
+
637
+ **Rescan merge behavior (`/calibrate rescan`):**
638
+ When rescanning, do NOT auto-remove previously detected environments. Instead:
639
+ 1. Re-run detection and compare with existing Environments section
640
+ 2. For new environments found: add them
641
+ 3. For existing environments not re-detected: ask user "I previously detected {env} but can't find it now. Remove it? [y/n]"
642
+ 4. For changed details (URL, branch): update silently
643
+
644
+ After user confirmation, write the Environments table to CLAUDE.md and the detailed blocks to project-profile.md (Phase 2).
645
+
646
+ The CLAUDE.md table format to write:
647
+ ```
648
+ | Name | Type | URL | Health | Deploy | Branch |
649
+ |------|------|-----|--------|--------|--------|
650
+ | local | development | http://localhost:8000 | /health | manual | — |
651
+ | staging | staging | https://staging.myapp.com | /health | push to staging | staging |
652
+ ```
653
+
654
+ ### Phase 1.7: Full Agent & Skill Evaluation (CRITICAL)
655
+
656
+ This is what makes `/calibrate` different from a generic recommendation engine. It doesn't pick
657
+ from a static list — it **reads every single agent and skill definition** in the toolkit and
658
+ evaluates each one against the project's actual needs.
659
+
660
+ #### How It Works
661
+
662
+ 1. **Read ALL agent definitions** from `~/.claude-agents/agents/*.md`:
663
+ - For each agent file, read the frontmatter (`name`, `description`, `tools`, `model`)
664
+ - Read the full body to understand what the agent does, what it expects, what patterns it follows
665
+ - Extract: what tech stacks it handles, what project signals it looks for, what CLAUDE.md sections it reads
666
+
667
+ 2. **Read ALL skill definitions** from `~/.claude-agents/skills/*/SKILL.md`:
668
+ - For each skill, read the frontmatter and full body
669
+ - Extract: what it does, what other skills/agents it chains to, what project state it needs
670
+ - Map dependencies: `/implement` needs `/planning` output, `/qa` reads Test Commands from CLAUDE.md, etc.
671
+
672
+ 3. **Read ALL hook definitions** from `~/.claude-agents/hooks/*.sh`:
673
+ - Read the header comments to understand what each hook does
674
+ - Identify which hooks are relevant for this project's workflow
675
+
676
+ 4. **Score each agent/skill against the project scan results:**
677
+
678
+ For each agent, evaluate:
679
+ ```
680
+ RELEVANCE SCORE (0-10):
681
+
682
+ Tech match (0-3):
683
+ - Does this agent handle the project's detected tech stack?
684
+ - python-backend + Python project = 3
685
+ - python-backend + Go project = 0
686
+ - architect + any project = 2 (always somewhat relevant)
687
+
688
+ Pattern match (0-3):
689
+ - Does the project have patterns this agent specializes in?
690
+ - qa-e2e + Playwright detected = 3
691
+ - qa-e2e + no E2E framework = 0 (but recommend setting up)
692
+ - sre + Railway detected = 3
693
+ - sre + no deploy platform = 1 (still useful for local ops)
694
+
695
+ Workflow fit (0-2):
696
+ - Does this agent fit into the project's natural workflow?
697
+ - frontend agent + project has React code = 2
698
+ - frontend agent + backend-only API = 0
699
+
700
+ Gap fill (0-2):
701
+ - Does this agent fill a capability gap the project currently has?
702
+ - qa-domain + project has complex business rules but no domain tests = 2
703
+ - content-strategist + developer tool with no marketing = 0
704
+ ```
705
+
706
+ **Scoring thresholds:**
707
+ - 7-10: **Essential** — install by default, include in recommended workflows
708
+ - 4-6: **Useful** — recommend, explain when to use
709
+ - 1-3: **Available** — mention but don't push
710
+ - 0: **Not relevant** — don't show unless user asks
711
+
712
+ 5. **Map skill chains into workflows:**
713
+
714
+ Based on what scored high, compose workflow sequences:
715
+ ```
716
+ If planning (8) + implement (8) + qa (9) + pr (7) all scored high:
717
+ → Core workflow: /planning → /implement → /qa → /pr
718
+
719
+ If sre (7) + ci-fix (6) scored high:
720
+ → Ops workflow: /sre status → /ci-fix (when CI breaks)
721
+
722
+ If design-studio-think (5) + design-studio-create (6) + design-studio-critique (5):
723
+ → Design workflow: design-studio-think → design-studio-create → design-studio-critique
724
+ ```
725
+
726
+ 6. **Identify gaps — things the project needs but no existing agent/skill covers:**
727
+
728
+ Compare project scan results against ALL agent/skill capabilities:
729
+ ```
730
+ Project has: Toolkit covers: Gap:
731
+ - Celery workers - No celery agent → Recommend custom celery-worker agent
732
+ - Django mgmt cmds - No Django cmd agent → Recommend custom django-commands agent
733
+ - Custom CLI tool - No CLI agent → Recommend custom cli agent
734
+ - GraphQL API - REST-focused agents → Recommend custom graphql agent
735
+ - Mobile app (React Native) - Web-focused frontend → Recommend custom mobile agent
736
+ - ML pipeline - No ML agent → Recommend custom ml-pipeline agent
737
+ - Terraform infra - SRE covers some → Recommend custom terraform agent or extend SRE
738
+ ```
739
+
740
+ **For non-web platforms (mobile, desktop, game, ML, embedded):**
741
+
742
+ The gap analysis is especially critical here because the toolkit has ZERO built-in agents
743
+ for these platforms. The evaluation should:
744
+
745
+ a) Score all universal agents (architect, code-reviewer, qa, product-manager) — these
746
+ apply to ANY project regardless of platform
747
+
748
+ b) Score all web-specific agents at 0 (frontend, python-backend) — they don't apply
749
+
750
+ c) Generate custom agents for the platform by:
751
+ - Using knowledge from the deep scan (Step 1.2b/1.2c)
752
+ - Using web-searched best practices for the platform
753
+ - Using patterns extracted from the project's own codebase
754
+ - Reading the project's own docs/README for architecture guidance
755
+
756
+ **Example — iOS App (SwiftUI + TCA):**
757
+ ```
758
+ Universal agents (still relevant):
759
+ - architect (8) → Essential — designs system architecture for any platform
760
+ - code-reviewer (7) → Essential — reviews Swift code quality
761
+ - qa (6) → Useful — orchestrates test runs, but needs XCTest knowledge
762
+ - product-manager (5) → Useful — feature planning is platform-agnostic
763
+ - design-studio-* (4) → Useful — UI/UX design is relevant for mobile
764
+
765
+ Web agents (not relevant):
766
+ - frontend (0) → React/Next.js focused, not Swift
767
+ - python-backend (0) → Python, not Swift
768
+ - ops (1) → can still run some commands
769
+
770
+ Custom agents to generate:
771
+ - ios-developer.md → SwiftUI/TCA patterns, Swift conventions, SPM
772
+ (seeded with conventions from Step 1.3 + TCA patterns from web search)
773
+ - ios-qa.md → XCTest, XCUITest, snapshot testing
774
+ (seeded with test patterns from Step 1.4)
775
+ - ios-ops.md → Fastlane, xcodebuild, TestFlight, provisioning
776
+ (seeded with CI/CD patterns from the project's fastlane/ dir)
777
+
778
+ Custom skills to generate:
779
+ - /build-ios → xcodebuild clean + build + test (replaces /probe)
780
+ - /deploy-ios → Fastlane beta distribution (replaces /sre deploy)
781
+ - /qa-ios → Run XCTest + XCUITest + snapshot tests (extends /qa)
782
+ ```
783
+
784
+ **How custom agents learn the platform (the key mechanism):**
785
+
786
+ When generating a custom agent for an unfamiliar platform, the agent definition
787
+ should embed the knowledge it needs inline — not just say "follow Swift conventions"
788
+ but actually include the specific conventions extracted from the codebase AND
789
+ web-searched best practices. This way the agent has the knowledge at invocation
790
+ time without needing to re-search.
791
+
792
+ ```markdown
793
+ # ios-developer.md (generated by /calibrate)
794
+
795
+ ## Swift Conventions (from this project's codebase)
796
+ - Naming: PascalCase types, camelCase properties/methods, SCREAMING_CASE constants
797
+ - File per type: each struct/class gets its own file
798
+ - Import order: Foundation → SwiftUI → External packages → Project modules
799
+ - Error handling: typed errors via enum conforming to Error protocol
800
+ - Async: async/await preferred over Combine, structured concurrency
801
+
802
+ ## TCA Patterns (from web search + this project's code)
803
+ - Feature modules: each feature has Reducer + View + State + Action
804
+ - File structure: Features/{FeatureName}/{FeatureName}.swift (reducer + view together)
805
+ - Dependencies: registered in DependencyValues extension
806
+ - Testing: use TestStore to assert state changes
807
+ ```
808
+
809
+ For each gap, draft what a custom agent/skill would look like and include it in recommendations.
810
+
811
+ #### Agent/Skill Registry (What to Read)
812
+
813
+ Read EVERY file in these directories:
814
+
815
+ ```
816
+ ~/.claude-agents/agents/ ← 26 agent definitions
817
+ ~/.claude-agents/skills/*/SKILL.md ← 31 skill definitions
818
+ ~/.claude-agents/hooks/ ← 13 hook definitions
819
+ ~/.claude-agents/examples/ ← Example customizations
820
+ ```
821
+
822
+ **Parse each file to extract:**
823
+ - Name and description (from frontmatter)
824
+ - Tech stack requirements (from body — grep for framework names, tool names)
825
+ - CLAUDE.md sections it reads (from "Read CLAUDE.md" instructions)
826
+ - Other agents/skills it spawns or chains to
827
+ - Model tier (opus/sonnet/haiku — affects cost)
828
+ - What project signals trigger its use (from triage router patterns)
829
+
830
+ **Build an internal evaluation matrix:**
831
+
832
+ ```
833
+ | Agent/Skill | Tech Match | Pattern Match | Workflow Fit | Gap Fill | TOTAL | Verdict |
834
+ |------------|-----------|--------------|-------------|---------|-------|---------|
835
+ | python-backend | 3 (Python) | 3 (FastAPI) | 2 (has backend) | 0 | 8 | Essential |
836
+ | frontend | 3 (React) | 2 (Next.js) | 2 (has frontend) | 0 | 7 | Essential |
837
+ | qa | 2 (pytest+vitest) | 3 (tests exist) | 2 (core workflow) | 2 (no orchestration) | 9 | Essential |
838
+ | sre | 2 (Railway) | 2 (has deploy) | 1 (not daily) | 1 | 6 | Useful |
839
+ | design-studio-* | 0 (no design) | 0 | 0 | 0 | 0 | Not relevant |
840
+ | ...
841
+ ```
842
+
843
+ This matrix drives ALL recommendations — MCP servers, categories, workflows, custom agents.
844
+
845
+ ### Phase 2: Write Project Profile
846
+
847
+ Write all findings to `.claude/project-profile.md`. This is the file agents read at runtime
848
+ to understand HOW the project works, not just WHAT it uses.
849
+
850
+ **Format:**
851
+
852
+ ```markdown
853
+ # Project Profile — {project_name}
854
+ <!-- Generated by /calibrate on {date} -->
855
+ <!-- Agents read this for deep project context. Re-run /calibrate rescan to update. -->
856
+ <!-- Last calibrated: {date} | Toolkit version: {version from install.sh} -->
857
+
858
+ ## Architecture
859
+
860
+ **Pattern**: {detected pattern — e.g., "3-layer service architecture (routes → services → repositories)"}
861
+ **Data flow**: {e.g., "HTTP request → Pydantic validation → service logic → SQLAlchemy ORM → PostgreSQL"}
862
+ **Frontend pattern**: {e.g., "Feature-based folders, each with page + components + hooks + tests"}
863
+ **API style**: {e.g., "REST, resource-based, versioned (/api/v1/)"}
864
+ **Auth approach**: {e.g., "JWT Bearer via FastAPI dependency injection on protected routes"}
865
+
866
+ ### Key Directories
867
+ | Directory | Purpose | Key patterns |
868
+ |-----------|---------|-------------|
869
+ | {dir} | {purpose} | {patterns used here} |
870
+
871
+ ### Dependency Flow
872
+ ```
873
+ {ascii diagram showing how modules depend on each other}
874
+ ```
875
+
876
+ ## Coding Conventions
877
+
878
+ ### {Language 1 — e.g., Python}
879
+ - **Naming**: {snake_case everywhere, PascalCase for classes}
880
+ - **Imports**: {absolute from project root, grouped: stdlib → external → internal}
881
+ - **Error handling**: {custom error hierarchy in app/errors.py — AppError → NotFoundError, ValidationError, etc.}
882
+ - **Type annotations**: {strict — all public functions and return types annotated}
883
+ - **Docstrings**: {Google style on all public functions}
884
+
885
+ ### {Language 2 — e.g., TypeScript}
886
+ - **Naming**: {camelCase vars, PascalCase components, kebab-case files}
887
+ - **Imports**: {absolute via @/ alias, type imports separate}
888
+ - **Error handling**: {try/catch with typed errors, error boundaries for React}
889
+ - **Components**: {function components only, props interface above component}
890
+
891
+ ### Shared Conventions
892
+ - **Commit style**: {conventional commits | freeform | etc.}
893
+ - **Branch naming**: {feature/xxx | feat/xxx | xxx}
894
+ - **PR process**: {squash merge | merge commit | rebase}
895
+
896
+ ## Testing Conventions
897
+
898
+ ### {Backend}
899
+ - **Framework**: {pytest}
900
+ - **Mock strategy**: {real database via test fixtures, external APIs mocked with responses library}
901
+ - **Fixtures**: {conftest.py with factory functions, shared test database}
902
+ - **Naming**: {test_{what}_when_{condition}_then_{expected}}
903
+ - **Coverage**: {enforced at 85% via pytest-cov}
904
+
905
+ ### {Frontend}
906
+ - **Framework**: {Vitest + Testing Library}
907
+ - **Mock strategy**: {MSW for API calls, local state for component tests}
908
+ - **Naming**: {describe/it blocks — "it should render the form"}
909
+
910
+ ### E2E
911
+ - **Framework**: {Playwright | Cypress | none detected}
912
+ - **Patterns**: {page object model | direct selectors}
913
+
914
+ ## Domain Model
915
+
916
+ **What this app does**: {1-2 sentence description derived from code}
917
+
918
+ ### Core Entities
919
+ | Entity | Key Fields | States/Lifecycle | Relationships |
920
+ |--------|-----------|-----------------|---------------|
921
+ | {entity} | {important fields} | {status values if any} | {belongs to X, has many Y} |
922
+
923
+ ### Business Rules
924
+ - {Rule 1 — derived from validators/guards}
925
+ - {Rule 2}
926
+
927
+ ### State Transitions
928
+ ```
929
+ {Entity}: {state1} → {state2} → {state3} (no backwards transitions)
930
+ ```
931
+
932
+ ### Domain Vocabulary
933
+ | Code Term | UI Term | Meaning |
934
+ |-----------|---------|---------|
935
+ | {e.g., organization} | {e.g., workspace} | {what it represents} |
936
+
937
+ ## External Integrations
938
+ | Service | How Used | Env Vars | MCP Available |
939
+ |---------|----------|----------|--------------|
940
+ | {service} | {purpose in this project} | {var names} | {yes/no + package name} |
941
+
942
+ ## Environments
943
+
944
+ ### {env_name} ({type})
945
+ - **Platform**: {e.g., Docker Compose, Railway, Vercel, AWS, Kubernetes}
946
+ - **URL**: {e.g., http://localhost:8000, https://staging.myapp.com}
947
+ - **Health**: {endpoint path, e.g., /health}
948
+ - **Database**: {e.g., postgres://localhost:5432/myapp_dev, Railway-managed postgres}
949
+ - **Env file**: {e.g., .env.local, .env.staging, Railway env vars}
950
+ - **Services**: {e.g., backend (port 8000), frontend (port 3000), postgres (port 5432)}
951
+ - **Start**: {e.g., docker compose up -d, N/A (managed)}
952
+ - **Deploy trigger**: {e.g., manual, push to staging branch, push to main}
953
+ - **Access**: {e.g., direct (local), Railway CLI / MCP, kubectl}
954
+ - **Access validated**: {true/false — checked during calibration}
955
+
956
+ ### Environment Access Methods
957
+ | Environment | Database | Logs | Deploy | Health |
958
+ |-------------|----------|------|--------|--------|
959
+ | {env_name} | {e.g., postgres MCP (direct)} | {e.g., docker compose logs} | {e.g., manual} | {e.g., curl localhost:8000/health} |
960
+
961
+ ## Detected Workflows
962
+ | Activity | Current Approach | Toolkit Equivalent |
963
+ |----------|-----------------|-------------------|
964
+ | {e.g., "Running tests"} | {e.g., "pytest from backend/"} | {e.g., "/qa or ops agent"} |
965
+ | {e.g., "Deploying"} | {e.g., "git push to main → Railway auto-deploy"} | {e.g., "/sre deploy"} |
966
+
967
+ ## Recommended Toolkit Configuration
968
+
969
+ ### MCP Servers to Install
970
+ | Server | Package | Why |
971
+ |--------|---------|-----|
972
+ | {name} | {npm package or install command} | {what it enables for this project} |
973
+
974
+ ### Agents (Priority Order)
975
+ | Agent | Relevance | Why |
976
+ |-------|-----------|-----|
977
+ | {agent} | {essential/high/medium/low} | {what it does for this project specifically} |
978
+
979
+ ### Skills (Priority Order)
980
+ | Skill | Relevance | Why |
981
+ |-------|-----------|-----|
982
+ | {skill} | {essential/high/medium} | {how this project uses it} |
983
+
984
+ ### Recommended Workflows
985
+ | Workflow | Steps | When to Use |
986
+ |----------|-------|-------------|
987
+ | {name} | {skill1 → skill2 → skill3} | {situation} |
988
+
989
+ ### Custom Agents/Skills to Create
990
+ | Name | Type | Purpose | Effort |
991
+ |------|------|---------|--------|
992
+ | {name} | {agent/skill} | {what gap it fills} | {small/medium} |
993
+ ```
994
+
995
+ ### Phase 3: Recommend
996
+
997
+ Present findings to the user as a clear, actionable report. Group into sections.
998
+
999
+ #### 3.1: Recommendations Summary
1000
+
1001
+ ```
1002
+ /calibrate Results for {project_name}
1003
+ ======================================
1004
+
1005
+ Project Profile: .claude/project-profile.md (written)
1006
+
1007
+ ## What I Learned
1008
+
1009
+ Architecture: {1-line summary}
1010
+ Stack: {detected stack}
1011
+ Domain: {1-line what the app does}
1012
+ Stage: {greenfield/early/growth/scale}
1013
+ Team patterns: {1-2 key conventions}
1014
+
1015
+ ## Recommendations
1016
+
1017
+ ### MCP Servers ({N} recommended)
1018
+
1019
+ These MCP servers connect Claude Code directly to your project's services:
1020
+
1021
+ ✦ {server_name} — {why}
1022
+ Install: {command}
1023
+
1024
+ ✦ {server_name} — {why}
1025
+ Install: {command}
1026
+
1027
+ ...
1028
+
1029
+ ### Toolkit Categories ({N} recommended)
1030
+
1031
+ Based on your project, these toolkit categories are most valuable:
1032
+
1033
+ [x] core — Required (already installed if toolkit is set up)
1034
+ [x] development — {why — e.g., "Your project has backend + frontend layers"}
1035
+ [x] quality — {why — e.g., "You have pytest + Vitest, QA agents orchestrate both"}
1036
+ [x] hooks — {why — e.g., "Triage router saves cost by routing to cheaper models"}
1037
+ [x] guardrails — {why — e.g., "Session bootstrap, onboard, safety guards"}
1038
+ [ ] operations — {why or why not}
1039
+ [ ] strategy — {why or why not}
1040
+ [ ] railway — {only if Railway detected}
1041
+ [ ] consulting — {only if relevant}
1042
+
1043
+ ### Workflows for Your Project
1044
+
1045
+ Your daily workflow should be:
1046
+ 1. /onboard — Start of session, see what's happening
1047
+ 2. {workflow step} — {why}
1048
+ 3. {workflow step} — {why}
1049
+ 4. /qa — Validate before shipping
1050
+ 5. /pr — Create PR with QA checks
1051
+
1052
+ Other valuable workflows:
1053
+ - {workflow} — {when to use}
1054
+ - {workflow} — {when to use}
1055
+
1056
+ ### Custom Agents/Skills to Create ({N} recommended)
1057
+
1058
+ Your project has patterns the generic toolkit doesn't cover:
1059
+
1060
+ ✦ {name} ({agent|skill}) — {what gap it fills}
1061
+ {1-2 sentence description of what it would do}
1062
+
1063
+ ...
1064
+
1065
+ ### Tools & Plugins
1066
+
1067
+ ✦ {tool/plugin} — {why}
1068
+
1069
+ ## Install Plan
1070
+
1071
+ I'll make these changes:
1072
+ 1. {action — e.g., "Add postgres MCP server to .claude/settings.json"}
1073
+ 2. {action — e.g., "Install categories: core, development, quality, hooks, guardrails"}
1074
+ 3. {action — e.g., "Create custom agent: django-management.md"}
1075
+ 4. {action — e.g., "Enable Slack plugin in settings"}
1076
+ ...
1077
+
1078
+ Proceed with all? Or pick which ones: [all / pick / skip]
1079
+ ```
1080
+
1081
+ Use AskUserQuestion to get the user's choice.
1082
+
1083
+ #### 3.2: Handle User Choice
1084
+
1085
+ | Choice | Action |
1086
+ |--------|--------|
1087
+ | `all` or `yes` | Execute full install plan |
1088
+ | `pick` | Present numbered list, let user select which to install |
1089
+ | `skip` | Skip installation, keep project-profile.md only |
1090
+ | Specific items (e.g., "1, 3, 5") | Install only those items |
1091
+
1092
+ ### Phase 4: Install Everything
1093
+
1094
+ Execute the install plan based on user choices. Run each step, verify, report.
1095
+
1096
+ #### 4.1: Install MCP Servers
1097
+
1098
+ For each recommended MCP server the user approved, add it to the project's `.claude/settings.json`.
1099
+
1100
+ **MCP Server Installation Database:**
1101
+
1102
+ ```python
1103
+ MCP_SERVERS = {
1104
+ "postgres": {
1105
+ "command": "npx",
1106
+ "args": ["-y", "@modelcontextprotocol/server-postgres", "{DATABASE_URL}"],
1107
+ "env_var": "DATABASE_URL",
1108
+ "note": "Replace {DATABASE_URL} with your connection string, or set DATABASE_URL env var"
1109
+ },
1110
+ "sqlite": {
1111
+ "command": "npx",
1112
+ "args": ["-y", "@modelcontextprotocol/server-sqlite", "--db-path", "{DB_PATH}"],
1113
+ "note": "Replace {DB_PATH} with path to your .db file"
1114
+ },
1115
+ "mysql": {
1116
+ "command": "npx",
1117
+ "args": ["-y", "@benborla29/mcp-server-mysql"],
1118
+ "env": {"MYSQL_HOST": "localhost", "MYSQL_USER": "root", "MYSQL_DATABASE": "{DB_NAME}"},
1119
+ "note": "Set MYSQL_* env vars"
1120
+ },
1121
+ "mongodb": {
1122
+ "command": "npx",
1123
+ "args": ["-y", "mongodb-mcp-server"],
1124
+ "env": {"MONGODB_URI": "{MONGO_URI}"},
1125
+ "note": "Set MONGODB_URI env var"
1126
+ },
1127
+ "redis": {
1128
+ "command": "npx",
1129
+ "args": ["-y", "redis-mcp-server"],
1130
+ "env": {"REDIS_URL": "{REDIS_URL}"},
1131
+ "note": "Set REDIS_URL env var"
1132
+ },
1133
+ "supabase": {
1134
+ "command": "npx",
1135
+ "args": ["-y", "@supabase/mcp-server-supabase"],
1136
+ "env": {"SUPABASE_URL": "{URL}", "SUPABASE_SERVICE_ROLE_KEY": "{KEY}"},
1137
+ "note": "Get from Supabase dashboard → Settings → API"
1138
+ },
1139
+ "neon": {
1140
+ "command": "npx",
1141
+ "args": ["-y", "@neondatabase/mcp-server-neon"],
1142
+ "env": {"NEON_API_KEY": "{KEY}"},
1143
+ "note": "Get from Neon console → Account → API Keys"
1144
+ },
1145
+ "github": {
1146
+ "command": "npx",
1147
+ "args": ["-y", "@modelcontextprotocol/server-github"],
1148
+ "env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "{TOKEN}"},
1149
+ "note": "Create a fine-grained PAT at github.com/settings/tokens"
1150
+ },
1151
+ "gitlab": {
1152
+ "command": "npx",
1153
+ "args": ["-y", "gitlab-mcp-server"],
1154
+ "env": {"GITLAB_TOKEN": "{TOKEN}", "GITLAB_URL": "https://gitlab.com"},
1155
+ "note": "Create a PAT at gitlab.com/-/user_settings/personal_access_tokens"
1156
+ },
1157
+ "linear": {
1158
+ "command": "npx",
1159
+ "args": ["-y", "mcp-linear"],
1160
+ "env": {"LINEAR_API_KEY": "{KEY}"},
1161
+ "note": "Get from Linear → Settings → API"
1162
+ },
1163
+ "notion": {
1164
+ "command": "npx",
1165
+ "args": ["-y", "notion-mcp-server"],
1166
+ "env": {"NOTION_API_KEY": "{KEY}"},
1167
+ "note": "Create an internal integration at notion.so/my-integrations"
1168
+ },
1169
+ "sentry": {
1170
+ "command": "npx",
1171
+ "args": ["-y", "@sentry/mcp-server-sentry"],
1172
+ "env": {"SENTRY_AUTH_TOKEN": "{TOKEN}"},
1173
+ "note": "Get from sentry.io → Settings → Auth Tokens"
1174
+ },
1175
+ "cloudflare": {
1176
+ "command": "npx",
1177
+ "args": ["-y", "@anthropic/mcp-server-cloudflare"],
1178
+ "env": {"CLOUDFLARE_API_TOKEN": "{TOKEN}"},
1179
+ "note": "Get from dash.cloudflare.com → Profile → API Tokens"
1180
+ },
1181
+ "docker": {
1182
+ "command": "npx",
1183
+ "args": ["-y", "@modelcontextprotocol/server-docker"],
1184
+ "note": "Requires Docker daemon running"
1185
+ },
1186
+ "puppeteer": {
1187
+ "command": "npx",
1188
+ "args": ["-y", "@modelcontextprotocol/server-puppeteer"],
1189
+ "note": "Browser automation — headless Chrome"
1190
+ },
1191
+ "filesystem": {
1192
+ "command": "npx",
1193
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "{PROJECT_DIR}"],
1194
+ "note": "Scoped file access — usually not needed since Claude Code has Read/Write"
1195
+ },
1196
+ "brave-search": {
1197
+ "command": "npx",
1198
+ "args": ["-y", "@modelcontextprotocol/server-brave-search"],
1199
+ "env": {"BRAVE_API_KEY": "{KEY}"},
1200
+ "note": "Web search capability — get key from api.search.brave.com"
1201
+ }
1202
+ }
1203
+ ```
1204
+
1205
+ **How to add an MCP server to settings.json:**
1206
+
1207
+ 1. Read the existing `.claude/settings.json` (project-level) — create it if it doesn't exist
1208
+ 2. Parse as JSON
1209
+ 3. Add to the `mcpServers` key (create if missing)
1210
+ 4. For servers that need env vars:
1211
+ - Check if the env var is already set in `.env.local`, `.env`, or the shell environment
1212
+ - If found, use the value
1213
+ - If not found, add the server config with a placeholder and note to the user
1214
+ 5. Write back the JSON (preserve existing settings, only add new MCP servers)
1215
+
1216
+ **CRITICAL**: Never overwrite existing MCP server configs. Only ADD new ones. If a server
1217
+ with the same key already exists, skip it and note "already configured."
1218
+
1219
+ **Also check for Claude Code plugins** (different from MCP servers):
1220
+ - If Slack integration detected → suggest enabling `slack@claude-plugins-official` in `enabledPlugins`
1221
+
1222
+ #### 4.2: Install Toolkit Categories
1223
+
1224
+ Run `install.sh` with the right categories:
1225
+
1226
+ ```bash
1227
+ ~/.claude-agents/install.sh --categories {comma-separated-categories} {project_dir}
1228
+ ```
1229
+
1230
+ If toolkit is already installed, run a sync instead:
1231
+ ```bash
1232
+ ~/.claude-agents/install.sh {project_dir}
1233
+ ```
1234
+
1235
+ If specific categories need to be added to an existing install:
1236
+ 1. Read `.claude/.claude-agents.conf` to get current categories
1237
+ 2. Merge new categories with existing ones
1238
+ 3. Run `install.sh --categories {merged-categories} {project_dir}`
1239
+
1240
+ #### 4.3: Create Custom Agents
1241
+
1242
+ For each recommended custom agent, generate a project-specific agent file.
1243
+
1244
+ **Template for custom agents:**
1245
+
1246
+ ```markdown
1247
+ ---
1248
+ name: {agent-name}
1249
+ description: {what it does for this specific project}
1250
+ tools: Read, Edit, Write, Bash, Grep, Glob
1251
+ model: sonnet
1252
+ ---
1253
+
1254
+ # {Agent Title}
1255
+
1256
+ {Description of what this agent specializes in for this project.}
1257
+
1258
+ ## Project Context Discovery
1259
+
1260
+ Before starting work:
1261
+ 1. Read `CLAUDE.md` for project overview and tech stack
1262
+ 2. Read `.claude/project-profile.md` for architecture patterns and conventions
1263
+ 3. Read `.claude/knowledge/shared/conventions.md` for coding rules
1264
+ 4. Read `.claude/knowledge/shared/domain.md` for business rules
1265
+ 5. Read `.claude/knowledge/agents/{my-name}.md` if it exists for past learning
1266
+
1267
+ ## {Domain-Specific Section}
1268
+
1269
+ {Project-specific instructions derived from the deep scan.
1270
+ Include actual patterns found in the codebase, naming conventions,
1271
+ file locations, and how this agent should write code that fits.}
1272
+
1273
+ ## Conventions (MUST FOLLOW)
1274
+
1275
+ {Extracted from project-profile.md — naming, imports, error handling, etc.
1276
+ Be specific: "Use snake_case for all Python functions" not "follow conventions."}
1277
+
1278
+ ## Examples from This Project
1279
+
1280
+ {Include 1-2 actual code snippets from the project that show the pattern
1281
+ this agent should follow. Extracted during the deep scan.}
1282
+ ```
1283
+
1284
+ Write custom agents as **regular files** (not symlinks) in `.claude/agents/`. The triage
1285
+ router auto-discovers them.
1286
+
1287
+ #### 4.4: Create Custom Skills
1288
+
1289
+ For each recommended custom skill, generate a project-specific skill.
1290
+
1291
+ Create as a directory in `.claude/skills/{skill-name}/SKILL.md` — regular directory (not symlink).
1292
+ The triage router auto-discovers them.
1293
+
1294
+ **Each custom skill should:**
1295
+ - Reference the project's actual commands (from CLAUDE.md)
1296
+ - Use the project's conventions (from project-profile.md)
1297
+ - Chain to existing toolkit skills where possible
1298
+
1299
+ #### 4.5: Update CLAUDE.md
1300
+
1301
+ If the deep scan found information that should be in CLAUDE.md but isn't:
1302
+ - Add missing Domain section content
1303
+ - Add missing Key Architecture descriptions
1304
+ - Add any custom commands or workflows discovered
1305
+ - **NEVER overwrite sections the user has already filled in**
1306
+
1307
+ #### 4.6: Configure Recommended Workflows
1308
+
1309
+ If the project would benefit from specific workflow chains, document them in the
1310
+ project profile under "Recommended Workflows" so the triage router and `/onboard`
1311
+ can reference them.
1312
+
1313
+ ### Phase 5: Verify & Report
1314
+
1315
+ After installation, verify everything:
1316
+
1317
+ 1. Check MCP servers were added to settings.json correctly
1318
+ 2. Check toolkit categories are installed (symlinks exist)
1319
+ 3. Check custom agents/skills are in place
1320
+ 4. Check project-profile.md was written
1321
+ 5. Verify CLAUDE.md has no remaining `<!-- TODO -->` in critical sections
1322
+
1323
+ **Final report:**
1324
+
1325
+ ```
1326
+ Calibration Complete
1327
+ ====================
1328
+
1329
+ Project Profile: .claude/project-profile.md ✓
1330
+ Knowledge Base: .claude/knowledge/ ✓ (seeded with {N} entries across {M} partitions)
1331
+
1332
+ Installed:
1333
+ ✓ MCP Servers: postgres, redis, linear (3 added to .claude/settings.json)
1334
+ ✓ Toolkit: core, development, quality, hooks, guardrails (5 categories)
1335
+ ✓ Custom Agents: django-management.md, celery-worker.md (2 created)
1336
+ ✓ Custom Skills: migrate/SKILL.md (1 created)
1337
+ ✓ Plugins: Slack enabled
1338
+ ✓ External sources: Notion wiki, Linear issues, Slack #eng (3 connected)
1339
+
1340
+ Knowledge Base Seeded:
1341
+ shared/conventions — {N} coding rules extracted from codebase
1342
+ shared/domain — {N} business rules from models + validators
1343
+ shared/vocabulary — {N} term mappings from code vs UI
1344
+ shared/patterns — {N} architecture patterns from source analysis
1345
+ external/sources — {N} team knowledge sources connected
1346
+
1347
+ Needs attention:
1348
+ ⚠ postgres MCP needs DATABASE_URL — set in .env.local
1349
+ ⚠ linear MCP needs LINEAR_API_KEY — set in .env.local
1350
+ ⚠ CLAUDE.md Domain section still has placeholders
1351
+
1352
+ Your daily workflow:
1353
+ /onboard → /planning <feature> → /implement <feature> → /qa → /pr
1354
+
1355
+ The knowledge base will grow as you use the toolkit. Agents learn from your
1356
+ corrections and contribute back what they discover. Run /calibrate rescan
1357
+ after major changes, or /calibrate status to check health.
1358
+ ```
1359
+
1360
+ ### Phase 6: Initialize Project Knowledge Base
1361
+
1362
+ The knowledge base is the toolkit's long-term memory for this project. Every agent and skill
1363
+ reads from it AND writes to it. It replaces the simpler "learning log" concept with a proper
1364
+ partitioned knowledge system.
1365
+
1366
+ #### 6.1: Knowledge Base Structure
1367
+
1368
+ Create the full directory structure:
1369
+
1370
+ ```
1371
+ .claude/knowledge/
1372
+ ├── README.md ← How the knowledge base works (for humans)
1373
+ ├── shared/ ← ALL agents and skills read this partition
1374
+ │ ├── conventions.md ← Coding conventions learned from corrections
1375
+ │ ├── domain.md ← Domain knowledge accumulated over time
1376
+ │ ├── patterns.md ← Architecture patterns and when to use them
1377
+ │ ├── vocabulary.md ← Project-specific terms, abbreviations, mappings
1378
+ │ └── decisions.md ← Key decisions made and why (lightweight ADRs)
1379
+ ├── agents/ ← Per-agent knowledge (agent reads its own + shared/)
1380
+ │ ├── frontend.md ← Frontend agent's accumulated learning
1381
+ │ ├── python-backend.md ← Backend agent's learning
1382
+ │ ├── qa.md ← QA agent's test patterns, failure patterns
1383
+ │ ├── sre.md ← SRE agent's deploy patterns, incident history
1384
+ │ └── {agent-name}.md ← Created on first use by each agent
1385
+ ├── skills/ ← Per-skill knowledge (skill reads its own + shared/)
1386
+ │ ├── planning.md ← What planning has learned about this project
1387
+ │ ├── implement.md ← Implementation patterns that worked
1388
+ │ ├── qa.md ← Test strategies, coverage gaps found
1389
+ │ └── {skill-name}.md ← Created on first use by each skill
1390
+ ├── workflows/ ← Learned workflow patterns
1391
+ │ └── effective.md ← Which workflow sequences work best for this project
1392
+ ├── external/ ← Pointers to external knowledge sources
1393
+ │ └── sources.md ← Links to wikis, Notion, Confluence, Linear, etc.
1394
+ └── meta/ ← Knowledge base metadata
1395
+ ├── change-detection.md ← File hashes for drift detection
1396
+ └── stats.md ← Usage stats, entry counts, staleness tracking
1397
+ ```
1398
+
1399
+ #### 6.2: Shared Knowledge Files
1400
+
1401
+ **`.claude/knowledge/shared/conventions.md`:**
1402
+ ```markdown
1403
+ # Coding Conventions
1404
+ <!-- Learned from user corrections and code analysis. All agents read this. -->
1405
+ <!-- Updated by: any agent that observes a user correction -->
1406
+ <!-- Last updated: {date} -->
1407
+
1408
+ ## Source: /calibrate deep scan ({date})
1409
+ {Conventions extracted during calibration — seeded from project-profile.md}
1410
+
1411
+ ## Learned from Use
1412
+ <!-- Entries below are added automatically when agents observe corrections -->
1413
+
1414
+ ### {date} — {convention name}
1415
+ **What happened**: {agent wrote X, user changed it to Y}
1416
+ **Rule**: {the convention to follow going forward}
1417
+ **Applies to**: {which files/patterns this affects}
1418
+ ```
1419
+
1420
+ **`.claude/knowledge/shared/domain.md`:**
1421
+ ```markdown
1422
+ # Domain Knowledge
1423
+ <!-- Business rules, entity relationships, invariants. All agents read this. -->
1424
+ <!-- Updated by: qa-domain, planning, implement, or any agent that learns domain rules -->
1425
+
1426
+ ## Source: /calibrate deep scan ({date})
1427
+ {Domain model extracted during calibration — seeded from project-profile.md}
1428
+
1429
+ ## Learned from Use
1430
+ <!-- Entries below are added when agents discover domain rules not in code -->
1431
+ ```
1432
+
1433
+ **`.claude/knowledge/shared/vocabulary.md`:**
1434
+ ```markdown
1435
+ # Project Vocabulary
1436
+ <!-- What the team calls things. Agents use these terms in communication. -->
1437
+
1438
+ ## Source: /calibrate deep scan ({date})
1439
+ | Code Term | UI Term | Team Shorthand | Meaning |
1440
+ |-----------|---------|----------------|---------|
1441
+ {Initial mappings from domain scan}
1442
+
1443
+ ## Learned from Use
1444
+ <!-- Added when users refer to things by names not in code -->
1445
+ ```
1446
+
1447
+ **`.claude/knowledge/shared/patterns.md`:**
1448
+ ```markdown
1449
+ # Architecture Patterns
1450
+ <!-- How to write code that fits this project. All code-writing agents read this. -->
1451
+
1452
+ ## Source: /calibrate deep scan ({date})
1453
+ {Patterns extracted from codebase — how routes are structured, how services work, etc.}
1454
+
1455
+ ## Learned from Use
1456
+ <!-- Added when agents discover new patterns or user teaches better approaches -->
1457
+ ```
1458
+
1459
+ **`.claude/knowledge/shared/decisions.md`:**
1460
+ ```markdown
1461
+ # Key Decisions
1462
+ <!-- Lightweight ADRs — decisions made during sessions with rationale. -->
1463
+ <!-- Prevents future agents from re-asking or contradicting past decisions. -->
1464
+
1465
+ ## Decisions
1466
+ <!-- Format: ### {date} — {title}
1467
+ **Decision**: {what was decided}
1468
+ **Why**: {rationale}
1469
+ **Context**: {what prompted it}
1470
+ **Alternatives considered**: {what else was discussed} -->
1471
+ ```
1472
+
1473
+ #### 6.3: Agent Knowledge Protocol
1474
+
1475
+ Every agent should follow this read/write protocol:
1476
+
1477
+ **On session start (READ):**
1478
+ ```
1479
+ 1. Read .claude/knowledge/shared/conventions.md → know the coding rules
1480
+ 2. Read .claude/knowledge/shared/domain.md → know the business rules
1481
+ 3. Read .claude/knowledge/shared/vocabulary.md → know the terminology
1482
+ 4. Read .claude/knowledge/shared/patterns.md → know the architecture patterns
1483
+ 5. Read .claude/knowledge/agents/{my-name}.md → know my own past learning
1484
+ (if it exists — skip on first use)
1485
+ ```
1486
+
1487
+ **During session (WRITE — when learning happens):**
1488
+ ```
1489
+ When you observe any of these, write to the appropriate knowledge file:
1490
+
1491
+ 1. User corrects your code style/pattern → append to shared/conventions.md
1492
+ 2. User teaches a domain rule not in code → append to shared/domain.md
1493
+ 3. User uses a term/abbreviation you didn't know → append to shared/vocabulary.md
1494
+ 4. You discover an architecture pattern from reading code → append to shared/patterns.md
1495
+ 5. A decision is made about approach/architecture → append to shared/decisions.md
1496
+ 6. You learn something specific to your domain → append to agents/{my-name}.md
1497
+ ```
1498
+
1499
+ **Write format for new entries:**
1500
+ ```markdown
1501
+ ### {date} — {title}
1502
+ **Source**: {agent/skill name}, session context
1503
+ **What was learned**: {the knowledge}
1504
+ **How to apply**: {when this matters for future work}
1505
+ ```
1506
+
1507
+ #### 6.4: Skill Knowledge Protocol
1508
+
1509
+ Skills that orchestrate work should also read/write:
1510
+
1511
+ **`/planning` writes to:** `skills/planning.md` — what worked, what the team preferred
1512
+ **`/implement` writes to:** `skills/implement.md` — implementation patterns, agent coordination
1513
+ **`/qa` writes to:** `skills/qa.md` — test strategies, common failure patterns, coverage gaps
1514
+ **`/pr` writes to:** `skills/qa.md` — review feedback patterns
1515
+ **`/sre` writes to:** `agents/sre.md` — deploy patterns, incident responses
1516
+
1517
+ #### 6.5: External Knowledge Sources
1518
+
1519
+ **`.claude/knowledge/external/sources.md`:**
1520
+ ```markdown
1521
+ # External Knowledge Sources
1522
+ <!-- Pointers to where knowledge lives outside this repo -->
1523
+
1524
+ ## Connected Sources
1525
+ | Source | Type | URL/Location | What's There | How to Access |
1526
+ |--------|------|-------------|-------------|--------------|
1527
+ | {e.g., Notion} | Wiki | {URL} | Architecture docs, PRDs | Notion MCP server |
1528
+ | {e.g., Linear} | Issue tracker | {project URL} | Bug reports, feature requests | Linear MCP or `gh` |
1529
+ | {e.g., Confluence} | Docs | {URL} | Engineering standards | Web fetch |
1530
+ | {e.g., Figma} | Design | {URL} | UI designs, component specs | Figma MCP server |
1531
+ | {e.g., Slack #eng} | Discussion | {channel} | Real-time decisions | Slack plugin |
1532
+
1533
+ ## How Agents Should Use External Sources
1534
+ - **Before planning a feature**: Check Linear/Jira for existing issues and context
1535
+ - **Before designing UI**: Check Figma for existing design system and components
1536
+ - **Before making architecture decisions**: Check wiki/Confluence for existing ADRs
1537
+ - **When domain questions arise**: Check wiki for business rule documentation
1538
+ ```
1539
+
1540
+ During calibration, ask the user:
1541
+ ```
1542
+ Where does your team keep knowledge outside the code?
1543
+ - Issue tracker: [Linear / Jira / GitHub Issues / none]
1544
+ - Documentation: [Notion / Confluence / GitBook / docs/ folder / none]
1545
+ - Design: [Figma / Sketch / none]
1546
+ - Communication: [Slack / Discord / Teams / none]
1547
+ - Other: [any other tools?]
1548
+ ```
1549
+
1550
+ For each answer, add to `external/sources.md` AND recommend the corresponding MCP server
1551
+ if available. This is how MCP server recommendations connect to the knowledge system.
1552
+
1553
+ #### 6.6: Change Detection
1554
+
1555
+ **`.claude/knowledge/meta/change-detection.md`:**
1556
+ ```markdown
1557
+ # Change Detection
1558
+ <!-- File hashes for drift detection. Session bootstrap hook checks these. -->
1559
+ <!-- When a hash changes → suggest /calibrate rescan -->
1560
+
1561
+ | File | Hash (sha256 first 8) | Last Checked | Status |
1562
+ |------|----------------------|-------------|--------|
1563
+ | package.json | {hash} | {date} | current |
1564
+ | requirements.txt | {hash} | {date} | current |
1565
+ | pyproject.toml | {hash} | {date} | current |
1566
+ | docker-compose.yml | {hash} | {date} | current |
1567
+ | .env.example | {hash} | {date} | current |
1568
+ | prisma/schema.prisma | {hash} | {date} | current |
1569
+ | alembic/versions/ (count) | {count} | {date} | current |
1570
+ | CLAUDE.md | {hash} | {date} | current |
1571
+ ```
1572
+
1573
+ Generate hashes during calibration:
1574
+ ```bash
1575
+ sha256sum {file} 2>/dev/null | cut -c1-8
1576
+ ```
1577
+
1578
+ The session bootstrap hook (`session-bootstrap.sh`) should check these hashes on session
1579
+ start and inject a warning if any have changed:
1580
+ ```
1581
+ ⚠ requirements.txt changed since last calibration — run /calibrate rescan
1582
+ ```
1583
+
1584
+ #### 6.7: Knowledge Base Stats
1585
+
1586
+ **`.claude/knowledge/meta/stats.md`:**
1587
+ ```markdown
1588
+ # Knowledge Base Stats
1589
+ <!-- Auto-updated. Shows health of the knowledge system. -->
1590
+
1591
+ | Partition | Entries | Last Updated | Staleness |
1592
+ |-----------|---------|-------------|-----------|
1593
+ | shared/conventions | {N} | {date} | {fresh/stale} |
1594
+ | shared/domain | {N} | {date} | {fresh/stale} |
1595
+ | shared/vocabulary | {N} | {date} | {fresh/stale} |
1596
+ | shared/patterns | {N} | {date} | {fresh/stale} |
1597
+ | shared/decisions | {N} | {date} | {fresh/stale} |
1598
+ | agents/* | {N total} | {date} | {fresh/stale} |
1599
+ | skills/* | {N total} | {date} | {fresh/stale} |
1600
+ | workflows/effective | {N} | {date} | {fresh/stale} |
1601
+
1602
+ Total entries: {N}
1603
+ Last calibration: {date}
1604
+ Sessions since calibration: {N}
1605
+ ```
1606
+
1607
+ #### 6.8: Knowledge Base README
1608
+
1609
+ **`.claude/knowledge/README.md`:**
1610
+ ```markdown
1611
+ # Project Knowledge Base
1612
+
1613
+ This directory is the toolkit's long-term memory for this project. It was
1614
+ initialized by `/calibrate` and grows as agents and skills learn from use.
1615
+
1616
+ ## How it works
1617
+
1618
+ - **shared/** — Knowledge ALL agents read. Coding conventions, domain rules,
1619
+ architecture patterns, vocabulary. Updated when users correct agent output.
1620
+ - **agents/** — Per-agent learning. Each agent reads its own file for past
1621
+ context. Written when an agent discovers something specific to its domain.
1622
+ - **skills/** — Per-skill learning. Written when a skill discovers what
1623
+ approaches work best for this project.
1624
+ - **workflows/** — Which skill/agent sequences work best. Updated over time.
1625
+ - **external/** — Pointers to where knowledge lives outside the code
1626
+ (Notion, Linear, Figma, Slack, etc.)
1627
+ - **meta/** — Change detection hashes and usage stats.
1628
+
1629
+ ## For humans
1630
+
1631
+ You can read and edit any file here. If you notice an agent consistently
1632
+ getting something wrong, add a correction to `shared/conventions.md` and
1633
+ it will be picked up in the next session.
1634
+
1635
+ To reset: delete this directory and run `/calibrate` again.
1636
+ To prune: run `/calibrate status` to see what's stale, then delete old entries.
1637
+ ```
1638
+
1639
+ ---
1640
+
1641
+ ## `/calibrate rescan` — Update Existing Profile
1642
+
1643
+ When running as rescan:
1644
+
1645
+ 1. Read existing `.claude/project-profile.md`
1646
+ 2. Re-run the deep scan (Phase 1)
1647
+ 3. Diff the old profile with new findings
1648
+ 4. Present ONLY what changed:
1649
+ ```
1650
+ Rescan Results
1651
+ ==============
1652
+
1653
+ Changed:
1654
+ ✦ New dependency: celery added to requirements.txt
1655
+ ✦ Architecture: new background worker pattern detected (backend/workers/)
1656
+ ✦ Testing: E2E tests added (playwright.config.ts found)
1657
+
1658
+ New recommendations:
1659
+ ✦ MCP Server: Redis (celery broker) — not currently configured
1660
+ ✦ Agent: celery-worker agent for task scaffolding
1661
+ ✦ Skill: /qa full now includes E2E (Playwright detected)
1662
+
1663
+ No changes:
1664
+ ✦ Coding conventions unchanged
1665
+ ✦ Domain model unchanged
1666
+ ✦ Existing MCP servers still valid
1667
+
1668
+ Update project-profile.md and install changes? [yes/no/pick]
1669
+ ```
1670
+ 5. Install changes based on user choice
1671
+ 6. Update file hashes in `.claude/knowledge/meta/change-detection.md`
1672
+ 7. Refresh the "Source: /calibrate" sections in knowledge base files (preserve "Learned from Use" sections)
1673
+ 8. Update `.claude/knowledge/meta/stats.md` with new counts
1674
+
1675
+ ---
1676
+
1677
+ ## `/calibrate status` — Current State
1678
+
1679
+ Show what's calibrated:
1680
+
1681
+ ```
1682
+ Calibration Status
1683
+ ==================
1684
+
1685
+ Last calibrated: 2026-03-20 (5 days ago)
1686
+ Profile: .claude/project-profile.md ✓
1687
+
1688
+ MCP Servers (3 configured):
1689
+ ✓ postgres — connected
1690
+ ✓ redis — connected
1691
+ ✓ discord-mcp — connected
1692
+
1693
+ Toolkit (5 categories installed):
1694
+ ✓ core, development, quality, hooks, guardrails
1695
+
1696
+ Custom (3 project-specific):
1697
+ ✓ agents/django-management.md
1698
+ ✓ agents/celery-worker.md
1699
+ ✓ skills/migrate/SKILL.md
1700
+
1701
+ Knowledge Base (.claude/knowledge/):
1702
+ shared/conventions — 12 entries (last updated 2 days ago) ✓
1703
+ shared/domain — 8 entries (last updated 3 days ago) ✓
1704
+ shared/vocabulary — 5 entries (last updated 1 day ago) ✓
1705
+ shared/patterns — 6 entries (seeded, no updates yet) ⚠
1706
+ shared/decisions — 3 entries (last updated 4 days ago) ✓
1707
+ agents/* — 4 agents have learning (frontend, python-backend, qa, sre)
1708
+ skills/* — 2 skills have learning (planning, implement)
1709
+ workflows/effective — 2 workflow patterns recorded
1710
+ external/sources — 3 sources connected (Notion, Linear, Slack)
1711
+
1712
+ Change Detection:
1713
+ ✓ package.json — unchanged
1714
+ ⚠ requirements.txt — CHANGED since last calibration
1715
+ ✓ docker-compose.yml — unchanged
1716
+
1717
+ Recommendation: Run /calibrate rescan — requirements.txt has changed.
1718
+ ```
1719
+
1720
+ ---
1721
+
1722
+ ## Agent & Skill Context Loading Protocol
1723
+
1724
+ **IMPORTANT**: After calibrating, all agents and skills automatically load project knowledge.
1725
+
1726
+ The CLAUDE.md managed block (injected by install.sh) should include these lines so every
1727
+ agent discovers the knowledge system through their standard "Read CLAUDE.md" step:
1728
+
1729
+ ```
1730
+ ## Project Knowledge (auto-populated by /calibrate)
1731
+
1732
+ If `.claude/project-profile.md` exists, read it for deep project context
1733
+ (architecture patterns, coding conventions, domain model, testing style).
1734
+
1735
+ If `.claude/knowledge/` exists, this project has a knowledge base:
1736
+ - Read `.claude/knowledge/shared/conventions.md` before writing any code
1737
+ - Read `.claude/knowledge/shared/domain.md` before making domain decisions
1738
+ - Read `.claude/knowledge/shared/vocabulary.md` to use correct terminology
1739
+ - Read `.claude/knowledge/agents/{your-agent-name}.md` for your past learning
1740
+ - Write to knowledge files when you learn something new (see knowledge/README.md)
1741
+ ```
1742
+
1743
+ This means agents automatically pick up the profile AND knowledge base without needing
1744
+ individual agent file edits. The managed block acts as the discovery mechanism.
1745
+
1746
+ ### What Agents Write Back
1747
+
1748
+ When an agent observes a correction or learns something new during a session, it should
1749
+ append to the appropriate knowledge file. This is how the knowledge base grows organically:
1750
+
1751
+ | Observation | Write To |
1752
+ |-------------|----------|
1753
+ | User renames a variable you created | `shared/conventions.md` — naming rule |
1754
+ | User changes your error handling approach | `shared/conventions.md` — error handling rule |
1755
+ | User explains a business rule not in code | `shared/domain.md` — new domain rule |
1756
+ | User refers to something by a shorthand | `shared/vocabulary.md` — new term |
1757
+ | You discover a code pattern by reading code | `shared/patterns.md` — new pattern |
1758
+ | Team decides on an approach during planning | `shared/decisions.md` — new ADR |
1759
+ | You learn something domain-specific to your role | `agents/{your-name}.md` — agent learning |
1760
+ | A workflow sequence worked particularly well | `workflows/effective.md` — workflow pattern |
1761
+
1762
+ ### Knowledge Base Hygiene
1763
+
1764
+ - Entries older than 90 days without being referenced should be reviewed for staleness
1765
+ - `/calibrate rescan` refreshes the "Source: /calibrate" sections but preserves "Learned from Use" entries
1766
+ - Contradictions between calibrate-seeded knowledge and learned-from-use entries should be resolved in favor of the learned entry (it's more recent and was validated by the user)
1767
+ - `/calibrate status` shows knowledge base health including entry counts and staleness
1768
+
1769
+ ---
1770
+
1771
+ ## MCP Server Verification
1772
+
1773
+ After adding MCP servers to settings.json, the user needs to restart Claude Code for them
1774
+ to take effect. Always remind:
1775
+
1776
+ ```
1777
+ MCP servers added to .claude/settings.json. Restart Claude Code to activate them.
1778
+ After restart, run /mcp to verify they're connected.
1779
+ ```
1780
+
1781
+ ---
1782
+
1783
+ ## Rules
1784
+
1785
+ - **Never overwrite user-customized files** — check for symlinks vs regular files before touching
1786
+ - **Never remove existing MCP servers** — only add new ones
1787
+ - **Never remove existing toolkit categories** — only add new ones
1788
+ - **Always present recommendations before installing** — user must approve
1789
+ - **Always verify after installing** — don't report success until confirmed
1790
+ - **Custom agents/skills are regular files** — never symlink them (they're project-specific)
1791
+ - **Profile must be re-readable** — agents parse it every session, so keep format consistent
1792
+ - **Hash key files** — so `/calibrate status` can detect drift without re-scanning
1793
+ - **Rescan is incremental** — show what changed, don't re-present everything
1794
+ - **MCP server credentials** — never store real credentials in settings.json recommendations;
1795
+ use env var references and instruct the user to set values in `.env.local`
1796
+ - **Read ALL agent/skill definitions** — never use a static list; always read the actual files
1797
+ in `~/.claude-agents/agents/` and `~/.claude-agents/skills/*/SKILL.md` to build recommendations
1798
+ - **Knowledge base is append-only during sessions** — agents add entries, never delete them.
1799
+ Only `/calibrate rescan` and manual user edits may remove entries
1800
+ - **Knowledge partitions are strict** — shared/ is for everyone, agents/{name}.md is for that
1801
+ agent only. Never cross-write (e.g., frontend agent writing to agents/backend.md)
1802
+ - **Seed knowledge from scan, grow from use** — calibration seeds the initial knowledge base
1803
+ entries from the deep scan. All subsequent entries come from agent/skill observations during
1804
+ real sessions. The seed is the floor, not the ceiling
1805
+ - **External sources need MCP** — when the user points to an external knowledge source
1806
+ (Notion, Linear, Figma), always check if a corresponding MCP server can bridge it. If yes,
1807
+ recommend installing it so agents can query the source directly