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
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: 'Fix validation errors in PRD. Goal is broken PRD markdown; context is error list from validation step.'
2
+ description: 'Fix the issues a PRD review found. Goal is the PRD, context is the list of issues; answers with the whole corrected PRD.'
3
3
  agent: 'Team Lead (OpenCastle)'
4
4
  output: prd
5
5
  ---
@@ -8,46 +8,50 @@ output: prd
8
8
 
9
9
  # Fix PRD
10
10
 
11
- You are the Team Lead. The PRD below failed validation. Fix **every reported issue**; output complete, corrected PRD.
11
+ You are the Team Lead. The PRD at the end of this prompt failed review. Fix **every reported issue** and return the complete, corrected PRD.
12
12
 
13
- ## Failing PRD
14
-
15
- {{goal}}
16
-
17
- ## Validation Errors
13
+ ## What Happens to Your Answer
18
14
 
19
- {{context}}
15
+ When `opencastle convoy` runs this step, your answer replaces the PRD file exactly as written, and the reviewer checks it again. That happens at most twice, so fix everything in one go.
20
16
 
21
- ---
17
+ This session is read-only; answer in text.
22
18
 
23
19
  ## Fix Instructions
24
20
 
25
- 1. Read every reported issue before making changes.
26
- 2. Fix **all** reported issues; do not partially fix.
27
- 3. Do not change intent, goals, or scope of feature. Only fix what validator flagged.
28
- 4. Preserve all content not part of reported issues.
21
+ 1. Read every reported issue before changing anything.
22
+ 2. Fix **all** of them; do not fix some.
23
+ 3. Do not change the feature's intent, goals or scope. Change only what the reviewer flagged.
24
+ 4. Keep everything else as it was, including every section heading and each `Phase N —` line in the Task Breakdown: the planner reads them, and the work was already sized from them.
29
25
 
30
26
  ### Common Fix Patterns
31
27
 
32
28
  **Missing sections**
33
- - Add missing section with concrete, specific content — not placeholder text
34
- - If section needs real data you cannot infer, write reasonable default; mark with `<!-- TODO: verify -->`
29
+ - Add the section with concrete content, not placeholder text.
30
+ - If it needs facts you cannot infer, write a reasonable default and mark it `<!-- TODO: verify -->`.
35
31
 
36
32
  **Conflicting requirements**
37
- - Resolve contradictions between sections — pick intent that best matches feature goals
33
+ - Resolve the contradiction in favour of what best matches the feature's goals.
38
34
 
39
35
  **File partition conflicts**
40
- - If two parallel workstreams claim same file, move one to later phase with explicit dependency
41
- - Or split file's responsibilities across two workstreams so each touches distinct files
36
+ - If two workstreams in the same phase claim the same file, move one to a later phase and say what it depends on.
37
+ - Or split the file's responsibilities so each workstream touches different files.
42
38
 
43
39
  **Broad implementation scope**
44
- - Replace excessively broad paths (`src/`, `the frontend`) with specific subdirectories or file names
40
+ - Replace broad paths (`src/`, "the frontend") with specific subdirectories or files.
45
41
 
46
42
  **Placeholder text**
47
- - Replace template filler ("2–3 sentences about…", "Description here") with real content derived from feature description
43
+ - Replace template filler ("2–3 sentences about…", "Description here") with real content drawn from the feature request.
44
+
45
+ ## Output
46
+
47
+ Return the **complete corrected PRD** as raw Markdown, starting with the `#` heading. No code fence, no notes before or after it.
48
48
 
49
49
  ---
50
50
 
51
- ## Output
51
+ ## Failing PRD
52
52
 
53
- Return **complete corrected PRD** as raw Markdown starting with `#` heading. Do not wrap output in code fence. Do not add explanatory prose before or after PRD.
53
+ {{goal}}
54
+
55
+ ## Issues to Fix
56
+
57
+ {{context}}
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: 'Generate JSON task plan for autonomous convoy execution based on a high-level goal.'
2
+ description: 'Break a PRD into a JSON task plan for the convoy engine: the tasks, their prompts, agents, files and dependencies.'
3
3
  agent: 'Team Lead (OpenCastle)'
4
4
  output: json
5
5
  ---
@@ -8,19 +8,22 @@ output: json
8
8
 
9
9
  # Generate Task Plan
10
10
 
11
- You are the Team Lead. User wants to run `opencastle convoy run --file <spec>` to execute batch of tasks autonomously via convoy engine. Your job: produce JSON task plan. CLI will convert it to valid convoy spec — **you do not need to know YAML syntax**. Derive short, descriptive, kebab-case filename from user's goal (2–4 words max), e.g. `auth-refactor` or `add-search`.
11
+ You are the Team Lead. Break the work described at the end of this prompt into tasks that agents carry out on their own, several at a time, under OpenCastle's convoy engine (experimental). Answer with a JSON task plan.
12
12
 
13
- > **⚠️ OUTPUT FORMAT: Your entire response must be a single ` ```json ` fenced code block. Do NOT output any text, explanations, summaries, or DAG diagrams before or after the JSON block. The parser only reads the ` ```json ` fence — everything else causes a failure.**
13
+ > **⚠️ OUTPUT FORMAT:** Your whole answer is one ` ```json ` fenced block. Nothing before or after it — no explanation, no summary, no diagram.
14
14
 
15
- ## User Goal
15
+ ## What Happens to Your Answer
16
16
 
17
- {{goal}}
17
+ When `opencastle convoy` runs this step, you decide the tasks; the code decides how the run behaves:
18
18
 
19
- ## PRD Reference
19
+ - **The spec.** Your plan is written to `.opencastle/convoys/<name>.convoy.yml`, after your `name` in kebab-case, so keep `name` short and descriptive (2–4 words, e.g. `Auth refactor`).
20
+ - **Run settings.** The work lands on a branch `convoy/<name>`, never in the user's checkout. It runs on the agent runtime that planned it. As many tasks run at once as the dependencies allow, up to 4, each as soon as the tasks it depends on are done. A task that fails holds back only the tasks that depend on it.
21
+ - **Checks.** The project's typecheck, lint, test and build scripts from `package.json` run once, after every task, with one attempt to fix a failure. Do not add tasks — or prompt steps — that run the whole test suite. Each task checks its own work, narrowly.
22
+ - **Effort.** Each task's `complexity` sets its timeout, retries and review level.
23
+ - **Validation.** The code checks that ids are unique, every `depends_on` exists, there are no cycles, `files` are plain paths, and no two tasks that can run at the same time claim the same file. A glob in `files` is cut back to the directory before its first wildcard. Anything that fails goes to a fix step as targeted patches, at most twice; if two tasks still claim the same file after that, the later one is made to wait for the earlier.
24
+ - **Approval.** A person sees the plan as a table — task, agent, depends on, files — and decides whether to run it. With `--yes`, a reviewer reads it instead.
20
25
 
21
- {{context}}
22
-
23
- ---
26
+ This session is read-only. Read the repository to learn its layout and conventions, and answer in text.
24
27
 
25
28
  ## JSON Schema
26
29
 
@@ -28,97 +31,93 @@ You are the Team Lead. User wants to run `opencastle convoy run --file <spec>` t
28
31
 
29
32
  | Field | Type | Required | Description |
30
33
  |-------|------|----------|-------------|
31
- | `name` | string | **yes** | Human-readable name for the run |
32
- | `branch` | string | no | Git feature branch (e.g. `feat/auth-refactor`) |
33
- | `concurrency` | integer ≥ 1 | no | Max parallel tasks (default `1`) |
34
- | `on_failure` | `continue` \| `stop` | no | Behaviour on task failure (default `continue`) |
34
+ | `name` | string | **yes** | 2–4 words; names the spec file and the branch |
35
35
  | `tasks` | list | **yes** | Non-empty list of task objects |
36
- | `gates` | array of strings | no | Shell commands run after all tasks complete; each must exit 0 |
37
- | `gate_retries` | integer ≥ 0 | no | Times to retry failing gates with an auto-fix task |
38
36
 
39
- > **Added automatically — you do not need to set these:** `version: 1`, `defaults.timeout: '30m'`, `defaults.max_retries: 1`, `defaults.review: 'fast'`.
37
+ Nothing else at the top level is read. Branch, concurrency, failure policy and checks are set by the code, as described above.
40
38
 
41
39
  ### Task Fields
42
40
 
43
41
  | Field | Type | Required | Description |
44
42
  |-------|------|----------|-------------|
45
43
  | `id` | string | **yes** | Unique identifier (lowercase, kebab-case) |
46
- | `prompt` | string | **yes** | Full self-contained instruction for the agent |
44
+ | `prompt` | string | **yes** | The agent's complete, self-contained instructions |
47
45
  | `agent` | string | no | Agent role (default `developer`) — see Agent Roster |
48
- | `description` | string | no | Short label shown in progress output |
49
- | `files` | list of paths | no | Files/directories the agent may modify. Plain paths only — **no globs**. |
50
- | `depends_on` | list of ids | no | Task ids that must complete first |
51
- | `timeout` | duration | no | e.g. `30m`, `1h`, `10m` |
52
- | `max_retries` | integer | no | Override retry count for this task |
53
- | `review` | `fast` \| `panel` \| `none` \| `auto` | no | Review level |
54
- | `gates` | list of strings | no | Per-task gate commands |
55
- | `complexity` | `1` \| `2` \| `3` \| `5` \| `8` \| `13` | no | Fibonacci complexity score. Auto-populates timeout/retries/review from effort table. |
46
+ | `description` | string | no | Short label shown in the plan and in progress output |
47
+ | `files` | list of paths | no | Files and directories the task may change. Plain paths only — **no globs**. |
48
+ | `depends_on` | list of ids | no | Tasks that must finish first |
49
+ | `complexity` | `1` \| `2` \| `3` \| `5` \| `8` \| `13` | no | Fibonacci score; sets timeout, retries and review |
50
+ | `timeout` | duration | no | Overrides the complexity default, e.g. `45m` |
56
51
 
57
52
  ### Complexity Scores
58
53
 
59
- If **Pre-Computed Task Complexity** table is present in context, use those scores directly — do not re-derive. Map each convoy task to closest workstream; for combined workstreams use highest score.
54
+ If a **Pre-Computed Task Complexity** table comes with the PRD, use its scores — do not re-derive them. Map each task to the closest workstream; for a task that combines workstreams, use the highest score.
60
55
 
61
- If no pre-computed data available, assess complexity yourself: `1` (trivial), `2` (simple), `3` (moderate), `5` (significant), `8` (complex), `13` (epic).
56
+ Otherwise score each task yourself: `1` (trivial), `2` (simple), `3` (moderate), `5` (significant), `8` (complex), `13` (epic).
62
57
 
63
58
  ### Agent Roster
64
59
 
65
- `developer` · `architect` · `content-engineer` · `writer` · `data-engineer` · `data-engineer` · `developer` · `devops-expert` · `writer` · `performance-expert` · `devops-expert` · `researcher` · `security-expert` · `writer` · `team-lead` · `testing-expert` · `ui-ux-expert`
60
+ | Agent | For |
61
+ |-------|-----|
62
+ | `developer` | Pages, components, routes, API and server logic — most code |
63
+ | `ui-ux-expert` | Design system, accessible UI components, styling |
64
+ | `testing-expert` | Unit, integration and end-to-end tests |
65
+ | `data-engineer` | Schemas, migrations, queries, ETL, crawlers, data import |
66
+ | `security-expert` | Authentication, authorization, input validation, security headers |
67
+ | `devops-expert` | CI/CD, deployment, environment variables, caching, release notes |
68
+ | `performance-expert` | Frontend, backend and build performance |
69
+ | `content-engineer` | CMS schemas, content models and queries |
70
+ | `writer` | Documentation, user-facing copy, metadata |
71
+ | `architect` | Design decisions and structure that other tasks build on |
72
+ | `researcher` | Investigating the codebase before a change |
66
73
 
67
74
  ---
68
75
 
69
76
  ### Content Research Rule
70
77
 
71
- When writing task `prompt` fields involving creating content about real-world people, places, organizations, or topics — **include explicit instruction in prompt** telling agent to search internet first using available web search or fetch tools (e.g. `fetch_webpage`, web search MCP). Agents must never fabricate bios, descriptions, histories, statistics, or factual claims. If web search unavailable, prompt should instruct agent to use placeholder text clearly marked as `[NEEDS RESEARCH]` rather than inventing content.
78
+ When a task creates content about real people, places, organizations or topics, its `prompt` must tell the agent to search the web first with whatever search or fetch tool it has, and never to invent bios, histories, statistics or facts. If no search tool is available, the agent uses placeholder text marked `[NEEDS RESEARCH]`.
72
79
 
73
- Example prompt suffix when content research needed:
80
+ Example prompt suffix:
74
81
  > "Before writing any content about [topic], search the internet for accurate information. Do not make up facts, descriptions, or biographical details. Use verified sources only."
75
82
 
76
- ---
77
-
78
- ### Scaffolding Rule
79
-
80
-
81
83
  ---
82
84
 
83
85
  ## Workflow
84
86
 
85
87
  ### 1. Analyse the Goal
86
88
 
87
- - Read user's goal. Identify **deliverables** — what must exist or change after run completes.
88
- - Search codebase to understand current state, file layout, conventions.
89
- - List high-level workstreams (e.g. "database changes", "UI components", "tests", "docs").
89
+ - Read the goal and the PRD. Identify the **deliverables** — what must exist or change when the run is done.
90
+ - Look at the codebase for its current state, file layout and conventions.
91
+ - List the workstreams (e.g. "database changes", "UI components", "tests", "docs").
90
92
 
91
93
  ### 2. Decompose into Tasks
92
94
 
93
- For each workstream, break down into smallest meaningful unit. Follow these rules:
94
-
95
- 1. **Single responsibility** — each task does exactly one thing.
96
- 2. **Self-contained prompt** — `prompt` field must contain everything agent needs: objective, file paths, constraints, acceptance criteria. Agent has no other context.
97
- 3. **Explicit file scopes** — list every directory or file task may touch in `files`. Use plain paths only: exact file paths (e.g. `app/page.tsx`) or directory paths (e.g. `app/about/`). **Glob patterns (`*`, `?`, `**`) not allowed** — engine rejects them.
98
-
99
- 4. **No partition conflicts** — two tasks may not share `files` entry if they run in parallel (same phase). Resolve by either:
100
- - **Specificity**: replace a broad directory path with the specific files each task actually creates (e.g., instead of both tasks claiming `components/`, one gets `components/Hero.tsx` and the other gets `components/ProjectCard.tsx`)
101
- - **Sequencing**: add a `depends_on` edge from the later task to the earlier one, so they run in different phases
95
+ 1. **As few tasks as the work needs** — a change one agent can make in one session is one task. Split only into tasks that can run at the same time on different files, or into work that genuinely must come after other work. A small change is usually one task; most features are two to five. Every extra task is another agent session, review and merge.
96
+ 2. **Self-contained prompt** — the `prompt` holds everything the agent needs: objective, file paths, constraints, acceptance criteria. The agent sees nothing else.
97
+ 3. **Explicit file scopes** — list every file or directory the task may change in `files`: exact files (`app/page.tsx`) or directories (`app/about/`). **No glob patterns (`*`, `?`, `**`).**
98
+ 4. **No partition conflicts** — two tasks that can run at the same time (neither depends on the other, directly or through other tasks) may not share a `files` entry, and a directory overlaps every file inside it. Resolve it by:
99
+ - **Specificity**: give each task the specific files it creates (instead of both claiming `components/`, one gets `components/Hero.tsx` and the other `components/ProjectCard.tsx`), or
100
+ - **Sequencing**: add a `depends_on` edge so one runs after the other.
102
101
 
103
- > **Common mistake:** multiple tasks depending on single `setup` task will run in parallel, conflict if sharing directory like `components/`, `app/globals.css`, or `app/layout.tsx`. Always use specific file paths or sequence conflicting tasks.
102
+ > **Common mistake:** several tasks that depend only on one `setup` task run at the same time, and conflict if they all claim `components/`, `app/globals.css` or `app/layout.tsx`. Use specific paths, or sequence them.
104
103
 
105
- 5. **Appropriate agent** — pick agent whose speciality matches task (e.g. `testing-expert` for tests, `data-engineer` for migrations).
106
- 6. **Realistic timeouts** — `30m` for most tasks; `1h` for large refactors; `10m` for small docs or config.
104
+ 5. **Appropriate agent** — pick the agent whose speciality matches the task (see the roster).
105
+ 6. **Code and its tests in the same task** — the agent that writes a change writes its tests and runs them, while it still has the context; list the test files in that task's `files`. Plan a separate testing task only for tests that cover several tasks' work together, after those tasks. Running the full suite is never a task: the code runs it once at the end.
107
106
 
108
- ### 2.5 Foundation Phase for Multi-Page Projects
107
+ ### 3. Foundation Phase for Multi-Page Projects
109
108
 
110
- When goal involves building **2 or more pages, views, or UI sections**, apply Foundation-First Pattern to prevent consistency drift across parallel agents:
109
+ When the goal involves **2 or more pages, views or UI sections**, use a foundation task, so parallel agents do not each invent their own styles:
111
110
 
112
- 1. **Create foundation task** (`id: foundation-setup`) as FIRST task. This task:
111
+ 1. **Create a foundation task** (`id: foundation-setup`) first. It:
113
112
  - Creates a **design tokens file** (CSS custom properties for colors, typography, spacing, motion, shadows, breakpoints)
114
113
  - Creates a **shared layout component** (page container with header, footer, navigation)
115
114
  - Creates a **UI component library** (Button, Card, Heading, Text, Section, Container, Grid)
116
- - Establishes **style guide** (aesthetic direction, content tone, terminology, navigation labels)
115
+ - Sets the **style guide** (aesthetic direction, content tone, terminology, navigation labels)
117
116
  - Agent: `ui-ux-expert` or `developer`
118
117
 
119
- 2. **All page tasks must `depends_on: [foundation-setup]`** — cannot run until foundation in place.
118
+ 2. **Every page task has `depends_on: [foundation-setup]`.**
120
119
 
121
- 3. **Every page task prompt must include Foundation References** — 5 mandatory lines constrain agent to `use` existing artifacts instead of `creating` new ones:
120
+ 3. **Every page task prompt includes Foundation References** — five lines that make the agent use what exists instead of creating its own:
122
121
  ```
123
122
  ### Foundation References (MANDATORY)
124
123
  - Design tokens: `[path to tokens file]` — use ONLY these variables. No new color/font/spacing values.
@@ -128,72 +127,83 @@ When goal involves building **2 or more pages, views, or UI sections**, apply Fo
128
127
  - Tone: [content tone from foundation]
129
128
  ```
130
129
 
131
- 4. **The foundation prompt itself** should specify:
132
- - The aesthetic direction (2-3 words + elaboration)
130
+ 4. **The foundation prompt itself** states:
131
+ - The aesthetic direction (2–3 words, then a sentence)
133
132
  - The typography pairing (display + body font)
134
133
  - The color palette intent (dominant, accent, muted)
135
- - The navigation labels (exact text for every nav link)
136
- - The content tone (formal/casual, active/passive)
137
- - Terminology choices (e.g., "projects" not "portfolio")
134
+ - The navigation labels (exact text for every link)
135
+ - The content tone (formal or casual, active or passive)
136
+ - Terminology choices (e.g. "projects", not "portfolio")
138
137
 
139
- > **Why:** Without this pattern, parallel agents independently choose fonts, colors, component APIs, content tone. Result looks built by different teams — because it was. Foundation-first makes consistency structural, not aspirational.
138
+ > **Why:** without it, parallel agents choose fonts, colors, component APIs and tone independently, and the result looks built by different teams — because it was.
140
139
 
141
- ### 3. Define the Dependency Graph (DAG)
140
+ ### 4. Define the Dependency Graph
142
141
 
143
- - Tasks with no dependencies run first (in parallel up to `concurrency`).
144
- - Tasks consuming output of earlier tasks declare `depends_on`.
142
+ - Tasks with no dependencies start first; each other task starts as soon as everything in its `depends_on` is done.
143
+ - A task that uses another task's output declares it in `depends_on`.
145
144
  - **Never create cycles.**
146
- - Verify implicit phase structure:
147
- ```
148
- Phase 1: [independent tasks]
149
- Phase 2: [tasks depending only on Phase 1]
150
- ```
151
-
152
- ### 4. Set Global Options
153
-
154
- - `name` — short description of run.
155
- - `branch` — derive from the goal, e.g. `feat/auth-refactor`.
156
- - `concurrency` — 2–3 for overnight runs; 1 if tasks share files or machine is constrained.
157
- - `on_failure` — `stop` when every subsequent task depends on success; else `continue`.
158
- - `gates` — standard validation (lint, type-check, test) unless user specifies otherwise.
145
+ - Keep the graph as wide as the work honestly allows: independent tasks finish sooner side by side.
159
146
 
160
147
  ### 5. Write the Prompts
161
148
 
162
- Each task `prompt` must be **complete, standalone instruction**. Include:
149
+ Each `prompt` is a **complete, standalone instruction**:
163
150
 
164
- - **What** to build / change / fix.
151
+ - **What** to build, change or fix.
165
152
  - **Where** — exact file paths or directories.
166
- - **Why** — business context so agent can make good decisions.
167
- - **Constraints** — coding standards, conventions, do-not-touch files.
168
- - **Acceptance criteria** — bullet list of pass conditions.
169
- - **Verification command** — e.g. `Run project's test command with coverage` so the agent self-checks.
153
+ - **Why** — enough context for good decisions.
154
+ - **Constraints** — conventions, files not to touch.
155
+ - **Acceptance criteria** — a bullet list of pass conditions.
156
+ - **A narrow check** — how the agent verifies its own work, e.g. "run the test file you wrote" or "typecheck the files you changed" — not the whole suite.
170
157
 
171
158
  > **Weak prompt:** "Add tests for the auth module."
172
159
  >
173
- > **Strong prompt:** "Write unit tests for `libs/auth/src/server.ts` covering token refresh, expiry edge cases, and invalid signatures. Place tests in `libs/auth/src/__tests__/server.test.ts`. Follow the existing test conventions. Achieve ≥ 95% coverage for `server.ts`. Run the project's test command with coverage and fix any failures."
160
+ > **Strong prompt:** "Write unit tests for `libs/auth/src/server.ts` covering token refresh, expiry edge cases, and invalid signatures. Place them in `libs/auth/src/__tests__/server.test.ts`, following the existing test conventions. Run that test file and fix any failures."
174
161
 
175
- > **Multi-page prompt pattern:** For page tasks in a multi-page project, always include the Foundation References block (from Step 2.5). The foundation task creates the design system; page tasks consume it.
176
- >
177
- > **Strong page prompt:** "Build the About page at `app/about/page.tsx`. **Foundation References:** Design tokens: `src/styles/tokens.css` — use ONLY these variables. Layout: `src/components/Layout.tsx` — wrap content in this layout. UI components: `src/components/ui/` — use Heading, Text, Section. Aesthetic: warm editorial. Tone: conversational and authentic. Include a bio section, skills grid (use Card from UI lib), and a timeline of experience. Responsive at 320px, 768px, 1280px."
162
+ > **Strong page prompt:** "Build the About page at `app/about/page.tsx`. **Foundation References:** Design tokens: `src/styles/tokens.css` — use ONLY these variables. Layout: `src/components/Layout.tsx` — wrap content in this layout. UI components: `src/components/ui/` — use Heading, Text, Section. Aesthetic: warm editorial. Tone: conversational and authentic. Include a bio section, a skills grid (Card from the UI library), and a timeline of experience. Responsive at 320px, 768px, 1280px."
178
163
  >
179
- > **Weak page prompt:** "Build the About page with a bio and skills section." — No foundation references, agent will create its own styles.
164
+ > **Weak page prompt:** "Build the About page with a bio and skills section." — no foundation references, so the agent invents its own styles.
165
+
166
+ ---
180
167
 
181
- ### 6. Output
168
+ ## Chain Mode (One Group of a Larger Plan)
182
169
 
183
- Your response must contain **ONLY** single ` ```json ` fenced code block — no text before, no text after, no explanations, no summaries, no DAG diagrams.
170
+ When the goal contains a **Convoy Group Scope** section, you are planning ONE group of a large feature, at the same time as the other groups. You see only this group's phases of the PRD.
171
+
172
+ - Plan **only** the phases listed in the scope.
173
+ - Name the plan after the group (e.g. "Database Setup").
174
+ - Do not put ids from other groups in `depends_on` — you cannot see them. The code makes this group's first tasks wait for the last tasks of the groups it depends on.
175
+ - Keep prompts concise but complete: what to do, which files, key constraints, acceptance criteria.
176
+ - Everything else is as for a whole plan.
184
177
 
185
178
  ---
186
179
 
187
- ## Chain Mode (Subset Generation)
180
+ ## Self-Validation Checklist (MANDATORY)
181
+
182
+ Check every item before answering. A failure costs a fix round.
183
+
184
+ ### Structure
185
+
186
+ - [ ] Every task has a unique `id` (lowercase, kebab-case) and a non-empty `prompt`
187
+ - [ ] Every `depends_on` id is a task in this plan, and there are no cycles
188
+ - [ ] No `files` entry contains `*`, `?` or `**`
189
+ - [ ] `name` is present and `tasks` is non-empty
188
190
 
189
- When `{{goal}}` section contains "Convoy Group Scope" heading, you are generating ONE convoy spec that is part of a larger convoy chain. The goal will contain original user prompt, group name, description, phases to cover, dependency info. Full PRD available in `{{context}}` as reference.
191
+ ### Partitions and Dependencies
190
192
 
191
- When chain mode is detected:
192
- - **Only** generate tasks for phases listed in group scope. Do not include tasks from other phases.
193
- - Derive convoy `name` from group name (e.g. "Database Setup").
194
- - Derive `branch` from PRD's feature name (overridden by pipeline anyway).
195
- - **Keep prompts concise** — write complete, self-contained prompts; avoid unnecessary verbosity. Focus on: what to do, which files to create/modify, key constraints, acceptance criteria.
196
- - Keep all other conventions same as for single-spec generation.
193
+ - [ ] No two tasks that can run at the same time share a `files` entry (a directory overlaps the files inside it)
194
+ - [ ] **Dependency completeness**: when a prompt uses a file, type or component another task creates, it depends on that task
195
+ - [ ] **File list completeness**: every file a prompt creates or changes is in that task's `files`, including small utilities, sub-components and config
196
+ - [ ] **No workarounds** for outputs of tasks in `depends_on` (stub files, `@ts-expect-error`, conditional imports) — those outputs will exist
197
+
198
+ ### Prompts
199
+
200
+ - [ ] **Self-contained**: an agent with no other context can carry it out
201
+ - [ ] **File-specific**: names exact files, not "the frontend" or "the codebase"
202
+ - [ ] **Substantive**: at least 2 real sentences; no `...` or placeholders
203
+ - [ ] **Verifiable**: has acceptance criteria and a narrow check
204
+ - [ ] **Right agent**: each `agent` matches the work (see the roster)
205
+ - [ ] **Research**: prompts about real people, places or organizations include the research instruction
206
+ - [ ] **Foundation** (multi-page work): `foundation-setup` exists and every page task depends on it, with the five Foundation References
197
207
 
198
208
  ---
199
209
 
@@ -201,67 +211,49 @@ When chain mode is detected:
201
211
 
202
212
  ````json
203
213
  {
204
- "name": "Human-readable run name",
205
- "branch": "feat/feature-name",
206
- "concurrency": 2,
207
- "on_failure": "stop",
214
+ "name": "Auth refactor",
208
215
  "tasks": [
209
216
  {
210
- "id": "task-id-kebab-case",
217
+ "id": "token-service",
218
+ "agent": "developer",
219
+ "description": "Extract the token service, with its tests",
220
+ "files": ["libs/auth/src/tokens.ts", "libs/auth/src/__tests__/tokens.test.ts"],
221
+ "depends_on": [],
222
+ "complexity": 3,
223
+ "prompt": "Full self-contained instruction..."
224
+ },
225
+ {
226
+ "id": "session-store",
211
227
  "agent": "developer",
212
- "description": "Short label for progress output",
213
- "files": ["app/page.tsx", "components/Hero.tsx"],
228
+ "description": "Move sessions to the store, with its tests",
229
+ "files": ["libs/auth/src/sessions.ts", "libs/auth/src/__tests__/sessions.test.ts"],
214
230
  "depends_on": [],
215
- "timeout": "30m",
231
+ "complexity": 3,
232
+ "prompt": "Full self-contained instruction..."
233
+ },
234
+ {
235
+ "id": "auth-docs",
236
+ "agent": "writer",
237
+ "description": "Document the new auth flow",
238
+ "files": ["docs/auth.md"],
239
+ "depends_on": ["token-service", "session-store"],
240
+ "complexity": 1,
216
241
  "prompt": "Full self-contained instruction..."
217
242
  }
218
- ],
219
- "gates": ["npx tsc --noEmit", "npx vitest run"],
220
- "gate_retries": 1
243
+ ]
221
244
  }
222
245
  ````
223
246
 
224
- ## Self-Validation Checklist (MANDATORY)
225
-
226
- Before outputting JSON, verify **every item** below. Downstream validator will reject your plan if any blocking checks fail — fix them now to avoid expensive retry cycles.
227
-
228
- ### Structural Integrity
229
-
230
- - [ ] Every task has a unique `id` (lowercase, kebab-case)
231
- - [ ] Every `depends_on` reference points to valid `id` defined in task list
232
- - [ ] No dependency cycles exist (DAG is acyclic)
233
- - [ ] No `files` entry contains `*`, `?`, or `**` — plain paths only
234
- - [ ] Top-level `name`, `tasks` fields present; `tasks` non-empty
235
- - [ ] Every task has both `id`, `prompt` fields (both non-empty strings)
247
+ ---
236
248
 
237
- ### Partition & Dependency Coherence
249
+ ## PRD
238
250
 
239
- - [ ] No two parallel tasks (same phase / no `depends_on` edge) share any `files` entry — resolve with specific file paths or sequencing
240
- - [ ] **Dependency completeness**: For every task prompt, scan for imports or references to files/types/components produced by other tasks. Each cross-reference MUST have `depends_on` edge to producing task.
241
- - [ ] **File list completeness**: Every file mentioned in task's prompt that agent will create or modify appears in that task's `files` list. Don't omit utility files, sub-components, or config files.
242
- - [ ] **Prompt-dependency coherence**: Prompts do not include workarounds (stub files, `@ts-expect-error`, conditional imports) for outputs of tasks listed in `depends_on`, since those outputs are guaranteed to exist.
251
+ {{context}}
243
252
 
244
- ### Prompt Quality
253
+ ## Goal
245
254
 
246
- - [ ] **Self-contained**: Agent with zero context can execute prompt without external clarification.
247
- - [ ] **File-specific**: Names exact files to create or modify — no vague references ("the frontend", "the codebase").
248
- - [ ] **Substantive**: At least 2 meaningful sentences; no stubs (`...`), no placeholders.
249
- - [ ] **Verifiable**: Contains acceptance criteria or explicit verification steps.
250
- - [ ] **Agent domain matching**: Each task's `agent` matches domain — `developer` for code, `testing-expert` for tests, `writer` for docs, `writer` for marketing copy, `ui-ux-expert` for UI, `data-engineer` for migrations, `security-expert` for auth/security, `data-engineer` for ETL/scraping.
251
- - [ ] **Content research compliance**: If prompt concerns real people, places, or organisations, includes research instruction.
252
- - [ ] **Foundation phase present** (multi-page only): If 2+ pages/UI sections, `foundation-setup` task exists; all page tasks depend on it with 5 mandatory Foundation References.
255
+ {{goal}}
253
256
 
254
257
  ---
255
258
 
256
- ## Historical Performance Context
257
-
258
- When historical execution data available (via convoy history in `.opencastle/convoy.db`), Team Lead should include compact summary in context. Example:
259
-
260
- ### Historical Performance (auto-generated)
261
- Based on {N} past convoys:
262
- - Tasks on `src/cli/` succeed 92% with Developer (avg 8min)
263
- - Recommended concurrency for {task_count} tasks: {recommended}
264
- - Agents to watch: {high_retry_agents}
265
-
266
- Use this data to make evidence-based decisions about agent assignment, concurrency, timeout settings.
267
-
259
+ Answer with the ` ```json ` block only.