codebyplan 1.11.1 → 1.12.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.
Files changed (56) hide show
  1. package/dist/cli.js +602 -345
  2. package/package.json +1 -1
  3. package/templates/README.md +1 -1
  4. package/templates/agents/cbp-cc-executor.md +1 -1
  5. package/templates/agents/cbp-e2e-maestro.md +202 -0
  6. package/templates/agents/cbp-e2e-playwright.md +229 -0
  7. package/templates/agents/cbp-e2e-tauri.md +184 -0
  8. package/templates/agents/cbp-e2e-vscode.md +203 -0
  9. package/templates/agents/cbp-e2e-xcuitest.md +224 -0
  10. package/templates/agents/cbp-improve-claude.md +1 -1
  11. package/templates/agents/cbp-round-executor.md +11 -11
  12. package/templates/agents/cbp-task-check.md +1 -1
  13. package/templates/agents/cbp-task-planner.md +2 -0
  14. package/templates/agents/cbp-testing-qa-agent.md +9 -9
  15. package/templates/context/testing/e2e.md +303 -0
  16. package/templates/hooks/cbp-statusline.mjs +44 -0
  17. package/templates/hooks/cbp-statusline.py +24 -2
  18. package/templates/hooks/cbp-statusline.sh +22 -2
  19. package/templates/hooks/validate-structure-lengths.sh +2 -0
  20. package/templates/hooks/validate-structure-smoke.sh +2 -1
  21. package/templates/hooks/validate-structure-templates.sh +1 -0
  22. package/templates/rules/README.md +8 -1
  23. package/templates/rules/context-file-loading.md +4 -1
  24. package/templates/rules/e2e-mandatory.md +70 -0
  25. package/templates/rules/supabase-branch-lifecycle.md +99 -0
  26. package/templates/settings.project.base.json +1 -2
  27. package/templates/skills/cbp-build-cc-agent/SKILL.md +16 -14
  28. package/templates/skills/cbp-build-cc-agent/reference/cbp-quality.md +4 -4
  29. package/templates/skills/cbp-build-cc-agent/scripts/validate-agent.sh +8 -6
  30. package/templates/skills/cbp-build-cc-mode/SKILL.md +4 -4
  31. package/templates/skills/cbp-build-cc-settings/reference/cbp-conventions.md +1 -2
  32. package/templates/skills/cbp-checkpoint-check/SKILL.md +12 -8
  33. package/templates/skills/cbp-checkpoint-create/SKILL.md +2 -0
  34. package/templates/skills/cbp-checkpoint-end/SKILL.md +27 -5
  35. package/templates/skills/cbp-checkpoint-plan/SKILL.md +2 -2
  36. package/templates/skills/cbp-checkpoint-plan/reference/e2e-discovery-probe.md +5 -5
  37. package/templates/skills/cbp-e2e-setup/SKILL.md +254 -0
  38. package/templates/skills/cbp-e2e-setup/reference/maestro.md +200 -0
  39. package/templates/skills/cbp-e2e-setup/reference/playwright.md +212 -0
  40. package/templates/skills/cbp-e2e-setup/reference/tauri.md +147 -0
  41. package/templates/skills/cbp-e2e-setup/reference/vscode.md +154 -0
  42. package/templates/skills/cbp-e2e-setup/reference/xcuitest.md +185 -0
  43. package/templates/skills/cbp-frontend-ui/SKILL.md +6 -6
  44. package/templates/skills/cbp-frontend-ux/SKILL.md +1 -1
  45. package/templates/skills/cbp-git-worktree-remove/SKILL.md +17 -1
  46. package/templates/skills/cbp-round-execute/SKILL.md +30 -17
  47. package/templates/skills/cbp-session-start/SKILL.md +27 -2
  48. package/templates/skills/cbp-ship-main/SKILL.md +13 -0
  49. package/templates/skills/cbp-supabase-branch-check/SKILL.md +12 -5
  50. package/templates/skills/cbp-supabase-migrate/SKILL.md +139 -9
  51. package/templates/skills/cbp-supabase-migrate/reference/preflight-dry-run.md +1 -1
  52. package/templates/skills/cbp-supabase-setup/SKILL.md +13 -7
  53. package/templates/skills/cbp-supabase-setup/reference/branching-setup.md +2 -2
  54. package/templates/skills/cbp-task-check/SKILL.md +2 -2
  55. package/templates/skills/cbp-task-start/SKILL.md +2 -0
  56. package/templates/agents/cbp-test-e2e-agent.md +0 -363
@@ -0,0 +1,99 @@
1
+ ---
2
+ scope: org-shared
3
+ description: Supabase preview-branch lifecycle mirrors the git feat-branch lifecycle
4
+ paths:
5
+ - "supabase/migrations/**"
6
+ - ".codebyplan/shipment.json"
7
+ - ".codebyplan/git.json"
8
+ - ".claude/skills/cbp-supabase-migrate/**"
9
+ - ".claude/skills/cbp-supabase-branch-check/**"
10
+ - ".claude/skills/cbp-checkpoint-end/**"
11
+ - ".claude/skills/cbp-git-worktree-remove/**"
12
+ - ".claude/skills/cbp-ship-main/**"
13
+ ---
14
+
15
+ # Supabase Branch Lifecycle
16
+
17
+ When a checkpoint or standalone task does DB work on its own feat branch, that branch gets
18
+ a Supabase preview branch whose lifecycle mirrors the git branch — created on first DB
19
+ change, deleted when the git branch is removed.
20
+
21
+ ## Contract
22
+
23
+ Each feat branch that touches the database owns exactly one Supabase preview branch, named
24
+ identically to the git branch. The git branch is the source of truth; the Supabase branch
25
+ follows it.
26
+
27
+ ## Create (lazy)
28
+
29
+ The Supabase branch is created by `cbp-supabase-migrate` (Step 2.3) on the **first DB
30
+ change** for the branch — never eagerly at git-branch creation time. Creation is guarded
31
+ by the skill's db_paths detection so the step fires only when the invocation actually
32
+ touches the database.
33
+
34
+ The branch is named **verbatim** after the git branch, slashes included (e.g.
35
+ `feat/CHK-144-supabase-branch-lifecycle`). This identical naming is the linchpin: the
36
+ GitHub branching integration reconciles to the same branch on PR open rather than creating
37
+ a duplicate.
38
+
39
+ After creation, the branch name and resulting `project_ref` are recorded on the parent
40
+ checkpoint or standalone task context (via `mcp__codebyplan__update_checkpoint` /
41
+ `mcp__codebyplan__update_task`) and may also be noted in `.codebyplan/shipment.json` so
42
+ cleanup skills can discover and remove it without querying the API.
43
+
44
+ ## Delete
45
+
46
+ The Supabase branch is removed wherever the git branch is deleted:
47
+
48
+ | Skill | Trigger |
49
+ |---|---|
50
+ | `cbp-checkpoint-end` | stale-branch cleanup + current feat-branch delete on ship |
51
+ | `cbp-git-worktree-remove` | worktree teardown removes the coupled Supabase branch |
52
+ | `cbp-ship-main` | `branch_deleted` event after PR merge |
53
+
54
+ Deletion is **existence-checked and idempotent** — a not-found response is treated as
55
+ success. This tolerates the GitHub integration auto-deleting the preview branch on PR
56
+ close before the skill runs.
57
+
58
+ These skills use `delete_branch` (MCP tool), never `merge_branch`. Production migrations
59
+ reach main via the existing merge path (GitHub rebuild / `last_shipped_migration_version`);
60
+ there is no separate Supabase branch merge step.
61
+
62
+ ## Exclusions
63
+
64
+ This lifecycle applies **only to feat branches**. It MUST NOT fire for:
65
+
66
+ - The main/production branch (`branch_config.production`, default `"main"`)
67
+ - Any branch listed in `branch_config.protected[]`
68
+ - A standalone task running directly on the production branch
69
+ - The integration branch (`branch_config.integration`) when non-null — it gets a persistent branch via `cbp-supabase-setup`, not a lazy ephemeral one.
70
+
71
+ `cbp-supabase-migrate` Step 2.3 Guard 1 enforces this by reading `.codebyplan/git.json`
72
+ and skipping provisioning when the current branch matches `$PRODUCTION`, `$PROTECTED`, or
73
+ a non-null `$INTEGRATION`.
74
+
75
+ ## Guards
76
+
77
+ Skills that delete Supabase branches MUST:
78
+
79
+ 1. Verify the branch name matches the feat branch being removed (never delete by
80
+ `project_ref` alone).
81
+ 2. Never delete the parent/production project (`rrvtrumtkhrsbhcyrwvf`) itself.
82
+ 3. Never delete a persistent/long-lived branch that does not correspond to the git branch
83
+ being torn down.
84
+
85
+ ## PR Gate (retained)
86
+
87
+ `cbp-supabase-branch-check` runs as a required PR gate, independent of the create/delete
88
+ coupling. By-name resolution works whether the branch was created by `cbp-supabase-migrate`
89
+ or auto-created by the GitHub integration — both paths use the same branch name.
90
+
91
+ ## Skill Map
92
+
93
+ | Role | Skill |
94
+ |---|---|
95
+ | Create (lazy) | `cbp-supabase-migrate` (Step 2.3) |
96
+ | Delete | `cbp-checkpoint-end`, `cbp-git-worktree-remove`, `cbp-ship-main` |
97
+ | PR gate | `cbp-supabase-branch-check` |
98
+
99
+ Each skill in the Skill Map above carries an inline back-reference to this rule at its create or teardown step.
@@ -39,8 +39,7 @@
39
39
  "Bash(git push --force:*)",
40
40
  "Bash(git push -f:*)",
41
41
  "Bash(git checkout -- :*)",
42
- "Bash(git add .:*)",
43
- "Bash(git add -A:*)",
42
+ "Bash(git add:*)",
44
43
  "Bash(rm -rf:*)",
45
44
  "Bash(pnpm add:*)",
46
45
  "Bash(pnpm install:*)",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  scope: org-shared
3
3
  name: cbp-build-cc-agent
4
- description: Build a Claude Code subagent at .claude/agents/{name}/AGENT.md (CBP folder form) following the official sub-agents spec (frontmatter, tools, model, memory, hooks, skills preload, permission modes, isolation).
4
+ description: Build a Claude Code subagent at .claude/agents/{name}.md (flat form, per the official sub-agents spec) following the official sub-agents spec (frontmatter, tools, model, memory, hooks, skills preload, permission modes, isolation).
5
5
  argument-hint: "[agent-name] [--scope=project|user] [--memory=project|user|local] [--isolation=worktree]"
6
6
  allowed-tools: Read, Write, Edit, Glob, Grep, Bash(mkdir *), Bash(chmod *)
7
7
  effort: xhigh
@@ -32,18 +32,18 @@ Do **not** create a subagent for one-off work — spawn `general-purpose` inline
32
32
 
33
33
  - Name must be lowercase kebab-case (a–z, 0–9, hyphens only)
34
34
  - Reject collisions with built-in agents: `Explore`, `Plan`, `general-purpose`, `statusline-setup`, `Claude Code Guide`
35
- - Reject if `.claude/agents/{name}/AGENT.md` already exists unless the user asked to update
35
+ - Reject if `.claude/agents/{name}.md` already exists unless the user asked to update
36
36
 
37
37
  ### Step 2 — Pick scope
38
38
 
39
- CBP uses the **folder form** so an agent can bundle supporting docs/scripts next to `AGENT.md`.
39
+ The default layout is **flat form** a single `.claude/agents/{name}.md` file, matching the official Claude Code sub-agents spec and all 12 existing CBP agents. Use folder form `{name}/AGENT.md` only when the agent bundles supporting files (context, examples, scripts) next to it.
40
40
 
41
- | Scope | Path | Use when |
42
- | ------- | ---------------------------------- | --------------------------------------- |
43
- | project | `.claude/agents/{name}/AGENT.md` | Repo-specific, shared with team via git |
44
- | user | `~/.claude/agents/{name}/AGENT.md` | Personal, reused across all projects |
41
+ | Scope | Path | Use when |
42
+ | ------- | ------------------------------- | --------------------------------------- |
43
+ | project | `.claude/agents/{name}.md` | Repo-specific, shared with team via git |
44
+ | user | `~/.claude/agents/{name}.md` | Personal, reused across all projects |
45
45
 
46
- Default: `project`. Pass `--scope=user` to override. Flat form (`.claude/agents/{name}.md`) is the Claude Code native layout but CBP's structure hook expects the folder form — always use that in this repo.
46
+ Default: `project`. Pass `--scope=user` to override. Use folder form `{scope-path}/{name}/AGENT.md` only when bundling supporting files alongside the agent definition.
47
47
 
48
48
  ### Step 3 — Read the template and CBP context
49
49
 
@@ -89,8 +89,8 @@ Cross-references for complex cases:
89
89
 
90
90
  ### Step 6 — Write the agent file
91
91
 
92
- 1. Create directory: `mkdir -p {scope-path}/{name}`
93
- 2. Write `{scope-path}/{name}/AGENT.md`
92
+ 1. Write `{scope-path}/{name}.md` (flat form — default for all new agents)
93
+ 2. If the agent bundles supporting files (context, examples, scripts), create a folder instead: `mkdir -p {scope-path}/{name}` and write `{scope-path}/{name}/AGENT.md`
94
94
  3. Copy the template, fill frontmatter, then write the system prompt as the markdown body. The body becomes the agent's entire system prompt — no CLAUDE.md prefix, no Claude Code defaults.
95
95
 
96
96
  System prompt guidance:
@@ -100,16 +100,18 @@ System prompt guidance:
100
100
  - Output format it must return
101
101
  - Failure modes (when to return `blocked`, `failed`, `no_findings`)
102
102
 
103
- Supporting files (optional) live next to `AGENT.md` in the same folder: `{name}/context.md`, `{name}/examples/`, etc.
103
+ Supporting files (optional) live next to the agent in a same-name folder: `{name}/context.md`, `{name}/examples/`, etc. Only create the folder when you are actually writing supporting files.
104
104
 
105
105
  ### Step 7 — Validate
106
106
 
107
107
  Run the validator:
108
108
 
109
109
  ```bash
110
- bash "${CLAUDE_SKILL_DIR}/scripts/validate-agent.sh" "{scope-path}/{name}/AGENT.md"
110
+ bash "${CLAUDE_SKILL_DIR}/scripts/validate-agent.sh" "{scope-path}/{name}.md"
111
111
  ```
112
112
 
113
+ (Pass `{scope-path}/{name}/AGENT.md` instead if folder form was chosen.)
114
+
113
115
  It checks: name format, frontmatter parses, required fields present (`name`, `description`, `scope`), tool names are valid, model alias is recognised.
114
116
 
115
117
  ### Step 8 — Surface to the user
@@ -126,7 +128,7 @@ Report:
126
128
 
127
129
  - **Triggered by**: user invocation
128
130
  - **Reads**: `${CLAUDE_SKILL_DIR}/templates/agent.md`, `${CLAUDE_SKILL_DIR}/reference/*.md` (including `cbp-quality.md`)
129
- - **Writes**: `.claude/agents/{name}/AGENT.md` or `~/.claude/agents/{name}/AGENT.md`
131
+ - **Writes**: `.claude/agents/{name}.md` (flat default) or `.claude/agents/{name}/AGENT.md` (folder form, when bundling supporting files); same under `~/.claude/` for user scope
130
132
  - **Related skills**: `/cbp-build-cc-skill` (skill-level workflows), `/cbp-build-cc-settings` (session-level `SubagentStart`/`SubagentStop` hooks), `/cbp-build-cc-mode` (canonical model/effort matrix — audit or apply)
131
133
 
132
134
  ## Key Rules
@@ -136,4 +138,4 @@ Report:
136
138
  - `bypassPermissions` and `acceptEdits` inherited from the parent cannot be weakened by the child
137
139
  - Preloaded skills inject _full content_ at startup — don't preload `disable-model-invocation: true` skills
138
140
  - Restart the session or use `/agents` to load a newly written agent file
139
- - CBP folder form is required the structure hook blocks flat agent files in this repo
141
+ - Flat form `.claude/agents/{name}.md` is the default and matches all 12 existing CBP agents; folder form `{name}/AGENT.md` is optional and only for agents that bundle supporting files alongside them
@@ -4,11 +4,11 @@ scope: org-shared
4
4
 
5
5
  # Agent Authoring Quality
6
6
 
7
- Quality expectations and structure for `/.claude/agents/{name}/AGENT.md` files. This file adds CBP-specific constraints on top of the official Claude Code sub-agents spec.
7
+ Quality expectations and structure for `/.claude/agents/{name}.md` files. This file adds CBP-specific constraints on top of the official Claude Code sub-agents spec.
8
8
 
9
- ## CBP Folder Form
9
+ ## Agent Layout
10
10
 
11
- CBP uses the folder form `.claude/agents/{name}/AGENT.md`, not Claude Code's native flat `.claude/agents/{name}.md`. The structure hook enforces this. Folder form lets an agent bundle supporting files (context, examples, scripts) next to `AGENT.md`.
11
+ CBP uses the flat form `.claude/agents/{name}.md` the default per the official Claude Code sub-agents spec. All 12 existing CBP agents use this layout. Folder form `.claude/agents/{name}/AGENT.md` is optional and only appropriate when the agent bundles supporting files (context, examples, scripts) next to the definition.
12
12
 
13
13
  ## Required CBP Frontmatter
14
14
 
@@ -125,7 +125,7 @@ Agents that modify `.claude/` files MUST:
125
125
 
126
126
  | Situation | Action |
127
127
  | ---------------------------------------- | ----------------------------------------------- |
128
- | Existing agent covers the domain | Update its AGENT.md |
128
+ | Existing agent covers the domain | Update its agent definition file |
129
129
  | New domain, no existing agent covers it | Create new agent |
130
130
  | Existing agent is too large (>400 lines) | Split into orchestrator + specialist |
131
131
  | One-off task, not recurring | Don't create an agent — use inline instructions |
@@ -1,11 +1,12 @@
1
1
  #!/bin/bash
2
- # Validate a Claude Code subagent file (CBP folder form).
3
- # Usage: validate-agent.sh <path-to-AGENT.md>
2
+ # Validate a Claude Code subagent file (flat form or CBP folder form).
3
+ # Usage: validate-agent.sh <path-to-agent-file>
4
+ # Accepts: flat agents/{name}.md (spec default) or folder agents/{name}/AGENT.md (for bundling).
4
5
  # Exit 0 = valid, exit 1 = invalid (errors printed to stderr).
5
6
 
6
7
  set -uo pipefail
7
8
 
8
- FILE="${1:?Usage: validate-agent.sh <path-to-AGENT.md>}"
9
+ FILE="${1:?Usage: validate-agent.sh <path-to-agent-file>}"
9
10
 
10
11
  if [ ! -f "$FILE" ]; then
11
12
  echo "ERROR: file not found: $FILE" >&2
@@ -15,10 +16,11 @@ fi
15
16
  errors=0
16
17
  err() { echo " - $1" >&2; errors=$((errors + 1)); }
17
18
 
18
- # CBP folder form: .claude/agents/{name}/AGENT.md
19
+ # Accept flat agents/{name}.md (spec default) or folder agents/{name}/AGENT.md (when bundling)
19
20
  case "$FILE" in
20
- */AGENT.md) ;;
21
- *) err "CBP expects folder form: .claude/agents/{name}/AGENT.md (got: $FILE)";;
21
+ */AGENT.md) ;; # folder form (agent bundles supporting files)
22
+ */agents/*.md) ;; # flat form Claude Code spec default
23
+ *) err "expected a subagent markdown file under agents/ — flat agents/{name}.md or folder agents/{name}/AGENT.md (got: $FILE)";;
22
24
  esac
23
25
 
24
26
  # Frontmatter must be present
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  scope: org-shared
3
3
  name: cbp-build-cc-mode
4
- description: Audit + apply the CHK-109 model/effort matrix across every authoring skill and agent under `packages/codebyplan-package/templates/`. Bare invocation walks all SKILL.md and AGENT.md files and reports frontmatter gaps; with a path argument, edits the target file's frontmatter to the matrix-decided values.
4
+ description: Audit + apply the CHK-109 model/effort matrix across every authoring skill and agent under `packages/codebyplan-package/templates/`. Bare invocation walks all SKILL.md and agent .md files and reports frontmatter gaps; with a path argument, edits the target file's frontmatter to the matrix-decided values.
5
5
  argument-hint: "[path-to-agent-or-skill]"
6
6
  allowed-tools: Read, Write, Edit, Glob, Grep
7
7
  effort: xhigh
@@ -23,7 +23,7 @@ Audit or apply the canonical `model:` + `effort:` frontmatter convention across
23
23
 
24
24
  `model: sonnet` + `effort: xhigh`
25
25
 
26
- Eleven of the 12 authoring agents take the default (`cbp-cc-executor`, `cbp-database-agent`, `cbp-improve-claude`, `cbp-improve-round`, `cbp-research`, `cbp-round-executor`, `cbp-security-agent`, `cbp-task-check`, `cbp-task-planner`, `cbp-test-e2e-agent`, `cbp-testing-qa-agent`). The 12th — `cbp-mechanical-edits` — is an explicit haiku-low exception (see below). 27 skills take the default: cbp-round-start, cbp-round-input, cbp-round-execute, cbp-task-create, cbp-task-start, cbp-task-complete, cbp-task-testing, cbp-checkpoint-create, cbp-checkpoint-check, cbp-checkpoint-end, cbp-build-cc-mode, cbp-build-cc-agent, cbp-build-cc-skill, cbp-build-cc-rule, cbp-build-cc-claude-file, cbp-build-cc-memory, cbp-build-cc-settings, cbp-frontend-a11y, cbp-frontend-design, cbp-frontend-ui, cbp-frontend-ux, cbp-session-end, cbp-ship, cbp-ship-configure, cbp-supabase-setup, cbp-supabase-migrate, cbp-supabase-branch-check.
26
+ Fifteen of the 16 authoring agents take the default (`cbp-cc-executor`, `cbp-database-agent`, `cbp-improve-claude`, `cbp-improve-round`, `cbp-research`, `cbp-round-executor`, `cbp-security-agent`, `cbp-task-check`, `cbp-task-planner`, `cbp-testing-qa-agent`, `cbp-e2e-playwright`, `cbp-e2e-maestro`, `cbp-e2e-tauri`, `cbp-e2e-vscode`, `cbp-e2e-xcuitest`). The 16th — `cbp-mechanical-edits` — is an explicit haiku-low exception (see below). 27 skills take the default: cbp-round-start, cbp-round-input, cbp-round-execute, cbp-task-create, cbp-task-start, cbp-task-complete, cbp-task-testing, cbp-checkpoint-create, cbp-checkpoint-check, cbp-checkpoint-end, cbp-build-cc-mode, cbp-build-cc-agent, cbp-build-cc-skill, cbp-build-cc-rule, cbp-build-cc-claude-file, cbp-build-cc-memory, cbp-build-cc-settings, cbp-frontend-a11y, cbp-frontend-design, cbp-frontend-ui, cbp-frontend-ux, cbp-session-end, cbp-ship, cbp-ship-configure, cbp-supabase-setup, cbp-supabase-migrate, cbp-supabase-branch-check.
27
27
 
28
28
  ### Effort-lowered skills (5)
29
29
 
@@ -55,7 +55,7 @@ Eleven of the 12 authoring agents take the default (`cbp-cc-executor`, `cbp-data
55
55
 
56
56
  ### Haiku-low agents (1)
57
57
 
58
- `model: haiku` + `effort: low`. The 12th authoring agent — pure I/O mechanical work, never authors logic.
58
+ `model: haiku` + `effort: low`. The 16th authoring agent — pure I/O mechanical work, never authors logic.
59
59
 
60
60
  | agent | model | effort | reason |
61
61
  | -------------------- | ----- | ------ | ----------------------------------------------------------------------------------- |
@@ -87,7 +87,7 @@ The audit is read-only — no edits performed.
87
87
 
88
88
  ## Apply Mode
89
89
 
90
- Invoked with a path argument (the target `SKILL.md` or `AGENT.md`). Procedure:
90
+ Invoked with a path argument (the target `SKILL.md` or agent `.md`). Procedure:
91
91
 
92
92
  1. Read the file. Identify the skill or agent name from the `name:` frontmatter field (or from the path basename if `name:` is absent).
93
93
  2. Look up target `model` + `effort` from the matrix above.
@@ -47,8 +47,7 @@ These values are part of the CBP baseline and should not be weakened:
47
47
  "Bash(git push --force:*)",
48
48
  "Bash(git push -f:*)",
49
49
  "Bash(git checkout -- :*)",
50
- "Bash(git add .:*)",
51
- "Bash(git add -A:*)",
50
+ "Bash(git add:*)",
52
51
  "Bash(rm -rf:*)",
53
52
  "Bash(pnpm add:*)",
54
53
  "Bash(pnpm install:*)",
@@ -90,11 +90,9 @@ Re-run build/lint/types on current codebase to verify nothing regressed across t
90
90
 
91
91
  Aggregate the files touched across all tasks (reusing Step 4's deduplicated table) and run e2e once against the union of pages they affect.
92
92
 
93
- 1. **Build `pages_affected`** — derive from Step 4's `files_changed` union using the same heuristic as `cbp-test-e2e-agent` Step 5.1 (Next.js: `app/<route>/page.tsx` chains; Expo: screen files; Tauri: route components; fallback: directory-based grouping). Deduplicate by route / screen.
93
+ 1. **Build `pages_affected`** — derive from Step 4's `files_changed` union using the same heuristic as `context/testing/e2e.md` Step 5.1 (Next.js: `app/<route>/page.tsx` chains; Expo: screen files; Tauri: route components; fallback: directory-based grouping). Deduplicate by route / screen.
94
94
 
95
- 2. **Spawn `cbp-test-e2e-agent`** via the Agent tool with:
96
-
97
- `test_strategy` is intentionally omitted — the agent auto-detects per-app via its Step 1.5 DB tech-stack lookup (`get_repos`) and Step 2 filesystem reconciliation. Mixed-framework monorepos disambiguate via `tech_stack.apps[]`; pre-pass `test_strategy` only when DB tech_stack is empty AND filesystem probe is ambiguous.
95
+ 2. **Config-driven dispatch** (per `context/testing/e2e.md` dispatch contract): read `.codebyplan/e2e.json`. If the file is absent or `frameworks` is empty, append `| Checkpoint E2E | n/a | no framework configured |` to the Step 5 QA Summary and continue to Step 6. Otherwise, for each entry where `enabled === true` AND `auto_run === true` whose `app` path intersects the aggregated `files_changed` union, spawn the matching `cbp-e2e-*` specialist via the Agent tool — one per eligible framework, in parallel. Inject `framework`, `app`, `platforms`, and `credential_vars` from `e2e.json` (authoritative; the agent does not auto-detect):
98
96
 
99
97
  ```yaml
100
98
  input:
@@ -105,18 +103,24 @@ Aggregate the files touched across all tasks (reusing Step 4's deduplicated tabl
105
103
  pages_affected: [aggregated]
106
104
  has_auth: [boolean, from .codebyplan/server.json + repo]
107
105
  dev_server_port: [from .codebyplan/server.json]
106
+ framework: [from e2e.json — authoritative]
107
+ app: [from e2e.json — e.g. apps/web]
108
+ platforms: [from e2e.json — e.g. ["web"]]
109
+ credential_vars: [from e2e.json — env var names only, never secrets]
108
110
  ```
109
111
 
110
- 3. **Wait for completion.** The agent's output carries `whole_checkpoint_aggregated: true` confirming whole-checkpoint formatting.
112
+ Hold each specialist's output keyed by framework (an `e2e_outputs[framework]` map) for this skill's aggregation checkpoint-check has no MCP round, so this lives in-memory during the run (persist to `checkpoint.context` via `update_checkpoint` at Step 7 if a durable record is needed). `test_strategy` is intentionally omitted — the agent resolves it from `.codebyplan/e2e.json` and the DB tech-stack record.
113
+
114
+ 3. **Wait for all specialists to complete.** Each agent's output carries `whole_checkpoint_aggregated: true` confirming whole-checkpoint formatting.
111
115
 
112
- 4. **On pass** (`e2e_output.status === 'completed'` AND `e2e_output.test_results.failed === 0`): append a row to the Step 5 QA Summary table:
116
+ 4. **On pass** (every eligible framework `f`: `e2e_outputs[f].status === 'completed'` AND `e2e_outputs[f].test_results.failed === 0`): append a row to the Step 5 QA Summary table:
113
117
  ```
114
118
  | Checkpoint E2E | pass | aggregated |
115
119
  ```
116
120
  Continue to Step 6.
117
121
 
118
- 5. **On fail** (`e2e_output.status === 'failed'` OR `e2e_output.test_results.failed > 0`): build a failure summary from `e2e_output.test_results.failures[]` grouped by `category`. Surface via `AskUserQuestion`:
119
- - **(a) Create fix-task in CHK-{NNN} (recommended)** — invoke MCP `create_task` with `checkpoint_id=current_checkpoint_id`, `title="Fix checkpoint-level e2e failures (CHK-{NNN})"`, `requirements` containing the detailed failure breakdown (category counts, files involved, pages broken, screenshot paths from `e2e_output.screenshots[]`), AND `context: { source_checkpoint_id, e2e_failure_summary: { category_counts, pages_broken, screenshot_paths }, fix_type: "checkpoint_e2e" }` so downstream `cbp-task-planner` Phase 1.5 can verify failure premises programmatically without re-parsing the requirements text. Per `infra-issue-absorption.md` "Resolve-in-Current-Scope by Default", checkpoint-level e2e failures absorb into the active checkpoint — not standalone.
122
+ 5. **On fail** (any framework `f`: `e2e_outputs[f].status === 'failed'` OR `e2e_outputs[f].test_results.failed > 0`): build a failure summary from `e2e_outputs[*].test_results.failures[]` aggregated and grouped by `category`. Surface via `AskUserQuestion`:
123
+ - **(a) Create fix-task in CHK-{NNN} (recommended)** — invoke MCP `create_task` with `checkpoint_id=current_checkpoint_id`, `title="Fix checkpoint-level e2e failures (CHK-{NNN})"`, `requirements` containing the detailed failure breakdown (category counts, files involved, pages broken, screenshot paths from `e2e_outputs[*].screenshots[]`), AND `context: { source_checkpoint_id, e2e_failure_summary: { category_counts, pages_broken, screenshot_paths }, fix_type: "checkpoint_e2e" }` so downstream `cbp-task-planner` can verify failure premises. Per `infra-issue-absorption.md` "Resolve-in-Current-Scope by Default", checkpoint-level e2e failures absorb into the active checkpoint — not standalone.
120
124
  - **(b) Surface as warning only — proceed to checkpoint-end** — append `| Checkpoint E2E | warning | N failures (deferred) |` to Step 5 QA Summary; continue to Step 6.
121
125
  - **(c) Halt — review manually** — STOP and wait for the user.
122
126
 
@@ -95,6 +95,8 @@ git push -u origin "feat/CHK-{NNN}-{slug}"
95
95
 
96
96
  Slug: lowercase, dash-joined, punctuation dropped, ≤40 chars. Persist the branch via MCP `update_checkpoint(checkpoint_id, branch_name: "feat/CHK-{NNN}-{slug}")`. (The dedicated `/cbp-git-branch-feat-create` skill is the canonical config-driven helper if you prefer to delegate.)
97
97
 
98
+ **Note — Supabase preview branch**: no Supabase branch is created here. Creation is lazy — it happens on the first DB change when `/cbp-supabase-migrate` runs on this feat branch, which provisions a Supabase branch named identically to the git branch. See `cbp-supabase-migrate` Step 2.3 for the creation protocol.
99
+
98
100
  ### Step 10: Show Result + Auto-Trigger Plan
99
101
 
100
102
  ```
@@ -141,13 +141,25 @@ C) Keep all
141
141
 
142
142
  Only delete with explicit user confirmation. Delete both local and remote:
143
143
  ```bash
144
- git branch -d "$BRANCH" 2>/dev/null
145
- git push origin --delete "$BRANCH"
144
+ git branch -d "$BRANCH" && git push origin --delete "$BRANCH"
146
145
  ```
147
146
 
147
+ Only after both the local and remote git delete above succeed, run a conditional Supabase preview-branch teardown for that branch name (do not suppress the delete output — a failed local delete must stay visible):
148
+
149
+ > Lifecycle contract: see [[supabase-branch-lifecycle]].
150
+
151
+ - Call `mcp__supabase__list_branches` with `project_id: rrvtrumtkhrsbhcyrwvf`.
152
+ - Scan the returned list for an entry whose `name` exactly equals `$BRANCH`.
153
+ - If found: call `mcp__supabase__delete_branch` with its `branch_id`. Record the branch name in `SUPABASE_BRANCHES_DELETED[]`.
154
+ - If not found: no-op silently — the GitHub integration may have already removed it on PR close; not-found is success, NOT an error.
155
+ - If the `list_branches` call itself fails (network, auth, or a non-success response — distinct from a successful lookup that returns no match): emit a non-blocking warning that the Supabase preview branch for `$BRANCH` may still exist and should be verified in the dashboard. Do not treat an API failure as a not-found success.
156
+ - Never delete the parent project `rrvtrumtkhrsbhcyrwvf` itself or any persistent/production branch.
157
+
158
+ Accumulate all Supabase branch names removed across the loop in `SUPABASE_BRANCHES_DELETED`.
159
+
148
160
  ### Step 9: Current Feat Branch Cleanup
149
161
 
150
- Present comprehensive summary first (Step 10), then ask about current feat branch via AskUserQuestion:
162
+ Before asking about the current feat branch, present a partial summary of what has shipped so far — runtime surfaces (from `/cbp-ship` Step 7), stale branches cleaned (Step 8), and the `SUPABASE_BRANCHES_DELETED` accumulated so far — then ask about the current feat branch via AskUserQuestion (the complete shipment record is finalised in Step 10):
151
163
 
152
164
  ```
153
165
  The current feat branch [BRANCH] has been fully merged.
@@ -166,6 +178,14 @@ git branch -d "$FEAT_BRANCH"
166
178
  git push origin --delete "$FEAT_BRANCH"
167
179
  ```
168
180
 
181
+ After the feat branch git delete, run the same conditional Supabase teardown for `$FEAT_BRANCH`:
182
+
183
+ - Call `mcp__supabase__list_branches` with `project_id: rrvtrumtkhrsbhcyrwvf`.
184
+ - Scan for an entry whose `name` exactly equals `$FEAT_BRANCH`.
185
+ - If found: call `mcp__supabase__delete_branch` with its `branch_id`. Add `$FEAT_BRANCH` to `SUPABASE_BRANCHES_DELETED[]`.
186
+ - If not found: no-op silently — idempotent, not-found is success.
187
+ - If the `list_branches` call itself fails (network, auth, or a non-success response — distinct from a successful lookup that returns no match): emit a non-blocking warning that the Supabase preview branch for `$FEAT_BRANCH` may still exist and should be verified in the dashboard. Do not treat an API failure as a not-found success.
188
+
169
189
  ### Step 10: Save Shipment Results and Summary
170
190
 
171
191
  Update checkpoint context via MCP `update_checkpoint`. The `shipment` block contains both branch promotion AND runtime surface results (from `/cbp-ship` Step 7):
@@ -177,8 +197,9 @@ context.shipment: {
177
197
  feat_to_base: { pr_url, merged: true/false },
178
198
  surfaces: [...], // populated by /cbp-ship — per-surface deploy results
179
199
  skipped: [...], // populated by /cbp-ship — surfaces explicitly skipped
180
- stale_branches_cleaned: [list of deleted branches],
181
- feat_branch_deleted: true/false
200
+ stale_branches_cleaned: [list of deleted git branches],
201
+ feat_branch_deleted: true/false,
202
+ supabase_branches_deleted: [list of Supabase preview branch names removed in Steps 8–9]
182
203
  }
183
204
  ```
184
205
 
@@ -198,6 +219,7 @@ Present summary:
198
219
  ### Branch Operations
199
220
  - Stale branches deleted: [N] ([list])
200
221
  - Feat branch: [deleted/kept]
222
+ - Supabase preview branches deleted: [N] ([list from supabase_branches_deleted], or "none")
201
223
 
202
224
  ### Before/After Branch State
203
225
  - Before: [list of feat/* branches]
@@ -63,7 +63,7 @@ Only relevant when an idea touches a UI surface AND you SUSPECT an existing flow
63
63
 
64
64
  1. Surface the suspicion: name the area + the specific pages/screens, and why you think it is broken.
65
65
  2. Ask the user via AskUserQuestion to confirm running the probe (it needs a running dev server).
66
- 3. On confirm, spawn `cbp-test-e2e-agent` with `whole_checkpoint_mode: true`, `round_number: 0`, `files_changed: []`, the `pages_affected` you proposed, plus `repo_id` / `test_strategy` / `has_auth` / `dev_server_port`. Resolve `test_strategy` and `dev_server_port` per `reference/e2e-discovery-probe.md` (do not pass placeholder strings).
66
+ 3. On confirm, spawn the config-matched `cbp-e2e-*` specialist (for a web app, `cbp-e2e-playwright`) per the `context/testing/e2e.md` dispatch contract, with `whole_checkpoint_mode: true`, `round_number: 0`, `files_changed: []`, the `pages_affected` you proposed, plus `repo_id` / `test_strategy` / `has_auth` / `dev_server_port`. Resolve `test_strategy` and `dev_server_port` per `reference/e2e-discovery-probe.md` (do not pass placeholder strings).
67
67
  4. Record the probe outcome (what actually failed vs. what you assumed) in `context.discoveries[]` so the plan targets real defects.
68
68
 
69
69
  Skip this step entirely for non-UI checkpoints or when no breakage is suspected.
@@ -131,7 +131,7 @@ This skill does **NOT** activate the checkpoint and does **NOT** claim a user/wo
131
131
 
132
132
  - **Reads**: MCP `get_current_task`, `get_checkpoints`, `get_tasks`
133
133
  - **Writes**: MCP `update_checkpoint` (ideas assessment, context, plan, research), `create_task`
134
- - **Spawns**: `cbp-research` (level 2+ only), `cbp-test-e2e-agent` (opt-in discovery probe, `whole_checkpoint_mode`)
134
+ - **Spawns**: `cbp-research` (level 2+ only), config-matched `cbp-e2e-*` specialist (opt-in discovery probe, `whole_checkpoint_mode` — see `context/testing/e2e.md` dispatch contract)
135
135
  - **Triggered by**: `/cbp-checkpoint-create` (auto), or user directly
136
136
  - **Triggers**: `/cbp-checkpoint-start` (auto when claimed at create; directive when left open)
137
137
  - **Never**: activates the checkpoint or claims a user/worktree — that is `/cbp-checkpoint-start`
@@ -4,7 +4,7 @@ scope: org-shared
4
4
 
5
5
  # E2E Discovery Probe
6
6
 
7
- Loaded by `/cbp-checkpoint-plan` Step 4. The probe answers one question before you plan a fix: **is this area actually broken, and how?** It reuses `cbp-test-e2e-agent` (the sole owner of e2e execution) in `whole_checkpoint_mode` rather than introducing a second smoke-test path.
7
+ Loaded by `/cbp-checkpoint-plan` Step 4. The probe answers one question before you plan a fix: **is this area actually broken, and how?** It reuses the config-matched `cbp-e2e-*` specialist (the framework owners of e2e execution) in `whole_checkpoint_mode` rather than introducing a second smoke-test path. See `context/testing/e2e.md` for the dispatch contract that selects which specialist to spawn.
8
8
 
9
9
  ## When to offer the probe
10
10
 
@@ -20,8 +20,8 @@ Skip silently for backend-only / infra / `claude_only` checkpoints, or when you
20
20
  1. **State the suspicion** — name the area, the specific pages/screens, and why you think it is broken (a stale selector, a route that 404s, a recent refactor nearby).
21
21
  2. **Confirm with the user** via AskUserQuestion — the probe needs a running dev server, so it is opt-in. Options: run the probe / skip and plan from assumption / let me name different pages.
22
22
  3. **Resolve the dev-server port** from `.codebyplan/server.json` `port_allocations[]` (pick the entry whose `server_type` matches the app, e.g. `nextjs`). If nothing is running there, ask the user to start it or skip.
23
- 4. **Resolve `test_strategy`** — call MCP `get_repos()`, find the entry where `id === repo_id`, and read the affected app's platform + e2e framework from its `tech_stack` record. If the record has no e2e data, pass `null` for the unknown fields — the agent resolves them itself at its Step 1.5. Do NOT pass placeholder strings.
24
- 5. **Spawn** `cbp-test-e2e-agent` with the payload below.
23
+ 4. **Resolve `test_strategy`** — call MCP `get_repos()`, find the entry where `id === repo_id`, and read the affected app's platform + e2e framework from its `tech_stack` record. If the record has no e2e data, pass `null` for the unknown fields — the agent resolves them itself. Do NOT pass placeholder strings.
24
+ 5. **Spawn** the config-matched `cbp-e2e-*` specialist per `context/testing/e2e.md` dispatch contract (e.g. `cbp-e2e-playwright` for a web app) with the payload below.
25
25
  6. **Interpret** the result: compare what actually failed against what you assumed. Record the delta in `context.discoveries[]` so the plan targets real defects, not imagined ones.
26
26
 
27
27
  ## Spawn payload (whole_checkpoint_mode)
@@ -52,6 +52,6 @@ The agent returns `test_results` (passed / failed / skipped + per-failure `categ
52
52
  - `category: 'env' | 'auth' | 'access' | 'flake'` → not the feature's fault; note it but do not plan a code fix around it.
53
53
  - A clean pass → your breakage suspicion was wrong; plan the actual requested change without a "fix" step you did not need.
54
54
 
55
- ## Why reuse the agent (not a new smoke probe)
55
+ ## Why reuse the specialist agents (not a new smoke probe)
56
56
 
57
- `cbp-test-e2e-agent` is the declared sole owner of e2e: it auto-detects the platform, reconciles against the `tech_stack` DB record, configures the framework if missing, and classifies failures. A bespoke in-skill smoke check would duplicate that ownership and drift. The probe is a thin, opt-in caller of the existing agent.
57
+ The `cbp-e2e-*` specialists are the declared framework owners of e2e: they configure the framework if missing, run preflight, and classify failures. A bespoke in-skill smoke check would duplicate that ownership and drift. The probe is a thin, opt-in caller of the matching existing agent (selected per `context/testing/e2e.md` dispatch contract).