opencastle 0.27.3 → 0.29.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.
- package/README.md +12 -3
- package/bin/cli.mjs +13 -5
- package/dist/cli/convoy/engine.d.ts.map +1 -1
- package/dist/cli/convoy/engine.js +2 -11
- package/dist/cli/convoy/engine.js.map +1 -1
- package/dist/cli/convoy/engine.test.js +2 -1
- package/dist/cli/convoy/engine.test.js.map +1 -1
- package/dist/cli/convoy/export.d.ts +1 -3
- package/dist/cli/convoy/export.d.ts.map +1 -1
- package/dist/cli/convoy/export.js +9 -88
- package/dist/cli/convoy/export.js.map +1 -1
- package/dist/cli/convoy/export.test.js +7 -186
- package/dist/cli/convoy/export.test.js.map +1 -1
- package/dist/cli/convoy/issues.js +3 -3
- package/dist/cli/convoy/issues.js.map +1 -1
- package/dist/cli/convoy/issues.test.js +4 -3
- package/dist/cli/convoy/issues.test.js.map +1 -1
- package/dist/cli/convoy/pipeline.d.ts.map +1 -1
- package/dist/cli/convoy/pipeline.js +0 -21
- package/dist/cli/convoy/pipeline.js.map +1 -1
- package/dist/cli/convoy/pipeline.test.js +0 -21
- package/dist/cli/convoy/pipeline.test.js.map +1 -1
- package/dist/cli/dashboard.d.ts.map +1 -1
- package/dist/cli/dashboard.js +32 -8
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/destroy.d.ts.map +1 -1
- package/dist/cli/destroy.js +13 -0
- package/dist/cli/destroy.js.map +1 -1
- package/dist/cli/dispute.d.ts +3 -0
- package/dist/cli/dispute.d.ts.map +1 -0
- package/dist/cli/dispute.js +25 -0
- package/dist/cli/dispute.js.map +1 -0
- package/dist/cli/doctor.d.ts +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +14 -1
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/eject.d.ts.map +1 -1
- package/dist/cli/eject.js +14 -0
- package/dist/cli/eject.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +14 -0
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/log.d.ts +0 -11
- package/dist/cli/log.d.ts.map +1 -1
- package/dist/cli/log.js +2 -114
- package/dist/cli/log.js.map +1 -1
- package/dist/cli/pipeline.d.ts +3 -0
- package/dist/cli/pipeline.d.ts.map +1 -0
- package/dist/cli/pipeline.js +321 -0
- package/dist/cli/pipeline.js.map +1 -0
- package/dist/cli/plan.d.ts +37 -0
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli/plan.js +321 -161
- package/dist/cli/plan.js.map +1 -1
- package/dist/cli/run.js +2 -2
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +16 -0
- package/dist/cli/update.js.map +1 -1
- package/dist/cli/validate.d.ts +3 -0
- package/dist/cli/validate.d.ts.map +1 -0
- package/dist/cli/validate.js +60 -0
- package/dist/cli/validate.js.map +1 -0
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +1 -3
- package/dist/cli/watch.js.map +1 -1
- package/package.json +5 -4
- package/src/cli/convoy/engine.test.ts +2 -1
- package/src/cli/convoy/engine.ts +2 -5
- package/src/cli/convoy/export.test.ts +7 -224
- package/src/cli/convoy/export.ts +10 -106
- package/src/cli/convoy/issues.test.ts +3 -2
- package/src/cli/convoy/issues.ts +3 -3
- package/src/cli/convoy/pipeline.test.ts +0 -25
- package/src/cli/convoy/pipeline.ts +0 -19
- package/src/cli/dashboard.ts +33 -8
- package/src/cli/destroy.ts +15 -0
- package/src/cli/dispute.ts +28 -0
- package/src/cli/doctor.ts +16 -1
- package/src/cli/eject.ts +16 -0
- package/src/cli/init.ts +16 -0
- package/src/cli/log.ts +2 -120
- package/src/cli/pipeline.ts +362 -0
- package/src/cli/plan.ts +357 -153
- package/src/cli/run.ts +2 -2
- package/src/cli/update.ts +18 -0
- package/src/cli/validate.ts +65 -0
- package/src/cli/watch.ts +1 -3
- package/src/dashboard/dist/_astro/index.Je1YjU_y.css +1 -0
- package/src/dashboard/dist/data/convoy-list.json +54 -9
- package/src/dashboard/dist/data/convoys/demo-api-v2.json +177 -0
- package/src/dashboard/dist/data/convoys/demo-auth-revamp.json +239 -0
- package/src/dashboard/dist/data/convoys/demo-dashboard-ui.json +328 -0
- package/src/dashboard/dist/data/convoys/demo-data-pipeline.json +187 -0
- package/src/dashboard/dist/data/convoys/demo-deploy-ci.json +153 -0
- package/src/dashboard/dist/data/convoys/demo-docs-update.json +154 -0
- package/src/dashboard/dist/data/convoys/demo-perf-opt.json +227 -0
- package/src/dashboard/dist/data/events.ndjson +115 -0
- package/src/dashboard/dist/data/overall-stats.json +56 -13
- package/src/dashboard/dist/data/pipelines.ndjson +5285 -0
- package/src/dashboard/dist/index.html +165 -1392
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/dashboard/public/data/convoy-list.json +54 -9
- package/src/dashboard/public/data/convoys/demo-api-v2.json +177 -0
- package/src/dashboard/public/data/convoys/demo-auth-revamp.json +239 -0
- package/src/dashboard/public/data/convoys/demo-dashboard-ui.json +328 -0
- package/src/dashboard/public/data/convoys/demo-data-pipeline.json +187 -0
- package/src/dashboard/public/data/convoys/demo-deploy-ci.json +153 -0
- package/src/dashboard/public/data/convoys/demo-docs-update.json +154 -0
- package/src/dashboard/public/data/convoys/demo-perf-opt.json +227 -0
- package/src/dashboard/public/data/events.ndjson +115 -0
- package/src/dashboard/public/data/overall-stats.json +56 -13
- package/src/dashboard/public/data/pipelines.ndjson +5285 -0
- package/src/dashboard/scripts/etl.test.ts +4 -62
- package/src/dashboard/scripts/etl.ts +11 -10
- package/src/dashboard/scripts/generate-demo-db.ts +482 -115
- package/src/dashboard/src/pages/index.astro +235 -1638
- package/src/dashboard/src/styles/dashboard.css +473 -7
- package/src/orchestrator/prompts/brainstorm.prompt.md +1 -0
- package/src/orchestrator/prompts/fix-convoy.prompt.md +79 -0
- package/src/orchestrator/prompts/generate-convoy.prompt.md +60 -58
- package/src/orchestrator/prompts/generate-prd.prompt.md +126 -0
- package/src/orchestrator/prompts/validate-convoy.prompt.md +89 -0
- package/src/orchestrator/prompts/validate-prd.prompt.md +83 -0
- package/dist/cli/convoy/log-merge.test.d.ts +0 -2
- package/dist/cli/convoy/log-merge.test.d.ts.map +0 -1
- package/dist/cli/convoy/log-merge.test.js +0 -147
- package/dist/cli/convoy/log-merge.test.js.map +0 -1
- package/src/cli/convoy/log-merge.test.ts +0 -179
- package/src/dashboard/dist/_astro/index.6L3_HsPT.css +0 -1
|
@@ -37,8 +37,8 @@ The output file must conform to the following schema. Fields marked **(required)
|
|
|
37
37
|
| `gates` | array of strings | no | — | Shell commands run after all tasks complete; each must exit 0 |
|
|
38
38
|
| `gate_retries` | integer ≥ 0 | no | `0` | How many times to retry failing gates with an auto-fix task |
|
|
39
39
|
| `guard` | object | no | — | Post-convoy guard configuration (see Guard below) |
|
|
40
|
-
| `hooks` | array of Hook | no | — | Post-convoy lifecycle hooks
|
|
41
|
-
| `watch` | object | no | — | Watch mode configuration for continuous re-runs (
|
|
40
|
+
| `hooks` | array of Hook | no | — | Post-convoy lifecycle hooks. Use `post_convoy` hooks for notifications or cleanup scripts after the run completes. |
|
|
41
|
+
| `watch` | object | no | — | Watch mode configuration for continuous re-runs. Set this when the goal is a recurring workflow (e.g. nightly sync, CI re-run on file change). |
|
|
42
42
|
| `tasks` | list | **yes** | — | Non-empty list of task objects |
|
|
43
43
|
| `depends_on_convoy` | list of strings | no | — | (version 2 only) Other convoy spec names to run before this one |
|
|
44
44
|
|
|
@@ -49,31 +49,21 @@ All fields are optional. Values are merged into each task unless the task overri
|
|
|
49
49
|
| Field | Type | Default | Description |
|
|
50
50
|
|-------|------|---------|-------------|
|
|
51
51
|
| `timeout` | duration | `30m` | Default task timeout (`<n><s\|m\|h>`) |
|
|
52
|
-
| `model` | string | — | AI model override for all tasks |
|
|
53
52
|
| `max_retries` | integer | `1` | Default max retry attempts |
|
|
54
53
|
| `agent` | string | `developer` | Default agent role |
|
|
55
|
-
| `
|
|
56
|
-
| `gates` | array of strings | — | Per-task gate commands run after adapter success |
|
|
54
|
+
| `gates` | array of strings | — | Gate commands run after every task completes (use for project-wide lint/type-check) |
|
|
57
55
|
| `review` | `auto` \| `fast` \| `panel` \| `none` | — | Review level for completed tasks |
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `avoid_weak_agents` | boolean | — | Skip assigning agents to tasks matching their weak areas |
|
|
70
|
-
| `max_swarm_concurrency` | integer (1–50) | `8` | Max parallel tasks in swarm mode (`concurrency: auto`) |
|
|
71
|
-
| `built_in_gates` | object | — | Built-in gate configuration (see Built-in Gates below) |
|
|
72
|
-
| `browser_test` | object | — | Default browser test gate config (see Browser Test below) |
|
|
73
|
-
| `circuit_breaker` | object | — | Circuit breaker config (see Circuit Breaker below) |
|
|
74
|
-
| `mcp_servers` | array of MCPServer | — | MCP servers available to tasks |
|
|
75
|
-
| `mcp_approve_all` | boolean | — | Auto-approve all MCP tool calls |
|
|
76
|
-
| `mcp_server_approval_timeout` | number | — | Timeout (seconds) for MCP approval prompts |
|
|
56
|
+
| `review_heuristics` | object | — | Auto-routing rules (see Review Heuristics below). Use to automatically assign `panel` review for security-sensitive paths or agents. |
|
|
57
|
+
| `detect_drift` | boolean | — | Enable drift detection on streaming adapters. Set `true` for long-running (>1h) tasks on streaming adapters to catch scope creep early. |
|
|
58
|
+
| `on_exhausted` | `dlq` \| `skip` \| `stop` | — | Action when max_retries exhausted. Use `dlq` for critical tasks in unattended overnight runs so failures are tracked. |
|
|
59
|
+
| `escalate_to` | string | — | Agent for DLQ escalation (e.g. `architect`). Pair with `on_exhausted: dlq`. |
|
|
60
|
+
| `inject_lessons` | boolean | — | Auto-inject relevant lessons from LESSONS-LEARNED.md into prompts. **Always set `true`.** |
|
|
61
|
+
| `track_discovered_issues` | boolean | — | Enable discovered issues tracking in prompts. **Always set `true`.** |
|
|
62
|
+
| `avoid_weak_agents` | boolean | — | Skip assigning agents to tasks matching their weak areas. **Always set `true`.** |
|
|
63
|
+
| `max_swarm_concurrency` | integer (1–50) | `8` | Max parallel tasks in swarm mode. Only relevant when `concurrency: auto`. |
|
|
64
|
+
| `built_in_gates` | object | — | Built-in gate configuration (see Built-in Gates below). Enable `secret_scan: true` for any task writing auth/config/env files; `dependency_audit: true` when the run adds new packages. |
|
|
65
|
+
| `browser_test` | object | — | Default browser test gate config (see Browser Test below). Set when the goal involves UI changes. |
|
|
66
|
+
| `circuit_breaker` | object | — | Circuit breaker config (see Circuit Breaker below). Set for long multi-agent runs to prevent cascading failures. |
|
|
77
67
|
|
|
78
68
|
### Built-in Gates
|
|
79
69
|
|
|
@@ -161,6 +151,13 @@ Enables continuous re-execution triggered by file changes, cron, or git push.
|
|
|
161
151
|
| `cron` | `schedule` (5-field cron) | Re-run on cron schedule |
|
|
162
152
|
| `git-push` | `branch` | Re-run when new commits are pushed |
|
|
163
153
|
|
|
154
|
+
### Content Research Rule
|
|
155
|
+
|
|
156
|
+
When writing task `prompt` fields that involve creating content about real-world people, places, organizations, or topics — **include an explicit instruction in the prompt** telling the agent to search the internet first using any available web search or fetch tools (e.g. `fetch_webpage`, web search MCP). Agents must never fabricate bios, descriptions, histories, statistics, or any factual claims. If web search is unavailable, the prompt should instruct the agent to use placeholder text clearly marked as `[NEEDS RESEARCH]` rather than inventing content.
|
|
157
|
+
|
|
158
|
+
Example prompt suffix to include when content research is needed:
|
|
159
|
+
> "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."
|
|
160
|
+
|
|
164
161
|
### Task Fields
|
|
165
162
|
|
|
166
163
|
| Field | Type | Required | Default | Description |
|
|
@@ -170,21 +167,19 @@ Enables continuous re-execution triggered by file changes, cron, or git push.
|
|
|
170
167
|
| `agent` | string | no | `developer` | Agent role hint (see Agent Roster below) |
|
|
171
168
|
| `description` | string | no | same as `id` | Short human label shown in progress output |
|
|
172
169
|
| `depends_on` | list of ids | no | `[]` | Task ids that must finish before this one starts |
|
|
173
|
-
| `files` | list of
|
|
170
|
+
| `files` | list of paths | no | `[]` | File scope the agent is allowed to modify. Must be plain file paths or directory paths. **Glob patterns (`*`, `?`, `**`) are not allowed** — use a plain directory path (e.g., `components/`) to cover a whole directory. |
|
|
174
171
|
| `timeout` | duration | no | `30m` | Max wall time (`<number><s\|m\|h>`, e.g. `10m`, `1h`) |
|
|
175
|
-
| `max_retries` | integer | no | from `defaults` or `1` | Max retry attempts for this task |
|
|
176
|
-
| `
|
|
177
|
-
| `adapter` | string | no | — | Per-task adapter override |
|
|
178
|
-
| `gates` | list of strings | no | — | Per-task gate commands run after adapter success |
|
|
172
|
+
| `max_retries` | integer | no | from `defaults` or `1` | Max retry attempts for this task. Override to `3` for high-risk tasks (DB migrations, security changes) or `0` for tasks that must not auto-retry. |
|
|
173
|
+
| `gates` | list of strings | no | — | Per-task gate commands when this task needs specific validation beyond global `gates` (e.g. a task-specific test suite or a schema diff check). |
|
|
179
174
|
| `review` | `auto` \| `fast` \| `panel` \| `none` | no | from `defaults` | Review level for this task |
|
|
180
|
-
| `detect_drift` | boolean | no | — | Enable drift detection (streaming adapters only) |
|
|
181
|
-
| `persistent` | boolean | no | — | Enable persistent agent identity across convoy runs |
|
|
182
|
-
| `steps` | list of TaskStep | no | — | Multi-step sub-prompts (
|
|
183
|
-
| `hooks` | list of Hook | no | — | Per-task lifecycle hooks |
|
|
184
|
-
| `outputs` | list of TaskOutput | no | — | Named artifacts this task produces |
|
|
185
|
-
| `inputs` | list of TaskInput | no | — | Named artifacts this task consumes from upstream tasks |
|
|
186
|
-
| `browser_test` | object | no | — | Per-task browser test config
|
|
187
|
-
| `built_in_gates` | object | no | — | Per-task built-in gates override |
|
|
175
|
+
| `detect_drift` | boolean | no | — | Enable drift detection (streaming adapters only). Set `true` for long (>1h) streaming-adapter tasks to catch scope creep. |
|
|
176
|
+
| `persistent` | boolean | no | — | Enable persistent agent identity across convoy runs. Set `true` for research, exploration, or multi-session implementation tasks where the agent's accumulated discoveries and decisions should be available in future convoy runs targeting the same workstream. Omit (defaults to `false`) for short, self-contained tasks. |
|
|
177
|
+
| `steps` | list of TaskStep | no | — | Multi-step sub-prompts. Use when a task has distinct sequential phases that need intermediate gates (e.g. step 1: generate migration, gate: dry-run; step 2: apply migration). |
|
|
178
|
+
| `hooks` | list of Hook | no | — | Per-task lifecycle hooks. Uncommon at task level; prefer top-level `hooks` for post-convoy actions. |
|
|
179
|
+
| `outputs` | list of TaskOutput | no | — | Named artifacts this task produces (used with `inputs` for explicit artifact passing between tasks). |
|
|
180
|
+
| `inputs` | list of TaskInput | no | — | Named artifacts this task consumes from upstream tasks. |
|
|
181
|
+
| `browser_test` | object | no | — | Per-task browser test config. Set when only this task's output requires visual/a11y validation. |
|
|
182
|
+
| `built_in_gates` | object | no | — | Per-task built-in gates override. Use to enable `secret_scan: true` for specific tasks writing credentials or keys. |
|
|
188
183
|
|
|
189
184
|
### Task Steps
|
|
190
185
|
|
|
@@ -218,18 +213,6 @@ Tasks can produce named artifacts and consume artifacts from upstream tasks.
|
|
|
218
213
|
| `name` | string | **yes** | Artifact name from the source task |
|
|
219
214
|
| `as` | string | no | Rename the artifact in the consuming task |
|
|
220
215
|
|
|
221
|
-
### MCP Server Config
|
|
222
|
-
|
|
223
|
-
| Field | Type | Required | Description |
|
|
224
|
-
|-------|------|----------|-------------|
|
|
225
|
-
| `name` | string | **yes** | Server identifier |
|
|
226
|
-
| `type` | string | **yes** | Server type (e.g. `stdio`, `http`) |
|
|
227
|
-
| `local` | boolean | no | Whether the server runs locally |
|
|
228
|
-
| `command` | string | no | Command to start the server |
|
|
229
|
-
| `args` | list of strings | no | Arguments for the command |
|
|
230
|
-
| `url` | string | no | URL for HTTP-based servers |
|
|
231
|
-
| `config` | object | no | Additional server configuration |
|
|
232
|
-
|
|
233
216
|
### Agent Roster
|
|
234
217
|
|
|
235
218
|
Available values for the `agent` field:
|
|
@@ -263,9 +246,16 @@ For each workstream, break it down into the smallest meaningful unit of work tha
|
|
|
263
246
|
|
|
264
247
|
1. **Single responsibility** — each task does exactly one thing.
|
|
265
248
|
2. **Self-contained prompt** — the `prompt` field must contain everything the agent needs: objective, file paths, constraints, acceptance criteria. The agent has no other context.
|
|
266
|
-
3. **Explicit file scopes** — list every directory or file the task may touch in `files`.
|
|
267
|
-
|
|
268
|
-
|
|
249
|
+
3. **Explicit file scopes** — list every directory or file the task may touch in `files`. Use plain paths only: exact file paths (e.g., `app/page.tsx`) or directory paths with a trailing slash (e.g., `app/about/`). **Glob patterns (`*`, `?`, `**`) are not allowed** — the engine rejects them.
|
|
250
|
+
|
|
251
|
+
4. **No partition conflicts** — two tasks may not share a `files` entry if they run in parallel (same phase). Resolve conflicts by either:
|
|
252
|
+
- **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`)
|
|
253
|
+
- **Sequencing**: add a `depends_on` edge from the later task to the earlier one, so they run in different phases
|
|
254
|
+
|
|
255
|
+
> **Common mistake:** multiple tasks all depending on a single `setup` task will run in parallel and conflict if they share a directory like `components/`, `app/globals.css`, or `app/layout.tsx`. Always use specific file paths or sequence conflicting tasks.
|
|
256
|
+
|
|
257
|
+
5. **Appropriate agent** — pick the agent whose speciality matches the task (e.g., `testing-expert` for tests, `database-engineer` for migrations).
|
|
258
|
+
6. **Realistic timeouts** — default 30 m is fine for most tasks; use `1h` for large refactors or test suites; use `10m` for small docs or config changes.
|
|
269
259
|
|
|
270
260
|
### 3. Define the Dependency Graph (DAG)
|
|
271
261
|
|
|
@@ -287,12 +277,20 @@ For each workstream, break it down into the smallest meaningful unit of work tha
|
|
|
287
277
|
- `on_failure` — use `continue` (default) when tasks are independent so one failure doesn't waste the whole run. Use `stop` when every subsequent task depends on success.
|
|
288
278
|
- `adapter` — **omit this field** to let the CLI auto-detect the first available adapter. Only set explicitly if the user requests a specific adapter.
|
|
289
279
|
- `branch` — derive from the goal, e.g., `feat/auth-refactor`. Use a descriptive branch name.
|
|
290
|
-
- `defaults` —
|
|
280
|
+
- `defaults` — always include `inject_lessons: true`, `track_discovered_issues: true`, and `avoid_weak_agents: true`. Omit `model` and `adapter` to allow auto-detection.
|
|
291
281
|
- `gates` — include standard validation gates (lint, type-check, test) unless the user specifies otherwise.
|
|
292
282
|
- `gate_retries` — set to 1–2 if you want the engine to auto-fix gate failures by spawning a fix-up task.
|
|
293
283
|
- `guard` — enable for post-convoy compliance checks (observability, cleanup, cost reporting).
|
|
294
|
-
-
|
|
295
|
-
-
|
|
284
|
+
- `review` / `review_heuristics` — use `review: fast` as the default. Upgrade to `panel` for security, auth, and database migration tasks. Use `review_heuristics.panel_paths` to auto-escalate specific file patterns (e.g. `db/migrations/`, `libs/auth/`) without setting per-task overrides.
|
|
285
|
+
- `built_in_gates` — set `secret_scan: true` in `defaults.built_in_gates` whenever the run touches auth, config, or env files. Set `dependency_audit: true` when adding new packages.
|
|
286
|
+
- `on_exhausted` + `escalate_to` — set `on_exhausted: dlq` and `escalate_to: architect` in `defaults` for unattended overnight runs so exhausted tasks are queued for human review rather than silently skipped.
|
|
287
|
+
- `detect_drift` — set `detect_drift: true` in `defaults` for runs with tasks longer than 1h on streaming adapters.
|
|
288
|
+
- `circuit_breaker` — configure with a `fallback_agent` for long multi-agent runs to prevent one flaky agent from stalling the whole convoy.
|
|
289
|
+
- `persistent` — set `persistent: true` on individual tasks that do research, codebase exploration, or long implementation work where the agent's accumulated discoveries should persist across future convoy runs (e.g. a Researcher task mapping the auth system, or a Database Engineer task discovering schema quirks). Omit for short, self-contained tasks.
|
|
290
|
+
- `steps` — use on a task when it has distinct sequential phases that need intermediate validation gates between them (e.g. generate migration → dry-run gate → apply migration). Do not use `steps` just to split a large prompt; use separate tasks instead.
|
|
291
|
+
- Per-task `gates` — add to a task only when that specific task needs validation gates beyond the global `gates` (e.g. a dedicated test suite for a specific module, a schema diff command).
|
|
292
|
+
- Per-task `max_retries` — override to `3` for high-risk tasks (DB migrations, security changes) or `0` when a task must not auto-retry (e.g. payment processing changes).
|
|
293
|
+
- `hooks` — use top-level `post_convoy` hooks for notifications, changelog generation, or cleanup scripts that should run once after all tasks complete.
|
|
296
294
|
|
|
297
295
|
### 5. Write the Prompts
|
|
298
296
|
|
|
@@ -317,7 +315,8 @@ Before presenting the YAML, mentally verify:
|
|
|
317
315
|
- [ ] Every task has a unique `id`
|
|
318
316
|
- [ ] Every `depends_on` reference points to a valid `id` defined earlier in the list
|
|
319
317
|
- [ ] No dependency cycles exist
|
|
320
|
-
- [ ] No two parallel tasks share the same `files` entries (
|
|
318
|
+
- [ ] No two parallel tasks share the same `files` entries — group tasks by phase and check each phase for overlaps; resolve with specific file paths or `depends_on` (see Step 2, rule 4)
|
|
319
|
+
- [ ] No `files` entry contains `*`, `?`, or `**` — use plain file paths or directory paths (trailing `/`) only
|
|
321
320
|
- [ ] Prompts are self-contained — an agent with zero context can execute them
|
|
322
321
|
- [ ] Timeouts are reasonable for the scope of each task
|
|
323
322
|
- [ ] `outputs`/`inputs` references are consistent (consuming task depends on producing task)
|
|
@@ -347,7 +346,9 @@ tasks:
|
|
|
347
346
|
description: <short label>
|
|
348
347
|
timeout: <duration>
|
|
349
348
|
files:
|
|
350
|
-
-
|
|
349
|
+
- app/some-file.tsx
|
|
350
|
+
- components/Hero.tsx
|
|
351
|
+
- components/Button.tsx
|
|
351
352
|
prompt: |
|
|
352
353
|
<full self-contained instruction>
|
|
353
354
|
|
|
@@ -356,7 +357,8 @@ tasks:
|
|
|
356
357
|
- <task-id>
|
|
357
358
|
agent: <agent>
|
|
358
359
|
files:
|
|
359
|
-
-
|
|
360
|
+
- app/other-file.tsx
|
|
361
|
+
- components/OtherComponent.tsx
|
|
360
362
|
prompt: |
|
|
361
363
|
<full self-contained instruction>
|
|
362
364
|
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Generate a Product Requirements Document from a high-level feature prompt. Output feeds directly into the generate-convoy step.'
|
|
3
|
+
agent: 'Team Lead (OpenCastle)'
|
|
4
|
+
output: prd
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
8
|
+
|
|
9
|
+
# Generate PRD
|
|
10
|
+
|
|
11
|
+
You are the Team Lead. Convert the feature request below into a structured Product Requirements Document (PRD). The PRD will be consumed by the `generate-convoy` step to produce an automated agent task spec, so every section must be **concrete**, **specific**, and **implementation-ready**.
|
|
12
|
+
|
|
13
|
+
## Feature Request
|
|
14
|
+
|
|
15
|
+
{{goal}}
|
|
16
|
+
|
|
17
|
+
## Additional Context
|
|
18
|
+
|
|
19
|
+
{{context}}
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Research Before Writing
|
|
24
|
+
|
|
25
|
+
If the feature request involves a specific person, place, organization, topic, or any real-world subject you are not confident you have accurate knowledge about — **you MUST search the internet first** using any available web search or fetch tools (e.g. `fetch_webpage`, web search MCP, or similar). Use the search results to gather accurate facts, names, dates, descriptions, and other details.
|
|
26
|
+
|
|
27
|
+
**Never fabricate or hallucinate content** about real-world subjects. If you cannot verify a claim through web search, state what is unknown rather than inventing plausible-sounding text. This applies to all content: bios, descriptions, histories, statistics, quotes, and any factual claims.
|
|
28
|
+
|
|
29
|
+
## Required PRD Structure
|
|
30
|
+
|
|
31
|
+
Produce the PRD in Markdown using **exactly** the sections below. Do not skip or merge sections. Do not wrap the output in a code fence — output raw Markdown starting directly with the `#` heading.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# [Feature Name] — PRD
|
|
36
|
+
|
|
37
|
+
## Overview
|
|
38
|
+
|
|
39
|
+
2–3 sentences: what this feature does, who benefits, and why it matters now.
|
|
40
|
+
|
|
41
|
+
## Goals
|
|
42
|
+
|
|
43
|
+
Numbered list of specific, measurable outcomes this feature must achieve. Each goal should be a single sentence with a clear success condition.
|
|
44
|
+
|
|
45
|
+
1. …
|
|
46
|
+
2. …
|
|
47
|
+
|
|
48
|
+
## Non-Goals
|
|
49
|
+
|
|
50
|
+
Explicit exclusions — what this work does **not** cover. If nothing is excluded, write "None."
|
|
51
|
+
|
|
52
|
+
## User Stories & Acceptance Criteria
|
|
53
|
+
|
|
54
|
+
For each primary scenario, write a user story + binary acceptance criteria. Criteria must be testable (pass/fail — no subjective language).
|
|
55
|
+
|
|
56
|
+
**US-1: [Short title]**
|
|
57
|
+
As a [user type], I want [action] so that [benefit].
|
|
58
|
+
|
|
59
|
+
Acceptance criteria:
|
|
60
|
+
- [ ] [Specific, testable condition]
|
|
61
|
+
- [ ] [Another condition]
|
|
62
|
+
|
|
63
|
+
*(Repeat for each user story)*
|
|
64
|
+
|
|
65
|
+
## Technical Requirements
|
|
66
|
+
|
|
67
|
+
Specific technical constraints the implementation must respect:
|
|
68
|
+
- Libraries, framework versions to use or avoid
|
|
69
|
+
- API contracts or interfaces that must not break
|
|
70
|
+
- Performance thresholds (e.g., "<200 ms p95 latency")
|
|
71
|
+
- Security requirements
|
|
72
|
+
- Browser/platform compatibility
|
|
73
|
+
|
|
74
|
+
## Implementation Scope
|
|
75
|
+
|
|
76
|
+
List **every file and directory** that will be created, modified, or deleted. Use specific paths — not broad paths like `src/`. Group by concern.
|
|
77
|
+
|
|
78
|
+
| Concern | Files / Directories |
|
|
79
|
+
|---------|---------------------|
|
|
80
|
+
| [Frontend components] | `components/feature/`, `app/feature/page.tsx` |
|
|
81
|
+
| [API routes] | `app/api/feature/route.ts` |
|
|
82
|
+
| [Database] | `db/migrations/add_feature.sql`, `db/schema.ts` |
|
|
83
|
+
| [Shared types] | `types/feature.ts` |
|
|
84
|
+
| [Tests] | `__tests__/feature.test.ts`, `e2e/feature.spec.ts` |
|
|
85
|
+
| [Config / env] | `.env.example` |
|
|
86
|
+
|
|
87
|
+
**File partition rules (important for parallel execution):**
|
|
88
|
+
- No two concurrent workstreams may modify the same file
|
|
89
|
+
- If two workstreams need the same file, they must be sequenced (Phase N+1 after Phase N)
|
|
90
|
+
|
|
91
|
+
## Task Breakdown
|
|
92
|
+
|
|
93
|
+
Decompose into the minimum number of phases. Tasks in the same phase run in parallel and **must not share any files**.
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Phase 1 — Foundation (parallel, no dependencies):
|
|
97
|
+
- [Workstream A title]: [2-sentence description]
|
|
98
|
+
Files: [list exact files]
|
|
99
|
+
- [Workstream B title]: [2-sentence description]
|
|
100
|
+
Files: [list exact files]
|
|
101
|
+
|
|
102
|
+
Phase 2 — Integration (depends on Phase 1):
|
|
103
|
+
- [Workstream C title]: [2-sentence description]
|
|
104
|
+
Files: [list exact files]
|
|
105
|
+
Depends on: Phase 1
|
|
106
|
+
|
|
107
|
+
Phase 3 — Verification (depends on Phase 2):
|
|
108
|
+
- [Tests]: Run full test suite, achieve ≥ 95% coverage on new files
|
|
109
|
+
- [Documentation]: Update READMEs and changelogs
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Success Criteria
|
|
113
|
+
|
|
114
|
+
Measurable, binary checks that confirm the feature is shippable:
|
|
115
|
+
- [ ] All acceptance criteria in User Stories & Acceptance Criteria pass
|
|
116
|
+
- [ ] TypeScript compiles with zero errors
|
|
117
|
+
- [ ] Lint passes with zero warnings
|
|
118
|
+
- [ ] Unit test coverage ≥ 95% on all new/changed files
|
|
119
|
+
- [ ] [Feature-specific checks]
|
|
120
|
+
|
|
121
|
+
## Risks & Open Questions
|
|
122
|
+
|
|
123
|
+
- **[Risk title]**: [Description of the risk] — *Mitigation: [How to handle it]*
|
|
124
|
+
- **[Open question]**: [What needs to be decided before implementation can start]
|
|
125
|
+
|
|
126
|
+
If there are no risks or open questions, write "None identified."
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Validate a convoy YAML spec for schema correctness and logical soundness. Outputs VALID or INVALID with specific errors.'
|
|
3
|
+
agent: 'Reviewer'
|
|
4
|
+
output: validation
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
8
|
+
|
|
9
|
+
# Validate Convoy Spec
|
|
10
|
+
|
|
11
|
+
You are a senior technical reviewer. Validate the convoy spec below against the schema rules and logical constraints. Be strict — a spec that passes this gate will be executed autonomously by AI agents.
|
|
12
|
+
|
|
13
|
+
## Convoy Spec to Validate
|
|
14
|
+
|
|
15
|
+
{{goal}}
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Validation Rules
|
|
20
|
+
|
|
21
|
+
Evaluate **every rule** below. If ALL pass, respond `VALID`. If ANY fail, respond `INVALID` with specific, actionable errors.
|
|
22
|
+
|
|
23
|
+
### Schema Requirements
|
|
24
|
+
|
|
25
|
+
- [ ] `name` field is present (non-empty string)
|
|
26
|
+
- [ ] `version` field is present (integer: `1` or `2`)
|
|
27
|
+
- [ ] `tasks` list is present and contains at least one task
|
|
28
|
+
- [ ] Every task has a unique `id` (lowercase, kebab-case, no spaces or special chars)
|
|
29
|
+
- [ ] Every task has a non-empty `prompt` field
|
|
30
|
+
- [ ] `on_failure` is `continue` or `stop` (if present; default `stop` is fine if absent)
|
|
31
|
+
- [ ] `concurrency` is a positive integer or the string `"auto"` (if present)
|
|
32
|
+
- [ ] `review` values are one of: `auto`, `fast`, `panel`, `none` (if present on task)
|
|
33
|
+
- [ ] `agent` values are from the approved roster (if present on task):
|
|
34
|
+
`api-designer`, `architect`, `content-engineer`, `copywriter`, `data-expert`,
|
|
35
|
+
`database-engineer`, `developer`, `devops-expert`, `documentation-writer`,
|
|
36
|
+
`performance-expert`, `release-manager`, `researcher`, `security-expert`,
|
|
37
|
+
`seo-specialist`, `team-lead`, `testing-expert`, `ui-ux-expert`
|
|
38
|
+
- [ ] `timeout` values match `<integer><s|m|h>` format (e.g., `30m`, `1h`, `90s`) (if present)
|
|
39
|
+
|
|
40
|
+
### Files Constraint
|
|
41
|
+
|
|
42
|
+
- [ ] No `files` entry contains glob patterns (`*`, `?`, `**`)
|
|
43
|
+
- [ ] All `files` entries are plain file paths or directory paths (trailing `/` is allowed for directories)
|
|
44
|
+
- [ ] No `files` entry is an absolute path (all paths must be relative to the repo root)
|
|
45
|
+
|
|
46
|
+
### Dependency Graph
|
|
47
|
+
|
|
48
|
+
- [ ] Every `depends_on` id references a real task `id` in the spec
|
|
49
|
+
- [ ] No dependency cycles exist (A → B → A is a cycle; A → B → C → A is also a cycle)
|
|
50
|
+
|
|
51
|
+
### Partition Conflicts
|
|
52
|
+
|
|
53
|
+
Two tasks that can run in parallel (no `depends_on` edge between them) must not share any `files` entry.
|
|
54
|
+
|
|
55
|
+
- [ ] Check every pair of tasks that lack a `depends_on` relationship — they must not share any file or directory path in their `files` lists
|
|
56
|
+
|
|
57
|
+
### Prompt Quality
|
|
58
|
+
|
|
59
|
+
- [ ] Each task `prompt` is self-contained: an agent with no surrounding context must be able to execute it
|
|
60
|
+
- [ ] Each task `prompt` names the specific files to act on (not vague phrases like "the frontend" or "the codebase")
|
|
61
|
+
- [ ] No task `prompt` is shorter than 2 sentences (one-liners are usually too vague)
|
|
62
|
+
|
|
63
|
+
### Inputs / Outputs Consistency (if used)
|
|
64
|
+
|
|
65
|
+
- [ ] Every `inputs[].from` references an existing task `id`
|
|
66
|
+
- [ ] Every task referenced in an `inputs[].from` declares a matching `outputs[].name`
|
|
67
|
+
- [ ] No consuming task runs before its producing task (must have `depends_on` edge or be in a later phase)
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Output Format
|
|
72
|
+
|
|
73
|
+
If all checks pass:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
VALID
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If any check fails:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
INVALID
|
|
83
|
+
|
|
84
|
+
Errors:
|
|
85
|
+
- [Rule category] / [task id if applicable]: [Specific problem] — Fix: [How to correct it]
|
|
86
|
+
- [Rule category] / [task id if applicable]: [Another problem] — Fix: [How to correct it]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
List only real failures. Do not list passing checks. Be specific — name the task id, the field, and the exact value that violates the rule.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Validate a PRD for completeness, clarity, and implementability before generating a convoy spec. Outputs VALID or INVALID with specific issues.'
|
|
3
|
+
agent: 'Reviewer'
|
|
4
|
+
output: validation
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
8
|
+
|
|
9
|
+
# Validate PRD
|
|
10
|
+
|
|
11
|
+
You are a senior technical reviewer. Your job is to validate the PRD below against strict quality criteria before it is used to generate an automated convoy spec. A PRD that passes this gate will produce a clean, executable convoy spec. A PRD that fails will produce bad tasks.
|
|
12
|
+
|
|
13
|
+
Be strict. Do not pass a PRD with vague language or missing sections just because it "looks mostly right."
|
|
14
|
+
|
|
15
|
+
## PRD to Validate
|
|
16
|
+
|
|
17
|
+
{{goal}}
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Validation Checklist
|
|
22
|
+
|
|
23
|
+
Evaluate **every item** below. If ALL items pass, respond `VALID`. If ANY item fails, respond `INVALID` with a specific, actionable issue list.
|
|
24
|
+
|
|
25
|
+
### Required Sections
|
|
26
|
+
|
|
27
|
+
- [ ] `Overview` section is present and non-empty (at least 2 sentences)
|
|
28
|
+
- [ ] `Goals` section is present with at least one numbered, specific goal
|
|
29
|
+
- [ ] `Non-Goals` section is present (may say "None" but must not be missing)
|
|
30
|
+
- [ ] `User Stories & Acceptance Criteria` section is present with at least one user story
|
|
31
|
+
- [ ] Each user story has associated acceptance criteria (not just the story itself)
|
|
32
|
+
- [ ] `Technical Requirements` section is present and non-empty
|
|
33
|
+
- [ ] `Implementation Scope` section is present with a table or list of specific files/directories
|
|
34
|
+
- [ ] `Task Breakdown` section is present with at least one phase and workstream
|
|
35
|
+
- [ ] `Success Criteria` section is present with at least 3 measurable checks
|
|
36
|
+
- [ ] `Risks & Open Questions` section is present (may say "None identified")
|
|
37
|
+
|
|
38
|
+
### Acceptance Criteria Quality
|
|
39
|
+
|
|
40
|
+
- [ ] All acceptance criteria can be evaluated as pass/fail (no subjective language like "looks good", "feels responsive", "is clean")
|
|
41
|
+
- [ ] No criterion uses modal verbs that imply optionality ("should", "might", "could", "may")
|
|
42
|
+
- [ ] No criterion references undefined external systems without explaining what they are
|
|
43
|
+
|
|
44
|
+
### Implementation Scope Quality
|
|
45
|
+
|
|
46
|
+
- [ ] Scope lists **specific** file names or subdirectory names — not broad paths like `src/` or `the frontend`
|
|
47
|
+
- [ ] Scope table does not use glob patterns (`*`, `**`)
|
|
48
|
+
- [ ] Every concern area has at least one specific file or directory
|
|
49
|
+
|
|
50
|
+
### Task Breakdown Quality
|
|
51
|
+
|
|
52
|
+
- [ ] Each workstream lists the exact files it will modify
|
|
53
|
+
- [ ] No two parallel workstreams (same phase) claim the same file
|
|
54
|
+
- [ ] Phases have explicit dependency declarations (`depends on: Phase N`)
|
|
55
|
+
- [ ] No circular dependencies
|
|
56
|
+
|
|
57
|
+
### Language Quality
|
|
58
|
+
|
|
59
|
+
- [ ] No undefined acronyms or jargon used without explanation
|
|
60
|
+
- [ ] No conflicting requirements (e.g., "must be fast AND run full suite on every change")
|
|
61
|
+
- [ ] Section content is not placeholder/template text (e.g., "2–3 sentences about…", "Description here")
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Output Format
|
|
66
|
+
|
|
67
|
+
If the PRD passes every check above, respond with **exactly**:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
VALID
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If the PRD fails one or more checks, respond with:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
INVALID
|
|
77
|
+
|
|
78
|
+
Issues:
|
|
79
|
+
- [Section name]: [Specific problem] — Fix: [What the author must change]
|
|
80
|
+
- [Section name]: [Another problem] — Fix: [What the author must change]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
List only real failures. Do not list items that passed.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log-merge.test.d.ts","sourceRoot":"","sources":["../../../src/cli/convoy/log-merge.test.ts"],"names":[],"mappings":""}
|