codebyplan 1.13.52 → 1.13.54
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 +3226 -897
- package/package.json +1 -1
- package/templates/agents/cbp-database-agent.md +1 -1
- package/templates/agents/cbp-e2e-maestro.md +1 -1
- package/templates/agents/cbp-e2e-playwright.md +24 -16
- package/templates/agents/cbp-e2e-tauri.md +1 -1
- package/templates/agents/cbp-e2e-vscode.md +1 -1
- package/templates/agents/cbp-e2e-xcuitest.md +1 -1
- package/templates/agents/cbp-improve-claude.md +2 -2
- package/templates/agents/{cbp-round-executor.md → cbp-round-builder.md} +23 -23
- package/templates/agents/{cbp-task-planner.md → cbp-round-planner.md} +26 -25
- package/templates/agents/cbp-security-agent.md +10 -2
- package/templates/agents/cbp-stripe-agent.md +2 -2
- package/templates/agents/cbp-testing-qa-agent.md +34 -20
- package/templates/agents/cbp-verify-reviewer.md +236 -0
- package/templates/context/architecture-map.md +4 -4
- package/templates/context/mcp-docs.md +57 -11
- package/templates/context/testing/e2e.md +9 -9
- package/templates/github-workflows/ci.yml +104 -0
- package/templates/github-workflows/publish.yml +8 -27
- package/templates/github-workflows/release-desktop.yml +215 -0
- package/templates/hooks/cbp-skill-context-guard.sh +1 -1
- package/templates/hooks/cbp-test-hooks.sh +9 -9
- package/templates/hooks/validate-structure-lengths.sh +1 -1
- package/templates/hooks/validate-structure-patterns.sh +1 -1
- package/templates/rules/README.md +1 -2
- package/templates/rules/agent-claim-verification.md +1 -1
- package/templates/rules/context-file-loading.md +10 -10
- package/templates/rules/development-workflow.md +73 -0
- package/templates/rules/e2e-mandatory.md +8 -8
- package/templates/rules/execution-proof.md +70 -0
- package/templates/rules/model-invocation-convention.md +2 -2
- package/templates/rules/parallel-waves.md +11 -11
- package/templates/rules/spawn-failure-is-gate-failure.md +76 -0
- package/templates/rules/task-routing-recommendation.md +1 -1
- package/templates/rules/todo-backend.md +3 -3
- package/templates/rules/two-tier-ci.md +63 -0
- package/templates/settings.project.base.json +15 -11
- package/templates/skills/cbp-build-cc-mode/SKILL.md +1 -1
- package/templates/skills/cbp-build-cc-settings/reference/cbp-permission-policy.md +7 -7
- package/templates/skills/cbp-build-cc-skill/SKILL.md +1 -1
- package/templates/skills/cbp-build-cc-skill/reference/cbp-quality.md +2 -2
- package/templates/skills/cbp-build-cc-skill/reference/fork-eligibility.md +11 -14
- package/templates/skills/cbp-checkpoint-check/SKILL.md +11 -3
- package/templates/skills/cbp-checkpoint-create/SKILL.md +16 -1
- package/templates/skills/cbp-checkpoint-end/SKILL.md +5 -1
- package/templates/skills/cbp-checkpoint-update/SKILL.md +3 -3
- package/templates/skills/cbp-clear-continue/SKILL.md +2 -2
- package/templates/skills/cbp-clear-prep/SKILL.md +3 -3
- package/templates/skills/{cbp-task-complete → cbp-finalize}/SKILL.md +25 -29
- package/templates/skills/{cbp-task-complete → cbp-finalize}/reference/checkpoint-done-branching.md +1 -1
- package/templates/skills/{cbp-task-complete → cbp-finalize}/reference/next-step-heuristic.md +1 -1
- package/templates/skills/cbp-frontend-design/SKILL.md +1 -1
- package/templates/skills/cbp-frontend-ui/SKILL.md +7 -7
- package/templates/skills/cbp-git-commit/SKILL.md +3 -3
- package/templates/skills/cbp-merge-main/SKILL.md +4 -4
- package/templates/skills/{cbp-round-execute → cbp-round-build}/SKILL.md +93 -75
- package/templates/skills/cbp-round-complete/SKILL.md +15 -14
- package/templates/skills/cbp-round-plan/SKILL.md +344 -0
- package/templates/skills/cbp-session-end/SKILL.md +1 -1
- package/templates/skills/cbp-setup-cd/SKILL.md +291 -0
- package/templates/skills/cbp-setup-cd/reference/github-actions-cd.md +231 -0
- package/templates/skills/cbp-setup-ci/SKILL.md +175 -0
- package/templates/skills/cbp-setup-ci/reference/github-actions.md +100 -0
- package/templates/skills/cbp-ship/SKILL.md +21 -0
- package/templates/skills/cbp-ship-main/SKILL.md +3 -2
- package/templates/skills/cbp-standalone-task-check/SKILL.md +10 -9
- package/templates/skills/cbp-standalone-task-complete/SKILL.md +12 -13
- package/templates/skills/cbp-standalone-task-create/SKILL.md +16 -9
- package/templates/skills/cbp-standalone-task-start/SKILL.md +9 -5
- package/templates/skills/cbp-standalone-task-testing/SKILL.md +16 -7
- package/templates/skills/cbp-task-create/SKILL.md +6 -7
- package/templates/skills/cbp-task-start/SKILL.md +8 -8
- package/templates/skills/cbp-todo/SKILL.md +6 -8
- package/templates/skills/cbp-verify/SKILL.md +146 -0
- package/templates/skills/cbp-verify/reference/deterministic-gates.md +114 -0
- package/templates/skills/{cbp-round-end → cbp-verify}/reference/findings-presentation.md +16 -12
- package/templates/skills/cbp-verify/reference/round-scope.md +62 -0
- package/templates/skills/cbp-verify/reference/task-scope.md +71 -0
- package/templates/agents/cbp-improve-round.md +0 -283
- package/templates/agents/cbp-task-check.md +0 -217
- package/templates/skills/cbp-round-check/SKILL.md +0 -132
- package/templates/skills/cbp-round-end/SKILL.md +0 -173
- package/templates/skills/cbp-round-end/reference/inline-fallback.md +0 -35
- package/templates/skills/cbp-round-execute/reference/inline-fallback.md +0 -55
- package/templates/skills/cbp-round-input/SKILL.md +0 -197
- package/templates/skills/cbp-round-start/SKILL.md +0 -261
- package/templates/skills/cbp-round-update/SKILL.md +0 -120
- package/templates/skills/cbp-ship/templates/workflow-eas-submit.yml +0 -53
- package/templates/skills/cbp-ship/templates/workflow-vsce-publish.yml +0 -31
- package/templates/skills/cbp-task-check/SKILL.md +0 -172
- package/templates/skills/cbp-task-testing/SKILL.md +0 -277
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: cbp-round-input
|
|
3
|
-
description: Gather input for a new round with deep analysis of unapproved work
|
|
4
|
-
argument-hint: [chk-task-round | task-round | requirements-text]
|
|
5
|
-
effort: xhigh
|
|
6
|
-
---
|
|
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`. (Kind-detection is MCP-unavoidable — no identifier yet means no local path to probe; subsequent operations are local-first per the rows below.) |
|
|
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 | local state (break-glass: `get_current_task`) | `get_current_standalone_task(repo_id)` |
|
|
23
|
-
| Get rounds | local state (break-glass: `get_rounds`) | `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
|
-
| Update task | `update_task(task_id, ...)` | `update_standalone_task(standalone_task_id, ...)` |
|
|
27
|
-
|
|
28
|
-
# Round Input Command
|
|
29
|
-
|
|
30
|
-
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.
|
|
31
|
-
|
|
32
|
-
## When Used
|
|
33
|
-
|
|
34
|
-
- After `/cbp-round-update` triages a round as not-clean and routes here, or `/cbp-round-complete` routes here (files left unapproved after completing the round)
|
|
35
|
-
- After `/cbp-round-execute` Step 6 routes here (structural failure or retry-exhausted hard-fail)
|
|
36
|
-
- After `/clear` + `/cbp-todo` reloads context and triggers this
|
|
37
|
-
- When user wants to start a new round with specific changes
|
|
38
|
-
|
|
39
|
-
## Instructions
|
|
40
|
-
|
|
41
|
-
### Step 1: Parse `$ARGUMENTS`
|
|
42
|
-
|
|
43
|
-
Try the numeric identifier regex first: `^[0-9]+(-[0-9]+){0,2}$`
|
|
44
|
-
|
|
45
|
-
| Shape | Segments | Resolves to |
|
|
46
|
-
|-------|----------|-------------|
|
|
47
|
-
| `{task}` (e.g. `45`) | 1 | Standalone TASK-{task} next round (matches cbp-task-start standalone convention) |
|
|
48
|
-
| `{chk}-{task}` (e.g. `108-1`) | 2 | CHK-{chk} TASK-{task} next round (round number implicit — round-input creates a new round) |
|
|
49
|
-
| `{chk}-{task}-{round}` (e.g. `108-1-2`) | 3 | CHK-{chk} TASK-{task} targeting ROUND-{round} (existing round context) |
|
|
50
|
-
| _(no match / empty)_ | — | Free-text requirements (passed through to Step 5) OR empty → use Kind Detection |
|
|
51
|
-
|
|
52
|
-
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).
|
|
53
|
-
|
|
54
|
-
#### Worked examples
|
|
55
|
-
|
|
56
|
-
- `round-input 45` → standalone TASK-45 next round
|
|
57
|
-
- `round-input 108-1` → CHK-108 TASK-1 next round
|
|
58
|
-
- `round-input 108-1-2` → CHK-108 TASK-1 ROUND-2
|
|
59
|
-
- `round-input` (no arg) → active task via Kind Detection
|
|
60
|
-
- `round-input Fix the broken lint rule in the auth module` → free-text requirements (numeric regex fails → falls through to free-text path)
|
|
61
|
-
|
|
62
|
-
> **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`.
|
|
63
|
-
|
|
64
|
-
### Step 2: Deep Analysis (MANDATORY — always runs)
|
|
65
|
-
|
|
66
|
-
**2a:** Load task:
|
|
67
|
-
- **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(repo_id)` when state dir is absent and sync fails. Get `files_changed`, `requirements`, `context`, `qa`.
|
|
68
|
-
- **standalone KIND** — MCP `get_current_standalone_task(repo_id)`. (Standalone KIND still uses MCP until a later task.)
|
|
69
|
-
|
|
70
|
-
**2b:** Load all rounds:
|
|
71
|
-
- **checkpoint KIND** — Read `.codebyplan/state/checkpoints/<checkpointId>/tasks/<taskId>/rounds/*.json` (local-first; break-glass: MCP `get_rounds(task_id)`). Get previous round context, testing-qa output.
|
|
72
|
-
- **standalone KIND** — MCP `get_standalone_rounds(standalone_task_id)`.
|
|
73
|
-
|
|
74
|
-
**2c:** Identify unapproved files from `task.files_changed` where `user_approved === false`
|
|
75
|
-
|
|
76
|
-
**2d:** Read the content of each unapproved file (using Read tool, max 5 files, first 100 lines each)
|
|
77
|
-
|
|
78
|
-
**2e:** Cross-reference with task requirements — for each requirement, is it met or missed?
|
|
79
|
-
|
|
80
|
-
**2f:** Extract testing-qa failures from latest round context (`context.testing_qa_output`)
|
|
81
|
-
|
|
82
|
-
**2g:** Extract code review findings from latest round context (`context.improve_round_findings`).
|
|
83
|
-
These are out-of-scope findings from the `improve-round` agent — bugs, logic errors, edge cases
|
|
84
|
-
that round-end could not auto-apply inline (they reference files outside the prior round's
|
|
85
|
-
`files_changed[]`). Include them as high-priority requirements.
|
|
86
|
-
|
|
87
|
-
**2h:** Identify root causes — not "file X is wrong" but "requirement Y was not met because Z"
|
|
88
|
-
|
|
89
|
-
**2i:** Produce structured analysis summary
|
|
90
|
-
|
|
91
|
-
### Step 3: Present Analysis
|
|
92
|
-
|
|
93
|
-
Show the analysis to the user:
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
## Follow-up Round Analysis
|
|
97
|
-
|
|
98
|
-
### Unapproved Files ([N])
|
|
99
|
-
| File | Action | Issue |
|
|
100
|
-
|------|--------|-------|
|
|
101
|
-
| path | modified | [what's wrong based on reading the file] |
|
|
102
|
-
|
|
103
|
-
### Requirements Coverage
|
|
104
|
-
| Requirement | Status | Gap |
|
|
105
|
-
|-------------|--------|-----|
|
|
106
|
-
| [req] | met/missed | [what's missing] |
|
|
107
|
-
|
|
108
|
-
### Testing-QA Issues (from previous round)
|
|
109
|
-
- [issue 1 from testing-qa output]
|
|
110
|
-
- [issue 2]
|
|
111
|
-
|
|
112
|
-
### Code Review Findings (from improve-round)
|
|
113
|
-
| # | Severity | File | Issue |
|
|
114
|
-
|---|----------|------|-------|
|
|
115
|
-
| [findings accepted by user in previous round-end] |
|
|
116
|
-
|
|
117
|
-
### Root Causes
|
|
118
|
-
1. [root cause with explanation]
|
|
119
|
-
2. [root cause with explanation]
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Step 4: Choose Mode
|
|
123
|
-
|
|
124
|
-
**If `round.context.auto_loop_mode === true` on the prior round**: skip the AskUserQuestion below. Auto-pick "Start round with these findings" using the analysis directly. Set the next round's `auto_loop_mode = true`, carry `auto_loop_index` and `auto_loop_cap` forward into round-start args.
|
|
125
|
-
|
|
126
|
-
**Else (manual mode — flag absent or false)**, ask user via AskUserQuestion:
|
|
127
|
-
|
|
128
|
-
- **Start round with these findings** — use analysis as requirements
|
|
129
|
-
- **Discuss first** — open conversation about the analysis
|
|
130
|
-
- **Adjust** — user provides their own requirements
|
|
131
|
-
|
|
132
|
-
If "Discuss first": enter open discussion about the analysis. When direction is clear, proceed to Step 5.
|
|
133
|
-
If "Adjust": user provides their own requirements, merged with analysis context.
|
|
134
|
-
|
|
135
|
-
### Step 5: Formulate Requirements
|
|
136
|
-
|
|
137
|
-
Based on the analysis + user input, create detailed requirements that:
|
|
138
|
-
|
|
139
|
-
- Reference specific root causes identified in Step 2
|
|
140
|
-
- Include full task requirements context
|
|
141
|
-
- Are as thorough as round 1 (not quick fixes)
|
|
142
|
-
- Include checkpoint and task context for the planner
|
|
143
|
-
|
|
144
|
-
**Under `auto_loop_mode`**: requirements come VERBATIM from the prior round's `improve_round_findings[]` and `testing_qa_output` failures, treated as a flat list. Test failures are listed first (they block shipping); reviewer findings follow. Both sets are included unchanged — do not re-summarise or re-prioritise either. The auto-loop transcribes the prior reviewer's output directly.
|
|
145
|
-
|
|
146
|
-
### Step 6: Update Context (if direction changed)
|
|
147
|
-
|
|
148
|
-
If the new round requirements change the task direction:
|
|
149
|
-
|
|
150
|
-
1. Update task context per KIND:
|
|
151
|
-
- **checkpoint KIND**: `codebyplan task update --id <task_id> --checkpoint-id <checkpoint_id> --context '<json>'` (CLI write-through: local state file + REST). Break-glass fallback: MCP `update_task(task_id, context: { ... })` when the CLI is unavailable.
|
|
152
|
-
- **standalone KIND**: MCP `update_standalone_task(standalone_task_id, context: { ... })`. (Standalone KIND still uses MCP until a later task.)
|
|
153
|
-
- Add new decisions to `context.decisions[]`
|
|
154
|
-
- Update `context.discoveries[]` if applicable
|
|
155
|
-
2. If checkpoint-level changes needed (checkpoint KIND only): `codebyplan checkpoint update --id <checkpoint_id> --context '<json>'` (CLI write-through). Break-glass fallback: MCP `update_checkpoint`.
|
|
156
|
-
|
|
157
|
-
### Step 7: Auto-trigger Round Start
|
|
158
|
-
|
|
159
|
-
Pass the new requirements to `/cbp-round-start`:
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
Starting new round with updated requirements...
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Trigger `/cbp-round-start` with the round requirements as arguments.
|
|
166
|
-
|
|
167
|
-
**Under `auto_loop_mode`**: pass `auto_loop_mode: true`, `auto_loop_index: N`, `auto_loop_cap: C` into round-start's args/context so round-start Step 4 can persist them on the new round and downstream skills (round-execute, round-end) read them.
|
|
168
|
-
|
|
169
|
-
## Fallback: Context Recovery
|
|
170
|
-
|
|
171
|
-
If this command is triggered **directly** (not via `/cbp-todo`) and no context is available in the session:
|
|
172
|
-
|
|
173
|
-
1. Read `.codebyplan/repo.json` for `repo_id`
|
|
174
|
-
2. Use Kind Detection to determine KIND, then:
|
|
175
|
-
- **checkpoint KIND**: Read local `.codebyplan/state/` files for checkpoint + task (break-glass: MCP `get_current_task`).
|
|
176
|
-
- **standalone KIND**: MCP `get_current_standalone_task`.
|
|
177
|
-
3. Load round history:
|
|
178
|
-
- **checkpoint KIND**: Read `.codebyplan/state/checkpoints/<id>/tasks/<id>/rounds/*.json` (break-glass: MCP `get_rounds(task_id)`).
|
|
179
|
-
- **standalone KIND**: MCP `get_standalone_rounds(standalone_task_id)`.
|
|
180
|
-
4. Continue from Step 2 (deep analysis handles all context loading)
|
|
181
|
-
|
|
182
|
-
## Key Rules
|
|
183
|
-
|
|
184
|
-
- **Deep analysis is MANDATORY** — always runs, even if arguments provided (for context)
|
|
185
|
-
- **Analysis reads from local state first**, falling back to MCP only when state files are absent and sync fails
|
|
186
|
-
- **Follow-up rounds get same depth as round 1** — no quick-fix behavior
|
|
187
|
-
- **Never ask to git add** — user file approval (git staging) is reconciled by `/cbp-round-complete`
|
|
188
|
-
- **Update all context locations** — task, checkpoint, and round should all have consistent information
|
|
189
|
-
|
|
190
|
-
## Integration
|
|
191
|
-
|
|
192
|
-
- **Triggered by**: `/cbp-round-update` (auto, not-clean triage), `/cbp-round-complete` (auto, files left unapproved after completing the round), `/cbp-round-execute` (auto, on hard-fail after retry exhausted), `/cbp-todo` (after /clear), user manually
|
|
193
|
-
- **Reads (checkpoint KIND)**: `.codebyplan/state/checkpoints/<id>.json`, `checkpoints/<id>/tasks/<id>.json`, `checkpoints/<id>/tasks/<id>/rounds/*.json` (local-first; break-glass: MCP `get_current_task` / `get_rounds`), file contents (Read tool)
|
|
194
|
-
- **Reads (standalone KIND)**: MCP `get_current_standalone_task` / `get_standalone_rounds` (standalone KIND still uses MCP until a later task)
|
|
195
|
-
- **Writes (checkpoint KIND)**: `codebyplan task update` (context), `codebyplan checkpoint update` (context, if needed). Break-glass: MCP `update_task` / `update_checkpoint`.
|
|
196
|
-
- **Writes (standalone KIND)**: MCP `update_standalone_task` / (checkpoint via MCP `update_checkpoint` if needed). (Standalone KIND still uses MCP until a later task.)
|
|
197
|
-
- **Triggers**: `/cbp-round-start` (auto)
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: cbp-round-start
|
|
3
|
-
description: Start a round — planning phase only
|
|
4
|
-
triggers: [cbp-round-execute]
|
|
5
|
-
argument-hint: [chk-task-round | task-round | requirements-text] # e.g. `108-1-2`, `45-2`, or free-text from /cbp-round-input
|
|
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 for this task and will be addressed in a later task.
|
|
31
|
-
|
|
32
|
-
# Round Start Command
|
|
33
|
-
|
|
34
|
-
Planning phase for a new round. Analyzes context, creates a plan, then auto-triggers `/cbp-round-execute` — the `ask`-tier permission prompt on that skill IS the user's plan approval. NO execution or testing — those are separate commands.
|
|
35
|
-
|
|
36
|
-
## Inline-Fallback for Planner Spawn Failure
|
|
37
|
-
|
|
38
|
-
If the `cbp-task-planner` agent spawn fails for any reason (`API Error: Extra usage required`, monthly Agent usage cap, provider 5xx, rate limit, context overflow), the orchestrator MUST follow the canonical inline-fallback procedure documented in `skills/cbp-round-end/SKILL.md` "Inline-fallback for any spawn failure".
|
|
39
|
-
|
|
40
|
-
Procedure summary (pointer back to canonical):
|
|
41
|
-
|
|
42
|
-
1. Detect the failure class from the error string; record `round.context.planner_findings.spawn_failure = { class, error_message, decided_at }`.
|
|
43
|
-
2. Walk the planner's documented Phase 0-8 checklist inline using `Read` / `Grep` / `Bash` / MCP `get_*` — `agents/cbp-task-planner.md` is the inline script. Phase 1.5 (Requirement Premise Verification) and Phase 4.7 (Migration Shape-Distribution Pre-Flight) are MANDATORY in fallback mode — these are the gates the agent uniquely enforces; skipping them produces unverified plans.
|
|
44
|
-
3. Populate the planner's output contract (`approved_plan` shape: `files_to_modify[]`, `deliverables`, `specialist_needs`, `round_type`, `shape_distribution` if applicable, `context_summary`) with `mode: 'inline_fallback'`.
|
|
45
|
-
4. Apply the pre-emptive-skip rule: when the same failure class fired in the previous spawn of this session, skip the spawn attempt entirely and go straight to inline.
|
|
46
|
-
5. Continue the skill — do NOT abort. Step 9 auto-triggers `/cbp-round-execute`; the `ask`-tier permission prompt on that skill is the user's plan approval (see Step 8).
|
|
47
|
-
|
|
48
|
-
Inline-fallback is NOT a quality downgrade trapdoor — Phase 1.5 row-by-row verification is mandatory. A fallback plan that skipped premise verification is a regression caught by the next session's cbp-improve-round.
|
|
49
|
-
|
|
50
|
-
## Pipeline
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
/cbp-round-start (planning) → /cbp-round-execute (ask-tier permission = plan approval)
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Auto-loop mode**: when `round.context.auto_loop_mode === true` flows in from `/cbp-round-input`, Step 6 (Q&A) is skipped and Step 8's `/cbp-round-execute` permission is auto-approved. See cbp-round-update SKILL.md Step 3b (auto-loop decision) and cbp-round-end SKILL.md Step 8 for the full contract.
|
|
57
|
-
|
|
58
|
-
## Instructions
|
|
59
|
-
|
|
60
|
-
### Step 0: Parse `$ARGUMENTS` shape
|
|
61
|
-
|
|
62
|
-
Disambiguate the argument up front. Three input shapes:
|
|
63
|
-
|
|
64
|
-
### CHK / TASK / ROUND Identifier Notation Vocabulary
|
|
65
|
-
|
|
66
|
-
| Shape | Regex | Meaning |
|
|
67
|
-
|-------|-------|---------|
|
|
68
|
-
| `{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`. |
|
|
69
|
-
| `{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). |
|
|
70
|
-
| Non-empty, non-identifier-shaped | — | **Free-text round requirements** (the round-input passthrough path). |
|
|
71
|
-
| _(empty)_ | — | No identifier, no requirements text — derive task/round from Kind Detection above. |
|
|
72
|
-
|
|
73
|
-
Malformed identifier shapes (`108-`, `-1-2`, `108--1`, `abc-1`) — surface this error and stop, mirroring `/cbp-task-start`'s error vocabulary:
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
round-start: invalid argument `{value}`. Expected:
|
|
77
|
-
108-1-2 → round 2 of CHK-108 TASK-1
|
|
78
|
-
45-2 → round 2 of standalone TASK-45
|
|
79
|
-
(free-text) → round requirements (typical from /cbp-round-input)
|
|
80
|
-
(empty) → derive from active task/round state
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
#### Worked examples
|
|
84
|
-
|
|
85
|
-
- `round-start 108-1-2` → resolve CHK-108 TASK-1, target round 2
|
|
86
|
-
- `round-start 45-2` → resolve standalone TASK-45, target round 2
|
|
87
|
-
- `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).
|
|
88
|
-
- `round-start "Implement OAuth flow per CHK-X plan"` → free-text path; current-task/round derivation from state
|
|
89
|
-
- `round-start` (empty) → derive from Kind Detection; round 1 uses `task.requirements`
|
|
90
|
-
- `round-start 108-` → error: malformed identifier
|
|
91
|
-
- `round-start -1-2` → error: malformed identifier
|
|
92
|
-
- `round-start abc-1` → error: malformed identifier
|
|
93
|
-
|
|
94
|
-
> **Mental-model warning**: `task-start` and `round-start` interpret the SAME `108-1` argument differently. `task-start 108-1` → CHK-108 TASK-1 (checkpoint-bound task). `round-start 108-1` → standalone TASK-108 round 1 (because round-start needs three numbers for a checkpoint-bound round). When in doubt, write all three: `round-start 108-1-2`.
|
|
95
|
-
|
|
96
|
-
### Step 1: Get Current Task
|
|
97
|
-
|
|
98
|
-
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.
|
|
99
|
-
|
|
100
|
-
Otherwise: use Kind Detection to determine KIND, then:
|
|
101
|
-
- **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).
|
|
102
|
-
- **standalone KIND**: MCP `get_current_standalone_task(repo_id)` — standalone tools are NOT migrated this task; standalone KIND still uses MCP until a later task.
|
|
103
|
-
|
|
104
|
-
If no in-progress task and Step 0 produced no identifier, show error: `No active task. Run /cbp-task-start first.`
|
|
105
|
-
|
|
106
|
-
### Step 2: Determine Round Number
|
|
107
|
-
|
|
108
|
-
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).
|
|
109
|
-
|
|
110
|
-
Otherwise:
|
|
111
|
-
- **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.
|
|
112
|
-
- **standalone KIND**: MCP `get_standalone_rounds(standalone_task_id)` — standalone still uses MCP.
|
|
113
|
-
|
|
114
|
-
Count existing rounds; next is N+1.
|
|
115
|
-
|
|
116
|
-
### Step 3: Gather Round Requirements
|
|
117
|
-
|
|
118
|
-
**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.
|
|
119
|
-
|
|
120
|
-
**Else (free-text path), if round number is 1:**
|
|
121
|
-
|
|
122
|
-
- Use `task.requirements` as the primary requirements
|
|
123
|
-
- If `$ARGUMENTS` provided (free-text), merge as additional context
|
|
124
|
-
|
|
125
|
-
**Else (free-text path), if round number > 1:**
|
|
126
|
-
|
|
127
|
-
1. If `$ARGUMENTS` provided (from `/cbp-round-input`): use as round requirements
|
|
128
|
-
2. If NO arguments: show error - `Round 2+ requires input. Run /cbp-round-input first.`
|
|
129
|
-
|
|
130
|
-
### Step 4: Create Round in DB
|
|
131
|
-
|
|
132
|
-
**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.
|
|
133
|
-
|
|
134
|
-
**standalone KIND**: MCP `add_standalone_round(standalone_task_id, ...)` — standalone still uses MCP.
|
|
135
|
-
|
|
136
|
-
Fields to supply:
|
|
137
|
-
- `task_id` (checkpoint) / `standalone_task_id` (standalone): current task ID
|
|
138
|
-
- `number`: next round number
|
|
139
|
-
- `status`: "in_progress"
|
|
140
|
-
- `started_at`: now (ISO format)
|
|
141
|
-
- `triggered_by`: `"user"` | `"claude"` | `"auto_loop"` — `auto_loop` when `auto_loop_mode === true` flows in from round-input; `claude` when auto-triggered by testing failure; `user` otherwise
|
|
142
|
-
- `requirements`: round requirements from Step 3
|
|
143
|
-
- `context`: when `auto_loop_mode === true`, persist `auto_loop_mode: true`, `auto_loop_index: N`, `auto_loop_cap: C` into `round.context` (carried forward from round-input args)
|
|
144
|
-
|
|
145
|
-
### Step 5: Load Context from DB
|
|
146
|
-
|
|
147
|
-
Load from checkpoint and task:
|
|
148
|
-
- Checkpoint context (decisions, dependencies, constraints, goal)
|
|
149
|
-
- Task context and requirements
|
|
150
|
-
- Resources from checkpoint and task (documentation links, API docs, guides)
|
|
151
|
-
- Previous round results (files_changed, QA results)
|
|
152
|
-
- For round 2+: load the latest completed round's `context.testing_qa_output` and `context.executor_output`:
|
|
153
|
-
- **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.
|
|
154
|
-
- **standalone KIND**: MCP `get_standalone_rounds(standalone_task_id)` — standalone still uses MCP.
|
|
155
|
-
- Identify unapproved files from task.files_changed (where user_approved === false)
|
|
156
|
-
|
|
157
|
-
### Step 6: First Round Analysis (Round 1 only)
|
|
158
|
-
|
|
159
|
-
For the first round only:
|
|
160
|
-
|
|
161
|
-
1. Analyze the task context and requirements thoroughly
|
|
162
|
-
2. Identify any ambiguities or gaps
|
|
163
|
-
3. If questions are needed, ask user via AskUserQuestion (max 4 per batch)
|
|
164
|
-
4. If task context changes from Q&A answers:
|
|
165
|
-
- **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.
|
|
166
|
-
- **standalone KIND**: MCP `update_standalone_task(standalone_task_id, context: {...})` — standalone still uses MCP.
|
|
167
|
-
- Save Q&A decisions as `context.decisions[]`
|
|
168
|
-
|
|
169
|
-
Skip this step for round 2+ (context already established via `/cbp-round-input`).
|
|
170
|
-
|
|
171
|
-
**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 (round 1 is always manual in practice, but the rule is explicit so future round-1 auto-loops follow it).
|
|
172
|
-
|
|
173
|
-
### Step 7: Spawn Task Planner Agent
|
|
174
|
-
|
|
175
|
-
Spawn `cbp-task-planner` agent with:
|
|
176
|
-
```yaml
|
|
177
|
-
input:
|
|
178
|
-
task_number: N
|
|
179
|
-
round_number: N
|
|
180
|
-
requirements: task.requirements
|
|
181
|
-
round_requirements: [round-specific input from Step 3]
|
|
182
|
-
checkpoint: {id, title, goal, context}
|
|
183
|
-
task: {id, title, requirements, context}
|
|
184
|
-
previous_rounds: {count, files_pending, files_changed, testing_qa_output, unapproved_files}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
**Round 2+ context**: The planner receives the previous round's testing-qa output and list of unapproved files.
|
|
188
|
-
|
|
189
|
-
**Priority**: If `round_requirements` is set (round 2+), the planner focuses on those specific goals while respecting `task.requirements` as context.
|
|
190
|
-
|
|
191
|
-
Wait for planner output.
|
|
192
|
-
|
|
193
|
-
### Step 8: Present Plan
|
|
194
|
-
|
|
195
|
-
Present the plan to user:
|
|
196
|
-
|
|
197
|
-
```
|
|
198
|
-
## Round [N] Plan
|
|
199
|
-
|
|
200
|
-
**Goal**: [goal]
|
|
201
|
-
|
|
202
|
-
### Steps:
|
|
203
|
-
1. [step]
|
|
204
|
-
2. [step]
|
|
205
|
-
...
|
|
206
|
-
|
|
207
|
-
### Files to modify:
|
|
208
|
-
| File | Action | Purpose |
|
|
209
|
-
|------|--------|---------|
|
|
210
|
-
| ... | ... | ... |
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
**Wave table** — when `approved_plan.waves[]` contains ≥2 entries, render a wave summary table BEFORE the files table:
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
### Execution Waves
|
|
217
|
-
| Wave | Agent type | Files | Depends on | Skill preloads |
|
|
218
|
-
|------|-----------|-------|-----------|----------------|
|
|
219
|
-
| web-ui | cbp-round-executor | 7 | — | cbp-frontend-design |
|
|
220
|
-
| backend-api | cbp-round-executor | 4 | — | — |
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
Single-wave plans present the existing flat plan view (no wave table) — backward compatible.
|
|
224
|
-
|
|
225
|
-
**Plan approval is the `ask`-tier `Skill(cbp-round-execute)` permission prompt** — there is NO approve/needs-changes/wrong AskUserQuestion here. After presenting the plan, proceed to Step 9, which auto-triggers `/cbp-round-execute`; the harness then shows the `ask`-tier permission prompt, and confirming it IS the user's go-ahead on the plan.
|
|
226
|
-
|
|
227
|
-
**Denied-execute handling** — if the user declines the `/cbp-round-execute` permission, the plan does not run. Treat the decline as "the plan must change":
|
|
228
|
-
|
|
229
|
-
- **Minor changes**: collect the user's feedback, re-spawn `cbp-task-planner` with it as a constraint (re-run Step 7), present the revised plan, and re-trigger `/cbp-round-execute`.
|
|
230
|
-
- **Wrong direction**: save the rejection reason to round context and auto-trigger `/cbp-round-input` for new requirements.
|
|
231
|
-
|
|
232
|
-
**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-execute` permission is auto-approved under the loop).
|
|
233
|
-
|
|
234
|
-
### Step 9: Auto-trigger Round Execute
|
|
235
|
-
|
|
236
|
-
Save planner output to round context, then trigger `/cbp-round-execute`. The `ask`-tier permission prompt on `/cbp-round-execute` is the user's plan approval (see Step 8).
|
|
237
|
-
|
|
238
|
-
- **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.
|
|
239
|
-
- **standalone KIND**: MCP `update_standalone_round(standalone_round_id, ...)` — standalone still uses MCP.
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
Starting execution phase...
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
## Key Rules
|
|
246
|
-
|
|
247
|
-
- **Planning ONLY** — no code execution, no testing
|
|
248
|
-
- Planner gets full context (checkpoint + task + previous rounds)
|
|
249
|
-
- Round 1 auto-triggered from `/cbp-task-start`
|
|
250
|
-
- Round 2+ triggered from `/cbp-round-input`
|
|
251
|
-
- Claude NEVER git adds files in round commands
|
|
252
|
-
|
|
253
|
-
## Integration
|
|
254
|
-
|
|
255
|
-
- **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)
|
|
256
|
-
- **Reads (standalone KIND)**: MCP `get_current_standalone_task`, `get_standalone_rounds` — standalone still uses MCP
|
|
257
|
-
- **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`
|
|
258
|
-
- **Writes (standalone KIND)**: MCP `add_standalone_round`, `update_standalone_round`, `update_standalone_task` — standalone still uses MCP
|
|
259
|
-
- **Spawns**: `cbp-task-planner`
|
|
260
|
-
- **Triggers**: `/cbp-round-execute` (auto, on plan approval)
|
|
261
|
-
- **Triggered by**: `/cbp-task-start` (round 1), `/cbp-round-input` (round 2+)
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: cbp-round-update
|
|
3
|
-
description: Triage a finished round (Claude-only); direct user to run round-complete on a clean round, or trigger round-input when more work is needed
|
|
4
|
-
argument-hint: [chk-task-round | task-round]
|
|
5
|
-
triggers: [cbp-round-input]
|
|
6
|
-
effort: low
|
|
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. round-update is **read + triage only** — it reads round state and routes; it never completes the round or writes file approvals. 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
|
-
| Update round (audit only) | `codebyplan round update` (break-glass: `update_round`) | `update_standalone_round(standalone_round_id, ...)` |
|
|
26
|
-
|
|
27
|
-
> **Note**: The `standalone` KIND column uses MCP tools unchanged — standalone local-first migration is out of scope for this task and will be addressed in a later task.
|
|
28
|
-
|
|
29
|
-
The completion + file-approval reconcile (`sync-approvals`, `complete_round` / `complete_standalone_round`) now lives in `/cbp-round-complete`.
|
|
30
|
-
|
|
31
|
-
# Round Update Command
|
|
32
|
-
|
|
33
|
-
**Claude-only, autonomous triage.** round-update inspects a finished round's automated state — which files Claude approved (`claude_approved`), whether testing-QA hard-failed, and whether `improve-round` left outstanding findings — and routes to exactly one next step. It makes **no writes** beyond an audit breadcrumb and **never prompts the user**: it is auto-triggered by `/cbp-round-end` and runs without a confirmation gate. The user-facing confirmation has moved to `/cbp-round-complete` (an `ask`-tier permission prompt). round-update NEVER reads or touches git staging — user approval is reconciled later by `/cbp-round-complete`.
|
|
34
|
-
|
|
35
|
-
## Routing in one line
|
|
36
|
-
|
|
37
|
-
- **Round is clean** → **direct the user to run** `/cbp-round-complete` (the user-invoked finalizer reconciles your `git add`s and completes the round; round-update cannot invoke it — round-complete is `disable-model-invocation: true`).
|
|
38
|
-
- **Round needs more work** → trigger `/cbp-round-input` (more changes / planning).
|
|
39
|
-
|
|
40
|
-
## Instructions
|
|
41
|
-
|
|
42
|
-
### Step 1: Parse `$ARGUMENTS`
|
|
43
|
-
|
|
44
|
-
Parse the argument using the canonical chk-task-round notation (see `cbp-round-start` Step 0 "CHK / TASK / ROUND Identifier Notation Vocabulary"):
|
|
45
|
-
|
|
46
|
-
| Shape | Regex | Resolves to |
|
|
47
|
-
|-------|-------|-------------|
|
|
48
|
-
| `{chk}-{task}-{round}` (e.g. `108-1-2`) | `^[0-9]+-[0-9]+-[0-9]+$` | Checkpoint-bound: CHK-{chk} TASK-{task} ROUND-{round} |
|
|
49
|
-
| `{task}-{round}` (e.g. `45-2`) | `^[0-9]+-[0-9]+$` | Standalone: standalone TASK-{task} ROUND-{round} |
|
|
50
|
-
| _(empty)_ | — | Use Kind Detection to find active task and latest round |
|
|
51
|
-
|
|
52
|
-
Anything else is malformed — surface this error and stop:
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
round-update: invalid argument `{value}`. Expected:
|
|
56
|
-
108-1-2 → CHK-108 TASK-1 ROUND-2 (checkpoint-bound)
|
|
57
|
-
45-2 → standalone TASK-45 ROUND-2
|
|
58
|
-
(empty) → active task and latest round
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Error cases: `abc`, `108-`, `-1`, anything with whitespace or non-numeric characters. Note that `108-1` is **valid** here — it resolves to standalone TASK-108 ROUND-1 per the 2-segment task-round form. To target a checkpoint-bound round, use the 3-segment form `108-1-2`.
|
|
62
|
-
|
|
63
|
-
#### Worked examples
|
|
64
|
-
|
|
65
|
-
- `round-update 108-1-2` → CHK-108 TASK-1 ROUND-2
|
|
66
|
-
- `round-update 45-2` → standalone TASK-45 ROUND-2
|
|
67
|
-
- `round-update` (no arg) → active task and latest in-progress round via Kind Detection
|
|
68
|
-
- `round-update abc` → error: malformed
|
|
69
|
-
|
|
70
|
-
### Step 1.5: Get Current Task and Round
|
|
71
|
-
|
|
72
|
-
Given the parse from Step 1:
|
|
73
|
-
|
|
74
|
-
| Parse | Resolution path |
|
|
75
|
-
|-------|-----------------|
|
|
76
|
-
| `{chk}-{task}-{round}` | Read `.codebyplan/state/checkpoints/` to find the checkpoint where `number === {chk}` (local-first; `npx codebyplan sync` on miss; break-glass: MCP `get_checkpoints(repo_id)`). Read `checkpoints/<id>/tasks/<taskId>.json` to find task where `number === {task}` (break-glass: MCP `get_tasks`). Read `checkpoints/<id>/tasks/<id>/rounds/<roundId>.json` to find round where `number === {round}` (break-glass: MCP `get_rounds`). |
|
|
77
|
-
| `{task}-{round}` | MCP `get_standalone_rounds` via `get_current_standalone_task` or direct task lookup → filter `number === {round}`. Standalone still uses MCP. |
|
|
78
|
-
| _(empty)_ | checkpoint KIND → read `.codebyplan/state/checkpoints/<id>/tasks/<id>.json` (local-first; sync on miss; break-glass: MCP `get_current_task` + `get_rounds`); standalone KIND → MCP `get_current_standalone_task(repo_id)` + `get_standalone_rounds(standalone_task_id)` — standalone still uses MCP. |
|
|
79
|
-
|
|
80
|
-
If no task found: `No active task. Nothing to update.`
|
|
81
|
-
|
|
82
|
-
This step is **read-only**. There is no permission gate — round-update is autonomous (see the Key Rules below).
|
|
83
|
-
|
|
84
|
-
### Step 2: Triage the Round
|
|
85
|
-
|
|
86
|
-
Read the latest round's context: `round.context.testing_qa_output.totals.hard_fail`, `round.context.improve_round_findings[]`, `round.context.round_type`, and `round.files_changed[]` (each entry's `claude_approved`). Compute a single `clean` verdict:
|
|
87
|
-
|
|
88
|
-
- **Survey round** (`round.context.round_type === 'survey'`): no file diff exists, so QA/approval predicates do not apply. `clean = improve_round_findings[]` is empty.
|
|
89
|
-
- **Normal round**: `clean = (every file in files_changed[] has claude_approved === true) AND testing_qa_output.totals.hard_fail === false AND improve_round_findings[]` is empty.
|
|
90
|
-
|
|
91
|
-
Display a one-line triage summary, e.g. `"ROUND-N triage: clean"` or `"ROUND-N triage: N findings / hard_fail=true → needs another round"`. round-update reads `claude_approved` only — it does **not** read git staging or `user_approved`; those belong to `/cbp-round-complete`.
|
|
92
|
-
|
|
93
|
-
### Step 3: Route
|
|
94
|
-
|
|
95
|
-
**3a — Clean → direct the user to `/cbp-round-complete`.** STOP and surface the directive: `Round clean. Next: run /cbp-round-complete to reconcile your git adds and finalize.` round-update does NOT invoke round-complete — round-complete carries `disable-model-invocation: true`, so only the user can run it (its `ask`-tier permission prompt is the user's confirmation on that direct invoke). Once the user runs it, round-complete reconciles the `git add`s, completes the round, and routes onward (all files staged → task-check; some withheld → round-input). round-update writes nothing here beyond the Step 2 summary. In `auto_loop_mode`, a clean triage is the loop's success exit — the directive applies here too (the user invokes round-complete to finalize); the loop continues only via the not-clean path in 3b, and round-complete owns the degenerate clean-but-unstaged guard.
|
|
96
|
-
|
|
97
|
-
**3b — Not clean → `/cbp-round-input`.** More changes or planning are needed. Routing is **independent of git staging** — round-input is reachable whether or not the user has staged anything (it performs its own deep analysis of the unapproved files). Two sub-cases:
|
|
98
|
-
|
|
99
|
-
- **Auto-loop** (`round.context.auto_loop_mode === true`): compute `next_index = (round.context.auto_loop_index ?? 0) + 1`.
|
|
100
|
-
- If `next_index > (round.context.auto_loop_cap ?? 5)`: surface the cap-exhausted prompt via AskUserQuestion (a genuine multi-option user decision — keep it). 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.
|
|
101
|
-
- Otherwise: persist `round.context.auto_loop_decision = { spawned_next: true, next_index, decided_at }` on the current round (audit trail) — **checkpoint KIND**: `codebyplan round update --id <round-id> --task-id <uuid> --checkpoint-id <uuid> --context <json>` (break-glass: MCP `update_round`); **standalone KIND**: MCP `update_standalone_round(standalone_round_id, ...)` — standalone still uses MCP. Then auto-trigger `/cbp-round-input` with NO prompt. 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.
|
|
102
|
-
- **Manual round**: auto-trigger `/cbp-round-input` directly (no prompt).
|
|
103
|
-
|
|
104
|
-
## Key Rules
|
|
105
|
-
|
|
106
|
-
- **Autonomous + Claude-only** — round-update never prompts before running. It is auto-triggered by `/cbp-round-end`. On a clean triage it **directs** the user to run `/cbp-round-complete` — it cannot invoke that skill (`disable-model-invocation: true`); the confirmation step is round-complete's own `ask`-tier permission prompt on the user's direct invoke, not an AskUserQuestion here. (The auto-loop cap-exhausted AskUserQuestion in Step 3b is a genuine user decision, not a run gate.)
|
|
107
|
-
- **Triage, never finalize** — round-update does NOT call `sync-approvals`, `complete_round`, or `complete_standalone_round`, and does NOT write file approvals. All of that is `/cbp-round-complete`.
|
|
108
|
-
- **Never touches git** — round-update reads `claude_approved` from the DB only; it never reads staging, asks the user to `git add`, or stages files.
|
|
109
|
-
- **git-add independence** — the "needs more work" route to `/cbp-round-input` fires regardless of whether files are staged. There is no clean-but-unstaged dead-end.
|
|
110
|
-
- **standalone parity** — KIND detection governs which read/audit tools are used; the clean→`/cbp-round-complete` and not-clean→`/cbp-round-input` routing is identical for both KINDs (round-complete and round-input self-detect KIND).
|
|
111
|
-
|
|
112
|
-
## Integration
|
|
113
|
-
|
|
114
|
-
- **Triggered by**: `/cbp-round-end` (auto), or user manually
|
|
115
|
-
- **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_checkpoints` / `get_tasks` / `get_rounds` as break-glass)
|
|
116
|
-
- **Reads (standalone KIND)**: MCP `get_current_standalone_task`, `get_standalone_rounds` — standalone still uses MCP
|
|
117
|
-
- **Writes (checkpoint KIND)**: `codebyplan round update` — audit only (`auto_loop_decision` / `auto_loop_cap_exhausted`; break-glass: MCP `update_round`). No completion, no file-approval writes.
|
|
118
|
-
- **Writes (standalone KIND)**: MCP `update_standalone_round` — audit only — standalone still uses MCP
|
|
119
|
-
- **Triggers**: `/cbp-round-input` (not-clean triage: outstanding findings, hard-fail, or unapproved Claude checks — fires independent of git staging; also the auto-loop dirty spawn), cap-exhausted prompt routes from Step 3b (any of the three options)
|
|
120
|
-
- **Directs the user to**: `/cbp-round-complete` (clean triage) — round-update cannot invoke it (`disable-model-invocation: true`); it emits a `Next: /cbp-round-complete` directive and the user runs it (its `ask`-tier permission prompt is the confirmation)
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
name: EAS Build + Submit
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'mobile-v*.*.*'
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
inputs:
|
|
9
|
-
profile:
|
|
10
|
-
type: choice
|
|
11
|
-
description: Build profile
|
|
12
|
-
options: [preview, production]
|
|
13
|
-
default: preview
|
|
14
|
-
platform:
|
|
15
|
-
type: choice
|
|
16
|
-
description: Platform
|
|
17
|
-
options: [all, ios, android]
|
|
18
|
-
default: all
|
|
19
|
-
|
|
20
|
-
jobs:
|
|
21
|
-
build:
|
|
22
|
-
runs-on: ubuntu-latest
|
|
23
|
-
steps:
|
|
24
|
-
- uses: actions/checkout@v4
|
|
25
|
-
|
|
26
|
-
- uses: pnpm/action-setup@v3
|
|
27
|
-
with:
|
|
28
|
-
version: 10
|
|
29
|
-
|
|
30
|
-
- uses: actions/setup-node@v4
|
|
31
|
-
with:
|
|
32
|
-
node-version: 22
|
|
33
|
-
cache: pnpm
|
|
34
|
-
|
|
35
|
-
- uses: expo/expo-github-action@v8
|
|
36
|
-
with:
|
|
37
|
-
eas-version: latest
|
|
38
|
-
token: ${{ secrets.EXPO_TOKEN }}
|
|
39
|
-
|
|
40
|
-
- run: pnpm install --frozen-lockfile
|
|
41
|
-
|
|
42
|
-
- name: EAS Build
|
|
43
|
-
run: |
|
|
44
|
-
cd apps/mobile
|
|
45
|
-
eas build --profile ${{ inputs.profile || 'preview' }} \
|
|
46
|
-
--platform ${{ inputs.platform || 'all' }} \
|
|
47
|
-
--non-interactive --no-wait
|
|
48
|
-
|
|
49
|
-
- name: EAS Submit (production only)
|
|
50
|
-
if: inputs.profile == 'production'
|
|
51
|
-
run: |
|
|
52
|
-
cd apps/mobile
|
|
53
|
-
eas submit --platform ${{ inputs.platform || 'all' }} --latest --non-interactive
|