codebyplan 1.13.13 → 1.13.15
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/dist/cli.js +319 -63
- package/package.json +1 -1
- package/templates/agents/cbp-e2e-maestro.md +26 -3
- package/templates/agents/cbp-e2e-playwright.md +24 -3
- package/templates/agents/cbp-e2e-tauri.md +25 -2
- package/templates/agents/cbp-e2e-vscode.md +28 -3
- package/templates/agents/cbp-e2e-xcuitest.md +40 -4
- package/templates/agents/cbp-task-check.md +2 -0
- package/templates/context/testing/e2e.md +57 -9
- package/templates/hooks/validate-structure-patterns.sh +1 -1
- package/templates/rules/e2e-mandatory.md +19 -2
- package/templates/rules/task-routing-recommendation.md +51 -0
- package/templates/settings.project.base.json +8 -1
- package/templates/skills/cbp-checkpoint-end/SKILL.md +18 -1
- package/templates/skills/cbp-frontend-ui/SKILL.md +9 -7
- package/templates/skills/cbp-round-check/SKILL.md +28 -4
- package/templates/skills/cbp-round-end/SKILL.md +35 -12
- package/templates/skills/cbp-round-execute/SKILL.md +60 -13
- package/templates/skills/cbp-round-input/SKILL.md +31 -10
- package/templates/skills/cbp-round-start/SKILL.md +35 -14
- package/templates/skills/cbp-round-update/SKILL.md +43 -12
- package/templates/skills/cbp-standalone-task-check/SKILL.md +152 -0
- package/templates/skills/cbp-standalone-task-complete/SKILL.md +201 -0
- package/templates/skills/cbp-standalone-task-create/SKILL.md +150 -0
- package/templates/skills/cbp-standalone-task-start/SKILL.md +177 -0
- package/templates/skills/cbp-standalone-task-testing/SKILL.md +210 -0
- package/templates/skills/cbp-task-check/SKILL.md +5 -5
- package/templates/skills/cbp-task-complete/SKILL.md +9 -22
- package/templates/skills/cbp-task-create/SKILL.md +11 -31
- package/templates/skills/cbp-task-start/SKILL.md +6 -13
- package/templates/skills/cbp-task-testing/SKILL.md +5 -5
|
@@ -5,6 +5,27 @@ description: Summary wrap-up after testing phase completes
|
|
|
5
5
|
effort: high
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## Kind Detection
|
|
9
|
+
|
|
10
|
+
Inspect the resolved identifier from argument parsing to determine the task kind:
|
|
11
|
+
|
|
12
|
+
| Identifier shape | KIND |
|
|
13
|
+
|-----------------|------|
|
|
14
|
+
| `{task}-{round}` (2-segment, e.g. `45-2`) | `standalone` |
|
|
15
|
+
| `{chk}-{task}-{round}` (3-segment, e.g. `141-3-1`) | `checkpoint` |
|
|
16
|
+
| _(empty / free-text)_ | Check `get_current_standalone_task` first; if found → `standalone`. Else → `checkpoint` via `get_current_task`. |
|
|
17
|
+
|
|
18
|
+
Set `KIND` for the rest of this skill. MCP tool names vary by KIND:
|
|
19
|
+
|
|
20
|
+
| Operation | `checkpoint` KIND | `standalone` KIND |
|
|
21
|
+
|-----------|------------------|-------------------|
|
|
22
|
+
| Get task | `get_current_task(repo_id)` | `get_current_standalone_task(repo_id)` |
|
|
23
|
+
| Get rounds | `get_rounds(task_id)` | `get_standalone_rounds(standalone_task_id)` |
|
|
24
|
+
| Add round | `add_round(task_id, ...)` | `add_standalone_round(standalone_task_id, ...)` |
|
|
25
|
+
| Update round | `update_round(round_id, ...)` | `update_standalone_round(standalone_round_id, ...)` |
|
|
26
|
+
| 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 |
|
|
27
|
+
| Update task | `update_task(task_id, ...)` | `update_standalone_task(standalone_task_id, ...)` |
|
|
28
|
+
|
|
8
29
|
# Round End Command
|
|
9
30
|
|
|
10
31
|
Summary phase — presents what was done, then runs code quality review to catch bugs and logic errors that automated checks miss.
|
|
@@ -21,14 +42,16 @@ See `reference/inline-fallback.md` for full trigger table, procedure, and covera
|
|
|
21
42
|
|
|
22
43
|
## Identifier Notation
|
|
23
44
|
|
|
24
|
-
This skill operates on the **active** task/round resolved via MCP
|
|
45
|
+
This skill operates on the **active** task/round resolved via MCP and does not accept a positional identifier argument. Canonical chk-task-round notation — used in prose, error messages, and cross-references — follows `.claude/rules/notation-consistency.md` "CHK / TASK / ROUND Identifier Notation": `108-1` (CHK-108 TASK-1), `45` (standalone TASK-45), `108-1-2` (round 2 of CHK-108 TASK-1), `45-2` (round 2 of standalone TASK-45).
|
|
25
46
|
|
|
26
47
|
## Instructions
|
|
27
48
|
|
|
28
49
|
### Step 1: Get Current Task and Round
|
|
29
50
|
|
|
30
|
-
Use
|
|
31
|
-
|
|
51
|
+
Use Kind Detection above to set KIND. Then:
|
|
52
|
+
|
|
53
|
+
- **checkpoint KIND**: MCP `get_current_task(repo_id)` (pass `checkpoint_id` if known) to find the active task. MCP `get_rounds(task_id)` to find the in-progress round.
|
|
54
|
+
- **standalone KIND**: MCP `get_current_standalone_task(repo_id)` to find the active task. MCP `get_standalone_rounds(standalone_task_id)` to find the in-progress round.
|
|
32
55
|
|
|
33
56
|
Load round context with all outputs (executor_output, testing_qa_output, reviewer_output).
|
|
34
57
|
|
|
@@ -70,11 +93,11 @@ Merge with previous rounds (supersede items for re-modified files, preserve veri
|
|
|
70
93
|
|
|
71
94
|
### Step 4: Update Task Files and QA
|
|
72
95
|
|
|
73
|
-
Update via MCP:
|
|
96
|
+
Update via MCP using KIND-appropriate tools:
|
|
74
97
|
|
|
75
|
-
- `update_task(task_id, files_changed: [...])` — merge with existing
|
|
76
|
-
- `update_round(round_id, files_changed: [...], qa: {items: [auto_qa items + default_checklist items]})` — round-specific
|
|
77
|
-
- `update_task(task_id, qa: {items: [auto_qa items + default_checklist items]})` — aggregated
|
|
98
|
+
- `update_task(task_id, files_changed: [...])` / `update_standalone_task(standalone_task_id, files_changed: [...])` — merge with existing
|
|
99
|
+
- `update_round(round_id, files_changed: [...], qa: {items: [auto_qa items + default_checklist items]})` / `update_standalone_round(standalone_round_id, ...)` — round-specific
|
|
100
|
+
- `update_task(task_id, qa: {items: [auto_qa items + default_checklist items]})` / `update_standalone_task(standalone_task_id, qa: {items: [auto_qa items + default_checklist items]})` — aggregated
|
|
78
101
|
|
|
79
102
|
### Step 5: Present Summary
|
|
80
103
|
|
|
@@ -137,8 +160,8 @@ Example tables and the `inline` option gating spec: see `reference/findings-pres
|
|
|
137
160
|
- Auto-accept ALL findings into `improve_round_findings[]` regardless of severity (the user opted into the loop).
|
|
138
161
|
- Skip the polish-spiral stop-gate (auto-loop has its own cap-exhausted termination).
|
|
139
162
|
- Skip the user findings-decision prompt.
|
|
140
|
-
- Save findings via `update_round` exactly as in manual mode.
|
|
141
|
-
- Auto-trigger `/cbp-round-update` immediately. round-update Step
|
|
163
|
+
- Save findings via `update_round` / `update_standalone_round` per KIND exactly as in manual mode.
|
|
164
|
+
- Auto-trigger `/cbp-round-update` immediately. round-update Step 4 will decide whether to spawn another round or exit clean (see cbp-round-update SKILL.md Step 4).
|
|
142
165
|
|
|
143
166
|
**Else (manual mode — flag absent or false):**
|
|
144
167
|
|
|
@@ -146,7 +169,7 @@ Run the existing flow:
|
|
|
146
169
|
|
|
147
170
|
1. After round 2+, surface the polish-spiral stop-gate per `polish-spiral-stop-gate.md` (defer-to-followups vs continue).
|
|
148
171
|
2. Surface the findings-decision AskUserQuestion (with optional `inline` per the gating rules in `reference/findings-presentation.md`).
|
|
149
|
-
3. Save accepted/rejected findings to round context via MCP `update_round
|
|
172
|
+
3. Save accepted/rejected findings to round context via MCP `update_round` / `update_standalone_round` per KIND:
|
|
150
173
|
```json
|
|
151
174
|
{
|
|
152
175
|
"context": {
|
|
@@ -167,7 +190,7 @@ Run the existing flow:
|
|
|
167
190
|
## Integration
|
|
168
191
|
|
|
169
192
|
- **Triggered by**: `/cbp-round-execute` (auto, after all waves + testing complete)
|
|
170
|
-
- **Reads**: MCP `get_current_task`, `get_rounds
|
|
171
|
-
- **Writes**: MCP `update_round`, `update_task` (files_changed, qa, findings)
|
|
193
|
+
- **Reads**: MCP `get_current_task` / `get_current_standalone_task`, `get_rounds` / `get_standalone_rounds` (per KIND), round context
|
|
194
|
+
- **Writes**: MCP `update_round` / `update_standalone_round`, `update_task` / `update_standalone_task` (files_changed, qa, findings) — per KIND
|
|
172
195
|
- **Spawns**: `cbp-improve-round` (code quality review)
|
|
173
196
|
- **Triggers**: `/cbp-round-update` (auto, after findings handled)
|
|
@@ -5,6 +5,27 @@ description: Execute the approved plan from /cbp-round-start — runs per-wave e
|
|
|
5
5
|
effort: xhigh
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## Kind Detection
|
|
9
|
+
|
|
10
|
+
Inspect the resolved identifier from argument parsing to determine the task kind:
|
|
11
|
+
|
|
12
|
+
| Identifier shape | KIND |
|
|
13
|
+
|-----------------|------|
|
|
14
|
+
| `{task}-{round}` (2-segment, e.g. `45-2`) | `standalone` |
|
|
15
|
+
| `{chk}-{task}-{round}` (3-segment, e.g. `141-3-1`) | `checkpoint` |
|
|
16
|
+
| _(empty / free-text)_ | Check `get_current_standalone_task` first; if found → `standalone`. Else → `checkpoint` via `get_current_task`. |
|
|
17
|
+
|
|
18
|
+
Set `KIND` for the rest of this skill. MCP tool names vary by KIND:
|
|
19
|
+
|
|
20
|
+
| Operation | `checkpoint` KIND | `standalone` KIND |
|
|
21
|
+
|-----------|------------------|-------------------|
|
|
22
|
+
| Get task | `get_current_task(repo_id)` | `get_current_standalone_task(repo_id)` |
|
|
23
|
+
| Get rounds | `get_rounds(task_id)` | `get_standalone_rounds(standalone_task_id)` |
|
|
24
|
+
| Add round | `add_round(task_id, ...)` | `add_standalone_round(standalone_task_id, ...)` |
|
|
25
|
+
| Update round | `update_round(round_id, ...)` | `update_standalone_round(standalone_round_id, ...)` |
|
|
26
|
+
| 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 |
|
|
27
|
+
| Update task | `update_task(task_id, ...)` | `update_standalone_task(standalone_task_id, ...)` |
|
|
28
|
+
|
|
8
29
|
# Round Execute Command
|
|
9
30
|
|
|
10
31
|
Execution and validation phase. Receives the approved plan from `/cbp-round-start`, dispatches wave executors, runs per-wave `cbp-testing-qa-agent` in parallel, and routes to `/cbp-round-end`.
|
|
@@ -17,14 +38,16 @@ Execution and validation phase. Receives the approved plan from `/cbp-round-star
|
|
|
17
38
|
|
|
18
39
|
## Identifier Notation
|
|
19
40
|
|
|
20
|
-
This skill operates on the **active** task/round resolved via MCP
|
|
41
|
+
This skill operates on the **active** task/round resolved via MCP and does not accept a positional identifier argument. Canonical chk-task-round notation — used in prose, error messages, and cross-references — follows `.claude/rules/notation-consistency.md` "CHK / TASK / ROUND Identifier Notation": `108-1` (CHK-108 TASK-1), `45` (standalone TASK-45), `108-1-2` (round 2 of CHK-108 TASK-1), `45-2` (round 2 of standalone TASK-45).
|
|
21
42
|
|
|
22
43
|
## Instructions
|
|
23
44
|
|
|
24
45
|
### Step 1: Get Current Task and Round
|
|
25
46
|
|
|
26
|
-
Use
|
|
27
|
-
|
|
47
|
+
Use Kind Detection above to set KIND. Then:
|
|
48
|
+
|
|
49
|
+
- **checkpoint KIND**: MCP `get_current_task(repo_id)` (pass checkpoint_id if known) to find the active task. MCP `get_rounds(task_id)` to find the in-progress round.
|
|
50
|
+
- **standalone KIND**: MCP `get_current_standalone_task(repo_id)` to find the active task. MCP `get_standalone_rounds(standalone_task_id)` to find the in-progress round.
|
|
28
51
|
|
|
29
52
|
If no in-progress round: `No active round. Run /cbp-round-start first.`
|
|
30
53
|
|
|
@@ -161,11 +184,35 @@ Input contracts: `cbp-testing-qa-agent` receives `executor_output`, `testing_pro
|
|
|
161
184
|
|
|
162
185
|
### Step 5b: Post-E2E Screenshot Review (cbp-frontend-ui Phase 6.5)
|
|
163
186
|
|
|
164
|
-
Aggregate
|
|
187
|
+
Aggregate across ALL specialists that ran:
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
screenshots = Object.values(round.context.e2e_outputs ?? {}).flatMap(o => o.screenshots ?? []);
|
|
191
|
+
e2e_gallery = Object.values(round.context.e2e_outputs ?? {}).flatMap(o => o.e2e_gallery ?? []);
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Auto-new baseline handling**: for each entry in `e2e_gallery` where `is_new === true`, the
|
|
195
|
+
specialist has already run `git add <committed_path>`. No additional user gate is needed.
|
|
196
|
+
**Changed-baseline handling**: entries where `is_new === false` AND `baseline_diff_pct > threshold`
|
|
197
|
+
are `visual_regression` — do NOT auto-accept; surface as blocking gate at Step 7.
|
|
198
|
+
|
|
199
|
+
Persist `e2e_gallery` to `round.context.e2e_gallery` (additive alongside existing
|
|
200
|
+
`round.context.e2e_outputs`). This field is consumed by TASK-3 / checkpoint-end for DB upload.
|
|
201
|
+
Note: `e2e_gallery[]` is aggregated and persisted regardless of whether `cbp-frontend-ui` runs — the empty-gallery enforcement lives in `cbp-task-check` Phase 4, while the `screenshots[]` visual review (frontend-ui Phase 6.5) is a separate concern gated on `screenshots[]` being non-empty.
|
|
202
|
+
|
|
203
|
+
When the aggregated `screenshots` list is non-empty, invoke the `cbp-frontend-ui` skill with
|
|
204
|
+
`phase: 'screenshot_review'` (input: `files_changed`, `e2e_screenshots: <aggregated screenshots>`,
|
|
205
|
+
`context: { checkpoint_goal, round_requirements }`). Under this phase the skill runs only
|
|
206
|
+
Phase 6.5 (Rendered-Output Visual Review) + 7 + 8 — Phases 1-6 (style) already ran at Step 3.8.
|
|
165
207
|
|
|
166
|
-
Persist findings to `round.context.frontend_ui_review` (merge with Step 3.8's style-only output
|
|
208
|
+
Persist findings to `round.context.frontend_ui_review` (merge with Step 3.8's style-only output
|
|
209
|
+
if present). Baseline-regression findings surface as a BLOCKING gate at `/cbp-round-end` Step 7
|
|
210
|
+
(an explicit accept-or-fix user decision; changed baselines are NEVER auto-accepted);
|
|
211
|
+
rendered_visual critical findings are surfaced in the Step 7 findings presentation. Neither
|
|
212
|
+
auto-fails the round. cbp-testing-qa-agent does NOT read these findings (full independence).
|
|
167
213
|
|
|
168
|
-
**Skip** when `round.context.e2e_outputs` is absent/empty, the aggregated `screenshots` list
|
|
214
|
+
**Skip** when `round.context.e2e_outputs` is absent/empty, the aggregated `screenshots` list
|
|
215
|
+
is empty, or `testing_profile === 'claude_only'`.
|
|
169
216
|
|
|
170
217
|
### Step 6: Hard-Fail Routing
|
|
171
218
|
|
|
@@ -178,7 +225,7 @@ Per-wave hard-fail signal — true when ANY hold:
|
|
|
178
225
|
**All waves hard_fail: false** → proceed to Step 7. **Any wave hard_fail: true**:
|
|
179
226
|
|
|
180
227
|
- **Simple fixes** (type errors, lint, missing imports, test assertion fixes, e2e `real`-category with clear code-side root cause, no prior re-trigger this round) → save failure details to round context; retrigger the failing wave's executor; re-run testing-qa AND the eligible `cbp-e2e-*` specialists for that wave.
|
|
181
|
-
- **Structural OR already re-triggered once OR e2e preflight aborts OR `e2e_eligible_skipped`** → save failure context via MCP `update_round
|
|
228
|
+
- **Structural OR already re-triggered once OR e2e preflight aborts OR `e2e_eligible_skipped`** → save failure context via MCP `update_round` / `update_standalone_round` per KIND; auto-trigger `/cbp-round-input`. STOP.
|
|
182
229
|
|
|
183
230
|
## Inline execution fallback
|
|
184
231
|
|
|
@@ -190,11 +237,11 @@ When `cbp-testing-qa-agent` spawn fails OR the resolved `testing_profile` is `cl
|
|
|
190
237
|
|
|
191
238
|
### Step 7: Save Executor Output
|
|
192
239
|
|
|
193
|
-
Update round context via MCP `update_round
|
|
240
|
+
Update round context via MCP `update_round` / `update_standalone_round` per KIND:
|
|
194
241
|
|
|
195
|
-
- `context`: { ...existing, executor_output, testing_qa_output, e2e_eligible, e2e_outputs, frontend_ui_review }
|
|
242
|
+
- `context`: { ...existing, executor_output, testing_qa_output, e2e_eligible, e2e_outputs, e2e_gallery, frontend_ui_review }
|
|
196
243
|
|
|
197
|
-
`e2e_outputs` (a framework-keyed map of specialist outputs, e.g. `{ playwright: {...}, maestro: {...} }`) and `frontend_ui_review` are present only when the gates above admitted them (≥1 eligible framework ran AND Step 5b ran). `e2e_eligible[]` records which frameworks were eligible this round and drives the Step 6 `e2e_eligible_skipped` check.
|
|
244
|
+
`e2e_outputs` (a framework-keyed map of specialist outputs, e.g. `{ playwright: {...}, maestro: {...} }`), `e2e_gallery` (aggregated flat array of committed-PNG entries across all specialists — consumed by TASK-3 / checkpoint-end for DB upload), and `frontend_ui_review` are present only when the gates above admitted them (≥1 eligible framework ran AND Step 5b ran). `e2e_eligible[]` records which frameworks were eligible this round and drives the Step 6 `e2e_eligible_skipped` check.
|
|
198
245
|
|
|
199
246
|
### Step 8: Auto-trigger Round End
|
|
200
247
|
|
|
@@ -211,13 +258,13 @@ Trigger `/cbp-round-end`.
|
|
|
211
258
|
- `testing_profile` from `task.context` governs which checks run — read it once in Step 2; pass to every testing-qa + e2e specialist spawn
|
|
212
259
|
- `claude_only` profile skips all agent spawns (testing-qa AND `cbp-e2e-*`); runs hook syntax and skill structure checks inline
|
|
213
260
|
- E2E dispatch is **config-driven and opt-out** (`.codebyplan/e2e.json`), not gated on `has_ui_work`/`testing_profile` — an eligible framework that silently does not run is an `e2e_eligible_skipped` hard-fail (`rules/e2e-mandatory.md`)
|
|
214
|
-
- Step 5b (cbp-frontend-ui Phase 6.5) runs only when e2e produced screenshots — gated on the aggregated `e2e_outputs[*].screenshots[]` being non-empty
|
|
261
|
+
- Step 5b (cbp-frontend-ui Phase 6.5) runs only when e2e produced screenshots — gated on the aggregated `e2e_outputs[*].screenshots[]` being non-empty; `e2e_gallery[]` is always aggregated and persisted when any specialist ran
|
|
215
262
|
- Claude NEVER git adds files in round commands
|
|
216
263
|
|
|
217
264
|
## Integration
|
|
218
265
|
|
|
219
|
-
- **Reads**: MCP `get_current_task`, `get_rounds`
|
|
220
|
-
- **Writes**: MCP `update_round` (context with executor_output + testing_qa_output + e2e_eligible + e2e_outputs + frontend_ui_review)
|
|
266
|
+
- **Reads**: MCP `get_current_task` / `get_current_standalone_task`, `get_rounds` / `get_standalone_rounds` (per KIND)
|
|
267
|
+
- **Writes**: MCP `update_round` / `update_standalone_round` (context with executor_output + testing_qa_output + e2e_eligible + e2e_outputs + e2e_gallery + frontend_ui_review) — per KIND
|
|
221
268
|
- **Spawns**: `cbp-round-executor` (per wave or single), `cbp-testing-qa-agent` (per wave, parallel sibling of the `cbp-e2e-*` specialists), the `cbp-e2e-*` specialists (config-driven dispatch per `context/testing/e2e.md`, one per eligible framework in `.codebyplan/e2e.json`), `cbp-database-agent` (if DB work), `cbp-security-agent` (if security review needed)
|
|
222
269
|
- **Skill invocations**: `cbp-frontend-ui` at Step 5b with `phase: 'screenshot_review'` (post-e2e)
|
|
223
270
|
- **Triggers**: `/cbp-round-end` (auto)
|
|
@@ -6,6 +6,27 @@ argument-hint: [chk-task-round | task-round | requirements-text]
|
|
|
6
6
|
effort: xhigh
|
|
7
7
|
---
|
|
8
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. MCP tool names vary by KIND:
|
|
20
|
+
|
|
21
|
+
| Operation | `checkpoint` KIND | `standalone` KIND |
|
|
22
|
+
|-----------|------------------|-------------------|
|
|
23
|
+
| Get task | `get_current_task(repo_id)` | `get_current_standalone_task(repo_id)` |
|
|
24
|
+
| Get rounds | `get_rounds(task_id)` | `get_standalone_rounds(standalone_task_id)` |
|
|
25
|
+
| Add round | `add_round(task_id, ...)` | `add_standalone_round(standalone_task_id, ...)` |
|
|
26
|
+
| Update round | `update_round(round_id, ...)` | `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 | `update_task(task_id, ...)` | `update_standalone_task(standalone_task_id, ...)` |
|
|
29
|
+
|
|
9
30
|
# Round Input Command
|
|
10
31
|
|
|
11
32
|
Gathers input for a new round. Performs deep analysis of unapproved files, requirements coverage, and testing-QA failures before formulating requirements. Follow-up rounds get the same depth as round 1.
|
|
@@ -28,7 +49,7 @@ Try the numeric identifier regex first: `^[0-9]+(-[0-9]+){0,2}$`
|
|
|
28
49
|
| `{task}` (e.g. `45`) | 1 | Standalone TASK-{task} next round (matches cbp-task-start standalone convention) |
|
|
29
50
|
| `{chk}-{task}` (e.g. `108-1`) | 2 | CHK-{chk} TASK-{task} next round (round number implicit — round-input creates a new round) |
|
|
30
51
|
| `{chk}-{task}-{round}` (e.g. `108-1-2`) | 3 | CHK-{chk} TASK-{task} targeting ROUND-{round} (existing round context) |
|
|
31
|
-
| _(no match / empty)_ | — | Free-text requirements (passed through to Step 5) OR empty → use
|
|
52
|
+
| _(no match / empty)_ | — | Free-text requirements (passed through to Step 5) OR empty → use Kind Detection |
|
|
32
53
|
|
|
33
54
|
If the argument matches the numeric regex, resolve the target task/round from DB. If no match (or empty), treat the argument as free-text requirements and proceed to Step 2 for context (free-text path still runs deep analysis before Step 5).
|
|
34
55
|
|
|
@@ -37,16 +58,16 @@ If the argument matches the numeric regex, resolve the target task/round from DB
|
|
|
37
58
|
- `round-input 45` → standalone TASK-45 next round
|
|
38
59
|
- `round-input 108-1` → CHK-108 TASK-1 next round
|
|
39
60
|
- `round-input 108-1-2` → CHK-108 TASK-1 ROUND-2
|
|
40
|
-
- `round-input` (no arg) → active task via
|
|
61
|
+
- `round-input` (no arg) → active task via Kind Detection
|
|
41
62
|
- `round-input Fix the broken lint rule in the auth module` → free-text requirements (numeric regex fails → falls through to free-text path)
|
|
42
63
|
|
|
43
64
|
> **Note on 2-segment divergence**: `round-input 108-1` resolves to **CHK-108 TASK-1** (targeting that task's next round). This diverges from `/cbp-round-start` where the 2-segment `108-1` means **standalone TASK-108 ROUND-1**. Round-input always operates on a task-level context (it creates a new round on a task), so the round number is implicit and 2 segments are interpreted as `{chk}-{task}`. To target a standalone task here, use the 1-segment form `45`. To target a specific existing round, use the 3-segment form `108-1-2`.
|
|
44
65
|
|
|
45
66
|
### Step 2: Deep Analysis (MANDATORY — always runs)
|
|
46
67
|
|
|
47
|
-
**2a:** Load task via MCP `get_current_task`
|
|
68
|
+
**2a:** Load task via KIND-appropriate MCP tool (`get_current_task` or `get_current_standalone_task`) — get `files_changed`, `requirements`, `context`, `qa`
|
|
48
69
|
|
|
49
|
-
**2b:** Load all rounds via MCP `get_rounds(task_id)` — get previous round context, testing-qa output
|
|
70
|
+
**2b:** Load all rounds via MCP `get_rounds(task_id)` (checkpoint KIND) or `get_standalone_rounds(standalone_task_id)` (standalone KIND) — get previous round context, testing-qa output
|
|
50
71
|
|
|
51
72
|
**2c:** Identify unapproved files from `task.files_changed` where `user_approved === false`
|
|
52
73
|
|
|
@@ -123,10 +144,10 @@ Based on the analysis + user input, create detailed requirements that:
|
|
|
123
144
|
|
|
124
145
|
If the new round requirements change the task direction:
|
|
125
146
|
|
|
126
|
-
1. Update task context via MCP `update_task(task_id, context: { ... })
|
|
147
|
+
1. Update task context via MCP `update_task(task_id, context: { ... })` / `update_standalone_task(standalone_task_id, context: { ... })` per KIND:
|
|
127
148
|
- Add new decisions to `context.decisions[]`
|
|
128
149
|
- Update `context.discoveries[]` if applicable
|
|
129
|
-
2. If checkpoint-level changes needed, update checkpoint context via MCP `update_checkpoint`
|
|
150
|
+
2. If checkpoint-level changes needed (checkpoint KIND only), update checkpoint context via MCP `update_checkpoint`
|
|
130
151
|
|
|
131
152
|
### Step 7: Auto-trigger Round Start
|
|
132
153
|
|
|
@@ -145,8 +166,8 @@ Trigger `/cbp-round-start` with the round requirements as arguments.
|
|
|
145
166
|
If this command is triggered **directly** (not via `/cbp-todo`) and no context is available in the session:
|
|
146
167
|
|
|
147
168
|
1. Read `.codebyplan/repo.json` for `repo_id`
|
|
148
|
-
2. Use MCP
|
|
149
|
-
3. Use MCP `get_rounds(task_id)` to load round history
|
|
169
|
+
2. Use Kind Detection to determine KIND, then use the appropriate MCP tool to load checkpoint + task
|
|
170
|
+
3. Use MCP `get_rounds(task_id)` / `get_standalone_rounds(standalone_task_id)` per KIND to load round history
|
|
150
171
|
4. Continue from Step 2 (deep analysis handles all context loading)
|
|
151
172
|
|
|
152
173
|
## Key Rules
|
|
@@ -160,6 +181,6 @@ If this command is triggered **directly** (not via `/cbp-todo`) and no context i
|
|
|
160
181
|
## Integration
|
|
161
182
|
|
|
162
183
|
- **Triggered by**: `/cbp-round-update` (auto, unapproved files), `/cbp-round-execute` (auto, on hard-fail after retry exhausted), `/cbp-todo` (after /clear), user manually
|
|
163
|
-
- **Reads**: MCP `get_current_task`, `get_rounds
|
|
164
|
-
- **Writes**: MCP `update_task` (context), `update_checkpoint` (context, if needed)
|
|
184
|
+
- **Reads**: MCP `get_current_task` / `get_current_standalone_task`, `get_rounds` / `get_standalone_rounds` (per KIND), file contents (Read tool)
|
|
185
|
+
- **Writes**: MCP `update_task` / `update_standalone_task` (context), `update_checkpoint` (context, if checkpoint KIND and needed)
|
|
165
186
|
- **Triggers**: `/cbp-round-start` (auto)
|
|
@@ -7,6 +7,27 @@ argument-hint: [chk-task-round | task-round | requirements-text] # e.g. `108-1-
|
|
|
7
7
|
effort: xhigh
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## Kind Detection
|
|
11
|
+
|
|
12
|
+
Inspect the resolved identifier from argument parsing to determine the task kind:
|
|
13
|
+
|
|
14
|
+
| Identifier shape | KIND |
|
|
15
|
+
|-----------------|------|
|
|
16
|
+
| `{task}-{round}` (2-segment, e.g. `45-2`) | `standalone` |
|
|
17
|
+
| `{chk}-{task}-{round}` (3-segment, e.g. `141-3-1`) | `checkpoint` |
|
|
18
|
+
| _(empty / free-text)_ | Check `get_current_standalone_task` first; if found → `standalone`. Else → `checkpoint` via `get_current_task`. |
|
|
19
|
+
|
|
20
|
+
Set `KIND` for the rest of this skill. MCP tool names vary by KIND:
|
|
21
|
+
|
|
22
|
+
| Operation | `checkpoint` KIND | `standalone` KIND |
|
|
23
|
+
|-----------|------------------|-------------------|
|
|
24
|
+
| Get task | `get_current_task(repo_id)` | `get_current_standalone_task(repo_id)` |
|
|
25
|
+
| Get rounds | `get_rounds(task_id)` | `get_standalone_rounds(standalone_task_id)` |
|
|
26
|
+
| Add round | `add_round(task_id, ...)` | `add_standalone_round(standalone_task_id, ...)` |
|
|
27
|
+
| Update round | `update_round(round_id, ...)` | `update_standalone_round(standalone_round_id, ...)` |
|
|
28
|
+
| 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 |
|
|
29
|
+
| Update task | `update_task(task_id, ...)` | `update_standalone_task(standalone_task_id, ...)` |
|
|
30
|
+
|
|
10
31
|
# Round Start Command
|
|
11
32
|
|
|
12
33
|
Planning phase for a new round. Analyzes context, creates plan, gets user approval. NO execution or testing — those are separate commands.
|
|
@@ -31,7 +52,7 @@ Inline-fallback is NOT a quality downgrade trapdoor — Phase 1.5 row-by-row ver
|
|
|
31
52
|
/cbp-round-start (planning) → [user approval] → /cbp-round-execute (auto)
|
|
32
53
|
```
|
|
33
54
|
|
|
34
|
-
**Auto-loop mode**: when `round.context.auto_loop_mode === true` flows in from `/cbp-round-input`, Step 6 (Q&A) and Step 8 (user approval) skip user prompts. See cbp-round-update SKILL.md Step
|
|
55
|
+
**Auto-loop mode**: when `round.context.auto_loop_mode === true` flows in from `/cbp-round-input`, Step 6 (Q&A) and Step 8 (user approval) skip user prompts. See cbp-round-update SKILL.md Step 4 (auto-loop decision) and cbp-round-end SKILL.md Step 8 for the full contract.
|
|
35
56
|
|
|
36
57
|
## Instructions
|
|
37
58
|
|
|
@@ -44,7 +65,7 @@ Disambiguate the argument up front. Three input shapes (see `.claude/rules/notat
|
|
|
44
65
|
| `{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`. |
|
|
45
66
|
| `{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). |
|
|
46
67
|
| Non-empty, non-identifier-shaped | — | **Free-text round requirements** (the round-input passthrough path). |
|
|
47
|
-
| _(empty)_ | — | No identifier, no requirements text — derive task/round from
|
|
68
|
+
| _(empty)_ | — | No identifier, no requirements text — derive task/round from Kind Detection above. |
|
|
48
69
|
|
|
49
70
|
Malformed identifier shapes (`108-`, `-1-2`, `108--1`, `abc-1`) — surface this error and stop, mirroring `/cbp-task-start`'s error vocabulary:
|
|
50
71
|
|
|
@@ -62,7 +83,7 @@ round-start: invalid argument `{value}`. Expected:
|
|
|
62
83
|
- `round-start 45-2` → resolve standalone TASK-45, target round 2
|
|
63
84
|
- `round-start 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).
|
|
64
85
|
- `round-start "Implement OAuth flow per CHK-X plan"` → free-text path; current-task/round derivation from state
|
|
65
|
-
- `round-start` (empty) → derive from
|
|
86
|
+
- `round-start` (empty) → derive from Kind Detection; round 1 uses `task.requirements`
|
|
66
87
|
- `round-start 108-` → error: malformed identifier
|
|
67
88
|
- `round-start -1-2` → error: malformed identifier
|
|
68
89
|
- `round-start abc-1` → error: malformed identifier
|
|
@@ -71,17 +92,17 @@ round-start: invalid argument `{value}`. Expected:
|
|
|
71
92
|
|
|
72
93
|
### Step 1: Get Current Task
|
|
73
94
|
|
|
74
|
-
If Step 0 produced an identifier (`target_task` set): resolve directly per the identifier (bound or standalone) — MCP
|
|
95
|
+
If Step 0 produced an identifier (`target_task` set): resolve directly per the identifier (bound or standalone) — use KIND-appropriate MCP tools per the Kind Detection table above.
|
|
75
96
|
|
|
76
|
-
Otherwise: use MCP `get_current_task`
|
|
97
|
+
Otherwise: use Kind Detection to determine KIND, then use MCP `get_current_task` (checkpoint KIND) or `get_current_standalone_task` (standalone KIND) with repo_id to find the active task.
|
|
77
98
|
|
|
78
99
|
If no in-progress task and Step 0 produced no identifier, show error: `No active task. Run /cbp-task-start first.`
|
|
79
100
|
|
|
80
101
|
### Step 2: Determine Round Number
|
|
81
102
|
|
|
82
|
-
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 checking MCP `get_rounds`).
|
|
103
|
+
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 checking MCP `get_rounds` / `get_standalone_rounds` per KIND).
|
|
83
104
|
|
|
84
|
-
Otherwise: use MCP `get_rounds` for the task; count existing rounds; next is N+1.
|
|
105
|
+
Otherwise: use MCP `get_rounds` (checkpoint KIND) or `get_standalone_rounds` (standalone KIND) for the task; count existing rounds; next is N+1.
|
|
85
106
|
|
|
86
107
|
### Step 3: Gather Round Requirements
|
|
87
108
|
|
|
@@ -99,8 +120,8 @@ Otherwise: use MCP `get_rounds` for the task; count existing rounds; next is N+1
|
|
|
99
120
|
|
|
100
121
|
### Step 4: Create Round in DB
|
|
101
122
|
|
|
102
|
-
Use MCP `add_round
|
|
103
|
-
- `task_id
|
|
123
|
+
Use MCP `add_round` (checkpoint KIND) or `add_standalone_round` (standalone KIND):
|
|
124
|
+
- `task_id` (checkpoint) / `standalone_task_id` (standalone): current task ID
|
|
104
125
|
- `number`: next round number
|
|
105
126
|
- `status`: "in_progress"
|
|
106
127
|
- `started_at`: now (ISO format)
|
|
@@ -115,7 +136,7 @@ Load from checkpoint and task:
|
|
|
115
136
|
- Task context and requirements
|
|
116
137
|
- Resources from checkpoint and task (documentation links, API docs, guides)
|
|
117
138
|
- Previous round results (files_changed, QA results)
|
|
118
|
-
- For round 2+: load the latest completed round's `context.testing_qa_output` and `context.executor_output` via `get_rounds`
|
|
139
|
+
- For round 2+: load the latest completed round's `context.testing_qa_output` and `context.executor_output` via `get_rounds` / `get_standalone_rounds` per KIND
|
|
119
140
|
- Identify unapproved files from task.files_changed (where user_approved === false)
|
|
120
141
|
|
|
121
142
|
### Step 6: First Round Analysis (Round 1 only)
|
|
@@ -126,7 +147,7 @@ For the first round only:
|
|
|
126
147
|
2. Identify any ambiguities or gaps
|
|
127
148
|
3. If questions are needed, ask user via AskUserQuestion (max 4 per batch)
|
|
128
149
|
4. If task context changes from Q&A answers:
|
|
129
|
-
- Update task context via MCP `update_task(task_id, context: {...})`
|
|
150
|
+
- Update task context via MCP `update_task(task_id, context: {...})` / `update_standalone_task(standalone_task_id, context: {...})` per KIND
|
|
130
151
|
- Save Q&A decisions as `context.decisions[]`
|
|
131
152
|
|
|
132
153
|
Skip this step for round 2+ (context already established via `/cbp-round-input`).
|
|
@@ -199,7 +220,7 @@ Single-wave plans present the existing flat plan view (no wave table) — backwa
|
|
|
199
220
|
|
|
200
221
|
### Step 9: Auto-trigger Round Execute
|
|
201
222
|
|
|
202
|
-
On approval, save planner output to round context via MCP `update_round
|
|
223
|
+
On approval, save planner output to round context via MCP `update_round` / `update_standalone_round` per KIND, then trigger `/cbp-round-execute`.
|
|
203
224
|
|
|
204
225
|
```
|
|
205
226
|
Plan approved. Starting execution phase...
|
|
@@ -215,8 +236,8 @@ Plan approved. Starting execution phase...
|
|
|
215
236
|
|
|
216
237
|
## Integration
|
|
217
238
|
|
|
218
|
-
- **Reads**: MCP `get_current_task`, `get_rounds`
|
|
219
|
-
- **Writes**: MCP `add_round`, `update_round`, `update_task` (context only)
|
|
239
|
+
- **Reads**: MCP `get_current_task` / `get_current_standalone_task`, `get_rounds` / `get_standalone_rounds` (per KIND)
|
|
240
|
+
- **Writes**: MCP `add_round` / `add_standalone_round`, `update_round` / `update_standalone_round`, `update_task` / `update_standalone_task` (context only) — per KIND
|
|
220
241
|
- **Spawns**: `cbp-task-planner`
|
|
221
242
|
- **Triggers**: `/cbp-round-execute` (auto, on plan approval)
|
|
222
243
|
- **Triggered by**: `/cbp-task-start` (round 1), `/cbp-round-input` (round 2+)
|
|
@@ -3,10 +3,31 @@ scope: org-shared
|
|
|
3
3
|
name: cbp-round-update
|
|
4
4
|
description: Check file approvals, complete round, and route to next step
|
|
5
5
|
argument-hint: [chk-task-round | task-round]
|
|
6
|
-
triggers: [cbp-round-input, cbp-task-check]
|
|
6
|
+
triggers: [cbp-round-input, cbp-task-check, cbp-standalone-task-check]
|
|
7
7
|
effort: low
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## Kind Detection
|
|
11
|
+
|
|
12
|
+
Inspect the resolved identifier from argument parsing to determine the task kind:
|
|
13
|
+
|
|
14
|
+
| Identifier shape | KIND |
|
|
15
|
+
|-----------------|------|
|
|
16
|
+
| `{task}-{round}` (2-segment, e.g. `45-2`) | `standalone` |
|
|
17
|
+
| `{chk}-{task}-{round}` (3-segment, e.g. `141-3-1`) | `checkpoint` |
|
|
18
|
+
| _(empty / free-text)_ | Check `get_current_standalone_task` first; if found → `standalone`. Else → `checkpoint` via `get_current_task`. |
|
|
19
|
+
|
|
20
|
+
Set `KIND` for the rest of this skill. MCP tool names vary by KIND:
|
|
21
|
+
|
|
22
|
+
| Operation | `checkpoint` KIND | `standalone` KIND |
|
|
23
|
+
|-----------|------------------|-------------------|
|
|
24
|
+
| Get task | `get_current_task(repo_id)` | `get_current_standalone_task(repo_id)` |
|
|
25
|
+
| Get rounds | `get_rounds(task_id)` | `get_standalone_rounds(standalone_task_id)` |
|
|
26
|
+
| Add round | `add_round(task_id, ...)` | `add_standalone_round(standalone_task_id, ...)` |
|
|
27
|
+
| Update round | `update_round(round_id, ...)` | `update_standalone_round(standalone_round_id, ...)` |
|
|
28
|
+
| 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 |
|
|
29
|
+
| Update task | `update_task(task_id, ...)` | `update_standalone_task(standalone_task_id, ...)` |
|
|
30
|
+
|
|
10
31
|
# Round Update Command
|
|
11
32
|
|
|
12
33
|
Checks file approval status, completes the round, and routes to next step. NEVER asks the user to git add or stage anything — it only reads current state.
|
|
@@ -29,7 +50,7 @@ Parse the argument using the canonical chk-task-round notation (see `.claude/rul
|
|
|
29
50
|
|-------|-------|-------------|
|
|
30
51
|
| `{chk}-{task}-{round}` (e.g. `108-1-2`) | `^[0-9]+-[0-9]+-[0-9]+$` | Checkpoint-bound: CHK-{chk} TASK-{task} ROUND-{round} |
|
|
31
52
|
| `{task}-{round}` (e.g. `45-2`) | `^[0-9]+-[0-9]+$` | Standalone: standalone TASK-{task} ROUND-{round} |
|
|
32
|
-
| _(empty)_ | — | Use
|
|
53
|
+
| _(empty)_ | — | Use Kind Detection to find active task and latest round |
|
|
33
54
|
|
|
34
55
|
Anything else is malformed — surface this error and stop:
|
|
35
56
|
|
|
@@ -46,7 +67,7 @@ Error cases: `abc`, `108-`, `-1`, anything with whitespace or non-numeric charac
|
|
|
46
67
|
|
|
47
68
|
- `round-update 108-1-2` → CHK-108 TASK-1 ROUND-2
|
|
48
69
|
- `round-update 45-2` → standalone TASK-45 ROUND-2
|
|
49
|
-
- `round-update` (no arg) → active task and latest in-progress round via
|
|
70
|
+
- `round-update` (no arg) → active task and latest in-progress round via Kind Detection
|
|
50
71
|
- `round-update abc` → error: malformed
|
|
51
72
|
|
|
52
73
|
### Step 1.5: Get Current Task and Round
|
|
@@ -56,8 +77,8 @@ Given the parse from Step 1:
|
|
|
56
77
|
| Parse | Resolution path |
|
|
57
78
|
|-------|-----------------|
|
|
58
79
|
| `{chk}-{task}-{round}` | MCP `get_checkpoints(repo_id)` → filter `number === {chk}`. MCP `get_tasks(checkpoint_id)` → filter `number === {task}`. MCP `get_rounds(task_id)` → filter `number === {round}`. |
|
|
59
|
-
| `{task}-{round}` | MCP `
|
|
60
|
-
| _(empty)_ | MCP `get_current_task(repo_id)`
|
|
80
|
+
| `{task}-{round}` | MCP `get_standalone_rounds` via `get_current_standalone_task` or direct task lookup → filter `number === {round}`. |
|
|
81
|
+
| _(empty)_ | Use Kind Detection: checkpoint KIND → MCP `get_current_task(repo_id)` + `get_rounds(task_id)`; standalone KIND → MCP `get_current_standalone_task(repo_id)` + `get_standalone_rounds(standalone_task_id)`. |
|
|
61
82
|
|
|
62
83
|
If no task found: `No active task. Nothing to update.`
|
|
63
84
|
|
|
@@ -108,7 +129,16 @@ If the command exits non-zero, surface the stderr and STOP. Do NOT proceed to St
|
|
|
108
129
|
### Step 3: Complete Round
|
|
109
130
|
|
|
110
131
|
Calculate duration from `started_at` to now in minutes.
|
|
111
|
-
|
|
132
|
+
|
|
133
|
+
- **checkpoint KIND**: MCP `complete_round(round_id, duration_minutes)`.
|
|
134
|
+
- **standalone KIND**: MCP `complete_standalone_round(standalone_round_id, duration_minutes, caller_worktree_id)`. ⚠️ `caller_worktree_id` is REQUIRED — resolve via `CALLER_WT=$(npx codebyplan resolve-worktree 2>/dev/null)`. If `CALLER_WT` is empty, surface this warning and ask user to confirm before proceeding:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
Warning: could not resolve caller_worktree_id (npx codebyplan resolve-worktree returned empty).
|
|
138
|
+
The complete_standalone_round call may be rejected by the pre-guard. Proceed anyway? (yes / no)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
If user confirms yes, proceed with `caller_worktree_id: ""`. If no, stop.
|
|
112
142
|
|
|
113
143
|
### Step 4: Auto-Loop Decision
|
|
114
144
|
|
|
@@ -118,7 +148,7 @@ Procedure:
|
|
|
118
148
|
|
|
119
149
|
1. Compute `next_index = (round.context.auto_loop_index ?? 0) + 1`.
|
|
120
150
|
2. **If `next_index > (round.context.auto_loop_cap ?? 5)`**: surface the cap-exhausted prompt via AskUserQuestion (options: extend cap, stop loop / drop into round-input, close task as-is). Persist `round.context.auto_loop_cap_exhausted = { user_choice, decided_at }` and route per choice.
|
|
121
|
-
3. **Otherwise**: persist `round.context.auto_loop_decision = { spawned_next: true, next_index, decided_at }` on the CURRENT round via `update_round` (audit trail), then auto-trigger `/cbp-round-input` with NO AskUserQuestion. Pass `auto_loop_mode: true`, `auto_loop_index: next_index`, `auto_loop_cap: (prior cap ?? 5)` forward — round-start Step 4 persists them on the new round.
|
|
151
|
+
3. **Otherwise**: persist `round.context.auto_loop_decision = { spawned_next: true, next_index, decided_at }` on the CURRENT round via `update_round` / `update_standalone_round` per KIND (audit trail), then auto-trigger `/cbp-round-input` with NO AskUserQuestion. Pass `auto_loop_mode: true`, `auto_loop_index: next_index`, `auto_loop_cap: (prior cap ?? 5)` forward — round-start Step 4 persists them on the new round.
|
|
122
152
|
|
|
123
153
|
> **Permission-gate note**: the "NO AskUserQuestion" in item 3 governs only the auto-loop's decision to spawn `/cbp-round-input` — it does not add a prompt for that hand-off. It is NOT a bypass of the Step 1.6 permission gate: when the spawned round eventually re-enters `/cbp-round-update`, Step 1.6 prompts again (the gate always fires, including inside the auto-loop).
|
|
124
154
|
|
|
@@ -135,7 +165,7 @@ If BOTH signals are clean, fall through to Step 5 (exit routing).
|
|
|
135
165
|
Survey rounds produce no file diff; A/B/C predicates assume `files_changed[]` non-empty. Survey routing is decided by `improve_round_findings[]` instead:
|
|
136
166
|
|
|
137
167
|
- `improve_round_findings[]` non-empty → auto-trigger `/cbp-round-input`
|
|
138
|
-
- `improve_round_findings[]` empty → auto-trigger `/cbp-task-check`
|
|
168
|
+
- `improve_round_findings[]` empty → checkpoint KIND: auto-trigger `/cbp-task-check`; standalone KIND: auto-trigger `/cbp-standalone-task-check`
|
|
139
169
|
|
|
140
170
|
Output: `"## Round [N] Complete — Survey Round"` with duration, files=0, findings count, routing message. Skip Branches A/B/C.
|
|
141
171
|
|
|
@@ -150,7 +180,7 @@ Output: `"## Round [N] Complete — Survey Round"` with duration, files=0, findi
|
|
|
150
180
|
|
|
151
181
|
Surface AskUserQuestion (clean-exit user-gate):
|
|
152
182
|
|
|
153
|
-
- **(a) close & complete round** → auto-trigger `/cbp-task-check`
|
|
183
|
+
- **(a) close & complete round** → checkpoint KIND: auto-trigger `/cbp-task-check`; standalone KIND: auto-trigger `/cbp-standalone-task-check`
|
|
154
184
|
- **(b) start new round** → auto-trigger `/cbp-round-input`
|
|
155
185
|
|
|
156
186
|
Persist `round.context.auto_loop_exit = { staged_count, unstaged_count, route, decided_at }`.
|
|
@@ -187,11 +217,12 @@ Unreachable in the auto-loop path — Step 4 catches it first. Retained for MANU
|
|
|
187
217
|
- **Step 4 owns the dirty-loop case**; Step 5 owns the clean-exit case. Step 5 Branch C is for manual invocation only.
|
|
188
218
|
- **NEVER ask user to git add files** — only reads staging status. **NEVER stage files** — Claude does not touch git staging area.
|
|
189
219
|
- Auto-triggered by `/cbp-round-end`, or run manually by user.
|
|
220
|
+
- **standalone KIND Step 3**: `caller_worktree_id` is REQUIRED for `complete_standalone_round` — always resolve and pass it.
|
|
190
221
|
|
|
191
222
|
## Integration
|
|
192
223
|
|
|
193
224
|
- **Gates**: Step 1.6 permission gate — asks the user to confirm before any side effect; **Cancel** aborts cleanly with no writes. Fires on every invocation incl. the Step 4 auto-loop; sits before and independent of the top-of-file Step 2 hard gate.
|
|
194
225
|
- **Triggered by**: `/cbp-round-end` (auto), or user manually
|
|
195
|
-
- **Reads**: MCP `get_current_task`, `get_rounds
|
|
196
|
-
- **Writes**: MCP `update_round` (auto_loop_decision / auto_loop_exit / auto_loop_cap_exhausted)
|
|
197
|
-
- **Triggers**: `/cbp-round-input` (Step 4 dirty-loop spawn; Branch A 'b' choice; Branch B auto-loop-exit; Branch C manual), `/cbp-task-check` (Branch A 'a' choice; Branch D survey-clean), staging-gate stop (Branch B manual mode), cap-exhausted prompt routes from Step 4 (any of the three options)
|
|
226
|
+
- **Reads**: MCP `get_current_task` / `get_current_standalone_task`, `get_rounds` / `get_standalone_rounds` (per KIND); delegates git+approval sync to `npx codebyplan round sync-approvals`
|
|
227
|
+
- **Writes**: MCP `update_round` / `update_standalone_round` (auto_loop_decision / auto_loop_exit / auto_loop_cap_exhausted); `complete_round` / `complete_standalone_round` (per KIND); round+task files_changed written by CLI
|
|
228
|
+
- **Triggers**: `/cbp-round-input` (Step 4 dirty-loop spawn; Branch A 'b' choice; Branch B auto-loop-exit; Branch C manual), `/cbp-task-check` (Branch A 'a' choice per checkpoint KIND; Branch D survey-clean per checkpoint KIND), `/cbp-standalone-task-check` (Branch A 'a' choice per standalone KIND; Branch D survey-clean per standalone KIND), staging-gate stop (Branch B manual mode), cap-exhausted prompt routes from Step 4 (any of the three options)
|