@winspan/claude-forge 9.2.0 → 9.12.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 (591) hide show
  1. package/DEVELOPMENT.md +80 -19
  2. package/README.md +13 -6
  3. package/dist/catalogs/agents.json +19 -24
  4. package/dist/catalogs/skills.json +139 -27
  5. package/dist/claudemd/templates/swarm-protocol.md +1 -1
  6. package/dist/cli/commands/agent.d.ts +169 -0
  7. package/dist/cli/commands/agent.d.ts.map +1 -0
  8. package/dist/cli/commands/agent.js +690 -0
  9. package/dist/cli/commands/agent.js.map +1 -0
  10. package/dist/cli/commands/codegraph.d.ts +17 -0
  11. package/dist/cli/commands/codegraph.d.ts.map +1 -0
  12. package/dist/cli/commands/codegraph.js +263 -0
  13. package/dist/cli/commands/codegraph.js.map +1 -0
  14. package/dist/cli/commands/decisions.d.ts.map +1 -1
  15. package/dist/cli/commands/decisions.js +46 -9
  16. package/dist/cli/commands/decisions.js.map +1 -1
  17. package/dist/cli/commands/executions.d.ts.map +1 -1
  18. package/dist/cli/commands/executions.js +2 -1
  19. package/dist/cli/commands/executions.js.map +1 -1
  20. package/dist/cli/commands/insights-goal-check.d.ts +5 -1
  21. package/dist/cli/commands/insights-goal-check.d.ts.map +1 -1
  22. package/dist/cli/commands/insights-goal-check.js +15 -15
  23. package/dist/cli/commands/insights-goal-check.js.map +1 -1
  24. package/dist/cli/commands/knowledge.d.ts +51 -0
  25. package/dist/cli/commands/knowledge.d.ts.map +1 -1
  26. package/dist/cli/commands/knowledge.js +202 -29
  27. package/dist/cli/commands/knowledge.js.map +1 -1
  28. package/dist/cli/commands/loop.d.ts +95 -0
  29. package/dist/cli/commands/loop.d.ts.map +1 -0
  30. package/dist/cli/commands/loop.js +408 -0
  31. package/dist/cli/commands/loop.js.map +1 -0
  32. package/dist/cli/commands/maintenance.d.ts +33 -0
  33. package/dist/cli/commands/maintenance.d.ts.map +1 -0
  34. package/dist/cli/commands/maintenance.js +75 -0
  35. package/dist/cli/commands/maintenance.js.map +1 -0
  36. package/dist/cli/commands/mcp.d.ts +23 -0
  37. package/dist/cli/commands/mcp.d.ts.map +1 -1
  38. package/dist/cli/commands/mcp.js +82 -0
  39. package/dist/cli/commands/mcp.js.map +1 -1
  40. package/dist/cli/commands/skills.d.ts +131 -0
  41. package/dist/cli/commands/skills.d.ts.map +1 -1
  42. package/dist/cli/commands/skills.js +409 -9
  43. package/dist/cli/commands/skills.js.map +1 -1
  44. package/dist/cli/commands/stats.d.ts.map +1 -1
  45. package/dist/cli/commands/stats.js +9 -2
  46. package/dist/cli/commands/stats.js.map +1 -1
  47. package/dist/cli/index.js +8 -0
  48. package/dist/cli/index.js.map +1 -1
  49. package/dist/core/constants.d.ts +37 -0
  50. package/dist/core/constants.d.ts.map +1 -1
  51. package/dist/core/constants.js +43 -0
  52. package/dist/core/constants.js.map +1 -1
  53. package/dist/core/diagnostics/checks.d.ts.map +1 -1
  54. package/dist/core/diagnostics/checks.js +2 -1
  55. package/dist/core/diagnostics/checks.js.map +1 -1
  56. package/dist/core/diagnostics/daemon-status.d.ts +1 -1
  57. package/dist/core/diagnostics/daemon-status.d.ts.map +1 -1
  58. package/dist/core/diagnostics/daemon-status.js +1 -1
  59. package/dist/core/diagnostics/daemon-status.js.map +1 -1
  60. package/dist/core/diagnostics/entropy-checks.d.ts +3 -2
  61. package/dist/core/diagnostics/entropy-checks.d.ts.map +1 -1
  62. package/dist/core/diagnostics/entropy-checks.js +10 -5
  63. package/dist/core/diagnostics/entropy-checks.js.map +1 -1
  64. package/dist/core/diagnostics/heartbeat-reader.d.ts +28 -0
  65. package/dist/core/diagnostics/heartbeat-reader.d.ts.map +1 -0
  66. package/dist/core/diagnostics/heartbeat-reader.js +50 -0
  67. package/dist/core/diagnostics/heartbeat-reader.js.map +1 -0
  68. package/dist/core/event-fields.d.ts +27 -0
  69. package/dist/core/event-fields.d.ts.map +1 -1
  70. package/dist/core/event-fields.js +43 -0
  71. package/dist/core/event-fields.js.map +1 -1
  72. package/dist/core/governance/global-inject.d.ts +34 -4
  73. package/dist/core/governance/global-inject.d.ts.map +1 -1
  74. package/dist/core/governance/global-inject.js +80 -25
  75. package/dist/core/governance/global-inject.js.map +1 -1
  76. package/dist/core/insights/agent-anchor-guard.d.ts +77 -0
  77. package/dist/core/insights/agent-anchor-guard.d.ts.map +1 -0
  78. package/dist/core/insights/agent-anchor-guard.js +119 -0
  79. package/dist/core/insights/agent-anchor-guard.js.map +1 -0
  80. package/dist/core/insights/agent-distill-context.d.ts +55 -0
  81. package/dist/core/insights/agent-distill-context.d.ts.map +1 -0
  82. package/dist/core/insights/agent-distill-context.js +146 -0
  83. package/dist/core/insights/agent-distill-context.js.map +1 -0
  84. package/dist/core/insights/agent-distill-spawn.d.ts +56 -0
  85. package/dist/core/insights/agent-distill-spawn.d.ts.map +1 -0
  86. package/dist/core/insights/agent-distill-spawn.js +179 -0
  87. package/dist/core/insights/agent-distill-spawn.js.map +1 -0
  88. package/dist/core/insights/agent-drift.d.ts +66 -0
  89. package/dist/core/insights/agent-drift.d.ts.map +1 -0
  90. package/dist/core/insights/agent-drift.js +109 -0
  91. package/dist/core/insights/agent-drift.js.map +1 -0
  92. package/dist/core/insights/agent-evolution-sources.d.ts +21 -0
  93. package/dist/core/insights/agent-evolution-sources.d.ts.map +1 -0
  94. package/dist/core/insights/agent-evolution-sources.js +36 -0
  95. package/dist/core/insights/agent-evolution-sources.js.map +1 -0
  96. package/dist/core/insights/agent-health.d.ts +142 -0
  97. package/dist/core/insights/agent-health.d.ts.map +1 -0
  98. package/dist/core/insights/agent-health.js +296 -0
  99. package/dist/core/insights/agent-health.js.map +1 -0
  100. package/dist/core/insights/agent-patch-apply.d.ts +45 -0
  101. package/dist/core/insights/agent-patch-apply.d.ts.map +1 -0
  102. package/dist/core/insights/agent-patch-apply.js +165 -0
  103. package/dist/core/insights/agent-patch-apply.js.map +1 -0
  104. package/dist/core/insights/agent-suggest.d.ts +128 -0
  105. package/dist/core/insights/agent-suggest.d.ts.map +1 -0
  106. package/dist/core/insights/agent-suggest.js +284 -0
  107. package/dist/core/insights/agent-suggest.js.map +1 -0
  108. package/dist/core/insights/coverage-tiers.d.ts +46 -0
  109. package/dist/core/insights/coverage-tiers.d.ts.map +1 -0
  110. package/dist/core/insights/coverage-tiers.js +95 -0
  111. package/dist/core/insights/coverage-tiers.js.map +1 -0
  112. package/dist/{daemon/services → core/insights}/experience-extractor.d.ts +0 -7
  113. package/dist/core/insights/experience-extractor.d.ts.map +1 -0
  114. package/dist/{daemon/services → core/insights}/experience-extractor.js +5 -9
  115. package/dist/core/insights/experience-extractor.js.map +1 -0
  116. package/dist/{daemon/services → core/insights}/violation-reporter.d.ts +20 -1
  117. package/dist/core/insights/violation-reporter.d.ts.map +1 -0
  118. package/dist/{daemon/services → core/insights}/violation-reporter.js +56 -4
  119. package/dist/core/insights/violation-reporter.js.map +1 -0
  120. package/dist/core/loop/loop-engine.d.ts +140 -0
  121. package/dist/core/loop/loop-engine.d.ts.map +1 -0
  122. package/dist/core/loop/loop-engine.js +266 -0
  123. package/dist/core/loop/loop-engine.js.map +1 -0
  124. package/dist/core/queue/index.d.ts.map +1 -1
  125. package/dist/core/queue/index.js +2 -1
  126. package/dist/core/queue/index.js.map +1 -1
  127. package/dist/core/storage/base.d.ts +159 -0
  128. package/dist/core/storage/base.d.ts.map +1 -1
  129. package/dist/core/storage/base.js +523 -0
  130. package/dist/core/storage/base.js.map +1 -1
  131. package/dist/core/storage/codegraph-types.d.ts +79 -0
  132. package/dist/core/storage/codegraph-types.d.ts.map +1 -0
  133. package/dist/core/storage/codegraph-types.js +14 -0
  134. package/dist/core/storage/codegraph-types.js.map +1 -0
  135. package/dist/core/storage/codegraph.d.ts +186 -0
  136. package/dist/core/storage/codegraph.d.ts.map +1 -0
  137. package/dist/core/storage/codegraph.js +452 -0
  138. package/dist/core/storage/codegraph.js.map +1 -0
  139. package/dist/core/storage/decisions.d.ts +30 -5
  140. package/dist/core/storage/decisions.d.ts.map +1 -1
  141. package/dist/core/storage/decisions.js +45 -13
  142. package/dist/core/storage/decisions.js.map +1 -1
  143. package/dist/core/storage/events.d.ts +127 -0
  144. package/dist/core/storage/events.d.ts.map +1 -1
  145. package/dist/core/storage/events.js +318 -3
  146. package/dist/core/storage/events.js.map +1 -1
  147. package/dist/core/storage/feedback.d.ts +3 -23
  148. package/dist/core/storage/feedback.d.ts.map +1 -1
  149. package/dist/core/storage/feedback.js +37 -38
  150. package/dist/core/storage/feedback.js.map +1 -1
  151. package/dist/core/storage/injections.d.ts +40 -0
  152. package/dist/core/storage/injections.d.ts.map +1 -1
  153. package/dist/core/storage/injections.js +69 -0
  154. package/dist/core/storage/injections.js.map +1 -1
  155. package/dist/core/storage/knowledge.d.ts +226 -0
  156. package/dist/core/storage/knowledge.d.ts.map +1 -1
  157. package/dist/core/storage/knowledge.js +391 -4
  158. package/dist/core/storage/knowledge.js.map +1 -1
  159. package/dist/core/storage/pipeline-rollup.d.ts +1 -7
  160. package/dist/core/storage/pipeline-rollup.d.ts.map +1 -1
  161. package/dist/core/storage/pipeline-rollup.js +18 -57
  162. package/dist/core/storage/pipeline-rollup.js.map +1 -1
  163. package/dist/core/storage/routing.d.ts +34 -0
  164. package/dist/core/storage/routing.d.ts.map +1 -1
  165. package/dist/core/storage/routing.js +92 -2
  166. package/dist/core/storage/routing.js.map +1 -1
  167. package/dist/core/storage/rows.d.ts +5 -25
  168. package/dist/core/storage/rows.d.ts.map +1 -1
  169. package/dist/core/storage/schema.sql +92 -27
  170. package/dist/core/storage/sessions.d.ts.map +1 -1
  171. package/dist/core/storage/sessions.js +2 -1
  172. package/dist/core/storage/sessions.js.map +1 -1
  173. package/dist/core/storage/skills.d.ts +159 -0
  174. package/dist/core/storage/skills.d.ts.map +1 -1
  175. package/dist/core/storage/skills.js +350 -4
  176. package/dist/core/storage/skills.js.map +1 -1
  177. package/dist/core/storage/sqlite.d.ts +81 -25
  178. package/dist/core/storage/sqlite.d.ts.map +1 -1
  179. package/dist/core/storage/sqlite.js +143 -45
  180. package/dist/core/storage/sqlite.js.map +1 -1
  181. package/dist/core/storage/tasks.d.ts +270 -0
  182. package/dist/core/storage/tasks.d.ts.map +1 -1
  183. package/dist/core/storage/tasks.js +495 -16
  184. package/dist/core/storage/tasks.js.map +1 -1
  185. package/dist/core/storage/tool-intercepts.d.ts +1 -1
  186. package/dist/core/storage/tool-intercepts.js +1 -1
  187. package/dist/core/types.d.ts +26 -3
  188. package/dist/core/types.d.ts.map +1 -1
  189. package/dist/core/types.js +1 -3
  190. package/dist/core/types.js.map +1 -1
  191. package/dist/core/utils/binary-paths.d.ts +32 -0
  192. package/dist/core/utils/binary-paths.d.ts.map +1 -1
  193. package/dist/core/utils/binary-paths.js +52 -0
  194. package/dist/core/utils/binary-paths.js.map +1 -1
  195. package/dist/core/utils/claude-cli-resolver.d.ts.map +1 -0
  196. package/dist/{skills/distill → core/utils}/claude-cli-resolver.js +1 -1
  197. package/dist/core/utils/claude-cli-resolver.js.map +1 -0
  198. package/dist/core/utils/claude-cli-spawn.d.ts +1 -1
  199. package/dist/core/utils/claude-cli-spawn.js +2 -2
  200. package/dist/core/utils/claude-cli-spawn.js.map +1 -1
  201. package/dist/core/utils/noise-prompt.d.ts +1 -1
  202. package/dist/core/utils/noise-prompt.js +1 -1
  203. package/dist/core/utils/time.d.ts +26 -0
  204. package/dist/core/utils/time.d.ts.map +1 -1
  205. package/dist/core/utils/time.js +33 -0
  206. package/dist/core/utils/time.js.map +1 -1
  207. package/dist/daemon/config-store.d.ts.map +1 -1
  208. package/dist/daemon/config-store.js +14 -5
  209. package/dist/daemon/config-store.js.map +1 -1
  210. package/dist/daemon/event-parser.d.ts.map +1 -1
  211. package/dist/daemon/event-parser.js +5 -0
  212. package/dist/daemon/event-parser.js.map +1 -1
  213. package/dist/daemon/handlers/post-tool-use.d.ts +24 -16
  214. package/dist/daemon/handlers/post-tool-use.d.ts.map +1 -1
  215. package/dist/daemon/handlers/post-tool-use.js +76 -116
  216. package/dist/daemon/handlers/post-tool-use.js.map +1 -1
  217. package/dist/daemon/handlers/pre-tool-use.d.ts +35 -10
  218. package/dist/daemon/handlers/pre-tool-use.d.ts.map +1 -1
  219. package/dist/daemon/handlers/pre-tool-use.js +71 -38
  220. package/dist/daemon/handlers/pre-tool-use.js.map +1 -1
  221. package/dist/daemon/handlers/stop.d.ts +20 -0
  222. package/dist/daemon/handlers/stop.d.ts.map +1 -1
  223. package/dist/daemon/handlers/stop.js +96 -8
  224. package/dist/daemon/handlers/stop.js.map +1 -1
  225. package/dist/daemon/handlers/user-prompt.d.ts +16 -1
  226. package/dist/daemon/handlers/user-prompt.d.ts.map +1 -1
  227. package/dist/daemon/handlers/user-prompt.js +97 -56
  228. package/dist/daemon/handlers/user-prompt.js.map +1 -1
  229. package/dist/daemon/handlers/violation-content-backfill.d.ts +76 -0
  230. package/dist/daemon/handlers/violation-content-backfill.d.ts.map +1 -0
  231. package/dist/daemon/handlers/violation-content-backfill.js +167 -0
  232. package/dist/daemon/handlers/violation-content-backfill.js.map +1 -0
  233. package/dist/daemon/index.d.ts +19 -0
  234. package/dist/daemon/index.d.ts.map +1 -1
  235. package/dist/daemon/index.js +125 -200
  236. package/dist/daemon/index.js.map +1 -1
  237. package/dist/daemon/rules/defaults.d.ts.map +1 -1
  238. package/dist/daemon/rules/defaults.js +151 -64
  239. package/dist/daemon/rules/defaults.js.map +1 -1
  240. package/dist/daemon/rules/types.d.ts +28 -22
  241. package/dist/daemon/rules/types.d.ts.map +1 -1
  242. package/dist/daemon/rules/workflow-defaults.js +9 -9
  243. package/dist/daemon/rules/workflow-defaults.js.map +1 -1
  244. package/dist/daemon/services/codegraph-sync.d.ts +94 -0
  245. package/dist/daemon/services/codegraph-sync.d.ts.map +1 -0
  246. package/dist/daemon/services/codegraph-sync.js +159 -0
  247. package/dist/daemon/services/codegraph-sync.js.map +1 -0
  248. package/dist/daemon/services/decision-hint.d.ts +47 -10
  249. package/dist/daemon/services/decision-hint.d.ts.map +1 -1
  250. package/dist/daemon/services/decision-hint.js +99 -24
  251. package/dist/daemon/services/decision-hint.js.map +1 -1
  252. package/dist/daemon/services/event-ttl-sweep.d.ts.map +1 -1
  253. package/dist/daemon/services/event-ttl-sweep.js +3 -2
  254. package/dist/daemon/services/event-ttl-sweep.js.map +1 -1
  255. package/dist/daemon/services/feedback-aggregator.d.ts +14 -26
  256. package/dist/daemon/services/feedback-aggregator.d.ts.map +1 -1
  257. package/dist/daemon/services/feedback-aggregator.js +23 -63
  258. package/dist/daemon/services/feedback-aggregator.js.map +1 -1
  259. package/dist/daemon/services/heartbeat-writer.d.ts +6 -15
  260. package/dist/daemon/services/heartbeat-writer.d.ts.map +1 -1
  261. package/dist/daemon/services/heartbeat-writer.js +7 -36
  262. package/dist/daemon/services/heartbeat-writer.js.map +1 -1
  263. package/dist/daemon/services/kb-injector.d.ts +1 -1
  264. package/dist/daemon/services/kb-injector.d.ts.map +1 -1
  265. package/dist/daemon/services/kb-injector.js +10 -2
  266. package/dist/daemon/services/kb-injector.js.map +1 -1
  267. package/dist/daemon/services/kb-rebuild-scheduler.d.ts +95 -0
  268. package/dist/daemon/services/kb-rebuild-scheduler.d.ts.map +1 -0
  269. package/dist/daemon/services/kb-rebuild-scheduler.js +149 -0
  270. package/dist/daemon/services/kb-rebuild-scheduler.js.map +1 -0
  271. package/dist/daemon/services/loop-hint.d.ts +139 -0
  272. package/dist/daemon/services/loop-hint.d.ts.map +1 -0
  273. package/dist/daemon/services/loop-hint.js +272 -0
  274. package/dist/daemon/services/loop-hint.js.map +1 -0
  275. package/dist/daemon/services/outcome-classification-service.js +1 -1
  276. package/dist/daemon/services/outcome-classification-service.js.map +1 -1
  277. package/dist/daemon/services/task-segmenter.d.ts +11 -0
  278. package/dist/daemon/services/task-segmenter.d.ts.map +1 -1
  279. package/dist/daemon/services/task-segmenter.js +48 -2
  280. package/dist/daemon/services/task-segmenter.js.map +1 -1
  281. package/dist/daemon/startup/maintenance-schedulers.d.ts +68 -0
  282. package/dist/daemon/startup/maintenance-schedulers.d.ts.map +1 -0
  283. package/dist/daemon/startup/maintenance-schedulers.js +294 -0
  284. package/dist/daemon/startup/maintenance-schedulers.js.map +1 -0
  285. package/dist/daemon/templates/agents/agent-retro-distiller.md +106 -0
  286. package/dist/daemon/templates/agents/claudemd-writer.md +1 -0
  287. package/dist/daemon/templates/agents/coder.md +165 -8
  288. package/dist/daemon/templates/agents/decision-maker.md +107 -21
  289. package/dist/daemon/templates/agents/doc-reviewer.md +4 -1
  290. package/dist/daemon/templates/agents/harness-debug-full.md +85 -3
  291. package/dist/daemon/templates/agents/knowledge-builder.md +1 -0
  292. package/dist/daemon/templates/agents/patch-applier.md +1 -0
  293. package/dist/daemon/templates/agents/planner.md +55 -3
  294. package/dist/daemon/templates/agents/safety-net-implementer.md +278 -0
  295. package/dist/daemon/templates/agents/skill-distiller.md +1 -0
  296. package/dist/daemon/templates/agents/task-boundary-classifier.md +1 -0
  297. package/dist/daemon/templates/agents/verify-agent.md +128 -5
  298. package/dist/hooks/stop.sh +7 -1
  299. package/dist/knowledge/builder.js +36 -7
  300. package/dist/knowledge/builder.js.map +1 -1
  301. package/dist/knowledge/constants.d.ts +10 -5
  302. package/dist/knowledge/constants.d.ts.map +1 -1
  303. package/dist/knowledge/constants.js +10 -5
  304. package/dist/knowledge/constants.js.map +1 -1
  305. package/dist/knowledge/graph/edge-extractor.d.ts +45 -0
  306. package/dist/knowledge/graph/edge-extractor.d.ts.map +1 -0
  307. package/dist/knowledge/graph/edge-extractor.js +242 -0
  308. package/dist/knowledge/graph/edge-extractor.js.map +1 -0
  309. package/dist/knowledge/graph/impact.d.ts +73 -0
  310. package/dist/knowledge/graph/impact.d.ts.map +1 -0
  311. package/dist/knowledge/graph/impact.js +94 -0
  312. package/dist/knowledge/graph/impact.js.map +1 -0
  313. package/dist/knowledge/graph/types.d.ts +22 -0
  314. package/dist/knowledge/graph/types.d.ts.map +1 -0
  315. package/dist/knowledge/graph/types.js +13 -0
  316. package/dist/knowledge/graph/types.js.map +1 -0
  317. package/dist/knowledge/prompt.d.ts +9 -0
  318. package/dist/knowledge/prompt.d.ts.map +1 -1
  319. package/dist/knowledge/prompt.js +17 -5
  320. package/dist/knowledge/prompt.js.map +1 -1
  321. package/dist/knowledge/query.d.ts +13 -0
  322. package/dist/knowledge/query.d.ts.map +1 -1
  323. package/dist/knowledge/query.js +107 -10
  324. package/dist/knowledge/query.js.map +1 -1
  325. package/dist/knowledge/repo-map.d.ts +11 -5
  326. package/dist/knowledge/repo-map.d.ts.map +1 -1
  327. package/dist/knowledge/repo-map.js +42 -3
  328. package/dist/knowledge/repo-map.js.map +1 -1
  329. package/dist/knowledge/validator.d.ts.map +1 -1
  330. package/dist/knowledge/validator.js +69 -2
  331. package/dist/knowledge/validator.js.map +1 -1
  332. package/dist/mcp/server.d.ts +64 -8
  333. package/dist/mcp/server.d.ts.map +1 -1
  334. package/dist/mcp/server.js +233 -18
  335. package/dist/mcp/server.js.map +1 -1
  336. package/dist/skills/distill/distiller.js +1 -1
  337. package/dist/skills/distill/distiller.js.map +1 -1
  338. package/dist/skills/distilled/distilled-api-design.md +4 -0
  339. package/dist/skills/distilled/distilled-brainstorming.md +79 -0
  340. package/dist/skills/distilled/distilled-brand-guidelines.md +86 -0
  341. package/dist/skills/distilled/distilled-canvas-design.md +128 -0
  342. package/dist/skills/distilled/distilled-claude-api.md +185 -0
  343. package/dist/skills/distilled/distilled-creator.md +5 -2
  344. package/dist/skills/distilled/distilled-dispatching-parallel-agents.md +136 -0
  345. package/dist/skills/distilled/distilled-doc-coauthoring.md +144 -0
  346. package/dist/skills/distilled/distilled-docx.md +231 -0
  347. package/dist/skills/distilled/distilled-executing-plans.md +85 -50
  348. package/dist/skills/distilled/distilled-finishing-a-development-branch.md +213 -0
  349. package/dist/skills/distilled/distilled-frontend-design.md +118 -0
  350. package/dist/skills/distilled/distilled-harness-engineering.md +1 -1
  351. package/dist/skills/distilled/distilled-receiving-code-review.md +185 -0
  352. package/dist/skills/distilled/distilled-subagent-driven-development.md +124 -0
  353. package/dist/skills/distilled/distilled-systematic-debugging.md +108 -260
  354. package/dist/skills/distilled/distilled-test-driven-development.md +432 -0
  355. package/dist/skills/distilled/distilled-using-superpowers.md +134 -0
  356. package/dist/skills/distilled/distilled-verification-before-completion.md +88 -78
  357. package/dist/skills/distilled/distilled-writing-skills.md +175 -0
  358. package/dist/skills/registry.d.ts +10 -50
  359. package/dist/skills/registry.d.ts.map +1 -1
  360. package/dist/skills/registry.js +7 -118
  361. package/dist/skills/registry.js.map +1 -1
  362. package/dist/skills/tools/pipeline-suggest.js +2 -2
  363. package/dist/skills/tools/pipeline-suggest.js.map +1 -1
  364. package/dist/skills/tools/skill-invoke.d.ts +2 -1
  365. package/dist/skills/tools/skill-invoke.d.ts.map +1 -1
  366. package/dist/skills/tools/skill-invoke.js +3 -1
  367. package/dist/skills/tools/skill-invoke.js.map +1 -1
  368. package/dist/web/analytics/anti-pattern-detector.d.ts.map +1 -1
  369. package/dist/web/analytics/anti-pattern-detector.js +6 -1
  370. package/dist/web/analytics/anti-pattern-detector.js.map +1 -1
  371. package/dist/web/analytics/drift-detector.d.ts +6 -0
  372. package/dist/web/analytics/drift-detector.d.ts.map +1 -1
  373. package/dist/web/analytics/drift-detector.js +15 -8
  374. package/dist/web/analytics/drift-detector.js.map +1 -1
  375. package/dist/web/analytics/weekly-report.d.ts +13 -0
  376. package/dist/web/analytics/weekly-report.d.ts.map +1 -1
  377. package/dist/web/analytics/weekly-report.js +17 -3
  378. package/dist/web/analytics/weekly-report.js.map +1 -1
  379. package/dist/web/routes/_helpers.d.ts +31 -0
  380. package/dist/web/routes/_helpers.d.ts.map +1 -1
  381. package/dist/web/routes/_helpers.js +33 -0
  382. package/dist/web/routes/_helpers.js.map +1 -1
  383. package/dist/web/routes/agent-distill.d.ts +49 -0
  384. package/dist/web/routes/agent-distill.d.ts.map +1 -0
  385. package/dist/web/routes/agent-distill.js +526 -0
  386. package/dist/web/routes/agent-distill.js.map +1 -0
  387. package/dist/web/routes/config.d.ts +56 -0
  388. package/dist/web/routes/config.d.ts.map +1 -0
  389. package/dist/web/routes/config.js +243 -0
  390. package/dist/web/routes/config.js.map +1 -0
  391. package/dist/web/routes/decisions.js +1 -1
  392. package/dist/web/routes/decisions.js.map +1 -1
  393. package/dist/web/routes/error-handler.d.ts +0 -4
  394. package/dist/web/routes/error-handler.d.ts.map +1 -1
  395. package/dist/web/routes/error-handler.js +0 -8
  396. package/dist/web/routes/error-handler.js.map +1 -1
  397. package/dist/web/routes/events.d.ts.map +1 -1
  398. package/dist/web/routes/events.js +2 -1
  399. package/dist/web/routes/events.js.map +1 -1
  400. package/dist/web/routes/insights.d.ts.map +1 -1
  401. package/dist/web/routes/insights.js +0 -0
  402. package/dist/web/routes/insights.js.map +1 -1
  403. package/dist/web/routes/knowledge.d.ts +43 -2
  404. package/dist/web/routes/knowledge.d.ts.map +1 -1
  405. package/dist/web/routes/knowledge.js +117 -6
  406. package/dist/web/routes/knowledge.js.map +1 -1
  407. package/dist/web/routes/pipeline.d.ts +0 -9
  408. package/dist/web/routes/pipeline.d.ts.map +1 -1
  409. package/dist/web/routes/pipeline.js +0 -4
  410. package/dist/web/routes/pipeline.js.map +1 -1
  411. package/dist/web/routes/rules.d.ts.map +1 -1
  412. package/dist/web/routes/rules.js +20 -6
  413. package/dist/web/routes/rules.js.map +1 -1
  414. package/dist/web/routes/sessions.d.ts.map +1 -1
  415. package/dist/web/routes/sessions.js +8 -7
  416. package/dist/web/routes/sessions.js.map +1 -1
  417. package/dist/web/routes/skill-stats.d.ts.map +1 -1
  418. package/dist/web/routes/skill-stats.js +153 -16
  419. package/dist/web/routes/skill-stats.js.map +1 -1
  420. package/dist/web/routes/skills-distill.js +1 -1
  421. package/dist/web/routes/skills-distill.js.map +1 -1
  422. package/dist/web/routes/stats.d.ts.map +1 -1
  423. package/dist/web/routes/stats.js +2 -1
  424. package/dist/web/routes/stats.js.map +1 -1
  425. package/dist/web/routes/task-timeline.d.ts +95 -19
  426. package/dist/web/routes/task-timeline.d.ts.map +1 -1
  427. package/dist/web/routes/task-timeline.js +344 -88
  428. package/dist/web/routes/task-timeline.js.map +1 -1
  429. package/dist/web/routes/tasks.d.ts.map +1 -1
  430. package/dist/web/routes/tasks.js +52 -30
  431. package/dist/web/routes/tasks.js.map +1 -1
  432. package/dist/web/routes/violations.d.ts +1 -1
  433. package/dist/web/routes/violations.d.ts.map +1 -1
  434. package/dist/web/routes/violations.js +3 -2
  435. package/dist/web/routes/violations.js.map +1 -1
  436. package/dist/web/server.d.ts.map +1 -1
  437. package/dist/web/server.js +20 -0
  438. package/dist/web/server.js.map +1 -1
  439. package/dist/web/services/agent-distill-manager.d.ts +122 -0
  440. package/dist/web/services/agent-distill-manager.d.ts.map +1 -0
  441. package/dist/web/services/agent-distill-manager.js +397 -0
  442. package/dist/web/services/agent-distill-manager.js.map +1 -0
  443. package/dist/web/services/distill-manager.d.ts +47 -0
  444. package/dist/web/services/distill-manager.d.ts.map +1 -1
  445. package/dist/web/services/distill-manager.js +103 -0
  446. package/dist/web/services/distill-manager.js.map +1 -1
  447. package/dist/web/static/assets/AgentDetailPage-DlUeA1sX.js +2 -0
  448. package/dist/web/static/assets/AgentDetailPage-DlUeA1sX.js.map +1 -0
  449. package/dist/web/static/assets/AgentDistillRunPage-Cybo4bii.js +3 -0
  450. package/dist/web/static/assets/AgentDistillRunPage-Cybo4bii.js.map +1 -0
  451. package/dist/web/static/assets/AgentsPage-Qd9FExLG.js +2 -0
  452. package/dist/web/static/assets/AgentsPage-Qd9FExLG.js.map +1 -0
  453. package/dist/web/static/assets/DaemonHealthPage-DTSVqtrI.js +2 -0
  454. package/dist/web/static/assets/DaemonHealthPage-DTSVqtrI.js.map +1 -0
  455. package/dist/web/static/assets/DecisionDetailPage-b4BA8dhc.js +2 -0
  456. package/dist/web/static/assets/DecisionDetailPage-b4BA8dhc.js.map +1 -0
  457. package/dist/web/static/assets/DecisionsPage-a3NRo_T7.js +2 -0
  458. package/dist/web/static/assets/DecisionsPage-a3NRo_T7.js.map +1 -0
  459. package/dist/web/static/assets/DiagnosticsPage-DIVdiIQG.js +2 -0
  460. package/dist/web/static/assets/DiagnosticsPage-DIVdiIQG.js.map +1 -0
  461. package/dist/web/static/assets/DistillDetailPage-U6a3l2iP.js +4 -0
  462. package/dist/web/static/assets/DistillDetailPage-U6a3l2iP.js.map +1 -0
  463. package/dist/web/static/assets/DistillPage-O7BHtRN8.js +2 -0
  464. package/dist/web/static/assets/DistillPage-O7BHtRN8.js.map +1 -0
  465. package/dist/web/static/assets/DistillRunPage-D1JuRWWr.js +2 -0
  466. package/dist/web/static/assets/DistillRunPage-D1JuRWWr.js.map +1 -0
  467. package/dist/web/static/assets/GlobalScopeHint-Q3wTJx3F.js +2 -0
  468. package/dist/web/static/assets/GlobalScopeHint-Q3wTJx3F.js.map +1 -0
  469. package/dist/web/static/assets/IssueDetailPage-BDfrtk2C.js +2 -0
  470. package/dist/web/static/assets/IssueDetailPage-BDfrtk2C.js.map +1 -0
  471. package/dist/web/static/assets/IssuesPage-SKmhlCrw.js +2 -0
  472. package/dist/web/static/assets/IssuesPage-SKmhlCrw.js.map +1 -0
  473. package/dist/web/static/assets/KbDetailPage-Yna86Na8.js +2 -0
  474. package/dist/web/static/assets/KbDetailPage-Yna86Na8.js.map +1 -0
  475. package/dist/web/static/assets/KbHitsPage-Cljl7H9p.js +2 -0
  476. package/dist/web/static/assets/KbHitsPage-Cljl7H9p.js.map +1 -0
  477. package/dist/web/static/assets/{MarkdownRenderer-DZmTl-8J.js → MarkdownRenderer-DlDQNihj.js} +2 -2
  478. package/dist/web/static/assets/{MarkdownRenderer-DZmTl-8J.js.map → MarkdownRenderer-DlDQNihj.js.map} +1 -1
  479. package/dist/web/static/assets/NotFound-LMzbP51V.js +2 -0
  480. package/dist/web/static/assets/{NotFound-BQPh0vaF.js.map → NotFound-LMzbP51V.js.map} +1 -1
  481. package/dist/web/static/assets/SettingsPage-DzoK4PKg.js +2 -0
  482. package/dist/web/static/assets/SettingsPage-DzoK4PKg.js.map +1 -0
  483. package/dist/web/static/assets/SkillDetailPage-BuBJJ_NX.js +2 -0
  484. package/dist/web/static/assets/SkillDetailPage-BuBJJ_NX.js.map +1 -0
  485. package/dist/web/static/assets/SkillsPage-aojkJpBc.js +2 -0
  486. package/dist/web/static/assets/SkillsPage-aojkJpBc.js.map +1 -0
  487. package/dist/web/static/assets/TaskDetailPage-1ckxnGhw.js +4 -0
  488. package/dist/web/static/assets/TaskDetailPage-1ckxnGhw.js.map +1 -0
  489. package/dist/web/static/assets/TasksHubPage-C2PLh3eg.js +6 -0
  490. package/dist/web/static/assets/TasksHubPage-C2PLh3eg.js.map +1 -0
  491. package/dist/web/static/assets/WorkplacePage-DHrp5VxS.js +2 -0
  492. package/dist/web/static/assets/WorkplacePage-DHrp5VxS.js.map +1 -0
  493. package/dist/web/static/assets/arco-DV6xCLhr.js +14 -0
  494. package/dist/web/static/assets/arco-DV6xCLhr.js.map +1 -0
  495. package/dist/web/static/assets/charts-BSV4cyC4.js +37 -0
  496. package/dist/web/static/assets/charts-BSV4cyC4.js.map +1 -0
  497. package/dist/web/static/assets/{index-7bl3kbcx.css → index-B_v_MKlb.css} +1 -1
  498. package/dist/web/static/assets/index-DileOOE4.js +4 -0
  499. package/dist/web/static/assets/index-DileOOE4.js.map +1 -0
  500. package/dist/web/static/assets/markdown-CA7ePUts.js +30 -0
  501. package/dist/web/static/assets/markdown-CA7ePUts.js.map +1 -0
  502. package/dist/web/static/assets/{outcome-DUn1NjlC.js → outcome-BKGy9azt.js} +2 -2
  503. package/dist/web/static/assets/{outcome-DUn1NjlC.js.map → outcome-BKGy9azt.js.map} +1 -1
  504. package/dist/web/static/assets/{query-S6X1S7K9.js → query-CgCOpYWf.js} +2 -2
  505. package/dist/web/static/assets/{query-S6X1S7K9.js.map → query-CgCOpYWf.js.map} +1 -1
  506. package/dist/web/static/assets/{react-router-JVUrkhdd.js → react-router-Cxmg8RuL.js} +3 -3
  507. package/dist/web/static/assets/{react-router-JVUrkhdd.js.map → react-router-Cxmg8RuL.js.map} +1 -1
  508. package/dist/web/static/assets/{syntax-highlighter-BkZfCDsz.js → syntax-highlighter-BDYycNja.js} +3 -3
  509. package/dist/web/static/assets/{syntax-highlighter-BkZfCDsz.js.map → syntax-highlighter-BDYycNja.js.map} +1 -1
  510. package/dist/web/static/assets/task-title-BhOcemuR.js +2 -0
  511. package/dist/web/static/assets/task-title-BhOcemuR.js.map +1 -0
  512. package/dist/web/static/assets/useAgentStats-B-uTgqBd.js +2 -0
  513. package/dist/web/static/assets/useAgentStats-B-uTgqBd.js.map +1 -0
  514. package/dist/web/static/assets/useDecisions-D-G2Ft5T.js +2 -0
  515. package/dist/web/static/assets/useDecisions-D-G2Ft5T.js.map +1 -0
  516. package/dist/web/static/assets/useDistill-21dZkXlT.js +3 -0
  517. package/dist/web/static/assets/useDistill-21dZkXlT.js.map +1 -0
  518. package/dist/web/static/assets/useEffectiveProject-DQiyX54y.js +2 -0
  519. package/dist/web/static/assets/useEffectiveProject-DQiyX54y.js.map +1 -0
  520. package/dist/web/static/assets/useIssuesFeed-CFiyQkAL.js +2 -0
  521. package/dist/web/static/assets/useIssuesFeed-CFiyQkAL.js.map +1 -0
  522. package/dist/web/static/assets/useKbHits-xKXWgqh9.js +2 -0
  523. package/dist/web/static/assets/useKbHits-xKXWgqh9.js.map +1 -0
  524. package/dist/web/static/assets/useSkillStats-B5hbIwdf.js +2 -0
  525. package/dist/web/static/assets/useSkillStats-B5hbIwdf.js.map +1 -0
  526. package/dist/web/static/assets/vendor-DS-q4Eyc.js +36 -0
  527. package/dist/web/static/assets/vendor-DS-q4Eyc.js.map +1 -0
  528. package/dist/web/static/index.html +6 -6
  529. package/package.json +5 -3
  530. package/dist/core/storage/workflow-recommendations.d.ts +0 -124
  531. package/dist/core/storage/workflow-recommendations.d.ts.map +0 -1
  532. package/dist/core/storage/workflow-recommendations.js +0 -274
  533. package/dist/core/storage/workflow-recommendations.js.map +0 -1
  534. package/dist/daemon/services/experience-extractor.d.ts.map +0 -1
  535. package/dist/daemon/services/experience-extractor.js.map +0 -1
  536. package/dist/daemon/services/violation-reporter.d.ts.map +0 -1
  537. package/dist/daemon/services/violation-reporter.js.map +0 -1
  538. package/dist/daemon/templates/agents/harness-hotfix.md +0 -99
  539. package/dist/daemon/templates/agents/hybrid-feature-with-safety.md +0 -104
  540. package/dist/daemon/templates/agents/refactor-specialist.md +0 -98
  541. package/dist/skills/distill/claude-cli-resolver.d.ts.map +0 -1
  542. package/dist/skills/distill/claude-cli-resolver.js.map +0 -1
  543. package/dist/skills/distilled/distilled-defi-amm-security.md +0 -293
  544. package/dist/skills/keyword-score.d.ts +0 -29
  545. package/dist/skills/keyword-score.d.ts.map +0 -1
  546. package/dist/skills/keyword-score.js +0 -54
  547. package/dist/skills/keyword-score.js.map +0 -1
  548. package/dist/web/static/assets/AgentContentPage-DkeRNxok.js +0 -2
  549. package/dist/web/static/assets/AgentContentPage-DkeRNxok.js.map +0 -1
  550. package/dist/web/static/assets/AgentDelegationTable-ByBa0x1l.js +0 -2
  551. package/dist/web/static/assets/AgentDelegationTable-ByBa0x1l.js.map +0 -1
  552. package/dist/web/static/assets/ContextInsightsPage-oUk7_I8u.js +0 -3
  553. package/dist/web/static/assets/ContextInsightsPage-oUk7_I8u.js.map +0 -1
  554. package/dist/web/static/assets/DaemonHealthPage-DG2fyOP7.js +0 -2
  555. package/dist/web/static/assets/DaemonHealthPage-DG2fyOP7.js.map +0 -1
  556. package/dist/web/static/assets/DecisionsPage-CMAPEnKb.js +0 -2
  557. package/dist/web/static/assets/DecisionsPage-CMAPEnKb.js.map +0 -1
  558. package/dist/web/static/assets/DiagnosticsPage-DQd-Zm4r.js +0 -2
  559. package/dist/web/static/assets/DiagnosticsPage-DQd-Zm4r.js.map +0 -1
  560. package/dist/web/static/assets/DriftTab-DqpepOhI.js +0 -2
  561. package/dist/web/static/assets/DriftTab-DqpepOhI.js.map +0 -1
  562. package/dist/web/static/assets/HealthHomePage-CN6zNIie.js +0 -3
  563. package/dist/web/static/assets/HealthHomePage-CN6zNIie.js.map +0 -1
  564. package/dist/web/static/assets/KbHitRateTable-ByEIWujF.js +0 -2
  565. package/dist/web/static/assets/KbHitRateTable-ByEIWujF.js.map +0 -1
  566. package/dist/web/static/assets/NotFound-BQPh0vaF.js +0 -2
  567. package/dist/web/static/assets/ProjectSwitcher-D3lZMFd3.js +0 -2
  568. package/dist/web/static/assets/ProjectSwitcher-D3lZMFd3.js.map +0 -1
  569. package/dist/web/static/assets/SettingsPage-oLJBNzQj.js +0 -2
  570. package/dist/web/static/assets/SettingsPage-oLJBNzQj.js.map +0 -1
  571. package/dist/web/static/assets/SkillContentPage-DK5rgfgw.js +0 -2
  572. package/dist/web/static/assets/SkillContentPage-DK5rgfgw.js.map +0 -1
  573. package/dist/web/static/assets/SkillStatsTable-DYMzjEUV.js +0 -2
  574. package/dist/web/static/assets/SkillStatsTable-DYMzjEUV.js.map +0 -1
  575. package/dist/web/static/assets/SkillsDistillTab-C7qaG8q3.js +0 -2
  576. package/dist/web/static/assets/SkillsDistillTab-C7qaG8q3.js.map +0 -1
  577. package/dist/web/static/assets/TasksHubPage-03wsRRsJ.js +0 -6
  578. package/dist/web/static/assets/TasksHubPage-03wsRRsJ.js.map +0 -1
  579. package/dist/web/static/assets/ViolationsPage-DSiLr-9O.js +0 -3
  580. package/dist/web/static/assets/ViolationsPage-DSiLr-9O.js.map +0 -1
  581. package/dist/web/static/assets/arco-Bhi3a6Qp.js +0 -14
  582. package/dist/web/static/assets/arco-Bhi3a6Qp.js.map +0 -1
  583. package/dist/web/static/assets/charts-BuHQWDbQ.js +0 -37
  584. package/dist/web/static/assets/charts-BuHQWDbQ.js.map +0 -1
  585. package/dist/web/static/assets/index-BIYnq1Dx.js +0 -4
  586. package/dist/web/static/assets/index-BIYnq1Dx.js.map +0 -1
  587. package/dist/web/static/assets/useTabsParam-k8qte_0C.js +0 -2
  588. package/dist/web/static/assets/useTabsParam-k8qte_0C.js.map +0 -1
  589. package/dist/web/static/assets/vendor-DWgdB1eY.js +0 -65
  590. package/dist/web/static/assets/vendor-DWgdB1eY.js.map +0 -1
  591. /package/dist/{skills/distill → core/utils}/claude-cli-resolver.d.ts +0 -0
@@ -4,6 +4,7 @@ description: Lightweight decision agent for prompts the daemon flagged as decisi
4
4
  tools: Read, Bash, Glob, Grep, Write
5
5
  model: inherit
6
6
  color: orange
7
+ version: 1
7
8
  ---
8
9
 
9
10
  # IMPORTANT: subagent rules
@@ -113,15 +114,19 @@ axis readings and the chosen path.
113
114
  ## Step 1: KB query — understand project background (REQUIRED)
114
115
 
115
116
  ```bash
116
- cf knowledge query <keyword1> --json --max 3
117
+ cf knowledge query <keyword1> --json --max 3 --reason "decision/kb-precedent"
117
118
  # heavy path only — second query:
118
- cf knowledge query <keyword2> --json --max 3
119
+ cf knowledge query <keyword2> --json --max 3 --reason "decision/kb-precedent"
119
120
  ```
120
121
 
121
122
  Extract keywords from the user prompt and query the KB (light path: 1 query;
122
123
  heavy path: up to 2). If KB is empty or not built, note it and continue. KB
123
124
  context often reveals architecture constraints that change the correct decision.
124
125
 
126
+ > Telemetry: pass `--reason "decision/kb-<phase>"` so the KB pull is attributable
127
+ > in `kb_query_log` (source=agent-pull), the same way skill pulls are recorded —
128
+ > distinguishing an agent's deliberate pull from the daemon kb-injector's probing.
129
+
125
130
  ## Step 1.5: Outcome-weighted precedent (REQUIRED)
126
131
 
127
132
  Look for precedent before proposing options — and weight it by how prior similar
@@ -147,6 +152,46 @@ Referenced" section, e.g. "decision X used the same shape, outcome=failed — so
147
152
  proposal deliberately avoids it" or "decision Y outcome=success — leaning toward
148
153
  the same approach." If no relevant precedent, note "no relevant prior decisions."
149
154
 
155
+ ## Step 1.7: discover the methodology skill that fits the decision (targeted)
156
+
157
+ Before you reason about options, find the ONE distilled methodology skill that
158
+ matches the **nature of this decision** — by DYNAMIC DISCOVERY, not a hardcoded
159
+ lookup table (decision c20c2d1f). Steps:
160
+
161
+ 1. **Describe what this decision is really about** in one phrase (e.g.
162
+ `"choose between two architecture approaches for a boundary"`, `"diagnose why
163
+ an intermittent failure happens"`, `"scope whether and how to build a feature"`),
164
+ then run via **Bash**:
165
+ `cf skill search "<decision-desc>" --json`
166
+ 2. **Read the ranked candidates + scores**, then YOU (the LLM) judge which single
167
+ one — at most 1, the most relevant — fits this decision's nature. If the output
168
+ says `no_strong_match: true` (or none truly fits), **skip the pull** and note
169
+ `skill-pull-skipped: no-match` in your summary. Do NOT force a weak candidate.
170
+ 3. **Pull the one you chose:**
171
+ `cf skill invoke <id> --reason "decision/<phase>" --agent decision-maker`
172
+ (pass `--agent decision-maker` so `agent_id` is written — decision 234f1ad4 Q6).
173
+ Read it and use it as your reasoning reference.
174
+
175
+ Rules:
176
+ - **Pick at most one** via `cf skill search` — the single best fit for this
177
+ decision's nature; use it as a reference, not a script. Do NOT pull the whole
178
+ catalog — pulling everything every time is the noise trap (d08da374) we avoid.
179
+ - **When to SKIP:** on a **trivial fast-exit (Step 0)** or a **light-path** local
180
+ decision, or when `cf skill search` reports `no_strong_match`, skip the pull and
181
+ note `skill-pull-skipped: no-match` (or `trivial`) in your summary. Do not pull
182
+ just to pull.
183
+ - This is the decision-maker analogue of `coder` Step 2.7 / `verify-agent` Step 0.
184
+
185
+ > Why Bash, not MCP: subagents in this harness have **zero MCP access** — the MCP
186
+ > `skill_invoke` / `skill_search` tools are uncallable from you. `cf skill search`
187
+ > / `cf skill invoke` (Bash) are the working channel, and invoke records the pull
188
+ > to `skill_invocations` (`invocation_type='cli'`).
189
+
190
+ **Telemetry convention (required).** The `--reason` MUST begin with the prefix
191
+ **`decision/`** (e.g. `--reason "decision/architecture-decision"`). The
192
+ `<workflow>/<phase>` form is parsed by `parseWorkflowMeta` into `workflow`/`phase`
193
+ columns — keep both segments lowercase, letters/digits/hyphens only.
194
+
150
195
  ## Step 2: Read Skill catalog (HEAVY PATH ONLY)
151
196
 
152
197
  > Light path: skip this step.
@@ -163,29 +208,62 @@ ls src/skills/distilled/
163
208
  Read the list of available skills. For the task at hand, identify the 1-3 most
164
209
  relevant skills the implementation agent should use. Note their IDs for Step 5.
165
210
 
166
- ## Step 3: Read Agent catalog (HEAVY PATH ONLY)
211
+ ## Step 3: Choose the implementation agent via `cf agent suggest` (HEAVY PATH ONLY)
167
212
 
168
213
  > Light path: skip this step.
169
214
 
170
- ```bash
171
- cat dist/catalogs/agents.json
172
- ```
215
+ This is the decision-end mirror of Step 1.7's `cf skill search` (decision
216
+ c20c2d1f, C2). Instead of applying a hardcoded coverage/nature lookup table by
217
+ hand, run the **deterministic** `cf agent suggest` command — it ranks the
218
+ spawnable implementation agents by **task-nature × skill affinity × agent-health**
219
+ with a **coverage backstop**, and emits machine-readable candidates. YOU make the
220
+ final call over them (the command = candidates, the LLM = judgment), exactly like
221
+ C1's "ranker ranks, LLM picks".
173
222
 
174
- If the file does not exist (pre-build), fallback:
175
- ```bash
176
- ls .claude/agents/
177
- ```
178
-
179
- Read the list of available agents. Based on the user's prompt, select 1-2
180
- recommended implementation agents. Note their names for Step 5.
181
-
182
- Use the agent selection guide:
183
- - new feature + touches legacy low-coverage code → `hybrid-feature-with-safety`
184
- - new feature, fully isolated `coder`
185
- - known bug + low-coverage `harness-hotfix`
186
- - unknown/intermittent bug → `harness-debug-full`
187
- - restructuring low-coverage code `refactor-specialist`
188
- - architecture planning `planner`
223
+ 1. **Describe the task's nature + name the module it touches**, then run via
224
+ **Bash**:
225
+ ```bash
226
+ cf agent suggest "<one-phrase task nature, e.g. fix a known null-deref in the event handler>" \
227
+ --module <touched module path, e.g. src/daemon/handlers> --json
228
+ ```
229
+ - `--module` enables the coverage backstop (Signal 4): if the top candidate is
230
+ `coder` but the module is **<50% lines**, the command automatically demotes
231
+ it to `safety-net-implementer` and sets `demoted_from: "coder"`. Pass the
232
+ module path whenever you know it.
233
+ - Omit `--module` only when the task is not module-scoped (then the backstop is
234
+ skipped and the JSON's `coverage_note` says so).
235
+
236
+ 2. **Read the ranked `candidates` + their `reasons`.** The top candidate is the
237
+ data-driven recommendation. Each candidate carries a `confidence`
238
+ (`data-backed` when historical (agent×skill) usefulness drove it, or
239
+ `nature-prior` when it fell back to the cold-start nature table — common early,
240
+ by design, until C1 usefulness data accumulates).
241
+
242
+ 3. **YOU make the final call.** Fold in the **KB precedent you read in Step 1**
243
+ (which agent actually succeeded on similar tasks before) and the core-beliefs
244
+ gate (Step 3.5). Write the chosen agent(s) into `recommended_agents` with your
245
+ rationale. You **MAY override** the top candidate when KB precedent or an
246
+ invariant says so — but **state why** in the doc.
247
+
248
+ 4. **Coverage is a backstop, not the primary driver.** The command already applies
249
+ the coder→safety-net-implementer demotion for low-coverage modules — do NOT
250
+ re-apply the coverage table as the main selection criterion (that was the old
251
+ hardcoded guide this step replaces). The spawnable pool is
252
+ `{coder, safety-net-implementer, harness-debug-full, planner}`; for
253
+ `safety-net-implementer` note the mode in your rationale (hotfix / refactor /
254
+ hybrid-feature) per the task shape.
255
+
256
+ > Why Bash, not MCP: subagents have **zero MCP access** — `cf agent suggest`
257
+ > (Bash) is the working channel. It is read-only and deterministic (no LLM, no
258
+ > embedding, no DB writes).
259
+
260
+ If `cf agent suggest` is unavailable (pre-build), fall back to reading the agent
261
+ catalog directly and applying the nature→agent shape by hand
262
+ (`cat dist/catalogs/agents.json` or `ls .claude/agents/`):
263
+ new-feature → `coder` (demote to `safety-net-implementer` if the module is
264
+ <50%); known bug → `safety-net-implementer` (hotfix); unknown/intermittent bug →
265
+ `harness-debug-full`; refactor → `safety-net-implementer` (refactor); planning →
266
+ `planner`.
189
267
 
190
268
  ## Step 3.5: Read core-beliefs — project invariants as HARD constraints (REQUIRED, both paths)
191
269
 
@@ -341,6 +419,14 @@ In your final message return:
341
419
  - The Open Questions list
342
420
  - Recommended next step: `spawn <recommended_agent> with decision_id=<id> in prompt`
343
421
  (heavy path), or "light decision — user may proceed directly" if no agent needed.
422
+ - **Rate the pulled skill after you used it (post-use self-assessment, decision
423
+ d24cd3a2).** If you pulled a skill in Step 1.7, run ONE Bash line rating how
424
+ actionable its CONTENT was on THIS decision:
425
+ `cf skill feedback --skill <the-id-you-pulled> --rating helped|partial|not-actionable --note "<one line: what WAS / WASN'T applicable to THIS project>"`.
426
+ Rate HONESTLY by whether the methodology's CONCRETE steps were usable here, not
427
+ whether the principle merely sounded nice — `not-actionable`/`partial` are
428
+ VALUABLE signals, not failures. Skip only if you skipped the pull. (Advisory +
429
+ fail-soft: it never blocks your flow.)
344
430
 
345
431
  **Outcome back-fill handoff (REQUIRED in your summary).** When you hand off to an
346
432
  implementation agent, state the back-fill protocol explicitly:
@@ -4,6 +4,7 @@ description: Read-only code, spec, or document analysis. Returns a structured re
4
4
  tools: Read, Bash, Glob, Grep
5
5
  model: inherit
6
6
  color: cyan
7
+ version: 1
7
8
  ---
8
9
 
9
10
  # IMPORTANT: subagent rules
@@ -93,7 +94,9 @@ let them spawn an agent with Write access to save it.
93
94
  (commit/checkout/add/push/reset/stash) / 删改文件 (rm/mv/cp 写目标/重定向 `>`/`>>`/
94
95
  `tee` / `sed -i`)。Bash 仅限只读检视:`cat` / `grep` / `ls` / `find` / `wc` /
95
96
  `git status` / `git diff` / `git log` / `git show` / 只读的 `cf` 查询命令
96
- (如 `cf knowledge query`, `cf decisions list`)。若调查需要 mutating 操作,
97
+ (如 `cf knowledge query <keyword> --reason "review/kb-precedent"`,
98
+ `cf decisions list`;KB 查询带 `--reason "review/kb-<phase>"` 让 pull 在
99
+ `kb_query_log` 中可归因为 source=agent-pull)。若调查需要 mutating 操作,
97
100
  STOP 并把建议回报主线程,由主线程决定——你自己绝不执行。
98
101
  - Do NOT propose inline code patches — describe changes in prose
99
102
  - Do NOT spawn other agents
@@ -1,9 +1,10 @@
1
1
  ---
2
2
  name: harness-debug-full
3
- description: Unknown or intermittent bug — reproduce, then find root cause, then fix, then verify. Use when symptoms are described but root cause is NOT known, or when behavior is intermittent / random / flaky / "时好时坏". For known-cause bugs use harness-hotfix instead.
3
+ description: Unknown or intermittent bug — reproduce, then find root cause, then fix, then verify. Use when symptoms are described but root cause is NOT known, or when behavior is intermittent / random / flaky / "时好时坏". For known-cause bugs use safety-net-implementer (mode=hotfix) instead.
4
4
  tools: Read, Edit, Write, Bash, Glob, Grep
5
5
  model: inherit
6
6
  color: red
7
+ version: 1
7
8
  ---
8
9
 
9
10
  # IMPORTANT: subagent rules
@@ -30,7 +31,7 @@ You should be the agent selected when ANY of these hold:
30
31
  - Bug only appears under specific load / timing / data conditions
31
32
  - Prior fix attempts didn't stick (regression-like behavior)
32
33
 
33
- If user already identified the cause and just needs a fix → `harness-hotfix`.
34
+ If user already identified the cause and just needs a fix → `safety-net-implementer` (mode=hotfix).
34
35
 
35
36
  # Workflow
36
37
 
@@ -49,6 +50,45 @@ If user already identified the cause and just needs a fix → `harness-hotfix`.
49
50
  - The test MUST fail at the actual bug, not at setup.
50
51
  - Run `npm test` — fails at the right place.
51
52
 
53
+ ## Step 2.7: discover the debugging methodology skill dynamically (targeted)
54
+
55
+ Before you root-cause (Step 3), find the methodology skill that fits THIS debug
56
+ task by DYNAMIC DISCOVERY, not a hardcoded id (decision c20c2d1f) — **at most 1
57
+ skill**. Steps:
58
+
59
+ 1. **Describe the bug you are chasing** in one phrase (e.g. `"diagnose an
60
+ intermittent daemon socket failure"`, `"find root cause of a flaky test"`),
61
+ then run via **Bash**:
62
+ `cf skill search "<bug-desc>" --json` (for typical debugging this surfaces
63
+ `distilled-systematic-debugging`).
64
+ 2. **Read the ranked candidates + scores**, then YOU (the LLM) judge the single
65
+ best fit. If `cf skill search` reports `no_strong_match: true` (or none fits),
66
+ **skip the pull** and note `skill-pull-skipped: no-match` in the changelog.
67
+ 3. **Pull the one you chose:**
68
+ `cf skill invoke <id> --reason "harness/<phase>" --agent harness-debug-full`
69
+ (pass `--agent harness-debug-full` so `agent_id` is written — decision
70
+ 234f1ad4 Q6). Read it and use it to drive hypothesis forming + bisection
71
+ (Step 3). This is the harness analogue of `coder` Step 2.7 / `verify-agent`
72
+ Step 0.
73
+
74
+ Rules:
75
+ - **At most 1 skill** via `cf skill search`; do NOT pull the whole catalog
76
+ (pulling everything every time is the noise trap d08da374 we avoid).
77
+ - **When to SKIP:** if the repro turned out trivial and the cause is already
78
+ obvious, or `cf skill search` reports `no_strong_match`, skip the pull and note
79
+ `skill-pull-skipped: no-match` (or `trivial`) in the changelog. Do not pull just
80
+ to pull.
81
+
82
+ > Why Bash, not MCP: subagents in this harness have **zero MCP access** — the MCP
83
+ > `skill_invoke` / `skill_search` tools are uncallable from you. `cf skill search`
84
+ > / `cf skill invoke` (Bash) are the working channel; invoke records to
85
+ > `skill_invocations` (`invocation_type='cli'`).
86
+
87
+ **Telemetry convention (required).** The `--reason` MUST begin with the prefix
88
+ **`harness/`** (e.g. `--reason "harness/systematic-debugging"`). The
89
+ `<workflow>/<phase>` form is parsed by `parseWorkflowMeta` into `workflow`/`phase`
90
+ columns — keep both segments lowercase, letters/digits/hyphens only.
91
+
52
92
  ## Step 3: root-cause
53
93
 
54
94
  - Form a hypothesis (be explicit: "I think X causes Y because Z").
@@ -58,6 +98,36 @@ If user already identified the cause and just needs a fix → `harness-hotfix`.
58
98
  - DO NOT guess-and-fix. You must be able to explain WHY the fix works
59
99
  before you write the fix.
60
100
 
101
+ ## Step 3.5: Assess impact before touching the root-cause symbol — pick the right tool
102
+
103
+ Once you've located the root-cause symbol, don't patch it blind — a fix here can
104
+ ripple to callers you never read. Assess who is affected before you Edit/Write,
105
+ but **pick the tool that fits the shape of the question**:
106
+
107
+ - **Cross-layer / transitive impact / flow tracing** (the symbol is a storage
108
+ method / exported API, or you need every path that reaches it across layers) →
109
+ **MUST use** `code_impact <Class.method>` (transitive caller closure; pass the
110
+ qualified name). This is codegraph's moat: grep cannot follow call edges across
111
+ layers, which is exactly what flow tracing needs.
112
+ - **Find a direct call-site / a definition / who implements an interface** →
113
+ use **grep** (`grep "X("` / `grep "implements Y"`). Faster and more precise for
114
+ "find this name in this layer"; do NOT use codegraph here (slower or silently
115
+ empty for these).
116
+ - **Not sure which?** "cross-file / cross-layer / transitive" → codegraph;
117
+ "find a name right here in this layer" → grep.
118
+
119
+ `code_impact` / `code_graph_explore` / `code_search` are MCP tools in **deferred**
120
+ form: before calling, load the schema with
121
+ `ToolSearch select:mcp__claude-forge__code_impact` (and likewise for the others).
122
+ **Fallback when no MCP is available**: shell out via Bash —
123
+ `cf codegraph impact <symbol> --json` / `cf knowledge query <keyword> --json --reason "harness/kb-rootcause"`.
124
+ Prefer passing a qualified symbol name (`Class.method`); pass `--reason` on the
125
+ KB query so the pull is attributable in `kb_query_log` (source=agent-pull).
126
+
127
+ The transitive caller set also sharpens root-cause confidence: it shows every path
128
+ that reaches the symbol across layers, so you can confirm the fix covers all of
129
+ them, not just the repro path.
130
+
61
131
  ## Step 4: fix
62
132
 
63
133
  - Once root cause is identified, make the minimal change.
@@ -79,6 +149,18 @@ Write to `docs/implementation/YYYY-MM-DD/HHMM-[task]-changelog.md`:
79
149
  whenever this work traces to an approved decision/spec — this is what lets the
80
150
  Web decision detail page reliably surface the changelog. Omit only if there is
81
151
  genuinely no associated decision id.
152
+ - **A `Skill pull:` line** recording the Step 2.7 pull (e.g.
153
+ `Skill pull: distilled-systematic-debugging (reason=harness/systematic-debugging)`
154
+ or `skill-pull-skipped: trivial`) so the pull follow-through is visible.
155
+ - **Rate the pulled skill after you used it (post-use self-assessment, decision
156
+ d24cd3a2).** If you pulled a skill in Step 2.7, run ONE Bash line rating how
157
+ actionable its CONTENT was on THIS bug:
158
+ `cf skill feedback --skill <the-id-you-pulled> --rating helped|partial|not-actionable --note "<one line: what WAS / WASN'T applicable to THIS project>"`.
159
+ Rate HONESTLY by whether the methodology's CONCRETE steps were usable here, not
160
+ whether the principle merely sounded nice — `not-actionable`/`partial` are
161
+ VALUABLE signals, not failures. Skip only if you skipped the pull. (Advisory +
162
+ fail-soft: it never blocks your flow.) Echo the rating on the `Skill pull:` line
163
+ (e.g. `... (reason=harness/systematic-debugging) usefulness=partial`).
82
164
  - Bug description (symptoms only, as user saw them)
83
165
  - Reproduction script (PASTE FULL CONTENT; future debuggers need it)
84
166
  - Root cause (technical explanation — what / why / how it manifests)
@@ -94,7 +176,7 @@ Write to `docs/implementation/YYYY-MM-DD/HHMM-[task]-changelog.md`:
94
176
  - If repro is impossible within reasonable effort → BLOCKED, not "best guess fix"
95
177
  - Keep the fix surgical; the urge to "fix the whole area while debugging" is the bug-introducer
96
178
  - The repro script in the changelog is REQUIRED; this is what makes this agent valuable
97
- vs. harness-hotfix
179
+ vs. safety-net-implementer (mode=hotfix)
98
180
  - **scope-checkpoint**: when this single task's cumulative edits reach 5 distinct
99
181
  files, STOP and report to the main thread (work done so far + remaining plan +
100
182
  any blockers) before continuing — do NOT plow ahead silently; large tasks should
@@ -9,6 +9,7 @@ description: |
9
9
  tools: Read, Grep
10
10
  model: sonnet
11
11
  color: purple
12
+ version: 1
12
13
  ---
13
14
 
14
15
  # IMPORTANT: subagent rules
@@ -9,6 +9,7 @@ description: |
9
9
  tools: Read, Grep
10
10
  model: sonnet
11
11
  color: orange
12
+ version: 1
12
13
  ---
13
14
 
14
15
  # IMPORTANT: subagent rules
@@ -4,6 +4,7 @@ description: Spec writer for non-trivial work. Research current state, propose 2
4
4
  tools: Read, Bash, Glob, Grep, WebFetch, WebSearch, Write
5
5
  model: inherit
6
6
  color: yellow
7
+ version: 1
7
8
  ---
8
9
 
9
10
  # IMPORTANT: subagent rules
@@ -42,11 +43,50 @@ If target modules have <50% coverage → route to Harness/Hybrid agents (they se
42
43
  - Read the relevant files (use Glob to find them).
43
44
  - Check git log / git blame for context on recent changes.
44
45
  - Query the knowledge base if available:
45
- `cf knowledge query <keyword> --json --max 3`
46
- or use MCP `knowledge_query` tool if accessible.
46
+ `cf knowledge query <keyword> --json --max 3 --reason "planner/kb-research"`
47
+ (Bash CLI — subagents have zero MCP access, so do NOT rely on the MCP
48
+ `knowledge_query` tool; the `--reason "planner/kb-<phase>"` makes the pull
49
+ attributable in `kb_query_log` as source=agent-pull).
47
50
  - Use WebSearch / WebFetch for external references (RFCs, library docs) ONLY if
48
51
  the task requires external knowledge you don't have.
49
52
 
53
+ ## Step 1.5: discover the spec methodology skill dynamically (targeted)
54
+
55
+ Before you draft options (Step 2), find the methodology skill that fits THIS
56
+ planning task by DYNAMIC DISCOVERY, not a hardcoded id (decision c20c2d1f) —
57
+ **at most 1 skill, only when this is real spec work**. Steps:
58
+
59
+ 1. **Describe the planning task** in one phrase (e.g. `"scope and write a spec for
60
+ a new feature"`, `"plan a multi-phase refactor"`), then run via **Bash**:
61
+ `cf skill search "<task-desc>" --json` (for typical spec work this surfaces
62
+ `distilled-spec-driven-design`).
63
+ 2. **Read the ranked candidates + scores**, then YOU (the LLM) judge the single
64
+ best fit. If `cf skill search` reports `no_strong_match: true` (or none fits),
65
+ **skip the pull** and note `skill-pull-skipped: no-match` in your final report.
66
+ 3. **Pull the one you chose:**
67
+ `cf skill invoke <id> --reason "planner/<phase>" --agent planner`
68
+ (pass `--agent planner` so `agent_id` is written — decision 234f1ad4 Q6). Read
69
+ it and use it to shape the options + spec structure (Steps 2-4). This is the
70
+ planner analogue of `coder` Step 2.7 / `verify-agent` Step 0.
71
+
72
+ Rules:
73
+ - **At most 1 skill** via `cf skill search`; do NOT pull the whole catalog (pulling
74
+ everything every time is the noise trap d08da374 we avoid).
75
+ - **When to SKIP:** for a trivial / one-page "quick spec" or a pure config tweak
76
+ where the methodology adds nothing, or when `cf skill search` reports
77
+ `no_strong_match`, skip the pull and note `skill-pull-skipped: no-match` (or
78
+ `trivial`) in your final report.
79
+
80
+ > Why Bash, not MCP: subagents in this harness have **zero MCP access** — the MCP
81
+ > `skill_invoke` / `skill_search` tools are uncallable from you. `cf skill search`
82
+ > / `cf skill invoke` (Bash) are the working channel; invoke records to
83
+ > `skill_invocations` (`invocation_type='cli'`).
84
+
85
+ **Telemetry convention (required).** The `--reason` MUST begin with the prefix
86
+ **`planner/`** (e.g. `--reason "planner/spec-driven-design"`). The
87
+ `<workflow>/<phase>` form is parsed by `parseWorkflowMeta` into `workflow`/`phase`
88
+ columns — keep both segments lowercase, letters/digits/hyphens only.
89
+
50
90
  ## Step 2: propose 2-3 options
51
91
 
52
92
  For each option, write:
@@ -160,6 +200,18 @@ Notes:
160
200
  # Output
161
201
 
162
202
  - Spec file at `docs/design/YYYY-MM-DD/HHMM-[task]-spec.md`
163
- - Final message: file path + tl;dr + open questions
203
+ - Final message: file path + tl;dr + open questions + a **`Skill pull:`** line
204
+ recording the Step 1.5 pull (e.g.
205
+ `Skill pull: distilled-spec-driven-design (reason=planner/spec-driven-design)`
206
+ or `skill-pull-skipped: trivial`)
207
+ - **Rate the pulled skill after you used it (post-use self-assessment, decision
208
+ d24cd3a2).** If you pulled a skill in Step 1.5, run ONE Bash line rating how
209
+ actionable its CONTENT was on THIS spec:
210
+ `cf skill feedback --skill <the-id-you-pulled> --rating helped|partial|not-actionable --note "<one line: what WAS / WASN'T applicable to THIS project>"`.
211
+ Rate HONESTLY by whether the methodology's CONCRETE steps were usable here, not
212
+ whether the principle merely sounded nice — `not-actionable`/`partial` are
213
+ VALUABLE signals, not failures. Skip only if you skipped the pull. (Advisory +
214
+ fail-soft: it never blocks your flow.) Echo the rating on the `Skill pull:` line
215
+ (e.g. `... (reason=planner/spec-driven-design) usefulness=partial`).
164
216
  - No source code changes
165
217
  - No changelog (the spec IS the deliverable)