opencastle 1.6.2 → 1.6.4

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 (275) hide show
  1. package/README.md +9 -9
  2. package/bin/cli.mjs +19 -12
  3. package/dist/cli/adapters/adapter-contract.test.js +1 -1
  4. package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
  5. package/dist/cli/adapters/single-file-base.js +2 -12
  6. package/dist/cli/adapters/single-file-base.js.map +1 -1
  7. package/dist/cli/add.js +7 -7
  8. package/dist/cli/add.js.map +1 -1
  9. package/dist/cli/baseline.js +6 -6
  10. package/dist/cli/baseline.js.map +1 -1
  11. package/dist/cli/bootstrap.d.ts.map +1 -1
  12. package/dist/cli/bootstrap.js +15 -6
  13. package/dist/cli/bootstrap.js.map +1 -1
  14. package/dist/cli/bootstrap.test.js +8 -0
  15. package/dist/cli/bootstrap.test.js.map +1 -1
  16. package/dist/cli/ci.d.ts.map +1 -1
  17. package/dist/cli/ci.js +19 -9
  18. package/dist/cli/ci.js.map +1 -1
  19. package/dist/cli/command-namespace.test.js +4 -21
  20. package/dist/cli/command-namespace.test.js.map +1 -1
  21. package/dist/cli/convoy/engine.js +3 -3
  22. package/dist/cli/convoy/engine.js.map +1 -1
  23. package/dist/cli/convoy/engine.test.js +1 -1
  24. package/dist/cli/convoy/engine.test.js.map +1 -1
  25. package/dist/cli/convoy/read-model.d.ts +8 -15
  26. package/dist/cli/convoy/read-model.d.ts.map +1 -1
  27. package/dist/cli/convoy/read-model.js +9 -68
  28. package/dist/cli/convoy/read-model.js.map +1 -1
  29. package/dist/cli/convoy/read-model.test.js +6 -25
  30. package/dist/cli/convoy/read-model.test.js.map +1 -1
  31. package/dist/cli/convoy/spec-builder.d.ts +2 -2
  32. package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
  33. package/dist/cli/convoy/spec-builder.js +3 -3
  34. package/dist/cli/convoy/spec-builder.js.map +1 -1
  35. package/dist/cli/convoy/spec-builder.test.js +2 -2
  36. package/dist/cli/convoy/spec-builder.test.js.map +1 -1
  37. package/dist/cli/convoy-cmd.js +16 -16
  38. package/dist/cli/convoy-cmd.js.map +1 -1
  39. package/dist/cli/convoy-cmd.test.js +11 -11
  40. package/dist/cli/convoy-cmd.test.js.map +1 -1
  41. package/dist/cli/dashboard.js +3 -3
  42. package/dist/cli/dashboard.js.map +1 -1
  43. package/dist/cli/dashboard.test.js +10 -2
  44. package/dist/cli/dashboard.test.js.map +1 -1
  45. package/dist/cli/dispatcher.test.js +7 -4
  46. package/dist/cli/dispatcher.test.js.map +1 -1
  47. package/dist/cli/docs-accuracy.test.js +5 -1
  48. package/dist/cli/docs-accuracy.test.js.map +1 -1
  49. package/dist/cli/doctor.d.ts.map +1 -1
  50. package/dist/cli/doctor.js +17 -42
  51. package/dist/cli/doctor.js.map +1 -1
  52. package/dist/cli/explain.js +2 -2
  53. package/dist/cli/explain.js.map +1 -1
  54. package/dist/cli/fleet.js +1 -1
  55. package/dist/cli/github-report.js +5 -5
  56. package/dist/cli/github-report.js.map +1 -1
  57. package/dist/cli/gitignore.js +1 -1
  58. package/dist/cli/gitignore.js.map +1 -1
  59. package/dist/cli/init.d.ts.map +1 -1
  60. package/dist/cli/init.js +27 -10
  61. package/dist/cli/init.js.map +1 -1
  62. package/dist/cli/layers.js +4 -4
  63. package/dist/cli/layers.js.map +1 -1
  64. package/dist/cli/lesson.js +12 -12
  65. package/dist/cli/lesson.js.map +1 -1
  66. package/dist/cli/lessons.d.ts.map +1 -1
  67. package/dist/cli/lessons.js +11 -7
  68. package/dist/cli/lessons.js.map +1 -1
  69. package/dist/cli/managed-block.js +1 -1
  70. package/dist/cli/managed-block.js.map +1 -1
  71. package/dist/cli/mcp-audit.js +6 -6
  72. package/dist/cli/mcp-audit.js.map +1 -1
  73. package/dist/cli/mcp-audit.test.js +5 -5
  74. package/dist/cli/mcp-audit.test.js.map +1 -1
  75. package/dist/cli/pipeline.d.ts +1 -1
  76. package/dist/cli/pipeline.flow.test.js +77 -77
  77. package/dist/cli/pipeline.flow.test.js.map +1 -1
  78. package/dist/cli/pipeline.js +30 -30
  79. package/dist/cli/pipeline.js.map +1 -1
  80. package/dist/cli/plan.d.ts +8 -2
  81. package/dist/cli/plan.d.ts.map +1 -1
  82. package/dist/cli/plan.js +18 -12
  83. package/dist/cli/plan.js.map +1 -1
  84. package/dist/cli/plan.test.js +17 -19
  85. package/dist/cli/plan.test.js.map +1 -1
  86. package/dist/cli/plugin.js +8 -8
  87. package/dist/cli/plugin.js.map +1 -1
  88. package/dist/cli/promote.js +5 -5
  89. package/dist/cli/promote.js.map +1 -1
  90. package/dist/cli/prompt.d.ts.map +1 -1
  91. package/dist/cli/prompt.js +15 -2
  92. package/dist/cli/prompt.js.map +1 -1
  93. package/dist/cli/prompt.test.js +33 -8
  94. package/dist/cli/prompt.test.js.map +1 -1
  95. package/dist/cli/remove.js +1 -1
  96. package/dist/cli/review.js +3 -3
  97. package/dist/cli/review.js.map +1 -1
  98. package/dist/cli/run/adapters/index.js +3 -3
  99. package/dist/cli/run/adapters/index.js.map +1 -1
  100. package/dist/cli/run/adapters/index.test.js +3 -3
  101. package/dist/cli/run/adapters/index.test.js.map +1 -1
  102. package/dist/cli/run/schema.js +3 -3
  103. package/dist/cli/run/schema.js.map +1 -1
  104. package/dist/cli/run.js +21 -21
  105. package/dist/cli/run.js.map +1 -1
  106. package/dist/cli/run.test.js +3 -3
  107. package/dist/cli/run.test.js.map +1 -1
  108. package/dist/cli/stack-config-update.test.js +18 -1
  109. package/dist/cli/stack-config-update.test.js.map +1 -1
  110. package/dist/cli/stack-config.d.ts.map +1 -1
  111. package/dist/cli/stack-config.js +10 -1
  112. package/dist/cli/stack-config.js.map +1 -1
  113. package/dist/cli/status.js +9 -9
  114. package/dist/cli/status.js.map +1 -1
  115. package/dist/cli/status.test.js +3 -3
  116. package/dist/cli/status.test.js.map +1 -1
  117. package/dist/cli/sync-check.js +16 -16
  118. package/dist/cli/sync-check.js.map +1 -1
  119. package/dist/cli/sync.js +1 -1
  120. package/dist/cli/team-ci.test.js +3 -3
  121. package/dist/cli/team-ci.test.js.map +1 -1
  122. package/dist/cli/team-commands.test.js +30 -1
  123. package/dist/cli/team-commands.test.js.map +1 -1
  124. package/dist/cli/update.d.ts.map +1 -1
  125. package/dist/cli/update.js +34 -66
  126. package/dist/cli/update.js.map +1 -1
  127. package/package.json +1 -1
  128. package/src/cli/adapters/adapter-contract.test.ts +1 -1
  129. package/src/cli/adapters/single-file-base.ts +2 -11
  130. package/src/cli/add.ts +7 -7
  131. package/src/cli/baseline.ts +6 -6
  132. package/src/cli/bootstrap.test.ts +9 -0
  133. package/src/cli/bootstrap.ts +16 -6
  134. package/src/cli/ci.ts +17 -9
  135. package/src/cli/command-namespace.test.ts +5 -22
  136. package/src/cli/convoy/engine.test.ts +1 -1
  137. package/src/cli/convoy/engine.ts +3 -3
  138. package/src/{orchestrator/prompts/assess-complexity.prompt.md → cli/convoy/prompts/convoy-assess.prompt.md} +0 -3
  139. package/src/{orchestrator/prompts/fix-convoy.prompt.md → cli/convoy/prompts/convoy-plan-fix.prompt.md} +0 -3
  140. package/src/{orchestrator/prompts/validate-convoy.prompt.md → cli/convoy/prompts/convoy-plan-review.prompt.md} +0 -3
  141. package/src/{orchestrator/prompts/generate-convoy.prompt.md → cli/convoy/prompts/convoy-plan.prompt.md} +0 -2
  142. package/src/{orchestrator/prompts/fix-prd.prompt.md → cli/convoy/prompts/convoy-prd-fix.prompt.md} +0 -3
  143. package/src/{orchestrator/prompts/validate-prd.prompt.md → cli/convoy/prompts/convoy-prd-review.prompt.md} +0 -3
  144. package/src/{orchestrator/prompts/generate-prd.prompt.md → cli/convoy/prompts/convoy-prd.prompt.md} +0 -3
  145. package/src/cli/convoy/read-model.test.ts +5 -29
  146. package/src/cli/convoy/read-model.ts +11 -71
  147. package/src/cli/convoy/spec-builder.test.ts +2 -2
  148. package/src/cli/convoy/spec-builder.ts +4 -4
  149. package/src/cli/convoy-cmd.test.ts +11 -11
  150. package/src/cli/convoy-cmd.ts +18 -18
  151. package/src/cli/dashboard/dashboard.js +2 -4
  152. package/src/cli/dashboard.test.ts +10 -2
  153. package/src/cli/dashboard.ts +3 -3
  154. package/src/cli/dispatcher.test.ts +8 -4
  155. package/src/cli/docs-accuracy.test.ts +5 -1
  156. package/src/cli/doctor.ts +17 -43
  157. package/src/cli/explain.ts +2 -2
  158. package/src/cli/fleet.ts +1 -1
  159. package/src/cli/github-report.ts +5 -5
  160. package/src/cli/gitignore.ts +1 -1
  161. package/src/cli/init.ts +26 -10
  162. package/src/cli/layers.ts +4 -4
  163. package/src/cli/lesson.ts +12 -12
  164. package/src/cli/lessons.ts +11 -7
  165. package/src/cli/managed-block.ts +1 -1
  166. package/src/cli/mcp-audit.test.ts +5 -5
  167. package/src/cli/mcp-audit.ts +6 -6
  168. package/src/cli/pipeline.flow.test.ts +78 -78
  169. package/src/cli/pipeline.ts +31 -31
  170. package/src/cli/plan.test.ts +18 -20
  171. package/src/cli/plan.ts +18 -12
  172. package/src/cli/plugin.ts +8 -8
  173. package/src/cli/promote.ts +5 -5
  174. package/src/cli/prompt.test.ts +41 -13
  175. package/src/cli/prompt.ts +14 -2
  176. package/src/cli/remove.ts +1 -1
  177. package/src/cli/review.ts +3 -3
  178. package/src/cli/run/adapters/index.test.ts +3 -3
  179. package/src/cli/run/adapters/index.ts +3 -3
  180. package/src/cli/run/schema.ts +3 -3
  181. package/src/cli/run.test.ts +3 -3
  182. package/src/cli/run.ts +21 -21
  183. package/src/cli/stack-config-update.test.ts +22 -1
  184. package/src/cli/stack-config.ts +9 -1
  185. package/src/cli/status.test.ts +3 -3
  186. package/src/cli/status.ts +9 -9
  187. package/src/cli/sync-check.ts +16 -16
  188. package/src/cli/sync.ts +1 -1
  189. package/src/cli/team-ci.test.ts +3 -3
  190. package/src/cli/team-commands.test.ts +32 -1
  191. package/src/cli/update.ts +32 -74
  192. package/src/orchestrator/agent-workflows/README.md +10 -18
  193. package/src/orchestrator/agent-workflows/data-pipeline.md +7 -140
  194. package/src/orchestrator/agent-workflows/database-migration.md +7 -153
  195. package/src/orchestrator/agent-workflows/performance-optimization.md +6 -119
  196. package/src/orchestrator/agent-workflows/refactoring.md +8 -137
  197. package/src/orchestrator/agent-workflows/schema-changes.md +8 -159
  198. package/src/orchestrator/agent-workflows/security-audit.md +7 -142
  199. package/src/orchestrator/agent-workflows/shared-delivery-phase.md +8 -25
  200. package/src/orchestrator/agents/architect.agent.md +2 -14
  201. package/src/orchestrator/agents/content-engineer.agent.md +8 -10
  202. package/src/orchestrator/agents/data-engineer.agent.md +8 -8
  203. package/src/orchestrator/agents/developer.agent.md +3 -10
  204. package/src/orchestrator/agents/devops-expert.agent.md +0 -3
  205. package/src/orchestrator/agents/performance-expert.agent.md +2 -3
  206. package/src/orchestrator/agents/security-expert.agent.md +10 -12
  207. package/src/orchestrator/agents/team-lead.agent.md +31 -75
  208. package/src/orchestrator/agents/testing-expert.agent.md +3 -6
  209. package/src/orchestrator/agents/ui-ux-expert.agent.md +1 -4
  210. package/src/orchestrator/agents/writer.agent.md +0 -3
  211. package/src/orchestrator/customizations/LESSONS-LEARNED.md +5 -3
  212. package/src/orchestrator/customizations/README.md +3 -4
  213. package/src/orchestrator/customizations/agents/agent-registry.md +3 -3
  214. package/src/orchestrator/customizations/agents/skill-matrix.json +6 -42
  215. package/src/orchestrator/instructions/general.instructions.md +10 -37
  216. package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +4 -6
  217. package/src/orchestrator/prompts/brainstorm.prompt.md +7 -12
  218. package/src/orchestrator/prompts/bug-fix.prompt.md +19 -100
  219. package/src/orchestrator/prompts/convoy.prompt.md +20 -0
  220. package/src/orchestrator/prompts/create-skill.prompt.md +1 -5
  221. package/src/orchestrator/prompts/implement-feature.prompt.md +22 -93
  222. package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +1 -5
  223. package/src/orchestrator/skills/api-patterns/SKILL.md +21 -18
  224. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +1 -1
  225. package/src/orchestrator/skills/fast-review/SKILL.md +28 -65
  226. package/src/orchestrator/skills/frontend-design/REFERENCE.md +0 -1
  227. package/src/orchestrator/skills/frontend-design/SKILL.md +3 -1
  228. package/src/orchestrator/skills/git-workflow/SKILL.md +18 -34
  229. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +16 -46
  230. package/src/orchestrator/skills/security-hardening/SKILL.md +20 -19
  231. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +2 -2
  232. package/src/orchestrator/skills/self-improvement/SKILL.md +21 -46
  233. package/src/orchestrator/skills/technical-writing/SKILL.md +3 -1
  234. package/src/orchestrator/skills/technical-writing/TEMPLATES.md +23 -0
  235. package/src/orchestrator/skills/testing-workflow/SKILL.md +21 -23
  236. package/src/orchestrator/skills/validation-gates/REFERENCE.md +2 -14
  237. package/src/orchestrator/skills/validation-gates/SKILL.md +10 -88
  238. package/dist/cli/log.d.ts +0 -44
  239. package/dist/cli/log.d.ts.map +0 -1
  240. package/dist/cli/log.js +0 -336
  241. package/dist/cli/log.js.map +0 -1
  242. package/dist/cli/log.test.d.ts +0 -2
  243. package/dist/cli/log.test.d.ts.map +0 -1
  244. package/dist/cli/log.test.js +0 -208
  245. package/dist/cli/log.test.js.map +0 -1
  246. package/src/cli/log.test.ts +0 -228
  247. package/src/cli/log.ts +0 -374
  248. package/src/orchestrator/agent-workflows/bug-fix.md +0 -130
  249. package/src/orchestrator/agent-workflows/feature-implementation.md +0 -232
  250. package/src/orchestrator/instructions/ai-optimization.instructions.md +0 -17
  251. package/src/orchestrator/prompts/quick-refinement.prompt.md +0 -110
  252. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +0 -44
  253. package/src/orchestrator/skills/agent-hooks/SKILL.md +0 -80
  254. package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +0 -49
  255. package/src/orchestrator/skills/agent-memory/SKILL.md +0 -50
  256. package/src/orchestrator/skills/code-commenting/SKILL.md +0 -18
  257. package/src/orchestrator/skills/context-map/REFERENCE.md +0 -67
  258. package/src/orchestrator/skills/context-map/SKILL.md +0 -71
  259. package/src/orchestrator/skills/decomposition/SKILL.md +0 -103
  260. package/src/orchestrator/skills/documentation-standards/SKILL.md +0 -33
  261. package/src/orchestrator/skills/fast-review/REFERENCE.md +0 -28
  262. package/src/orchestrator/skills/memory-merger/SKILL.md +0 -77
  263. package/src/orchestrator/skills/observability-logging/LOG-SCHEMA.md +0 -238
  264. package/src/orchestrator/skills/observability-logging/SKILL.md +0 -73
  265. package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +0 -38
  266. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +0 -120
  267. package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +0 -49
  268. package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +0 -38
  269. package/src/orchestrator/skills/performance-optimization/SKILL.md +0 -23
  270. package/src/orchestrator/skills/project-consistency/SKILL.md +0 -80
  271. package/src/orchestrator/skills/project-consistency/TEMPLATES.md +0 -35
  272. package/src/orchestrator/skills/react-development/SKILL.md +0 -24
  273. package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +0 -56
  274. package/src/orchestrator/skills/session-checkpoints/SKILL.md +0 -40
  275. package/src/orchestrator/skills/team-lead-reference/SKILL.md +0 -126
@@ -30,23 +30,21 @@ describe('fillTemplate', () => {
30
30
  })
31
31
  })
32
32
 
33
- // `pipeline`: only the CLI runs it. generate-convoy is the exception, as the
34
- // Team Lead also plans in the editor by its rules.
35
33
  const PLANNER = {
36
- 'generate-prd': { output: 'prd', context: false, pipeline: true },
37
- 'validate-prd': { output: 'validation', context: false, pipeline: true },
38
- 'fix-prd': { output: 'prd', context: true, pipeline: true },
39
- 'assess-complexity': { output: 'json', context: true, pipeline: true },
40
- 'generate-convoy': { output: 'json', context: true, pipeline: false },
41
- 'validate-convoy': { output: 'validation', context: false, pipeline: true },
42
- 'fix-convoy': { output: 'json', context: true, pipeline: true },
34
+ 'convoy-prd': { output: 'prd', context: false },
35
+ 'convoy-prd-review': { output: 'validation', context: false },
36
+ 'convoy-prd-fix': { output: 'prd', context: true },
37
+ 'convoy-assess': { output: 'json', context: true },
38
+ 'convoy-plan': { output: 'json', context: true },
39
+ 'convoy-plan-review': { output: 'validation', context: false },
40
+ 'convoy-plan-fix': { output: 'json', context: true },
43
41
  } as const
44
42
 
45
43
  describe('the planner templates', () => {
46
44
  it.each(Object.entries(PLANNER))('%s keeps its frontmatter and fills each input once', (name, expected) => {
47
45
  const text = readFileSync(templatePath(pkgRoot, name), 'utf8')
48
46
  const fm = parseFrontmatter(text)
49
- expect(Object.keys(fm).sort()).toEqual(['agent', 'description', 'output', ...(expected.pipeline ? ['pipeline'] : [])])
47
+ expect(Object.keys(fm).sort()).toEqual(['agent', 'description', 'output'])
50
48
  expect(fm.output).toBe(expected.output)
51
49
 
52
50
  // Exactly one slot per input, and no other mention that a fill could reach.
@@ -140,7 +138,7 @@ describe('runPromptStep', () => {
140
138
 
141
139
  it('runs read-only, in the project, as the template agent', async () => {
142
140
  const { adapter, seen } = adapterAnswering('```json\n{"valid": true}\n```')
143
- const result = await runPromptStep({ template: 'validate-prd', goalText: '# PRD', adapter, pkgRoot, cwd })
141
+ const result = await runPromptStep({ template: 'convoy-prd-review', goalText: '# PRD', adapter, pkgRoot, cwd })
144
142
  expect(result.isValid).toBe(true)
145
143
  expect(seen[0].options).toMatchObject({ permissionMode: 'plan', cwd })
146
144
  expect(seen[0].task.agent).toBe('reviewer')
@@ -150,45 +148,45 @@ describe('runPromptStep', () => {
150
148
  it('writes the plan on the standard tier and checks it on economy, when the runtime has tier models', async () => {
151
149
  const { adapter, seen } = adapterAnswering('```json\n{"valid": true}\n```')
152
150
  adapter.tierModels = { premium: 'opus', standard: 'sonnet', economy: 'haiku' }
153
- await runPromptStep({ template: 'validate-prd', goalText: '# PRD', adapter, pkgRoot, cwd })
154
- await runPromptStep({ template: 'generate-prd', goalText: 'add tags', adapter, pkgRoot, cwd })
151
+ await runPromptStep({ template: 'convoy-prd-review', goalText: '# PRD', adapter, pkgRoot, cwd })
152
+ await runPromptStep({ template: 'convoy-prd', goalText: 'add tags', adapter, pkgRoot, cwd })
155
153
  expect(seen[0].options?.model).toBe('haiku')
156
154
  expect(seen[1].options?.model).toBe('sonnet')
157
155
  })
158
156
 
159
157
  it('passes no model when the runtime has none for its tiers', async () => {
160
158
  const { adapter, seen } = adapterAnswering('```json\n{"valid": true}\n```')
161
- await runPromptStep({ template: 'validate-prd', goalText: '# PRD', adapter, pkgRoot, cwd })
159
+ await runPromptStep({ template: 'convoy-prd-review', goalText: '# PRD', adapter, pkgRoot, cwd })
162
160
  expect(seen[0].options).not.toHaveProperty('model')
163
161
  })
164
162
 
165
163
  it('names a Team Lead step by its slug', async () => {
166
164
  const { adapter, seen } = adapterAnswering('```json\n[]\n```')
167
- await runPromptStep({ template: 'fix-convoy', goalText: '{}', contextText: '- x', adapter, pkgRoot, cwd })
165
+ await runPromptStep({ template: 'convoy-plan-fix', goalText: '{}', contextText: '- x', adapter, pkgRoot, cwd })
168
166
  expect(seen[0].task.agent).toBe('team-lead')
169
167
  })
170
168
 
171
169
  it('writes a PRD to a new file under .opencastle/prds', async () => {
172
170
  const { adapter } = adapterAnswering('Sure!\n# Dark Mode — PRD\n\n## Overview\n\nText.')
173
- const first = await runPromptStep({ template: 'generate-prd', goalText: 'dark mode', adapter, pkgRoot, cwd })
171
+ const first = await runPromptStep({ template: 'convoy-prd', goalText: 'dark mode', adapter, pkgRoot, cwd })
174
172
  expect(first.outputPath).toBe(join(cwd, '.opencastle', 'prds', 'dark-mode.prd.md'))
175
173
  expect(readFileSync(first.outputPath!, 'utf8')).toBe('# Dark Mode — PRD\n\n## Overview\n\nText.\n')
176
- const second = await runPromptStep({ template: 'generate-prd', goalText: 'dark mode', adapter, pkgRoot, cwd })
174
+ const second = await runPromptStep({ template: 'convoy-prd', goalText: 'dark mode', adapter, pkgRoot, cwd })
177
175
  expect(second.outputPath).toBe(join(cwd, '.opencastle', 'prds', 'dark-mode-2.prd.md'))
178
176
  expect(existsSync(first.outputPath!)).toBe(true)
179
177
  })
180
178
 
181
179
  it('reports an adapter failure with its output', async () => {
182
180
  const { adapter } = adapterAnswering('auth expired', false)
183
- await expect(runPromptStep({ template: 'validate-prd', goalText: 'x', adapter, pkgRoot, cwd })).rejects.toThrow(
184
- /stub failed on validate-prd \(exit code 2\)[\s\S]*auth expired/,
181
+ await expect(runPromptStep({ template: 'convoy-prd-review', goalText: 'x', adapter, pkgRoot, cwd })).rejects.toThrow(
182
+ /stub failed on convoy-prd-review \(exit code 2\)[\s\S]*auth expired/,
185
183
  )
186
184
  })
187
185
 
188
186
  it('stops a session that runs too long', async () => {
189
187
  const { adapter, kill } = adapterAnswering(() => new Promise<never>(() => {}))
190
188
  await expect(
191
- runPromptStep({ template: 'validate-prd', goalText: 'x', adapter, pkgRoot, cwd, timeoutMs: 20 }),
189
+ runPromptStep({ template: 'convoy-prd-review', goalText: 'x', adapter, pkgRoot, cwd, timeoutMs: 20 }),
192
190
  ).rejects.toThrow(/ran longer than/)
193
191
  expect(kill).toHaveBeenCalledTimes(1)
194
192
  })
package/src/cli/plan.ts CHANGED
@@ -98,15 +98,21 @@ export function parseFrontmatter(text: string): Record<string, string> {
98
98
  return result
99
99
  }
100
100
 
101
+ /**
102
+ * A planning step's template. They live with the engine, not among the
103
+ * prompts every assistant is given: only the planner runs them, with their
104
+ * input filled in, and as `/oc:` commands they were seven menu entries nobody
105
+ * should pick.
106
+ */
101
107
  export function templatePath(pkgRoot: string, name: string): string {
102
- return join(pkgRoot, 'src', 'orchestrator', 'prompts', `${name}.prompt.md`)
108
+ return join(pkgRoot, 'src', 'cli', 'convoy', 'prompts', `${name}.prompt.md`)
103
109
  }
104
110
 
105
111
  /**
106
112
  * Put the inputs into a template.
107
113
  *
108
114
  * A placeholder is filled only where it stands on a line of its own. The
109
- * instructions in generate-convoy mentioned `{{goal}}` and `{{context}}` in
115
+ * instructions in convoy-plan mentioned `{{goal}}` and `{{context}}` in
110
116
  * passing, and a global replace pasted the whole PRD into those sentences as
111
117
  * well, so every plan carried its PRD twice.
112
118
  *
@@ -154,7 +160,7 @@ function extractMarkdownBody(output: string): string {
154
160
  /**
155
161
  * The JSON in an answer: the last ```json fence if there is one, else the whole
156
162
  * answer. A missing fence used to abort the plan outright, before the one
157
- * retry generate-convoy is allowed; now the parser downstream sees the text and
163
+ * retry convoy-plan is allowed; now the parser downstream sees the text and
158
164
  * reports why it is not a plan.
159
165
  */
160
166
  export function extractJson(output: string): string {
@@ -223,13 +229,13 @@ function prdStem(content: string): string {
223
229
  const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
224
230
 
225
231
  const TEMPLATE_MESSAGES: Record<string, string> = {
226
- 'generate-prd': 'Writing the PRD',
227
- 'validate-prd': 'Checking the PRD',
228
- 'fix-prd': 'Fixing the PRD',
229
- 'assess-complexity': 'Sizing the work',
230
- 'generate-convoy': 'Breaking it into tasks',
231
- 'validate-convoy': 'Reviewing the plan',
232
- 'fix-convoy': 'Fixing the plan',
232
+ 'convoy-prd': 'Writing the PRD',
233
+ 'convoy-prd-review': 'Checking the PRD',
234
+ 'convoy-prd-fix': 'Fixing the PRD',
235
+ 'convoy-assess': 'Sizing the work',
236
+ 'convoy-plan': 'Breaking it into tasks',
237
+ 'convoy-plan-review': 'Reviewing the plan',
238
+ 'convoy-plan-fix': 'Fixing the plan',
233
239
  }
234
240
 
235
241
  /**
@@ -277,7 +283,7 @@ function startProgress(templateName: string): () => void {
277
283
  * standard tier; checking and sizing them is a short read, so it gets economy.
278
284
  */
279
285
  function modelFor(adapter: AgentAdapter, template: string): string | undefined {
280
- const tier = /^(validate-|assess-)/.test(template) ? 'economy' : 'standard'
286
+ const tier = /-review$|^convoy-assess$/.test(template) ? 'economy' : 'standard'
281
287
  return adapter.tierModels?.[tier]
282
288
  }
283
289
 
@@ -291,7 +297,7 @@ function modelFor(adapter: AgentAdapter, template: string): string | undefined {
291
297
  * sizing, the PRD, the checks and the fixes get `low`.
292
298
  */
293
299
  export function effortFor(template: string): 'low' | 'medium' {
294
- return template === 'generate-convoy' ? 'medium' : 'low'
300
+ return template === 'convoy-plan' ? 'medium' : 'low'
295
301
  }
296
302
 
297
303
  /**
package/src/cli/plugin.ts CHANGED
@@ -25,7 +25,7 @@ import type { CliContext } from './types.js'
25
25
  */
26
26
 
27
27
  const HELP = `
28
- opencastle plugin <check|build|index> [dir] [options]
28
+ npx opencastle plugin <check|build|index> [dir] [options]
29
29
 
30
30
  Agent Plugins 1.0 is the open package format for skills and MCP servers
31
31
  (agent-plugins.org): plugin.json, skills/<name>/SKILL.md and mcp.json.
@@ -170,7 +170,7 @@ function listPlugins(root: string): { plugins: Listed[]; problems: string[] } {
170
170
  const at = join(dir, entry)
171
171
  if (!existsSync(join(at, 'plugin.json'))) continue
172
172
  if (!isAgentPlugin(at)) {
173
- problems.push(`plugins/${entry}: plugin.json does not declare an Agent Plugins version — run opencastle plugin check plugins/${entry}`)
173
+ problems.push(`plugins/${entry}: plugin.json does not declare an Agent Plugins version — run npx opencastle plugin check plugins/${entry}`)
174
174
  continue
175
175
  }
176
176
  const report = readAgentPlugin(at)
@@ -214,15 +214,15 @@ function printReport(dir: string, report: PluginReport, claudeStale: string[]):
214
214
  console.log(` Skills: ${report.skills.length > 0 ? report.skills.join(', ') : c.dim('none')}`)
215
215
  console.log(` MCP servers: ${Object.keys(report.servers).length > 0 ? Object.keys(report.servers).join(', ') : c.dim('none')}`)
216
216
  if (existsSync(join(report.root, EXTENSION_NAMESPACE))) {
217
- console.log(` ${EXTENSION_NAMESPACE}/: ${c.dim('OpenCastle content — check it with opencastle baseline check')}`)
217
+ console.log(` ${EXTENSION_NAMESPACE}/: ${c.dim('OpenCastle content — check it with npx opencastle baseline check')}`)
218
218
  }
219
219
  }
220
220
  for (const e of report.errors) console.log(` ${c.red('✗')} ${e}`)
221
- for (const s of claudeStale) console.log(` ${c.red('✗')} ${s} does not match plugin.json and mcp.json ${c.dim('— run opencastle plugin build')}`)
221
+ for (const s of claudeStale) console.log(` ${c.red('✗')} ${s} does not match plugin.json and mcp.json ${c.dim('— run npx opencastle plugin build')}`)
222
222
  for (const w of report.warnings) console.log(` ${c.yellow('!')} ${c.dim(w)}`)
223
223
  if (report.errors.length === 0 && claudeStale.length === 0) {
224
224
  console.log(`\n ${c.green('✓')} Loads in GitHub Copilot, VS Code, Cursor, Codex and Kiro as it is` +
225
- (existsSync(join(report.root, '.claude-plugin', 'plugin.json')) ? ', and in Claude Code.\n' : `.\n ${c.dim('Run opencastle plugin build to add the files Claude Code reads.')}\n`))
225
+ (existsSync(join(report.root, '.claude-plugin', 'plugin.json')) ? ', and in Claude Code.\n' : `.\n ${c.dim('Run npx opencastle plugin build to add the files Claude Code reads.')}\n`))
226
226
  } else {
227
227
  console.log(`\n ${c.red(`${report.errors.length + claudeStale.length} problem(s) to fix.`)}\n`)
228
228
  }
@@ -268,7 +268,7 @@ export default async function plugin({ args }: CliContext): Promise<void> {
268
268
  const changed = apply(root, claudeFiles(root, report), check)
269
269
  if (check) {
270
270
  if (changed.length > 0) {
271
- for (const f of changed) console.error(` ${c.red('✗')} ${f} does not match plugin.json and mcp.json — run opencastle plugin build`)
271
+ for (const f of changed) console.error(` ${c.red('✗')} ${f} does not match plugin.json and mcp.json — run npx opencastle plugin build`)
272
272
  process.exit(1)
273
273
  }
274
274
  console.log(` ${c.green('✓')} Claude Code's files match plugin.json and mcp.json`)
@@ -291,7 +291,7 @@ export default async function plugin({ args }: CliContext): Promise<void> {
291
291
  const noClaude = plugins.filter((p) => !p.claude)
292
292
  if (check) {
293
293
  if (changed.length > 0) {
294
- for (const f of changed) console.error(` ${c.red('✗')} ${f} does not list the plugins under plugins/ — run opencastle plugin index`)
294
+ for (const f of changed) console.error(` ${c.red('✗')} ${f} does not list the plugins under plugins/ — run npx opencastle plugin index`)
295
295
  process.exit(1)
296
296
  }
297
297
  console.log(` ${c.green('✓')} The marketplace files list all ${plugins.length} plugin(s)`)
@@ -303,7 +303,7 @@ export default async function plugin({ args }: CliContext): Promise<void> {
303
303
  : ` ${c.green('✓')} The marketplace files already list all ${plugins.length} plugin(s)`,
304
304
  )
305
305
  if (noClaude.length > 0) {
306
- console.log(` ${c.yellow('!')} ${noClaude.map((p) => `plugins/${p.dir}`).join(', ')} ${c.dim('— Claude Code needs .claude-plugin/plugin.json; run opencastle plugin build in each')}`)
306
+ console.log(` ${c.yellow('!')} ${noClaude.map((p) => `plugins/${p.dir}`).join(', ')} ${c.dim('— Claude Code needs .claude-plugin/plugin.json; run npx opencastle plugin build in each')}`)
307
307
  }
308
308
  console.log(` ${c.dim(`Add it: claude plugin marketplace add <owner>/<repo>, copilot plugin marketplace add <owner>/<repo>, codex plugin marketplace add <owner>/<repo>; in Cursor, Dashboard → Plugins → Team Marketplaces → Import.`)}`)
309
309
  }
@@ -30,7 +30,7 @@ import type { CliContext } from './types.js'
30
30
  */
31
31
 
32
32
  const HELP = `
33
- opencastle promote <skill|memory> [name|path] [options]
33
+ npx opencastle promote <skill|memory> [name|path] [options]
34
34
 
35
35
  Make what one person's assistant learned the team's: copy it into the
36
36
  team's sources, where the next sync compiles it into every assistant.
@@ -172,7 +172,7 @@ function promoteSkill(pkgRoot: string, args: string[], dryRun: boolean): void {
172
172
  const to = flag(args, '--to')
173
173
  const projectRoot = projectRootFrom(cwd)
174
174
  const destSkills = to ? skillsDirOf(resolve(cwd, to)) : join(projectRoot, '.opencastle', 'skills')
175
- if (!to && !existsSync(join(projectRoot, '.opencastle'))) fail('no .opencastle/ here — run opencastle init first, or promote it into a baseline with --to <dir>')
175
+ if (!to && !existsSync(join(projectRoot, '.opencastle'))) fail('no .opencastle/ here — run npx opencastle init first, or promote it into a baseline with --to <dir>')
176
176
  const dest = join(destSkills, name)
177
177
  const shown = relative(cwd, dest) || '.'
178
178
  if (existsSync(dest) && !args.includes('--force')) {
@@ -190,8 +190,8 @@ function promoteSkill(pkgRoot: string, args: string[], dryRun: boolean): void {
190
190
  if (core) console.log(` ${c.yellow('!')} OpenCastle ships a skill of that name; this one replaces it for everyone it reaches`)
191
191
  console.log(
192
192
  to
193
- ? ` ${c.dim('Next:')} ${c.cyan(`opencastle baseline check ${relative(cwd, resolve(cwd, to)) || '.'}`)}${c.dim(', then publish a new version.')}\n`
194
- : ` ${c.dim('Next:')} ${c.cyan('opencastle sync')} ${c.dim('compiles it into every assistant; commit it, and the pull request is where the team agrees.')}\n`,
193
+ ? ` ${c.dim('Next:')} ${c.cyan(`npx opencastle baseline check ${relative(cwd, resolve(cwd, to)) || '.'}`)}${c.dim(', then publish a new version.')}\n`
194
+ : ` ${c.dim('Next:')} ${c.cyan('npx opencastle sync')} ${c.dim('compiles it into every assistant; commit it, and the pull request is where the team agrees.')}\n`,
195
195
  )
196
196
  }
197
197
 
@@ -284,7 +284,7 @@ function titleOf(memory: Memory): string {
284
284
  function promoteMemory(args: string[], dryRun: boolean): void {
285
285
  const projectRoot = projectRootFrom(process.cwd())
286
286
  const customizations = join(projectRoot, '.opencastle')
287
- if (!existsSync(customizations)) fail('no .opencastle/ here — run opencastle init first')
287
+ if (!existsSync(customizations)) fail('no .opencastle/ here — run npx opencastle init first')
288
288
  const from = flag(args, '--from')
289
289
  const dir = from ? resolve(process.cwd(), from.replace(/^~(?=\/|$)/, home())) : claudeMemoryDir(projectRoot)
290
290
  if (!existsSync(dir)) {
@@ -1,4 +1,4 @@
1
- import { describe, it, expect, afterEach } from 'vitest';
1
+ import { describe, it, expect, afterEach, beforeEach } from 'vitest';
2
2
  import { computeVisibleWindow, c } from './prompt.js';
3
3
 
4
4
  describe('computeVisibleWindow', () => {
@@ -66,20 +66,48 @@ describe('computeVisibleWindow', () => {
66
66
  });
67
67
 
68
68
  describe('colours', () => {
69
- const saved = process.env.NO_COLOR;
69
+ const saved = { NO_COLOR: process.env.NO_COLOR, FORCE_COLOR: process.env.FORCE_COLOR, TERM: process.env.TERM }
70
+ const tty = process.stdout.isTTY
71
+ const setTty = (v: boolean | undefined) => Object.defineProperty(process.stdout, 'isTTY', { value: v, configurable: true })
72
+ beforeEach(() => {
73
+ delete process.env.NO_COLOR
74
+ delete process.env.FORCE_COLOR
75
+ delete process.env.TERM
76
+ })
70
77
  afterEach(() => {
71
- if (saved === undefined) delete process.env.NO_COLOR;
72
- else process.env.NO_COLOR = saved;
73
- });
78
+ for (const [k, v] of Object.entries(saved)) {
79
+ if (v === undefined) delete process.env[k]
80
+ else process.env[k] = v
81
+ }
82
+ setTty(tty)
83
+ })
74
84
 
75
- it('wrap text in an SGR sequence by default', () => {
76
- delete process.env.NO_COLOR;
77
- expect(c.green('ok')).toBe('\x1B[32mok\x1B[0m');
78
- });
85
+ it('wrap text in an SGR sequence on a terminal', () => {
86
+ setTty(true)
87
+ expect(c.green('ok')).toBe('\x1B[32mok\x1B[0m')
88
+ })
89
+
90
+ it('are left out when output is piped or redirected', () => {
91
+ setTty(false)
92
+ expect(c.green('ok')).toBe('ok')
93
+ })
94
+
95
+ it('are left out on a terminal that says it cannot show them', () => {
96
+ setTty(true)
97
+ process.env.TERM = 'dumb'
98
+ expect(c.green('ok')).toBe('ok')
99
+ })
79
100
 
80
101
  it('are left out when NO_COLOR is set (no-color.org)', () => {
81
- process.env.NO_COLOR = '1';
82
- expect(c.green('ok')).toBe('ok');
83
- expect(c.bold(c.dim('x'))).toBe('x');
84
- });
102
+ setTty(true)
103
+ process.env.NO_COLOR = '1'
104
+ expect(c.green('ok')).toBe('ok')
105
+ expect(c.bold(c.dim('x'))).toBe('x')
106
+ })
107
+
108
+ it('are put back anywhere by FORCE_COLOR', () => {
109
+ setTty(false)
110
+ process.env.FORCE_COLOR = '1'
111
+ expect(c.green('ok')).toBe('\x1B[32mok\x1B[0m')
112
+ })
85
113
  });
package/src/cli/prompt.ts CHANGED
@@ -16,9 +16,21 @@ function moveUp(n: number): string {
16
16
 
17
17
  // ── Color helpers ─────────────────────────────────────────────────
18
18
 
19
- /** One SGR style, unless `NO_COLOR` is set (https://no-color.org). Read per call, so a test can set it. */
19
+ /**
20
+ * Whether to colour output: on a terminal, unless `NO_COLOR` is set
21
+ * (https://no-color.org) or `TERM=dumb`; `FORCE_COLOR` turns it on anywhere.
22
+ * Piped or redirected output was coloured too, so a log file or `| grep` got
23
+ * escape codes. Read per call, so a test can set it.
24
+ */
25
+ function colourOn(): boolean {
26
+ if (process.env.NO_COLOR) return false;
27
+ if (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== '0') return true;
28
+ return Boolean(process.stdout.isTTY) && process.env.TERM !== 'dumb';
29
+ }
30
+
31
+ /** One SGR style, when output is coloured at all. */
20
32
  const sgr = (code: string) => (s: string) =>
21
- process.env.NO_COLOR ? s : `\x1B[${code}m${s}\x1B[0m`;
33
+ colourOn() ? `\x1B[${code}m${s}\x1B[0m` : s;
22
34
 
23
35
  /** ANSI color helpers for CLI output. */
24
36
  export const c = {
package/src/cli/remove.ts CHANGED
@@ -25,7 +25,7 @@ import { parseMcpConfigText } from './mcp-file.js'
25
25
  */
26
26
 
27
27
  const REMOVE_HELP = `
28
- opencastle remove [options]
28
+ npx opencastle remove [options]
29
29
 
30
30
  Remove OpenCastle from this project. Asks whether to keep the generated
31
31
  files (so they become standalone) or delete everything.
package/src/cli/review.ts CHANGED
@@ -21,7 +21,7 @@ import type { CliContext } from './types.js'
21
21
  */
22
22
 
23
23
  const HELP = `
24
- opencastle review [options]
24
+ npx opencastle review [options]
25
25
 
26
26
  Explain what a change to the AI assistant config does: which skills, agents,
27
27
  instructions and MCP servers every assistant gains, loses or gets changed,
@@ -342,7 +342,7 @@ export function reviewMarkdown(report: ReviewReport): string {
342
342
  function renderTerminal(report: ReviewReport): void {
343
343
  console.log(`\n 🏰 ${c.bold('OpenCastle review')} ${c.dim(`— compared with ${report.base}`)}\n`)
344
344
  if (report.staleLock) {
345
- console.log(` ${c.yellow('!')} ${LOCK_REL} is not what the sources compile to — run ${c.cyan('opencastle sync')}\n`)
345
+ console.log(` ${c.yellow('!')} ${LOCK_REL} is not what the sources compile to — run ${c.cyan('npx opencastle sync')}\n`)
346
346
  }
347
347
  if (report.lines.length === 0) {
348
348
  console.log(` ${c.green('✓')} No change to what any assistant is given.\n`)
@@ -398,7 +398,7 @@ export function lockAtRef(projectRoot: string, ref: string): Lock | null {
398
398
  /** What the sources compile to now, as a lock; or the committed one if they do not resolve. */
399
399
  async function headLock(pkgRoot: string, projectRoot: string): Promise<{ lock: Lock; stale: boolean }> {
400
400
  const manifest = await readManifest(projectRoot)
401
- if (!manifest) throw new Error('OpenCastle is not set up here — run opencastle init')
401
+ if (!manifest) throw new Error('OpenCastle is not set up here — run npx opencastle init')
402
402
  refuseOlderCli(pkgRoot, manifest.version)
403
403
  const ides = (manifest.ides?.length ? manifest.ides : [manifest.ide]).filter(Boolean)
404
404
  const stack = resolveStack({ ...manifest, ides })
@@ -70,7 +70,7 @@ describe.skipIf(process.platform === 'win32')('resolveAdapter', () => {
70
70
  const projectRoot = setup(['claude', 'copilot'], { ides: ['vscode', 'claude-code'] })
71
71
  const r = await resolveAdapter({ projectRoot })
72
72
  expect(r).toMatchObject({ name: 'copilot', source: 'configured' })
73
- expect(r.detail).toBe('GitHub Copilot CLI — configured by opencastle init')
73
+ expect(r.detail).toBe('GitHub Copilot CLI — configured by npx opencastle init')
74
74
  })
75
75
 
76
76
  it('walks the configured assistants in order, saying which came first but is missing', async () => {
@@ -96,7 +96,7 @@ describe.skipIf(process.platform === 'win32')('resolveAdapter', () => {
96
96
  const projectRoot = setup(['codex'], { ides: ['claude-code'] })
97
97
  const r = await resolveAdapter({ projectRoot })
98
98
  expect(r).toMatchObject({ name: 'codex', source: 'detected' })
99
- expect(r.detail).toContain('opencastle init configured Claude Code, but `claude` is not on PATH')
99
+ expect(r.detail).toContain('npx opencastle init configured Claude Code, but `claude` is not on PATH')
100
100
  })
101
101
 
102
102
  it('detects in the order claude, codex, cursor, opencode, copilot', async () => {
@@ -115,7 +115,7 @@ describe.skipIf(process.platform === 'win32')('resolveAdapter', () => {
115
115
  it('does not count Copilot unless its CLI is on PATH, though its SDK is installed here', async () => {
116
116
  const projectRoot = setup([], { ides: ['vscode'] })
117
117
  const err = await resolveAdapter({ projectRoot }).catch((e: Error) => e)
118
- expect((err as Error).message).toContain('opencastle init configured GitHub Copilot CLI, but no agent CLI is on PATH')
118
+ expect((err as Error).message).toContain('npx opencastle init configured GitHub Copilot CLI, but no agent CLI is on PATH')
119
119
  expect((err as Error).message).toContain('npm install -g @github/copilot')
120
120
  })
121
121
 
@@ -148,7 +148,7 @@ export async function resolveAdapter(opts: {
148
148
  const also = notInstalled.length
149
149
  ? ` (${notInstalled.map((n) => RUNTIMES[n].label).join(', ')} came first but ${notInstalled.length === 1 ? 'is' : 'are'} not installed)`
150
150
  : ''
151
- return { name, adapter, source: 'configured', detail: `${RUNTIMES[name].label} — configured by opencastle init${also}` }
151
+ return { name, adapter, source: 'configured', detail: `${RUNTIMES[name].label} — configured by npx opencastle init${also}` }
152
152
  }
153
153
  notInstalled.push(name)
154
154
  }
@@ -158,7 +158,7 @@ export async function resolveAdapter(opts: {
158
158
  if (await adapter.isAvailable()) {
159
159
  const notes: string[] = []
160
160
  if (notInstalled.length) {
161
- notes.push(`opencastle init configured ${notInstalled.map((n) => RUNTIMES[n].label).join(' and ')}, but \`${notInstalled.map((n) => RUNTIMES[n].command).join('`, `')}\` is not on PATH`)
161
+ notes.push(`npx opencastle init configured ${notInstalled.map((n) => RUNTIMES[n].label).join(' and ')}, but \`${notInstalled.map((n) => RUNTIMES[n].command).join('`, `')}\` is not on PATH`)
162
162
  }
163
163
  if (noRuntime.length) notes.push(`${noRuntime.join(' and ')} has no command-line agent`)
164
164
  return {
@@ -172,7 +172,7 @@ export async function resolveAdapter(opts: {
172
172
 
173
173
  if (notInstalled.length) {
174
174
  throw new Error(
175
- `opencastle init configured ${notInstalled.map((n) => RUNTIMES[n].label).join(' and ')}, but no agent CLI is on PATH.\n` +
175
+ `npx opencastle init configured ${notInstalled.map((n) => RUNTIMES[n].label).join(' and ')}, but no agent CLI is on PATH.\n` +
176
176
  notInstalled.map((n) => ` ${RUNTIMES[n].label}: ${RUNTIMES[n].install}`).join('\n') +
177
177
  `\n Or install another runtime and pick it with --adapter <${NAMES.replace(/, /g, '|')}>.`,
178
178
  )
@@ -135,12 +135,12 @@ const RETIRED_DEFAULTS: Record<string, string> = {
135
135
  snippets: 'snippets were folded into skills',
136
136
  detect_drift: 'drift detection was removed; reviews and gates check the work instead',
137
137
  review_stages: 'the two-stage review was removed; `review` picks one fast review or a panel',
138
- mcp_approve_all: 'agents use the MCP servers and approvals in the project\'s own config, which `opencastle sync` writes',
138
+ mcp_approve_all: 'agents use the MCP servers and approvals in the project\'s own config, which `npx opencastle sync` writes',
139
139
  }
140
140
 
141
141
  /** Top-level and per-task keys retired the same way. */
142
142
  const RETIRED_SPEC_KEYS: Record<string, string> = {
143
- watch: 'watch mode was removed; run the spec again, or `opencastle convoy resume` to continue one',
143
+ watch: 'watch mode was removed; run the spec again, or `npx opencastle convoy resume` to continue one',
144
144
  }
145
145
  const RETIRED_TASK_KEYS: Record<string, string> = {
146
146
  detect_drift: 'drift detection was removed; reviews and gates check the work instead',
@@ -149,7 +149,7 @@ const RETIRED_TASK_KEYS: Record<string, string> = {
149
149
  /** What a version 2 (chained) spec is told to do instead. */
150
150
  const CHAIN_REPLACEMENT =
151
151
  'put every task in one version 1 spec and let `depends_on` order them — tasks that do not ' +
152
- 'depend on each other run in parallel. `opencastle convoy "<task>"` plans large work that way.'
152
+ 'depend on each other run in parallel. `npx opencastle convoy "<task>"` plans large work that way.'
153
153
 
154
154
  /**
155
155
  * Every key under `defaults` that something reads.
@@ -79,7 +79,7 @@ describe('parseRunArgs', () => {
79
79
  it('gives resume no spec, and says so for a stray word', () => {
80
80
  expect(parseRunArgs(['--dry-run'], 'resume')).toEqual(args({ dryRun: true }))
81
81
  expect((parseRunArgs(['task-1'], 'resume') as { error: string }).error).toMatch(/takes no name/)
82
- expect(parseRunArgs(['-f', 'a.yml'], 'resume')).toEqual({ error: '-f belongs to opencastle convoy run' })
82
+ expect(parseRunArgs(['-f', 'a.yml'], 'resume')).toEqual({ error: '-f belongs to npx opencastle convoy run' })
83
83
  })
84
84
  })
85
85
 
@@ -270,7 +270,7 @@ tasks:
270
270
  WRITE two.txt second
271
271
  `)
272
272
  expect(await runSpec(args({ spec }))).toBe(1)
273
- expect(text()).toMatch(/Resume with: opencastle convoy resume/)
273
+ expect(text()).toMatch(/Resume with: npx opencastle convoy resume/)
274
274
 
275
275
  rmSync(flag)
276
276
  out.length = 0
@@ -346,6 +346,6 @@ describe('convoy resume', () => {
346
346
  db.close()
347
347
  expect(await resumeLast(args())).toBe(1)
348
348
  expect(text()).toMatch(/is still running in another process/)
349
- expect(text()).toContain('opencastle convoy dashboard')
349
+ expect(text()).toContain('npx opencastle convoy dashboard')
350
350
  })
351
351
  })
package/src/cli/run.ts CHANGED
@@ -25,23 +25,23 @@ import type { TaskSpec } from './convoy/spec-types.js'
25
25
  import type { CliContext } from './types.js'
26
26
 
27
27
  const RUN_HELP = `
28
- opencastle convoy run <spec.yml> [options]
28
+ npx opencastle convoy run <spec.yml> [options]
29
29
 
30
- Run a convoy spec: one you wrote, or one opencastle convoy "<task>" wrote to
30
+ Run a convoy spec: one you wrote, or one npx opencastle convoy "<task>" wrote to
31
31
  .opencastle/convoys/. The work lands on a branch of its own (the spec's
32
32
  branch, or convoy/<name>-<id>); your checkout is never touched.
33
33
 
34
34
  Options:
35
35
  --dry-run Check the spec and show what would run; start nothing
36
36
  --adapter, -a <name> Agent runtime: claude, codex, cursor, opencode or copilot
37
- (default: the spec's, else the one opencastle init set up)
37
+ (default: the spec's, else the one npx opencastle init set up)
38
38
  --concurrency, -c <n> Tasks at once (default: the spec's, else 4)
39
39
  --verbose Stream agent output
40
40
  --help, -h Show this help
41
41
  `
42
42
 
43
43
  const RESUME_HELP = `
44
- opencastle convoy resume [options]
44
+ npx opencastle convoy resume [options]
45
45
 
46
46
  Continue the newest run that is not done. Failed, timed-out and interrupted
47
47
  tasks run again, and so do the tasks a failure skipped; finished tasks are
@@ -74,18 +74,18 @@ const KNOWN_FLAGS = ['--dry-run', '--adapter', '-a', '--concurrency', '-c', '--v
74
74
  * because "unknown option" is the wrong answer to a flag our own docs taught.
75
75
  */
76
76
  export const REMOVED_FLAGS: Record<string, string> = {
77
- '--resume': 'Use: opencastle convoy resume',
78
- '--retry-failed': 'Use: opencastle convoy resume — it re-runs failed tasks too',
79
- '--status': 'Use: opencastle convoy — it shows the last run and what to do next',
80
- '--dlq-list': 'Failed tasks are listed by opencastle convoy, and re-run by opencastle convoy resume',
81
- '--dlq-resolve': 'Failed tasks are listed by opencastle convoy, and re-run by opencastle convoy resume',
82
- '--dlq-retry': 'Use: opencastle convoy resume',
83
- '--formula': 'Formulas are gone: write the spec out, or plan it with opencastle convoy "<task>"',
84
- '--set': 'Formulas are gone: write the spec out, or plan it with opencastle convoy "<task>"',
77
+ '--resume': 'Use: npx opencastle convoy resume',
78
+ '--retry-failed': 'Use: npx opencastle convoy resume — it re-runs failed tasks too',
79
+ '--status': 'Use: npx opencastle convoy — it shows the last run and what to do next',
80
+ '--dlq-list': 'Failed tasks are listed by npx opencastle convoy, and re-run by npx opencastle convoy resume',
81
+ '--dlq-resolve': 'Failed tasks are listed by npx opencastle convoy, and re-run by npx opencastle convoy resume',
82
+ '--dlq-retry': 'Use: npx opencastle convoy resume',
83
+ '--formula': 'Formulas are gone: write the spec out, or plan it with npx opencastle convoy "<task>"',
84
+ '--set': 'Formulas are gone: write the spec out, or plan it with npx opencastle convoy "<task>"',
85
85
  '--watch': 'Watch mode is gone: run the spec again when you want it run',
86
86
  '--watch-config': 'Watch mode is gone: run the spec again when you want it run',
87
87
  '--clear-scratchpad': 'Watch mode is gone: run the spec again when you want it run',
88
- '--report-dir': 'Runs are recorded in .opencastle/convoy.db. See them with opencastle convoy dashboard',
88
+ '--report-dir': 'Runs are recorded in .opencastle/convoy.db. See them with npx opencastle convoy dashboard',
89
89
  '--permission-mode': 'Set defaults.permission_mode in the spec instead',
90
90
  }
91
91
 
@@ -133,7 +133,7 @@ export function parseRunArgs(args: string[], command: 'run' | 'resume'): RunArgs
133
133
  }
134
134
  case '--file':
135
135
  case '-f': {
136
- if (command !== 'run') return { error: `${arg} belongs to opencastle convoy run` }
136
+ if (command !== 'run') return { error: `${arg} belongs to npx opencastle convoy run` }
137
137
  const v = value(i++, arg)
138
138
  if (typeof v !== 'string') return v
139
139
  if (out.spec !== null) return { error: `Two specs given: ${out.spec} and ${v}. Run one at a time.` }
@@ -227,7 +227,7 @@ async function drive(work: () => Promise<ConvoyResult>, projectRoot: string): Pr
227
227
  return result.exitCode ?? (result.status === 'done' ? 0 : 1)
228
228
  } catch (err) {
229
229
  if (err instanceof EngineAlreadyRunningError) {
230
- return fail(`${err.message}\n Watch it with: opencastle convoy dashboard`)
230
+ return fail(`${err.message}\n Watch it with: npx opencastle convoy dashboard`)
231
231
  }
232
232
  return fail((err as Error).message)
233
233
  } finally {
@@ -278,7 +278,7 @@ function describePlan(spec: TaskSpec, runtime: string): string[] {
278
278
  */
279
279
  export async function runSpec(args: RunArgs, opts: { runtime?: ResolvedAdapter } = {}): Promise<number> {
280
280
  if (!args.spec) {
281
- console.error(` ${c.red('✗')} Name the spec to run: opencastle convoy run <spec.yml>`)
281
+ console.error(` ${c.red('✗')} Name the spec to run: npx opencastle convoy run <spec.yml>`)
282
282
  console.error(` ${c.dim('Specs the planner wrote are in .opencastle/convoys/.')}`)
283
283
  return 1
284
284
  }
@@ -324,7 +324,7 @@ export async function runSpec(args: RunArgs, opts: { runtime?: ResolvedAdapter }
324
324
  if (runtimeProblem) return fail(runtimeProblem)
325
325
  const problem = spec.defaults?.permission_mode ? permissionModeError(runtime!.name, spec.defaults.permission_mode) : null
326
326
  if (problem) return fail(problem)
327
- console.log(` ${c.dim('Dry run — nothing started, nothing recorded. To run it:')} opencastle convoy run ${args.spec}`)
327
+ console.log(` ${c.dim('Dry run — nothing started, nothing recorded. To run it:')} npx opencastle convoy run ${args.spec}`)
328
328
  console.log('')
329
329
  return 0
330
330
  }
@@ -368,19 +368,19 @@ export async function resumeLast(args: RunArgs): Promise<number> {
368
368
  const runs = readRuns(projectRoot, 200)
369
369
  if (runs.length === 0) {
370
370
  console.error(` ${c.red('✗')} No convoy runs in this project yet.`)
371
- console.error(` ${c.dim('Start one:')} opencastle convoy "<task>"`)
371
+ console.error(` ${c.dim('Start one:')} npx opencastle convoy "<task>"`)
372
372
  return 1
373
373
  }
374
374
  const target = runs.find(unfinished)
375
375
  if (!target) {
376
376
  const last = runs[0]
377
377
  console.log(` Nothing to resume: the last run, ${c.bold(last.name)}, finished with all ${last.tasks_total} tasks done.`)
378
- console.log(` ${c.dim('Start another:')} opencastle convoy "<task>"`)
378
+ console.log(` ${c.dim('Start another:')} npx opencastle convoy "<task>"`)
379
379
  return 0
380
380
  }
381
381
  if (isRunAlive(projectRoot, target.id)) {
382
382
  console.error(` ${c.red('✗')} ${target.name} (${target.id}) is still running in another process.`)
383
- console.error(` ${c.dim('Watch it:')} opencastle convoy dashboard`)
383
+ console.error(` ${c.dim('Watch it:')} npx opencastle convoy dashboard`)
384
384
  return 1
385
385
  }
386
386
 
@@ -451,7 +451,7 @@ async function main(args: string[], command: 'run' | 'resume'): Promise<void> {
451
451
  const parsed = parseRunArgs(args, command)
452
452
  if ('error' in parsed) {
453
453
  console.error(` ${c.red('✗')} ${parsed.error}`)
454
- console.error(` Run "opencastle convoy ${command} --help" for usage.`)
454
+ console.error(` Run "npx opencastle convoy ${command} --help" for usage.`)
455
455
  exitWith(1)
456
456
  return
457
457
  }