codebyplan 1.13.53 → 1.13.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1364 -352
- 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 +1 -1
- package/templates/agents/cbp-stripe-agent.md +2 -2
- package/templates/agents/cbp-testing-qa-agent.md +11 -11
- 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 +58 -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 +8 -10
- 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 +2 -2
- package/templates/skills/cbp-checkpoint-create/SKILL.md +16 -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-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 +5 -5
- 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 -134
- 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 -279
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: cbp-round-end
|
|
3
|
-
description: Summary wrap-up after testing phase completes
|
|
4
|
-
effort: high
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Round End Command
|
|
8
|
-
|
|
9
|
-
Summary phase — presents what was done, then runs code quality review to catch bugs and logic errors that automated checks miss.
|
|
10
|
-
|
|
11
|
-
**Inline-fallback for any spawn failure**: when `cbp-improve-round` (or any peer agent) fails to spawn, the orchestrator falls through to an inline procedure that produces equivalent (lower-fidelity but valid) output. The contract: detect failure class → record in `round.context.improve_round_findings.spawn_failure` → walk the agent's Phase checklist inline → continue the skill. Same procedure for every failure class (org/billing, monthly Agent cap, provider 5xx, rate limit, context overflow, tool not available). Pre-emptive skip applies when the same class fired on the prior round.
|
|
12
|
-
|
|
13
|
-
See `reference/inline-fallback.md` for full trigger table, procedure, and coverage list.
|
|
14
|
-
|
|
15
|
-
## Pipeline
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
/cbp-round-execute → /cbp-round-end → [code review + auto-apply in-scope] → /cbp-round-update
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Identifier Notation
|
|
22
|
-
|
|
23
|
-
This skill operates on the **active** task/round resolved via MCP `get_current_task` / `get_rounds` and does not accept a positional identifier argument. Canonical chk-task-round notation is defined in `cbp-round-start` Step 0 "CHK / TASK / ROUND Identifier Notation Vocabulary".
|
|
24
|
-
|
|
25
|
-
## Instructions
|
|
26
|
-
|
|
27
|
-
### Step 1: Get Current Task and Round
|
|
28
|
-
|
|
29
|
-
Read `.codebyplan/state/checkpoints/<checkpointId>/tasks/<taskId>.json` (local-first) to find the active task. 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).
|
|
30
|
-
|
|
31
|
-
Read `.codebyplan/state/checkpoints/<checkpointId>/tasks/<taskId>/rounds/<roundId>.json` (local-first) to find the in-progress round. Same sync / break-glass pattern (MCP `get_rounds` as fallback).
|
|
32
|
-
|
|
33
|
-
Load round context with all outputs (executor_output, testing_qa_output, reviewer_output).
|
|
34
|
-
|
|
35
|
-
### Step 2: Collect Files Changed
|
|
36
|
-
|
|
37
|
-
Collect all files changed during this round from:
|
|
38
|
-
|
|
39
|
-
- Work executor output
|
|
40
|
-
- `git diff --name-status HEAD` for final state
|
|
41
|
-
|
|
42
|
-
Build the files list with approval status:
|
|
43
|
-
|
|
44
|
-
```json
|
|
45
|
-
[
|
|
46
|
-
{
|
|
47
|
-
"path": "src/file.ts",
|
|
48
|
-
"action": "modified",
|
|
49
|
-
"claude_approved": true,
|
|
50
|
-
"user_approved": false
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
**claude_approved**: `true` if cbp-testing-qa-agent passed for this file. `false` if issues remain.
|
|
56
|
-
**user_approved**: Always `false` initially. User approves via git staging or web UI.
|
|
57
|
-
|
|
58
|
-
### Step 3: Collect QA Results
|
|
59
|
-
|
|
60
|
-
**No QA runs here** — all QA was already executed by per-wave `cbp-testing-qa-agent` inside `/cbp-round-execute` Step 5.
|
|
61
|
-
|
|
62
|
-
#### 3a — Collect items from agent outputs
|
|
63
|
-
|
|
64
|
-
Collect from round context:
|
|
65
|
-
|
|
66
|
-
- **Auto items**: from `testing_qa_output.auto_qa.items`
|
|
67
|
-
- **Default items**: from `testing_qa_output.default_checklist.items`
|
|
68
|
-
|
|
69
|
-
Merge with previous rounds (supersede items for re-modified files, preserve verified items).
|
|
70
|
-
|
|
71
|
-
### Step 4: Update Task Files and QA
|
|
72
|
-
|
|
73
|
-
- **Round files + QA**: `codebyplan round update --id <round-id> --task-id <uuid> --checkpoint-id <uuid> --files-changed <json> --qa <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.
|
|
74
|
-
- **Task files_changed merge**: `codebyplan task update --id <task-id> --checkpoint-id <uuid> --files-changed <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.
|
|
75
|
-
- **Task QA aggregated**: `codebyplan task update --id <task-id> --checkpoint-id <uuid> --qa <json>` (same CLI write-through). Break-glass: MCP `update_task`.
|
|
76
|
-
|
|
77
|
-
### Step 5: Present Summary
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
## Round [N] Complete - Ready for Review
|
|
81
|
-
|
|
82
|
-
### Work Done
|
|
83
|
-
[Brief summary from executor_output]
|
|
84
|
-
|
|
85
|
-
### Files Changed ([N] files, [N] need approval)
|
|
86
|
-
| File | Action | Claude | User |
|
|
87
|
-
|------|--------|--------|------|
|
|
88
|
-
| src/file.ts | modified | approved | pending |
|
|
89
|
-
|
|
90
|
-
### Auto Checks
|
|
91
|
-
| Check | Status |
|
|
92
|
-
|-------|--------|
|
|
93
|
-
| Build | pass |
|
|
94
|
-
| Lint | pass |
|
|
95
|
-
| Types | pass |
|
|
96
|
-
| Tests | pass/skipped |
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Step 6: Spawn Code Quality Review
|
|
100
|
-
|
|
101
|
-
Spawn `cbp-improve-round` agent via Agent tool with:
|
|
102
|
-
|
|
103
|
-
```yaml
|
|
104
|
-
input:
|
|
105
|
-
repo_id: [from config]
|
|
106
|
-
task: {id, title, requirements, context}
|
|
107
|
-
round: {id, number, requirements, files_changed, context}
|
|
108
|
-
project_path: [working directory]
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Wait for agent to complete. If the spawn fails for any reason, apply the inline-fallback procedure documented in `reference/inline-fallback.md` (record `round.context.improve_round_findings.spawn_failure`, walk the agent's Phase checklist inline, continue the skill).
|
|
112
|
-
|
|
113
|
-
### Step 7: Present Findings
|
|
114
|
-
|
|
115
|
-
**Baseline-regression blocking gate**: before presenting code-review findings, check `round.context.frontend_ui_review.findings[]` for any entry with `category: 'baseline_regression'` (any severity). When one or more such findings exist, surface them as a BLOCKING decision that MUST be resolved before routing to `/cbp-round-update`:
|
|
116
|
-
|
|
117
|
-
- Present each regression: screenshot path, `baseline_diff_pct`, affected page/screen.
|
|
118
|
-
- Ask the user via AskUserQuestion to choose:
|
|
119
|
-
- **(a) Treat as regression** — add a fix-round to address the visual change, OR
|
|
120
|
-
- **(b) Accept the new baseline** — run `pnpm exec playwright test --update-snapshots` in `apps/{app}` and commit the updated baselines.
|
|
121
|
-
- Do NOT route to `/cbp-round-update` until the decision is recorded. Baselines are NEVER auto-accepted.
|
|
122
|
-
|
|
123
|
-
`rendered_visual` critical findings from `round.context.frontend_ui_review.findings[]` are surfaced in the normal findings presentation below (not as a separate gate).
|
|
124
|
-
|
|
125
|
-
**If `status: 'no_findings'`:** show `### Code Review\nNo issues found. Code looks good.` and skip to Step 8.
|
|
126
|
-
|
|
127
|
-
**If findings exist**, present them grouped by severity (table + per-finding details).
|
|
128
|
-
|
|
129
|
-
**Under `auto_loop_mode === true`**: do NOT auto-apply here — Step 8's auto-loop path accepts all findings into `improve_round_findings[]` and defers the fixes to the next loop round. Skip straight to Step 8.
|
|
130
|
-
|
|
131
|
-
**Manual mode**: **auto-apply all in-scope findings inline**. A finding is *in-scope* when every file it references is within the round's `files_changed[]`. The round-end orchestrator (main context — it has Edit/Write) applies these fixes directly; the `cbp-improve-round` agent stays read-only/advisory and never writes. Record each applied fix in `round.context.inline_fix_log` (findings indices, rationale, `fixes[]`, applied_at). After applying, re-run the verification scoped to the modified files (hook syntax check for `.sh`; `cbp-testing-qa-agent` for code) per `reference/findings-presentation.md`; if it fails, do NOT record the fix — treat the finding as out-of-scope instead. Findings that reference files OUTSIDE `files_changed[]` are **out-of-scope** — do NOT apply them; save them to `improve_round_findings[]` so Step 8 routes them to `/cbp-round-input` or a new task. There is no findings-decision AskUserQuestion — the round was already approved at the `/cbp-round-execute` permission prompt. The baseline-regression gate above is the ONLY user decision in this step.
|
|
132
|
-
|
|
133
|
-
Example tables and the in-scope/out-of-scope classification: see `reference/findings-presentation.md`.
|
|
134
|
-
|
|
135
|
-
### Step 8: Route Based on Decisions
|
|
136
|
-
|
|
137
|
-
**If `round.context.auto_loop_mode === true`** (auto-loop active):
|
|
138
|
-
|
|
139
|
-
- Auto-accept ALL findings into `improve_round_findings[]` regardless of severity (the user opted into the loop).
|
|
140
|
-
- Skip the polish-spiral stop-gate (auto-loop has its own cap-exhausted termination).
|
|
141
|
-
- Skip Step 7's inline auto-apply (findings are deferred to the next loop round, not applied this round).
|
|
142
|
-
- Save findings via `update_round` exactly as in manual mode.
|
|
143
|
-
- Auto-trigger `/cbp-round-update` immediately. round-update triages the round and either routes to `/cbp-round-input` (spawn another round) or **directs the user to run** `/cbp-round-complete` on a clean exit — see cbp-round-update SKILL.md Step 2/3.
|
|
144
|
-
|
|
145
|
-
**Else (manual mode — flag absent or false):**
|
|
146
|
-
|
|
147
|
-
Step 7 already auto-applied in-scope findings and logged them to `round.context.inline_fix_log`. Now record any out-of-scope findings and route:
|
|
148
|
-
|
|
149
|
-
1. **Polish-spiral stop-gate** (round 2+ only): if this is round 2 or later AND the prior round also ended with code-review fixes, surface a one-line stop-gate via AskUserQuestion — *defer remaining polish to a follow-up task* vs *continue with another round*. This is a genuine user decision about scope (it guards against endless low-value polish loops), not a flow-control prompt. Skip on round 1.
|
|
150
|
-
2. Save out-of-scope findings (those NOT auto-applied in Step 7) to round context via `codebyplan round update --id <round-id> --task-id <uuid> --checkpoint-id <uuid> --context <json>` (break-glass: MCP `update_round`):
|
|
151
|
-
```json
|
|
152
|
-
{
|
|
153
|
-
"context": {
|
|
154
|
-
"improve_round_findings": [out-of-scope findings]
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
3. Auto-trigger `/cbp-round-update`. round-update triages the round: if out-of-scope findings (or a hard-fail) remain it routes to `/cbp-round-input` (which picks up the findings from round context and includes them in the new round's requirements automatically); if the round is clean it **directs the user to run** `/cbp-round-complete` (the user-invoked finalizer that reconciles the user's `git add`s and completes the round).
|
|
159
|
-
|
|
160
|
-
## Key Rules
|
|
161
|
-
|
|
162
|
-
- Claude NEVER git adds files — user approval is via git staging at `/cbp-round-complete`
|
|
163
|
-
- Auto-triggers `/cbp-round-update` after findings are handled
|
|
164
|
-
- `/cbp-round-end` is auto-triggered by `/cbp-round-execute` (user does not call it directly)
|
|
165
|
-
- In-scope findings are **auto-applied inline** by the round-end orchestrator (the round was already approved at the `/cbp-round-execute` permission); out-of-scope findings route to `/cbp-round-input`. `cbp-improve-round` stays read-only/advisory. Baseline-regression accept (Step 7 gate) stays a user decision — baselines are NEVER auto-accepted.
|
|
166
|
-
|
|
167
|
-
## Integration
|
|
168
|
-
|
|
169
|
-
- **Triggered by**: `/cbp-round-execute` (auto, after all waves + testing complete)
|
|
170
|
-
- **Reads**: `.codebyplan/state/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)
|
|
171
|
-
- **Writes**: `codebyplan round update` (Step 4 round files/QA, Step 8 findings; break-glass: MCP `update_round`), `codebyplan task update` (Step 4 files_changed + QA aggregated; break-glass: MCP `update_task`)
|
|
172
|
-
- **Spawns**: `cbp-improve-round` (code quality review)
|
|
173
|
-
- **Triggers**: `/cbp-round-update` (auto, after findings handled)
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Inline-Fallback for Any Spawn Failure
|
|
2
|
-
|
|
3
|
-
When `improve-round` (or any agent spawned by this or peer skills) fails to spawn, the orchestrator falls through to an inline procedure that produces equivalent (lower-fidelity but valid) output. Same contract for every failure class — no special-casing per class.
|
|
4
|
-
|
|
5
|
-
## Trigger conditions (any one)
|
|
6
|
-
|
|
7
|
-
| Failure class | Detection signal |
|
|
8
|
-
| ------------------------- | ------------------------------------------------------------------------------------- |
|
|
9
|
-
| Org/billing limit | `API Error: Extra usage is required for 1M context` (the original Proposal U trigger) |
|
|
10
|
-
| Monthly Agent usage cap | `API Error: This conversation has reached the monthly Agent usage limit` or similar |
|
|
11
|
-
| Provider 5xx | Spawn returns `API Error 500` / `502` / `503` — transient or sustained |
|
|
12
|
-
| Rate limit | `API Error 429` with retry hint |
|
|
13
|
-
| Context overflow at spawn | Spawn returns `Context window exceeded` before agent can run |
|
|
14
|
-
| Tool not available | Skill caller's tool surface lacks Agent (rare — only in nested-agent contexts) |
|
|
15
|
-
|
|
16
|
-
## Fallback procedure (uniform across all triggers)
|
|
17
|
-
|
|
18
|
-
1. Note the failure: `agent_spawned: false`, `skip_reason: "<one-line failure class>"`. Save to `round.context.improve_round_findings.spawn_failure = { class, error_message, decided_at }`.
|
|
19
|
-
2. Perform the agent's analysis inline using whatever tools the orchestrator has (typically `Read` + `Bash` grep/find/head + `Glob`/`Grep`). Use the agent's documented Phase checklist as the script — agents are essentially curated checklists; following them inline produces equivalent (lower-fidelity but valid) output.
|
|
20
|
-
3. Record findings in the same shape the agent would have returned (`findings[]` array with `severity`, `category`, `file`, `description`, `suggested_fix`). Mark each with `mode: 'inline_fallback'` so analytics can distinguish.
|
|
21
|
-
4. Continue the skill — do NOT abort the round on spawn failure. The fallback is intended to keep the pipeline moving; aborting would force the user to manually re-run when the same failure will recur.
|
|
22
|
-
|
|
23
|
-
**Pre-emptive skip**: when the same failure class fired in the previous round of the same task, skip the spawn attempt entirely and go straight to inline. This avoids one wasted API call per round during a sustained outage.
|
|
24
|
-
|
|
25
|
-
## Coverage
|
|
26
|
-
|
|
27
|
-
This fallback applies to:
|
|
28
|
-
|
|
29
|
-
- `improve-round` spawned by `/cbp-round-end` (Step 6) — original case
|
|
30
|
-
- `task-planner` spawned by `/cbp-round-start` Step 7 — orchestrator falls back to inline planning using the planner's Phase checklist
|
|
31
|
-
- `testing-qa-agent` spawned by `/cbp-round-execute` Step 5 (per-wave) — orchestrator runs build/lint/types/tests inline via Bash and aggregates results in the agent's output shape
|
|
32
|
-
- `task-check` spawned by `/cbp-task-check` skill — orchestrator walks the agent's verdict checklist inline
|
|
33
|
-
- `improve-claude` spawned by its caller (when re-enabled) — orchestrator walks the agent's Phase 0-7 inline
|
|
34
|
-
|
|
35
|
-
For details, each spawning skill carries a brief "Inline fallback" section pointing back to this contract. The canonical reference is here.
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# Inline-fallback procedures
|
|
2
|
-
|
|
3
|
-
When `round-executor` or `testing-qa-agent` cannot be spawned (env limits, monthly cap, 5xx, rate limit, context overflow), the orchestrator falls through to an inline procedure that walks the agent's Phase checklist using its own tools.
|
|
4
|
-
|
|
5
|
-
The two fallback modes are documented separately so the SKILL.md stubs can link the right section.
|
|
6
|
-
|
|
7
|
-
## Execution fallback (round-executor spawn failed)
|
|
8
|
-
|
|
9
|
-
Triggered when the executor agent spawn returns one of the failure classes documented in `agent-spawn-failure-fallback.md`. Procedure:
|
|
10
|
-
|
|
11
|
-
1. Detect failure class from error string. Record:
|
|
12
|
-
```yaml
|
|
13
|
-
round.context.executor_findings.spawn_failure:
|
|
14
|
-
class: "monthly_agent_usage_limit" | "provider_5xx" | "rate_limit_429" | "context_overflow_at_spawn" | "billing_limit"
|
|
15
|
-
error_message: "<verbatim>"
|
|
16
|
-
decided_at: "<ISO>"
|
|
17
|
-
```
|
|
18
|
-
2. For `.claude/`-only file sets, fall through to the 3-INLINE branch in `../SKILL.md` Step 3 (orchestrator routes per file-routing.md to the matching build-cc skill or direct Edit).
|
|
19
|
-
3. For non-`.claude/` file sets, walk `agents/round-executor.md` Phase 1–4 inline using Read / Edit / Write / Bash / Glob / Grep. Step 3 (Implementation) is the load-bearing phase — apply each `files_to_modify[]` deliverable in order, respecting wave boundaries when wave mode is active.
|
|
20
|
-
4. Populate the executor's output contract with `mode: 'inline_fallback'` so analytics distinguishes.
|
|
21
|
-
5. Pre-emptive skip on repeat: if `prior_round.context.executor_findings.spawn_failure.class === current_class`, skip the spawn attempt entirely and go straight to inline.
|
|
22
|
-
|
|
23
|
-
## Validation fallback (testing-qa-agent spawn failed OR claude_only profile)
|
|
24
|
-
|
|
25
|
-
Triggered when testing-qa-agent spawn returns a failure class, OR when the resolved profile is `claude_only` (in which case the agent should not have been spawned at all). Procedure:
|
|
26
|
-
|
|
27
|
-
1. Detect failure class. Record:
|
|
28
|
-
```yaml
|
|
29
|
-
round.context.testing_qa_findings.spawn_failure:
|
|
30
|
-
class: "<failure_class>"
|
|
31
|
-
error_message: "<verbatim>"
|
|
32
|
-
decided_at: "<ISO>"
|
|
33
|
-
```
|
|
34
|
-
2. Apply the profile gate matrix from `agents/testing-qa-agent.md` Phase 3 to determine which checks are in-scope:
|
|
35
|
-
- `claude_only`: only hook bash syntax (`bash -n <hook>`) + skill structure validation (line counts, scope marker, /cbp-* legacy notation absent)
|
|
36
|
-
- `web`: skip desktop + backend
|
|
37
|
-
- `backend`: skip web + desktop
|
|
38
|
-
- `desktop`: skip web + backend
|
|
39
|
-
- `full_matrix`: all
|
|
40
|
-
- `cross_app`: union of touched apps
|
|
41
|
-
3. Walk `agents/testing-qa-agent.md` Phase 1 (Setup) + Phase 2 (Discovery) + Phase 3 (Mandatory Automated Testing) inline using Read / Grep / Bash. Aggregate per-check results.
|
|
42
|
-
4. Populate `testing_qa_output` shape with `mode: 'inline_fallback'`. For `claude_only` specifically, use `mode: 'inline_synthesised_for_claude_only_profile'` (the agent was never expected to spawn — this isn't a fallback, it's the documented happy path).
|
|
43
|
-
5. Pre-emptive skip on repeat: if `prior_round.context.testing_qa_findings.spawn_failure.class === current_class`, skip the spawn attempt entirely.
|
|
44
|
-
|
|
45
|
-
## Pre-emptive skip rule
|
|
46
|
-
|
|
47
|
-
Per `agent-spawn-failure-fallback.md` item 5: when the same failure class fired in the previous round of the same task, skip the spawn attempt entirely and go straight to inline. This avoids one wasted API call per round during a sustained outage.
|
|
48
|
-
|
|
49
|
-
## Pairs With
|
|
50
|
-
|
|
51
|
-
- `../SKILL.md` — points at this reference for procedural detail
|
|
52
|
-
- `agents/round-executor.md` — execution-fallback target agent
|
|
53
|
-
- `agents/testing-qa-agent.md` — validation-fallback target agent + Phase 3 profile gate matrix
|
|
54
|
-
- `rules/agent-spawn-failure-fallback.md` — required-coverage table; canonical failure classes
|
|
55
|
-
- `rules/testing-profile.md` — claude_only profile detail; cross-app union semantics
|
|
@@ -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)
|