opencastle 1.3.0 → 1.4.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 (577) hide show
  1. package/README.md +102 -131
  2. package/bin/cli.mjs +20 -10
  3. package/dist/cli/adapters/claude-code.d.ts +5 -3
  4. package/dist/cli/adapters/claude-code.d.ts.map +1 -1
  5. package/dist/cli/adapters/claude-code.js +7 -3
  6. package/dist/cli/adapters/claude-code.js.map +1 -1
  7. package/dist/cli/adapters/single-file-base.d.ts +18 -0
  8. package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
  9. package/dist/cli/adapters/single-file-base.js +29 -4
  10. package/dist/cli/adapters/single-file-base.js.map +1 -1
  11. package/dist/cli/agent-plugin.test.js +12 -0
  12. package/dist/cli/agent-plugin.test.js.map +1 -1
  13. package/dist/cli/agent-roster.test.js +0 -48
  14. package/dist/cli/agent-roster.test.js.map +1 -1
  15. package/dist/cli/bootstrap.d.ts.map +1 -1
  16. package/dist/cli/bootstrap.js +20 -0
  17. package/dist/cli/bootstrap.js.map +1 -1
  18. package/dist/cli/boundary.test.js +9 -7
  19. package/dist/cli/boundary.test.js.map +1 -1
  20. package/dist/cli/ci.d.ts.map +1 -1
  21. package/dist/cli/ci.js +6 -4
  22. package/dist/cli/ci.js.map +1 -1
  23. package/dist/cli/command-namespace.test.js +33 -0
  24. package/dist/cli/command-namespace.test.js.map +1 -1
  25. package/dist/cli/convoy/artifacts.d.ts +9 -2
  26. package/dist/cli/convoy/artifacts.d.ts.map +1 -1
  27. package/dist/cli/convoy/artifacts.js +13 -10
  28. package/dist/cli/convoy/artifacts.js.map +1 -1
  29. package/dist/cli/convoy/artifacts.test.js +4 -2
  30. package/dist/cli/convoy/artifacts.test.js.map +1 -1
  31. package/dist/cli/convoy/engine.d.ts +53 -23
  32. package/dist/cli/convoy/engine.d.ts.map +1 -1
  33. package/dist/cli/convoy/engine.git.test.d.ts +2 -0
  34. package/dist/cli/convoy/engine.git.test.d.ts.map +1 -0
  35. package/dist/cli/convoy/engine.git.test.js +435 -0
  36. package/dist/cli/convoy/engine.git.test.js.map +1 -0
  37. package/dist/cli/convoy/engine.js +1746 -2305
  38. package/dist/cli/convoy/engine.js.map +1 -1
  39. package/dist/cli/convoy/engine.test.js +698 -678
  40. package/dist/cli/convoy/engine.test.js.map +1 -1
  41. package/dist/cli/convoy/event-schemas.d.ts +2 -0
  42. package/dist/cli/convoy/event-schemas.d.ts.map +1 -1
  43. package/dist/cli/convoy/event-schemas.js +59 -57
  44. package/dist/cli/convoy/event-schemas.js.map +1 -1
  45. package/dist/cli/convoy/events.d.ts +4 -1
  46. package/dist/cli/convoy/events.d.ts.map +1 -1
  47. package/dist/cli/convoy/events.js +69 -84
  48. package/dist/cli/convoy/events.js.map +1 -1
  49. package/dist/cli/convoy/events.test.js +50 -9
  50. package/dist/cli/convoy/events.test.js.map +1 -1
  51. package/dist/cli/convoy/gates.d.ts +9 -4
  52. package/dist/cli/convoy/gates.d.ts.map +1 -1
  53. package/dist/cli/convoy/gates.js +29 -14
  54. package/dist/cli/convoy/gates.js.map +1 -1
  55. package/dist/cli/convoy/isolation.d.ts +32 -6
  56. package/dist/cli/convoy/isolation.d.ts.map +1 -1
  57. package/dist/cli/convoy/isolation.js +72 -34
  58. package/dist/cli/convoy/isolation.js.map +1 -1
  59. package/dist/cli/convoy/isolation.test.js +66 -42
  60. package/dist/cli/convoy/isolation.test.js.map +1 -1
  61. package/dist/cli/convoy/lock.d.ts.map +1 -1
  62. package/dist/cli/convoy/lock.js +25 -10
  63. package/dist/cli/convoy/lock.js.map +1 -1
  64. package/dist/cli/convoy/lock.test.js +12 -0
  65. package/dist/cli/convoy/lock.test.js.map +1 -1
  66. package/dist/cli/convoy/merge.d.ts +21 -4
  67. package/dist/cli/convoy/merge.d.ts.map +1 -1
  68. package/dist/cli/convoy/merge.js +69 -53
  69. package/dist/cli/convoy/merge.js.map +1 -1
  70. package/dist/cli/convoy/merge.test.js +23 -1
  71. package/dist/cli/convoy/merge.test.js.map +1 -1
  72. package/dist/cli/convoy/progress.d.ts +35 -0
  73. package/dist/cli/convoy/progress.d.ts.map +1 -0
  74. package/dist/cli/convoy/progress.js +103 -0
  75. package/dist/cli/convoy/progress.js.map +1 -0
  76. package/dist/cli/convoy/progress.test.d.ts +2 -0
  77. package/dist/cli/convoy/progress.test.d.ts.map +1 -0
  78. package/dist/cli/convoy/progress.test.js +53 -0
  79. package/dist/cli/convoy/progress.test.js.map +1 -0
  80. package/dist/cli/convoy/read-model.d.ts +468 -0
  81. package/dist/cli/convoy/read-model.d.ts.map +1 -0
  82. package/dist/cli/convoy/read-model.js +1132 -0
  83. package/dist/cli/convoy/read-model.js.map +1 -0
  84. package/dist/cli/convoy/read-model.test.d.ts +2 -0
  85. package/dist/cli/convoy/read-model.test.d.ts.map +1 -0
  86. package/dist/cli/convoy/read-model.test.js +609 -0
  87. package/dist/cli/convoy/read-model.test.js.map +1 -0
  88. package/dist/cli/convoy/redact.d.ts +34 -0
  89. package/dist/cli/convoy/redact.d.ts.map +1 -0
  90. package/dist/cli/convoy/redact.js +66 -0
  91. package/dist/cli/convoy/redact.js.map +1 -0
  92. package/dist/cli/convoy/redact.test.d.ts +2 -0
  93. package/dist/cli/convoy/redact.test.d.ts.map +1 -0
  94. package/dist/cli/convoy/redact.test.js +43 -0
  95. package/dist/cli/convoy/redact.test.js.map +1 -0
  96. package/dist/cli/convoy/reviewer.d.ts +65 -0
  97. package/dist/cli/convoy/reviewer.d.ts.map +1 -0
  98. package/dist/cli/convoy/reviewer.js +141 -0
  99. package/dist/cli/convoy/reviewer.js.map +1 -0
  100. package/dist/cli/convoy/reviewer.test.d.ts +2 -0
  101. package/dist/cli/convoy/reviewer.test.d.ts.map +1 -0
  102. package/dist/cli/convoy/reviewer.test.js +96 -0
  103. package/dist/cli/convoy/reviewer.test.js.map +1 -0
  104. package/dist/cli/convoy/schedule.d.ts +30 -0
  105. package/dist/cli/convoy/schedule.d.ts.map +1 -0
  106. package/dist/cli/convoy/schedule.js +111 -0
  107. package/dist/cli/convoy/schedule.js.map +1 -0
  108. package/dist/cli/convoy/schedule.test.d.ts +2 -0
  109. package/dist/cli/convoy/schedule.test.d.ts.map +1 -0
  110. package/dist/cli/convoy/schedule.test.js +45 -0
  111. package/dist/cli/convoy/schedule.test.js.map +1 -0
  112. package/dist/cli/convoy/spec-builder.d.ts +120 -30
  113. package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
  114. package/dist/cli/convoy/spec-builder.js +438 -114
  115. package/dist/cli/convoy/spec-builder.js.map +1 -1
  116. package/dist/cli/convoy/spec-builder.test.js +419 -435
  117. package/dist/cli/convoy/spec-builder.test.js.map +1 -1
  118. package/dist/cli/convoy/spec-types.d.ts +46 -92
  119. package/dist/cli/convoy/spec-types.d.ts.map +1 -1
  120. package/dist/cli/convoy/store.d.ts +6 -1
  121. package/dist/cli/convoy/store.d.ts.map +1 -1
  122. package/dist/cli/convoy/store.js +111 -15
  123. package/dist/cli/convoy/store.js.map +1 -1
  124. package/dist/cli/convoy/store.test.js +59 -13
  125. package/dist/cli/convoy/store.test.js.map +1 -1
  126. package/dist/cli/convoy/types.d.ts +76 -113
  127. package/dist/cli/convoy/types.d.ts.map +1 -1
  128. package/dist/cli/convoy/types.js +6 -13
  129. package/dist/cli/convoy/types.js.map +1 -1
  130. package/dist/cli/convoy/worktree.d.ts +88 -3
  131. package/dist/cli/convoy/worktree.d.ts.map +1 -1
  132. package/dist/cli/convoy/worktree.js +282 -56
  133. package/dist/cli/convoy/worktree.js.map +1 -1
  134. package/dist/cli/convoy/worktree.test.js +132 -1
  135. package/dist/cli/convoy/worktree.test.js.map +1 -1
  136. package/dist/cli/convoy-args.test.js +9 -27
  137. package/dist/cli/convoy-args.test.js.map +1 -1
  138. package/dist/cli/convoy-cmd.d.ts +31 -6
  139. package/dist/cli/convoy-cmd.d.ts.map +1 -1
  140. package/dist/cli/convoy-cmd.js +150 -200
  141. package/dist/cli/convoy-cmd.js.map +1 -1
  142. package/dist/cli/convoy-cmd.test.d.ts +2 -0
  143. package/dist/cli/convoy-cmd.test.d.ts.map +1 -0
  144. package/dist/cli/convoy-cmd.test.js +144 -0
  145. package/dist/cli/convoy-cmd.test.js.map +1 -0
  146. package/dist/cli/dashboard.d.ts +24 -11
  147. package/dist/cli/dashboard.d.ts.map +1 -1
  148. package/dist/cli/dashboard.js +241 -303
  149. package/dist/cli/dashboard.js.map +1 -1
  150. package/dist/cli/dashboard.test.d.ts +2 -0
  151. package/dist/cli/dashboard.test.d.ts.map +1 -0
  152. package/dist/cli/dashboard.test.js +340 -0
  153. package/dist/cli/dashboard.test.js.map +1 -0
  154. package/dist/cli/dispatcher.test.js +41 -2
  155. package/dist/cli/dispatcher.test.js.map +1 -1
  156. package/dist/cli/docs-accuracy.test.js +36 -11
  157. package/dist/cli/docs-accuracy.test.js.map +1 -1
  158. package/dist/cli/doctor.d.ts.map +1 -1
  159. package/dist/cli/doctor.js +9 -6
  160. package/dist/cli/doctor.js.map +1 -1
  161. package/dist/cli/init-own-files.test.d.ts +2 -0
  162. package/dist/cli/init-own-files.test.d.ts.map +1 -0
  163. package/dist/cli/init-own-files.test.js +133 -0
  164. package/dist/cli/init-own-files.test.js.map +1 -0
  165. package/dist/cli/init.d.ts.map +1 -1
  166. package/dist/cli/init.js +106 -7
  167. package/dist/cli/init.js.map +1 -1
  168. package/dist/cli/init.test.js +5 -4
  169. package/dist/cli/init.test.js.map +1 -1
  170. package/dist/cli/layers.d.ts.map +1 -1
  171. package/dist/cli/layers.js +13 -4
  172. package/dist/cli/layers.js.map +1 -1
  173. package/dist/cli/lesson.d.ts.map +1 -1
  174. package/dist/cli/lesson.js +6 -5
  175. package/dist/cli/lesson.js.map +1 -1
  176. package/dist/cli/log.d.ts +39 -0
  177. package/dist/cli/log.d.ts.map +1 -1
  178. package/dist/cli/log.js +267 -93
  179. package/dist/cli/log.js.map +1 -1
  180. package/dist/cli/log.test.d.ts +2 -0
  181. package/dist/cli/log.test.d.ts.map +1 -0
  182. package/dist/cli/log.test.js +208 -0
  183. package/dist/cli/log.test.js.map +1 -0
  184. package/dist/cli/nearest.d.ts +18 -0
  185. package/dist/cli/nearest.d.ts.map +1 -0
  186. package/dist/cli/nearest.js +38 -0
  187. package/dist/cli/nearest.js.map +1 -0
  188. package/dist/cli/nearest.test.d.ts +2 -0
  189. package/dist/cli/nearest.test.d.ts.map +1 -0
  190. package/dist/cli/nearest.test.js +24 -0
  191. package/dist/cli/nearest.test.js.map +1 -0
  192. package/dist/cli/pipeline.d.ts +61 -0
  193. package/dist/cli/pipeline.d.ts.map +1 -1
  194. package/dist/cli/pipeline.flow.test.d.ts +2 -0
  195. package/dist/cli/pipeline.flow.test.d.ts.map +1 -0
  196. package/dist/cli/pipeline.flow.test.js +524 -0
  197. package/dist/cli/pipeline.flow.test.js.map +1 -0
  198. package/dist/cli/pipeline.js +471 -690
  199. package/dist/cli/pipeline.js.map +1 -1
  200. package/dist/cli/plan.d.ts +82 -31
  201. package/dist/cli/plan.d.ts.map +1 -1
  202. package/dist/cli/plan.js +167 -507
  203. package/dist/cli/plan.js.map +1 -1
  204. package/dist/cli/plan.test.d.ts +2 -0
  205. package/dist/cli/plan.test.d.ts.map +1 -0
  206. package/dist/cli/plan.test.js +158 -0
  207. package/dist/cli/plan.test.js.map +1 -0
  208. package/dist/cli/prompt.d.ts.map +1 -1
  209. package/dist/cli/prompt.js +9 -7
  210. package/dist/cli/prompt.js.map +1 -1
  211. package/dist/cli/prompt.test.js +20 -2
  212. package/dist/cli/prompt.test.js.map +1 -1
  213. package/dist/cli/remove.d.ts.map +1 -1
  214. package/dist/cli/remove.js +3 -1
  215. package/dist/cli/remove.js.map +1 -1
  216. package/dist/cli/review.d.ts.map +1 -1
  217. package/dist/cli/review.js +7 -1
  218. package/dist/cli/review.js.map +1 -1
  219. package/dist/cli/run/adapters/agent-process.d.ts +82 -0
  220. package/dist/cli/run/adapters/agent-process.d.ts.map +1 -0
  221. package/dist/cli/run/adapters/agent-process.js +224 -0
  222. package/dist/cli/run/adapters/agent-process.js.map +1 -0
  223. package/dist/cli/run/adapters/agent-process.test.d.ts +2 -0
  224. package/dist/cli/run/adapters/agent-process.test.d.ts.map +1 -0
  225. package/dist/cli/run/adapters/agent-process.test.js +159 -0
  226. package/dist/cli/run/adapters/agent-process.test.js.map +1 -0
  227. package/dist/cli/run/adapters/claude.d.ts +53 -2
  228. package/dist/cli/run/adapters/claude.d.ts.map +1 -1
  229. package/dist/cli/run/adapters/claude.js +147 -171
  230. package/dist/cli/run/adapters/claude.js.map +1 -1
  231. package/dist/cli/run/adapters/claude.test.js +197 -254
  232. package/dist/cli/run/adapters/claude.test.js.map +1 -1
  233. package/dist/cli/run/adapters/codex.d.ts +25 -2
  234. package/dist/cli/run/adapters/codex.d.ts.map +1 -1
  235. package/dist/cli/run/adapters/codex.js +113 -81
  236. package/dist/cli/run/adapters/codex.js.map +1 -1
  237. package/dist/cli/run/adapters/codex.test.js +116 -95
  238. package/dist/cli/run/adapters/codex.test.js.map +1 -1
  239. package/dist/cli/run/adapters/copilot.d.ts +35 -1
  240. package/dist/cli/run/adapters/copilot.d.ts.map +1 -1
  241. package/dist/cli/run/adapters/copilot.js +104 -287
  242. package/dist/cli/run/adapters/copilot.js.map +1 -1
  243. package/dist/cli/run/adapters/copilot.test.js +122 -282
  244. package/dist/cli/run/adapters/copilot.test.js.map +1 -1
  245. package/dist/cli/run/adapters/cursor.d.ts +25 -7
  246. package/dist/cli/run/adapters/cursor.d.ts.map +1 -1
  247. package/dist/cli/run/adapters/cursor.js +103 -156
  248. package/dist/cli/run/adapters/cursor.js.map +1 -1
  249. package/dist/cli/run/adapters/cursor.test.js +106 -218
  250. package/dist/cli/run/adapters/cursor.test.js.map +1 -1
  251. package/dist/cli/run/adapters/index.d.ts +34 -5
  252. package/dist/cli/run/adapters/index.d.ts.map +1 -1
  253. package/dist/cli/run/adapters/index.js +147 -21
  254. package/dist/cli/run/adapters/index.js.map +1 -1
  255. package/dist/cli/run/adapters/index.test.d.ts +2 -0
  256. package/dist/cli/run/adapters/index.test.d.ts.map +1 -0
  257. package/dist/cli/run/adapters/index.test.js +129 -0
  258. package/dist/cli/run/adapters/index.test.js.map +1 -0
  259. package/dist/cli/run/adapters/opencode.d.ts +25 -9
  260. package/dist/cli/run/adapters/opencode.d.ts.map +1 -1
  261. package/dist/cli/run/adapters/opencode.js +136 -152
  262. package/dist/cli/run/adapters/opencode.js.map +1 -1
  263. package/dist/cli/run/adapters/opencode.test.js +99 -218
  264. package/dist/cli/run/adapters/opencode.test.js.map +1 -1
  265. package/dist/cli/run/adapters/permission-modes.d.ts +47 -4
  266. package/dist/cli/run/adapters/permission-modes.d.ts.map +1 -1
  267. package/dist/cli/run/adapters/permission-modes.js +113 -37
  268. package/dist/cli/run/adapters/permission-modes.js.map +1 -1
  269. package/dist/cli/run/adapters/permission-modes.test.js +55 -40
  270. package/dist/cli/run/adapters/permission-modes.test.js.map +1 -1
  271. package/dist/cli/run/adapters/stub-cli.test-helper.d.ts +22 -0
  272. package/dist/cli/run/adapters/stub-cli.test-helper.d.ts.map +1 -0
  273. package/dist/cli/run/adapters/stub-cli.test-helper.js +73 -0
  274. package/dist/cli/run/adapters/stub-cli.test-helper.js.map +1 -0
  275. package/dist/cli/run/platform.d.ts +52 -0
  276. package/dist/cli/run/platform.d.ts.map +1 -0
  277. package/dist/cli/run/platform.js +207 -0
  278. package/dist/cli/run/platform.js.map +1 -0
  279. package/dist/cli/run/platform.test.d.ts +2 -0
  280. package/dist/cli/run/platform.test.d.ts.map +1 -0
  281. package/dist/cli/run/platform.test.js +119 -0
  282. package/dist/cli/run/platform.test.js.map +1 -0
  283. package/dist/cli/run/schema.d.ts +6 -8
  284. package/dist/cli/run/schema.d.ts.map +1 -1
  285. package/dist/cli/run/schema.js +44 -68
  286. package/dist/cli/run/schema.js.map +1 -1
  287. package/dist/cli/run/schema.test.js +59 -279
  288. package/dist/cli/run/schema.test.js.map +1 -1
  289. package/dist/cli/run.d.ts +34 -56
  290. package/dist/cli/run.d.ts.map +1 -1
  291. package/dist/cli/run.js +379 -1132
  292. package/dist/cli/run.js.map +1 -1
  293. package/dist/cli/run.test.d.ts +2 -0
  294. package/dist/cli/run.test.d.ts.map +1 -0
  295. package/dist/cli/run.test.js +318 -0
  296. package/dist/cli/run.test.js.map +1 -0
  297. package/dist/cli/sync-check.d.ts.map +1 -1
  298. package/dist/cli/sync-check.js +12 -3
  299. package/dist/cli/sync-check.js.map +1 -1
  300. package/dist/cli/sync.d.ts.map +1 -1
  301. package/dist/cli/sync.js +3 -2
  302. package/dist/cli/sync.js.map +1 -1
  303. package/dist/cli/team-config.d.ts.map +1 -1
  304. package/dist/cli/team-config.js +2 -21
  305. package/dist/cli/team-config.js.map +1 -1
  306. package/dist/cli/tiers.test.js +4 -13
  307. package/dist/cli/tiers.test.js.map +1 -1
  308. package/dist/cli/update.d.ts.map +1 -1
  309. package/dist/cli/update.js +4 -3
  310. package/dist/cli/update.js.map +1 -1
  311. package/dist/cli/website-plugins.test.js +51 -2
  312. package/dist/cli/website-plugins.test.js.map +1 -1
  313. package/dist/orchestrator/plugins/coolify/config.d.ts.map +1 -1
  314. package/dist/orchestrator/plugins/coolify/config.js +13 -0
  315. package/dist/orchestrator/plugins/coolify/config.js.map +1 -1
  316. package/dist/orchestrator/plugins/sentry/config.d.ts.map +1 -1
  317. package/dist/orchestrator/plugins/sentry/config.js +13 -0
  318. package/dist/orchestrator/plugins/sentry/config.js.map +1 -1
  319. package/package.json +3 -10
  320. package/src/cli/adapters/claude-code.ts +7 -3
  321. package/src/cli/adapters/single-file-base.ts +47 -4
  322. package/src/cli/agent-plugin.test.ts +14 -0
  323. package/src/cli/agent-roster.test.ts +0 -55
  324. package/src/cli/bootstrap.ts +23 -0
  325. package/src/cli/boundary.test.ts +9 -7
  326. package/src/cli/ci.ts +6 -4
  327. package/src/cli/command-namespace.test.ts +35 -0
  328. package/src/cli/convoy/TELEMETRY.md +138 -130
  329. package/src/cli/convoy/artifacts.test.ts +4 -2
  330. package/src/cli/convoy/artifacts.ts +13 -12
  331. package/src/cli/convoy/engine.git.test.ts +462 -0
  332. package/src/cli/convoy/engine.test.ts +817 -850
  333. package/src/cli/convoy/engine.ts +1864 -2596
  334. package/src/cli/convoy/event-schemas.ts +63 -59
  335. package/src/cli/convoy/events.test.ts +58 -9
  336. package/src/cli/convoy/events.ts +69 -91
  337. package/src/cli/convoy/gates.ts +31 -12
  338. package/src/cli/convoy/isolation.test.ts +76 -43
  339. package/src/cli/convoy/isolation.ts +100 -38
  340. package/src/cli/convoy/lock.test.ts +16 -0
  341. package/src/cli/convoy/lock.ts +25 -8
  342. package/src/cli/convoy/merge.test.ts +25 -1
  343. package/src/cli/convoy/merge.ts +74 -61
  344. package/src/cli/convoy/progress.test.ts +59 -0
  345. package/src/cli/convoy/progress.ts +121 -0
  346. package/src/cli/convoy/read-model.test.ts +685 -0
  347. package/src/cli/convoy/read-model.ts +1469 -0
  348. package/src/cli/convoy/redact.test.ts +49 -0
  349. package/src/cli/convoy/redact.ts +73 -0
  350. package/src/cli/convoy/reviewer.test.ts +112 -0
  351. package/src/cli/convoy/reviewer.ts +196 -0
  352. package/src/cli/convoy/schedule.test.ts +56 -0
  353. package/src/cli/convoy/schedule.ts +109 -0
  354. package/src/cli/convoy/spec-builder.test.ts +460 -464
  355. package/src/cli/convoy/spec-builder.ts +460 -129
  356. package/src/cli/convoy/spec-types.ts +46 -108
  357. package/src/cli/convoy/store.test.ts +64 -13
  358. package/src/cli/convoy/store.ts +143 -33
  359. package/src/cli/convoy/types.ts +59 -71
  360. package/src/cli/convoy/worktree.test.ts +140 -1
  361. package/src/cli/convoy/worktree.ts +311 -61
  362. package/src/cli/convoy-args.test.ts +10 -30
  363. package/src/cli/convoy-cmd.test.ts +163 -0
  364. package/src/cli/convoy-cmd.ts +173 -215
  365. package/src/cli/dashboard/dashboard.css +2086 -0
  366. package/src/cli/dashboard/dashboard.js +1687 -0
  367. package/src/cli/dashboard/index.html +307 -0
  368. package/src/cli/dashboard.test.ts +382 -0
  369. package/src/cli/dashboard.ts +243 -339
  370. package/src/cli/dispatcher.test.ts +43 -2
  371. package/src/cli/docs-accuracy.test.ts +37 -10
  372. package/src/cli/doctor.ts +9 -6
  373. package/src/cli/init-own-files.test.ts +156 -0
  374. package/src/cli/init.test.ts +5 -4
  375. package/src/cli/init.ts +104 -7
  376. package/src/cli/layers.ts +13 -4
  377. package/src/cli/lesson.ts +6 -5
  378. package/src/cli/log.test.ts +228 -0
  379. package/src/cli/log.ts +302 -83
  380. package/src/cli/nearest.test.ts +27 -0
  381. package/src/cli/nearest.ts +38 -0
  382. package/src/cli/pipeline.flow.test.ts +607 -0
  383. package/src/cli/pipeline.ts +544 -759
  384. package/src/cli/plan.test.ts +193 -0
  385. package/src/cli/plan.ts +209 -545
  386. package/src/cli/prompt.test.ts +21 -2
  387. package/src/cli/prompt.ts +11 -7
  388. package/src/cli/remove.ts +3 -0
  389. package/src/cli/review.ts +7 -1
  390. package/src/cli/run/adapters/agent-process.test.ts +175 -0
  391. package/src/cli/run/adapters/agent-process.ts +252 -0
  392. package/src/cli/run/adapters/claude.test.ts +205 -260
  393. package/src/cli/run/adapters/claude.ts +151 -162
  394. package/src/cli/run/adapters/codex.test.ts +120 -100
  395. package/src/cli/run/adapters/codex.ts +115 -91
  396. package/src/cli/run/adapters/copilot.test.ts +135 -306
  397. package/src/cli/run/adapters/copilot.ts +105 -274
  398. package/src/cli/run/adapters/cursor.test.ts +111 -220
  399. package/src/cli/run/adapters/cursor.ts +105 -156
  400. package/src/cli/run/adapters/index.test.ts +148 -0
  401. package/src/cli/run/adapters/index.ts +168 -20
  402. package/src/cli/run/adapters/opencode.test.ts +106 -227
  403. package/src/cli/run/adapters/opencode.ts +139 -151
  404. package/src/cli/run/adapters/permission-modes.test.ts +63 -41
  405. package/src/cli/run/adapters/permission-modes.ts +118 -37
  406. package/src/cli/run/adapters/stub-cli.test-helper.ts +88 -0
  407. package/src/cli/run/platform.test.ts +128 -0
  408. package/src/cli/run/platform.ts +213 -0
  409. package/src/cli/run/schema.test.ts +62 -344
  410. package/src/cli/run/schema.ts +48 -78
  411. package/src/cli/run.test.ts +351 -0
  412. package/src/cli/run.ts +366 -1151
  413. package/src/cli/sync-check.ts +12 -3
  414. package/src/cli/sync.ts +3 -2
  415. package/src/cli/team-config.ts +2 -21
  416. package/src/cli/tiers.test.ts +4 -17
  417. package/src/cli/update.ts +4 -3
  418. package/src/cli/website-plugins.test.ts +55 -5
  419. package/src/orchestrator/agents/team-lead.agent.md +2 -2
  420. package/src/orchestrator/customizations/README.md +58 -13
  421. package/src/orchestrator/customizations/logs/README.md +23 -18
  422. package/src/orchestrator/instructions/general.instructions.md +1 -1
  423. package/src/orchestrator/plugins/coolify/config.ts +13 -0
  424. package/src/orchestrator/plugins/sentry/config.ts +13 -0
  425. package/src/orchestrator/prompts/assess-complexity.prompt.md +43 -26
  426. package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +44 -49
  427. package/src/orchestrator/prompts/brainstorm.prompt.md +2 -2
  428. package/src/orchestrator/prompts/bug-fix.prompt.md +5 -4
  429. package/src/orchestrator/prompts/create-skill.prompt.md +29 -39
  430. package/src/orchestrator/prompts/fix-convoy.prompt.md +43 -29
  431. package/src/orchestrator/prompts/fix-prd.prompt.md +26 -22
  432. package/src/orchestrator/prompts/generate-convoy.prompt.md +139 -147
  433. package/src/orchestrator/prompts/generate-prd.prompt.md +75 -68
  434. package/src/orchestrator/prompts/implement-feature.prompt.md +7 -6
  435. package/src/orchestrator/prompts/validate-convoy.prompt.md +29 -28
  436. package/src/orchestrator/prompts/validate-prd.prompt.md +28 -21
  437. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +3 -3
  438. package/src/orchestrator/skills/agent-hooks/SKILL.md +1 -1
  439. package/src/orchestrator/skills/fast-review/SKILL.md +3 -1
  440. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +7 -8
  441. package/dist/cli/convoy/dag-analysis.d.ts +0 -39
  442. package/dist/cli/convoy/dag-analysis.d.ts.map +0 -1
  443. package/dist/cli/convoy/dag-analysis.js +0 -279
  444. package/dist/cli/convoy/dag-analysis.js.map +0 -1
  445. package/dist/cli/convoy/dag-analysis.test.d.ts +0 -2
  446. package/dist/cli/convoy/dag-analysis.test.d.ts.map +0 -1
  447. package/dist/cli/convoy/dag-analysis.test.js +0 -289
  448. package/dist/cli/convoy/dag-analysis.test.js.map +0 -1
  449. package/dist/cli/convoy/formula.d.ts +0 -19
  450. package/dist/cli/convoy/formula.d.ts.map +0 -1
  451. package/dist/cli/convoy/formula.js +0 -142
  452. package/dist/cli/convoy/formula.js.map +0 -1
  453. package/dist/cli/convoy/formula.test.d.ts +0 -2
  454. package/dist/cli/convoy/formula.test.d.ts.map +0 -1
  455. package/dist/cli/convoy/formula.test.js +0 -342
  456. package/dist/cli/convoy/formula.test.js.map +0 -1
  457. package/dist/cli/convoy/health.d.ts +0 -34
  458. package/dist/cli/convoy/health.d.ts.map +0 -1
  459. package/dist/cli/convoy/health.js +0 -123
  460. package/dist/cli/convoy/health.js.map +0 -1
  461. package/dist/cli/convoy/health.test.d.ts +0 -2
  462. package/dist/cli/convoy/health.test.d.ts.map +0 -1
  463. package/dist/cli/convoy/health.test.js +0 -448
  464. package/dist/cli/convoy/health.test.js.map +0 -1
  465. package/dist/cli/convoy/last-run.d.ts +0 -53
  466. package/dist/cli/convoy/last-run.d.ts.map +0 -1
  467. package/dist/cli/convoy/last-run.js +0 -54
  468. package/dist/cli/convoy/last-run.js.map +0 -1
  469. package/dist/cli/convoy/last-run.test.d.ts +0 -2
  470. package/dist/cli/convoy/last-run.test.d.ts.map +0 -1
  471. package/dist/cli/convoy/last-run.test.js +0 -110
  472. package/dist/cli/convoy/last-run.test.js.map +0 -1
  473. package/dist/cli/convoy/pipeline.d.ts +0 -41
  474. package/dist/cli/convoy/pipeline.d.ts.map +0 -1
  475. package/dist/cli/convoy/pipeline.js +0 -414
  476. package/dist/cli/convoy/pipeline.js.map +0 -1
  477. package/dist/cli/convoy/pipeline.test.d.ts +0 -2
  478. package/dist/cli/convoy/pipeline.test.d.ts.map +0 -1
  479. package/dist/cli/convoy/pipeline.test.js +0 -837
  480. package/dist/cli/convoy/pipeline.test.js.map +0 -1
  481. package/dist/cli/convoy/review-stages.d.ts +0 -9
  482. package/dist/cli/convoy/review-stages.d.ts.map +0 -1
  483. package/dist/cli/convoy/review-stages.js +0 -134
  484. package/dist/cli/convoy/review-stages.js.map +0 -1
  485. package/dist/cli/convoy/review-stages.test.d.ts +0 -2
  486. package/dist/cli/convoy/review-stages.test.d.ts.map +0 -1
  487. package/dist/cli/convoy/review-stages.test.js +0 -197
  488. package/dist/cli/convoy/review-stages.test.js.map +0 -1
  489. package/dist/cli/run/executor.d.ts +0 -15
  490. package/dist/cli/run/executor.d.ts.map +0 -1
  491. package/dist/cli/run/executor.js +0 -249
  492. package/dist/cli/run/executor.js.map +0 -1
  493. package/dist/cli/run/executor.test.d.ts +0 -2
  494. package/dist/cli/run/executor.test.d.ts.map +0 -1
  495. package/dist/cli/run/executor.test.js +0 -297
  496. package/dist/cli/run/executor.test.js.map +0 -1
  497. package/dist/cli/run/reporter.d.ts +0 -10
  498. package/dist/cli/run/reporter.d.ts.map +0 -1
  499. package/dist/cli/run/reporter.js +0 -142
  500. package/dist/cli/run/reporter.js.map +0 -1
  501. package/dist/cli/run-dry-run.test.d.ts +0 -2
  502. package/dist/cli/run-dry-run.test.d.ts.map +0 -1
  503. package/dist/cli/run-dry-run.test.js +0 -83
  504. package/dist/cli/run-dry-run.test.js.map +0 -1
  505. package/dist/cli/run-executor-flags.test.d.ts +0 -2
  506. package/dist/cli/run-executor-flags.test.d.ts.map +0 -1
  507. package/dist/cli/run-executor-flags.test.js +0 -31
  508. package/dist/cli/run-executor-flags.test.js.map +0 -1
  509. package/dist/cli/run-finish.test.d.ts +0 -2
  510. package/dist/cli/run-finish.test.d.ts.map +0 -1
  511. package/dist/cli/run-finish.test.js +0 -77
  512. package/dist/cli/run-finish.test.js.map +0 -1
  513. package/dist/cli/watch.d.ts +0 -15
  514. package/dist/cli/watch.d.ts.map +0 -1
  515. package/dist/cli/watch.js +0 -277
  516. package/dist/cli/watch.js.map +0 -1
  517. package/dist/dashboard/scripts/etl.d.ts +0 -10
  518. package/dist/dashboard/scripts/etl.d.ts.map +0 -1
  519. package/dist/dashboard/scripts/etl.js +0 -141
  520. package/dist/dashboard/scripts/etl.js.map +0 -1
  521. package/src/cli/convoy/dag-analysis.test.ts +0 -349
  522. package/src/cli/convoy/dag-analysis.ts +0 -367
  523. package/src/cli/convoy/formula.test.ts +0 -404
  524. package/src/cli/convoy/formula.ts +0 -174
  525. package/src/cli/convoy/health.test.ts +0 -519
  526. package/src/cli/convoy/health.ts +0 -189
  527. package/src/cli/convoy/last-run.test.ts +0 -130
  528. package/src/cli/convoy/last-run.ts +0 -87
  529. package/src/cli/convoy/pipeline.test.ts +0 -999
  530. package/src/cli/convoy/pipeline.ts +0 -492
  531. package/src/cli/convoy/review-stages.test.ts +0 -235
  532. package/src/cli/convoy/review-stages.ts +0 -166
  533. package/src/cli/run/executor.test.ts +0 -338
  534. package/src/cli/run/executor.ts +0 -292
  535. package/src/cli/run/reporter.ts +0 -160
  536. package/src/cli/run-dry-run.test.ts +0 -97
  537. package/src/cli/run-executor-flags.test.ts +0 -38
  538. package/src/cli/run-finish.test.ts +0 -91
  539. package/src/cli/watch.ts +0 -295
  540. package/src/dashboard/astro.config.mjs +0 -6
  541. package/src/dashboard/dist/_astro/index.CADNhRPS.css +0 -1
  542. package/src/dashboard/dist/data/.gitkeep +0 -0
  543. package/src/dashboard/dist/data/convoy-list.json +0 -1
  544. package/src/dashboard/dist/data/overall-stats.json +0 -29
  545. package/src/dashboard/dist/index.html +0 -1963
  546. package/src/dashboard/node_modules/.vite/deps/_metadata.json +0 -31
  547. package/src/dashboard/node_modules/.vite/deps/astro___aria-query.js +0 -6776
  548. package/src/dashboard/node_modules/.vite/deps/astro___aria-query.js.map +0 -7
  549. package/src/dashboard/node_modules/.vite/deps/astro___axobject-query.js +0 -3754
  550. package/src/dashboard/node_modules/.vite/deps/astro___axobject-query.js.map +0 -7
  551. package/src/dashboard/node_modules/.vite/deps/astro___cssesc.js +0 -99
  552. package/src/dashboard/node_modules/.vite/deps/astro___cssesc.js.map +0 -7
  553. package/src/dashboard/node_modules/.vite/deps/chunk-BUSYA2B4.js +0 -8
  554. package/src/dashboard/node_modules/.vite/deps/chunk-BUSYA2B4.js.map +0 -7
  555. package/src/dashboard/node_modules/.vite/deps/package.json +0 -3
  556. package/src/dashboard/package-lock.json +0 -6
  557. package/src/dashboard/public/data/.gitkeep +0 -0
  558. package/src/dashboard/public/data/convoy-list.json +0 -1
  559. package/src/dashboard/public/data/overall-stats.json +0 -29
  560. package/src/dashboard/public/icon-192.png +0 -0
  561. package/src/dashboard/scripts/etl.test.ts +0 -166
  562. package/src/dashboard/scripts/etl.ts +0 -170
  563. package/src/dashboard/scripts/generate-demo-db.test.ts +0 -30
  564. package/src/dashboard/scripts/generate-demo-db.ts +0 -529
  565. package/src/dashboard/scripts/integration-test.ts +0 -504
  566. package/src/dashboard/scripts/verify-demo-data.sh +0 -51
  567. package/src/dashboard/seed-data/delegations.ndjson +0 -35
  568. package/src/dashboard/seed-data/events.ndjson +0 -104
  569. package/src/dashboard/seed-data/panels.ndjson +0 -13
  570. package/src/dashboard/seed-data/reviews.ndjson +0 -6
  571. package/src/dashboard/seed-data/sessions.ndjson +0 -50
  572. package/src/dashboard/src/env.d.ts +0 -1
  573. package/src/dashboard/src/layouts/Layout.astro +0 -25
  574. package/src/dashboard/src/pages/index.astro +0 -2313
  575. package/src/dashboard/src/styles/dashboard.css +0 -2943
  576. package/src/dashboard/tsconfig.json +0 -6
  577. /package/src/{dashboard/dist → cli/dashboard}/icon-192.png +0 -0
package/README.md CHANGED
@@ -46,8 +46,7 @@ which framework and database you use, which test runner. Then it shows you what
46
46
  it found and asks once.
47
47
 
48
48
  ```
49
- 🏰 OpenCastle
50
-
49
+ …
51
50
  Found assistant config:
52
51
  • Claude Code (CLAUDE.md)
53
52
 
@@ -58,12 +57,22 @@ it found and asks once.
58
57
  nextjs, supabase, vitest, chrome-devtools
59
58
 
60
59
  Set this up? [Y/n]
60
+ …
61
+ ✓ Created 114 files
62
+ ✓ Created .gitignore with OpenCastle entries
63
+ ✓ Merged into your existing CLAUDE.md
64
+ your content is above the managed block and is never overwritten
65
+ …
61
66
  ```
62
67
 
63
- No questionnaire. Your existing files are never overwritten — OpenCastle tells
64
- you which ones it left alone.
68
+ What you wrote in `CLAUDE.md`, `.cursorrules`, `AGENTS.md` and the other root
69
+ files stays above a managed block. A file of yours inside a directory OpenCastle
70
+ generates (`.cursor/rules/`, `.claude/agents/`, …) is named by `init` and
71
+ removed by the next `sync`; move it into `.opencastle/` and it compiles for
72
+ every assistant.
65
73
 
66
- Full walkthrough: **[docs/quickstart.md](docs/quickstart.md)** — five minutes.
74
+ Node.js 22.5 or newer. Full walkthrough, including CI and upgrading:
75
+ **[docs/quickstart.md](docs/quickstart.md)**.
67
76
 
68
77
  <br>
69
78
 
@@ -81,43 +90,24 @@ Running `opencastle` with no arguments is the one command worth remembering. It
81
90
  answers the question you actually have:
82
91
 
83
92
  ```
84
- 🏰 OpenCastle
93
+ 🏰 OpenCastle v1.0.0
85
94
 
86
- ! 2/3 targets in sync (sources are newer)
95
+ ! 2/3 targets installed — generated files no longer match their sources
87
96
  ✓ claude-code up to date
88
97
  ✓ cursor up to date
89
98
  ! vscode 4 paths missing
90
99
 
91
100
  Next: opencastle sync
92
- generated files are older than the framework sources
93
- ```
94
-
95
-
96
- ### Keep it in sync in CI
97
-
98
- `sync --check` compiles to a scratch directory and compares. It writes nothing and
99
- exits non-zero when a generated file no longer matches its source — someone edited
100
- `.cursor/rules/foo.mdc` by hand, added a file under a generated directory, or
101
- upgraded without recompiling.
102
-
103
- ```yaml
104
- # .github/workflows/opencastle.yml
105
- - uses: actions/setup-node@v4
106
- with: { node-version: 22 }
107
- - run: npx opencastle sync --check
101
+ 1 target missing generated files
108
102
  ```
109
103
 
110
- `opencastle ci` writes the whole workflow for you: it installs dependencies so
111
- baselines resolve, runs the project's own OpenCastle version, and adds `review`
112
- on pull requests.
104
+ Commit the generated config, like a lockfile, and let CI check it:
105
+ `npm i -D opencastle && npx opencastle ci` writes a GitHub Actions workflow that
106
+ runs `sync --check` on every pull request
107
+ ([quickstart, step 4](docs/quickstart.md#4-keep-it-honest-in-ci)). Every command
108
+ and flag: [opencastle.dev/docs/cli](https://www.opencastle.dev/docs/cli/).
113
109
 
114
- Commit the generated config, like a lockfile. That is what gives the check
115
- something to compare and what lets a teammate clone the repo and have working
116
- rules without running anything. Only `.env` and run artefacts are gitignored.
117
-
118
- Upgrading from 0.35 or earlier? Run `opencastle sync` once — it rewrites the
119
- `.gitignore` block, repairs the manifest, and adopts root files an older release
120
- generated, keeping a `.opencastle-backup` of each. See
110
+ Upgrading from 0.35 or earlier? Run `opencastle sync` once — see
121
111
  [the quickstart](docs/quickstart.md#upgrading-from-035-or-earlier).
122
112
 
123
113
  <br>
@@ -134,7 +124,7 @@ can share it across every repository it owns.
134
124
  "extends": ["@acme/opencastle-baseline"], // a devDependency; your lockfile pins it
135
125
  "exclude": ["skills/seo-patterns"],
136
126
  "mcpServers": {
137
- "acme-db": {
127
+ "acme-db": { // must be on the baseline's policy.mcp.allow
138
128
  "command": "npx",
139
129
  "args": ["-y", "@acme/db-mcp@2.2.0"],
140
130
  "env": { "ACME_DB_URL": "${ACME_DB_URL}" } // each assistant gets its own spelling
@@ -143,112 +133,93 @@ can share it across every repository it owns.
143
133
  }
144
134
  ```
145
135
 
146
- - **One standard, many repositories.** A baseline is an ordinary npm package
147
- carrying the organisation's instructions, skills, agents, MCP servers and
148
- policy — and, as `baseline init` lays it out, an Agent Plugin. Each repository installs it as a devDependency and names it in
149
- `extends`; the lockfile pins the version, and an upgrade bot opens one pull
150
- request per repository when it moves. What a repository adds under
151
- `.opencastle/` — `instructions/`, `skills/<name>/SKILL.md`, `agents/` —
152
- compiles into all seven assistants the same way.
153
- - **Policy only tightens.** A baseline can say which MCP servers may run, which
154
- hosts remote ones may reach, that every server is pinned to an exact version,
155
- which items no repository may drop, and how much context may load before a
156
- task. A repository can tighten it, never relax it, and can opt out of a
157
- baseline's server. A server that breaks its own layer's policy, or a
158
- credential written inline, is a compile error, and `doctor` and
159
- `sync --check` hold servers someone added to an MCP config by hand to the same
160
- policy.
161
- - **Team memory that merges and keeps current.** Agents record lessons with
162
- `opencastle lesson`, one file each in `.opencastle/lessons/`, citing the code
163
- a lesson is about; `doctor` names a lesson whose code has changed since.
164
- `opencastle promote` makes what one person's assistant learned the team's: a
165
- personal skill into the team's sources or a baseline, and Claude Code's auto
166
- memory for the repository into lessons — in the working tree, for the pull
167
- request to review.
168
- - **A lock you can review.** `sync` writes `.opencastle/lock.json`: which layers
169
- at which versions, where every skill and instruction came from, which MCP
170
- servers every assistant can start, and how many tokens load up front.
171
- `opencastle review` puts the change to it into sentences on the pull request,
172
- and marks with ⚠️ what deserves a careful look — a new MCP server, a widened
173
- allowlist, a new always-loaded instruction.
174
- - **Drift shows up on the pull request.** On GitHub Actions, `sync --check`
175
- annotates each drifted file with that file's own fix and writes a table to the
176
- run's summary page. Nothing to configure: it reads `GITHUB_ACTIONS`.
177
- - **MCP servers are pinned like dependencies.** Every server OpenCastle adds is
178
- the vendor's own remote server, the project's own copy of a tool it already
179
- uses (`npx --no`), or a package at an exact version — never `@latest`. Every
180
- laptop and every CI run starts the same server version. (A pin fixes the
181
- server's own version, not the versions of its dependencies, which npx resolves
182
- per machine.) Upgrading OpenCastle moves them forward in one reviewable diff,
183
- and an entry you edited is left alone.
184
- - **`doctor` audits what your agents launch**, including servers you added
185
- yourself: a package with no exact version, one that no longer exists on npm,
186
- a remote server your assistant cannot load, a credential written into the
187
- file, or a server the policy does not allow. It also checks the team's own
188
- sources: that they resolve, how much context every assistant loads against
189
- the budget, and whether instructions still name scripts and paths that exist.
190
- Each finding names the fix that works for it.
191
- - **Built on the open standards.** Codex and OpenCode read `AGENTS.md`; every
192
- skill is a `SKILL.md` folder named as the skill, in the Agent Skills format,
193
- wherever each assistant reads skills; every assistant gets its MCP servers in
194
- its own config. And [Agent Plugins 1.0](https://agent-plugins.org) packages
195
- them: a baseline is one, so Copilot, VS Code, Cursor, Codex and Kiro can
196
- install it as it is, while OpenCastle compiles it — and what the standard
197
- does not cover yet — into all seven assistants. Any Agent Plugin on npm can be
198
- extended the same way. `opencastle plugin` checks one against the spec,
199
- writes the manifest Claude Code reads instead, and writes the marketplace file
200
- for Claude Code, Copilot, Cursor and Codex. Each of the integrations ships as
201
- an Agent Plugin too.
136
+ `extends` takes npm packages, found in `node_modules`, or relative paths, which
137
+ resolve from `.opencastle/` — a `baseline/` directory at the project root is
138
+ `"../baseline"`.
139
+
140
+ - **One standard, many repositories.** A baseline is an npm package with the
141
+ organisation's instructions, skills, agents, MCP servers and policy. As
142
+ `baseline init` lays it out, it is also an [Agent Plugin](https://agent-plugins.org),
143
+ so Copilot, VS Code, Cursor, Codex and Kiro can install it as it is. What a
144
+ repository adds under `.opencastle/` compiles into all seven assistants.
145
+ - **Policy only tightens.** A baseline says which MCP servers may run, which
146
+ hosts remote ones may reach, that every server is pinned, which items no
147
+ repository may drop, and how much context may load before a task. A
148
+ repository can tighten it, never relax it.
149
+ - **A lock you can review.** `sync` writes `.opencastle/lock.json`.
150
+ `opencastle review` turns a change to it into sentences on the pull request
151
+ and marks with ⚠️ what deserves a careful look, such as a new MCP server.
152
+ - **MCP servers pinned and audited.** Every server OpenCastle adds is the
153
+ vendor's remote server, the project's own copy of a tool (`npx --no`), or a
154
+ package at an exact version. `doctor` and `sync --check` audit every MCP
155
+ config, including servers you added by hand: no exact version, a package
156
+ OpenCastle knows is not on npm, a credential written into the file, a server
157
+ the policy does not allow.
158
+ - **Team memory.** Agents record lessons with `opencastle lesson`, one file each
159
+ in `.opencastle/lessons/`, citing the code they are about; `doctor` names a
160
+ lesson whose code has changed. `opencastle promote` turns a personal skill or
161
+ Claude Code's auto memory into the team's, for the pull request to review.
202
162
 
203
163
  ```bash
204
164
  opencastle explain # what a new teammate's assistant gets, and what to set up
205
165
  opencastle ci --owners @acme/platform # CI check and review on every PR; owners for the lock
206
- opencastle baseline init # start the organisation's baseline package (an Agent Plugin)
207
- opencastle plugin check # check it the way every assistant loads it
166
+ opencastle baseline init acme-baseline --name @acme/opencastle-baseline # the organisation's baseline
167
+ opencastle plugin check acme-baseline # check it the way every assistant loads it
208
168
  opencastle promote memory # what your assistant learned here, as lessons for the team
209
169
  opencastle fleet ~/src/* # which repositories run which baseline version
210
170
  ```
211
171
 
212
172
  The guide — layers, every config field, policy, the lock, a rollout recipe:
213
173
  **[opencastle.dev/docs/teams](https://www.opencastle.dev/docs/teams/)**. What is
214
- still open: **[docs/teams.md](docs/teams.md)**.
174
+ still open, and why things are the way they are: **[docs/teams.md](docs/teams.md)**.
215
175
 
216
176
  <br>
217
177
 
218
178
  ## Supported assistants
219
179
 
220
- | Assistant | Compiles to |
221
- |-----------|-------------|
222
- | **Claude Code** | `CLAUDE.md` + `.claude/` — commands as `/oc:<name>` |
223
- | **GitHub Copilot** | `.github/` — agents, skills, prompts as `/oc:<name>` |
224
- | **Cursor** | `.cursorrules` + `.cursor/rules/*.mdc` + `.agents/skills/` |
225
- | **Windsurf** (Devin Desktop) | `.windsurfrules` + `.windsurf/rules/*.md` + `.agents/skills/` + `.devin/mcp_config.json` |
226
- | **OpenCode** | `AGENTS.md` + `.agents/skills/` + `.opencode/` + `opencode.json` |
227
- | **Codex CLI** | `AGENTS.md` + `.agents/skills/` + `.codex/` (MCP in `config.toml`) |
228
- | **Antigravity** | `GEMINI.md` + `.agents/` (skills in `.agents/skills/`) |
180
+ | Assistant | Instructions | Skills | MCP config |
181
+ |-----------|--------------|--------|------------|
182
+ | **Claude Code** | `CLAUDE.md`, `.claude/agents/`, commands in `.claude/commands/oc/` | `.claude/skills/` | `.mcp.json` |
183
+ | **VS Code** (GitHub Copilot) | `.github/copilot-instructions.md`, `.github/instructions/`, `.github/agents/`, prompts `.github/prompts/oc.*.prompt.md` | `.github/skills/` | `.vscode/mcp.json` |
184
+ | **Cursor** | `.cursorrules`, `.cursor/rules/*.mdc` | `.agents/skills/` | `.cursor/mcp.json` |
185
+ | **Windsurf** (Devin Desktop) | `.windsurfrules`, `.windsurf/rules/*.md` | `.agents/skills/` | `.devin/mcp_config.json` |
186
+ | **OpenCode** | `AGENTS.md`, `.opencode/` | `.agents/skills/` | `opencode.json` |
187
+ | **Codex CLI** | `AGENTS.md`, `.codex/` | `.agents/skills/` | `.codex/config.toml` (trusted projects only) |
188
+ | **Antigravity** | `GEMINI.md` (points to `AGENTS.md` when Codex or OpenCode is also selected), `.agents/` | `.agents/skills/` | `.agents/mcp_config.json` |
229
189
 
230
190
  Each target gets that assistant's native format, including its own frontmatter
231
- dialect for how a rule is scoped. MCP servers are configured per assistant too,
232
- in whichever shape it expects.
233
-
234
- Compiled commands share one namespace — `/oc:bug-fix`, `/oc:implement-feature`,
235
- and a team's own prompts as `/oc:<name>` — so a command of yours with the same
236
- name keeps working beside them. In `.claude/commands/` and `.github/prompts/`,
237
- OpenCastle writes only its `oc` files and leaves everything else alone.
191
+ dialect for how a rule is scoped, and its MCP servers in the shape it expects.
192
+ `opencastle explain` lists the paths for the assistants a project compiles for.
193
+
194
+ In Claude Code and in VS Code's Copilot Chat, OpenCastle's prompts are slash
195
+ commands in one namespace — `/oc:bug-fix`, `/oc:implement-feature`, and a
196
+ team's own prompts as `/oc:<name>` — so a command of yours with the same name
197
+ keeps working beside them. In `.claude/commands/` and `.github/prompts/`,
198
+ OpenCastle writes only its `oc` files and leaves everything else alone. The
199
+ other assistants get the prompts as files (`.cursor/rules/prompts/`,
200
+ `.windsurf/rules/prompts/`, `.opencode/prompts/`, `.codex/prompts/`,
201
+ `.agents/prompts/`) that you ask for by name.
238
202
 
239
203
  <br>
240
204
 
241
205
  ## What gets compiled
242
206
 
243
207
  **Agents** — 13 role definitions (Developer, UI/UX, Data, Security, Testing,
244
- Reviewer, and others), each with a defined scope and output contract.
208
+ Reviewer, and others), each with a defined scope and output contract. A project
209
+ gets the ones its stack needs: Content Engineer comes with a CMS, Data Engineer
210
+ with a database.
245
211
 
246
212
  **Skills** — 31 domain skills plus 31 tool integrations, loaded on demand so
247
213
  they don't sit in the context window. Selected during init from what your
248
214
  repository actually uses.
249
215
 
250
- **Workflows** — 9 templates for recurring work: features, bug fixes, data
251
- pipelines, security audits, migrations.
216
+ **Workflows** — 8 templates for recurring work (features, bug fixes, data
217
+ pipelines, security audits, migrations, and more), plus a shared delivery
218
+ phase that ends each of them.
219
+
220
+ **Prompts** — 7 for people (brainstorm, implement-feature, bug-fix,
221
+ quick-refinement, resolve-pr-comments, bootstrap-customizations, create-skill)
222
+ and 7 steps the convoy planner runs.
252
223
 
253
224
  **Quality gates** — a review pass after each step, panel review for high-stakes
254
225
  changes, plus your own lint, test, and build commands.
@@ -261,39 +232,39 @@ can reach and what they cost today. A pinned model name can only be wrong later.
261
232
 
262
233
  ## Convoy Engine (experimental)
263
234
 
264
- For work too long to sit and watch, the convoy engine runs tasks in dependency
265
- order across isolated git worktrees, with SQLite persistence so a crash resumes
266
- instead of restarting.
235
+ For multi-step work you would rather not sit and watch. `opencastle convoy "<task>"`
236
+ plans the work without changing anything, shows you the plan and asks once. Then it
237
+ runs independent tasks at the same time, each in its own git worktree, on the
238
+ runtime `opencastle init` set up: Claude Code, Codex, Cursor, OpenCode or Copilot.
239
+ Each finished task is merged onto a branch of its own, your project's checks run
240
+ once at the end, and your checkout is never touched. This part is experimental
241
+ and may change; the compiler above does not depend on it.
267
242
 
268
243
  ```bash
269
- opencastle convoy "Add user reviews to the place detail page"
270
- opencastle convoy # where did the last run get to?
271
- opencastle convoy resume # continue after an interruption
244
+ opencastle convoy "Add tags to notes, and reject a note without a title" # plan, show, ask, run
245
+ opencastle convoy # the last run and the one next step
246
+ opencastle convoy resume # continue whatever is not done
247
+ opencastle convoy dashboard # the Observability dashboard, live
248
+ opencastle convoy run my.convoy.yml # run a spec you wrote
272
249
  ```
273
250
 
274
- It plans the work, executes it, and runs your gates. Inspired by Steve Yegge's
275
- [Gas Town](https://github.com/steveyegge/gastown).
276
-
277
- This part is experimental and may change. The compiler above does not depend on
278
- it.
251
+ Real runs, with their time and cost: [Use cases](https://www.opencastle.dev/docs/use-cases).
252
+ Every command and flag: [CLI reference](https://www.opencastle.dev/docs/cli#convoy).
253
+ How it works: [ARCHITECTURE.md](ARCHITECTURE.md#convoy-architecture). Inspired by
254
+ Steve Yegge's [Gas Town](https://github.com/gastownhall/gastown).
279
255
 
280
256
  <br>
281
257
 
282
258
  ## Architecture
283
259
 
284
- See **[ARCHITECTURE.md](ARCHITECTURE.md)** for how the adapters, skill matrix,
285
- and convoy engine fit together.
260
+ See **[ARCHITECTURE.md](ARCHITECTURE.md)** for how the adapters, team sources,
261
+ skill matrix and convoy engine fit together.
286
262
 
287
263
  <br>
288
264
 
289
265
  ## Contributing
290
266
 
291
- 1. Fork the repo
292
- 2. Create a branch — `feat/your-feature` or `fix/your-fix`
293
- 3. Make changes and ensure `npm test` and `npx tsc --noEmit` pass
294
- 4. Open a PR
295
-
296
- See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
267
+ See **[CONTRIBUTING.md](CONTRIBUTING.md)**.
297
268
 
298
269
  <br>
299
270
 
package/bin/cli.mjs CHANGED
@@ -11,6 +11,16 @@ const pkgRoot = resolve(__dirname, '..')
11
11
 
12
12
  const [, , command, ...rawArgs] = process.argv
13
13
 
14
+ // A reader that stops early — `opencastle explain | head` — closes the pipe, and
15
+ // the next write raised EPIPE as an unhandled error: a stack trace after the
16
+ // lines that were wanted. Stop quietly instead, as `cat` and `git` do.
17
+ for (const stream of [process.stdout, process.stderr]) {
18
+ stream.on('error', (err) => {
19
+ if (err && err.code === 'EPIPE') process.exit(0)
20
+ throw err
21
+ })
22
+ }
23
+
14
24
  /**
15
25
  * `--flag=value` and `--flag value` are the same thing.
16
26
  *
@@ -55,7 +65,9 @@ const args = expandEqualsForm(rawArgs)
55
65
  * `docs-accuracy.test.ts` asserts this table against each command's `--help`, so
56
66
  * the two cannot drift.
57
67
  */
58
- const GLOBAL_FLAGS = ['--help', '-h', '--version', '-v', '--debug']
68
+ // `--version` is not here: it is read only as the first argument (below), so a
69
+ // command given it is refused rather than run as if it had not been.
70
+ const GLOBAL_FLAGS = ['--help', '-h', '--debug']
59
71
  const COMMAND_FLAGS = {
60
72
  init: ['--allow-downgrade', '--customize', '--dry-run', '--dryRun', '--reconfigure', '--yes', '-y'],
61
73
  sync: ['--allow-downgrade', '--check', '--dry-run', '--dryRun', '--force', '--json', '--reconfigure', '--yes'],
@@ -121,7 +133,7 @@ const HELP = `
121
133
  fleet Versions and drift across many repositories
122
134
 
123
135
  Experimental:
124
- convoy Run multi-step work through the convoy engine
136
+ convoy Plan multi-step work and run it with agents in parallel
125
137
 
126
138
  Options:
127
139
  --dry-run Preview changes without writing files
@@ -192,7 +204,8 @@ const commands = { ...VISIBLE, ...HIDDEN }
192
204
  // belongs to it too — `opencastle --json` is documented in the help text, in
193
205
  // status's own help, and on the website, and used to answer "Unknown command".
194
206
  if (!command || command.startsWith('-')) {
195
- const bare = ['--json', '--help', '-h']
207
+ // `--debug` is global; alone it is the status command with stack traces on.
208
+ const bare = ['--json', '--help', '-h', '--debug']
196
209
  if (!command || bare.includes(command)) {
197
210
  if (command === '--help' || command === '-h') {
198
211
  console.log(HELP)
@@ -219,19 +232,15 @@ if (command === '--help' || command === '-h' || command === 'help') {
219
232
  process.exit(0)
220
233
  }
221
234
 
235
+ // Only as the first argument. Anywhere else `-v` can be a value — `opencastle
236
+ // log --task -v` used to print the version and record nothing — or a word of
237
+ // a convoy task.
222
238
  if (command === '--version' || command === '-v') {
223
239
  const pkg = JSON.parse(await readFile(resolve(pkgRoot, 'package.json'), 'utf8'))
224
240
  console.log(pkg.version)
225
241
  process.exit(0)
226
242
  }
227
243
 
228
- // Handle --version anywhere in args (e.g. "opencastle init --version")
229
- if (args.includes('--version') || args.includes('-v')) {
230
- const pkg = JSON.parse(await readFile(resolve(pkgRoot, 'package.json'), 'utf8'))
231
- console.log(pkg.version)
232
- process.exit(0)
233
- }
234
-
235
244
  if (!commands[command]) {
236
245
  if (command in REPLACED) {
237
246
  const replacement = REPLACED[command]
@@ -255,6 +264,7 @@ const stray = unknownFlag(command, args)
255
264
  if (stray) {
256
265
  const known = [...COMMAND_FLAGS[command], ...GLOBAL_FLAGS].sort()
257
266
  console.error(`\n ✗ Unknown option for "${command}": ${stray}`)
267
+ if (stray === '--version' || stray === '-v') console.error(' For the version, put it first: opencastle --version')
258
268
  console.error(` Accepts: ${known.join(' ')}`)
259
269
  console.error(` Run "opencastle ${command} --help" for what each one does.\n`)
260
270
  process.exit(1)
@@ -12,9 +12,11 @@
12
12
  * The rest of `.claude/commands/` belongs to whoever writes there; `sync` never
13
13
  * touches it, beyond removing what a release before the namespace left at the top.
14
14
  *
15
- * Note: Claude Code has no "agents" concept. Agent definitions are embedded
16
- * as reference sections within CLAUDE.md so Claude can adopt personas
17
- * when asked.
15
+ * agents/*.agent.md → .claude/agents/<name>.agent.md (subagents)
16
+ *
17
+ * Each command keeps one line of frontmatter, its description, which is what
18
+ * Claude Code lists beside it in the `/` menu. Each agent keeps a name and a
19
+ * description, which is what makes it a subagent Claude Code can delegate to.
18
20
  */
19
21
  export declare const IDE_ID = "claude-code";
20
22
  declare const install: (_pkgRoot: string, _projectRoot: string, _stack?: import("../types.js").StackConfig, _repoInfo?: import("../types.js").RepoInfo, _source?: import("../layers.js").CompileSource) => Promise<import("../types.js").CopyResults>, update: (_pkgRoot: string, _projectRoot: string, _stack?: import("../types.js").StackConfig, _repoInfo?: import("../types.js").RepoInfo, _source?: import("../layers.js").CompileSource) => Promise<import("../types.js").CopyResults>, getManagedPaths: () => import("../types.js").ManagedPaths, getDoctorChecks: () => import("../types.js").DoctorCheck[], getLegacyOutputs: ((_projectRoot: string) => string[]) & ((_projectRoot: string) => string[]);
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/cli/adapters/claude-code.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,MAAM,gBAAgB,CAAA;AAEnC,QAAA,MAAQ,OAAO,kOAAE,MAAM,kOAAE,eAAe,4CAAE,eAAe,6CAAE,gBAAgB,6EAUzE,CAAA;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAA"}
1
+ {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/cli/adapters/claude-code.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,MAAM,gBAAgB,CAAA;AAEnC,QAAA,MAAQ,OAAO,kOAAE,MAAM,kOAAE,eAAe,4CAAE,eAAe,6CAAE,gBAAgB,6EAYzE,CAAA;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAA"}
@@ -14,9 +14,11 @@ import { CLAUDE_COMMANDS_DIR, legacyClaudeCommands } from '../command-namespace.
14
14
  * The rest of `.claude/commands/` belongs to whoever writes there; `sync` never
15
15
  * touches it, beyond removing what a release before the namespace left at the top.
16
16
  *
17
- * Note: Claude Code has no "agents" concept. Agent definitions are embedded
18
- * as reference sections within CLAUDE.md so Claude can adopt personas
19
- * when asked.
17
+ * agents/*.agent.md → .claude/agents/<name>.agent.md (subagents)
18
+ *
19
+ * Each command keeps one line of frontmatter, its description, which is what
20
+ * Claude Code lists beside it in the `/` menu. Each agent keeps a name and a
21
+ * description, which is what makes it a subagent Claude Code can delegate to.
20
22
  */
21
23
  export const IDE_ID = 'claude-code';
22
24
  const { install, update, getManagedPaths, getDoctorChecks, getLegacyOutputs } = createSingleFileAdapter({
@@ -29,6 +31,8 @@ const { install, update, getManagedPaths, getDoctorChecks, getLegacyOutputs } =
29
31
  workflowPrefix: 'workflow-',
30
32
  frameworkDirs: ['agents', 'skills', CLAUDE_COMMANDS_DIR],
31
33
  legacyOutputs: (projectRoot) => legacyClaudeCommands(projectRoot),
34
+ commandDescriptions: true,
35
+ agentFrontmatter: true,
32
36
  });
33
37
  export { install, update, getManagedPaths, getDoctorChecks, getLegacyOutputs };
34
38
  //# sourceMappingURL=claude-code.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../src/cli/adapters/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAEnF;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAA;AAEnC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,uBAAuB,CAAC;IACtG,QAAQ,EAAE,WAAW;IACrB,MAAM,EAAE,SAAS;IACjB,aAAa,EAAE,WAAW;IAC1B,SAAS,EAAE,aAAa;IACxB,UAAU,EAAE,mBAAmB;IAC/B,YAAY,EAAE,mBAAmB;IACjC,cAAc,EAAE,WAAW;IAC3B,aAAa,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,CAAC;IACxD,aAAa,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,oBAAoB,CAAC,WAAW,CAAC;CAClE,CAAC,CAAA;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAA"}
1
+ {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../src/cli/adapters/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAEnF;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAA;AAEnC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,uBAAuB,CAAC;IACtG,QAAQ,EAAE,WAAW;IACrB,MAAM,EAAE,SAAS;IACjB,aAAa,EAAE,WAAW;IAC1B,SAAS,EAAE,aAAa;IACxB,UAAU,EAAE,mBAAmB;IAC/B,YAAY,EAAE,mBAAmB;IACjC,cAAc,EAAE,WAAW;IAC3B,aAAa,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,CAAC;IACxD,aAAa,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,oBAAoB,CAAC,WAAW,CAAC;IACjE,mBAAmB,EAAE,IAAI;IACzB,gBAAgB,EAAE,IAAI;CACvB,CAAC,CAAA;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAA"}
@@ -44,8 +44,26 @@ export interface SingleFileAdapterConfig {
44
44
  * present on disk now, relative to the project root. Removed on update.
45
45
  */
46
46
  legacyOutputs?: (_projectRoot: string) => string[];
47
+ /**
48
+ * Prompts and workflows become slash commands that list a description.
49
+ * Claude Code takes it from frontmatter and otherwise from the first line,
50
+ * which once frontmatter was stripped was the managed-file banner — every
51
+ * `/oc:` command described as "This file is managed by OpenCastle".
52
+ */
53
+ commandDescriptions?: boolean;
54
+ /**
55
+ * Agent files are the assistant's own subagents, which it registers only
56
+ * with a `name` and a `description` in frontmatter. Claude Code reads
57
+ * `.claude/agents/`; written bare, every agent there was a file it never
58
+ * offered to delegate to. Everything else in the source frontmatter (VS Code
59
+ * tool names, handoffs, the tier) means nothing to it and is left out, so the
60
+ * agent inherits the session's tools and model.
61
+ */
62
+ agentFrontmatter?: boolean;
47
63
  }
48
64
  export declare function createSingleFileAdapter(config: SingleFileAdapterConfig): IdeAdapter & {
49
65
  getLegacyOutputs(_projectRoot: string): string[];
50
66
  };
67
+ /** Every file under a directory, relative to it. */
68
+ export declare function filesUnderDir(root: string): string[];
51
69
  //# sourceMappingURL=single-file-base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"single-file-base.d.ts","sourceRoot":"","sources":["../../../src/cli/adapters/single-file-base.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAA4B,UAAU,EAAE,SAAS,EAAuC,MAAM,aAAa,CAAA;AAGvH;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAA;IACd,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,SAAS,EAAE,SAAS,CAAA;IACpB,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAA;IAClB,yFAAyF;IACzF,YAAY,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,SAAS,EAAE,CAAA;KAAE,CAAA;IACxD;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,EAAE,CAAA;CACnD;AA4FD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,uBAAuB,GAC9B,UAAU,GAAG;IAAE,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,CAibnE"}
1
+ {"version":3,"file":"single-file-base.d.ts","sourceRoot":"","sources":["../../../src/cli/adapters/single-file-base.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAA4B,UAAU,EAAE,SAAS,EAAuC,MAAM,aAAa,CAAA;AAGvH;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAA;IACd,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,SAAS,EAAE,SAAS,CAAA;IACpB,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAA;IAClB,yFAAyF;IACzF,YAAY,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,SAAS,EAAE,CAAA;KAAE,CAAA;IACxD;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,EAAE,CAAA;IAClD;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAuHD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,uBAAuB,GAC9B,UAAU,GAAG;IAAE,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,CAibnE;AAgBD,oDAAoD;AACpD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAUpD"}
@@ -7,6 +7,31 @@ import { mergeCopyResults, copyDir } from '../copy.js';
7
7
  import { scaffoldMcpConfigInto } from '../mcp.js';
8
8
  import { withSource } from '../layers.js';
9
9
  import { stripFrontmatter, parseFrontmatterMeta } from './frontmatter.js';
10
+ /** An agent's name as a subagent: its file name, lower-case and hyphenated. */
11
+ function subagentName(file) {
12
+ return basename(file).replace(/\.agent\.md$|\.md$/, '').toLowerCase().replace(/[^a-z0-9-]+/g, '-');
13
+ }
14
+ /** An agent file: the body, under a name and description when the assistant registers subagents. */
15
+ function agentFile(file, content, withFrontmatter) {
16
+ const body = stripFrontmatter(content) + '\n';
17
+ if (!withFrontmatter)
18
+ return body;
19
+ const description = commandDescription(content) ?? subagentName(file);
20
+ return `---\nname: ${subagentName(file)}\ndescription: ${JSON.stringify(description)}\n---\n\n${body}`;
21
+ }
22
+ /** The frontmatter `description`, or the first heading, as a command's one line. */
23
+ function commandDescription(content) {
24
+ const fromMeta = parseFrontmatterMeta(content).description;
25
+ if (fromMeta)
26
+ return fromMeta;
27
+ return stripFrontmatter(content).match(/^#\s+(.+)$/m)?.[1]?.trim();
28
+ }
29
+ /** A command file: the body, under a description when the assistant lists one. */
30
+ function commandFile(content, withDescription) {
31
+ const body = stripFrontmatter(content) + '\n';
32
+ const description = withDescription ? commandDescription(content) : undefined;
33
+ return description ? `---\ndescription: ${JSON.stringify(description)}\n---\n\n${body}` : body;
34
+ }
10
35
  /**
11
36
  * Creates install/update/getManagedPaths functions from a config object.
12
37
  *
@@ -257,7 +282,7 @@ export function createSingleFileAdapter(config) {
257
282
  continue;
258
283
  const destPath = resolve(destAgents, file);
259
284
  const content = await readFile(resolve(agentsDir, file), 'utf8');
260
- await emit(projectRoot, destPath, stripFrontmatter(content) + '\n', overwrite, results);
285
+ await emit(projectRoot, destPath, agentFile(file, content, config.agentFrontmatter === true), overwrite, results);
261
286
  }
262
287
  }
263
288
  // 3. Skills → <skillsDir>/<name>/SKILL.md (+ sibling resources, frontmatter preserved).
@@ -295,7 +320,7 @@ export function createSingleFileAdapter(config) {
295
320
  const name = basename(file, '.prompt.md') || basename(file, '.md');
296
321
  const destPath = resolve(destPrompts, `${name}.md`);
297
322
  const content = await readFile(resolve(promptDir, file), 'utf8');
298
- await emit(projectRoot, destPath, stripFrontmatter(content) + '\n', overwrite, results);
323
+ await emit(projectRoot, destPath, commandFile(content, config.commandDescriptions === true), overwrite, results);
299
324
  }
300
325
  }
301
326
  // 5. Agent Workflows → dotDir/<workflowsDir>/<prefix><name>.md
@@ -311,7 +336,7 @@ export function createSingleFileAdapter(config) {
311
336
  const name = basename(file, '.md');
312
337
  const destPath = resolve(destWf, `${config.workflowPrefix}${name}.md`);
313
338
  const content = await readFile(resolve(wfDir, file), 'utf8');
314
- await emit(projectRoot, destPath, stripFrontmatter(content) + '\n', overwrite, results);
339
+ await emit(projectRoot, destPath, commandFile(content, config.commandDescriptions === true), overwrite, results);
315
340
  }
316
341
  }
317
342
  // 7. MCP server config (scaffold once)
@@ -462,7 +487,7 @@ function pruneEmptied(root, dirs) {
462
487
  }
463
488
  }
464
489
  /** Every file under a directory, relative to it. */
465
- function filesUnderDir(root) {
490
+ export function filesUnderDir(root) {
466
491
  const out = [];
467
492
  const walk = (dir, prefix) => {
468
493
  for (const entry of readdirSync(dir, { withFileTypes: true })) {