codebyplan 1.13.53 → 1.13.55

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 (84) hide show
  1. package/dist/cli.js +1364 -352
  2. package/package.json +1 -1
  3. package/templates/agents/cbp-database-agent.md +1 -1
  4. package/templates/agents/cbp-e2e-maestro.md +1 -1
  5. package/templates/agents/cbp-e2e-playwright.md +24 -16
  6. package/templates/agents/cbp-e2e-tauri.md +1 -1
  7. package/templates/agents/cbp-e2e-vscode.md +1 -1
  8. package/templates/agents/cbp-e2e-xcuitest.md +1 -1
  9. package/templates/agents/cbp-improve-claude.md +2 -2
  10. package/templates/agents/{cbp-round-executor.md → cbp-round-builder.md} +23 -23
  11. package/templates/agents/{cbp-task-planner.md → cbp-round-planner.md} +26 -25
  12. package/templates/agents/cbp-security-agent.md +1 -1
  13. package/templates/agents/cbp-stripe-agent.md +2 -2
  14. package/templates/agents/cbp-testing-qa-agent.md +11 -11
  15. package/templates/agents/cbp-verify-reviewer.md +236 -0
  16. package/templates/context/architecture-map.md +4 -4
  17. package/templates/context/mcp-docs.md +57 -11
  18. package/templates/context/testing/e2e.md +9 -9
  19. package/templates/github-workflows/ci.yml +58 -0
  20. package/templates/hooks/cbp-skill-context-guard.sh +1 -1
  21. package/templates/hooks/cbp-test-hooks.sh +9 -9
  22. package/templates/hooks/validate-structure-lengths.sh +1 -1
  23. package/templates/hooks/validate-structure-patterns.sh +1 -1
  24. package/templates/rules/README.md +1 -2
  25. package/templates/rules/agent-claim-verification.md +1 -1
  26. package/templates/rules/context-file-loading.md +10 -10
  27. package/templates/rules/development-workflow.md +73 -0
  28. package/templates/rules/e2e-mandatory.md +8 -8
  29. package/templates/rules/execution-proof.md +70 -0
  30. package/templates/rules/model-invocation-convention.md +2 -2
  31. package/templates/rules/parallel-waves.md +11 -11
  32. package/templates/rules/spawn-failure-is-gate-failure.md +76 -0
  33. package/templates/rules/task-routing-recommendation.md +1 -1
  34. package/templates/rules/todo-backend.md +3 -3
  35. package/templates/rules/two-tier-ci.md +63 -0
  36. package/templates/settings.project.base.json +8 -10
  37. package/templates/skills/cbp-build-cc-mode/SKILL.md +1 -1
  38. package/templates/skills/cbp-build-cc-settings/reference/cbp-permission-policy.md +7 -7
  39. package/templates/skills/cbp-build-cc-skill/SKILL.md +1 -1
  40. package/templates/skills/cbp-build-cc-skill/reference/cbp-quality.md +2 -2
  41. package/templates/skills/cbp-build-cc-skill/reference/fork-eligibility.md +11 -14
  42. package/templates/skills/cbp-checkpoint-check/SKILL.md +2 -2
  43. package/templates/skills/cbp-checkpoint-create/SKILL.md +16 -1
  44. package/templates/skills/cbp-checkpoint-update/SKILL.md +3 -3
  45. package/templates/skills/cbp-clear-continue/SKILL.md +2 -2
  46. package/templates/skills/cbp-clear-prep/SKILL.md +3 -3
  47. package/templates/skills/{cbp-task-complete → cbp-finalize}/SKILL.md +25 -29
  48. package/templates/skills/{cbp-task-complete → cbp-finalize}/reference/checkpoint-done-branching.md +1 -1
  49. package/templates/skills/{cbp-task-complete → cbp-finalize}/reference/next-step-heuristic.md +1 -1
  50. package/templates/skills/cbp-frontend-design/SKILL.md +1 -1
  51. package/templates/skills/cbp-frontend-ui/SKILL.md +7 -7
  52. package/templates/skills/cbp-git-commit/SKILL.md +3 -3
  53. package/templates/skills/cbp-merge-main/SKILL.md +4 -4
  54. package/templates/skills/{cbp-round-execute → cbp-round-build}/SKILL.md +93 -75
  55. package/templates/skills/cbp-round-complete/SKILL.md +15 -14
  56. package/templates/skills/cbp-round-plan/SKILL.md +344 -0
  57. package/templates/skills/cbp-session-end/SKILL.md +1 -1
  58. package/templates/skills/cbp-ship-main/SKILL.md +3 -2
  59. package/templates/skills/cbp-standalone-task-check/SKILL.md +10 -9
  60. package/templates/skills/cbp-standalone-task-complete/SKILL.md +12 -13
  61. package/templates/skills/cbp-standalone-task-create/SKILL.md +16 -9
  62. package/templates/skills/cbp-standalone-task-start/SKILL.md +9 -5
  63. package/templates/skills/cbp-standalone-task-testing/SKILL.md +5 -5
  64. package/templates/skills/cbp-task-create/SKILL.md +6 -7
  65. package/templates/skills/cbp-task-start/SKILL.md +8 -8
  66. package/templates/skills/cbp-todo/SKILL.md +6 -8
  67. package/templates/skills/cbp-verify/SKILL.md +146 -0
  68. package/templates/skills/cbp-verify/reference/deterministic-gates.md +114 -0
  69. package/templates/skills/{cbp-round-end → cbp-verify}/reference/findings-presentation.md +16 -12
  70. package/templates/skills/cbp-verify/reference/round-scope.md +62 -0
  71. package/templates/skills/cbp-verify/reference/task-scope.md +71 -0
  72. package/templates/agents/cbp-improve-round.md +0 -283
  73. package/templates/agents/cbp-task-check.md +0 -217
  74. package/templates/skills/cbp-round-check/SKILL.md +0 -134
  75. package/templates/skills/cbp-round-end/SKILL.md +0 -173
  76. package/templates/skills/cbp-round-end/reference/inline-fallback.md +0 -35
  77. package/templates/skills/cbp-round-execute/reference/inline-fallback.md +0 -55
  78. package/templates/skills/cbp-round-input/SKILL.md +0 -197
  79. package/templates/skills/cbp-round-start/SKILL.md +0 -261
  80. package/templates/skills/cbp-round-update/SKILL.md +0 -120
  81. package/templates/skills/cbp-ship/templates/workflow-eas-submit.yml +0 -53
  82. package/templates/skills/cbp-ship/templates/workflow-vsce-publish.yml +0 -31
  83. package/templates/skills/cbp-task-check/SKILL.md +0 -172
  84. package/templates/skills/cbp-task-testing/SKILL.md +0 -279
@@ -0,0 +1,344 @@
1
+ ---
2
+ name: cbp-round-plan
3
+ description: Plan a round — round-1 planning AND round-2+ deep-analysis of unapproved work, then spawn cbp-round-planner and auto-trigger /cbp-round-build
4
+ triggers: [cbp-round-build]
5
+ argument-hint: [chk-task-round | task-round | requirements-text] # e.g. `108-1-2`, `45-2`, or free-text
6
+ effort: xhigh
7
+ ---
8
+
9
+ ## Kind Detection
10
+
11
+ Inspect the resolved identifier from argument parsing to determine the task kind:
12
+
13
+ | Identifier shape | KIND |
14
+ |-----------------|------|
15
+ | `{task}-{round}` (2-segment, e.g. `45-2`) | `standalone` |
16
+ | `{chk}-{task}-{round}` (3-segment, e.g. `141-3-1`) | `checkpoint` |
17
+ | _(empty / free-text)_ | Check `get_current_standalone_task` first; if found → `standalone`. Else → `checkpoint` via `get_current_task`. |
18
+
19
+ Set `KIND` for the rest of this skill. Read/write sources vary by KIND:
20
+
21
+ | Operation | `checkpoint` KIND | `standalone` KIND |
22
+ |-----------|------------------|-------------------|
23
+ | Get task | local state (break-glass: `get_current_task`) | `get_current_standalone_task(repo_id)` |
24
+ | Get rounds | local state (break-glass: `get_rounds`) | `get_standalone_rounds(standalone_task_id)` |
25
+ | Add round | `codebyplan round add` (break-glass: `add_round`) | `add_standalone_round(standalone_task_id, ...)` |
26
+ | Update round | `codebyplan round update` (break-glass: `update_round`) | `update_standalone_round(standalone_round_id, ...)` |
27
+ | Complete round | `complete_round(round_id, duration_minutes?)` | `complete_standalone_round(standalone_round_id, duration_minutes?, caller_worktree_id)` ⚠️ `caller_worktree_id` is REQUIRED for standalone |
28
+ | Update task | `codebyplan task update` (break-glass: `update_task`) | `update_standalone_task(standalone_task_id, ...)` |
29
+
30
+ > **Note**: The `standalone` KIND column uses MCP tools unchanged — standalone local-first migration is out of scope and will be addressed in a later task.
31
+
32
+ # Round Plan Command
33
+
34
+ The single **planning entry** for the round cycle. It plans BOTH the first round (from `task.requirements`) AND every follow-up round (deep analysis of the prior round's unapproved work, verify gate/proof failures, and reviewer findings — the round-input deep-analysis role is now folded in here). It analyzes context, spawns `cbp-round-planner` for the plan, then auto-triggers `/cbp-round-build` — the `ask`-tier permission prompt on that skill IS the user's plan approval. NO execution or testing here — those belong to `/cbp-round-build` and `/cbp-verify`.
35
+
36
+ ## Planner Spawn Failure Is A Gate Failure
37
+
38
+ If the `cbp-round-planner` agent spawn fails (`API Error: Extra usage required`, monthly Agent
39
+ usage cap, provider 5xx, rate limit, context overflow at spawn, the agent dying before emitting
40
+ its output contract), that is a **HARD GATE FAILURE** per `rules/spawn-failure-is-gate-failure.md`.
41
+ The orchestrator does **NOT** walk the planner's phases inline and self-certify a plan — doing so
42
+ re-introduces the exact fresh-context blind spot the planner exists to remove. STOP and surface the
43
+ retry directive verbatim:
44
+
45
+ ```
46
+ ## Plan blocked — planner could not spawn
47
+
48
+ The round planner (cbp-round-planner) failed to spawn: <class> — <verbatim error>.
49
+ This is a hard gate failure, not a plan. Retry when capacity returns:
50
+ Next: /cbp-round-plan
51
+ ```
52
+
53
+ Record `round.context.planner_findings.spawn_failure = { class, error_message, decided_at }` so the
54
+ retry is auditable. Do NOT continue to Step 8/9; no plan means no execution.
55
+
56
+ ## Pipeline
57
+
58
+ ```
59
+ /cbp-round-plan (planning) → /cbp-round-build (ask-tier permission = plan approval)
60
+ ```
61
+
62
+ **Auto-loop mode**: when `auto_loop_mode === true` carries forward from the prior round, the Step 6
63
+ Q&A and the Step 4b mode prompt are skipped, and Step 8's `/cbp-round-build` permission is
64
+ auto-approved. See `cbp-verify` reference `round-scope.md` Phase 5 (the auto-loop decision that
65
+ carries `auto_loop_mode` forward) for the contract.
66
+
67
+ ## Instructions
68
+
69
+ ### Step 0: Parse `$ARGUMENTS` shape
70
+
71
+ Disambiguate the argument up front. Three input shapes:
72
+
73
+ ### CHK / TASK / ROUND Identifier Notation Vocabulary
74
+
75
+ | Shape | Regex | Meaning |
76
+ |-------|-------|---------|
77
+ | `{chk}-{task}-{round}` (e.g. `108-1-2`) | `^[0-9]+-[0-9]+-[0-9]+$` | **Identifier**: targets round {round} of CHK-{chk} TASK-{task}. Sets `target_checkpoint`, `target_task`, `target_round`. |
78
+ | `{task}-{round}` (e.g. `45-2`) | `^[0-9]+-[0-9]+$` | **Identifier**: targets round {round} of standalone TASK-{task}. Sets `target_task`, `target_round` (no checkpoint). |
79
+ | Non-empty, non-identifier-shaped | — | **Free-text round requirements** (the follow-up-round requirements path). |
80
+ | _(empty)_ | — | No identifier, no requirements text — derive task/round from Kind Detection above. |
81
+
82
+ Malformed identifier shapes (`108-`, `-1-2`, `108--1`, `abc-1`) — surface this error and stop, mirroring `/cbp-task-start`'s error vocabulary:
83
+
84
+ ```
85
+ round-plan: invalid argument `{value}`. Expected:
86
+ 108-1-2 → round 2 of CHK-108 TASK-1
87
+ 45-2 → round 2 of standalone TASK-45
88
+ (free-text) → round requirements (follow-up round)
89
+ (empty) → derive from active task/round state
90
+ ```
91
+
92
+ #### Worked examples
93
+
94
+ - `round-plan 108-1-2` → resolve CHK-108 TASK-1, target round 2
95
+ - `round-plan 45-2` → resolve standalone TASK-45, target round 2
96
+ - `round-plan 108-1` → **standalone TASK-108 round 1** (NOT CHK-108 TASK-1). The 2-segment form means `{task}-{round}`; checkpoint-bound round-targeting requires all three numbers (`108-1-2`). If you got here trying to target CHK-108 TASK-1, you want `108-1-2` (specifying a round number) or `/cbp-task-start 108-1` (specifying just a task).
97
+ - `round-plan "Implement OAuth flow per CHK-X plan"` → free-text path; current-task/round derivation from state
98
+ - `round-plan` (empty) → derive from Kind Detection; round 1 uses `task.requirements`
99
+ - `round-plan 108-` → error: malformed identifier
100
+ - `round-plan -1-2` → error: malformed identifier
101
+ - `round-plan abc-1` → error: malformed identifier
102
+
103
+ > **Mental-model warning**: `task-start` and `round-plan` interpret the SAME `108-1` argument differently. `task-start 108-1` → CHK-108 TASK-1 (checkpoint-bound task). `round-plan 108-1` → standalone TASK-108 round 1 (because round-plan needs three numbers for a checkpoint-bound round). When in doubt, write all three: `round-plan 108-1-2`.
104
+
105
+ ### Step 1: Get Current Task
106
+
107
+ If Step 0 produced an identifier (`target_task` set): resolve directly per the identifier (bound or standalone) — use KIND-appropriate sources per the Kind Detection table above.
108
+
109
+ Otherwise: use Kind Detection to determine KIND, then:
110
+ - **checkpoint KIND**: read `.codebyplan/state/checkpoints/<checkpointId>/tasks/<taskId>.json` (local-first). If missing/stale, run `npx codebyplan sync` once and re-read. Break-glass fallback: MCP `get_current_task` when the state dir is absent and sync fails (daemon-dead + CLI-unavailable).
111
+ - **standalone KIND**: MCP `get_current_standalone_task(repo_id)` — standalone tools are NOT migrated; standalone KIND still uses MCP until a later task.
112
+
113
+ If no in-progress task and Step 0 produced no identifier, show error: `No active task. Run /cbp-task-start first.`
114
+
115
+ ### Step 2: Determine Round Number
116
+
117
+ If Step 0 produced `target_round`: use that as the round number directly (may target an existing round for resume, or N+1 for a new round — disambiguate by reading local round files or MCP per KIND below).
118
+
119
+ Otherwise:
120
+ - **checkpoint KIND**: list `.codebyplan/state/checkpoints/<checkpointId>/tasks/<taskId>/rounds/` (local-first). If missing/stale, run `npx codebyplan sync` once and re-read. Break-glass fallback: MCP `get_rounds` when the state dir is absent and sync fails.
121
+ - **standalone KIND**: MCP `get_standalone_rounds(standalone_task_id)` — standalone still uses MCP.
122
+
123
+ Count existing rounds; next is N+1. **Round 1** → run the Step 3 first-round path. **Round 2+** → run the Step 3D deep-analysis path (the folded-in round-input deep-analysis role) before creating the round.
124
+
125
+ ### Step 3: Gather Round Requirements
126
+
127
+ **If Step 0 parsed an identifier**: this skill was invoked to resume/start a specific round. Requirements come from existing round data (when the round exists) or task.requirements (for new round 1) — `$ARGUMENTS` is the identifier itself, NOT requirements text.
128
+
129
+ **Else (free-text path), if round number is 1:**
130
+
131
+ - Use `task.requirements` as the primary requirements
132
+ - If `$ARGUMENTS` provided (free-text), merge as additional context
133
+
134
+ **Else (round number > 1):** requirements come from the Step 3D Deep Analysis below — the prior round's unapproved work, verify gate/proof failures, and reviewer findings. Free-text `$ARGUMENTS` (if provided) is merged in as additional direction.
135
+
136
+ ### Step 3D: Deep Analysis (round 2+ only — MANDATORY)
137
+
138
+ Follow-up rounds get the SAME depth as round 1. This is the deep-analysis role that round-input
139
+ formerly owned; it now runs inline here for every round after the first.
140
+
141
+ **3D-a:** Load task (already loaded in Step 1) — confirm `files_changed`, `requirements`, `context`, `qa` are present.
142
+
143
+ **3D-b:** Load all rounds:
144
+ - **checkpoint KIND** — Read `.codebyplan/state/checkpoints/<checkpointId>/tasks/<taskId>/rounds/*.json` (local-first; break-glass: MCP `get_rounds(task_id)`). Get previous round context + verify outcome.
145
+ - **standalone KIND** — MCP `get_standalone_rounds(standalone_task_id)`.
146
+
147
+ **3D-c:** Identify unapproved files from `task.files_changed` where `user_approved === false`.
148
+
149
+ **3D-d:** Read the content of each unapproved file (Read tool, max 5 files, first 100 lines each).
150
+
151
+ **3D-e:** Cross-reference with task requirements — for each requirement, is it met or missed?
152
+
153
+ **3D-f:** Extract verify findings from the latest round context. `/cbp-verify` writes its outcome
154
+ into the round/task context (`verify_manifest`, gate `new_failures[]`, execution-proof gaps, and any
155
+ blocking `cbp-verify-reviewer` findings it could not auto-apply inline because they reference files
156
+ outside the prior round's `files_changed[]`). Include those out-of-scope findings as high-priority
157
+ requirements; deterministic gate failures and proof gaps come first (they block shipping).
158
+
159
+ **3D-g:** Identify root causes — not "file X is wrong" but "requirement Y was not met because Z".
160
+
161
+ **3D-h:** Present the analysis to the user:
162
+
163
+ ```
164
+ ## Follow-up Round Analysis
165
+
166
+ ### Unapproved Files ([N])
167
+ | File | Action | Issue |
168
+ |------|--------|-------|
169
+ | path | modified | [what's wrong based on reading the file] |
170
+
171
+ ### Requirements Coverage
172
+ | Requirement | Status | Gap |
173
+ |-------------|--------|-----|
174
+ | [req] | met/missed | [what's missing] |
175
+
176
+ ### Verify Findings (from /cbp-verify on the previous round)
177
+ | # | Source | File | Issue |
178
+ |---|--------|------|-------|
179
+ | [gate failure / proof gap / reviewer finding the previous verify could not auto-apply] |
180
+
181
+ ### Root Causes
182
+ 1. [root cause with explanation]
183
+ 2. [root cause with explanation]
184
+ ```
185
+
186
+ ### Step 4: Create Round in DB
187
+
188
+ **checkpoint KIND**: `codebyplan round add --task-id <uuid> --checkpoint-id <uuid> --number <N> --status in_progress --started-at <ISO> --triggered-by <user|claude|auto_loop> [--requirements <text>] [--context <json>]` (CLI write-through: writes local state at `.codebyplan/state/checkpoints/<checkpointId>/tasks/<taskId>/rounds/<roundId>.json` + REST). Break-glass fallback: MCP `add_round` when the CLI is unavailable.
189
+
190
+ **standalone KIND**: MCP `add_standalone_round(standalone_task_id, ...)` — standalone still uses MCP.
191
+
192
+ Fields to supply:
193
+ - `task_id` (checkpoint) / `standalone_task_id` (standalone): current task ID
194
+ - `number`: next round number
195
+ - `status`: "in_progress"
196
+ - `started_at`: now (ISO format)
197
+ - `triggered_by`: `"user"` | `"claude"` | `"auto_loop"` — `auto_loop` when `auto_loop_mode === true` carries forward; `claude` when auto-triggered by a verify failure; `user` otherwise
198
+ - `requirements`: round requirements from Step 3 / 3D
199
+ - `context`: when `auto_loop_mode === true`, persist `auto_loop_mode: true`, `auto_loop_index: N`, `auto_loop_cap: C` into `round.context`
200
+
201
+ ### Step 4b: Choose Mode (round 2+ only)
202
+
203
+ **If `round.context.auto_loop_mode === true` on the prior round**: skip the AskUserQuestion below. Auto-pick "Start round with these findings" using the Step 3D analysis directly. Set the next round's `auto_loop_mode = true`, carry `auto_loop_index` and `auto_loop_cap` forward.
204
+
205
+ **Else (manual mode)**, ask user via AskUserQuestion:
206
+
207
+ - **Start round with these findings** — use the Step 3D analysis as requirements
208
+ - **Discuss first** — open conversation about the analysis
209
+ - **Adjust** — user provides their own requirements
210
+
211
+ If "Discuss first": enter open discussion; when direction is clear, continue. If "Adjust": merge the user's requirements with the analysis context.
212
+
213
+ **Under `auto_loop_mode`**: requirements come VERBATIM from the prior round's reviewer findings and verify gate/proof failures, treated as a flat list. Test/gate failures are listed first (they block shipping); reviewer findings follow. Both sets are included unchanged — do not re-summarise or re-prioritise either.
214
+
215
+ ### Step 5: Load Context from DB
216
+
217
+ Load from checkpoint and task:
218
+ - Checkpoint context (decisions, dependencies, constraints, goal)
219
+ - Task context and requirements
220
+ - Resources from checkpoint and task (documentation links, API docs, guides)
221
+ - Previous round results (files_changed, verify outcomes)
222
+ - For round 2+: load the latest completed round's `context.verify_manifest` and `context.executor_output`:
223
+ - **checkpoint KIND**: read `.codebyplan/state/checkpoints/<checkpointId>/tasks/<taskId>/rounds/<roundId>.json` (local-first). If missing/stale, run `npx codebyplan sync` once and re-read. Break-glass fallback: MCP `get_rounds` when the state dir is absent and sync fails.
224
+ - **standalone KIND**: MCP `get_standalone_rounds(standalone_task_id)` — standalone still uses MCP.
225
+ - Identify unapproved files from task.files_changed (where user_approved === false)
226
+
227
+ ### Step 6: First Round Analysis (Round 1 only)
228
+
229
+ For the first round only:
230
+
231
+ 1. Analyze the task context and requirements thoroughly
232
+ 2. Identify any ambiguities or gaps
233
+ 3. If questions are needed, ask user via AskUserQuestion (max 4 per batch)
234
+ 4. If task context changes from Q&A answers:
235
+ - **checkpoint KIND**: `codebyplan task update --id <task-id> --checkpoint-id <uuid> --context <json>` (CLI write-through: local state at `.codebyplan/state/checkpoints/<checkpointId>/tasks/<taskId>.json` + REST). Break-glass fallback: MCP `update_task` when the CLI is unavailable.
236
+ - **standalone KIND**: MCP `update_standalone_task(standalone_task_id, context: {...})` — standalone still uses MCP.
237
+ - Save Q&A decisions as `context.decisions[]`
238
+
239
+ Skip this step for round 2+ (context already established via the Step 3D deep analysis).
240
+
241
+ **If `auto_loop_mode === true`, skip Q&A regardless of round number** — the auto-loop already has authoritative requirements from the prior round's findings.
242
+
243
+ ### Step 7: Spawn Round Planner Agent
244
+
245
+ Spawn `cbp-round-planner` agent with:
246
+ ```yaml
247
+ input:
248
+ task_number: N
249
+ round_number: N
250
+ requirements: task.requirements
251
+ round_requirements: [round-specific input from Step 3 / 3D]
252
+ checkpoint: {id, title, goal, context}
253
+ task: {id, title, requirements, context}
254
+ previous_rounds: {count, files_pending, files_changed, verify_manifest, unapproved_files}
255
+ ```
256
+
257
+ **Round 2+ context**: the planner receives the previous round's verify outcome and the list of unapproved files (from Step 3D).
258
+
259
+ **Priority**: if `round_requirements` is set (round 2+), the planner focuses on those specific goals while respecting `task.requirements` as context.
260
+
261
+ Wait for planner output. **If the spawn fails, STOP per "Planner Spawn Failure Is A Gate Failure" above** — do not self-certify a plan inline.
262
+
263
+ ### Step 8: Present Plan
264
+
265
+ Present the plan to user:
266
+
267
+ ```
268
+ ## Round [N] Plan
269
+
270
+ **Goal**: [goal]
271
+
272
+ ### Steps:
273
+ 1. [step]
274
+ 2. [step]
275
+ ...
276
+
277
+ ### Files to modify:
278
+ | File | Action | Purpose |
279
+ |------|--------|---------|
280
+ | ... | ... | ... |
281
+ ```
282
+
283
+ **Wave table** — when `approved_plan.waves[]` contains ≥2 entries, render a wave summary table BEFORE the files table:
284
+
285
+ ```
286
+ ### Execution Waves
287
+ | Wave | Agent type | Files | Depends on | Skill preloads |
288
+ |------|-----------|-------|-----------|----------------|
289
+ | web-ui | cbp-round-builder | 7 | — | cbp-frontend-design |
290
+ | backend-api | cbp-round-builder | 4 | — | — |
291
+ ```
292
+
293
+ Single-wave plans present the existing flat plan view (no wave table) — backward compatible.
294
+
295
+ **Plan approval is the `ask`-tier `Skill(cbp-round-build)` permission prompt** — there is NO approve/needs-changes/wrong AskUserQuestion here. After presenting the plan, proceed to Step 9, which auto-triggers `/cbp-round-build`; the harness then shows the `ask`-tier permission prompt, and confirming it IS the user's go-ahead on the plan.
296
+
297
+ **Denied-build handling** — if the user declines the `/cbp-round-build` permission, the plan does not run. Treat the decline as "the plan must change":
298
+
299
+ - **Minor changes**: collect the user's feedback, re-spawn `cbp-round-planner` with it as a constraint (re-run Step 7), present the revised plan, and re-trigger `/cbp-round-build`.
300
+ - **Wrong direction**: save the rejection reason to round context and re-run this skill's deep-analysis path (Step 3D) for new requirements.
301
+
302
+ **If `auto_loop_mode === true`**: the loop auto-approves — log `round.context.plan_approval = { mode: "auto_loop", auto_approved_at: <ISO> }`, surface a one-line note `"Auto-approved under auto_loop_mode (round N of cap C)"`, and proceed to Step 9 (the `/cbp-round-build` permission is auto-approved under the loop).
303
+
304
+ ### Step 9: Auto-trigger Round Build
305
+
306
+ Save planner output to round context, then trigger `/cbp-round-build`. The `ask`-tier permission prompt on `/cbp-round-build` is the user's plan approval (see Step 8).
307
+
308
+ - **checkpoint KIND**: `codebyplan round update --id <round-id> --task-id <uuid> --checkpoint-id <uuid> --context <json>` (CLI write-through: local state at `.codebyplan/state/checkpoints/<checkpointId>/tasks/<taskId>/rounds/<roundId>.json` + REST). Break-glass fallback: MCP `update_round` when the CLI is unavailable.
309
+ - **standalone KIND**: MCP `update_standalone_round(standalone_round_id, ...)` — standalone still uses MCP.
310
+
311
+ ```
312
+ Starting build phase...
313
+ ```
314
+
315
+ ## Fallback: Context Recovery
316
+
317
+ If this command is triggered **directly** (not via `/cbp-todo`) and no context is available in the session:
318
+
319
+ 1. Read `.codebyplan/repo.json` for `repo_id`
320
+ 2. Use Kind Detection to determine KIND, then:
321
+ - **checkpoint KIND**: Read local `.codebyplan/state/` files for checkpoint + task (break-glass: MCP `get_current_task`).
322
+ - **standalone KIND**: MCP `get_current_standalone_task`.
323
+ 3. Load round history:
324
+ - **checkpoint KIND**: Read `.codebyplan/state/checkpoints/<id>/tasks/<id>/rounds/*.json` (break-glass: MCP `get_rounds(task_id)`).
325
+ - **standalone KIND**: MCP `get_standalone_rounds(standalone_task_id)`.
326
+ 4. Continue from Step 1 (round 2+ deep analysis at Step 3D handles all context loading)
327
+
328
+ ## Key Rules
329
+
330
+ - **Planning ONLY** — no code execution, no testing
331
+ - Planner gets full context (checkpoint + task + previous rounds)
332
+ - Round 1 plans from `task.requirements`; round 2+ runs the MANDATORY Step 3D deep analysis (same depth as round 1 — no quick-fix behavior)
333
+ - Planner spawn failure is a HARD GATE FAILURE — STOP + retry directive, NEVER self-certify a plan inline (`rules/spawn-failure-is-gate-failure.md`)
334
+ - Claude NEVER git adds files in round commands
335
+
336
+ ## Integration
337
+
338
+ - **Reads (checkpoint KIND)**: `.codebyplan/state/checkpoints/<id>.json`, `checkpoints/<id>/tasks/<id>.json`, `checkpoints/<id>/tasks/<id>/rounds/<id>.json` (local-first; `npx codebyplan sync` on miss; MCP `get_current_task` / `get_rounds` as break-glass), file contents (Read tool, round 2+ deep analysis)
339
+ - **Reads (standalone KIND)**: MCP `get_current_standalone_task`, `get_standalone_rounds` — standalone still uses MCP
340
+ - **Writes (checkpoint KIND)**: `codebyplan round add` (Step 4), `codebyplan round update` (Step 9), `codebyplan task update` (Step 6 context only) — break-glass: MCP `add_round` / `update_round` / `update_task`
341
+ - **Writes (standalone KIND)**: MCP `add_standalone_round`, `update_standalone_round`, `update_standalone_task` — standalone still uses MCP
342
+ - **Spawns**: `cbp-round-planner` (spawn failure = hard gate failure → STOP)
343
+ - **Triggers**: `/cbp-round-build` (auto, on plan approval)
344
+ - **Triggered by**: `/cbp-task-start` (round 1), `/cbp-verify` (round 2+ fix round or more-work), `/cbp-todo` (after /clear), user manually
@@ -30,7 +30,7 @@ Snapshot the current next-action so the next `/cbp-session-start` (Step 4.5) can
30
30
  2. If `rows[0]` exists and its `command` is non-empty (active work in flight):
31
31
  ```yaml
32
32
  handoff:
33
- command: <rows[0].command> # e.g. "/cbp-round-update"
33
+ command: <rows[0].command> # e.g. "/cbp-verify"
34
34
  instructions: <rows[0].instructions> # human-readable trigger reason
35
35
  state: <rows[0].state> # workflow state label
36
36
  context: # entity ids used by the Step 4.5 freshness probe
@@ -79,12 +79,13 @@ If `branch_deleted === true`, run a conditional Supabase preview-branch teardown
79
79
  > Lifecycle contract: see [[supabase-branch-lifecycle]].
80
80
 
81
81
  - Read `FEAT_BRANCH` from the `feat_branch` field in the Step 3 JSON output — NOT from `git branch --show-current`. By the time Step 4 runs, `codebyplan ship` has already checked out the base branch (unless `--keep-feat` was passed), so the live branch is the base, not the feat branch.
82
- - Call `mcp__supabase__list_branches` with `project_id: rrvtrumtkhrsbhcyrwvf`.
82
+ - Resolve the parent project ref from config: `PARENT_REF=$(jq -r '.shipment.surfaces.supabase.project_ref' .codebyplan/shipment.json)` never a hardcoded literal. If `PARENT_REF` resolves empty or `null` (no Supabase surface configured), skip the teardown silently — there is no preview branch to remove.
83
+ - Call `mcp__supabase__list_branches` with `project_id: $PARENT_REF`.
83
84
  - Scan the returned list for an entry whose `name` exactly equals `$FEAT_BRANCH`.
84
85
  - If found: call `mcp__supabase__delete_branch` with its `branch_id`. Report the Supabase delete outcome alongside `pr_url` / `merge_commit` / `branch_deleted`.
85
86
  - If not found: no-op silently — the GitHub integration may have already removed the preview branch on PR close; not-found is success, NOT an error.
86
87
  - If the `list_branches` call itself fails (network, auth, or a non-success response — distinct from a successful lookup that returns no match): emit a non-blocking warning that the Supabase preview branch for `$FEAT_BRANCH` may still exist and should be verified in the dashboard. Do not treat an API failure as a not-found success.
87
- - Never delete the parent project `rrvtrumtkhrsbhcyrwvf` itself or any persistent/production branch.
88
+ - Never delete the parent project `$PARENT_REF` itself or any persistent/production branch.
88
89
  - This coordinates safely with `/cbp-checkpoint-end` — the existence-checked delete makes any second attempt a harmless no-op.
89
90
 
90
91
  ## Key Rules
@@ -9,11 +9,11 @@ effort: high
9
9
 
10
10
  # Standalone Task Check Command
11
11
 
12
- AI-driven production readiness review for standalone tasks. Spawns the `cbp-task-check` agent for thorough verification including user satisfaction discussion. This command is a thin orchestrator — the agent does the heavy lifting.
12
+ AI-driven production readiness review for standalone tasks. Spawns the `cbp-verify-reviewer` agent (`scope: 'task'`) for thorough verification including user satisfaction discussion. This command is a thin orchestrator — the agent does the heavy lifting.
13
13
 
14
- ## Inline-Fallback for Spawn Failure
14
+ ## Spawn Failure Is A Hard Gate Failure
15
15
 
16
- If the `cbp-task-check` agent spawn fails for any reason, follow the canonical inline-fallback procedure documented in `skills/cbp-round-end/SKILL.md` "Inline-fallback for any spawn failure". Walk every agent phase inline with the same Read/Grep depth the agent would have used do not skip phases.
16
+ If the `cbp-verify-reviewer` agent spawn fails for any reason, STOP and surface a retry directive per `rules/spawn-failure-is-gate-failure.md`. Do NOT walk the agent's phases inline and self-certify a missing fresh-context review is a hard gate failure, not a pass. Retry when capacity returns.
17
17
 
18
18
  ## When Used
19
19
 
@@ -34,7 +34,7 @@ Any multi-segment input is an error:
34
34
 
35
35
  ```
36
36
  standalone-task-check: argument `{value}` looks like a checkpoint-task pair.
37
- Use /cbp-task-check {chk}-{task} for checkpoint-bound tasks.
37
+ Use /cbp-verify {chk}-{task} for checkpoint-bound tasks.
38
38
  Standalone tasks use a bare number, e.g. /cbp-standalone-task-check 45.
39
39
  ```
40
40
 
@@ -44,7 +44,7 @@ Error cases: any multi-segment input, `abc`, `108-`, `-1`, anything with whitesp
44
44
 
45
45
  - `standalone-task-check 45` → standalone TASK-45
46
46
  - `standalone-task-check` (no arg) → active in-progress task via `get_current_standalone_task`
47
- - `standalone-task-check 141-3` → error: "Use /cbp-task-check {chk}-{task} for checkpoint-bound tasks."
47
+ - `standalone-task-check 141-3` → error: "Use /cbp-verify {chk}-{task} for checkpoint-bound tasks."
48
48
  - `standalone-task-check abc` → error: malformed
49
49
 
50
50
  ### Step 1.5: Get Current Task
@@ -66,7 +66,7 @@ If any rounds still in_progress:
66
66
  ## Cannot Run Standalone Task Check
67
67
 
68
68
  Standalone TASK-[N] has an active round (Round [N]). Complete it first:
69
- - Run `/cbp-round-update` to finish the round
69
+ - Run `/cbp-verify` to finish the round
70
70
  ```
71
71
 
72
72
  Stop here.
@@ -78,12 +78,13 @@ Stop here.
78
78
 
79
79
  No checkpoint context is needed — standalone tasks have no parent checkpoint.
80
80
 
81
- ### Step 4: Spawn Task Check Agent
81
+ ### Step 4: Spawn Verify Reviewer Agent
82
82
 
83
- Spawn `cbp-task-check` agent with full context:
83
+ Spawn `cbp-verify-reviewer` agent (`scope: 'task'`) with full context:
84
84
 
85
85
  ```yaml
86
86
  input:
87
+ scope: 'task'
87
88
  task_number: [N]
88
89
  round_number: [total rounds]
89
90
  checkpoint: null
@@ -117,7 +118,7 @@ Issues found that need addressing:
117
118
  - [issue 2]
118
119
  ```
119
120
 
120
- Suggest: `/cbp-round-input` with specific issues. Stop — wait for user.
121
+ Suggest: `/cbp-round-plan` with specific issues. Stop — wait for user.
121
122
 
122
123
  **NOT READY — needs new task:**
123
124
 
@@ -25,7 +25,7 @@ Any multi-segment input is an error:
25
25
 
26
26
  ```
27
27
  standalone-task-complete: argument `{value}` looks like a checkpoint-task pair.
28
- Use /cbp-task-complete {chk}-{task} for checkpoint-bound tasks.
28
+ Use /cbp-finalize {chk}-{task} for checkpoint-bound tasks.
29
29
  Standalone tasks use a bare number, e.g. /cbp-standalone-task-complete 45.
30
30
  ```
31
31
 
@@ -35,7 +35,7 @@ Error cases: any multi-segment input, `abc`, `108-`, `-1`, anything with whitesp
35
35
 
36
36
  - `standalone-task-complete 45` → standalone TASK-45
37
37
  - `standalone-task-complete` (no arg) → active in-progress task via `get_current_standalone_task`
38
- - `standalone-task-complete 141-3` → error: "Use /cbp-task-complete {chk}-{task} for checkpoint-bound tasks."
38
+ - `standalone-task-complete 141-3` → error: "Use /cbp-finalize {chk}-{task} for checkpoint-bound tasks."
39
39
  - `standalone-task-complete abc` → error: malformed
40
40
 
41
41
  ### Step 1.5: Get Current Task
@@ -56,7 +56,7 @@ If any round is `in_progress`:
56
56
  ```
57
57
  ## Cannot Complete Standalone Task
58
58
 
59
- Standalone TASK-[N] has an active round (Round [N]). Run `/cbp-round-update` to finish it.
59
+ Standalone TASK-[N] has an active round (Round [N]). Run `/cbp-verify` to finish it.
60
60
  ```
61
61
 
62
62
  Stop here.
@@ -66,7 +66,7 @@ Verify at least one round has `testing_qa_output` in its context. If not:
66
66
  ```
67
67
  ## Cannot Complete Standalone Task
68
68
 
69
- No testing-qa-agent validation found. Run `/cbp-round-start` to execute a validated round.
69
+ No testing-qa-agent validation found. Run `/cbp-round-plan` to execute a validated round.
70
70
  ```
71
71
 
72
72
  Stop here.
@@ -179,18 +179,17 @@ When `branch_deleted === true` in the ship JSON:
179
179
 
180
180
  ### Step 7.5: Complete Standalone Task
181
181
 
182
- Note: `complete_standalone_task` is called only after `codebyplan ship` succeeds (no `checks_failed`) — the DB completion record reflects work that has landed in production.
182
+ Note: completion is called only after `codebyplan ship` succeeds (no `checks_failed`) — the DB completion record reflects work that has landed in production.
183
183
 
184
- Resolve caller worktree: `CALLER_WT=$(npx codebyplan resolve-worktree 2>/dev/null)`.
184
+ Complete via the CLI (wraps the `complete_standalone_task` MCP tool):
185
185
 
186
- Call `complete_standalone_task(standalone_task_id, caller_worktree_id: CALLER_WT)`. `caller_worktree_id` is REQUIRED — the MCP server's pre-guard rejects mutations from non-matching worktrees. The server auto-clears `assigned_worktree_id` on the task on success.
186
+ ```bash
187
+ codebyplan standalone-task complete --id <standalone_task.id>
188
+ ```
187
189
 
188
- If `CALLER_WT` is empty, surface this warning and ask user to confirm before proceeding:
190
+ The CLI auto-resolves `caller_worktree_id` (override → worktree cache → resolver). `caller_worktree_id` is REQUIRED the MCP server's pre-guard rejects mutations from non-matching worktrees, and the CLI hard-fails (exit 1) with registration guidance rather than sending an undefined id. The server auto-clears `assigned_worktree_id` on the task on success.
189
191
 
190
- ```
191
- Warning: could not resolve caller_worktree_id (npx codebyplan resolve-worktree returned empty).
192
- The complete_standalone_task call may be rejected by the pre-guard. Proceed anyway? (yes / no)
193
- ```
192
+ If the CLI exits 1 with a "could not resolve caller_worktree_id" message, run `npx codebyplan setup` (or `codebyplan resolve-worktree --cache`) from this worktree, then re-run the command.
194
193
 
195
194
  ### Step 8: Run Cleanup + Migration (inline)
196
195
 
@@ -238,6 +237,6 @@ Do NOT use AskUserQuestion for routing. Do NOT use the Skill tool to auto-trigge
238
237
  - **Chain**: `/cbp-standalone-task-check` → `/cbp-standalone-task-testing` → `/cbp-standalone-task-complete`
239
238
  - **Delegates to**: `codebyplan ship` CLI (Step 7 — PR creation, check polling, merge, branch cleanup)
240
239
  - **Reads**: MCP `get_current_standalone_task`, `get_standalone_tasks`, `get_standalone_rounds`
241
- - **Writes**: MCP `update_standalone_task`, `complete_standalone_task`
240
+ - **Writes**: MCP `update_standalone_task` (Step 6 files); `codebyplan standalone-task complete` (wraps `complete_standalone_task`)
242
241
  - **Uses skills (inline, no sub-agent)**: `cleanup` (if deletions), `migration` (if exports renamed)
243
242
  - **Does NOT** auto-trigger next skill — emits single directive only
@@ -17,7 +17,7 @@ Create a new standalone task — independent of any checkpoint. Gathers user con
17
17
 
18
18
  ## Identifier Notation
19
19
 
20
- Standalone tasks use a bare number (e.g. `45` = standalone TASK-45). There is no checkpoint segment. Canonical notation follows `cbp-round-start` Step 0 "CHK / TASK / ROUND Identifier Notation Vocabulary".
20
+ Standalone tasks use a bare number (e.g. `45` = standalone TASK-45). There is no checkpoint segment. Canonical notation follows `cbp-round-plan` Step 0 "CHK / TASK / ROUND Identifier Notation Vocabulary".
21
21
 
22
22
  ## Instructions
23
23
 
@@ -96,13 +96,20 @@ Resolve worktree_id via `npx codebyplan resolve-worktree 2>/dev/null`.
96
96
 
97
97
  ### Step 7: Create Standalone Task
98
98
 
99
- Use MCP `create_standalone_task` with:
100
- - **repo_id**: from `.codebyplan/repo.json`
101
- - **title**: Concise task title
102
- - **number**: next available number from Step 3
103
- - **requirements**: Numbered requirements list
104
- - **context**: Include decisions from Q&A and source findings
105
- - **assigned_worktree_id**: from Step 6 (if resolved)
99
+ Create via the CLI (wraps the `create_standalone_task` MCP tool; auto-resolves `caller_worktree_id`):
100
+
101
+ ```bash
102
+ codebyplan standalone-task create \
103
+ --title "<concise task title>" \
104
+ --number <next number from Step 3> \
105
+ --requirements "<numbered requirements list>" \
106
+ --context '<JSON: decisions from Q&A + source findings>' \
107
+ --assigned-worktree-id <from Step 6, if resolved>
108
+ ```
109
+
110
+ - `--repo-id` is optional — the CLI reads it from `.codebyplan/repo.json`.
111
+ - Omit `--assigned-worktree-id` when Step 6 did not resolve a worktree.
112
+ - On success the CLI prints the created row JSON (including `.id`) to stdout.
106
113
 
107
114
  ```
108
115
  ## Standalone Task Created
@@ -145,6 +152,6 @@ Waiting for user to decide next step.
145
152
  ## Integration
146
153
 
147
154
  - **Reads**: MCP `get_standalone_tasks`
148
- - **Writes**: MCP `create_standalone_task`
155
+ - **Writes**: `codebyplan standalone-task create` (wraps `create_standalone_task` MCP tool)
149
156
  - **Triggered by**: user manual
150
157
  - **Does NOT auto-trigger** next command — user decides
@@ -149,13 +149,17 @@ Load context from DB:
149
149
 
150
150
  ### Step 5: Set Task Status
151
151
 
152
- Use MCP `update_standalone_task(task_id, status: "in_progress")`.
152
+ Set status via the CLI (wraps `update_standalone_task`; auto-resolves `caller_worktree_id`):
153
153
 
154
- If `CALLER_WT` is present, include `caller_worktree_id: CALLER_WT`.
154
+ ```bash
155
+ codebyplan standalone-task update --id <task.id> --status in_progress
156
+ ```
157
+
158
+ `--id` is the standalone task UUID resolved in Step 2. The CLI resolves `caller_worktree_id` itself (override → worktree cache → resolver), so `CALLER_WT` does not need to be passed.
155
159
 
156
160
  ### Step 6: Auto-trigger Round Start
157
161
 
158
- Trigger `/cbp-round-start` with no argument. Do NOT pass the task number — round-start's 2-segment form means standalone TASK-{a} round {b}, not a checkpoint task. Passing no argument causes round-start to derive the active task/round from state, which is correct.
162
+ Trigger `/cbp-round-plan` with no argument. Do NOT pass the task number — round-start's 2-segment form means standalone TASK-{a} round {b}, not a checkpoint task. Passing no argument causes round-start to derive the active task/round from state, which is correct.
159
163
 
160
164
  ```
161
165
  Starting first round...
@@ -164,5 +168,5 @@ Starting first round...
164
168
  ## Integration
165
169
 
166
170
  - **Reads**: MCP `get_standalone_tasks`, `get_current_standalone_task`, `get_standalone_rounds`
167
- - **Writes**: MCP `update_standalone_task`
168
- - **Triggers**: `/cbp-round-start` (no argument — auto, round 1)
171
+ - **Writes**: `codebyplan standalone-task update` (Step 5 status); MCP `update_standalone_task` (Step 3.4 branch_name persist)
172
+ - **Triggers**: `/cbp-round-plan` (no argument — auto, round 1)
@@ -19,7 +19,7 @@ Comprehensive task-level testing for standalone tasks — the **cross-round doub
19
19
 
20
20
  ## Scope vs Round-Level Validation
21
21
 
22
- Per-wave `testing-qa-agent` runs inside `/cbp-round-execute` Step 5 and **owns per-round QA**: per-app build/lint/types, the `console.log`/debug scan, the OWASP/secret full-diff grep, and `pnpm audit`. This skill does NOT repeat them. It adds only the cross-round layer invisible within a single round: workspace-wide lint, workspace tsc, and the full test suite (which catch cross-package breakage), plus the cross-round code review (Step 6.5) and the user manual walkthrough (Step 8).
22
+ Per-wave `testing-qa-agent` runs inside `/cbp-round-build` Step 5 and **owns per-round QA**: per-app build/lint/types, the `console.log`/debug scan, the OWASP/secret full-diff grep, and `pnpm audit`. This skill does NOT repeat them. It adds only the cross-round layer invisible within a single round: workspace-wide lint, workspace tsc, and the full test suite (which catch cross-package breakage), plus the cross-round code review (Step 6.5) and the user manual walkthrough (Step 8).
23
23
 
24
24
  ## Instructions
25
25
 
@@ -34,7 +34,7 @@ Any multi-segment input is an error:
34
34
 
35
35
  ```
36
36
  standalone-task-testing: argument `{value}` looks like a checkpoint-task pair.
37
- Use /cbp-task-testing {chk}-{task} for checkpoint-bound tasks.
37
+ Use /cbp-verify {chk}-{task} for checkpoint-bound tasks.
38
38
  Standalone tasks use a bare number, e.g. /cbp-standalone-task-testing 45.
39
39
  ```
40
40
 
@@ -57,7 +57,7 @@ Use MCP `get_standalone_rounds(standalone_task_id)`. Verify all rounds are `comp
57
57
  ## Cannot Run Standalone Task Testing
58
58
 
59
59
  Standalone TASK-[N] has an active round (Round [N]). Complete it first:
60
- - Run `/cbp-round-update` to finish the round
60
+ - Run `/cbp-verify` to finish the round
61
61
  ```
62
62
 
63
63
  Stop.
@@ -185,11 +185,11 @@ Next: /cbp-standalone-task-complete {N}
185
185
  ---
186
186
 
187
187
  **Next:**
188
- Run `/cbp-round-input` to address the minor issues found during testing.
188
+ Run `/cbp-round-plan` to address the minor issues found during testing.
189
189
 
190
190
  ---
191
191
 
192
- Waiting for user to run `/cbp-round-input`.
192
+ Waiting for user to run `/cbp-round-plan`.
193
193
 
194
194
  **Major problems found:**
195
195