@rryando/arcs 3.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 (370) hide show
  1. package/README.md +448 -0
  2. package/dist/cli/arcs-orchestrate-caveman.d.ts +16 -0
  3. package/dist/cli/arcs-orchestrate-caveman.d.ts.map +1 -0
  4. package/dist/cli/arcs-orchestrate-caveman.js +109 -0
  5. package/dist/cli/arcs-orchestrate-caveman.js.map +1 -0
  6. package/dist/cli/arcs-orchestrate.d.ts +2 -0
  7. package/dist/cli/arcs-orchestrate.d.ts.map +1 -0
  8. package/dist/cli/arcs-orchestrate.js +431 -0
  9. package/dist/cli/arcs-orchestrate.js.map +1 -0
  10. package/dist/cli/arg-parser.d.ts +20 -0
  11. package/dist/cli/arg-parser.d.ts.map +1 -0
  12. package/dist/cli/arg-parser.js +216 -0
  13. package/dist/cli/arg-parser.js.map +1 -0
  14. package/dist/cli/brief-renderer.d.ts +32 -0
  15. package/dist/cli/brief-renderer.d.ts.map +1 -0
  16. package/dist/cli/brief-renderer.js +67 -0
  17. package/dist/cli/brief-renderer.js.map +1 -0
  18. package/dist/cli/bundle-installer.d.ts +77 -0
  19. package/dist/cli/bundle-installer.d.ts.map +1 -0
  20. package/dist/cli/bundle-installer.js +328 -0
  21. package/dist/cli/bundle-installer.js.map +1 -0
  22. package/dist/cli/command-registry.d.ts +52 -0
  23. package/dist/cli/command-registry.d.ts.map +1 -0
  24. package/dist/cli/command-registry.js +68 -0
  25. package/dist/cli/command-registry.js.map +1 -0
  26. package/dist/cli/commands/batch.d.ts +2 -0
  27. package/dist/cli/commands/batch.d.ts.map +1 -0
  28. package/dist/cli/commands/batch.js +307 -0
  29. package/dist/cli/commands/batch.js.map +1 -0
  30. package/dist/cli/commands/brief.d.ts +2 -0
  31. package/dist/cli/commands/brief.d.ts.map +1 -0
  32. package/dist/cli/commands/brief.js +146 -0
  33. package/dist/cli/commands/brief.js.map +1 -0
  34. package/dist/cli/commands/bundle.d.ts +2 -0
  35. package/dist/cli/commands/bundle.d.ts.map +1 -0
  36. package/dist/cli/commands/bundle.js +90 -0
  37. package/dist/cli/commands/bundle.js.map +1 -0
  38. package/dist/cli/commands/dependency.d.ts +2 -0
  39. package/dist/cli/commands/dependency.d.ts.map +1 -0
  40. package/dist/cli/commands/dependency.js +260 -0
  41. package/dist/cli/commands/dependency.js.map +1 -0
  42. package/dist/cli/commands/diagnostics.d.ts +2 -0
  43. package/dist/cli/commands/diagnostics.d.ts.map +1 -0
  44. package/dist/cli/commands/diagnostics.js +91 -0
  45. package/dist/cli/commands/diagnostics.js.map +1 -0
  46. package/dist/cli/commands/diagram.d.ts +2 -0
  47. package/dist/cli/commands/diagram.d.ts.map +1 -0
  48. package/dist/cli/commands/diagram.js +305 -0
  49. package/dist/cli/commands/diagram.js.map +1 -0
  50. package/dist/cli/commands/done.d.ts +2 -0
  51. package/dist/cli/commands/done.d.ts.map +1 -0
  52. package/dist/cli/commands/done.js +140 -0
  53. package/dist/cli/commands/done.js.map +1 -0
  54. package/dist/cli/commands/graph.d.ts +2 -0
  55. package/dist/cli/commands/graph.d.ts.map +1 -0
  56. package/dist/cli/commands/graph.js +105 -0
  57. package/dist/cli/commands/graph.js.map +1 -0
  58. package/dist/cli/commands/index.d.ts +21 -0
  59. package/dist/cli/commands/index.d.ts.map +1 -0
  60. package/dist/cli/commands/index.js +22 -0
  61. package/dist/cli/commands/index.js.map +1 -0
  62. package/dist/cli/commands/knowledge-search.d.ts +2 -0
  63. package/dist/cli/commands/knowledge-search.d.ts.map +1 -0
  64. package/dist/cli/commands/knowledge-search.js +43 -0
  65. package/dist/cli/commands/knowledge-search.js.map +1 -0
  66. package/dist/cli/commands/knowledge.d.ts +2 -0
  67. package/dist/cli/commands/knowledge.d.ts.map +1 -0
  68. package/dist/cli/commands/knowledge.js +416 -0
  69. package/dist/cli/commands/knowledge.js.map +1 -0
  70. package/dist/cli/commands/loop.d.ts +2 -0
  71. package/dist/cli/commands/loop.d.ts.map +1 -0
  72. package/dist/cli/commands/loop.js +192 -0
  73. package/dist/cli/commands/loop.js.map +1 -0
  74. package/dist/cli/commands/maintenance.d.ts +2 -0
  75. package/dist/cli/commands/maintenance.d.ts.map +1 -0
  76. package/dist/cli/commands/maintenance.js +231 -0
  77. package/dist/cli/commands/maintenance.js.map +1 -0
  78. package/dist/cli/commands/next.d.ts +2 -0
  79. package/dist/cli/commands/next.d.ts.map +1 -0
  80. package/dist/cli/commands/next.js +116 -0
  81. package/dist/cli/commands/next.js.map +1 -0
  82. package/dist/cli/commands/plan.d.ts +2 -0
  83. package/dist/cli/commands/plan.d.ts.map +1 -0
  84. package/dist/cli/commands/plan.js +340 -0
  85. package/dist/cli/commands/plan.js.map +1 -0
  86. package/dist/cli/commands/project-updates.d.ts +2 -0
  87. package/dist/cli/commands/project-updates.d.ts.map +1 -0
  88. package/dist/cli/commands/project-updates.js +243 -0
  89. package/dist/cli/commands/project-updates.js.map +1 -0
  90. package/dist/cli/commands/project.d.ts +2 -0
  91. package/dist/cli/commands/project.d.ts.map +1 -0
  92. package/dist/cli/commands/project.js +362 -0
  93. package/dist/cli/commands/project.js.map +1 -0
  94. package/dist/cli/commands/remember.d.ts +2 -0
  95. package/dist/cli/commands/remember.d.ts.map +1 -0
  96. package/dist/cli/commands/remember.js +70 -0
  97. package/dist/cli/commands/remember.js.map +1 -0
  98. package/dist/cli/commands/status.d.ts +2 -0
  99. package/dist/cli/commands/status.d.ts.map +1 -0
  100. package/dist/cli/commands/status.js +104 -0
  101. package/dist/cli/commands/status.js.map +1 -0
  102. package/dist/cli/commands/task.d.ts +6 -0
  103. package/dist/cli/commands/task.d.ts.map +1 -0
  104. package/dist/cli/commands/task.js +361 -0
  105. package/dist/cli/commands/task.js.map +1 -0
  106. package/dist/cli/commands/utility.d.ts +9 -0
  107. package/dist/cli/commands/utility.d.ts.map +1 -0
  108. package/dist/cli/commands/utility.js +302 -0
  109. package/dist/cli/commands/utility.js.map +1 -0
  110. package/dist/cli/config.d.ts +42 -0
  111. package/dist/cli/config.d.ts.map +1 -0
  112. package/dist/cli/config.js +134 -0
  113. package/dist/cli/config.js.map +1 -0
  114. package/dist/cli/dag-commands.d.ts +7 -0
  115. package/dist/cli/dag-commands.d.ts.map +1 -0
  116. package/dist/cli/dag-commands.js +152 -0
  117. package/dist/cli/dag-commands.js.map +1 -0
  118. package/dist/cli/diagram-renderer.d.ts +26 -0
  119. package/dist/cli/diagram-renderer.d.ts.map +1 -0
  120. package/dist/cli/diagram-renderer.js +118 -0
  121. package/dist/cli/diagram-renderer.js.map +1 -0
  122. package/dist/cli/help-generator.d.ts +21 -0
  123. package/dist/cli/help-generator.d.ts.map +1 -0
  124. package/dist/cli/help-generator.js +100 -0
  125. package/dist/cli/help-generator.js.map +1 -0
  126. package/dist/cli/index.d.ts +8 -0
  127. package/dist/cli/index.d.ts.map +1 -0
  128. package/dist/cli/index.js +95 -0
  129. package/dist/cli/index.js.map +1 -0
  130. package/dist/cli/instructions.d.ts +53 -0
  131. package/dist/cli/instructions.d.ts.map +1 -0
  132. package/dist/cli/instructions.js +219 -0
  133. package/dist/cli/instructions.js.map +1 -0
  134. package/dist/cli/lean-output.d.ts +15 -0
  135. package/dist/cli/lean-output.d.ts.map +1 -0
  136. package/dist/cli/lean-output.js +66 -0
  137. package/dist/cli/lean-output.js.map +1 -0
  138. package/dist/cli/md-renderer.d.ts +6 -0
  139. package/dist/cli/md-renderer.d.ts.map +1 -0
  140. package/dist/cli/md-renderer.js +396 -0
  141. package/dist/cli/md-renderer.js.map +1 -0
  142. package/dist/cli/output-envelope.d.ts +15 -0
  143. package/dist/cli/output-envelope.d.ts.map +1 -0
  144. package/dist/cli/output-envelope.js +61 -0
  145. package/dist/cli/output-envelope.js.map +1 -0
  146. package/dist/cli/setup.d.ts +11 -0
  147. package/dist/cli/setup.d.ts.map +1 -0
  148. package/dist/cli/setup.js +415 -0
  149. package/dist/cli/setup.js.map +1 -0
  150. package/dist/cli/status-dashboard.d.ts +5 -0
  151. package/dist/cli/status-dashboard.d.ts.map +1 -0
  152. package/dist/cli/status-dashboard.js +248 -0
  153. package/dist/cli/status-dashboard.js.map +1 -0
  154. package/dist/index.d.ts +3 -0
  155. package/dist/index.d.ts.map +1 -0
  156. package/dist/index.js +25 -0
  157. package/dist/index.js.map +1 -0
  158. package/dist/retrieval/bm25.d.ts +23 -0
  159. package/dist/retrieval/bm25.d.ts.map +1 -0
  160. package/dist/retrieval/bm25.js +92 -0
  161. package/dist/retrieval/bm25.js.map +1 -0
  162. package/dist/retrieval/cross-project-search.d.ts +30 -0
  163. package/dist/retrieval/cross-project-search.d.ts.map +1 -0
  164. package/dist/retrieval/cross-project-search.js +109 -0
  165. package/dist/retrieval/cross-project-search.js.map +1 -0
  166. package/dist/retrieval/graph-builder.d.ts +6 -0
  167. package/dist/retrieval/graph-builder.d.ts.map +1 -0
  168. package/dist/retrieval/graph-builder.js +196 -0
  169. package/dist/retrieval/graph-builder.js.map +1 -0
  170. package/dist/retrieval/graph-cache.d.ts +15 -0
  171. package/dist/retrieval/graph-cache.d.ts.map +1 -0
  172. package/dist/retrieval/graph-cache.js +66 -0
  173. package/dist/retrieval/graph-cache.js.map +1 -0
  174. package/dist/retrieval/graph-invalidate.d.ts +18 -0
  175. package/dist/retrieval/graph-invalidate.d.ts.map +1 -0
  176. package/dist/retrieval/graph-invalidate.js +23 -0
  177. package/dist/retrieval/graph-invalidate.js.map +1 -0
  178. package/dist/retrieval/graph-retrieval.d.ts +24 -0
  179. package/dist/retrieval/graph-retrieval.d.ts.map +1 -0
  180. package/dist/retrieval/graph-retrieval.js +165 -0
  181. package/dist/retrieval/graph-retrieval.js.map +1 -0
  182. package/dist/retrieval/graph-traverse.d.ts +3 -0
  183. package/dist/retrieval/graph-traverse.d.ts.map +1 -0
  184. package/dist/retrieval/graph-traverse.js +53 -0
  185. package/dist/retrieval/graph-traverse.js.map +1 -0
  186. package/dist/retrieval/graph-types.d.ts +37 -0
  187. package/dist/retrieval/graph-types.d.ts.map +1 -0
  188. package/dist/retrieval/graph-types.js +12 -0
  189. package/dist/retrieval/graph-types.js.map +1 -0
  190. package/dist/retrieval/index-builder.d.ts +21 -0
  191. package/dist/retrieval/index-builder.d.ts.map +1 -0
  192. package/dist/retrieval/index-builder.js +94 -0
  193. package/dist/retrieval/index-builder.js.map +1 -0
  194. package/dist/retrieval/knowledge-selection.d.ts +7 -0
  195. package/dist/retrieval/knowledge-selection.d.ts.map +1 -0
  196. package/dist/retrieval/knowledge-selection.js +80 -0
  197. package/dist/retrieval/knowledge-selection.js.map +1 -0
  198. package/dist/retrieval/task-scoped.d.ts +23 -0
  199. package/dist/retrieval/task-scoped.d.ts.map +1 -0
  200. package/dist/retrieval/task-scoped.js +51 -0
  201. package/dist/retrieval/task-scoped.js.map +1 -0
  202. package/dist/utils/content-assembly.d.ts +44 -0
  203. package/dist/utils/content-assembly.d.ts.map +1 -0
  204. package/dist/utils/content-assembly.js +101 -0
  205. package/dist/utils/content-assembly.js.map +1 -0
  206. package/dist/utils/dag.d.ts +28 -0
  207. package/dist/utils/dag.d.ts.map +1 -0
  208. package/dist/utils/dag.js +68 -0
  209. package/dist/utils/dag.js.map +1 -0
  210. package/dist/utils/diagram-generator.d.ts +17 -0
  211. package/dist/utils/diagram-generator.d.ts.map +1 -0
  212. package/dist/utils/diagram-generator.js +38 -0
  213. package/dist/utils/diagram-generator.js.map +1 -0
  214. package/dist/utils/errors.d.ts +40 -0
  215. package/dist/utils/errors.d.ts.map +1 -0
  216. package/dist/utils/errors.js +83 -0
  217. package/dist/utils/errors.js.map +1 -0
  218. package/dist/utils/file-lock.d.ts +13 -0
  219. package/dist/utils/file-lock.d.ts.map +1 -0
  220. package/dist/utils/file-lock.js +80 -0
  221. package/dist/utils/file-lock.js.map +1 -0
  222. package/dist/utils/git.d.ts +14 -0
  223. package/dist/utils/git.d.ts.map +1 -0
  224. package/dist/utils/git.js +56 -0
  225. package/dist/utils/git.js.map +1 -0
  226. package/dist/utils/graphify-knowledge.d.ts +6 -0
  227. package/dist/utils/graphify-knowledge.d.ts.map +1 -0
  228. package/dist/utils/graphify-knowledge.js +60 -0
  229. package/dist/utils/graphify-knowledge.js.map +1 -0
  230. package/dist/utils/graphify.d.ts +49 -0
  231. package/dist/utils/graphify.d.ts.map +1 -0
  232. package/dist/utils/graphify.js +306 -0
  233. package/dist/utils/graphify.js.map +1 -0
  234. package/dist/utils/json-schemas.d.ts +723 -0
  235. package/dist/utils/json-schemas.d.ts.map +1 -0
  236. package/dist/utils/json-schemas.js +147 -0
  237. package/dist/utils/json-schemas.js.map +1 -0
  238. package/dist/utils/json.d.ts +15 -0
  239. package/dist/utils/json.d.ts.map +1 -0
  240. package/dist/utils/json.js +39 -0
  241. package/dist/utils/json.js.map +1 -0
  242. package/dist/utils/knowledge-store.d.ts +49 -0
  243. package/dist/utils/knowledge-store.d.ts.map +1 -0
  244. package/dist/utils/knowledge-store.js +191 -0
  245. package/dist/utils/knowledge-store.js.map +1 -0
  246. package/dist/utils/loop-state.d.ts +51 -0
  247. package/dist/utils/loop-state.d.ts.map +1 -0
  248. package/dist/utils/loop-state.js +123 -0
  249. package/dist/utils/loop-state.js.map +1 -0
  250. package/dist/utils/paths.d.ts +16 -0
  251. package/dist/utils/paths.d.ts.map +1 -0
  252. package/dist/utils/paths.js +66 -0
  253. package/dist/utils/paths.js.map +1 -0
  254. package/dist/utils/plan-store.d.ts +46 -0
  255. package/dist/utils/plan-store.d.ts.map +1 -0
  256. package/dist/utils/plan-store.js +184 -0
  257. package/dist/utils/plan-store.js.map +1 -0
  258. package/dist/utils/project-documents.d.ts +20 -0
  259. package/dist/utils/project-documents.d.ts.map +1 -0
  260. package/dist/utils/project-documents.js +10 -0
  261. package/dist/utils/project-documents.js.map +1 -0
  262. package/dist/utils/project-memory.d.ts +16 -0
  263. package/dist/utils/project-memory.d.ts.map +1 -0
  264. package/dist/utils/project-memory.js +16 -0
  265. package/dist/utils/project-memory.js.map +1 -0
  266. package/dist/utils/project-resolver.d.ts +28 -0
  267. package/dist/utils/project-resolver.d.ts.map +1 -0
  268. package/dist/utils/project-resolver.js +119 -0
  269. package/dist/utils/project-resolver.js.map +1 -0
  270. package/dist/utils/quick-scan.d.ts +13 -0
  271. package/dist/utils/quick-scan.d.ts.map +1 -0
  272. package/dist/utils/quick-scan.js +156 -0
  273. package/dist/utils/quick-scan.js.map +1 -0
  274. package/dist/utils/schemas.d.ts +13 -0
  275. package/dist/utils/schemas.d.ts.map +1 -0
  276. package/dist/utils/schemas.js +6 -0
  277. package/dist/utils/schemas.js.map +1 -0
  278. package/dist/utils/slug.d.ts +10 -0
  279. package/dist/utils/slug.d.ts.map +1 -0
  280. package/dist/utils/slug.js +18 -0
  281. package/dist/utils/slug.js.map +1 -0
  282. package/dist/utils/stdin.d.ts +6 -0
  283. package/dist/utils/stdin.d.ts.map +1 -0
  284. package/dist/utils/stdin.js +25 -0
  285. package/dist/utils/stdin.js.map +1 -0
  286. package/dist/utils/storage-utils.d.ts +48 -0
  287. package/dist/utils/storage-utils.d.ts.map +1 -0
  288. package/dist/utils/storage-utils.js +175 -0
  289. package/dist/utils/storage-utils.js.map +1 -0
  290. package/dist/utils/task-store.d.ts +49 -0
  291. package/dist/utils/task-store.d.ts.map +1 -0
  292. package/dist/utils/task-store.js +178 -0
  293. package/dist/utils/task-store.js.map +1 -0
  294. package/dist/utils/template.d.ts +15 -0
  295. package/dist/utils/template.d.ts.map +1 -0
  296. package/dist/utils/template.js +27 -0
  297. package/dist/utils/template.js.map +1 -0
  298. package/dist/utils/tool-response.d.ts +37 -0
  299. package/dist/utils/tool-response.d.ts.map +1 -0
  300. package/dist/utils/tool-response.js +44 -0
  301. package/dist/utils/tool-response.js.map +1 -0
  302. package/dist/utils/workflow-policy.d.ts +50 -0
  303. package/dist/utils/workflow-policy.d.ts.map +1 -0
  304. package/dist/utils/workflow-policy.js +111 -0
  305. package/dist/utils/workflow-policy.js.map +1 -0
  306. package/dist/utils/workspace-match.d.ts +35 -0
  307. package/dist/utils/workspace-match.d.ts.map +1 -0
  308. package/dist/utils/workspace-match.js +58 -0
  309. package/dist/utils/workspace-match.js.map +1 -0
  310. package/opencode/arcs/.opencode/plugins/arcs.js +348 -0
  311. package/opencode/arcs/bundle-runtime.json +68 -0
  312. package/opencode/arcs/manifest.json +279 -0
  313. package/opencode/arcs/prompts/arcs-docs.txt +124 -0
  314. package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +529 -0
  315. package/opencode/arcs/prompts/arcs-orchestrate.txt +437 -0
  316. package/opencode/arcs/prompts/code-reviewer.txt +55 -0
  317. package/opencode/arcs/prompts/devil-advocate.txt +121 -0
  318. package/opencode/arcs/prompts/docs-researcher.txt +54 -0
  319. package/opencode/arcs/prompts/oncall-ops.txt +54 -0
  320. package/opencode/arcs/prompts/qa-analyst.txt +54 -0
  321. package/opencode/arcs/prompts/software-engineer.txt +48 -0
  322. package/opencode/arcs/prompts/system-architect.txt +60 -0
  323. package/opencode/arcs/prompts/tech-architect.txt +54 -0
  324. package/opencode/arcs/skills/brainstorming/SKILL.md +144 -0
  325. package/opencode/arcs/skills/brainstorming/scripts/frame-template.html +214 -0
  326. package/opencode/arcs/skills/brainstorming/scripts/helper.js +88 -0
  327. package/opencode/arcs/skills/brainstorming/scripts/server.js +338 -0
  328. package/opencode/arcs/skills/brainstorming/scripts/start-server.sh +137 -0
  329. package/opencode/arcs/skills/brainstorming/scripts/stop-server.sh +31 -0
  330. package/opencode/arcs/skills/brainstorming/spec-document-reviewer-prompt.md +50 -0
  331. package/opencode/arcs/skills/brainstorming/visual-companion.md +277 -0
  332. package/opencode/arcs/skills/caveman-commit/SKILL.md +51 -0
  333. package/opencode/arcs/skills/code-agent/SKILL.md +58 -0
  334. package/opencode/arcs/skills/deep-pr-review/SKILL.md +191 -0
  335. package/opencode/arcs/skills/deep-pr-review/graphify-diff.md +102 -0
  336. package/opencode/arcs/skills/deep-pr-review/review-template.md +69 -0
  337. package/opencode/arcs/skills/executing-plans/SKILL.md +91 -0
  338. package/opencode/arcs/skills/init-project/SKILL.md +150 -0
  339. package/opencode/arcs/skills/quick-dev/SKILL.md +47 -0
  340. package/opencode/arcs/skills/requesting-code-review/SKILL.md +47 -0
  341. package/opencode/arcs/skills/requesting-code-review/code-reviewer.md +179 -0
  342. package/opencode/arcs/skills/subagent-driven-development/SKILL.md +162 -0
  343. package/opencode/arcs/skills/subagent-driven-development/code-quality-reviewer-prompt.md +53 -0
  344. package/opencode/arcs/skills/subagent-driven-development/implementer-prompt.md +148 -0
  345. package/opencode/arcs/skills/subagent-driven-development/spec-reviewer-prompt.md +85 -0
  346. package/opencode/arcs/skills/systematic-debugging/SKILL.md +174 -0
  347. package/opencode/arcs/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  348. package/opencode/arcs/skills/systematic-debugging/condition-based-waiting.md +115 -0
  349. package/opencode/arcs/skills/systematic-debugging/defense-in-depth.md +122 -0
  350. package/opencode/arcs/skills/systematic-debugging/find-polluter.sh +63 -0
  351. package/opencode/arcs/skills/systematic-debugging/phases-reference.md +168 -0
  352. package/opencode/arcs/skills/systematic-debugging/root-cause-tracing.md +169 -0
  353. package/opencode/arcs/skills/test-driven-development/SKILL.md +72 -0
  354. package/opencode/arcs/skills/test-driven-development/tdd-rationalizations-and-examples.md +157 -0
  355. package/opencode/arcs/skills/test-driven-development/testing-anti-patterns.md +299 -0
  356. package/opencode/arcs/skills/to-diagram/SKILL.md +235 -0
  357. package/opencode/arcs/skills/to-diagram/scripts/manage-diagram.mjs +963 -0
  358. package/opencode/arcs/skills/writing-plans/SKILL.md +179 -0
  359. package/opencode/arcs/skills/writing-plans/plan-document-reviewer-prompt.md +52 -0
  360. package/package.json +60 -0
  361. package/scripts/arcs-cli.mjs +45 -0
  362. package/skills/explore-dag.md +57 -0
  363. package/skills/init-project.md +105 -0
  364. package/skills/orchestrate.md +94 -0
  365. package/skills/update-docs.md +72 -0
  366. package/templates/dependency.md.tmpl +9 -0
  367. package/templates/knowledge.md.tmpl +15 -0
  368. package/templates/project-meta.json.tmpl +13 -0
  369. package/templates/project.md.tmpl +11 -0
  370. package/templates/task.md.tmpl +9 -0
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: subagent-driven-development
3
+ description: Use when executing implementation plans with independent tasks in the current session
4
+ ---
5
+
6
+ # Skill: Subagent-Driven Development
7
+
8
+ ## When
9
+
10
+ You have an implementation plan with mostly-independent tasks and want to execute them in-session via fresh subagents with two-stage review.
11
+
12
+ **NOT for:**
13
+ - If no subagent dispatch capability is available → use `executing-plans` instead (single-agent sequential)
14
+ - If the work is iterative self-correction without structured plan tasks → use `loop` instead
15
+
16
+ > CLI Primer: `arcs --commands --json` for discovery. Mutating commands run directly — no token.
17
+
18
+ ## Flow
19
+
20
+ ```mermaid
21
+ flowchart TD
22
+ A[Load plan + extract all tasks] --> B{Diagram .mmd exists?}
23
+ B -->|yes| C[arcs diagram ready → get parallel-safe nodes]
24
+ B -->|no| D[Pick next task sequentially]
25
+ C --> E[Read node metadata: skill, scope, acceptance, verify]
26
+ D --> F[Construct subagent prompt]
27
+ E --> F
28
+ F --> G[Dispatch implementer subagent]
29
+ G --> H{Subagent status?}
30
+ H -->|DONE / DONE_WITH_CONCERNS| I[Dispatch spec-reviewer subagent]
31
+ H -->|NEEDS_CONTEXT| J[Provide context, re-dispatch]
32
+ H -->|BLOCKED| K{Assess blocker}
33
+ J --> G
34
+ K -->|context gap| J
35
+ K -->|needs stronger model| L[Re-dispatch with capable model]
36
+ K -->|task too large| M[Split task, update plan]
37
+ K -->|plan wrong| N[Escalate to human]
38
+ L --> G
39
+ I --> O{Spec compliant?}
40
+ O -->|no| P[Implementer fixes spec gaps] --> I
41
+ O -->|yes| Q[Dispatch code-quality reviewer]
42
+ Q --> R{Quality approved?}
43
+ R -->|no| S[Implementer fixes quality issues] --> Q
44
+ R -->|yes| T[Mark task done]
45
+ T --> U{More tasks?}
46
+ U -->|yes| B
47
+ U -->|no| V[Dispatch final cross-task reviewer]
48
+ V --> W[Load skill: finishing-a-development-branch]
49
+ ```
50
+
51
+ ## Retry & Escalation
52
+
53
+ ```mermaid
54
+ flowchart TD
55
+ A[Subagent fails] --> B{First attempt?}
56
+ B -->|yes| C[Re-dispatch with more context or stronger model]
57
+ B -->|no| D{Same failure mode?}
58
+ D -->|yes| E[Escalate to human — don't loop]
59
+ D -->|no| C
60
+ C --> F{Success?}
61
+ F -->|yes| G[Continue pipeline]
62
+ F -->|no| D
63
+ ```
64
+
65
+ ## Diagram-First Dispatch
66
+
67
+ When the plan has a `.mmd` file:
68
+
69
+ 1. `arcs diagram ready <slug> <planId>` → all returned nodes are dispatch-safe in parallel
70
+ 2. Use per-node `%%` metadata (`skill`, `scope`, `files`, `acceptance`, `verify`) to construct prompts
71
+ 3. After completion: `arcs task transition <slug> <taskId> done --diagramNodeId=T001 --planId=<planId>`
72
+ 4. Re-run `diagram ready` to discover newly-unblocked nodes
73
+ 5. If node metadata is incomplete, fall back to reading the plan body for that task
74
+
75
+ **Ownership:** Dispatcher owns `.mmd` updates. Implementer subagents MUST NOT edit diagrams.
76
+
77
+ ## Sub-Agent Prompt Construction
78
+
79
+ Every implementer subagent prompt MUST include:
80
+
81
+ | Section | Content |
82
+ |---------|---------|
83
+ | **Goal** | Exact task description from plan (full text, not summary) |
84
+ | **Context** | Where this task fits in the plan; what came before |
85
+ | **Scope** | File boundaries — what to touch, what NOT to touch |
86
+ | **Acceptance** | Done criteria copied verbatim from plan/diagram |
87
+ | **Verify** | Exact command to run before claiming done |
88
+ | **Skill** | Which work-mode skill to load (from diagram metadata or inferred) |
89
+
90
+ Do NOT make the subagent read the plan file. Provide full text in the prompt.
91
+
92
+ ## Model Selection
93
+
94
+ | Task complexity | Model tier |
95
+ |----------------|-----------|
96
+ | 1-2 files, clear spec, mechanical | Fast/cheap |
97
+ | Multi-file integration, pattern matching | Standard |
98
+ | Architecture, design, review | Most capable |
99
+
100
+ ## Prompt Templates
101
+
102
+ - `./implementer-prompt.md`
103
+ - `./spec-reviewer-prompt.md`
104
+ - `./code-quality-reviewer-prompt.md`
105
+ - `./return-schema.md` — structured output format (inject into every dispatch)
106
+
107
+ ## Structured Return
108
+
109
+ All sub-agents MUST return a JSON block as the final thing in their message, per `./return-schema.md`.
110
+ Orchestrator parses `status` for routing, `payload` for action. Free-form prose above is fine.
111
+
112
+ Include in every dispatch prompt:
113
+ > "Return format: JSON envelope with status + typed payload. See return-schema.md for your role's schema."
114
+
115
+ ## Git State Discipline
116
+
117
+ - Sub-agents MUST NOT run `git stash` — ever, under any circumstance
118
+ - Sub-agents MUST NOT run `git checkout` on shared branches
119
+ - Sub-agents commit their changes atomically (scoped to task files) before reporting back
120
+ - Other agents may be working concurrently — do not assume a clean worktree
121
+ - Use `git diff HEAD -- <your-files>` to verify YOUR changes only — bare `git diff` is unreliable in parallel
122
+ - If you see unexpected changes in files outside your scope: **ignore them** — they belong to another agent
123
+
124
+ ## Verification Scoping
125
+
126
+ Sub-agents lint and test **only files they touched**:
127
+
128
+ | Scope | Command | NOT this |
129
+ |-------|---------|----------|
130
+ | Lint | `biome check src/changed.ts` | `biome check .` |
131
+ | Test | `vitest run test/changed.test.ts` | `vitest run` / `npm test` |
132
+ | Type check | `tsc --noEmit` (whole-project — exception) | — |
133
+
134
+ Full suite justified ONLY when change is pervasive (shared types, config, build).
135
+ Sub-agent must state `scopeReason` in return payload.
136
+
137
+ ## Parallelism Rules
138
+
139
+ Parallel implementers are allowed when tasks touch **zero shared files**.
140
+
141
+ 1. **Independence check:** Orchestrator verifies no file overlap before dispatch. If overlap → serialize.
142
+ 2. **Batch limit:** Maximum 4 concurrent subagents per round. Queue remaining.
143
+ 3. **Prompt construction:** Each subagent gets: Scope, Goal, Context, Constraints, Output format — all required.
144
+ 4. **Conflict detection:** After fan-out completes, check for conflicting edits before committing.
145
+ 5. **Shared context:** Fetch once (e.g., project brief), inject into all subagent prompts — don't make each agent re-fetch.
146
+
147
+ **When to serialize instead:**
148
+ - Tasks share source files (even different functions in same file)
149
+ - Task B's approach depends on Task A's output
150
+ - Both tasks modify test fixtures or shared mocks
151
+
152
+ ## Constraints
153
+
154
+ - Fresh subagent per task — never reuse session context
155
+ - Spec review BEFORE code quality review (never reverse)
156
+ - Parallel implementers only when zero file overlap (orchestrator verifies)
157
+ - Never skip re-review after fixes
158
+ - Never ignore BLOCKED/NEEDS_CONTEXT status — something must change
159
+ - Never start on main/master without explicit user consent
160
+ - If reviewer finds issues → implementer fixes → reviewer re-reviews → repeat until approved
161
+ - DONE_WITH_CONCERNS: read concerns before proceeding; address if correctness/scope related
162
+ - Scope changes discovered by subagents: report in summary, dispatcher handles diagram regeneration
@@ -0,0 +1,53 @@
1
+ # Code Quality Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a code quality reviewer subagent.
4
+
5
+ **Purpose:** Verify implementation is well-built (clean, tested, maintainable)
6
+
7
+ **Only dispatch after spec compliance review passes.**
8
+
9
+ ```
10
+ Task tool (arcs:code-reviewer):
11
+ Use template at requesting-code-review/code-reviewer.md
12
+
13
+ WHAT_WAS_IMPLEMENTED: [from implementer's report]
14
+ PLAN_OR_REQUIREMENTS: Task N from [plan-file]
15
+ BASE_SHA: [commit before task]
16
+ HEAD_SHA: [current commit]
17
+ DESCRIPTION: [task summary]
18
+ ```
19
+
20
+ **In addition to standard code quality concerns, the reviewer should check:**
21
+ - Does each file have one clear responsibility with a well-defined interface?
22
+ - Are units decomposed so they can be understood and tested independently?
23
+ - Is the implementation following the file structure from the plan?
24
+ - Did this implementation create new files that are already large, or significantly grow existing files? (Don't flag pre-existing file sizes — focus on what this change contributed.)
25
+
26
+ ## Report Format (MANDATORY)
27
+
28
+ Return prose explanation followed by this EXACT JSON block as the LAST thing in your message:
29
+
30
+ ```json
31
+ {
32
+ "status": "DONE | DONE_WITH_CONCERNS",
33
+ "summary": "<1-2 sentences: quality verdict>",
34
+ "payload": {
35
+ "approved": true,
36
+ "issues": [
37
+ {
38
+ "severity": "critical | important | minor",
39
+ "file": "src/foo.ts",
40
+ "line": 15,
41
+ "finding": "Variable name unclear",
42
+ "suggestion": "Rename `d` to `duration`"
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ ```
48
+
49
+ - `approved: true` = quality acceptable (minor issues OK)
50
+ - `approved: false` = must fix before proceeding (has critical/important issues)
51
+ - Severity: `critical` (must fix), `important` (should fix), `minor` (nice to fix)
52
+
53
+ **No prose after the JSON block.**
@@ -0,0 +1,148 @@
1
+ # Implementer Subagent Prompt Template
2
+
3
+ Use this template when dispatching an implementer subagent.
4
+
5
+ ```
6
+ Task tool (general-purpose):
7
+ description: "Implement Task N: [task name]"
8
+ prompt: |
9
+ You are implementing Task N: [task name]
10
+
11
+ ## Task Description
12
+
13
+ [FULL TEXT of task from plan - paste it here, don't make subagent read file]
14
+
15
+ ## Context
16
+
17
+ [Scene-setting: where this fits, dependencies, architectural context]
18
+
19
+ ## Before You Begin
20
+
21
+ If you have questions about:
22
+ - The requirements or acceptance criteria
23
+ - The approach or implementation strategy
24
+ - Dependencies or assumptions
25
+ - Anything unclear in the task description
26
+
27
+ **Ask them now.** Raise any concerns before starting work.
28
+
29
+ ## Your Job
30
+
31
+ Once you're clear on requirements:
32
+ 1. Implement exactly what the task specifies
33
+ 2. Write tests (following TDD if task says to)
34
+ 3. Verify implementation works (scoped — see below)
35
+ 4. Commit your work (scoped to your task files only: `git add <your-files>`)
36
+ 5. Self-review (see below)
37
+ 6. Report back with structured JSON
38
+
39
+ Work from: [directory]
40
+
41
+ **While you work:** If you encounter something unexpected or unclear, **ask questions**.
42
+ It's always OK to pause and clarify. Don't guess or make assumptions.
43
+
44
+ ## Git Rules
45
+
46
+ - NEVER run `git stash` — under any circumstance
47
+ - NEVER run `git checkout` on shared branches
48
+ - Commit your changes before reporting (scoped to your task files only: `git add <your-files>`)
49
+ - If you see changes to files outside your scope, IGNORE them — another agent owns those
50
+ - Use `git diff HEAD -- <files-you-changed>` to verify YOUR changes only
51
+ - Do NOT use bare `git diff` — it's unreliable when multiple agents share a worktree
52
+
53
+ ## Verification (Scoped)
54
+
55
+ Lint and test ONLY the files you touched:
56
+ - Lint: `biome check src/your-file.ts` (NOT `biome check .`)
57
+ - Test: `vitest run test/your-file.test.ts` (NOT `vitest run` or `npm test`)
58
+ - Type check: `tsc --noEmit` (this one is whole-project — exception)
59
+
60
+ Full suite only when your change is pervasive (shared types, config, build).
61
+ You MUST state why your verification scope is sufficient in your report.
62
+
63
+ ## Code Organization
64
+
65
+ You reason best about code you can hold in context at once, and your edits are more
66
+ reliable when files are focused. Keep this in mind:
67
+ - Follow the file structure defined in the plan
68
+ - Each file should have one clear responsibility with a well-defined interface
69
+ - If a file you're creating is growing beyond the plan's intent, stop and report
70
+ it as DONE_WITH_CONCERNS — don't split files on your own without plan guidance
71
+ - If an existing file you're modifying is already large or tangled, work carefully
72
+ and note it as a concern in your report
73
+ - In existing codebases, follow established patterns. Improve code you're touching
74
+ the way a good developer would, but don't restructure things outside your task.
75
+
76
+ ## When You're in Over Your Head
77
+
78
+ It is always OK to stop and say "this is too hard for me." Bad work is worse than
79
+ no work. You will not be penalized for escalating.
80
+
81
+ **STOP and escalate when:**
82
+ - The task requires architectural decisions with multiple valid approaches
83
+ - You need to understand code beyond what was provided and can't find clarity
84
+ - You feel uncertain about whether your approach is correct
85
+ - The task involves restructuring existing code in ways the plan didn't anticipate
86
+ - You've been reading file after file trying to understand the system without progress
87
+
88
+ **How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
89
+ specifically what you're stuck on, what you've tried, and what kind of help you need.
90
+ The controller can provide more context, re-dispatch with a more capable model,
91
+ or break the task into smaller pieces.
92
+
93
+ ## Before Reporting Back: Self-Review
94
+
95
+ Review your work with fresh eyes. Ask yourself:
96
+
97
+ **Completeness:**
98
+ - Did I fully implement everything in the spec?
99
+ - Did I miss any requirements?
100
+ - Are there edge cases I didn't handle?
101
+
102
+ **Quality:**
103
+ - Is this my best work?
104
+ - Are names clear and accurate (match what things do, not how they work)?
105
+ - Is the code clean and maintainable?
106
+
107
+ **Discipline:**
108
+ - Did I avoid overbuilding (YAGNI)?
109
+ - Did I only build what was requested?
110
+ - Did I follow existing patterns in the codebase?
111
+
112
+ **Testing:**
113
+ - Do tests actually verify behavior (not just mock behavior)?
114
+ - Did I follow TDD if required?
115
+ - Are tests comprehensive?
116
+
117
+ If you find issues during self-review, fix them now before reporting.
118
+
119
+ ## Report Format (MANDATORY)
120
+
121
+ When done, return prose explanation followed by this EXACT JSON block as the LAST thing in your message:
122
+
123
+ ```json
124
+ {
125
+ "status": "DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT",
126
+ "summary": "<1-2 sentences: what was accomplished>",
127
+ "payload": {
128
+ "filesChanged": ["src/foo.ts", "test/foo.test.ts"],
129
+ "filesCreated": ["src/bar.ts"],
130
+ "verification": {
131
+ "command": "<exact command you ran>",
132
+ "result": "pass | fail",
133
+ "scopeReason": "<why this scope is sufficient>"
134
+ },
135
+ "concerns": [],
136
+ "scopeChanges": []
137
+ }
138
+ }
139
+ ```
140
+
141
+ - `concerns`: doubts about correctness (use with DONE_WITH_CONCERNS)
142
+ - `scopeChanges`: discovered work outside task boundaries (orchestrator handles)
143
+ - Use BLOCKED if you cannot complete the task
144
+ - Use NEEDS_CONTEXT if you need information that wasn't provided
145
+ - Never silently produce work you're unsure about
146
+
147
+ **No prose after the JSON block.**
148
+ ```
@@ -0,0 +1,85 @@
1
+ # Spec Compliance Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a spec compliance reviewer subagent.
4
+
5
+ **Purpose:** Verify implementer built what was requested (nothing more, nothing less)
6
+
7
+ ```
8
+ Task tool (general-purpose):
9
+ description: "Review spec compliance for Task N"
10
+ prompt: |
11
+ You are reviewing whether an implementation matches its specification.
12
+
13
+ ## What Was Requested
14
+
15
+ [FULL TEXT of task requirements]
16
+
17
+ ## What Implementer Claims They Built
18
+
19
+ [From implementer's report]
20
+
21
+ ## CRITICAL: Do Not Trust the Report
22
+
23
+ The implementer finished suspiciously quickly. Their report may be incomplete,
24
+ inaccurate, or optimistic. You MUST verify everything independently.
25
+
26
+ **DO NOT:**
27
+ - Take their word for what they implemented
28
+ - Trust their claims about completeness
29
+ - Accept their interpretation of requirements
30
+
31
+ **DO:**
32
+ - Read the actual code they wrote
33
+ - Compare actual implementation to requirements line by line
34
+ - Check for missing pieces they claimed to implement
35
+ - Look for extra features they didn't mention
36
+
37
+ ## Your Job
38
+
39
+ Read the implementation code and verify:
40
+
41
+ **Missing requirements:**
42
+ - Did they implement everything that was requested?
43
+ - Are there requirements they skipped or missed?
44
+ - Did they claim something works but didn't actually implement it?
45
+
46
+ **Extra/unneeded work:**
47
+ - Did they build things that weren't requested?
48
+ - Did they over-engineer or add unnecessary features?
49
+ - Did they add "nice to haves" that weren't in spec?
50
+
51
+ **Misunderstandings:**
52
+ - Did they interpret requirements differently than intended?
53
+ - Did they solve the wrong problem?
54
+ - Did they implement the right feature but wrong way?
55
+
56
+ **Verify by reading code, not by trusting report.**
57
+
58
+ ## Report Format (MANDATORY)
59
+
60
+ Return prose explanation followed by this EXACT JSON block as the LAST thing in your message:
61
+
62
+ ```json
63
+ {
64
+ "status": "DONE | DONE_WITH_CONCERNS",
65
+ "summary": "<1-2 sentences: compliance verdict>",
66
+ "payload": {
67
+ "compliant": true,
68
+ "issues": [
69
+ {
70
+ "file": "src/foo.ts",
71
+ "line": 42,
72
+ "requirement": "Must validate input length",
73
+ "finding": "No length check present"
74
+ }
75
+ ]
76
+ }
77
+ }
78
+ ```
79
+
80
+ - `compliant: true` + empty `issues` = spec met
81
+ - `compliant: false` + populated `issues` = gaps found (use DONE_WITH_CONCERNS)
82
+ - Each issue must reference the specific requirement and what's missing/extra
83
+
84
+ **No prose after the JSON block.**
85
+ ```
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: systematic-debugging
3
+ description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
4
+ ---
5
+
6
+ # Skill: systematic-debugging
7
+
8
+ ## When
9
+
10
+ Any bug, test failure, or unexpected behavior — before proposing fixes.
11
+
12
+ > Follows ARCS CLI Primer: `arcs --commands --json` for discovery, `--json --lean` on all calls.
13
+
14
+ ## Flow
15
+
16
+ ```mermaid
17
+ flowchart TD
18
+ classDef decision fill:#f59e0b,color:#fff
19
+ classDef stop fill:#ef4444,color:#fff
20
+
21
+ Bug[Bug observed] --> ARCS[Check ARCS knowledge]
22
+ ARCS --> Found{Match found?}
23
+ Found -->|Yes| Verify[Verify it applies]
24
+ Found -->|No| Observe
25
+
26
+ Verify -->|Applies| Fix
27
+ Verify -->|Doesn't apply| Observe
28
+
29
+ Observe[Phase 1: Observe] --> Repro{Reproducible?}
30
+ Repro -->|No| Instrument[Add logging/tracing]
31
+ Instrument --> Observe
32
+ Repro -->|Yes| Hypothesize[Phase 2: Hypothesize]
33
+
34
+ Hypothesize --> Compare[Find working example, list differences]
35
+ Compare --> Theory[Form single specific hypothesis]
36
+
37
+ Theory --> Isolate[Phase 3: Isolate]
38
+ Isolate --> Test{Smallest change confirms?}
39
+ Test -->|Yes| Fix[Phase 4: Fix]
40
+ Test -->|No| FailCount{3+ failures?}
41
+ FailCount -->|No| Theory
42
+ FailCount -->|Yes| Arch[Question architecture]
43
+
44
+ Fix --> WriteFail[Write failing test]
45
+ WriteFail --> Implement[Single targeted fix]
46
+ Implement --> Green{Tests pass?}
47
+ Green -->|Yes| Capture[Capture as ARCS knowledge]
48
+ Green -->|No| FailCount
49
+
50
+ class Found,Repro,Test,FailCount,Green decision
51
+ class Arch stop
52
+ ```
53
+
54
+ ## Phase 1: Observe (Root Cause Investigation)
55
+
56
+ - Read the actual error message completely
57
+ - Reproduce consistently before proceeding
58
+ - Check recent changes (`git log`, `git diff`)
59
+ - Trace data flow backward from failure point
60
+ - Instrument component boundaries if cause unclear
61
+ - **Pre-step:** `arcs knowledge search <slug> "<error>" --json` for gotcha/lesson/pattern entries
62
+
63
+ ## Phase 2: Hypothesize (Pattern Analysis)
64
+
65
+ - Find a working example in the same codebase
66
+ - Compare working vs broken — list every difference
67
+ - Understand the dependency chain
68
+ - Form ONE specific hypothesis (not multiple)
69
+
70
+ ## Phase 3: Isolate
71
+
72
+ - Test with the smallest possible change
73
+ - One variable at a time — never stack fixes
74
+ - If hypothesis fails, form a new one from evidence
75
+ - **Escalation:** 3+ failed fixes → question the architecture, not the symptom
76
+
77
+ ## Phase 4: Fix
78
+
79
+ - Write a failing test FIRST (proves the bug exists)
80
+ - Implement a single targeted fix
81
+ - Verify all tests pass
82
+ - If fix introduces new failures, revert and return to Phase 2
83
+
84
+ ## Log Triage Protocol
85
+
86
+ **Scan order:** failure point → errors → warnings → timing anomalies
87
+
88
+ ```bash
89
+ rg -n "ERROR|FATAL|panic|exception" <logfile> # Error grep
90
+ jq 'select(.level == "error")' <json-log> # Structured logs
91
+ ```
92
+
93
+ **Output:** Timeline of events leading to failure (T-5m, T-3m, T-0).
94
+
95
+ ## Git Bisect (Regressions)
96
+
97
+ ```bash
98
+ git bisect start
99
+ git bisect bad HEAD
100
+ git bisect good <last-known-good>
101
+ git bisect run <test-command>
102
+ ```
103
+
104
+ After finding the commit: read the diff, isolate specific lines, feed into Phase 2.
105
+
106
+ ## Dependency Conflict Diagnosis
107
+
108
+ | Symptom | Likely Cause |
109
+ |---------|-------------|
110
+ | `instanceof` fails across modules | Duplicate package copies |
111
+ | Type mismatch on same interface | Different versions loaded |
112
+ | "Cannot find module" intermittent | Hoisting conflict |
113
+ | Works with `--legacy-peer-deps` | Peer dep unsatisfied |
114
+
115
+ Diagnose: `npm ls <pkg>`, `npm explain <pkg>`, check for multiple copies.
116
+
117
+ ## ARCS Knowledge Capture
118
+
119
+ After root cause identified, persist as knowledge:
120
+ - **gotcha** — environmental/config traps
121
+ - **lesson** — architectural insights from this session
122
+ - **pattern** — reusable solution to recurring problem
123
+
124
+ Include: root cause summary, evidence, affected files, fix approach.
125
+
126
+ ### Capture Resolution as Knowledge
127
+
128
+ After resolving the issue, persist the learning:
129
+
130
+ ```bash
131
+ # For a surprising behavior or trap
132
+ arcs knowledge create <slug> "Redis connection pool exhaustion under load" \
133
+ --kind=gotcha \
134
+ --summary="Pool size defaults to 10; under concurrent requests >50, connections time out silently" \
135
+ --body="Root cause: default pool size. Fix: set poolSize to max(50, expectedConcurrency). Symptoms: intermittent 503s with no error logs." \
136
+ --json
137
+
138
+ # For a reusable debugging technique or resolution pattern
139
+ arcs knowledge create <slug> "Diagnosing silent connection failures" \
140
+ --kind=lesson \
141
+ --summary="Enable connection-level event logging before load testing" \
142
+ --body="Attach listeners to pool 'error' and 'timeout' events. Default Node.js behavior swallows these." \
143
+ --json
144
+
145
+ # For a pattern that should be followed going forward
146
+ arcs knowledge create <slug> "Connection pool sizing formula" \
147
+ --kind=pattern \
148
+ --summary="Pool size = max(50, 2x expected peak concurrency)" \
149
+ --body="Applies to Redis, Postgres, and HTTP agent pools. Validated under load test 2026-05-26." \
150
+ --json
151
+ ```
152
+
153
+ **Kind selection guide:**
154
+ - `gotcha` — surprising behavior, trap, or non-obvious failure mode
155
+ - `lesson` — learned technique, debugging approach, resolution method
156
+ - `pattern` — reusable solution that should be applied going forward
157
+
158
+ ## Constraints
159
+
160
+ - **NO FIXES WITHOUT ROOT CAUSE INVESTIGATION.** If Phase 1 incomplete, you cannot propose fixes.
161
+ - **One variable at a time.** Never apply multiple changes simultaneously.
162
+ - **3+ failures = architectural problem.** Stop fixing symptoms, question the pattern.
163
+ - **Test before fix.** Failing test proves the bug; green test proves the fix.
164
+ - **Defense in depth:** After fixing root cause, add validation at multiple layers to prevent recurrence.
165
+ - **Systematic is faster than thrashing.** 15-30min systematic vs 2-3h random fixes.
166
+
167
+ ## Red Flags (Return to Phase 1)
168
+
169
+ - "Quick fix for now, investigate later"
170
+ - "Just try changing X and see"
171
+ - Proposing solutions before tracing data flow
172
+ - Each fix reveals a new problem in a different place
173
+ - "I don't fully understand but this might work"
174
+ - Human says "stop guessing" or "is that not happening?"