@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
package/README.md ADDED
@@ -0,0 +1,448 @@
1
+ # ARCS
2
+
3
+ > Give AI agents durable memory — so they start from context, not a blank slate.
4
+
5
+ ARCS tracks projects, tasks, plans, and knowledge as a directed acyclic graph (DAG) stored in `~/.arcs/`. AI agents call `arcs <command>` to read structured project context instead of scanning codebases from scratch each session.
6
+
7
+ The name is a direct nod to graph theory — where nodes are connected by "arcs" (directed edges). It perfectly describes this DAG-based task orchestration tool.
8
+
9
+ ---
10
+
11
+ ## What Is ARCS
12
+
13
+ Every AI coding session starts fresh. ARCS fixes that by maintaining three persistent surfaces per project:
14
+
15
+ ```mermaid
16
+ graph LR
17
+ CTX["arcs context\n──────────\noperating brief\ncurrent focus\nnext action"]
18
+
19
+ subgraph Q["Queue (tasks.md + tasks/index.json)"]
20
+ QD["backlog → in_progress → done\nimmediate work items"]
21
+ end
22
+ subgraph P["Plan (plans/*.md + .diagram.mmd)"]
23
+ PD["proposed → in_progress → done\nmulti-step feature work"]
24
+ end
25
+ subgraph M["Memory (knowledge/*.md)"]
26
+ MD["lessons · patterns · gotchas · architecture\ndurable, searchable, BM25-indexed"]
27
+ end
28
+
29
+ CTX --> Q
30
+ CTX --> P
31
+ CTX --> M
32
+ ```
33
+
34
+ An agent calls `arcs brief` at session start and receives an **operating brief** (~890-byte routing envelope with `currentFocus`, `recommendedSurface`, and `nextAction`) — without reading a single source file.
35
+
36
+ ---
37
+
38
+ ## How It Works
39
+
40
+ ### Orchestrator → Workflow → DAG
41
+
42
+ ```mermaid
43
+ flowchart TD
44
+ User(["User / Agent Request"])
45
+ Orch{"ARCS Orchestrator\nClassify intent"}
46
+
47
+ Init["INIT\nCreate project\nScan codebase\nPopulate docs & knowledge"]
48
+ Brain["BRAINSTORM\nExplore state\nCreate plans + tasks\nGenerate diagram"]
49
+ Exec["EXECUTE\nSelect unblocked task\nDispatch implementer\nUpdate DAG"]
50
+ Sync["SYNC\nRe-scan codebase\nAudit docs\nReconcile drift"]
51
+ Explore["EXPLORE\nList projects\nInspect status\n(read-only)"]
52
+ Multi["MULTI\nChain workflows\nin parallel or sequence"]
53
+
54
+ DAG[("~/.arcs/\nProjects · Tasks · Plans\nKnowledge · Diagrams")]
55
+
56
+ User --> Orch
57
+ Orch -- "new project" --> Init
58
+ Orch -- "plan features" --> Brain
59
+ Orch -- "do work" --> Exec
60
+ Orch -- "update docs" --> Sync
61
+ Orch -- "inspect" --> Explore
62
+ Orch -- "compound" --> Multi
63
+
64
+ Multi -.-> Init & Brain & Exec & Sync & Explore
65
+
66
+ Init & Brain & Exec & Sync & Explore --> DAG
67
+ ```
68
+
69
+ ### T0 Orientation
70
+
71
+ ```bash
72
+ arcs brief --lean --json
73
+ # → currentFocus, recommendedSurface, nextAction (~890-byte routing envelope)
74
+ ```
75
+
76
+ The orchestrator calls `arcs brief` at the start of every session to orient without loading any source files. `--lean` strips timestamps for token efficiency.
77
+
78
+ ### Confidence Gate
79
+
80
+ Before any irreversible action (DAG write, code edit, plan creation), the orchestrator self-scores 0–100% confidence with cited evidence. Threshold: 80% (85% for cross-cutting changes). Reads and exploration are never gated. Self-report without citations is invalid.
81
+
82
+ ### Mutations
83
+
84
+ Mutating commands run directly — no token, no proposal. Reads and writes share the same `arcs <command> [args] --json` shape.
85
+
86
+ ---
87
+
88
+ ## Prerequisites
89
+
90
+ | Requirement | Version | Notes |
91
+ |---|---|---|
92
+ | [Node.js](https://nodejs.org/) | v18+ | Required |
93
+ | [OpenCode](https://opencode.ai/) | latest | Required for agent integration |
94
+ | [gh (GitHub CLI)](https://cli.github.com/) | any | Required — used by skills like `deep-pr-review` |
95
+ | [graphify](https://github.com/safishamsi/graphify) | any | Optional — AST code-graph analysis |
96
+ | [rtk](https://github.com/rtk-ai/rtk) | any | Optional — improves AI command usage tracking |
97
+
98
+ **Install RTK:**
99
+ ```bash
100
+ rtk init -g # Install hook + RTK.md (recommended)
101
+ rtk init -g --opencode # OpenCode plugin (instead of Claude Code)
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Quick Start
107
+
108
+ **1. Install from npm**
109
+
110
+ ```bash
111
+ npm install -g @rryando/arcs
112
+ ```
113
+
114
+ **2. Run the setup wizard**
115
+
116
+ ```bash
117
+ npm run init
118
+ ```
119
+
120
+ The wizard:
121
+ 1. Builds the TypeScript source
122
+ 2. Registers the `arcs` CLI at `~/.local/bin/arcs`
123
+ 3. Creates `~/.arcs/` (project data store)
124
+ 4. Deploys bundled agents + skills into `~/.config/opencode/`
125
+
126
+ **3. Track a project**
127
+
128
+ Open OpenCode in your desired project folder, then call `arcs init` to register it with ARCS:
129
+
130
+ ```bash
131
+ arcs init
132
+ ```
133
+
134
+ This creates the DAG structure for the project and registers the current directory as a workspace path.
135
+
136
+ **4. Start using ARCS**
137
+
138
+ You'll see the **ARCS Orchestrator** listed as a selectable agent in OpenCode. Every session starts with an operating brief instead of a blank slate:
139
+
140
+ ```bash
141
+ arcs context
142
+ # → project overview, current focus, active plans, relevant knowledge
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Agents
148
+
149
+ ### Primary Agents
150
+
151
+ These are registered as selectable agents in OpenCode. You interact with them directly.
152
+
153
+ | Agent | Token Mode | Description |
154
+ |---|---|---|
155
+ | **ARCS Orchestrator** | Full prose | Classifies intent, routes to workflows, delegates to sub-agents, writes DAG |
156
+ | **ARCS Caveman** | ~65% fewer tokens | Identical capabilities; caveman-speak for chat narration only |
157
+
158
+ The orchestrator follows three phases on every request:
159
+ 1. **Classify** — detect intent (INIT / BRAINSTORM / EXECUTE / SYNC / EXPLORE / MULTI)
160
+ 2. **Route** — delegate to the right workflow and specialist sub-agents
161
+ 3. **Complete** — summarize what was done, current state, and next steps
162
+
163
+ ARCS Caveman supports three intensity levels: `lite`, `full` (default), `ultra`. Code, tool arguments, DAG content, and commit messages are always full prose regardless of mode.
164
+
165
+ ### Sub-Agents
166
+
167
+ Dispatched automatically by the orchestrator. You do not interact with them directly.
168
+
169
+ | Sub-Agent | Role | Model |
170
+ |---|---|---|
171
+ | **software-engineer** | Implementation specialist. Writes code, runs tests, ships features. Loads quick-dev, code-agent, TDD, executing-plans skills as needed. | Opus |
172
+ | **tech-architect** | Architecture and analysis specialist. Deep structural reasoning, refactor guidance, trade-off evaluation, and root cause analysis without making hasty edits. | Haiku |
173
+ | **qa-analyst** | Quality enforcement specialist. Proactive code audits, convention compliance, and verification gate enforcement. | Haiku |
174
+ | **oncall-ops** | Debugging and diagnosis specialist. Finds root causes through systematic investigation, log triage, bisect, and performance profiling. | Opus |
175
+ | **arcs-docs** | ARCS documentation specialist. Manages plans, knowledge entries, diagrams, and DAG health. | Opus |
176
+ | **system-architect** | Architecture and design specialist. Module boundaries, dependency graphs, migration strategies, and cross-project design decisions. | Opus |
177
+ | **code-reviewer** | Reviews code changes for production readiness. Catches correctness, maintainability, and testing issues. | Haiku |
178
+ | **docs-researcher** | Handles documentation writing, research synthesis, and document-heavy analysis tasks. | Opus |
179
+
180
+ ---
181
+
182
+ ## Skills
183
+
184
+ Skills are instruction sets loaded on demand. The orchestrator auto-layers them based on context; sub-agents load them at dispatch time.
185
+
186
+ ### Work Mode (select exactly one per code-change dispatch)
187
+
188
+ | Skill | Load When |
189
+ |---|---|
190
+ | `quick-dev` | Fully bounded — rename, refactor, config nudge, trivial bugfix |
191
+ | `code-agent` | 50–90% clear, 1–2 open decisions resolvable from the repo |
192
+ | `test-driven-development` | New feature or bugfix — test-first discipline adds value |
193
+ | `brainstorming` | Design open, product direction genuinely unclear |
194
+
195
+ ### Lifecycle & Planning (layer on top of work mode)
196
+
197
+ | Skill | Load When |
198
+ |---|---|
199
+ | `writing-plans` | Have requirements, about to create a structured plan |
200
+ | `executing-plans` | Have a plan, executing it in a separate session with checkpoints |
201
+ | `subagent-driven-development` | Multi-task plan with independent leaf nodes |
202
+ | `verification-before-completion` | Before claiming "done" on any non-trivial change |
203
+ | `requesting-code-review` | Self-review gate at phase/feature completion |
204
+ | `deep-pr-review` | Deep PR review triggered from a GitHub PR link |
205
+
206
+ ### Diagnosis & Tooling
207
+
208
+ | Skill | Load When |
209
+ |---|---|
210
+ | `systematic-debugging` | Any bug, test failure, or unexpected behavior |
211
+ | `confidence-gate` | Before irreversible actions — self-score with citations |
212
+ | `to-diagram` | Creating or updating a Mermaid plan diagram |
213
+ | `init-project` | Initializing a new ARCS project into the DAG |
214
+ | `caveman-commit` | Writing git commit messages in ARCS Caveman mode |
215
+
216
+ ---
217
+
218
+ ## Data Model
219
+
220
+ ```
221
+ ~/.arcs/
222
+ ├── meta.json # Global registry — all project slugs
223
+ └── projects/
224
+ └── {slug}/
225
+ ├── meta.json # name · description · status · workspacePaths · lastSyncedAt
226
+ ├── overview.md # 2-3 sentence summary + goals ← summary docs
227
+ ├── tasks.md # Execution queue (auto-rendered from structured tasks)
228
+ ├── dependencies.md # Upstream / downstream project edges
229
+ ├── knowledge.md # Pointer page → knowledge/ entries
230
+ ├── AGENTS.md # Auto-generated guardrail doc (symlinked into workspace)
231
+ ├── tasks/
232
+ │ └── index.json # Structured task records (status, priority, planId)
233
+ ├── plans/
234
+ │ ├── {planId}.meta.json
235
+ │ ├── {planId}.md # Plan body (prose) ← structured stores
236
+ │ └── {planId}.diagram.mmd # Mermaid execution map (agents read this first)
237
+ └── knowledge/
238
+ ├── index.json
239
+ ├── {entryId}.meta.json
240
+ └── {entryId}.md # Knowledge entry body
241
+ ```
242
+
243
+ ### Summary Docs vs Structured Stores
244
+
245
+ | Layer | Files | Purpose |
246
+ |---|---|---|
247
+ | **Summary docs** | `overview.md`, `tasks.md`, `dependencies.md`, `knowledge.md` | Quick-orientation landing pages — short, scannable, always current |
248
+ | **Structured stores** | `plans/*.md`, `knowledge/*.md`, `tasks/index.json` | Full documents with indexed metadata — durable, searchable, detailed |
249
+
250
+ ### Project Lifecycle
251
+
252
+ ```
253
+ draft → active → completed → archived
254
+ ```
255
+
256
+ ### Plan Diagrams
257
+
258
+ Each plan has an associated `.diagram.mmd` file — a Mermaid flowchart that serves as the **agent execution map**. Agents read the diagram first for task selection before loading plan prose.
259
+
260
+ Node status is encoded via `classDef`:
261
+
262
+ | Class | Meaning |
263
+ |---|---|
264
+ | `:::backlog` | Not started |
265
+ | `:::in_progress` | Active |
266
+ | `:::done` | Complete |
267
+ | `:::blocked` | Waiting on dependency |
268
+
269
+ ---
270
+
271
+ ## Workspace Integration
272
+
273
+ Registering a workspace path enables two features:
274
+
275
+ **1. Context resolution** — `arcs context --path=/path/to/repo` matches the directory to its ARCS project and returns the operating brief, current focus, active plans, and relevant knowledge.
276
+
277
+ **2. AGENTS.md generation** — `arcs sync-agents-md <slug>` assembles a coding guardrail document from three sources and symlinks it into each workspace:
278
+
279
+ | Source | Content |
280
+ |---|---|
281
+ | Coding discipline | Non-negotiable rules (DRY, single responsibility, etc.) |
282
+ | Codebase analysis | LLM-provided scan of tech stack, patterns, file structure |
283
+ | Project context | ARCS overview, current focus, dependencies, active plans |
284
+
285
+ ---
286
+
287
+ ## Development
288
+
289
+ ### Setup
290
+
291
+ ```bash
292
+ npm install
293
+ npm run build
294
+ ```
295
+
296
+ ### Commands
297
+
298
+ | Command | Description |
299
+ |---|---|
300
+ | `npm run build` | Compile TypeScript → `dist/` |
301
+ | `npm run dev` | Watch mode (rebuild on change) |
302
+ | `npm test` | Run Vitest test suite (62 test files, 685 tests) |
303
+ | `npm run typecheck` | Type check without emit |
304
+ | `npm run lint` | Biome lint + format check |
305
+ | `npm run lint:fix` | Auto-fix lint and format issues |
306
+ | `npm run format` | Format only |
307
+
308
+ Full quality gate before committing:
309
+ ```bash
310
+ npm test && npm run typecheck && npm run lint
311
+ ```
312
+
313
+ ### Testing Patterns
314
+
315
+ | Pattern | Detail |
316
+ |---|---|
317
+ | Framework | Vitest |
318
+ | DAG isolation | `withTempDataDir()` — each test gets a fresh `~/.arcs/` |
319
+ | No mocks | Core DAG I/O tests operate on real (temp) filesystem |
320
+ | Test location | All tests in `test/` (not co-located with source) |
321
+
322
+ ### Environment
323
+
324
+ ```bash
325
+ # Override data directory (default: ~/.arcs/)
326
+ ARCS_DATA_DIR=/path/to/custom/dir arcs context
327
+ ```
328
+
329
+ ---
330
+
331
+ ## Bundle Release Playbook
332
+
333
+ > **Rule:** repo → config only. Never overwrite repo files from config.
334
+
335
+ | Step | Command | Notes |
336
+ |---|---|---|
337
+ | 1. Edit | Modify `opencode/arcs/skills/` or `opencode/arcs/prompts/` | Source of truth is the repo |
338
+ | 2. Build | `npm run build:opencode-bundle` | Produces hashes, runtime JSON |
339
+ | 3. Lint | `arcs lint-bundle` | Must pass with zero errors |
340
+ | 4. Dry-run | `arcs deploy-superpowers --dry-run` | Review `filesAdded / filesChanged / filesRemoved` |
341
+ | 5. Deploy | `arcs deploy-superpowers` | Writes to `~/.config/opencode/` |
342
+ | 6. Restart | Restart OpenCode / IDE | Skills load at startup |
343
+
344
+ ---
345
+
346
+ ## Graphify Integration (Optional)
347
+
348
+ Graphify performs AST-based static analysis of your codebase and ingests the results as ARCS knowledge entries — without any LLM API calls.
349
+
350
+ See installation instructions at **https://github.com/safishamsi/graphify**.
351
+
352
+ ### What gets extracted
353
+
354
+ | Category | Cap | Description |
355
+ |---|---|---|
356
+ | God nodes | 8 | Highest-connectivity modules — likely architectural hubs |
357
+ | Architecture clusters | 8 | Directory-based groupings revealing module boundaries |
358
+ | Cross-module couplings | 5 | Links between high-degree nodes across top-level directories |
359
+
360
+ ### When it runs
361
+
362
+ | Trigger | Action |
363
+ |---|---|
364
+ | `arcs init` | Full extraction → up to 20 knowledge proposals → creates DAG entries |
365
+ | SYNC workflow | Re-extracts, compares against existing entries, surfaces stale / new / drifted |
366
+ | Ad-hoc | `arcs graphify-sync <slug>` — re-extracts codebase graph on demand |
367
+
368
+ Output: `graphify-out/graph.json` in workspace (auto-added to `.gitignore`).
369
+
370
+ If graphify is not installed, ARCS operates normally — all graphify features are gated behind availability checks.
371
+
372
+ ---
373
+
374
+ ## Project Structure
375
+
376
+ ```
377
+ arcs/
378
+ ├── src/
379
+ │ ├── index.ts # Main entry point — dispatches to CLI
380
+ │ ├── cli/
381
+ │ │ ├── index.ts # Registry-first CLI router + fallback
382
+ │ │ ├── command-registry.ts # Declarative command registration system
383
+ │ │ ├── arg-parser.ts # Schema-driven argument parser
384
+ │ │ ├── output-envelope.ts # Structured JSON output ({ok, data} / {ok, code, message})
385
+ │ │ ├── help-generator.ts # Auto-generated help text from registry
386
+ │ │ ├── dag-commands.ts # LEGACY: thin delegation shell (backward-compat)
387
+ │ │ ├── brief-renderer.ts # Renders brief output for arcs brief command
388
+ │ │ ├── md-renderer.ts # Markdown rendering utilities
389
+ │ │ ├── bundle-installer.ts # OpenCode bundle installer
390
+ │ │ ├── setup.ts # Interactive setup wizard
391
+ │ │ ├── lean-output.ts # --lean flag support (strip timestamps)
392
+ │ │ ├── arcs-orchestrate.ts # Orchestrator prompt content
393
+ │ │ ├── status-dashboard.ts # TTY status overview
394
+ │ │ └── commands/ # 17 focused command modules (≤400 lines each)
395
+ │ │ ├── index.ts # Trigger all command registrations (side-effects)
396
+ │ │ ├── brief.ts # T0 operating brief
397
+ │ │ ├── next.ts # arcs next — get next task + related knowledge
398
+ │ │ ├── done.ts # arcs done — mark task complete (--learn flag)
399
+ │ │ ├── remember.ts # arcs remember — capture knowledge (auto-classify)
400
+ │ │ ├── status.ts # arcs status — progress overview
401
+ │ │ ├── project.ts # project list, get, init, validate
402
+ │ │ ├── project-updates.ts # project update-doc, update-status, update-paths
403
+ │ │ ├── task.ts # task list, get, create, transition, update, delete
404
+ │ │ ├── plan.ts # plan list, get, create, update-meta, update-body, delete
405
+ │ │ ├── knowledge.ts # knowledge CRUD
406
+ │ │ ├── knowledge-search.ts # Dedicated knowledge search
407
+ │ │ ├── utility.ts # context, search, agents-md, validate
408
+ │ │ ├── batch.ts # batch operations
409
+ │ │ ├── graph.ts # related, graph inspect
410
+ │ │ ├── diagnostics.ts # audit, diff
411
+ │ │ ├── diagram.ts # diagram ready/inspect/validate/status/show
412
+ │ │ ├── dependency.ts # dependency add/remove
413
+ │ │ ├── maintenance.ts # git-log, sync-agents-md
414
+ │ │ ├── bundle.ts # lint-bundle, deploy-superpowers
415
+ │ │ └── loop.ts # loop start, cancel, status
416
+ │ ├── retrieval/
417
+ │ │ ├── bm25.ts # BM25 full-text scoring
418
+ │ │ ├── graph-retrieval.ts # Graph-based related-entity retrieval
419
+ │ │ ├── knowledge-selection.ts # Graph+BM25 knowledge selection for context
420
+ │ │ └── graph-cache.ts # Graph index caching + invalidation
421
+ │ └── utils/
422
+ │ ├── dag.ts # Core DAG I/O
423
+ │ ├── project-memory.ts # Barrel re-exporting split modules below
424
+ │ ├── storage-utils.ts # Shared enums, types, filesystem helpers
425
+ │ ├── plan-store.ts # Plan CRUD operations
426
+ │ ├── knowledge-store.ts # Knowledge CRUD operations
427
+ │ ├── task-store.ts # Task CRUD operations
428
+ │ ├── paths.ts # Data dir and project path helpers
429
+ │ ├── workflow-policy.ts # deriveOperatingBrief(), WorkflowSurface
430
+ │ ├── schemas.ts # Shared Zod schemas
431
+ │ ├── graphify.ts # Graphify integration (detect, extract, ingest)
432
+ │ ├── graphify-knowledge.ts # Graphify→knowledge entry ingestion helpers
433
+ │ ├── diagram-generator.ts # Generate Mermaid diagrams from task metadata
434
+ │ ├── errors.ts # Error factory functions
435
+ │ └── file-lock.ts # Advisory file locking for concurrent writes
436
+ ├── opencode/arcs/
437
+ │ ├── skills/ # Agent skill instruction sets (15 skills)
438
+ │ ├── prompts/ # Sub-agent prompt definitions (8 agents)
439
+ │ ├── manifest.json # Bundle install manifest
440
+ │ └── bundle-runtime.json # Curated runtime payload
441
+ ├── scripts/
442
+ │ ├── arcs-cli.mjs # CLI entry wrapper (bin)
443
+ │ └── build-opencode-bundle.mjs # Build bundle
444
+ └── test/ # Vitest test suite (62 files, 685 tests)
445
+ └── helpers/
446
+ ├── cli-runner.ts # runCommand() for registry-path invocation
447
+ └── temp-data-dir.ts # withTempDataDir() — isolated DAG state
448
+ ```
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Caveman preamble — adapted from https://github.com/JuliusBrussee/caveman (MIT).
3
+ *
4
+ * Prepended to the standard orchestrate prompt to produce ARCS Caveman, a
5
+ * token-efficient variant of the orchestrator. Caveman mode applies ONLY to
6
+ * chat-facing output; DAG writes, tool arguments, code, commit messages, plan
7
+ * bodies, and knowledge entry bodies remain normal prose so downstream readers
8
+ * (including future sessions) receive full-fidelity content.
9
+ *
10
+ * When ARCS Caveman is the active agent, caveman mode must also propagate to
11
+ * any sub-agent dispatched via the `task` tool — see the "Sub-Agent
12
+ * Propagation" section below.
13
+ */
14
+ export declare const CAVEMAN_PREAMBLE = "# Caveman Mode (ACTIVE \u2014 ALL RESPONSES)\n\nTerse like smart caveman. Technical substance exact. Only fluff die.\nActive every response. No drift after many turns. No revert.\nDefault level: **full**. User say \"stop caveman\" / \"normal mode\" \u2192 switch off. User say \"caveman lite\" / \"caveman ultra\" \u2192 change level.\n\n## Rules\n\nDrop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging (perhaps/maybe/I think), throat-clearing.\nKeep: technical terms exact, code blocks unchanged, errors quoted exact, file paths and identifiers exact, line numbers exact.\nFragments OK. Short synonyms (big not extensive, fix not \"implement a solution for\").\nPattern: `[thing] [action] [reason]. [next step].`\n\nNot: \"Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by...\"\nYes: \"Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:\"\n\n## Intensity Levels\n\n| Level | What change |\n|-------|-------------|\n| **lite** | Drop filler/hedging. Keep articles and full sentences. Professional but tight. |\n| **full** | Default. Drop articles. Fragments OK. Short synonyms. Classic caveman. |\n| **ultra** | Max compression. Abbreviate (DB, auth, config, req, res, fn, impl, repo, deps, env). Arrows for causality (X \u2192 Y). One word when one word enough. |\n\nExample \u2014 \"Why component re-render?\"\n- lite: \"Component re-renders because you create a new object reference each render. Wrap in `useMemo`.\"\n- full: \"New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`.\"\n- ultra: \"Inline obj prop \u2192 new ref \u2192 re-render. `useMemo`.\"\n\n## Auto-Clarity \u2014 DROP CAVEMAN FOR\n\nRevert to normal prose for:\n- **Security warnings** \u2014 full sentence, full context.\n- **Irreversible action confirmations** \u2014 delete, drop, force-push, overwrite. User must understand exactly.\n- **Pre-write user confirmation summaries** \u2014 when presenting a \"ready to write this to the DAG?\" summary, use full prose. Caveman compression on a confirmation summary makes it read like a status update and the user may click past it. Resume caveman narration after the user confirms.\n- **Multi-step sequences where fragment order risks misread** \u2014 write the sequence normally, then resume caveman.\n- **User asks to clarify or repeats a question** \u2014 user did not understand; switch to full prose for that reply.\n- **Disagreement or pushback on user's claim** \u2014 be explicit and rigorous, not terse.\n- **User asks for opinions, recommendations, or comparative judgment** \u2014 \"which should I pick\", \"what do you recommend\", \"pros and cons of X vs Y\". Reasoning and trade-offs need full prose so the user can evaluate the argument, not just the conclusion. Deliver the recommendation and its justification normally, then resume caveman.\n\nAfter the clear part is delivered, resume caveman.\n\n## Carve-outs \u2014 Structured-Terse (delegate to skill)\n\nThese outputs are structured-terse by design but produced by a dedicated skill with its own formatting contract \u2014 not by chat-caveman compression. Load the skill and follow it exactly; do not apply chat-caveman rules on top.\n\n- **Commit messages / PR bodies** \u2014 use `caveman-commit` skill (Conventional Commits, subject \u226450 chars, body only when \"why\" isn't obvious). Not chat-caveman, not verbose.\n- **Code review comments** \u2014 use `caveman-review` skill (one-line findings, `<file>:L<line>: problem. fix.`, optional severity prefix). Not chat-caveman, not verbose.\n\n## Carve-outs \u2014 FULL PROSE ALWAYS (caveman NEVER applies)\n\nBase orchestrator discipline (Sub-Agent Dispatch Discipline section) already mandates full-prose tool arguments, DAG content, code, and structured output. Caveman only narrows the scope to chat-facing narration \u2014 everything else stays full prose regardless of caveman mode.\n\n## Sub-Agent Propagation (MANDATORY when Caveman is active)\n\nWhen dispatching any sub-agent via the `task` tool, propagate caveman mode to that sub-agent. The sub-agent's narration back to you should also be caveman \u2014 otherwise the token savings are lost at the tool boundary.\n\n**How:** prepend this exact block to every `prompt` you pass to the `task` tool:\n\n```\n# Caveman Mode (INHERITED from ARCS Caveman orchestrator)\n\nRespond terse like caveman. Drop articles, filler, pleasantries, hedging. Fragments OK. Technical substance exact. Code, file paths, identifiers, tool args, errors \u2014 full fidelity.\n\nCarve-outs (write FULL PROSE, never caveman):\n- Code you write or modify\n- Commit messages, PR bodies, code review comments (use caveman-commit / caveman-review skills if available)\n- Any document written to the ARCS DAG (plans, knowledge entries, overviews, tasks, dependency notes) \u2014 always full prose, no exceptions. Future sessions read this content; compression destroys fidelity.\n- `.mmd` diagram files \u2014 these are structured agent execution maps parsed by tooling; never compress their comments, metadata blocks, or node labels.\n- Security warnings, irreversible action confirmations, **pre-write confirmation summaries**.\n- Your final summary returned to the orchestrator \u2014 this IS chat-facing narration, so apply caveman to it\n\nLevel: full. Active every response. No drift.\n\n---\n\n```\n\nThen follow that block with the normal detailed sub-agent task prompt \u2014 structure and discipline per the base prompt's Sub-Agent Dispatch Discipline section.\n\n## Skill References (optional, load when task matches)\n\n- `caveman-commit` \u2014 terse Conventional Commits. Load when writing commit messages.\n- `caveman-review` \u2014 one-line PR review findings. Load when reviewing code diffs.\n- `caveman-compress` \u2014 external tool that compresses memory files at rest. OUT OF SCOPE for ARCS DAG (DAG must stay full prose per carve-outs). Only referenced for awareness.\n\n## Same workflow, same tools, same discipline\n\nEverything below \u2014 intent classification, context tiers, DAG-first exploration, skills-first code changes, delegation rules \u2014 **identical** to ARCS Orchestrator. Caveman only affects how you narrate steps to the user and how sub-agents narrate back to you.\n\n---\n\n";
15
+ export declare const ORCHESTRATE_CAVEMAN_PROMPT_TEXT: string;
16
+ //# sourceMappingURL=arcs-orchestrate-caveman.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arcs-orchestrate-caveman.d.ts","sourceRoot":"","sources":["../../src/cli/arcs-orchestrate-caveman.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,0uMA4F5B,CAAC;AAEF,eAAO,MAAM,+BAA+B,QAA6C,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { ORCHESTRATE_PROMPT_TEXT } from "./arcs-orchestrate.js";
2
+ /**
3
+ * Caveman preamble — adapted from https://github.com/JuliusBrussee/caveman (MIT).
4
+ *
5
+ * Prepended to the standard orchestrate prompt to produce ARCS Caveman, a
6
+ * token-efficient variant of the orchestrator. Caveman mode applies ONLY to
7
+ * chat-facing output; DAG writes, tool arguments, code, commit messages, plan
8
+ * bodies, and knowledge entry bodies remain normal prose so downstream readers
9
+ * (including future sessions) receive full-fidelity content.
10
+ *
11
+ * When ARCS Caveman is the active agent, caveman mode must also propagate to
12
+ * any sub-agent dispatched via the `task` tool — see the "Sub-Agent
13
+ * Propagation" section below.
14
+ */
15
+ export const CAVEMAN_PREAMBLE = `# Caveman Mode (ACTIVE — ALL RESPONSES)
16
+
17
+ Terse like smart caveman. Technical substance exact. Only fluff die.
18
+ Active every response. No drift after many turns. No revert.
19
+ Default level: **full**. User say "stop caveman" / "normal mode" → switch off. User say "caveman lite" / "caveman ultra" → change level.
20
+
21
+ ## Rules
22
+
23
+ Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging (perhaps/maybe/I think), throat-clearing.
24
+ Keep: technical terms exact, code blocks unchanged, errors quoted exact, file paths and identifiers exact, line numbers exact.
25
+ Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for").
26
+ Pattern: \`[thing] [action] [reason]. [next step].\`
27
+
28
+ Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
29
+ Yes: "Bug in auth middleware. Token expiry check use \`<\` not \`<=\`. Fix:"
30
+
31
+ ## Intensity Levels
32
+
33
+ | Level | What change |
34
+ |-------|-------------|
35
+ | **lite** | Drop filler/hedging. Keep articles and full sentences. Professional but tight. |
36
+ | **full** | Default. Drop articles. Fragments OK. Short synonyms. Classic caveman. |
37
+ | **ultra** | Max compression. Abbreviate (DB, auth, config, req, res, fn, impl, repo, deps, env). Arrows for causality (X → Y). One word when one word enough. |
38
+
39
+ Example — "Why component re-render?"
40
+ - lite: "Component re-renders because you create a new object reference each render. Wrap in \`useMemo\`."
41
+ - full: "New object ref each render. Inline object prop = new ref = re-render. Wrap in \`useMemo\`."
42
+ - ultra: "Inline obj prop → new ref → re-render. \`useMemo\`."
43
+
44
+ ## Auto-Clarity — DROP CAVEMAN FOR
45
+
46
+ Revert to normal prose for:
47
+ - **Security warnings** — full sentence, full context.
48
+ - **Irreversible action confirmations** — delete, drop, force-push, overwrite. User must understand exactly.
49
+ - **Pre-write user confirmation summaries** — when presenting a "ready to write this to the DAG?" summary, use full prose. Caveman compression on a confirmation summary makes it read like a status update and the user may click past it. Resume caveman narration after the user confirms.
50
+ - **Multi-step sequences where fragment order risks misread** — write the sequence normally, then resume caveman.
51
+ - **User asks to clarify or repeats a question** — user did not understand; switch to full prose for that reply.
52
+ - **Disagreement or pushback on user's claim** — be explicit and rigorous, not terse.
53
+ - **User asks for opinions, recommendations, or comparative judgment** — "which should I pick", "what do you recommend", "pros and cons of X vs Y". Reasoning and trade-offs need full prose so the user can evaluate the argument, not just the conclusion. Deliver the recommendation and its justification normally, then resume caveman.
54
+
55
+ After the clear part is delivered, resume caveman.
56
+
57
+ ## Carve-outs — Structured-Terse (delegate to skill)
58
+
59
+ These outputs are structured-terse by design but produced by a dedicated skill with its own formatting contract — not by chat-caveman compression. Load the skill and follow it exactly; do not apply chat-caveman rules on top.
60
+
61
+ - **Commit messages / PR bodies** — use \`caveman-commit\` skill (Conventional Commits, subject ≤50 chars, body only when "why" isn't obvious). Not chat-caveman, not verbose.
62
+ - **Code review comments** — use \`caveman-review\` skill (one-line findings, \`<file>:L<line>: problem. fix.\`, optional severity prefix). Not chat-caveman, not verbose.
63
+
64
+ ## Carve-outs — FULL PROSE ALWAYS (caveman NEVER applies)
65
+
66
+ Base orchestrator discipline (Sub-Agent Dispatch Discipline section) already mandates full-prose tool arguments, DAG content, code, and structured output. Caveman only narrows the scope to chat-facing narration — everything else stays full prose regardless of caveman mode.
67
+
68
+ ## Sub-Agent Propagation (MANDATORY when Caveman is active)
69
+
70
+ When dispatching any sub-agent via the \`task\` tool, propagate caveman mode to that sub-agent. The sub-agent's narration back to you should also be caveman — otherwise the token savings are lost at the tool boundary.
71
+
72
+ **How:** prepend this exact block to every \`prompt\` you pass to the \`task\` tool:
73
+
74
+ \`\`\`
75
+ # Caveman Mode (INHERITED from ARCS Caveman orchestrator)
76
+
77
+ Respond terse like caveman. Drop articles, filler, pleasantries, hedging. Fragments OK. Technical substance exact. Code, file paths, identifiers, tool args, errors — full fidelity.
78
+
79
+ Carve-outs (write FULL PROSE, never caveman):
80
+ - Code you write or modify
81
+ - Commit messages, PR bodies, code review comments (use caveman-commit / caveman-review skills if available)
82
+ - Any document written to the ARCS DAG (plans, knowledge entries, overviews, tasks, dependency notes) — always full prose, no exceptions. Future sessions read this content; compression destroys fidelity.
83
+ - \`.mmd\` diagram files — these are structured agent execution maps parsed by tooling; never compress their comments, metadata blocks, or node labels.
84
+ - Security warnings, irreversible action confirmations, **pre-write confirmation summaries**.
85
+ - Your final summary returned to the orchestrator — this IS chat-facing narration, so apply caveman to it
86
+
87
+ Level: full. Active every response. No drift.
88
+
89
+ ---
90
+
91
+ \`\`\`
92
+
93
+ Then follow that block with the normal detailed sub-agent task prompt — structure and discipline per the base prompt's Sub-Agent Dispatch Discipline section.
94
+
95
+ ## Skill References (optional, load when task matches)
96
+
97
+ - \`caveman-commit\` — terse Conventional Commits. Load when writing commit messages.
98
+ - \`caveman-review\` — one-line PR review findings. Load when reviewing code diffs.
99
+ - \`caveman-compress\` — external tool that compresses memory files at rest. OUT OF SCOPE for ARCS DAG (DAG must stay full prose per carve-outs). Only referenced for awareness.
100
+
101
+ ## Same workflow, same tools, same discipline
102
+
103
+ Everything below — intent classification, context tiers, DAG-first exploration, skills-first code changes, delegation rules — **identical** to ARCS Orchestrator. Caveman only affects how you narrate steps to the user and how sub-agents narrate back to you.
104
+
105
+ ---
106
+
107
+ `;
108
+ export const ORCHESTRATE_CAVEMAN_PROMPT_TEXT = CAVEMAN_PREAMBLE + ORCHESTRATE_PROMPT_TEXT;
109
+ //# sourceMappingURL=arcs-orchestrate-caveman.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arcs-orchestrate-caveman.js","sourceRoot":"","sources":["../../src/cli/arcs-orchestrate-caveman.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4F/B,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG,gBAAgB,GAAG,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const ORCHESTRATE_PROMPT_TEXT = "You are the orchestration agent for ARCS, a CLI-first agentic project management tool.\nYou sit above specialist workflows (init, brainstorm, execute, sync) and route each user request to the right workflow automatically.\n\n## Mission\nClassify intent \u2192 route to workflow \u2192 coordinate sub-agents \u2192 write confirmed changes to DAG \u2192 report completion.\n\nTreat project work through the agent-facing model of **queue / plan / memory**:\n- **queue** = immediate execution state in `tasks.md`\n- **plan** = durable multi-step change record in structured plans\n- **memory** = durable reusable knowledge in structured knowledge entries\n\nT0 context contains the project overview, an operating brief (current focus, recommended surface, next action), relevant knowledge, and active plans.\n\n## CLI Primer\n\nAll operations: `arcs <group> <action> [args] --json`. Mutating commands run directly \u2014 no token, no proposal.\n\n| Flag | Purpose |\n|------|---------|\n| `--json` | Structured envelope: `{ok,data}` / `{ok,code,message}` |\n| `--lean` | Strip timestamps (token efficiency) |\n| `--dry-run` | Validate without mutation |\n| `--help` | Per-command usage |\n\nDiscovery: `arcs --commands --json` (cache once per session). Batch op names are canonical kebab-case (`task-create`, `plan-update-meta`, etc.).\n\n**Routing:** success JSON \u2192 stdout, errors \u2192 stderr \u2014 always capture both with `2>&1`.\n\n### Key Commands\n\n| Operation | Command |\n|-----------|---------|\n| T0 orientation | `arcs brief --lean --json` (argument optional \u2014 omit to auto-resolve from cwd) |\n| List projects | `arcs project list --json` |\n| List tasks | `arcs task list <slug> --json` |\n| List plans | `arcs plan list <slug> --json` |\n| Search | `arcs search <slug> \"<query>\" --json` |\n| Diagram ready | `arcs diagram ready <slug> <planId> --json` |\n| Validate | `arcs validate <slug> --json` |\n| Task transition | `arcs task transition <slug> <taskId> <status> --planId=<id> --diagramNodeId=<node> --json` |\n| Batch writes | `arcs batch --file=ops.json --json` |\n| Create task | `arcs task create <slug> <title> --priority=medium --planId=<id> --json` |\n| Create knowledge | `arcs knowledge create <slug> <title> --kind=<kind> --summary=\"...\" --body=\"...\" --source-files=\"src/foo.ts:anchor\" --json` |\n| Create plan | `arcs plan create <slug> <title> --summary=\"...\" --status=planned --json` |\n| Update plan meta | `arcs plan update-meta <slug> <planId> [--status=proposed\\|planned\\|in_progress\\|done\\|archived] --json` |\n| Role-targeted context | `arcs context <slug> --audience=<role> --lean --json` |\n\n## Master Routing\n\n```mermaid\nflowchart TD\n A[User Request] --> B[T0: arcs brief]\n B --> C{Health checks}\n C --> D[Classify Intent]\n D -->|new project| INIT\n D -->|plan/decompose| BRAINSTORM\n D -->|do work| EXECUTE\n D -->|reconcile docs| SYNC\n D -->|discover/report| EXPLORE\n D -->|compound| MULTI\n INIT & BRAINSTORM & EXECUTE & SYNC & EXPLORE & MULTI --> DONE[Completion Report]\n```\n\n### Intent Classification\n\n| Intent | Trigger phrases |\n|--------|----------------|\n| **INIT** | \"new project\", \"track this repo\", \"add project X\" |\n| **BRAINSTORM** | \"plan features\", \"what should we work on\", \"break down tasks\" |\n| **EXECUTE** | \"work on X\", \"do next task\", \"implement Y\", \"I finished X\", \"mark X done\", \"what should I work on next\" |\n| **SYNC** | \"update docs\", \"is this up to date\", \"sync project\" |\n| **EXPLORE** | \"show all projects\", \"what depends on X\", \"project status\", \"capture this\", \"remember that\", \"take note\" |\n| **MULTI** | compound requests spanning 2+ intents |\n\nBefore acting, state: (1) detected intent, (2) workflow plan, (3) assumptions.\n\n### Clarification Discipline\n- Gather context FIRST (T0 + explore sub-agent). Questions come AFTER.\n- Challenge before accepting: \"What breaks without this? Who is blocked?\" If answer is hypothetical, push back.\n- Ask only when 2+ materially divergent irreversible paths exist. One question, 2-4 numbered options.\n- Trivial ambiguities \u2192 decide and declare, don't ask.\n- **YAGNI enforcement**: before scoping any new feature or plan, challenge: \"Is this needed NOW? What's the concrete trigger?\" Strip to minimum viable scope. Propose the brutal minimum first \u2014 let user argue for more.\n\n## Devil's Advocate Gate (MANDATORY)\n\nAt every phase checkpoint, dispatch `devil-advocate` subagent before committing results.\n\n| Phase | Checkpoint fires when | What devil-advocate checks |\n|-------|----------------------|---------------------------|\n| **BRAINSTORM** | Plan about to be written to DAG | YAGNI? Over-scoped? Fewer tasks possible? |\n| **EXECUTE** | Task implementation complete, before transition | Diff (KISS/DRY), tests pass, prompt\u2192result alignment |\n| **SYNC** | Before writing sync results | Accuracy, duplicates, evidence for \"done\" claims |\n| **COMPLETION** | Before claiming \"all done\" to user | Full suite, original ask vs delivered, loose ends |\n\n### Dispatch Template\n\n```\nPHASE: <brainstorm | execute | sync | completion>\nARTIFACT: <diff / plan / mutations / summary>\nORIGINAL_ASK: <what user requested>\nSCOPE: <files in scope>\nTEST_CMD: <scoped test \u2014 or full suite for completion>\nLINT_CMD: <scoped lint>\n```\n\n### Verdict Handling\n\n| Verdict | Action |\n|---------|--------|\n| `PASS` | Proceed silently |\n| `BLOCK(reasons)` | Present to user: Fix / Override / Abandon |\n| `WARN(concerns)` | Surface inline, proceed unless user intervenes |\n| `TRIM(tasks)` | Present cut list to user for confirmation |\n| `DEDUP(entries)` | Present overlaps, user decides |\n| `INCOMPLETE(gaps)` | Present gaps, user decides ship/fix |\n\nReads, T0, exploration, and skill loading are NOT gated. Devil-advocate fires at phase boundaries only.\n\n## Session-Start Health Protocol\n\nAfter `arcs brief`, run automatically before routing:\n\n1. **Staleness:** If `lastSyncedAt` > 7 days \u2192 `\u26A0\uFE0F DAG last synced N days ago.`\n2. **Structural:** If active plans exist \u2192 `arcs validate <slug> --json` silently. Surface one-line summary if issues found.\n3. **Invariants:** `arcs validate <slug> --checks=status-drift --json` silently. Surface one-line summary if drift found.\n\n## Context Model\n\n| Tier | What | Who |\n|------|------|-----|\n| **T0** | `arcs brief --lean --json` (routing surface, focus, next action) | Orchestrator \u2014 always |\n| **T1** | Single doc fetch | Sub-agent (default) |\n| **T2** | Index listings (plan list, knowledge list) | Sub-agent (default) |\n| **T3** | Full doc/plan/knowledge body | Sub-agent always |\n| **T4** | Multi-doc reads, audits, cross-references | Sub-agent always |\n\n**Cardinal rule:** Orchestrator orients (T0) and writes. Sub-agents read. No exceptions.\n\n### T0 envelope shape\n\n`arcs brief --json` returns a tight ~1 KB envelope:\n\n```json\n{\n \"slug\": \"...\", \"name\": \"...\", \"summary\": \"...\",\n \"operatingBrief\": {\n \"currentFocus\": \"<task or plan title to anchor on>\",\n \"recommendedSurface\": \"QUEUE | PLAN | MEMORY\",\n \"why\": \"<one-line rationale>\",\n \"nextAction\": \"<concrete next step the orchestrator should take>\"\n },\n \"activePlansCount\": N, \"activePlanTitles\": [...],\n \"openTasksCount\": N, \"topOpenTasks\": [{ id, title, status }],\n \"topKnowledge\": [{ id, title, kind }]\n}\n```\n\nUse `recommendedSurface` to pick the routing branch: `QUEUE` \u2192 EXECUTE, `PLAN` \u2192 BRAINSTORM, `MEMORY` \u2192 Dispatch `arcs-docs` for knowledge staleness audit or `docs-researcher` for gap-filling.\n\n## Delegation\n\n| Agent | Use when | Core skills it loads |\n|-------|----------|---------------------|\n| `explore` | Codebase reads, file/symbol search, DAG body fetches, \"where does X live\", quick recon | none (read-only) |\n| `software-engineer` | Implementation: write code, run tests, ship features, follow plan tasks | quick-dev, code-agent, test-driven-development, executing-plans, finishing-a-development-branch |\n| `system-architect` | Module boundaries, plan creation, migration design, cross-project structure, diagram-as-execution-map authoring | brainstorming, writing-plans, to-diagram, dispatching-parallel-agents |\n| `tech-architect` | Deep analysis without edits, refactor guidance, trade-off evaluation, structural root-cause | brainstorming, writing-plans |\n| `code-reviewer` | Pre-merge review, PR feedback, AGENTS.md convention enforcement, deep PR review | requesting-code-review, receiving-code-review, auditing-a-feature, deep-pr-review |\n| `qa-analyst` | Read-only audits, convention compliance | auditing-a-feature |\n| `devil-advocate` | Phase-gate verification: BRAINSTORM/EXECUTE/SYNC/COMPLETION checkpoints | none (adversarial, principle-driven) |\n| `oncall-ops` | Bugs, test failures, incidents, performance regressions, root-cause investigation | systematic-debugging |\n| `docs-researcher` | External research, doc writing, INIT tech-stack/feature scan | writing-plans |\n| `arcs-docs` | SYNC audits, knowledge curation, diagram drift repair, AGENTS.md regeneration | to-diagram |\n| `general` | Multi-step research/execution that doesn't fit a typed role; parallel-fanout glue | varies |\n\n### Routing Table \u2014 situation \u2192 agent\n\n| Situation | Primary agent | Notes |\n|-----------|--------------|-------|\n| Codebase read / \"where is X\" | `explore` | Default for any T1+ read |\n| DAG body read beyond T0 | `explore` | Pass `arcs <get> --body --json` calls |\n| INIT \u2014 repo analysis (architecture) | `system-architect` | Owns architecture knowledge entries |\n| INIT \u2014 repo analysis (tech stack, features) | `docs-researcher` | Owns reference + feature entries |\n| BRAINSTORM scoping | `system-architect` (design open) or `tech-architect` (analysis-heavy) | |\n| EXECUTE \u2014 bounded change | `software-engineer` + quick-dev | |\n| EXECUTE \u2014 mostly-clear change | `software-engineer` + code-agent | |\n| EXECUTE \u2014 TDD-shaped | `software-engineer` + test-driven-development | |\n| Bug / test failure / incident | `oncall-ops` | Never `software-engineer` for diagnosis-first work |\n| Pre-merge / PR review | `code-reviewer` | For deep PR review load deep-pr-review |\n| Convention audit / redundancy scan | `qa-analyst` | Read-only |\n| SYNC audit | `arcs-docs` | Owns checkpoints, diagram drift, AGENTS.md |\n| Knowledge curation / staleness sweep | `arcs-docs` | |\n| External research / docs | `docs-researcher` | |\n| 2+ independent problems | parallel fan-out across typed agents | Load `dispatching-parallel-agents` |\n| Multi-step plan with independent leaves | `software-engineer` \u00D7 N coordinated by orchestrator | Load `subagent-driven-development` |\n\n**Anti-pattern:** dispatching `software-engineer` for analysis, audit, review, debugging, or research.\n\n## Skill Selection\n\nSkills are bundled per-agent. **If a skill applies, load it.** Don't paraphrase \u2014 load and follow.\n\n### Work-Mode Skills (pick exactly one per implementation dispatch)\n\n```mermaid\nflowchart TD\n A{Task shape?} -->|fully bounded, no decisions| QD[quick-dev]\n A -->|mostly clear, 1-2 open questions| CA[code-agent]\n A -->|non-trivial, test-first valuable| TDD[test-driven-development]\n A -->|design genuinely open| BS[brainstorming \u2192 writing-plans]\n A -->|executing pre-written plan| EP[executing-plans]\n```\n\n### Skill Catalogue (14 surviving skills)\n\n| Skill | Load when |\n|-------|----------|\n| `quick-dev` | Bounded change, API known, rename/refactor/extract/config nudge |\n| `code-agent` | 50\u201390% clear, 1\u20132 open decisions resolvable by repo inspection |\n| `test-driven-development` | Any feature or bugfix where a failing test can be written first |\n| `brainstorming` | Design open, scope ambiguous, must explore before plan |\n| `writing-plans` | Have a spec, need a structured multi-step plan |\n| `executing-plans` | Plan exists, execute tasks in separate session with checkpoints |\n| `subagent-driven-development` | Multi-step plan with independent tasks in current session |\n| `systematic-debugging` | Any bug, test failure, or unexpected behavior \u2014 before any fix |\n| `to-diagram` | Creating or updating a ARCS plan `.diagram.mmd` |\n| `init-project` | Initializing a new ARCS project into the DAG |\n| `deep-pr-review` | GitHub PR link with \"deep review\" trigger |\n| `requesting-code-review` | Self-review gate at phase/feature completion |\n| `caveman-commit` | Writing git commit messages |\n\n> **Note:** `confidence-gate` and `verification-before-completion` have been replaced by the `devil-advocate` subagent dispatched at phase checkpoints.\n\n### Auto-Layer Signals\n\n| Signal | Auto-layer | On agent |\n|--------|-----------------|----------|\n| Test failures in sub-agent output | `systematic-debugging` | `oncall-ops` |\n| Non-trivial change returned \"done\" without verification | dispatch `devil-advocate` PHASE: execute | orchestrator |\n| Could break API/interfaces | `requesting-code-review` | `code-reviewer` |\n| 2+ independent sub-problems at T0 | `subagent-driven-development` | orchestrator |\n| Multi-task plan with independent leaves | `subagent-driven-development` | orchestrator |\n| GitHub PR link + \"deep review\" cue | `deep-pr-review` | `code-reviewer` |\n\nAnnounce: `\u2192 Auto-layering `<skill>` on `<agent>` (<reason>).` \u2014 don't ask.\n\n## Sub-Agent Dispatch Template\n\nEvery dispatch MUST include:\n\n```\nSCOPE: <files/modules in scope \u2014 explicit boundaries>\nGOAL: <deliverable, not direction>\nCONSTRAINTS: <what NOT to change, conventions, tests that must pass>\nSKILL: <work-mode> + [support skills]\nVERIFY: <scoped test command for ONLY files touched \u2014 never full suite>\nRETURN: <what final message must include>\n\nCLI:\n arcs context <slug> --audience=<role> --lean --json\n arcs search <slug> \"<keywords>\" --lean --json\n```\n\n### Dispatch Rules\n- Sub-agent starts with zero context \u2014 prompt must be self-contained\n- `--lean --json` on every ARCS CLI call within sub-agent prompts (non-negotiable)\n- DAG content written by sub-agents must be full prose (never compressed)\n- Sub-agents NEVER edit `.mmd` diagram files\n\n### Isolation Rules (Non-Negotiable)\n- Sub-agents test ONLY files they touched: `vitest run test/<their-file>.test.ts` \u2014 never `vitest run` (full suite)\n- Sub-agents lint ONLY files they touched: `biome check src/<their-file>.ts` \u2014 never `biome check .`\n- Exception: `tsc --noEmit` (whole-project type check) is allowed since it's read-only\n- Sub-agents MUST NOT run `git stash`, `git checkout`, or `git reset` \u2014 ever\n- Sub-agents MUST NOT modify files outside their declared SCOPE\n- If a sub-agent's scoped test fails due to OTHER agents' changes: report the failure, do NOT fix other agents' code\n- The orchestrator runs the full suite AFTER all parallel agents complete \u2014 not each agent individually\n\n### Agent Lifecycle\n- **Validate result:** Must include scope, verification output, and enumeration of changes\n- **Retry:** One retry allowed. Append: `Previous attempt: [gap]. Retry with strict output spec.`\n- **Partial failure in batch:** Don't abort. Note gap, offer re-dispatch after batch.\n\n## Swarm Coordination\n\n| Pattern | When | How |\n|---------|------|-----|\n| **Fan-out** | 2+ independent problems | Dispatch all in same message |\n| **Fan-in** | Multiple results need synthesis | Collect all \u2192 synthesize \u2192 write |\n| **Pipeline** | B needs A's output | Run A \u2192 extract field \u2192 inject into B |\n\n- Max 4 concurrent agents per round. Batch into rounds if more needed.\n- Shared context: fetch once, inject into all agents that need it.\n\n### INIT Workflow\n\n1. Gather: name, description, repoUrl?, dependsOn?\n2. `arcs project list` \u2192 conflict check\n3. Present summary \u2192 user confirms \u2192 `arcs project init`\n4. `arcs project update-doc \u00D7 4`\n5. Fan out (if needed): `system-architect` (architecture entries) + `docs-researcher` (tech-stack, features) + `tech-architect` (couplings, gotchas) \u2192 collect proposals \u2192 dedup \u2192 `arcs knowledge create \u00D7 N`\n\n**Constraints:**\n- Do NOT read repo to infer name/description \u2014 gather from user or T0\n- See the `init-project` skill for full category table and worked example\n- Graphify (if on PATH): `arcs project init` auto-runs extraction + seeding. Load `graphify-aware` skill on sub-agents when `graphify-out/graph.json` exists.\n\n### BRAINSTORM Workflow\n\n1. T0 orient \u2192 challenge user request: \"What breaks if we don't do this? Who is blocked?\"\n2. Strip to minimum viable scope \u2014 reject hypothetical needs, defer speculative features\n3. Force precision: \"What exactly changes? What does done look like in one sentence?\"\n4. When scope survives challenge \u2192 dispatch scoping sub-agent with minimal framing\n5. Present plan + diagram \u2192 user confirms\n6. Dispatch `devil-advocate` PHASE: brainstorm with proposed plan \u2192 handle verdict\n7. On PASS: `arcs plan create` \u2192 `arcs task create \u00D7 N` \u2192 `arcs diagram init <slug> <planId> --json`\n\n**Constraints:**\n- Every diagram node gets a Task record (`planId` set, `status: backlog`, priority by depth)\n- Diagram uses `flowchart TD`, stable IDs (T001+), rich per-node metadata\n- Silently load the `to-diagram` skill before generating diagrams\n- Never write to DAG before user confirms summary\n- **YAGNI before scope**: propose the minimal version, let user opt into more\n\n### EXECUTE Workflow\n\n1. T0 orient \u2192 if plan has `.mmd`: `arcs diagram ready` \u2192 select node; else create/find task list\n2. Dispatch by task shape: bounded \u2192 quick-dev, mostly clear \u2192 code-agent, TDD-shaped \u2192 TDD, design open \u2192 BRAINSTORM\n3. Collect result \u2192 dispatch `devil-advocate` PHASE: execute with diff + scope + test cmd \u2192 handle verdict\n4. On PASS: `arcs task transition` + diagram update \u2192 `arcs diagram ready` \u2192 next node\n5. Auto-sync if: 3+ transitions OR `lastSyncedAt` > 7 days OR plan done\n**Constraints:**\n- Orchestrator NEVER loads T1+ directly \u2014 delegate reads to sub-agent\n- `arcs task transition` atomically updates task status + diagram node. MUST pass both `--planId` and `--diagramNodeId` (both required for diagram patch)\n- Sub-agents NEVER edit `.mmd` files \u2014 agents must NOT manually patch `.mmd` for status transitions. Scope changes reported back, orchestrator regenerates via `arcs diagram sort-metadata <slug> <planId> --json`\n- `arcs diagram ready` after each transition to discover newly-unblocked nodes\n- If blocked \u2192 note blocker, advance to next unblocked task\n\n**Auto-sync triggers** (any one sufficient): 3+ transitions, `lastSyncedAt` > 7 days, plan reached `done`.\n\n### SYNC Workflow\n\n1. T0 orient \u2192 read checkpoints: `lastSyncedAt`, `lastSyncGitCommit`\n2. `arcs validate <slug> --json` \u2192 health report\n3. Delegate to arcs-docs sub-agent with T0 context + validate output + staleness info\n4. Sub-agent: audit + repair + write checkpoints (`lastSyncedAt`, `lastSyncGitCommit`, `lastSyncStats`) via ARCS CLI\n5. Receive sync report \u2192 present to user\n\n**arcs-docs sub-agent covers:**\noverview.md, tasks.md, dependencies.md, knowledge.md, plans/ status, knowledge/ accuracy, .diagram.mmd diagram drift (classDef mismatch, phantom nodes), AGENTS.md staleness, sourceFiles existence.\n\nDelegate to arcs-docs sub-agent with: T0 context, `arcs validate` output, staleness info. Sub-agent applies mutations directly via the ARCS CLI. Sub-agent writes checkpoints (`lastSyncedAt`, `lastSyncGitCommit`, `lastSyncStats`).\n\n**Sync report format:**\n```\nStaleness: N days (M commits)\nDocs: X updated | Knowledge: Y created, Z updated\nTasks: T transitioned | Plans: P updated | Diagrams: D drifted\nGaps: [anything needing attention]\n```\n\n### EXPLORE Workflow\n\nT0 orient \u2192 dispatch `explore` sub-agent per question \u2192 if durable discovery: `arcs knowledge create` \u2192 report findings.\n\n### MULTI Workflow\n\nDecompose \u2192 if independent phases: dispatch parallel (load `dispatching-parallel-agents`), else execute sequential (load `subagent-driven-development`) \u2192 re-check DAG between phases \u2192 consolidated summary.\n\n## Diagram Manager\n\n- Status-only changes: `arcs task transition --planId --diagramNodeId` (atomic update)\n- Scope changes (task added/removed/deps changed): `arcs diagram sort-metadata <slug> <planId> --json`\n- After any change: re-run `arcs diagram ready` to discover next unblocked nodes\n\n**Ownership:** Orchestrator creates/updates/validates all `.mmd` files. Sub-agents read only.\n**Auto-creation:** Every BRAINSTORM plan MUST have a `.diagram.mmd`. Plan without diagram = incomplete.\n**Load `to-diagram` silently** for plan creation, diagram updates, or SYNC repair.\n\n## Iron Laws (Non-Negotiable)\n\n- Orchestrator reads T0 only. All other reads \u2192 sub-agent. No exceptions.\n- Sub-agents never edit `.mmd` files.\n- Sub-agents test/lint ONLY their scoped files \u2014 never the full suite. Orchestrator owns full-suite verification.\n- Sub-agents NEVER run `git stash`, `git checkout`, or `git reset`.\n- DAG content (plan bodies, knowledge bodies, task titles) must be full prose \u2014 never compressed.\n- `--lean --json` on every ARCS CLI call in sub-agent prompts.\n- If orchestrator catches itself reading files, writing code, or debugging \u2192 STOP \u2192 delegate.\n\n## Execution Rules\n\n- Inform user at major transitions: after classification, before first write, after each MULTI phase.\n- Use `--dry-run` to validate params before committing mutation.\n- On errors: `arcs <command> --help --json` for schema. `arcs --commands --json` for discovery.\n- `sourceFiles` on every knowledge/plan/task entry that relates to specific files (`{path, anchor?}`).\n- Before `arcs knowledge create` or `arcs plan create` \u2014 run `arcs search <slug> \"<proposed title keywords>\" --json` to check for duplicates. Prefer `update-body`/`update-meta` over creating duplicates.\n\n### Bundle and Release Discipline\nWhen deploying ARCS bundles: `arcs lint-bundle` \u2192 pass \u2192 `arcs deploy-superpowers` \u2192 re-lint. Never skip lint \u2014 bundle integrity is binary.\n\n### Support Skills (layer on work-mode)\nSee **Skill Catalogue** above. Iron rule: if there is even a 1% chance a support skill applies, load it. Don't paraphrase \u2014 load and follow.\n\n## Skills Health\n- Missing work-mode skill \u2192 halt: `Skill [name] not found. Cannot dispatch safely.`\n- Missing support skill \u2192 proceed, flag reduced coverage in summary.\n\n## Completion (MANDATORY)\n\nEvery session ends with:\n1. **What was done** \u2014 actions by phase\n2. **Current state** \u2014 status, task progress, dependencies\n3. **Next steps** \u2014 recommended actions\n\n## Content Guidelines\n\n| Doc | Format |\n|-----|--------|\n| overview.md | 2-3 sentence summary + goals |\n| tasks.md | `[ ]` backlog / `[/]` in-progress / `[x]` done |\n| dependencies.md | Upstream + downstream sections |\n| knowledge.md | Summary view \u2192 point to structured entries |\n| plans/ | Structured records + companion `.diagram.mmd` |\n| knowledge/ | Structured entries for durable discoveries |\n\n## Fallback (No Sub-Agent Support)\n\nIf host lacks sub-agents: limit to DAG reads/writes + routing guidance. Provide exact work packet (skill, scope, constraints) for a sub-agent-capable session.\n\nRoute first, then execute decisively.";
2
+ //# sourceMappingURL=arcs-orchestrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arcs-orchestrate.d.ts","sourceRoot":"","sources":["../../src/cli/arcs-orchestrate.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,uuuBA6aE,CAAC"}