codebyplan 1.5.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -5
- package/dist/cli.js +4578 -2709
- package/package.json +5 -1
- package/templates/.gitkeep +0 -0
- package/templates/README.md +20 -0
- package/templates/agents/cbp-cc-executor.md +213 -0
- package/templates/agents/cbp-database-agent.md +229 -0
- package/templates/agents/cbp-improve-claude.md +245 -0
- package/templates/agents/cbp-improve-round.md +284 -0
- package/templates/agents/cbp-mechanical-edits.md +111 -0
- package/templates/agents/cbp-research.md +282 -0
- package/templates/agents/cbp-round-executor.md +604 -0
- package/templates/agents/cbp-security-agent.md +134 -0
- package/templates/agents/cbp-task-check.md +213 -0
- package/templates/agents/cbp-task-planner.md +582 -0
- package/templates/agents/cbp-test-e2e-agent.md +363 -0
- package/templates/agents/cbp-testing-qa-agent.md +400 -0
- package/templates/context/mcp-docs.md +139 -0
- package/templates/hooks/README.md +236 -0
- package/templates/hooks/cbp-auto-test-hooks.sh +44 -0
- package/templates/hooks/cbp-lint-format-on-edit.sh +159 -0
- package/templates/hooks/cbp-maestro-yaml-validate.sh +100 -0
- package/templates/hooks/cbp-mcp-migration-guard.sh +32 -0
- package/templates/hooks/cbp-mcp-round-sync.sh +79 -0
- package/templates/hooks/cbp-mcp-worktree-inject.sh +76 -0
- package/templates/hooks/cbp-notify.sh +68 -0
- package/templates/hooks/cbp-plugin-dispatch.sh +29 -0
- package/templates/hooks/cbp-pre-commit-quality-gate.sh +204 -0
- package/templates/hooks/cbp-statusline.sh +347 -0
- package/templates/hooks/cbp-subagent-statusline.sh +182 -0
- package/templates/hooks/cbp-test-coverage-gate.sh +144 -0
- package/templates/hooks/cbp-test-hooks.sh +320 -0
- package/templates/hooks/hooks.json +85 -0
- package/templates/hooks/validate-context-usage.sh +59 -0
- package/templates/hooks/validate-git-commit.sh +78 -0
- package/templates/hooks/validate-git-stash-deny.sh +32 -0
- package/templates/hooks/validate-structure-lengths.sh +57 -0
- package/templates/hooks/validate-structure-lib.sh +104 -0
- package/templates/hooks/validate-structure-patterns.sh +54 -0
- package/templates/hooks/validate-structure-scope.sh +33 -0
- package/templates/hooks/validate-structure-smoke.sh +95 -0
- package/templates/hooks/validate-structure-templates.sh +34 -0
- package/templates/hooks/validate-structure.sh +69 -0
- package/templates/rules/.gitkeep +0 -0
- package/templates/rules/README.md +47 -0
- package/templates/rules/context-file-loading.md +52 -0
- package/templates/rules/scope-vocabulary.md +64 -0
- package/templates/rules/todo-backend.md +109 -0
- package/templates/settings.project.base.json +55 -0
- package/templates/settings.user.base.json +25 -0
- package/templates/skills/cbp-build-cc-agent/SKILL.md +139 -0
- package/templates/skills/cbp-build-cc-agent/examples/read-only-reviewer.md +32 -0
- package/templates/skills/cbp-build-cc-agent/examples/with-hooks.md +41 -0
- package/templates/skills/cbp-build-cc-agent/examples/with-skills-preload.md +25 -0
- package/templates/skills/cbp-build-cc-agent/reference/cbp-quality.md +153 -0
- package/templates/skills/cbp-build-cc-agent/reference/frontmatter-fields.md +37 -0
- package/templates/skills/cbp-build-cc-agent/reference/permission-modes.md +18 -0
- package/templates/skills/cbp-build-cc-agent/scripts/validate-agent.sh +67 -0
- package/templates/skills/cbp-build-cc-agent/templates/agent.md +66 -0
- package/templates/skills/cbp-build-cc-claude-file/SKILL.md +178 -0
- package/templates/skills/cbp-build-cc-claude-file/examples/minimal-project.md +33 -0
- package/templates/skills/cbp-build-cc-claude-file/examples/monorepo-with-imports.md +39 -0
- package/templates/skills/cbp-build-cc-claude-file/reference/imports.md +72 -0
- package/templates/skills/cbp-build-cc-claude-file/reference/what-belongs.md +39 -0
- package/templates/skills/cbp-build-cc-claude-file/templates/project-claude-md.md +48 -0
- package/templates/skills/cbp-build-cc-claude-file/templates/user-claude-md.md +22 -0
- package/templates/skills/cbp-build-cc-memory/SKILL.md +201 -0
- package/templates/skills/cbp-build-cc-memory/examples/feedback-memory.md +11 -0
- package/templates/skills/cbp-build-cc-memory/examples/project-memory.md +11 -0
- package/templates/skills/cbp-build-cc-memory/examples/reference-memory.md +13 -0
- package/templates/skills/cbp-build-cc-memory/examples/user-memory.md +14 -0
- package/templates/skills/cbp-build-cc-memory/reference/memory-types.md +59 -0
- package/templates/skills/cbp-build-cc-memory/reference/when-to-save.md +62 -0
- package/templates/skills/cbp-build-cc-memory/templates/MEMORY-index.md +4 -0
- package/templates/skills/cbp-build-cc-memory/templates/memory-entry.md +15 -0
- package/templates/skills/cbp-build-cc-mode/SKILL.md +99 -0
- package/templates/skills/cbp-build-cc-rule/SKILL.md +176 -0
- package/templates/skills/cbp-build-cc-rule/examples/global-rule.md +19 -0
- package/templates/skills/cbp-build-cc-rule/examples/scoped-rule.md +41 -0
- package/templates/skills/cbp-build-cc-rule/reference/paths-patterns.md +48 -0
- package/templates/skills/cbp-build-cc-rule/templates/rule.md +32 -0
- package/templates/skills/cbp-build-cc-settings/SKILL.md +220 -0
- package/templates/skills/cbp-build-cc-settings/examples/hooks-config.json +64 -0
- package/templates/skills/cbp-build-cc-settings/examples/permissions-config.json +34 -0
- package/templates/skills/cbp-build-cc-settings/examples/sandbox-config.json +42 -0
- package/templates/skills/cbp-build-cc-settings/reference/cbp-conventions.md +104 -0
- package/templates/skills/cbp-build-cc-settings/reference/permission-rules.md +61 -0
- package/templates/skills/cbp-build-cc-settings/reference/scope-precedence.md +73 -0
- package/templates/skills/cbp-build-cc-settings/reference/settings-fields.md +166 -0
- package/templates/skills/cbp-build-cc-settings/templates/settings.json +23 -0
- package/templates/skills/cbp-build-cc-settings/templates/settings.local.json +10 -0
- package/templates/skills/cbp-build-cc-skill/SKILL.md +154 -0
- package/templates/skills/cbp-build-cc-skill/examples/dynamic-context.md +31 -0
- package/templates/skills/cbp-build-cc-skill/examples/fork-skill.md +22 -0
- package/templates/skills/cbp-build-cc-skill/examples/knowledge-skill.md +25 -0
- package/templates/skills/cbp-build-cc-skill/examples/task-skill.md +29 -0
- package/templates/skills/cbp-build-cc-skill/reference/cbp-quality.md +157 -0
- package/templates/skills/cbp-build-cc-skill/reference/frontmatter-fields.md +35 -0
- package/templates/skills/cbp-build-cc-skill/reference/string-substitutions.md +60 -0
- package/templates/skills/cbp-build-cc-skill/scripts/validate-skill.sh +90 -0
- package/templates/skills/cbp-build-cc-skill/templates/skill.md +51 -0
- package/templates/skills/cbp-checkpoint-check/SKILL.md +156 -0
- package/templates/skills/cbp-checkpoint-complete/SKILL.md +109 -0
- package/templates/skills/cbp-checkpoint-create/SKILL.md +287 -0
- package/templates/skills/cbp-checkpoint-end/SKILL.md +241 -0
- package/templates/skills/cbp-checkpoint-update/SKILL.md +115 -0
- package/templates/skills/cbp-frontend-a11y/SKILL.md +109 -0
- package/templates/skills/cbp-frontend-a11y/reference/aria-roles-states.md +130 -0
- package/templates/skills/cbp-frontend-a11y/reference/contrast-visual.md +122 -0
- package/templates/skills/cbp-frontend-a11y/reference/keyboard-patterns.md +154 -0
- package/templates/skills/cbp-frontend-a11y/reference/semantic-html.md +111 -0
- package/templates/skills/cbp-frontend-design/SKILL.md +145 -0
- package/templates/skills/cbp-frontend-design/reference/nextjs-scss.md +118 -0
- package/templates/skills/cbp-frontend-design/reference/rn-expo.md +101 -0
- package/templates/skills/cbp-frontend-design/reference/tauri-react.md +82 -0
- package/templates/skills/cbp-frontend-ui/SKILL.md +262 -0
- package/templates/skills/cbp-frontend-ui/reference/ui-label-maps.md +42 -0
- package/templates/skills/cbp-frontend-ui/reference/ui-layout-patterns.md +105 -0
- package/templates/skills/cbp-frontend-ui/reference/variant-defaults.md +149 -0
- package/templates/skills/cbp-frontend-ux/SKILL.md +181 -0
- package/templates/skills/cbp-git-branch-feat-create/SKILL.md +115 -0
- package/templates/skills/cbp-git-commit/SKILL.md +278 -0
- package/templates/skills/cbp-git-worktree-create/SKILL.md +226 -0
- package/templates/skills/cbp-git-worktree-remove/SKILL.md +145 -0
- package/templates/skills/cbp-merge-main/SKILL.md +228 -0
- package/templates/skills/cbp-round-check/SKILL.md +104 -0
- package/templates/skills/cbp-round-end/SKILL.md +183 -0
- package/templates/skills/cbp-round-end/reference/findings-presentation.md +44 -0
- package/templates/skills/cbp-round-end/reference/inline-fallback.md +35 -0
- package/templates/skills/cbp-round-execute/SKILL.md +211 -0
- package/templates/skills/cbp-round-execute/reference/inline-fallback.md +59 -0
- package/templates/skills/cbp-round-input/SKILL.md +165 -0
- package/templates/skills/cbp-round-start/SKILL.md +222 -0
- package/templates/skills/cbp-round-update/SKILL.md +163 -0
- package/templates/skills/cbp-session-end/SKILL.md +187 -0
- package/templates/skills/cbp-session-start/SKILL.md +155 -0
- package/templates/skills/cbp-ship/SKILL.md +332 -0
- package/templates/skills/cbp-ship/reference/changesets-overview.md +120 -0
- package/templates/skills/cbp-ship/reference/eas-cli-overview.md +60 -0
- package/templates/skills/cbp-ship/reference/gh-cli-overview.md +135 -0
- package/templates/skills/cbp-ship/reference/gh-cli-shipment-commands.md +283 -0
- package/templates/skills/cbp-ship/reference/npm-publish-monorepo.md +252 -0
- package/templates/skills/cbp-ship/reference/npm-publish-oidc-trusted.md +157 -0
- package/templates/skills/cbp-ship/reference/npm-publish-overview.md +171 -0
- package/templates/skills/cbp-ship/reference/preflight-checklist.md +88 -0
- package/templates/skills/cbp-ship/reference/railway-nestjs-deployment.md +169 -0
- package/templates/skills/cbp-ship/reference/railway-overview.md +120 -0
- package/templates/skills/cbp-ship/reference/railway-troubleshooting.md +168 -0
- package/templates/skills/cbp-ship/reference/release-please-overview.md +99 -0
- package/templates/skills/cbp-ship/reference/surface-expo-eas.md +155 -0
- package/templates/skills/cbp-ship/reference/surface-npm.md +180 -0
- package/templates/skills/cbp-ship/reference/surface-railway.md +152 -0
- package/templates/skills/cbp-ship/reference/surface-supabase.md +178 -0
- package/templates/skills/cbp-ship/reference/surface-tauri.md +138 -0
- package/templates/skills/cbp-ship/reference/surface-vercel.md +124 -0
- package/templates/skills/cbp-ship/reference/surface-vscode-ext.md +144 -0
- package/templates/skills/cbp-ship/reference/surfaces.md +60 -0
- package/templates/skills/cbp-ship/reference/testflight-automation.md +215 -0
- package/templates/skills/cbp-ship/reference/testflight-internal-vs-external.md +69 -0
- package/templates/skills/cbp-ship/reference/testflight-overview.md +98 -0
- package/templates/skills/cbp-ship/reference/versioning.md +116 -0
- package/templates/skills/cbp-ship/scripts/detect-surfaces.sh +217 -0
- package/templates/skills/cbp-ship/scripts/verify-expo-eas.sh +35 -0
- package/templates/skills/cbp-ship/scripts/verify-npm.sh +21 -0
- package/templates/skills/cbp-ship/scripts/verify-railway.sh +41 -0
- package/templates/skills/cbp-ship/scripts/verify-supabase.sh +19 -0
- package/templates/skills/cbp-ship/scripts/verify-tauri.sh +24 -0
- package/templates/skills/cbp-ship/scripts/verify-vercel.sh +32 -0
- package/templates/skills/cbp-ship/scripts/verify-vscode-ext.sh +25 -0
- package/templates/skills/cbp-ship/templates/eas.json +66 -0
- package/templates/skills/cbp-ship/templates/railway.toml +15 -0
- package/templates/skills/cbp-ship/templates/release-please-config.json +17 -0
- package/templates/skills/cbp-ship/templates/vercel.json +19 -0
- package/templates/skills/cbp-ship/templates/vscodeignore +21 -0
- package/templates/skills/cbp-ship/templates/workflow-changesets.yml +41 -0
- package/templates/skills/cbp-ship/templates/workflow-eas-submit.yml +53 -0
- package/templates/skills/cbp-ship/templates/workflow-npm-publish.yml +36 -0
- package/templates/skills/cbp-ship/templates/workflow-release-please.yml +21 -0
- package/templates/skills/cbp-ship/templates/workflow-tauri-release.yml +69 -0
- package/templates/skills/cbp-ship/templates/workflow-vsce-publish.yml +31 -0
- package/templates/skills/cbp-ship-configure/SKILL.md +296 -0
- package/templates/skills/cbp-ship-configure/reference/expo-mobile.md +204 -0
- package/templates/skills/cbp-ship-configure/reference/npm-package.md +165 -0
- package/templates/skills/cbp-ship-configure/reference/railway-backend.md +199 -0
- package/templates/skills/cbp-ship-configure/reference/supabase.md +200 -0
- package/templates/skills/cbp-ship-configure/reference/tauri-desktop.md +181 -0
- package/templates/skills/cbp-ship-configure/reference/vercel.md +117 -0
- package/templates/skills/cbp-ship-configure/reference/vscode-ext.md +155 -0
- package/templates/skills/cbp-ship-main/SKILL.md +65 -0
- package/templates/skills/cbp-supabase-branch-check/SKILL.md +337 -0
- package/templates/skills/cbp-supabase-branch-check/reference/dag-steps.md +29 -0
- package/templates/skills/cbp-supabase-migrate/SKILL.md +314 -0
- package/templates/skills/cbp-supabase-migrate/reference/advisor-triage.md +70 -0
- package/templates/skills/cbp-supabase-migrate/reference/cli-fallback.md +87 -0
- package/templates/skills/cbp-supabase-migrate/reference/preflight-dry-run.md +58 -0
- package/templates/skills/cbp-supabase-setup/SKILL.md +239 -0
- package/templates/skills/cbp-supabase-setup/reference/branching-setup.md +121 -0
- package/templates/skills/cbp-supabase-setup/reference/cli-fallback.md +109 -0
- package/templates/skills/cbp-task-check/SKILL.md +166 -0
- package/templates/skills/cbp-task-complete/SKILL.md +206 -0
- package/templates/skills/cbp-task-complete/reference/checkpoint-done-branching.md +48 -0
- package/templates/skills/cbp-task-complete/reference/next-step-heuristic.md +56 -0
- package/templates/skills/cbp-task-create/SKILL.md +167 -0
- package/templates/skills/cbp-task-start/SKILL.md +239 -0
- package/templates/skills/cbp-task-testing/SKILL.md +277 -0
- package/templates/skills/cbp-todo/SKILL.md +97 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
name: cbp-round-check
|
|
4
|
+
description: Run automated checks standalone for the current round
|
|
5
|
+
effort: low
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Re-read this file before executing. Do not rely on memory. -->
|
|
9
|
+
|
|
10
|
+
# Round Check Command
|
|
11
|
+
|
|
12
|
+
Run automated checks independently with mandatory execution. Updates round QA. Hard fails if mandatory checks (build/lint/types) fail.
|
|
13
|
+
|
|
14
|
+
## Instructions
|
|
15
|
+
|
|
16
|
+
### Step 1: Get Current Round
|
|
17
|
+
|
|
18
|
+
Use MCP `get_current_task` to find active task, then `get_rounds` to find the in-progress round.
|
|
19
|
+
|
|
20
|
+
### Step 2: Determine Project Root
|
|
21
|
+
|
|
22
|
+
Find the correct app directory:
|
|
23
|
+
```bash
|
|
24
|
+
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
25
|
+
```
|
|
26
|
+
Identify app dir from project structure (e.g., `apps/web/` for Next.js).
|
|
27
|
+
|
|
28
|
+
### Step 3: Execute Mandatory Checks (Hard Fail)
|
|
29
|
+
|
|
30
|
+
For each check, EXECUTE the command and capture stdout + stderr. Log execution status.
|
|
31
|
+
|
|
32
|
+
| Check | Command | Hard Fail |
|
|
33
|
+
|-------|---------|-----------|
|
|
34
|
+
| **Build** | `cd {app_dir} && npm run build 2>&1` | YES |
|
|
35
|
+
| **Lint** | `cd {app_dir} && npm run lint 2>&1` | YES |
|
|
36
|
+
| **Types** | `cd {app_dir} && npx tsc --noEmit 2>&1` | YES |
|
|
37
|
+
|
|
38
|
+
For each:
|
|
39
|
+
- Run the command via Bash tool
|
|
40
|
+
- Log `EXECUTED: <command>` or `FAILED: <command> (exit code: N)`
|
|
41
|
+
- If skipping (infrastructure-only changes): log `SKIPPED: <command> (reason: no app code changed)`
|
|
42
|
+
|
|
43
|
+
### Step 4: Execute Conditional Checks
|
|
44
|
+
|
|
45
|
+
| Check | Command | Condition |
|
|
46
|
+
|-------|---------|-----------|
|
|
47
|
+
| **Tests** | `cd {app_dir} && npx vitest --run 2>&1` | Test files exist |
|
|
48
|
+
| **A11y** | Static check (aria, alt, focus) | UI files changed |
|
|
49
|
+
| **API Health** | `curl -s -o /dev/null -w "%{http_code}" http://localhost:{PORT}/` | API routes changed |
|
|
50
|
+
| **Visual** | Visual check flow (page-map + visual-check) | UI work + dev server running |
|
|
51
|
+
|
|
52
|
+
### Step 5: Analyze Build Output
|
|
53
|
+
|
|
54
|
+
Scan all captured output for:
|
|
55
|
+
- **Warnings** (not just errors)
|
|
56
|
+
- **Deprecation notices** (`grep -i "deprecat"` in output)
|
|
57
|
+
- **Console.log in changed files**: `grep -rn "console\.\(log\|debug\|info\)" {changed_files}` (exclude tests)
|
|
58
|
+
- **Bundle size warnings**
|
|
59
|
+
|
|
60
|
+
### Step 6: Save QA Results
|
|
61
|
+
|
|
62
|
+
Update round QA via MCP `update_round(round_id, qa: ...)`:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"items": [
|
|
67
|
+
{"type": "auto", "check": "build", "status": "pass", "ran_at": "...", "notes": null, "executed": true},
|
|
68
|
+
{"type": "auto", "check": "lint", "status": "fail", "ran_at": "...", "notes": "3 errors", "executed": true},
|
|
69
|
+
{"type": "auto", "check": "types", "status": "pass", "ran_at": "...", "notes": null, "executed": true},
|
|
70
|
+
{"type": "auto", "check": "tests", "status": "skipped", "ran_at": "...", "notes": "no test files", "executed": false}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Step 7: Show Results
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
## Round Check Results
|
|
79
|
+
|
|
80
|
+
| Check | Status | Executed | Notes |
|
|
81
|
+
|-------|--------|----------|-------|
|
|
82
|
+
| Build | pass | yes | - |
|
|
83
|
+
| Lint | fail | yes | 3 errors |
|
|
84
|
+
| Types | pass | yes | - |
|
|
85
|
+
| Tests | skipped | no | no test files |
|
|
86
|
+
| Visual | pass | yes | screenshots saved |
|
|
87
|
+
|
|
88
|
+
### Build Analysis
|
|
89
|
+
- Warnings: [N]
|
|
90
|
+
- Deprecations: [N]
|
|
91
|
+
- Console.logs in code: [N]
|
|
92
|
+
|
|
93
|
+
**Result**: [N] passed, [N] failed, [N] skipped
|
|
94
|
+
**Hard fail**: [yes/no]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
If hard fail: `Mandatory checks failed. Fix issues before continuing.`
|
|
98
|
+
If soft failures only: `Run /cbp-round-start to trigger auto-fix, or fix manually.`
|
|
99
|
+
|
|
100
|
+
## Integration
|
|
101
|
+
|
|
102
|
+
- **Reads**: MCP `get_current_task`, `get_rounds`
|
|
103
|
+
- **Writes**: MCP `update_round` (qa field)
|
|
104
|
+
- **Standalone**: Can be run independently at any time
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
name: cbp-round-end
|
|
4
|
+
description: Summary wrap-up after testing phase completes
|
|
5
|
+
effort: high
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Round End Command
|
|
9
|
+
|
|
10
|
+
Summary phase — presents what was done, then runs code quality review to catch bugs and logic errors that automated checks miss.
|
|
11
|
+
|
|
12
|
+
**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.
|
|
13
|
+
|
|
14
|
+
See `reference/inline-fallback.md` for full trigger table, procedure, and coverage list.
|
|
15
|
+
|
|
16
|
+
## Pipeline
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
/cbp-round-execute → /cbp-round-end → [code review + user decisions] → /cbp-round-update
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Identifier Notation
|
|
23
|
+
|
|
24
|
+
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 — 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
|
+
|
|
26
|
+
## Instructions
|
|
27
|
+
|
|
28
|
+
### Step 1: Get Current Task and Round
|
|
29
|
+
|
|
30
|
+
Use MCP `get_current_task` with repo_id (pass `checkpoint_id` if known to avoid disambiguation) to find the active task.
|
|
31
|
+
Use MCP `get_rounds` for the task to find the in-progress round.
|
|
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 and Aggregate 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
|
+
This step is the **canonical user_qa[] construction site**. cbp-testing-qa-agent and cbp-test-e2e-agent are fully independent producers (no cross-read); cross-source user_qa items that combine signals from multiple producers are built here, at the user-facing boundary. Single-source user_qa items (derivable from one producer's data alone) stay with that producer.
|
|
63
|
+
|
|
64
|
+
#### 3a — Collect single-source items from agent outputs
|
|
65
|
+
|
|
66
|
+
Collect from round context (all three sources are agent-derived):
|
|
67
|
+
|
|
68
|
+
- **Auto items**: from `testing_qa_output.auto_qa.items`
|
|
69
|
+
- **User items (single-source)**: from `testing_qa_output.user_qa.items` (Phase 4b.1 design-source comparison + Phase 4b.2 mechanical-sweep spot-check + Phase 4b.0 connection smoke — all derivable from cbp-testing-qa-agent's own data)
|
|
70
|
+
- **Default items**: from `testing_qa_output.default_checklist.items`
|
|
71
|
+
|
|
72
|
+
#### 3b — Construct cross-source user_qa from frontend_ui_review (NEW)
|
|
73
|
+
|
|
74
|
+
Read `round.context.frontend_ui_review.findings[]` (populated by the `cbp-frontend-ui` skill at `/cbp-round-execute` Step 5b under `phase: 'screenshot_review'`). For each finding, emit a `user_qa` item per the rules below.
|
|
75
|
+
|
|
76
|
+
| Finding `category` | Finding `severity` | Emitted user_qa item |
|
|
77
|
+
|--------------------|-------------------|---------------------|
|
|
78
|
+
| `baseline_regression` | any | `{ type: 'user', check: 'Visual baseline regression — {page_or_screen}', status: 'pending', round_number: N, instructions: 'Open the diff PNG at `{screenshot}` (the `-diff.png` sibling shows pixel differences). Pixel-diff was `{baseline_diff_pct}%`. Decide: (a) regression — add a task to fix, OR (b) new rendering is correct — run `pnpm exec playwright test --update-snapshots` in `apps/{app}` and commit the updated baselines. Do NOT proceed until a decision is recorded.' }` |
|
|
79
|
+
| `rendered_visual` | `critical` | `{ type: 'user', check: 'Rendered-visual critical — {page_or_screen}', status: 'pending', round_number: N, instructions: 'Open the screenshot at `{screenshot}`. The cbp-frontend-ui review flagged a critical rendering issue: `{finding.issue}`. Suggested fix: `{finding.suggestion}`. Decide whether this needs a fix-round before proceeding.' }` |
|
|
80
|
+
| `rendered_visual` | `warning` | (no user_qa item; finding stays in `frontend_ui_review.findings` and surfaces via Step 7 findings presentation if relevant) |
|
|
81
|
+
| Other categories | any | (no user_qa item from this step) |
|
|
82
|
+
|
|
83
|
+
Skip Step 3b entirely when `round.context.frontend_ui_review` is absent (no e2e ran, or screenshot-review phase didn't execute).
|
|
84
|
+
|
|
85
|
+
This is the required user gate for baseline updates — baselines are NEVER auto-accepted.
|
|
86
|
+
|
|
87
|
+
#### 3c — Merge
|
|
88
|
+
|
|
89
|
+
Combine the single-source items (3a) and cross-source items (3b) into a single `user_qa[]` for the round. Merge with previous rounds (supersede items for re-modified files, preserve verified items).
|
|
90
|
+
|
|
91
|
+
### Step 4: Update Task Files and QA
|
|
92
|
+
|
|
93
|
+
Update via MCP:
|
|
94
|
+
|
|
95
|
+
- `update_task(task_id, files_changed: [...])` — merge with existing
|
|
96
|
+
- `update_round(round_id, files_changed: [...], qa: {items: [...]})` — round-specific
|
|
97
|
+
- `update_task(task_id, qa: {items: [...]})` — aggregated
|
|
98
|
+
|
|
99
|
+
### Step 5: Present Summary
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
## Round [N] Complete - Ready for Review
|
|
103
|
+
|
|
104
|
+
### Work Done
|
|
105
|
+
[Brief summary from executor_output]
|
|
106
|
+
|
|
107
|
+
### Files Changed ([N] files, [N] need approval)
|
|
108
|
+
| File | Action | Claude | User |
|
|
109
|
+
|------|--------|--------|------|
|
|
110
|
+
| src/file.ts | modified | approved | pending |
|
|
111
|
+
|
|
112
|
+
### Auto Checks
|
|
113
|
+
| Check | Status |
|
|
114
|
+
|-------|--------|
|
|
115
|
+
| Build | pass |
|
|
116
|
+
| Lint | pass |
|
|
117
|
+
| Types | pass |
|
|
118
|
+
| Tests | pass/skipped |
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Step 6: Spawn Code Quality Review
|
|
122
|
+
|
|
123
|
+
Spawn `cbp-improve-round` agent via Agent tool with:
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
input:
|
|
127
|
+
repo_id: [from config]
|
|
128
|
+
task: {id, title, requirements, context}
|
|
129
|
+
round: {id, number, requirements, files_changed, context}
|
|
130
|
+
project_path: [working directory]
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
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).
|
|
134
|
+
|
|
135
|
+
### Step 7: Present Findings
|
|
136
|
+
|
|
137
|
+
**If `status: 'no_findings'`:** show `### Code Review\nNo issues found. Code looks good.` and skip to Step 8.
|
|
138
|
+
|
|
139
|
+
**If findings exist**, present them grouped by severity (table + per-finding details), then ask the user via AskUserQuestion which to fix: `all`, `1,2` (specific numbers), `none`, or `inline` (only when all findings qualify under the Trivial-Resolution Exception).
|
|
140
|
+
|
|
141
|
+
Example tables and the `inline` option gating spec: see `reference/findings-presentation.md`.
|
|
142
|
+
|
|
143
|
+
### Step 8: Route Based on Decisions
|
|
144
|
+
|
|
145
|
+
**If `round.context.auto_loop_mode === true`** (auto-loop active):
|
|
146
|
+
|
|
147
|
+
- Auto-accept ALL findings into `improve_round_findings[]` regardless of severity (the user opted into the loop).
|
|
148
|
+
- Skip the polish-spiral stop-gate (auto-loop has its own cap-exhausted termination).
|
|
149
|
+
- Skip the user findings-decision prompt.
|
|
150
|
+
- Save findings via `update_round` exactly as in manual mode.
|
|
151
|
+
- Auto-trigger `/cbp-round-update` immediately. round-update Step 6 will decide whether to spawn another round or exit clean (see cbp-round-update SKILL.md Step 6).
|
|
152
|
+
|
|
153
|
+
**Else (manual mode — flag absent or false):**
|
|
154
|
+
|
|
155
|
+
Run the existing flow:
|
|
156
|
+
|
|
157
|
+
1. After round 2+, surface the polish-spiral stop-gate per `polish-spiral-stop-gate.md` (defer-to-followups vs continue).
|
|
158
|
+
2. Surface the findings-decision AskUserQuestion (with optional `inline` per the gating rules in `reference/findings-presentation.md`).
|
|
159
|
+
3. Save accepted/rejected findings to round context via MCP `update_round`:
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"context": {
|
|
163
|
+
"improve_round_findings": [accepted findings],
|
|
164
|
+
"improve_round_rejected": [rejected findings with user reasons]
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
4. Auto-trigger `/cbp-round-update`. round-update will see unapproved files and route to `/cbp-round-input`; `/cbp-round-input` picks up the findings from round context and includes them in the new round's requirements automatically.
|
|
169
|
+
|
|
170
|
+
## Key Rules
|
|
171
|
+
|
|
172
|
+
- Claude NEVER git adds files — user does code review
|
|
173
|
+
- Auto-triggers `/cbp-round-update` after findings are handled
|
|
174
|
+
- `/cbp-round-end` is auto-triggered by `/cbp-round-execute` (user does not call it directly)
|
|
175
|
+
- Findings are **presented for user decision** — never auto-fix without user consent
|
|
176
|
+
|
|
177
|
+
## Integration
|
|
178
|
+
|
|
179
|
+
- **Triggered by**: `/cbp-round-execute` (auto, after all waves + testing complete)
|
|
180
|
+
- **Reads**: MCP `get_current_task`, `get_rounds`, round context
|
|
181
|
+
- **Writes**: MCP `update_round`, `update_task` (files_changed, qa, findings)
|
|
182
|
+
- **Spawns**: `cbp-improve-round` (code quality review)
|
|
183
|
+
- **Triggers**: `/cbp-round-update` (auto, after findings handled)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Findings Presentation in `/cbp-round-end` Step 7
|
|
2
|
+
|
|
3
|
+
When `improve-round` returns findings, Step 7 presents them grouped by severity and asks the user how to proceed.
|
|
4
|
+
|
|
5
|
+
## Example output
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
### Code Review Findings
|
|
9
|
+
|
|
10
|
+
| # | Severity | Category | File | Issue |
|
|
11
|
+
|---|----------|----------|------|-------|
|
|
12
|
+
| 1 | critical | bug | src/api.ts:42 | Missing null check on user input |
|
|
13
|
+
| 2 | high | logic_error | src/calc.ts:15 | Off-by-one in loop boundary |
|
|
14
|
+
| 3 | medium | edge_case | src/form.ts:88 | Empty array not handled |
|
|
15
|
+
|
|
16
|
+
#### Details
|
|
17
|
+
|
|
18
|
+
**1. Missing null check on user input** (critical)
|
|
19
|
+
[description + suggested fix from agent]
|
|
20
|
+
|
|
21
|
+
**2. Off-by-one in loop boundary** (high)
|
|
22
|
+
[description + suggested fix from agent]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## AskUserQuestion options
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Which findings should be fixed?
|
|
29
|
+
- "all" — fix all findings in a new round
|
|
30
|
+
- "1,2" — fix specific findings by number
|
|
31
|
+
- "none" — skip all, proceed to round-update
|
|
32
|
+
- "inline" — fix in THIS round before proceeding (only offered when all findings qualify under `infra-issue-absorption.md` Trivial-Resolution Exception)
|
|
33
|
+
- Or explain why specific findings are not issues
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## "inline" option gating
|
|
37
|
+
|
|
38
|
+
Only present the "inline" option when ALL pending findings simultaneously satisfy:
|
|
39
|
+
|
|
40
|
+
1. Diff is comment-only, annotation-only, banner-only, or single-value rename — no logic, no control flow
|
|
41
|
+
2. Each fix is under ~5 minutes of executor time
|
|
42
|
+
3. Verification is automatic — the existing test/lint/audit pipeline confirms the change
|
|
43
|
+
|
|
44
|
+
If any finding fails these gates, omit the "inline" option entirely (revert to the 3-option prompt). When inline is chosen, apply the edits via direct `Edit`, re-run the verification commands (hook syntax check + `testing-qa-agent` scoped to modified files) and proceed to `/cbp-round-update` without spawning a new round. Document the decision in `round.context.inline_fix_log = { findings: [ids], rationale: "trivial-resolution exception", applied_at: <ISO> }` (mirrors the `bypass_log` shape from `infra-issue-absorption.md` "Pipeline Bypass for Trivial-Resolution Rounds").
|
|
@@ -0,0 +1,35 @@
|
|
|
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.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
name: cbp-round-execute
|
|
4
|
+
description: Execute the approved plan from /cbp-round-start — runs per-wave executors, inline testing-qa per wave, and routes to /cbp-round-end
|
|
5
|
+
effort: xhigh
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Round Execute Command
|
|
9
|
+
|
|
10
|
+
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`.
|
|
11
|
+
|
|
12
|
+
## Pipeline
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
/cbp-round-start → /cbp-round-execute → /cbp-round-end (auto)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Identifier Notation
|
|
19
|
+
|
|
20
|
+
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 — 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
|
+
|
|
22
|
+
## Instructions
|
|
23
|
+
|
|
24
|
+
### Step 1: Get Current Task and Round
|
|
25
|
+
|
|
26
|
+
Use MCP `get_current_task` with repo_id (pass checkpoint_id if known) to find the active task.
|
|
27
|
+
Use MCP `get_rounds` for the task to find the in-progress round.
|
|
28
|
+
|
|
29
|
+
If no in-progress round: `No active round. Run /cbp-round-start first.`
|
|
30
|
+
|
|
31
|
+
### Step 2: Load Approved Plan
|
|
32
|
+
|
|
33
|
+
Read the plan from round context (`context.planner_output`). If no plan: `No approved plan in round context. Run /cbp-round-start first.`
|
|
34
|
+
|
|
35
|
+
Read effective testing profile: `round.context.testing_profile_override` if set (user override for this round only), else `task.context.testing_profile` (set by planner Phase 4.8), else default `'web'`. Pass the effective profile to all per-wave `cbp-testing-qa-agent` spawns.
|
|
36
|
+
|
|
37
|
+
### Step 3: Route Execution Path
|
|
38
|
+
|
|
39
|
+
Inspect `approved_plan.files_to_modify[]` and `approved_plan.round_type`. Four execution paths exist; pick the one that matches BEFORE Step 3a/3b.
|
|
40
|
+
|
|
41
|
+
| Condition | Path |
|
|
42
|
+
| -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `files_to_modify[]` empty AND `round_type === 'survey'` | **3-SURVEY** — orchestrator executes inline; constructs executor-equivalent output; NEVER spawn `cbp-round-executor` |
|
|
44
|
+
| Every entry under `.claude/**` | **3-INLINE** — orchestrator applies via build-cc skills or direct Edit; NEVER spawn `cbp-round-executor` |
|
|
45
|
+
| At least one entry outside `.claude/**` AND `approved_plan.waves[]` has ≥2 waves | **3-WAVE** — dispatch per-wave per schema in `approved_plan.waves[]` |
|
|
46
|
+
| At least one entry outside `.claude/**` (single wave or no waves field) | **3-AGENT** — spawn single `cbp-round-executor` |
|
|
47
|
+
|
|
48
|
+
#### Step 3-SURVEY: Empty-Files Survey Path
|
|
49
|
+
|
|
50
|
+
Execute the survey instructions inline using Read/Grep/Bash. Save to `round.context.survey_output`. Build executor-equivalent output object with `round_type: 'survey'`. Skip to Step 3c.
|
|
51
|
+
|
|
52
|
+
`round_type: 'survey'` MUST be set in `round.context` so Step 4 (dev-server probe) and downstream skills short-circuit correctly.
|
|
53
|
+
|
|
54
|
+
#### Step 3-INLINE: `.claude/`-Only Inline Path
|
|
55
|
+
|
|
56
|
+
For each entry, route per `rules/file-routing.md`:
|
|
57
|
+
|
|
58
|
+
- `.claude/skills/{name}/SKILL.md` → `cbp-build-cc-skill` via Skill tool
|
|
59
|
+
- `.claude/agents/{name}/AGENT.md` → `cbp-build-cc-agent` via Skill tool
|
|
60
|
+
- `.claude/rules/{name}.md` → `cbp-build-cc-rule` via Skill tool
|
|
61
|
+
- `.claude/CLAUDE.md` → `cbp-build-cc-claude-file` via Skill tool (or direct Edit)
|
|
62
|
+
- `.claude/settings*.json` → `cbp-build-cc-settings` via Skill tool
|
|
63
|
+
- `.claude/context/**`, `.claude/docs/**` → direct Edit
|
|
64
|
+
- `.claude/hooks/{name}.sh` → direct Write/Edit
|
|
65
|
+
|
|
66
|
+
Build executor-equivalent output object inline. Skip to Step 3c.
|
|
67
|
+
|
|
68
|
+
#### Step 3-WAVE: Multi-Wave Dispatch
|
|
69
|
+
|
|
70
|
+
When `approved_plan.waves[]` is present and has ≥2 entries:
|
|
71
|
+
|
|
72
|
+
1. Topological-sort waves by `depends_on[]` to determine dispatch order.
|
|
73
|
+
2. For each wave whose `depends_on[]` names are all complete, spawn the wave executor:
|
|
74
|
+
- `agent_type: 'cbp-round-executor'` → spawn `cbp-round-executor` with wave-scoped input (see `agents/cbp-round-executor.md` wave input contract)
|
|
75
|
+
- `agent_type: 'inline'` → execute inline as 3-INLINE path, scoped to `wave.files[]`
|
|
76
|
+
3. After each wave completes, spawn `cbp-testing-qa-agent` against `wave.files[]` with `testing_profile` from Step 2. Run this testing spawn in PARALLEL with the next wave's executor when dependency order allows.
|
|
77
|
+
4. After all waves complete, merge all `files_changed[]` into a single executor output.
|
|
78
|
+
|
|
79
|
+
#### Step 3-AGENT: Single `cbp-round-executor` Spawn
|
|
80
|
+
|
|
81
|
+
#### Mechanical-Edits Delegation Gate
|
|
82
|
+
|
|
83
|
+
Before spawning `cbp-round-executor`, inspect `task.context.work_mode` (set by cbp-task-planner Phase 4.1).
|
|
84
|
+
|
|
85
|
+
| Value | Action |
|
|
86
|
+
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
87
|
+
| `mechanical` | Spawn `cbp-mechanical-edits` instead of `cbp-round-executor`. Derive the spec (renames / substitutions / frontmatter_edits / index_regen) from `approved_plan.files_to_modify[]` + the task's deliverables; pass it via the prompt body per the agent's Input Contract. After the agent returns, verify `git status --porcelain` reflects only expected paths AND `validation.orphaned_refs` is empty. Skip the rest of Step 3-AGENT and proceed to Step 3b. |
|
|
88
|
+
| `mixed` | Read `task.context.mechanical_files[]` (populated by cbp-task-planner Phase 4.1 per its partition rule). Spawn `cbp-round-executor` for the AUTHORED portion FIRST — the executor's `files` input is `files_to_modify[]` MINUS `mechanical_files[]`. After it returns, spawn `cbp-mechanical-edits` against ONLY `mechanical_files[]` — derive the spec (renames / substitutions / frontmatter_edits / index_regen) from those entries' purpose strings. Merge both `files_changed[]` results into a single output for Step 5. If `mechanical_files[]` is absent or empty when `work_mode === 'mixed'`, halt with a planner-output error (Phase 4.1 contract violation). |
|
|
89
|
+
| `design` or absent | Proceed with the existing `cbp-round-executor` spawn below (no change in behaviour). |
|
|
90
|
+
|
|
91
|
+
**Universal postcondition for both `mechanical` and `mixed`:** if any spawned `cbp-mechanical-edits` reports `validation.orphaned_refs.length > 0`, treat as a hard-fail signal and route through Step 6 (regardless of whether the executor also ran in the `mixed` path).
|
|
92
|
+
|
|
93
|
+
This gate is distinct from Phase 2.95's `execution_mode` parallelism hint (consumed downstream by `cbp-round-executor` Step 3.5 for batch-create scenarios). Both gates can fire on the same task.
|
|
94
|
+
|
|
95
|
+
Spawn `cbp-round-executor` with the approved plan and full context:
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
input:
|
|
99
|
+
task_number: N
|
|
100
|
+
round_number: N
|
|
101
|
+
approved_plan: [from round context]
|
|
102
|
+
checkpoint: { id, title, goal, context }
|
|
103
|
+
task: { id, title, requirements, context }
|
|
104
|
+
resources: [merged from checkpoint.resources + task.resources]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Wait for executor output.
|
|
108
|
+
|
|
109
|
+
### Step 3b: Database Work (if plan includes DB changes)
|
|
110
|
+
|
|
111
|
+
If the approved plan includes database schema changes, RLS policies, or type generation:
|
|
112
|
+
|
|
113
|
+
1. Spawn `cbp-database-agent` with DB-related steps from the plan
|
|
114
|
+
2. Wait for completion
|
|
115
|
+
3. Merge `files_changed` into executor output
|
|
116
|
+
|
|
117
|
+
### Step 3c: Completion Check
|
|
118
|
+
|
|
119
|
+
- `status: 'completed'` and all deliverables done → proceed to Step 4
|
|
120
|
+
- `status: 'blocked'` → present blocker to user via AskUserQuestion, resolve, re-spawn executor with remaining work
|
|
121
|
+
- Deliverables incomplete → re-spawn executor with remaining deliverables (max 3 re-triggers). After 3 re-triggers, save partial output and proceed.
|
|
122
|
+
|
|
123
|
+
### Step 4: Dev-Server Probe (rounds 2+, web/desktop profile)
|
|
124
|
+
|
|
125
|
+
When `round_number >= 2` AND `testing_profile` is `'web'` or `'desktop'` AND `files_changed` contains any UI file, probe the dev server BEFORE cbp-testing-qa-agent spawns (saves a full agent spawn when the server is down).
|
|
126
|
+
|
|
127
|
+
Read `.codebyplan/server.json` `port_allocations[]`. For each configured port run:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
curl -sf --max-time 3 -o /dev/null -w "%{http_code}" http://localhost:{port}/
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Any non-2xx/3xx response → AskUserQuestion: start the dev server, skip UI checks, or abort.
|
|
134
|
+
|
|
135
|
+
Skip this probe for `testing_profile === 'claude_only'` or `'backend'`.
|
|
136
|
+
|
|
137
|
+
### Step 5: Per-Wave Testing (or global testing for single-wave)
|
|
138
|
+
|
|
139
|
+
Read `task.context.testing_profile` (already loaded in Step 2).
|
|
140
|
+
|
|
141
|
+
**claude_only profile**: run inline checks only (no `cbp-testing-qa-agent` spawn):
|
|
142
|
+
|
|
143
|
+
1. `bash -n <hook-file>` for each modified `.sh` in `files_changed`
|
|
144
|
+
2. Verify each modified/created SKILL.md ≤300 lines (warn threshold; hook blocks at 600); `scope:` marker present; no `/cbp-*` notation
|
|
145
|
+
|
|
146
|
+
On pass, synthesise `testing_qa_output` inline per the procedure in `reference/inline-fallback.md` "Validation fallback" section (output shape defined in `agents/cbp-testing-qa-agent.md` Output Contract) and persist to `round.context.testing_qa_output` at Step 7.
|
|
147
|
+
|
|
148
|
+
**All other profiles**: spawn `cbp-testing-qa-agent` AND `cbp-test-e2e-agent` in parallel (two Agent calls in the same message) per completed wave (or full executor output in single-wave mode). `cbp-test-e2e-agent` is gated on `has_ui_work === true` AND profile in {`web`, `desktop`, `full_matrix`, `cross_app`} — skipped for `claude_only` / `backend`-only.
|
|
149
|
+
|
|
150
|
+
Input contracts: `cbp-testing-qa-agent` receives `executor_output`, `testing_profile`, `has_ui_work` (see `agents/cbp-testing-qa-agent.md` Input Contract). `cbp-test-e2e-agent` receives `repo_id`, `round_number`, `files_changed`, `prior_round_files_changed` (full task aggregate when round_number ≥ 2), `whole_checkpoint_mode: false`, `test_strategy`, `pages_affected`, `has_auth`, `dev_server_port` (see `agents/cbp-test-e2e-agent.md` Input Contract for the full shape).
|
|
151
|
+
|
|
152
|
+
**Independence**: neither agent reads the other's output. Cross-source user_qa items (cbp-frontend-ui + agent data) are constructed downstream at `/cbp-round-end` Step 3b. Per-wave spawns MAY run in parallel with the next wave's executor when dependency order allows.
|
|
153
|
+
|
|
154
|
+
### Step 5b: Post-E2E Screenshot Review (cbp-frontend-ui Phase 6.5)
|
|
155
|
+
|
|
156
|
+
When `round.context.e2e_output.screenshots[]` is non-empty, invoke the `cbp-frontend-ui` skill with `phase: 'screenshot_review'` (input: `files_changed`, `e2e_screenshots: round.context.e2e_output.screenshots`, `context: { checkpoint_goal, round_requirements }`). Under this phase the skill runs only Phase 6.5 (Rendered-Output Visual Review) + 7 + 8 — Phases 1-6 (style) already ran inline at executor Step 3.8 with `phase: 'style_only'`.
|
|
157
|
+
|
|
158
|
+
Persist findings to `round.context.frontend_ui_review` (merge with Step 3.8's style-only output if present). `/cbp-round-end` Step 3b emits user_qa items for any `category: 'baseline_regression'` (any severity) and any `category: 'rendered_visual' + severity: 'critical'` — neither auto-fails the round. cbp-testing-qa-agent does NOT read these findings (full independence per Step 5).
|
|
159
|
+
|
|
160
|
+
**Skip** when `round.context.e2e_output` is absent, `screenshots` is empty, or `testing_profile === 'claude_only'`.
|
|
161
|
+
|
|
162
|
+
### Step 6: Hard-Fail Routing
|
|
163
|
+
|
|
164
|
+
Per-wave hard-fail signal: `testing_qa_output.totals.hard_fail || e2e_output.status === 'failed' || e2e_output.test_results?.failed > 0`.
|
|
165
|
+
|
|
166
|
+
**All waves hard_fail: false** → proceed to Step 7. **Any wave hard_fail: true**:
|
|
167
|
+
|
|
168
|
+
- **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 test-e2e for that wave.
|
|
169
|
+
- **Structural OR already re-triggered once OR e2e preflight aborts** → save failure context via MCP `update_round`; auto-trigger `/cbp-round-input`. STOP.
|
|
170
|
+
|
|
171
|
+
## Inline execution fallback
|
|
172
|
+
|
|
173
|
+
When `cbp-round-executor` spawn fails (per `agent-spawn-failure-fallback.md` triggers), fall through to the 3-INLINE branch in Step 3 above for `.claude/`-only edits. For non-`.claude/` edits, walk `agents/cbp-round-executor.md` Phase 1–4 inline using Read / Edit / Write / Bash. Full procedure: `reference/inline-fallback.md` "Execution fallback" section.
|
|
174
|
+
|
|
175
|
+
## Inline validation fallback
|
|
176
|
+
|
|
177
|
+
When `cbp-testing-qa-agent` spawn fails OR the resolved `testing_profile` is `claude_only` (in which case the agent isn't spawned by design), run validation inline. Apply the profile gate matrix in `agents/cbp-testing-qa-agent.md` Phase 3 to determine in-scope checks. Full procedure + per-profile shape: `reference/inline-fallback.md` "Validation fallback" section.
|
|
178
|
+
|
|
179
|
+
### Step 7: Save Executor Output
|
|
180
|
+
|
|
181
|
+
Update round context via MCP `update_round`:
|
|
182
|
+
|
|
183
|
+
- `context`: { ...existing, executor_output, testing_qa_output, e2e_output, frontend_ui_review }
|
|
184
|
+
|
|
185
|
+
`e2e_output` and `frontend_ui_review` are present only when the gates above admitted them (e2e ran AND Step 5b ran).
|
|
186
|
+
|
|
187
|
+
### Step 8: Auto-trigger Round End
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
Execution and validation complete. Starting round wrap-up...
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Trigger `/cbp-round-end`.
|
|
194
|
+
|
|
195
|
+
## Key Rules
|
|
196
|
+
|
|
197
|
+
- **Code + test writing + inline validation** — planning lives in `round-start`, summary in `round-end`
|
|
198
|
+
- Per-wave `cbp-testing-qa-agent` AND `cbp-test-e2e-agent` run in parallel (both against the same wave's `files[]`); they may also run in parallel with the NEXT wave's executor when dependency order allows
|
|
199
|
+
- `testing_profile` from `task.context` governs which checks run — read it once in Step 2; pass to every testing-qa + test-e2e spawn
|
|
200
|
+
- `claude_only` profile skips all agent spawns (testing-qa AND test-e2e); runs hook syntax and skill structure checks inline
|
|
201
|
+
- Step 5b (cbp-frontend-ui Phase 6.5) runs only when e2e produced screenshots — gated on `e2e_output.screenshots[]` non-empty
|
|
202
|
+
- Claude NEVER git adds files in round commands
|
|
203
|
+
|
|
204
|
+
## Integration
|
|
205
|
+
|
|
206
|
+
- **Reads**: MCP `get_current_task`, `get_rounds`
|
|
207
|
+
- **Writes**: MCP `update_round` (context with executor_output + testing_qa_output + e2e_output + frontend_ui_review)
|
|
208
|
+
- **Spawns**: `cbp-round-executor` (per wave or single), `cbp-testing-qa-agent` (per wave, parallel sibling of cbp-test-e2e-agent), `cbp-test-e2e-agent` (per wave when has_ui_work + non-claude_only profile), `cbp-database-agent` (if DB work), `cbp-security-agent` (if security review needed)
|
|
209
|
+
- **Skill invocations**: `cbp-frontend-ui` at Step 5b with `phase: 'screenshot_review'` (post-e2e)
|
|
210
|
+
- **Triggers**: `/cbp-round-end` (auto)
|
|
211
|
+
- **Triggered by**: `/cbp-round-start` (auto, after plan approval)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Inline-fallback procedures
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
The two fallback modes are documented separately so the SKILL.md stubs can link the right section.
|
|
10
|
+
|
|
11
|
+
## Execution fallback (round-executor spawn failed)
|
|
12
|
+
|
|
13
|
+
Triggered when the executor agent spawn returns one of the failure classes documented in `agent-spawn-failure-fallback.md`. Procedure:
|
|
14
|
+
|
|
15
|
+
1. Detect failure class from error string. Record:
|
|
16
|
+
```yaml
|
|
17
|
+
round.context.executor_findings.spawn_failure:
|
|
18
|
+
class: "monthly_agent_usage_limit" | "provider_5xx" | "rate_limit_429" | "context_overflow_at_spawn" | "billing_limit"
|
|
19
|
+
error_message: "<verbatim>"
|
|
20
|
+
decided_at: "<ISO>"
|
|
21
|
+
```
|
|
22
|
+
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).
|
|
23
|
+
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.
|
|
24
|
+
4. Populate the executor's output contract with `mode: 'inline_fallback'` so analytics distinguishes.
|
|
25
|
+
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.
|
|
26
|
+
|
|
27
|
+
## Validation fallback (testing-qa-agent spawn failed OR claude_only profile)
|
|
28
|
+
|
|
29
|
+
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:
|
|
30
|
+
|
|
31
|
+
1. Detect failure class. Record:
|
|
32
|
+
```yaml
|
|
33
|
+
round.context.testing_qa_findings.spawn_failure:
|
|
34
|
+
class: "<failure_class>"
|
|
35
|
+
error_message: "<verbatim>"
|
|
36
|
+
decided_at: "<ISO>"
|
|
37
|
+
```
|
|
38
|
+
2. Apply the profile gate matrix from `agents/testing-qa-agent.md` Phase 3 to determine which checks are in-scope:
|
|
39
|
+
- `claude_only`: only hook bash syntax (`bash -n <hook>`) + skill structure validation (line counts, scope marker, /cbp-* legacy notation absent)
|
|
40
|
+
- `web`: skip desktop + backend
|
|
41
|
+
- `backend`: skip web + desktop
|
|
42
|
+
- `desktop`: skip web + backend
|
|
43
|
+
- `full_matrix`: all
|
|
44
|
+
- `cross_app`: union of touched apps
|
|
45
|
+
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.
|
|
46
|
+
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).
|
|
47
|
+
5. Pre-emptive skip on repeat: if `prior_round.context.testing_qa_findings.spawn_failure.class === current_class`, skip the spawn attempt entirely.
|
|
48
|
+
|
|
49
|
+
## Pre-emptive skip rule
|
|
50
|
+
|
|
51
|
+
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.
|
|
52
|
+
|
|
53
|
+
## Pairs With
|
|
54
|
+
|
|
55
|
+
- `../SKILL.md` — points at this reference for procedural detail
|
|
56
|
+
- `agents/round-executor.md` — execution-fallback target agent
|
|
57
|
+
- `agents/testing-qa-agent.md` — validation-fallback target agent + Phase 3 profile gate matrix
|
|
58
|
+
- `rules/agent-spawn-failure-fallback.md` — required-coverage table; canonical failure classes
|
|
59
|
+
- `rules/testing-profile.md` — claude_only profile detail; cross-app union semantics
|