@rryando/arcs 3.9.2 → 3.11.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 (331) hide show
  1. package/README.md +172 -146
  2. package/dist/cli/agent-registry.d.ts +12 -0
  3. package/dist/cli/agent-registry.d.ts.map +1 -0
  4. package/dist/cli/agent-registry.js +67 -0
  5. package/dist/cli/agent-registry.js.map +1 -0
  6. package/dist/cli/arcs-flash.d.ts +2 -0
  7. package/dist/cli/arcs-flash.d.ts.map +1 -0
  8. package/dist/cli/arcs-flash.js +68 -0
  9. package/dist/cli/arcs-flash.js.map +1 -0
  10. package/dist/cli/arcs-orchestrate-caveman.d.ts +2 -14
  11. package/dist/cli/arcs-orchestrate-caveman.d.ts.map +1 -1
  12. package/dist/cli/arcs-orchestrate-caveman.js +6 -97
  13. package/dist/cli/arcs-orchestrate-caveman.js.map +1 -1
  14. package/dist/cli/arcs-orchestrate.d.ts +1 -1
  15. package/dist/cli/arcs-orchestrate.d.ts.map +1 -1
  16. package/dist/cli/arcs-orchestrate.js +40 -373
  17. package/dist/cli/arcs-orchestrate.js.map +1 -1
  18. package/dist/cli/bundle-installer.d.ts +10 -4
  19. package/dist/cli/bundle-installer.d.ts.map +1 -1
  20. package/dist/cli/bundle-installer.js +168 -15
  21. package/dist/cli/bundle-installer.js.map +1 -1
  22. package/dist/cli/commands/batch.js +4 -0
  23. package/dist/cli/commands/batch.js.map +1 -1
  24. package/dist/cli/commands/hooks.d.ts +36 -0
  25. package/dist/cli/commands/hooks.d.ts.map +1 -0
  26. package/dist/cli/commands/hooks.js +298 -0
  27. package/dist/cli/commands/hooks.js.map +1 -0
  28. package/dist/cli/commands/index.d.ts +2 -0
  29. package/dist/cli/commands/index.d.ts.map +1 -1
  30. package/dist/cli/commands/index.js +2 -0
  31. package/dist/cli/commands/index.js.map +1 -1
  32. package/dist/cli/commands/project.js +27 -0
  33. package/dist/cli/commands/project.js.map +1 -1
  34. package/dist/cli/commands/task.js +16 -1
  35. package/dist/cli/commands/task.js.map +1 -1
  36. package/dist/cli/commands/web.d.ts +2 -0
  37. package/dist/cli/commands/web.d.ts.map +1 -0
  38. package/dist/cli/commands/web.js +56 -0
  39. package/dist/cli/commands/web.js.map +1 -0
  40. package/dist/cli/config.d.ts +32 -0
  41. package/dist/cli/config.d.ts.map +1 -1
  42. package/dist/cli/config.js +56 -0
  43. package/dist/cli/config.js.map +1 -1
  44. package/dist/cli/instructions.d.ts +19 -6
  45. package/dist/cli/instructions.d.ts.map +1 -1
  46. package/dist/cli/instructions.js +62 -32
  47. package/dist/cli/instructions.js.map +1 -1
  48. package/dist/cli/orchestrator-shared-blocks.d.ts +31 -0
  49. package/dist/cli/orchestrator-shared-blocks.d.ts.map +1 -0
  50. package/dist/cli/orchestrator-shared-blocks.js +148 -0
  51. package/dist/cli/orchestrator-shared-blocks.js.map +1 -0
  52. package/dist/cli/setup.d.ts.map +1 -1
  53. package/dist/cli/setup.js +159 -85
  54. package/dist/cli/setup.js.map +1 -1
  55. package/dist/retrieval/index-builder.d.ts.map +1 -1
  56. package/dist/retrieval/index-builder.js +29 -1
  57. package/dist/retrieval/index-builder.js.map +1 -1
  58. package/dist/utils/claude-code-hook-install.d.ts +80 -0
  59. package/dist/utils/claude-code-hook-install.d.ts.map +1 -0
  60. package/dist/utils/claude-code-hook-install.js +146 -0
  61. package/dist/utils/claude-code-hook-install.js.map +1 -0
  62. package/dist/utils/claude-transcript.d.ts +127 -0
  63. package/dist/utils/claude-transcript.d.ts.map +1 -0
  64. package/dist/utils/claude-transcript.js +353 -0
  65. package/dist/utils/claude-transcript.js.map +1 -0
  66. package/dist/utils/diagram-generator.d.ts +1 -1
  67. package/dist/utils/diagram-generator.d.ts.map +1 -1
  68. package/dist/utils/diagram-generator.js +3 -2
  69. package/dist/utils/diagram-generator.js.map +1 -1
  70. package/dist/utils/errors.d.ts +6 -2
  71. package/dist/utils/errors.d.ts.map +1 -1
  72. package/dist/utils/errors.js +12 -0
  73. package/dist/utils/errors.js.map +1 -1
  74. package/dist/utils/hook-token-store.d.ts +22 -0
  75. package/dist/utils/hook-token-store.d.ts.map +1 -0
  76. package/dist/utils/hook-token-store.js +43 -0
  77. package/dist/utils/hook-token-store.js.map +1 -0
  78. package/dist/utils/json-schemas.d.ts +186 -2
  79. package/dist/utils/json-schemas.d.ts.map +1 -1
  80. package/dist/utils/json-schemas.js +48 -4
  81. package/dist/utils/json-schemas.js.map +1 -1
  82. package/dist/utils/knowledge-store.d.ts +7 -1
  83. package/dist/utils/knowledge-store.d.ts.map +1 -1
  84. package/dist/utils/knowledge-store.js +97 -65
  85. package/dist/utils/knowledge-store.js.map +1 -1
  86. package/dist/utils/plan-store.d.ts +8 -0
  87. package/dist/utils/plan-store.d.ts.map +1 -1
  88. package/dist/utils/plan-store.js +98 -59
  89. package/dist/utils/plan-store.js.map +1 -1
  90. package/dist/utils/project-resolver.d.ts +8 -0
  91. package/dist/utils/project-resolver.d.ts.map +1 -1
  92. package/dist/utils/project-resolver.js +7 -2
  93. package/dist/utils/project-resolver.js.map +1 -1
  94. package/dist/utils/session-store.d.ts +113 -0
  95. package/dist/utils/session-store.d.ts.map +1 -0
  96. package/dist/utils/session-store.js +312 -0
  97. package/dist/utils/session-store.js.map +1 -0
  98. package/dist/utils/storage-utils.d.ts +31 -0
  99. package/dist/utils/storage-utils.d.ts.map +1 -1
  100. package/dist/utils/storage-utils.js +116 -5
  101. package/dist/utils/storage-utils.js.map +1 -1
  102. package/dist/utils/task-store.d.ts +7 -0
  103. package/dist/utils/task-store.d.ts.map +1 -1
  104. package/dist/utils/task-store.js +73 -23
  105. package/dist/utils/task-store.js.map +1 -1
  106. package/dist/web-client/assets/GraphCanvas-dNyZ458L.js +1 -0
  107. package/dist/web-client/assets/MarkdownEditor-BmU9mdkN.js +77 -0
  108. package/dist/web-client/assets/abnfDiagram-VRR7QNED-D1BFBoeF.js +1 -0
  109. package/dist/web-client/assets/arc-Bfaogrm1.js +1 -0
  110. package/dist/web-client/assets/architecture-TIHT7OUA-CJqI5wNI.js +1 -0
  111. package/dist/web-client/assets/architectureDiagram-ZJ3FMSHR-CA8hTWUK.js +36 -0
  112. package/dist/web-client/assets/array-BifhSqXX.js +1 -0
  113. package/dist/web-client/assets/blockDiagram-677ZJIJ3-CQpb_KwX.js +132 -0
  114. package/dist/web-client/assets/c4Diagram-LMCZKHZV-BhpHX84V.js +10 -0
  115. package/dist/web-client/assets/channel-C8DlmyVe.js +1 -0
  116. package/dist/web-client/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  117. package/dist/web-client/assets/chunk-32BRIVSS-BUusQQa_.js +1 -0
  118. package/dist/web-client/assets/chunk-52WLFC77-nNYwlftl.js +10 -0
  119. package/dist/web-client/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
  120. package/dist/web-client/assets/chunk-7BUUIJ7U-Bb538aSH.js +1 -0
  121. package/dist/web-client/assets/chunk-C7G6YPKG-D0a-yqnK.js +1 -0
  122. package/dist/web-client/assets/chunk-EX3LRPZG-IDuRMN-4.js +231 -0
  123. package/dist/web-client/assets/chunk-FWX5IMBZ-D_spTcqi.js +2 -0
  124. package/dist/web-client/assets/chunk-HOUHSVGY-C-bcxwZS.js +1 -0
  125. package/dist/web-client/assets/chunk-ICXQ74PX-CjmK2bAM.js +2 -0
  126. package/dist/web-client/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  127. package/dist/web-client/assets/chunk-KEIR6QF5-DEvma7oi.js +161 -0
  128. package/dist/web-client/assets/chunk-MOJQB5TN-Bkc08KWY.js +88 -0
  129. package/dist/web-client/assets/chunk-OGEWGWER-BAAYYvG9.js +1 -0
  130. package/dist/web-client/assets/chunk-PUDLZKDR-WXbPY7NM.js +156 -0
  131. package/dist/web-client/assets/chunk-Q4XR5HBZ-DcbnjxQE.js +70 -0
  132. package/dist/web-client/assets/chunk-RYQCIY6F-np2RyIY1.js +1 -0
  133. package/dist/web-client/assets/chunk-V7JOEXUC-C6t75PAp.js +206 -0
  134. package/dist/web-client/assets/chunk-VAUOI2AC-DVrJ0Ic7.js +1 -0
  135. package/dist/web-client/assets/chunk-VR4S4FIN-MOOFvGS0.js +1 -0
  136. package/dist/web-client/assets/chunk-WYO6CB5R-sK7Y2NZD.js +125 -0
  137. package/dist/web-client/assets/chunk-XXDRQBXY-BvKO0v-W.js +1 -0
  138. package/dist/web-client/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  139. package/dist/web-client/assets/chunk-ZGVPDNZ5-a13RQsku.js +62 -0
  140. package/dist/web-client/assets/chunk-ZIRB5QZD-BpeS1aZ7.js +32 -0
  141. package/dist/web-client/assets/classDiagram-OUVF2IWQ-p32N1P_G.js +1 -0
  142. package/dist/web-client/assets/classDiagram-v2-EOCWNBFH-p32N1P_G.js +1 -0
  143. package/dist/web-client/assets/cose-bilkent-JH36ORCC-BebHqzgp.js +1 -0
  144. package/dist/web-client/assets/cynefin-VYW2F7L2-D8xaH-wO.js +1 -0
  145. package/dist/web-client/assets/cynefinDiagram-TSTJHNR4-Bt__EqJW.js +62 -0
  146. package/dist/web-client/assets/cytoscape-fcose-peAzqedC.js +1 -0
  147. package/dist/web-client/assets/cytoscape.esm-C3UvhD5t.js +321 -0
  148. package/dist/web-client/assets/dagre-Buvkdvvj.js +1 -0
  149. package/dist/web-client/assets/dagre-VKFMJZFB-Bwgjwflz.js +4 -0
  150. package/dist/web-client/assets/defaultLocale-BFoDCU3G.js +1 -0
  151. package/dist/web-client/assets/diagram-FQU43EPY-CaPDVUq2.js +3 -0
  152. package/dist/web-client/assets/diagram-G47NLZAW-BQLB9YYA.js +24 -0
  153. package/dist/web-client/assets/diagram-NH7WQ7WH-BWo84w8Y.js +24 -0
  154. package/dist/web-client/assets/diagram-OA4YK3LP-bKn6Pz5s.js +30 -0
  155. package/dist/web-client/assets/diagram-WEI45ONY-BRqV5Oy6.js +41 -0
  156. package/dist/web-client/assets/dist-B_J_HbC0.js +1 -0
  157. package/dist/web-client/assets/ebnfDiagram-CCIWWBDH-DhUXL1-7.js +1 -0
  158. package/dist/web-client/assets/erDiagram-Q63AITRT-HXAQQ-_F.js +85 -0
  159. package/dist/web-client/assets/eventmodeling-45OFAUF4-Bj5P8mZJ.js +1 -0
  160. package/dist/web-client/assets/flowDiagram-23GEKE2U-37BztFri.js +1 -0
  161. package/dist/web-client/assets/ganttDiagram-NO4QXBWP-D-Ddf_Ii.js +292 -0
  162. package/dist/web-client/assets/gitGraph-TEB2WS4Q-BmHzs0uF.js +1 -0
  163. package/dist/web-client/assets/gitGraphDiagram-IHSO6WYX-YnQWrlh_.js +106 -0
  164. package/dist/web-client/assets/graphlib-DS17s2tU.js +1 -0
  165. package/dist/web-client/assets/index-3mNPVkix.css +2 -0
  166. package/dist/web-client/assets/index-DCWxuIeQ.js +58 -0
  167. package/dist/web-client/assets/info-DKCQHKI2-DCT_B7RN.js +1 -0
  168. package/dist/web-client/assets/infoDiagram-FWYZ7A6U-D-le1Zhq.js +2 -0
  169. package/dist/web-client/assets/init-C-OQMol4.js +1 -0
  170. package/dist/web-client/assets/ishikawaDiagram-FXEZZL3T-Jr1x2VJB.js +70 -0
  171. package/dist/web-client/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  172. package/dist/web-client/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  173. package/dist/web-client/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  174. package/dist/web-client/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  175. package/dist/web-client/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  176. package/dist/web-client/assets/journeyDiagram-5HDEW3XC-BF9ELxj-.js +139 -0
  177. package/dist/web-client/assets/kanban-definition-HUTT4EX6-C4fJqAxu.js +89 -0
  178. package/dist/web-client/assets/katex-DolUETbr.js +257 -0
  179. package/dist/web-client/assets/line-7N7ikFxa.js +1 -0
  180. package/dist/web-client/assets/linear-DeUiD2wj.js +1 -0
  181. package/dist/web-client/assets/map-BaFkSB1l.js +1 -0
  182. package/dist/web-client/assets/mermaid-parser.core-QbC1icPt.js +7 -0
  183. package/dist/web-client/assets/mermaid.core-C26d_UJm.js +11 -0
  184. package/dist/web-client/assets/mindmap-definition-LN4V7U3C-D6TV1JDf.js +96 -0
  185. package/dist/web-client/assets/ordinal-BDEzSJ7C.js +1 -0
  186. package/dist/web-client/assets/packet-7NZHBO7P-CR1vrGj3.js +1 -0
  187. package/dist/web-client/assets/path-COt_16Va.js +1 -0
  188. package/dist/web-client/assets/pegDiagram-2B236MQR-xOMBBtfV.js +1 -0
  189. package/dist/web-client/assets/pie-RZYD4A2V-BbWuhjwy.js +1 -0
  190. package/dist/web-client/assets/pieDiagram-ENE6RG2P-MsfnsqgW.js +39 -0
  191. package/dist/web-client/assets/quadrantDiagram-ABIIQ3AL-BoI7zKXF.js +7 -0
  192. package/dist/web-client/assets/radar-I7S5WNFK-CbYXKToJ.js +1 -0
  193. package/dist/web-client/assets/railroad-3IZDKUUU-6LxHDkLe.js +1 -0
  194. package/dist/web-client/assets/railroad-abnf-AHOZXSZD-2Dg9wu0J.js +1 -0
  195. package/dist/web-client/assets/railroad-ebnf-EBAXGLYW-C_E2ot0R.js +1 -0
  196. package/dist/web-client/assets/railroad-peg-LSFZ7HO6-Bs9UQR1b.js +1 -0
  197. package/dist/web-client/assets/railroadDiagram-RFXS5EU6-D6RUoUki.js +1 -0
  198. package/dist/web-client/assets/requirementDiagram-TGXJPOKE-B6k4BDpE.js +84 -0
  199. package/dist/web-client/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
  200. package/dist/web-client/assets/rough.esm-By172zw-.js +1 -0
  201. package/dist/web-client/assets/sankeyDiagram-HTMAVEWB-BUDF-UFr.js +40 -0
  202. package/dist/web-client/assets/sequenceDiagram-DBY2YBRQ-D6GqcsUi.js +162 -0
  203. package/dist/web-client/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
  204. package/dist/web-client/assets/src-oBChb5qS.js +1 -0
  205. package/dist/web-client/assets/stateDiagram-2N3HPSRC-WfJCQAK5.js +1 -0
  206. package/dist/web-client/assets/stateDiagram-v2-6OUMAXLB-BCMWGnsJ.js +1 -0
  207. package/dist/web-client/assets/swimlanes-5IMT3BWC-BtMo82mC.js +2 -0
  208. package/dist/web-client/assets/swimlanesDiagram-G3AALYLV-DmudmLcK.js +8 -0
  209. package/dist/web-client/assets/timeline-definition-FHXFAJF6-CoAmv2Sn.js +120 -0
  210. package/dist/web-client/assets/treeView-QDETBFTQ-BWsKzE1s.js +1 -0
  211. package/dist/web-client/assets/treemap-6X3UGDF4-i_qGtB3o.js +1 -0
  212. package/dist/web-client/assets/vennDiagram-L72KCM5P-DYkiLe-P.js +34 -0
  213. package/dist/web-client/assets/wardley-OPB4EBWU-Daaqr1Vp.js +1 -0
  214. package/dist/web-client/assets/wardleyDiagram-EHGQE667-Bofbsg3J.js +78 -0
  215. package/dist/web-client/assets/xychartDiagram-FW5EYKEG-KNF4VTfL.js +7 -0
  216. package/dist/web-client/index.html +15 -0
  217. package/dist/web-server/app.d.ts +13 -0
  218. package/dist/web-server/app.d.ts.map +1 -0
  219. package/dist/web-server/app.js +58 -0
  220. package/dist/web-server/app.js.map +1 -0
  221. package/dist/web-server/claude-runner.d.ts +86 -0
  222. package/dist/web-server/claude-runner.d.ts.map +1 -0
  223. package/dist/web-server/claude-runner.js +320 -0
  224. package/dist/web-server/claude-runner.js.map +1 -0
  225. package/dist/web-server/hook-auth.d.ts +12 -0
  226. package/dist/web-server/hook-auth.d.ts.map +1 -0
  227. package/dist/web-server/hook-auth.js +36 -0
  228. package/dist/web-server/hook-auth.js.map +1 -0
  229. package/dist/web-server/index.d.ts +23 -0
  230. package/dist/web-server/index.d.ts.map +1 -0
  231. package/dist/web-server/index.js +49 -0
  232. package/dist/web-server/index.js.map +1 -0
  233. package/dist/web-server/opencode-client.d.ts +123 -0
  234. package/dist/web-server/opencode-client.d.ts.map +1 -0
  235. package/dist/web-server/opencode-client.js +514 -0
  236. package/dist/web-server/opencode-client.js.map +1 -0
  237. package/dist/web-server/respond.d.ts +33 -0
  238. package/dist/web-server/respond.d.ts.map +1 -0
  239. package/dist/web-server/respond.js +79 -0
  240. package/dist/web-server/respond.js.map +1 -0
  241. package/dist/web-server/routes/collections.d.ts +11 -0
  242. package/dist/web-server/routes/collections.d.ts.map +1 -0
  243. package/dist/web-server/routes/collections.js +217 -0
  244. package/dist/web-server/routes/collections.js.map +1 -0
  245. package/dist/web-server/routes/discovery.d.ts +7 -0
  246. package/dist/web-server/routes/discovery.d.ts.map +1 -0
  247. package/dist/web-server/routes/discovery.js +159 -0
  248. package/dist/web-server/routes/discovery.js.map +1 -0
  249. package/dist/web-server/routes/events.d.ts +6 -0
  250. package/dist/web-server/routes/events.d.ts.map +1 -0
  251. package/dist/web-server/routes/events.js +25 -0
  252. package/dist/web-server/routes/events.js.map +1 -0
  253. package/dist/web-server/routes/hook-events.d.ts +19 -0
  254. package/dist/web-server/routes/hook-events.d.ts.map +1 -0
  255. package/dist/web-server/routes/hook-events.js +135 -0
  256. package/dist/web-server/routes/hook-events.js.map +1 -0
  257. package/dist/web-server/routes/projects.d.ts +7 -0
  258. package/dist/web-server/routes/projects.d.ts.map +1 -0
  259. package/dist/web-server/routes/projects.js +272 -0
  260. package/dist/web-server/routes/projects.js.map +1 -0
  261. package/dist/web-server/routes/sessions.d.ts +16 -0
  262. package/dist/web-server/routes/sessions.d.ts.map +1 -0
  263. package/dist/web-server/routes/sessions.js +442 -0
  264. package/dist/web-server/routes/sessions.js.map +1 -0
  265. package/dist/web-server/security.d.ts +7 -0
  266. package/dist/web-server/security.d.ts.map +1 -0
  267. package/dist/web-server/security.js +41 -0
  268. package/dist/web-server/security.js.map +1 -0
  269. package/dist/web-server/static.d.ts +10 -0
  270. package/dist/web-server/static.d.ts.map +1 -0
  271. package/dist/web-server/static.js +36 -0
  272. package/dist/web-server/static.js.map +1 -0
  273. package/dist/web-server/storage.d.ts +17 -0
  274. package/dist/web-server/storage.d.ts.map +1 -0
  275. package/dist/web-server/storage.js +42 -0
  276. package/dist/web-server/storage.js.map +1 -0
  277. package/dist/web-server/watcher.d.ts +37 -0
  278. package/dist/web-server/watcher.d.ts.map +1 -0
  279. package/dist/web-server/watcher.js +181 -0
  280. package/dist/web-server/watcher.js.map +1 -0
  281. package/opencode/arcs/bundle-runtime.json +5 -14
  282. package/opencode/arcs/manifest.json +213 -149
  283. package/opencode/arcs/prompts/arcs-docs.txt +53 -47
  284. package/opencode/arcs/prompts/arcs-flash.txt +190 -0
  285. package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +116 -412
  286. package/opencode/arcs/prompts/arcs-orchestrate.txt +114 -331
  287. package/opencode/arcs/prompts/code-reviewer.txt +37 -98
  288. package/opencode/arcs/prompts/devil-advocate.txt +44 -115
  289. package/opencode/arcs/prompts/graph-explorer.txt +31 -179
  290. package/opencode/arcs/prompts/software-engineer.txt +24 -6
  291. package/opencode/arcs/prompts/tech-architect.txt +28 -12
  292. package/opencode/arcs/skills/brainstorming/SKILL.md +65 -105
  293. package/opencode/arcs/skills/brainstorming/scripts/server.js +37 -10
  294. package/opencode/arcs/skills/brainstorming/scripts/start-server.sh +20 -3
  295. package/opencode/arcs/skills/brainstorming/scripts/stop-server.sh +25 -6
  296. package/opencode/arcs/skills/brainstorming/visual-companion.md +3 -10
  297. package/opencode/arcs/skills/deep-pr-review/SKILL.md +5 -5
  298. package/opencode/arcs/skills/deep-pr-review/review-template.md +1 -1
  299. package/opencode/arcs/skills/enriching-codegraph-proposals/SKILL.md +17 -18
  300. package/opencode/arcs/skills/executing-plans/SKILL.md +26 -234
  301. package/opencode/arcs/skills/implementation/SKILL.md +61 -0
  302. package/opencode/arcs/skills/init-project/SKILL.md +16 -15
  303. package/opencode/arcs/skills/install-claude-code-hook/SKILL.md +143 -0
  304. package/opencode/arcs/skills/systematic-debugging/SKILL.md +16 -15
  305. package/opencode/arcs/skills/test-driven-development/SKILL.md +1 -1
  306. package/opencode/arcs/skills/to-diagram/SKILL.md +10 -29
  307. package/opencode/arcs/skills/writing-knowledge/SKILL.md +7 -6
  308. package/opencode/arcs/skills/writing-plans/SKILL.md +80 -130
  309. package/opencode/arcs/skills/writing-plans/plan-document-reviewer-prompt.md +38 -30
  310. package/package.json +14 -6
  311. package/scripts/build-opencode-bundle.mjs +23 -11
  312. package/scripts/claude-code-session-hook.mjs +125 -0
  313. package/scripts/deploy-claudecode-bundle.mjs +185 -132
  314. package/scripts/deploy-opencode-bundle.mjs +207 -6
  315. package/scripts/lib/bundle-helpers.mjs +29 -3
  316. package/scripts/lint-bundle.mjs +123 -3
  317. package/skills/explore-dag.md +5 -3
  318. package/skills/init-project.md +27 -26
  319. package/skills/orchestrate.md +29 -13
  320. package/skills/update-docs.md +8 -13
  321. package/opencode/arcs/prompts/docs-researcher.txt +0 -79
  322. package/opencode/arcs/prompts/oncall-ops.txt +0 -85
  323. package/opencode/arcs/skills/brainstorming/spec-document-reviewer-prompt.md +0 -56
  324. package/opencode/arcs/skills/code-agent/SKILL.md +0 -63
  325. package/opencode/arcs/skills/executing-plans/code-quality-reviewer-prompt.md +0 -57
  326. package/opencode/arcs/skills/executing-plans/implementer-prompt.md +0 -152
  327. package/opencode/arcs/skills/executing-plans/spec-reviewer-prompt.md +0 -91
  328. package/opencode/arcs/skills/quick-dev/SKILL.md +0 -52
  329. package/opencode/arcs/skills/requesting-code-review/SKILL.md +0 -59
  330. package/opencode/arcs/skills/requesting-code-review/code-reviewer.md +0 -139
  331. package/opencode/arcs/skills/the-ladder/SKILL.md +0 -54
@@ -1,153 +1,113 @@
1
1
  ---
2
2
  name: brainstorming
3
- description: "You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Challenges user intent, stress-tests requirements, and forces precision before design."
3
+ description: "You MUST use this before creative work that needs design. Resolves facts and material user-owned decisions, then obtains explicit design approval without authoring implementation artifacts."
4
4
  ---
5
5
 
6
6
  # Skill: brainstorming
7
7
 
8
- ## Persona
8
+ ## Purpose
9
9
 
10
- You are a critical design partner — not a yes-man. Your job is to **challenge the user's request until it's precise, minimal, and grounded in reality.** You push back. You ask "why." You strip scope. You refuse to design solutions to problems that don't exist yet.
10
+ You are a critical design partner. Make the requested outcome precise, minimal, and grounded in current evidence. Brainstorming is a finite human-in-the-loop design phase, not an authoring or implementation phase.
11
11
 
12
- Tone: cold, direct, constructive. No filler, no pleasantries. Every question has a purpose. If the user's request is vague, say so. If it's over-scoped, cut it. If it solves a hypothetical problem, reject it.
12
+ Tone: direct, constructive, and concise. Challenge unsupported scope, but do not manufacture disagreement or questions when the request is already complete.
13
13
 
14
- ## When
14
+ ## Lifecycle
15
15
 
16
- Any creative work — creating features, building components, adding functionality, or modifying behavior. Design before implementation, always.
16
+ The canonical lifecycle is:
17
17
 
18
- > CLI Primer: `arcs --commands --json` for discovery. Mutating commands run directly no token.
18
+ `INTAKE FACT_FINDING DECISION_LOOP DESIGN_DRAFT WAITING_FOR_DESIGN_APPROVAL PLAN_DRAFT BRAINSTORM_GATE WAITING_FOR_EXACT_AUTHORIZATION → AUTHORING`
19
19
 
20
- <HARD-GATE>
21
- Do NOT invoke any implementation skill, write any code, or take any implementation action until you have presented a design and the user has approved it. Every project, regardless of perceived simplicity.
22
- </HARD-GATE>
23
-
24
- ## Flow
20
+ Brainstorming owns only `INTAKE` through `WAITING_FOR_DESIGN_APPROVAL`. After explicit design approval, hand the approved design to `writing-plans`, the sole owner of `PLAN_DRAFT` through `AUTHORING`.
25
21
 
26
22
  ```mermaid
27
23
  flowchart TD
28
- A[Receive request] --> B[Challenge: is this needed NOW?]
29
- B -->|no evidence| C[Push back — ask for concrete trigger]
30
- B -->|yes, grounded| D[Strip to minimum viable scope]
31
- C --> B
32
- D --> E{Request precise enough?}
33
- E -->|vague| F[Challenge: what exactly? for whom? what changes?]
34
- E -->|precise| G[Propose minimal approach — 1 not 3]
35
- F --> E
36
- G --> H[Present constraints and trade-offs]
37
- H --> I{User approves?}
38
- I -->|no| G
39
- I -->|yes| J[Generate plan diagram .mmd]
40
- J --> K[Write design to arcs plan]
41
- K --> L[Invoke writing-plans skill]
24
+ A[INTAKE] --> B[FACT_FINDING]
25
+ B --> C[DECISION_LOOP]
26
+ C -->|completion predicate satisfied| D[DESIGN_DRAFT]
27
+ D --> E[WAITING_FOR_DESIGN_APPROVAL]
28
+ E -->|material revision requested| C
29
+ E -->|explicit design approval| F[Hand off to writing-plans]
42
30
  ```
43
31
 
44
- ## Prior Decisions Check
45
-
46
- Before challenging, read what's already settled so you don't relitigate or contradict a prior call: `arcs knowledge search <slug> "<topic-keywords>" --lean --json` filtering for `kind=decision` and `kind=architecture`. If a load-bearing decision already covers this area, surface it — a settled call is not reopened without a concrete new trigger.
32
+ ## Hard Boundary
47
33
 
48
- ## Challenge Protocol
34
+ Brainstorming must never create, write, or persist plans, tasks, diagrams, or knowledge. It must not invoke implementation, write code, commit, perform automatic git actions, or claim authorization to author durable artifacts. It may read repository, DAG, and environment evidence and may propose knowledge wording for later orchestrator fan-in, but it does not persist that proposal.
49
35
 
50
- Before designing anything, interrogate the request:
36
+ The only next skill after approved design is `writing-plans`; never invoke an implementation skill from brainstorming.
51
37
 
52
- ### 1. WHY — Justify existence
53
- - "What breaks if we don't do this?"
54
- - "Who is blocked by the absence of this?"
55
- - "Show me the error / the gap / the user complaint."
38
+ ## State Protocol
56
39
 
57
- If the answer is hypothetical ("we might need...", "in case someone wants...") → **reject the premise.** Propose deferral.
40
+ ### INTAKE
58
41
 
59
- ### 2. WHAT Force precision
60
- - "What exactly changes? Name the file, the function, the behavior."
61
- - "What does 'done' look like? Give me the acceptance test in one sentence."
62
- - "What does this NOT do? Draw the boundary."
42
+ Extract the stated goal, requested scope, constraints, non-goals, acceptance evidence, and volunteered decisions. Treat clear user statements as settled unless current evidence contradicts them. Push back only on a concrete risk, unsupported premise, conflict, or avoidable scope.
63
43
 
64
- If the user can't answer → the request isn't ready. Don't design around ambiguity — surface it.
44
+ ### FACT_FINDING
65
45
 
66
- ### 3. HOW SMALL Strip to minimum
67
- - "What's the smallest version that unblocks you?"
68
- - "Can this be a 1-file change instead of a system?"
69
- - "Does this need a new abstraction, or can the existing pattern absorb it?"
46
+ Resolve repository-, DAG-, environment-, and tool-discoverable facts before asking the user. Read established patterns and settled architecture or decision knowledge so you do not ask the user to locate files, recite current behavior, or relitigate prior calls.
70
47
 
71
- Always propose the brutal minimum first. Let the user argue for more.
48
+ Use `arcs knowledge search <slug> "<topic-keywords>" --lean --json` for relevant decisions, patterns, and architecture. Reads are evidence gathering only.
72
49
 
73
- ## YAGNI Enforcement (Non-Negotiable)
50
+ ### DECISION_LOOP
74
51
 
75
- | Signal | Response |
76
- |--------|----------|
77
- | "We might need X later" | "What's the concrete trigger? Until it fires, we don't build it." |
78
- | "Let's make it configurable" | "How many configs exist today? If 1, hardcode it." |
79
- | "Add a plugin/hook system" | "Name 2 plugins that exist right now. If you can't, no." |
80
- | "Generic interface for future use" | "1 consumer = no interface. Inline it." |
81
- | "Let's plan for scale" | "What's current load? Solve for 10x of that, nothing more." |
82
- | User adds scope during discussion | "That's a separate request. Finish this one minimal first." |
52
+ Maintain a finite list of unresolved material user-owned decisions. A decision is material when different answers alter externally visible behavior, scope, acceptance, irreversible choices, security/privacy posture, or a load-bearing trade-off.
83
53
 
84
- **Do not soften these.** State them flat. The user can override with justification, but they must explicitly argue past you.
54
+ - Ask one coupled material user-owned decision at a time, with a recommended answer and concise trade-off.
55
+ - Accept multiple answers when the user volunteers them; do not ask them again.
56
+ - Batch only independent factual confirmations when a tool cannot resolve them.
57
+ - Choose trivial, reversible implementation details from existing conventions without consuming a user turn.
58
+ - Do not ask a question merely to demonstrate challenge. If no material user-owned decision remains, proceed.
85
59
 
86
- ## Best Practices Force Them
60
+ The explicit completion predicate is satisfied only when all five are known: **goal, scope, non-goals, acceptance criterion, and all material decisions**. Stop questioning immediately when the completion predicate is satisfied.
87
61
 
88
- When the user's approach conflicts with established patterns, **don't ask if they want best practices — enforce them:**
62
+ ### DESIGN_DRAFT
89
63
 
90
- - **Existing codebase patterns win.** If the repo does X one way, new code does it the same way. No "let's also refactor while we're here."
91
- - **Separation of concerns.** One thing per unit. If a proposal mixes responsibilities, split it before designing.
92
- - **Testability first.** If a design can't be tested in isolation, reject it. "How do you test this without spinning up the whole system?"
93
- - **Explicit over implicit.** If behavior is hidden behind magic (auto-detection, convention-over-configuration chains), make it explicit.
94
- - **Reversibility.** Prefer changes that are easy to undo. Flag irreversible decisions loudly.
64
+ Present one minimal design, scaled to the problem. Include:
95
65
 
96
- ## Q&A Rhythm
66
+ - one-sentence goal and done criterion;
67
+ - in-scope and non-goals;
68
+ - behavior and boundaries;
69
+ - affected surfaces at design-level precision;
70
+ - load-bearing decisions, constraints, and trade-offs;
71
+ - test or verification strategy.
97
72
 
98
- - **One challenge per message** focused, pointed, impossible to dodge
99
- - **Multiple choice when forcing a decision** — 2-3 options, each with clear trade-off stated
100
- - **Cut scope aggressively**: if request describes multiple independent concerns, split immediately. "That's 3 separate things. Which one is blocking you right now?"
101
- - No open-ended "what do you think?" — always propose a position and let user argue against it
102
- - When the user explicitly requests a grill, or an ordinary challenge leaves a material decision unresolved, investigate environment- or tool-discoverable facts before asking the user. Then ask exactly one user-owned decision at a time, with a recommended default.
73
+ Do not include a plan, task decomposition, execution diagram, implementation steps, or persistence commands. The design may describe a visual interaction, but it is not an agentic execution map.
103
74
 
104
- ## Design Presentation
75
+ ### WAITING_FOR_DESIGN_APPROVAL
105
76
 
106
- When the request survives the challenge protocol:
77
+ Ask the current user to approve or revise the presented design. Design approval means only that `writing-plans` may draft authoring artifacts; it is not authorization to persist a plan, tasks, a diagram, or knowledge.
107
78
 
108
- - **One approach, not three.** Present the minimal viable design. If the user wants alternatives, they'll ask.
109
- - State constraints and trade-offs up front — what this design gives up, what it can't do, where it'll hurt if scope grows.
110
- - Cover only what's needed: affected files, behavior change, test strategy. No boilerplate sections.
111
- - Scale each section to its complexity (1 sentence → 200 words max). Don't pad.
79
+ If the user requests a material design change, return to `DECISION_LOOP`, revise the design, and request approval of the new design. If the user approves, hand the exact approved design to `writing-plans`.
112
80
 
113
- ## Diagram Creation
81
+ ## Scope Discipline
114
82
 
115
- <HARD-GATE>
116
- A plan diagram MUST be generated and presented before proceeding to storage. Draft in memory or `/tmp` — never write to DAG before the user confirms the design.
117
- </HARD-GATE>
83
+ Apply YAGNI against concrete evidence:
118
84
 
119
- - Load the `to-diagram` skill before generating any diagram content.
120
- - Use `flowchart TD` for task/dependency graphs; `stateDiagram-v2` for lifecycles
121
- - All nodes start `:::backlog`, stable IDs (`T001`, `T002`, ...)
122
- - Persist only after user confirms
123
-
124
- ## Storage
125
-
126
- ```bash
127
- arcs plan create <slug> --title="YYYY-MM-DD <topic> Design" --summary="..." --status=proposed --keywords="spec,design" --body="<markdown>" --json
128
- ```
129
-
130
- When creating tasks from the plan, wire execution order with `--dependsOn=dep-task-id-1,dep-task-id-2`. The `dependsOn` graph determines what `arcs next` returns — priority is a tiebreaker within the same topological level.
131
-
132
- After the design lands, capture the reasoning that the plan body alone will lose — this is the richest, most-skipped knowledge in the whole workflow. For each load-bearing DECISION and each REJECTED ALTERNATIVE (with the rationale for rejection), emit/run an upsert: `arcs knowledge upsert <slug> "<decision title>" --kind=decision --summary="<what was decided and why; what was rejected and why>" --keywords="<k1,k2>" --source-files="<path[:anchor],...>" --json`. Upsert is idempotent by title, so no dedup search is needed. (When the orchestrator drives this skill, emit the upsert command for it to run; standalone with bash, run it directly.)
85
+ | Signal | Response |
86
+ |--------|----------|
87
+ | Hypothetical future need | Defer until a named trigger occurs |
88
+ | Configuration with one current value | Keep the value local unless variability is required now |
89
+ | Generic interface with one consumer | Use the existing concrete pattern |
90
+ | Unrelated cleanup | Exclude it from scope |
91
+ | Multiple independent outcomes | Separate them and identify which outcome is currently required |
133
92
 
134
- After storage: _"Spec saved to plan `<planId>`. Review it. Push back if anything's wrong."_
93
+ Existing codebase patterns win unless the approved goal requires changing them. Prefer reversible choices. Never simplify away security, accessibility, validation, or data-loss prevention.
135
94
 
136
95
  ## Visual Companion
137
96
 
138
- Browser-based companion for mockups/diagrams. Offer once when visual questions are anticipated:
97
+ Browser-based companion for mockups and visual design questions. Offer once when seeing is materially clearer than reading:
139
98
 
140
99
  > "This might be easier to show visually. Want a browser companion?"
141
100
 
142
- - This offer MUST be its own message (no other content)
143
- - Per-question: use browser only when **seeing** beats **reading**
144
- - If accepted, read `skills/brainstorming/visual-companion.md`
101
+ - This offer must be its own message with no other content.
102
+ - Use the browser only for questions where seeing beats reading.
103
+ - If accepted, read `skills/brainstorming/visual-companion.md`.
104
+ - A visual companion is exploratory design evidence, not a plan diagram or durable artifact.
105
+
106
+ ## Exit
107
+
108
+ Exit only with either:
145
109
 
146
- ## Constraints
110
+ 1. a specifically identified unresolved material user-owned decision; or
111
+ 2. an exact approved design handed to `writing-plans`.
147
112
 
148
- - The ONLY next skill after brainstorming is `writing-plans` never implementation skills
149
- - Every project needs a design, no matter how "simple"
150
- - One challenge per message, multiple choice when forcing decisions
151
- - YAGNI is not a suggestion — it's a hard filter. Every feature must justify its existence NOW.
152
- - Existing codebases: explore first, follow patterns, don't propose unrelated refactoring
153
- - **Never agree easily.** If the user's first description is accepted without pushback, you failed. There's always something to clarify, trim, or ground.
113
+ Never imply that brainstorming must always ask something. Finite completion is the objective.
@@ -1,7 +1,10 @@
1
- const crypto = require('crypto');
2
- const http = require('http');
3
- const fs = require('fs');
4
- const path = require('path');
1
+ import crypto from 'node:crypto';
2
+ import fs from 'node:fs';
3
+ import http from 'node:http';
4
+ import path from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
5
8
 
6
9
  // ========== WebSocket Protocol (RFC 6455) ==========
7
10
 
@@ -79,6 +82,24 @@ const URL_HOST = process.env.BRAINSTORM_URL_HOST || (HOST === '127.0.0.1' ? 'loc
79
82
  const SCREEN_DIR = process.env.BRAINSTORM_DIR || '/tmp/brainstorm';
80
83
  const OWNER_PID = process.env.BRAINSTORM_OWNER_PID ? Number(process.env.BRAINSTORM_OWNER_PID) : null;
81
84
 
85
+ function isLiteralBindLoopback(host) {
86
+ return host === '127.0.0.1';
87
+ }
88
+
89
+ function isLoopbackUrlHost(host) {
90
+ return host === '127.0.0.1' || host === 'localhost';
91
+ }
92
+
93
+ if (!isLiteralBindLoopback(HOST)) {
94
+ console.error('Brainstorm server bind host must be a literal loopback address.');
95
+ process.exit(1);
96
+ }
97
+
98
+ if (!isLoopbackUrlHost(URL_HOST)) {
99
+ console.error('Brainstorm server URL host must be loopback-only.');
100
+ process.exit(1);
101
+ }
102
+
82
103
  const MIME_TYPES = {
83
104
  '.html': 'text/html', '.css': 'text/css', '.js': 'application/javascript',
84
105
  '.json': 'application/json', '.png': 'image/png', '.jpg': 'image/jpeg',
@@ -295,7 +316,10 @@ function startServer() {
295
316
  });
296
317
  watcher.on('error', (err) => console.error('fs.watch error:', err.message));
297
318
 
319
+ let shuttingDown = false;
298
320
  function shutdown(reason) {
321
+ if (shuttingDown) return;
322
+ shuttingDown = true;
299
323
  console.log(JSON.stringify({ type: 'server-stopped', reason }));
300
324
  const infoFile = path.join(SCREEN_DIR, '.server-info');
301
325
  if (fs.existsSync(infoFile)) fs.unlinkSync(infoFile);
@@ -320,10 +344,15 @@ function startServer() {
320
344
  }, 60 * 1000);
321
345
  lifecycleCheck.unref();
322
346
 
347
+ process.once('SIGINT', () => shutdown('SIGINT'));
348
+ process.once('SIGTERM', () => shutdown('SIGTERM'));
349
+
323
350
  server.listen(PORT, HOST, () => {
351
+ const address = server.address();
352
+ const port = typeof address === 'object' && address ? address.port : Number(PORT);
324
353
  const info = JSON.stringify({
325
- type: 'server-started', port: Number(PORT), host: HOST,
326
- url_host: URL_HOST, url: 'http://' + URL_HOST + ':' + PORT,
354
+ type: 'server-started', port, host: HOST,
355
+ url_host: URL_HOST, url: 'http://' + URL_HOST + ':' + port,
327
356
  screen_dir: SCREEN_DIR
328
357
  });
329
358
  console.log(info);
@@ -331,8 +360,6 @@ function startServer() {
331
360
  });
332
361
  }
333
362
 
334
- if (require.main === module) {
335
- startServer();
336
- }
363
+ startServer();
337
364
 
338
- module.exports = { computeAcceptKey, encodeFrame, decodeFrame, OPCODES };
365
+ export { computeAcceptKey, decodeFrame, encodeFrame, OPCODES };
@@ -8,9 +8,8 @@
8
8
  # Options:
9
9
  # --project-dir <path> Store session files under <path>/.superpowers/brainstorm/
10
10
  # instead of /tmp. Files persist after server stops.
11
- # --host <bind-host> Host/interface to bind (default: 127.0.0.1).
12
- # Use 0.0.0.0 in remote/containerized environments.
13
- # --url-host <host> Hostname shown in returned URL JSON.
11
+ # --host <bind-host> Loopback host/interface to bind (default: 127.0.0.1).
12
+ # --url-host <host> Loopback hostname shown in returned URL JSON.
14
13
  # --foreground Run server in the current terminal (no backgrounding).
15
14
  # --background Force background mode (overrides Codex auto-foreground).
16
15
 
@@ -51,6 +50,19 @@ while [[ $# -gt 0 ]]; do
51
50
  esac
52
51
  done
53
52
 
53
+ is_literal_bind_loopback() {
54
+ [[ "$1" == "127.0.0.1" ]]
55
+ }
56
+
57
+ is_loopback_url_host() {
58
+ [[ "$1" == "127.0.0.1" || "$1" == "localhost" ]]
59
+ }
60
+
61
+ if ! is_literal_bind_loopback "$BIND_HOST"; then
62
+ echo "{\"error\": \"Brainstorm server bind host must be a literal loopback address: $BIND_HOST\"}"
63
+ exit 1
64
+ fi
65
+
54
66
  if [[ -z "$URL_HOST" ]]; then
55
67
  if [[ "$BIND_HOST" == "127.0.0.1" || "$BIND_HOST" == "localhost" ]]; then
56
68
  URL_HOST="localhost"
@@ -59,6 +71,11 @@ if [[ -z "$URL_HOST" ]]; then
59
71
  fi
60
72
  fi
61
73
 
74
+ if ! is_loopback_url_host "$URL_HOST"; then
75
+ echo "{\"error\": \"Brainstorm server URL host must be loopback-only: $URL_HOST\"}"
76
+ exit 1
77
+ fi
78
+
62
79
  # Some environments reap detached/background processes. Auto-foreground when detected.
63
80
  if [[ -n "${CODEX_CI:-}" && "$FOREGROUND" != "true" && "$FORCE_BACKGROUND" != "true" ]]; then
64
81
  FOREGROUND="true"
@@ -2,8 +2,8 @@
2
2
  # Stop the brainstorm server and clean up
3
3
  # Usage: stop-server.sh <screen_dir>
4
4
  #
5
- # Kills the server process. Only deletes session directory if it's
6
- # under /tmp (ephemeral). Persistent directories (.superpowers/) are
5
+ # Kills the server process. Only deletes generated /tmp/brainstorm-* session
6
+ # roots. Persistent generated directories (.superpowers/) are
7
7
  # kept so mockups can be reviewed later.
8
8
 
9
9
  SCREEN_DIR="$1"
@@ -13,16 +13,35 @@ if [[ -z "$SCREEN_DIR" ]]; then
13
13
  exit 1
14
14
  fi
15
15
 
16
- PID_FILE="${SCREEN_DIR}/.server.pid"
16
+ if [[ "$SCREEN_DIR" != /* || "$SCREEN_DIR" =~ (^|/)\.\.(/|$) ]]; then
17
+ echo '{"error": "Invalid brainstorm session root"}'
18
+ exit 1
19
+ fi
20
+
21
+ CANONICAL_DIR="$(realpath -- "$SCREEN_DIR" 2>/dev/null)"
22
+ if [[ -z "$CANONICAL_DIR" ]]; then
23
+ echo '{"error": "Brainstorm session root does not exist"}'
24
+ exit 1
25
+ fi
26
+
27
+ EPHEMERAL="false"
28
+ if [[ "$CANONICAL_DIR" =~ ^/tmp/brainstorm-[0-9]+-[0-9]+$ ]]; then
29
+ EPHEMERAL="true"
30
+ elif [[ ! "$CANONICAL_DIR" =~ ^/.+/\.superpowers/brainstorm/[0-9]+-[0-9]+$ ]]; then
31
+ echo '{"error": "Refusing non-generated brainstorm session root"}'
32
+ exit 1
33
+ fi
34
+
35
+ PID_FILE="${CANONICAL_DIR}/.server.pid"
17
36
 
18
37
  if [[ -f "$PID_FILE" ]]; then
19
38
  pid=$(cat "$PID_FILE")
20
39
  kill "$pid" 2>/dev/null
21
- rm -f "$PID_FILE" "${SCREEN_DIR}/.server.log"
40
+ rm -f "$PID_FILE" "${CANONICAL_DIR}/.server.log"
22
41
 
23
42
  # Only delete ephemeral /tmp directories
24
- if [[ "$SCREEN_DIR" == /tmp/* ]]; then
25
- rm -rf "$SCREEN_DIR"
43
+ if [[ "$EPHEMERAL" == "true" ]]; then
44
+ rm -rf -- "$CANONICAL_DIR"
26
45
  fi
27
46
 
28
47
  echo '{"status": "stopped"}'
@@ -2,6 +2,8 @@
2
2
 
3
3
  Browser-based visual brainstorming companion for showing mockups, diagrams, and options.
4
4
 
5
+ The companion is loopback-only: it serves the local browser on the same machine and rejects non-loopback host configuration.
6
+
5
7
  ## When to Use
6
8
 
7
9
  Decide per-question, not per-session. The test: **would the user understand this better by seeing it than reading it?**
@@ -70,16 +72,7 @@ scripts/start-server.sh --project-dir /path/to/project --foreground
70
72
 
71
73
  **Other environments:** The server must keep running in the background across conversation turns. If your environment reaps detached processes, use `--foreground` and launch the command with your platform's background execution mechanism.
72
74
 
73
- If the URL is unreachable from your browser (common in remote/containerized setups), bind a non-loopback host:
74
-
75
- ```bash
76
- scripts/start-server.sh \
77
- --project-dir /path/to/project \
78
- --host 0.0.0.0 \
79
- --url-host localhost
80
- ```
81
-
82
- Use `--url-host` to control what hostname is printed in the returned URL JSON.
75
+ `--host` and `--url-host` accept loopback names and addresses only. Remote/container port exposure is intentionally unsupported.
83
76
 
84
77
  ## The Loop
85
78
 
@@ -9,7 +9,7 @@ description: Use when the user provides a GitHub PR link with a "deep review" tr
9
9
 
10
10
  User gives a GitHub PR URL plus a "deep review" trigger inside the locally cloned repo of that PR. Reviewer-side workflow: read-only by default, posts to GitHub only after explicit user gate.
11
11
 
12
- > CLI: `arcs --commands --json` for discovery. Posting is user-gated. ARCS writes (optional knowledge harvest) run directly via the CLI.
12
+ > CLI: `arcs --commands --json` for discovery. Posting is user-gated. Knowledge is proposal-only unless the user separately and explicitly authorizes that exact ARCS write.
13
13
 
14
14
  ## Flow
15
15
 
@@ -84,7 +84,7 @@ Agent picks dimensions from diff context. **Correctness is always evaluated.** O
84
84
  | **SOLID** | Module gains responsibilities, dependency direction shifts, large classes touched |
85
85
  | **Convention fit** | AGENTS.md or DAG `pattern`/`architecture` knowledge applies to changed files |
86
86
  | **Architectural risk** → handoff to the tech-architect agent (structural audit) | Diff crosses module boundaries, touches god nodes, changes public API |
87
- | **Performance risk** → handoff to the oncall-ops agent (performance investigation) | Hot paths, loops over external IO, new queries, allocations in render |
87
+ | **Performance/incident risk** → handoff to the software-engineer agent in incident mode with systematic-debugging | Hot paths, loops over external IO, new queries, allocations in render |
88
88
 
89
89
  Skipped dimensions are reported as `cleared (not applicable: <reason>)`. Never silently dropped.
90
90
 
@@ -106,7 +106,7 @@ Format: `L<line>: <tag> <what>. <replacement>.` — use `<file>:L<line>: ...` fo
106
106
 
107
107
  End with the only metric that matters: `net: -<N> lines, -<M> deps possible.` Nothing to cut → `Lean already. Ship.`
108
108
 
109
- Boundary: never flag the single ONE-runnable-check that `the-ladder` requires for non-trivial logic as bloat.
109
+ Boundary: never flag the single runnable check that implementation minimalism requires for non-trivial logic as bloat.
110
110
 
111
111
  ## Severity Prefixes
112
112
 
@@ -184,7 +184,7 @@ gh api POST /repos/{owner}/{repo}/pulls/{number}/reviews \
184
184
 
185
185
  ## Knowledge Proposals (standard report output)
186
186
 
187
- A recurring finding — the same class of bug, the same convention violation, a trap seen more than once across the diff — is durable knowledge, not just a one-off comment. Make proposing it a standard part of the report, not an afterthought: for each recurring finding, include a proposed `arcs knowledge upsert <slug> "<title>" --kind=<pattern|gotcha> --summary="<the recurring issue and the fix convention>" --keywords="<k1,k2>" --source-files="<path,...>" --json` in the report. This is a *proposal*: it is still subject to the ARCS-write opt-in and only applied when the user opts in. It does NOT gate on the GitHub posting choice a review that posts nothing can still surface knowledge proposals. Upsert is idempotent by title.
187
+ A recurring finding — the same class of bug, the same convention violation, a trap seen more than once across the diff — is durable knowledge, not just a one-off comment. Make proposing it a standard part of the report, not an afterthought. First use `arcs knowledge template --kind=<kind> --json`; then include a proposed `arcs knowledge upsert <slug> "<title>" --kind=<pattern|gotcha> --summary="<the recurring issue and the fix convention>" --body="<substantive filled template>" --keywords="<k1,k2>" --source-files="<path,...>" --json` in the report. Do not execute `arcs knowledge upsert` without explicit user authorization for that exact command. This opt-in is separate from the GitHub posting choice: a review that posts nothing can still surface knowledge proposals. Upsert is idempotent by title.
188
188
 
189
189
  ## Report Structure
190
190
 
@@ -210,7 +210,7 @@ A recurring finding — the same class of bug, the same convention violation, a
210
210
  - Cite every finding — no uncited claims
211
211
  - ` ```suggestion ` blocks only for small line-replacement fixes
212
212
  - Defer to the tech-architect agent (structural audit) for full structural drift; surface as handoff flag, do not run inline
213
- - Defer to the oncall-ops agent (performance investigation) for perf work; surface as risk flag
213
+ - Defer performance or incident investigation to the software-engineer agent with `AGENT_MODE: incident` and mandatory systematic-debugging; surface as a risk flag
214
214
  - Review dimensions are defined in this skill (Adaptive Rubric); inline findings use the one-line format `<file>:L<line>: problem. fix.` — do not duplicate
215
215
  - Re-review detection: if AI has reviewed before, scope to diff since last review's commit_id
216
216
  - Tag each posted suggestion with `<!-- arcs:deep-review:<finding-id> -->` for re-review tracking
@@ -26,7 +26,7 @@ Used as the `body` field of `gh api repos/{owner}/{repo}/pulls/{pull_number}/rev
26
26
  ### Architectural / Performance Handoffs
27
27
  <only if any; otherwise omit section>
28
28
  - [tech-architect] <reason — e.g. crosses 3 modules, touches god node X>
29
- - [oncall-ops] <reason — e.g. new query in render path>
29
+ - [software-engineer, AGENT_MODE: incident, systematic-debugging] <reason — e.g. new query in render path>
30
30
 
31
31
  ### Citations Used
32
32
  - AGENTS.md §<section> — <what was checked>
@@ -13,7 +13,7 @@ The CLI surfaced raw codegraph proposals and is waiting for an agent to turn the
13
13
  - `arcs codegraph-sync` returned `pending_enrichment: true`.
14
14
  - User said "enrich the proposals", "process the codegraph queue", "promote the pending proposals", or similar.
15
15
 
16
- > **Read-write skill.** This skill mutates the DAG via `arcs proposal promote/drop`. Before each promote, meet an evidence threshold: verify the proposal's structural facts, dedup candidates, natural kind, and source files support the authored entry. If that evidence is incomplete, drop or defer it; the orchestrator/devil-advocate gate independently checks the resulting workflow.
16
+ > **Read-only proposal skill.** This skill reads the queue, reaches verdicts only after the evidence threshold below is met, and returns exact commands under `PROPOSED_MUTATIONS:`. It does not execute `arcs proposal promote/drop` or `arcs knowledge upsert`; the orchestrator applies approved mutations.
17
17
 
18
18
  ## Flow
19
19
 
@@ -27,12 +27,12 @@ flowchart TD
27
27
  B -->|No| C[Pick highest-degree proposal]
28
28
  C --> D[Read structuralFacts + suggestedDedupCandidates]
29
29
  D --> E{Verdict}:::decision
30
- E -->|drop| F[arcs proposal drop slug id --reason='...']
30
+ E -->|drop| F[Propose drop command + reason]
31
31
  E -->|keep| G[Author title + summary + body]
32
32
  E -->|merge| H[Identify dedup target id]
33
33
  H --> I[Author append-style body]
34
- I --> J[arcs proposal promote slug id --merge-with=target ...]
35
- G --> K[arcs proposal promote slug id ...]
34
+ I --> J[Propose merge command]
35
+ G --> K[Propose promote command]
36
36
  F --> L{Budget left?}
37
37
  J --> L
38
38
  K --> L
@@ -57,7 +57,7 @@ Promote as a fresh knowledge entry when ALL of:
57
57
 
58
58
  ### Drop
59
59
 
60
- Reject the proposal (use `arcs proposal drop`) when ANY of:
60
+ Propose `arcs proposal drop` when ANY of:
61
61
 
62
62
  - `structuralFacts.fileTypeBreakdown` has zero code (all `.md`, `.mdx`, `.txt`, `.html` templates, skill files). T007 should already filter these — drop is defense-in-depth.
63
63
  - Cluster covers test directories only (`test/`, `__tests__/`, `*.test.ts`, `*.spec.ts`, `tests/`).
@@ -70,7 +70,7 @@ Always pass a `--reason` string. The reason is durable on the proposal-store led
70
70
 
71
71
  ### Merge
72
72
 
73
- Use `arcs proposal promote --merge-with=<existing-id>` when:
73
+ Propose `arcs proposal promote --merge-with=<existing-id>` when:
74
74
 
75
75
  - `suggestedDedupCandidates` lists an existing knowledge entry whose `kind` matches the proposal's natural kind, AND
76
76
  - The proposal adds genuinely new structural facts the existing entry does not already document (e.g. precise degree numbers, additional top hubs, cross-module edges, fileCount).
@@ -113,17 +113,17 @@ Always pass `--source-files` listing the files in `structuralFacts.fileList` (or
113
113
 
114
114
  - **Cap at 12 enrichments per session.** If proposals list exceeds 12, drop low-signal entries en masse before enriching the keep set.
115
115
  - **Process highest-degree clusters first.** Sort proposals by `structuralFacts.degree` descending; the top 3–5 carry most of the value.
116
- - **Bulk drop early.** A single triage pass over all proposals calling `arcs proposal drop` on obvious noise — is cheaper than enriching one and discovering the next is also noise.
116
+ - **Bulk-triage early.** Proposing drops for obvious noise in one pass is cheaper than enriching one and discovering the next is also noise.
117
117
  - **Stop early on budget.** If the agent has spent ~12 enrichments, drop the remainder with reason `"session budget exhausted; reconsider next sync"` rather than producing rushed entries.
118
118
 
119
119
  ## Failure Modes
120
120
 
121
121
  | Symptom | Recovery |
122
122
  |-----------------------------------------------------------|------------------------------------------------------------------------------------------------|
123
- | `promote --merge-with=<id>` fails: target doesn't exist | Drop the merge plan; re-run as a fresh `promote` (no `--merge-with`). |
123
+ | Proposed merge target no longer exists at apply time | Orchestrator rejects it; return for re-audit rather than changing the command during apply. |
124
124
  | Body too long for shell argv (errno E2BIG / argv overflow)| Switch to `--body-file=path/to/body.md` or pipe via `--body-stdin`. |
125
- | `proposal_not_found` on promote/drop | Another agent already handled it. Skip and continue proposal-store lock is first-come-first-serve. |
126
- | Promote succeeds but knowledge graph misses the edge | Verify `--source-files` was passed and points at real paths under the project root. |
125
+ | Proposal disappears before return | Re-list read-only, omit it, and report the race. |
126
+ | Proposed entry would miss graph edges | Verify `--source-files` is present and points at real paths under the project root. |
127
127
  | `structuralFacts` field absent | Treat as drop candidate — proposal has no evidence to enrich from. |
128
128
  | Verdict drift: same proposal triaged twice in one session | Re-list with `arcs proposal list --json` — the store is the single source of truth. |
129
129
 
@@ -132,8 +132,8 @@ Always pass `--source-files` listing the files in `structuralFacts.fileList` (or
132
132
  - **Do not invent structural facts** not present in `structuralFacts`. If real-code grounding is needed, defer to `arcs context <slug> --audience=<role>` or `arcs related <slug> <id>` and read source. Hallucinated graph facts poison every downstream retrieval.
133
133
  - **Always specify `--source-files`** on promote — graph-retrieval depends on it (per AGENTS.md "Knowledge gravity"). An entry without source files is a leaf with no inbound edges.
134
134
  - **Never edit `.mmd` files** directly — diagram ownership rules in AGENTS.md still apply during enrichment.
135
- - **No batch promote.** Each promote is one decision, one `arcs proposal promote` call. Bulk-promoting via `arcs batch` bypasses dedup checks and per-proposal review.
136
- - **Preserve proposal IDs in commit messages / summaries** when reporting back so the human can audit the verdict ledger.
135
+ - **No batch promote.** Each proposed promote is one decision and one command. Bulk promotion bypasses dedup checks and per-proposal review.
136
+ - **Preserve proposal IDs in summaries** when reporting back so the human can audit the verdict ledger.
137
137
 
138
138
  ## Worked Example
139
139
 
@@ -141,11 +141,11 @@ Always pass `--source-files` listing the files in `structuralFacts.fileList` (or
141
141
  # 1. List pending proposals (highest-degree first by default)
142
142
  arcs proposal list arcs --json
143
143
 
144
- # 2. Drop obvious noise in bulk
144
+ # 2. PROPOSED_MUTATIONS: drop obvious noise
145
145
  arcs proposal drop arcs prop_test_dirs_only \
146
146
  --reason="cluster covers test/ only — defense in depth past T007 filter" --json
147
147
 
148
- # 3. Promote a keep verdict with full enrichment
148
+ # 3. PROPOSED_MUTATIONS: promote a keep verdict with full enrichment
149
149
  arcs proposal promote arcs prop_storage_hub \
150
150
  --title="Storage hub re-exporting helpers to all persistent stores" \
151
151
  --summary="Central re-export point for nowISO and sanitizeFileRefs used by task/plan/knowledge stores; edits ripple through every persistent surface." \
@@ -154,17 +154,16 @@ arcs proposal promote arcs prop_storage_hub \
154
154
  --source-files=src/utils/storage-utils.ts,src/utils/task-store.ts,src/utils/plan-store.ts,src/utils/knowledge-store.ts \
155
155
  --json
156
156
 
157
- # 4. Merge into an existing entry
157
+ # 4. PROPOSED_MUTATIONS: merge into an existing entry
158
158
  arcs proposal promote arcs prop_cli_registry \
159
159
  --merge-with=cli-registry-pattern-handlers-typed-via-parsedparams \
160
160
  --body-file=/tmp/cli-registry-graph-evidence.md \
161
161
  --source-files=src/cli/command-registry.ts,src/cli/index.ts \
162
162
  --json
163
163
 
164
- # 5. Confirm queue drained
165
- arcs proposal list arcs --json # expect data.proposals == []
164
+ # Return these commands without executing them; the orchestrator applies approved mutations.
166
165
  ```
167
166
 
168
167
  ## Exit
169
168
 
170
- When `arcs proposal list <slug> --json` returns an empty `proposals` array, the enrichment pass is done. Surface a one-line summary to the orchestrator: kept N, merged M, dropped K, deferred D.
169
+ Return `PROPOSED_MUTATIONS:` with one stable proposal ID, verdict, rationale, and exact command per item. Do not execute `arcs knowledge upsert` or proposal mutations. Surface a one-line summary to the orchestrator: proposed keeps N, merges M, drops K, deferred D.