codebyplan 1.13.49 → 1.13.51

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 (34) hide show
  1. package/dist/cli.js +447 -14
  2. package/package.json +1 -1
  3. package/templates/agents/cbp-round-executor.md +1 -6
  4. package/templates/agents/cbp-task-planner.md +2 -2
  5. package/templates/hooks/cbp-skill-context-guard.sh +52 -0
  6. package/templates/hooks/cbp-test-hooks.sh +144 -0
  7. package/templates/hooks/hooks.json +9 -0
  8. package/templates/rules/model-invocation-convention.md +40 -0
  9. package/templates/rules/parallel-waves.md +1 -1
  10. package/templates/rules/supabase-branch-lifecycle.md +2 -3
  11. package/templates/rules/task-routing-recommendation.md +1 -1
  12. package/templates/settings.project.base.json +2 -3
  13. package/templates/skills/cbp-build-cc-mode/SKILL.md +1 -1
  14. package/templates/skills/cbp-build-cc-settings/reference/cbp-permission-policy.md +42 -0
  15. package/templates/skills/cbp-checkpoint-create/SKILL.md +1 -0
  16. package/templates/skills/cbp-checkpoint-start/SKILL.md +1 -0
  17. package/templates/skills/cbp-clear-continue/SKILL.md +86 -0
  18. package/templates/skills/cbp-clear-prep/SKILL.md +121 -0
  19. package/templates/skills/cbp-round-start/SKILL.md +1 -1
  20. package/templates/skills/cbp-session-end/SKILL.md +2 -18
  21. package/templates/skills/cbp-session-start/SKILL.md +4 -18
  22. package/templates/skills/cbp-supabase-migrate/SKILL.md +1 -1
  23. package/templates/skills/cbp-task-check/SKILL.md +12 -5
  24. package/templates/skills/cbp-task-complete/SKILL.md +9 -11
  25. package/templates/skills/cbp-task-complete/reference/checkpoint-done-branching.md +14 -21
  26. package/templates/skills/cbp-task-complete/reference/next-step-heuristic.md +4 -6
  27. package/templates/skills/cbp-task-testing/SKILL.md +9 -14
  28. package/templates/skills/cbp-frontend-a11y/SKILL.md +0 -108
  29. package/templates/skills/cbp-frontend-a11y/reference/aria-roles-states.md +0 -130
  30. package/templates/skills/cbp-frontend-a11y/reference/contrast-visual.md +0 -122
  31. package/templates/skills/cbp-frontend-a11y/reference/keyboard-patterns.md +0 -154
  32. package/templates/skills/cbp-frontend-a11y/reference/semantic-html.md +0 -111
  33. package/templates/skills/cbp-git-worktree-create/SKILL.md +0 -199
  34. package/templates/skills/cbp-git-worktree-remove/SKILL.md +0 -144
@@ -11,7 +11,7 @@ Activate the session, open a fresh session log, and surface the previous log's p
11
11
 
12
12
  ## Instructions
13
13
 
14
- Run Steps 0 through 5.8 silently (no intermediate output) — except Step 0 aborts the session on MCP failure, Step 1.4 may surface a one-line fast-forward note or warning, Step 1.5 may surface a one-line infra-drift nudge, Step 1.55 may surface a one-line architecture-map drift nudge, Step 1.6 may run an install-and-halt path, Step 1.7 may surface a one-line LSP binary nudge, Step 4.5 may auto-resume a handoff and exit session-start entirely (no Step 6 output), and Step 5.7 may surface an approval gate. (Step numbers are organizational labels; execution order is 0 → 1 → 1.4 → 1.5 → 1.55 → 1.6 → 1.7 → 3 → 4 → 4.5 → 5 → 5.7 → 5.8 → 6 → 7.) Produce ONE output block at Step 6, then auto-trigger or stop per Step 7.
14
+ Run Steps 0 through 5.8 silently (no intermediate output) — except Step 0 aborts the session on MCP failure, Step 1.5 may surface a one-line infra-drift nudge, Step 1.55 may surface a one-line architecture-map drift nudge, Step 1.6 may run an install-and-halt path, Step 1.7 may surface a one-line LSP binary nudge, Step 4.5 may auto-resume a handoff and exit session-start entirely (no Step 6 output), and Step 5.7 may surface an approval gate. (Step numbers are organizational labels; execution order is 0 → 1 → 1.5 → 1.55 → 1.6 → 1.7 → 3 → 4 → 4.5 → 5 → 5.7 → 5.8 → 6 → 7.) Produce ONE output block at Step 6, then auto-trigger or stop per Step 7.
15
15
 
16
16
  ### Step 0: MCP Health Gate
17
17
 
@@ -50,23 +50,11 @@ Extract `worktree_id` and `error_kind` from the JSON output.
50
50
 
51
51
  Pass `WORKTREE_ID` to MCP tools that support it. Null `WORKTREE_ID` means the (device, path, branch) tuple is unregistered — note this for Step 6.
52
52
 
53
- ### Step 1.4: Home-Branch Fast-Forward
54
-
55
- Keep this worktree's **home branch** rooted at the freshest production tip — no prompt, fully non-blocking. Home branches are the folder-named placeholder branches each worktree rests on (e.g. `codebyplan-web`); `feat/*` branches are deliberately skipped — they integrate via `/cbp-merge-main` with QA, never an auto fast-forward.
56
-
57
- Run `codebyplan session home-ff` and parse the JSON output (`{ result: 'skipped'|'warn'|'fast_forwarded', reason?, warn? }`):
58
-
59
- - **`result === 'skipped'`** (non-home branch or production mismatch): proceed silently.
60
- - **`result === 'warn'`** (fast-forward attempt failed): surface the `warn` field as one line, then proceed silently.
61
- - **`result === 'fast_forwarded'`** (home branch updated): proceed silently.
62
-
63
- Never rebase, reset, force-push, or stash. A non-fast-forwardable home branch is a signal to reconcile manually, not to overwrite.
64
-
65
53
  ### Step 1.5: Infra Drift Check
66
54
 
67
- Surface — never block — when this worktree's source-monorepo `.claude/` infra has fallen behind. Runs after Step 1.4 and may add one line to the Step 6 output (`$PRODUCTION` is the branch resolved in Step 1.4). Consumer-repo package-version freshness is handled by Step 1.6 (the freshness gate), not here:
55
+ Surface — never block — when this worktree's source-monorepo `.claude/` infra has fallen behind. Runs after Step 1 and may add one line to the Step 6 output (`$PRODUCTION` is `branch_config.production` read in Step 1). Consumer-repo package-version freshness is handled by Step 1.6 (the freshness gate), not here:
68
56
 
69
- - **Monorepo (concept A)** — both `packages/codebyplan-package/templates/` and `scripts/infra-drift.mjs` exist. Step 1.4 skips the fetch on a feat branch, so refresh `origin/$PRODUCTION` best-effort first, then run the reporter:
57
+ - **Monorepo (concept A)** — both `packages/codebyplan-package/templates/` and `scripts/infra-drift.mjs` exist. Refresh `origin/$PRODUCTION` best-effort first, then run the reporter:
70
58
 
71
59
  ```bash
72
60
  git fetch origin "$PRODUCTION" 2>/dev/null || true
@@ -136,8 +124,6 @@ Run `codebyplan session freshness-gate --halt-on-update` and parse the JSON outp
136
124
 
137
125
  On this update-and-halt path the session is NOT continued: `update_session_state(activate)` is NOT called, `create_session_log` is NOT called, and `/cbp-todo` is NOT triggered.
138
126
 
139
- **Home branches are intentionally not guarded.** A worktree's folder-named home branch (e.g. `codebyplan-web`) is neither protected/main nor the canonical source, so the freshness gate returns `result !== 'guarded'` there and this gate fires exactly as on a feat branch. That is deliberate — the update lands on whatever branch the worktree is currently resting on (the "update the branch they're on, except main/canonical" decision), not an accidental halt.
140
-
141
127
  Populate the claude-status cache best-effort (pure cache population — never gates session-start):
142
128
 
143
129
  ```bash
@@ -271,7 +257,7 @@ Three-branch gate using `owned_count` and `total_count` from Step 5.8:
271
257
 
272
258
  - **Triggered by**: user invocation, `/clear` recovery
273
259
  - **Resolves**: `npx codebyplan resolve-worktree --json` (worktree id + distress signal; non-tuple-miss distress is non-blocking at session-start)
274
- - **Reads**: `.codebyplan/repo.json`, `.codebyplan/git.json` (`branch_config.production` for the Step 1.4 home-branch fast-forward), MCP `health_check` (Step 0 hard gate — stays MCP unconditionally); local-first reads (with `npx codebyplan sync` + MCP break-glass): `.codebyplan/state/session/current.json` (Step 4 previous log + Step 4.5 handoff probe), `.codebyplan/state/checkpoints/<id>.json` / `tasks/<id>.json` / `rounds/<id>.json` (Step 4.5 freshness probe), `.codebyplan/state/todos.json` (Step 5.7 active-task lookup); MCP `get_checkpoints({ repo_id, status: 'active' })` (Step 5.8 ownership partition — MCP only, no local mirror for active-filter query); `scripts/infra-drift.mjs` + a best-effort `git fetch` (Step 1.5 monorepo drift); `npx codebyplan arch-map drift` + `.codebyplan/architecture.json` presence (Step 1.55 architecture-map drift nudge, non-blocking); `codebyplan session home-ff` (Step 1.4 home-branch fast-forward); `codebyplan session freshness-gate --halt-on-update` (Step 1.6 package-freshness gate); `codebyplan session infra-files --json --task-files <csv>` (Step 5.7 infra-file set math); `npx codebyplan lsp --check` (Step 1.7 LSP binary nudge — reads `.codebyplan/lsp.json`, non-blocking). Reads at Step 3 and later do NOT fire on a Step 0 MCP hard-fail or the Step 1.6 update-and-halt path
260
+ - **Reads**: `.codebyplan/repo.json`, `.codebyplan/git.json` (`branch_config.production` for Step 1.5 infra-drift fetch), MCP `health_check` (Step 0 hard gate — stays MCP unconditionally); local-first reads (with `npx codebyplan sync` + MCP break-glass): `.codebyplan/state/session/current.json` (Step 4 previous log + Step 4.5 handoff probe), `.codebyplan/state/checkpoints/<id>.json` / `tasks/<id>.json` / `rounds/<id>.json` (Step 4.5 freshness probe), `.codebyplan/state/todos.json` (Step 5.7 active-task lookup); MCP `get_checkpoints({ repo_id, status: 'active' })` (Step 5.8 ownership partition — MCP only, no local mirror for active-filter query); `scripts/infra-drift.mjs` + a best-effort `git fetch` (Step 1.5 monorepo drift); `npx codebyplan arch-map drift` + `.codebyplan/architecture.json` presence (Step 1.55 architecture-map drift nudge, non-blocking); `codebyplan session freshness-gate --halt-on-update` (Step 1.6 package-freshness gate); `codebyplan session infra-files --json --task-files <csv>` (Step 5.7 infra-file set math); `npx codebyplan lsp --check` (Step 1.7 LSP binary nudge — reads `.codebyplan/lsp.json`, non-blocking). Reads at Step 3 and later do NOT fire on a Step 0 MCP hard-fail or the Step 1.6 update-and-halt path
275
261
  - **Writes**: `codebyplan session create-log` (Step 5 — CLI write-through; break-glass: MCP `create_session_log`), `codebyplan session update-state --action activate` (Step 3 — CLI write-through to `.codebyplan/state/session/state.json`; break-glass: MCP `update_session_state`) — both SKIPPED on a Step 0 MCP hard-fail and on the Step 1.6 update-and-halt path
276
262
  - **Spawns**: none
277
263
  - **Triggers**: `/cbp-git-commit` (conditional, on user approval at Step 5.7 or the Step 1.6 update path), `handoff.command` (on fresh handoff hit at Step 4.5), `/cbp-todo` (auto fall-through when owned_count >= 1 or total_count === 0; STOPS with no trigger when total_count >= 1 AND owned_count === 0; NOT triggered on a Step 0 hard-fail or the Step 1.6 update-and-halt path)
@@ -170,7 +170,7 @@ Stop.
170
170
 
171
171
  ### Record connection
172
172
 
173
- Record the branch so cleanup (see `cbp-checkpoint-end`, `cbp-git-worktree-remove`) and other
173
+ Record the branch so cleanup (see `cbp-checkpoint-end`, `codebyplan worktree remove CHK-NNN`) and other
174
174
  skills can discover it. Phrase any context payload as prose — the MCP edge rejects raw
175
175
  uppercase database keywords (Cloudflare WAF).
176
176
 
@@ -120,7 +120,12 @@ Save agent output to task context: `codebyplan task update --id <taskId> --check
120
120
 
121
121
  **READY + satisfied:**
122
122
 
123
- **Next**: Run `/clear`, then `/cbp-task-testing {chk-task}` to run comprehensive task-level testing.
123
+ Starting task testing...
124
+
125
+ Invoke `cbp-task-testing` via the Skill tool with the same `{chk-task}` argument. `cbp-task-testing`
126
+ is `allow`-tier — it auto-fires silently. If the `cbp-skill-context-guard.sh` hook detects the
127
+ context window is above the 200K threshold it will block the skill and direct you to run
128
+ `/cbp-clear-prep` first; otherwise testing starts immediately.
124
129
 
125
130
  **NOT READY — fixable issues:**
126
131
 
@@ -130,7 +135,9 @@ Issues found that need addressing:
130
135
  - [issue 2]
131
136
  ```
132
137
 
133
- Suggest: `/cbp-round-input` with specific issues. **STOP HERE** — wait for user.
138
+ Invoking `cbp-round-input` to address the issues found during review...
139
+
140
+ Invoke `cbp-round-input` via the Skill tool. `cbp-round-input` is `allow`-tier — it auto-fires silently.
134
141
 
135
142
  **NOT READY — needs new task:**
136
143
 
@@ -139,7 +146,7 @@ Scope issues identified that require a new task:
139
146
  - [scope issue]
140
147
  ```
141
148
 
142
- Suggest: `/cbp-task-create`. **STOP HERE** — wait for user.
149
+ Suggest: `/cbp-task-create`. **STOP HERE** — wait for user (creating a new task is a user scope decision — not auto-triggered).
143
150
 
144
151
  **NOT READY — approvals missing:**
145
152
 
@@ -147,7 +154,7 @@ Suggest: `/cbp-task-create`. **STOP HERE** — wait for user.
147
154
  Code review passed but [N] files need user approval.
148
155
  ```
149
156
 
150
- Suggest: Approve files, then re-run `/cbp-task-check`. **STOP HERE** — wait for user.
157
+ Suggest: Approve files, then re-run `/cbp-task-check`. **STOP HERE** — wait for user (approval is a user action — not auto-triggered).
151
158
 
152
159
  ## Key Rules
153
160
 
@@ -161,5 +168,5 @@ Suggest: Approve files, then re-run `/cbp-task-check`. **STOP HERE** — wait fo
161
168
 
162
169
  - **Reads**: `.codebyplan/state/checkpoints/*.json`, `checkpoints/<id>/tasks/*.json`, `checkpoints/<id>/tasks/<id>/rounds/*.json`, `todos.json` (local-first; `npx codebyplan sync` on miss; MCP `get_current_task`/`get_rounds` break-glass), plus all changed files (via agent)
163
170
  - **Writes**: `codebyplan task update` (CLI write-through; MCP `update_task` break-glass)
164
- - **Triggers**: emits directive `Next: /clear, then /cbp-task-testing {chk-task}` on READY + satisfied (cross-context — testing is heavyweight, fresh context helps)
171
+ - **Triggers**: auto-triggers `cbp-task-testing` via Skill tool on READY + satisfied (`allow`-tier, fires silently; the 200K context guard handles oversized contexts via the cbp-clear-prep flow); auto-triggers `cbp-round-input` via Skill tool on NOT READY fixable issues (`allow`-tier, fires silently)
165
172
  - **Triggered by**: `/cbp-round-complete` (auto, when all files approved)
@@ -2,6 +2,7 @@
2
2
  name: cbp-task-complete
3
3
  description: Complete current task
4
4
  argument-hint: [chk-task]
5
+ triggers: [cbp-task-start, cbp-checkpoint-check]
5
6
  effort: xhigh
6
7
  ---
7
8
 
@@ -155,7 +156,7 @@ Show the completion summary:
155
156
  **Warnings**: [any QA / file-approval warnings from Step 3, or "none"]
156
157
  ```
157
158
 
158
- Then route. Same-context transitions (next task in this checkpoint) auto-trigger via the Skill tool. Cross-context transitions (checkpoint done /cbp-checkpoint-check, session end) surface as a single directive 'Next: /clear, then /cbp-X' for the user to invoke after refreshing context.
159
+ Then route. Same-context transitions (next task in this checkpoint) auto-trigger `cbp-task-start` via the Skill tool. Checkpoint-done (last task) also auto-triggers `cbp-checkpoint-check` via the Skill tool (`ask`-tier — the permission prompt is the human gate; the 200K context guard handles oversized contexts via the cbp-clear-prep flow). Only the no-task-anywhere session-end fallback surfaces as a single directive (`Next: Run /clear, then /cbp-session-end`) for the user to invoke.
159
160
 
160
161
  #### 9a — Determine routing context
161
162
 
@@ -179,16 +180,13 @@ Use the Skill tool with `skill: cbp-task-start` and `args: "{NEXT_CHK}-{NEXT_TAS
179
180
 
180
181
  If no next task is found (no pending work anywhere in the repo), emit directive and stop: `Next: Run /clear, then /cbp-session-end.`
181
182
 
182
- #### 9c — Checkpoint-done directive (last task in checkpoint)
183
+ #### 9c — Checkpoint-done auto-trigger (last task in checkpoint)
183
184
 
184
- The checkpoint has no remaining tasks. Emit this directive and stop:
185
-
186
- ```
187
- CHK-{NNN} is fully tasked. Run /clear, then /cbp-checkpoint-check to verify and ship.
188
- Alternatives: /cbp-checkpoint-update {NNN} to expand the checkpoint with more tasks, or /cbp-session-end to wrap up here.
189
- ```
190
-
191
- Do NOT use AskUserQuestion here — this is a directive, not a menu. The user runs whichever command fits their intent.
185
+ The checkpoint has no remaining tasks. Invoke `cbp-checkpoint-check` via the Skill tool.
186
+ `cbp-checkpoint-check` is `ask`-tier — the harness permission prompt IS the human gate; the
187
+ user confirms (or declines) before checkpoint verification and ship begins. If the context
188
+ window is above the 200K threshold the `cbp-skill-context-guard.sh` hook will block it and
189
+ direct you to run `/cbp-clear-prep` first; otherwise checkpoint-check starts on confirmation.
192
190
 
193
191
  ## Integration
194
192
 
@@ -197,5 +195,5 @@ Do NOT use AskUserQuestion here — this is a directive, not a menu. The user ru
197
195
  - **Reads**: `.codebyplan/state/checkpoints/*.json`, `checkpoints/<id>/tasks/*.json`, `checkpoints/<id>/tasks/<id>/rounds/*.json`, `todos.json` (local-first; `npx codebyplan sync` on miss; MCP `get_current_task`/`get_rounds`/`get_tasks` break-glass)
198
196
  - **Writes**: `codebyplan task update` for `files_changed` (CLI write-through; MCP `update_task` break-glass); MCP `complete_task` for task completion (kept MCP — CLI cannot forward `caller_worktree_id`)
199
197
  - **Uses skills (inline, no sub-agent)**: `cleanup` (if deletions), `migration` (if exports renamed)
200
- - **Triggers**: Same-context transitions auto-trigger via the Skill tool (next task in checkpoint → `/cbp-task-start {N}`). Cross-context transitions emit a directive `Next: /clear, then /cbp-X` for the user to invoke.
198
+ - **Triggers**: Same-context transitions auto-trigger via the Skill tool (next task in checkpoint → `cbp-task-start {N}`, `allow`-tier, fires silently). Checkpoint-done auto-triggers `cbp-checkpoint-check` via Skill tool (`ask`-tier, permission prompt IS the human gate). No-task-anywhere fallback → directive `Next: Run /clear, then /cbp-session-end.`
201
199
  - **Checkpoint-bound only** — for standalone tasks use `/cbp-standalone-task-complete`
@@ -1,8 +1,8 @@
1
- # Checkpoint-Done Branching in `/cbp-task-complete` Step 9
1
+ # Checkpoint-Done Auto-Trigger in `/cbp-task-complete` Step 9
2
2
 
3
- When the just-completed task was the LAST pending task in its checkpoint (every sibling task has `status === 'completed'`), Step 9c emits a directive instead of a routing menu. The user reads the directive and runs whichever command fits their intent — no AskUserQuestion.
3
+ When the just-completed task was the LAST pending task in its checkpoint (every sibling task has `status === 'completed'`), Step 9c auto-triggers `cbp-checkpoint-check` via the Skill tool — no routing menu, no manual `/clear` directive.
4
4
 
5
- This file describes the detection logic, the directive form, and the standalone fall-through.
5
+ This file describes the detection logic, the auto-trigger form, and the standalone fall-through.
6
6
 
7
7
  ## Detection
8
8
 
@@ -10,39 +10,32 @@ The skill detects "checkpoint done" at Step 9 by:
10
10
 
11
11
  1. Reading `current_task.checkpoint_id`. If `null` → standalone — see "Standalone Fall-Through" below.
12
12
  2. Calling `get_tasks(checkpoint_id)` and checking that EVERY task other than the just-completed one has `status === 'completed'`.
13
- 3. If yes, the checkpoint has no pending or in-progress siblings — emit the Step 9c directive.
13
+ 3. If yes, the checkpoint has no pending or in-progress siblings — fire the Step 9c auto-trigger.
14
14
 
15
- ## Step 9c Directive Form
15
+ ## Step 9c Auto-Trigger Form
16
16
 
17
- When all siblings are done, the skill emits:
17
+ When all siblings are done, the skill invokes `cbp-checkpoint-check` via the Skill tool:
18
18
 
19
- ```
20
- CHK-{NNN} is fully tasked. Run /clear, then /cbp-checkpoint-check to verify and ship.
21
- Alternatives: /cbp-checkpoint-update {NNN} to expand the checkpoint with more tasks, or /cbp-session-end to wrap up here.
22
- ```
19
+ - `cbp-checkpoint-check` is `ask`-tier — the harness permission prompt IS the human gate. The user confirms (or declines) before checkpoint verification and the shipment chain begin.
20
+ - No `/clear` is emitted unconditionally. If the `cbp-skill-context-guard.sh` hook detects the context window is above the 200K threshold it blocks the skill and directs you to run `/cbp-clear-prep` first (which writes a handoff; the user then runs `/clear`, then `/cbp-clear-continue` resumes); otherwise checkpoint-check starts immediately on confirmation.
23
21
 
24
- This is a directive, not a menu. No AskUserQuestion. The user runs whichever command fits their intent:
25
-
26
- - `/clear` then `/cbp-checkpoint-check` — verify deliverables and begin the shipment chain
27
- - `/cbp-checkpoint-update {NNN}` — expand the checkpoint with more tasks (routes through `checkpoint-update` FIRST, not directly to `task-create`)
28
- - `/cbp-session-end` — wrap up here
29
-
30
- The skill does NOT auto-invoke any of these. Emit the directive, then stop.
22
+ There is no AskUserQuestion menu. Expanding the checkpoint with more tasks (`/cbp-checkpoint-update`) or wrapping up the session (`/cbp-session-end`) are no longer surfaced as inline alternatives — the deterministic next step on checkpoint-done is `cbp-checkpoint-check`. (The user can still invoke those other skills manually at any time; they are simply not part of the auto-flow.)
31
23
 
32
24
  ## Standalone Fall-Through
33
25
 
34
26
  When the just-completed task is standalone (`checkpoint_id === null`):
35
27
 
36
- - The Step 9c directive does NOT apply. There is no checkpoint to ship, expand, or defer.
28
+ - The Step 9c auto-trigger does NOT apply. There is no checkpoint to verify or ship.
37
29
  - Step 9 falls through to next-task routing per `next-step-heuristic.md` "Standalone Variant":
38
30
  - If a next pending task is found (standalone or in-progress checkpoint): auto-trigger via Skill tool — no AskUserQuestion, no /clear.
39
31
  - If no pending tasks remain anywhere: emit single directive `**Next**: Run /clear, then /cbp-session-end.` — all known work complete.
40
32
 
41
33
  ## What the Skill Does NOT Do
42
34
 
43
- Never auto-trigger `/cbp-checkpoint-check`, `/cbp-checkpoint-update`, or auto-mark the checkpoint complete those are cross-context transitions that emit a single directive, not auto-invocations. Never combine the Step 9c directive with the Step 9b auto-trigger in the same response — one or the other based on detection, not both.
35
+ - Never combine the Step 9c auto-trigger (checkpoint done `cbp-checkpoint-check`) with the Step 9b auto-trigger (next task in checkpoint `cbp-task-start`) in the same response — fire one or the other based on detection, not both.
36
+ - Never present a multi-option AskUserQuestion menu for routing between known-next skills (per the close-out-routing rule — auto-trigger or a single directive, never an A/B/C menu).
44
37
 
45
38
  ## Pairs With
46
39
 
47
- - `next-step-heuristic.md` — sibling reference for non-last-task-in-checkpoint case (Step 9b auto-trigger)
48
- - `.claude/skills/cbp-checkpoint-update/SKILL.md` — destination of the expand path; accepts the entry-context preamble described in Step 9c
40
+ - `next-step-heuristic.md` — sibling reference for the non-last-task-in-checkpoint case (Step 9b auto-trigger)
41
+ - `.claude/skills/cbp-checkpoint-check/SKILL.md` — the auto-triggered destination on checkpoint-done
@@ -17,19 +17,17 @@ No AskUserQuestion, no `/clear`. The skill fires immediately.
17
17
 
18
18
  ## Case 2 — Cross-Context (checkpoint done, session end)
19
19
 
20
- When the checkpoint is fully done or no pending tasks exist in the current context, emit a single directive line at the end of skill output and stop:
20
+ Two sub-cases:
21
21
 
22
- ```
23
- **Next**: Run /clear, then /cbp-checkpoint-check.
24
- ```
22
+ **Checkpoint done** (last task in the checkpoint complete): auto-trigger `cbp-checkpoint-check` via the Skill tool. `cbp-checkpoint-check` is `ask`-tier — the permission prompt is the human gate; the 200K context guard handles oversized contexts (via `cbp-clear-prep`) only when context is near the limit. No unconditional `/clear`. (See `checkpoint-done-branching.md`.)
25
23
 
26
- Or for session-end:
24
+ **Session end** (no pending tasks anywhere): emit a single directive line at the end of skill output and stop:
27
25
 
28
26
  ```
29
27
  **Next**: Run /clear, then /cbp-session-end.
30
28
  ```
31
29
 
32
- The user runs the command after refreshing context. No menu, no options — just one directive.
30
+ The user runs session-end after refreshing context. No menu, no options — just one directive.
33
31
 
34
32
  ## Rule
35
33
 
@@ -2,7 +2,7 @@
2
2
  name: cbp-task-testing
3
3
  description: Run comprehensive task-level testing after /cbp-task-check passes
4
4
  argument-hint: [chk-task]
5
- triggers: [cbp-task-complete]
5
+ triggers: [cbp-task-complete, cbp-round-input]
6
6
  effort: xhigh
7
7
  ---
8
8
 
@@ -233,21 +233,16 @@ Collect failures from automated tests (Step 6), cross-round code review (Step 6.
233
233
  All tests passed for TASK-[N]. Routing to task-complete...
234
234
  ```
235
235
 
236
- Auto-trigger `/cbp-task-complete`.
236
+ Invoke `cbp-task-complete` via the Skill tool. `cbp-task-complete` is `ask`-tier — the harness
237
+ permission prompt IS the human gate; the user confirms (or declines) before task commit,
238
+ merge-main, and completion.
237
239
 
238
240
  **Minor problems found:**
239
241
 
240
- ---
241
-
242
- **Next:**
243
- Run `/cbp-round-input` to:
244
-
245
- - Address the minor issues found during testing
246
- - Create a focused round for fixes
247
-
248
- ---
242
+ Invoking `cbp-round-input` to address the minor issues found during testing...
249
243
 
250
- Waiting for user to run `/cbp-round-input`.
244
+ Invoke `cbp-round-input` via the Skill tool. `cbp-round-input` is `allow`-tier — it auto-fires
245
+ silently.
251
246
 
252
247
  **Major problems found:**
253
248
 
@@ -278,5 +273,5 @@ Waiting for user to run `/cbp-task-create`.
278
273
 
279
274
  - **Reads**: `.codebyplan/state/checkpoints/*.json`, `checkpoints/<id>/tasks/*.json`, `checkpoints/<id>/tasks/<id>/rounds/*.json`, `todos.json` (local-first; `npx codebyplan sync` on miss; MCP `get_current_task`/`get_rounds` break-glass), plus all aggregated files
280
275
  - **Writes**: `codebyplan task update` (CLI write-through; MCP `update_task` break-glass)
281
- - **Triggers**: `/cbp-task-complete` (auto, when ALL PASS)
282
- - **Triggered by**: user runs `/cbp-task-testing {chk-task}` per directive from `/cbp-task-check` on READY verdict (after `/cbp-round-execute`-driven validation completed all rounds)
276
+ - **Triggers**: `cbp-task-complete` (auto via Skill tool, when ALL PASS — `ask`-tier, permission prompt IS the human gate); `cbp-round-input` (auto via Skill tool, on minor problems — `allow`-tier, fires silently)
277
+ - **Triggered by**: `cbp-task-check` auto-triggers this skill via Skill tool on READY verdict; `cbp-task-testing` is `allow`-tier and fires silently (no permission prompt)
@@ -1,108 +0,0 @@
1
- ---
2
- name: cbp-frontend-a11y
3
- description: Pre-implementation accessibility playbook loaded BEFORE writing UI / styling code. Produces a per-component checklist of WCAG 2.1 AA obligations from semantic HTML, ARIA roles/states, keyboard patterns, and contrast requirements.
4
- effort: xhigh
5
- ---
6
-
7
- # Frontend Accessibility (Pre-Implementation Playbook)
8
-
9
- Loaded by `round-executor` Step 2.6 BEFORE any UI or styling file is written, AFTER `frontend-design` has committed to an aesthetic direction. Produces a concrete pre-write checklist — not a post-implementation audit.
10
-
11
- ## When this skill fires
12
-
13
- Invoked when the wave's `skill_preloads[]` contains `"frontend-a11y"` (set by planner Phase 5.6 when `wave.files[]` includes UI-bearing paths). See `rules/frontend-accessibility-invocation.md` for the trigger gate.
14
-
15
- If none of the wave files are UI-bearing, skip — proceed to Step 3.
16
-
17
- ## Phase 1: Read tokens and sibling components
18
-
19
- 1. Identify design tokens from the plan's context or `frontend-design` output — colour tokens are needed for contrast checks.
20
- 2. Glob for sibling components in the same directory as files being authored. Read 1-2 examples to understand existing `aria-*` usage, `role` attributes, keyboard handlers, focus management patterns.
21
- 3. Note the established a11y posture: does the codebase already use `role="dialog"` patterns? Does it trap focus in modals? Are there custom keyboard handlers?
22
-
23
- ## Phase 2: Detect the stack
24
-
25
- Read the planner's `test_strategy.platform` or grep for signal files:
26
-
27
- | Signal | Stack |
28
- |--------|-------|
29
- | `next.config.ts` | Next.js (App Router) |
30
- | `expo` in deps | React Native / Expo |
31
- | `tauri.conf.json` | Tauri web view |
32
-
33
- Load the matching reference doc from `reference/` (relative to this SKILL.md):
34
-
35
- - Next.js / web: read `reference/semantic-html.md`, `reference/aria-roles-states.md`, `reference/keyboard-patterns.md`, `reference/contrast-visual.md`
36
- - React Native: read `reference/aria-roles-states.md`, `reference/contrast-visual.md` (semantic HTML n/a for RN)
37
- - Tauri web view: same as Next.js / web
38
-
39
- ## Phase 3: Load reference docs
40
-
41
- For the detected stack, read EACH applicable reference doc in sequence. Do not skip — the pre-write checklist is derived from their combined content.
42
-
43
- Reference docs (paths relative to this SKILL.md):
44
-
45
- - `reference/semantic-html.md` — landmark roles, heading hierarchy, element semantics, anti-patterns
46
- - `reference/aria-roles-states.md` — role table, aria-label vs aria-labelledby, live regions, expanded/pressed/hidden
47
- - `reference/keyboard-patterns.md` — focus management, tab order, Esc, arrow keys, focus traps, type-ahead
48
- - `reference/contrast-visual.md` — WCAG 2.1 AA ratios, focus-visible, colour-only state, reduced-motion, touch targets
49
-
50
- ## Phase 4: Commit to per-component obligations
51
-
52
- For each component or element type in `wave.files[]`, derive explicit obligations from the reference docs. Group by component:
53
-
54
- ```
55
- Component: <ComponentName> (<path>)
56
- - Semantic: [e.g. "use <button> not <div onClick>"]
57
- - ARIA: [e.g. "aria-expanded on disclosure trigger"]
58
- - Keyboard: [e.g. "Esc closes; focus returns to trigger"]
59
- - Contrast: [e.g. "border token needs 3:1 vs background — verify"]
60
- - Touch: [e.g. "min 44x44px tap target on mobile"]
61
- ```
62
-
63
- Unknown component types get the universal checklist from Phase 5.
64
-
65
- ## Phase 5: Universal guidelines (applied to every component)
66
-
67
- Regardless of component type, every UI component must satisfy:
68
-
69
- 1. Every interactive element is keyboard-reachable and activatable (Enter/Space for buttons, Enter for links)
70
- 2. Focus-visible is never removed via `outline: none` without a custom indicator meeting 3:1 contrast
71
- 3. No state conveyed via colour alone — icon + text + colour
72
- 4. `prefers-reduced-motion` media query wraps any animation
73
- 5. Touch targets ≥ 44×44 CSS px
74
- 6. Images have `alt` text (decorative images use `alt=""`)
75
- 7. Form inputs have associated `<label htmlFor>` or `aria-label`
76
-
77
- ## Phase 6: Output pre-write checklist
78
-
79
- Produce a flat checklist in `round.context.frontend_a11y_checklist`:
80
-
81
- ```yaml
82
- frontend_a11y_checklist:
83
- - component: "<ComponentName>"
84
- file: "<path>"
85
- items:
86
- - "[Semantic] use <button> not <div onClick>"
87
- - "[ARIA] aria-expanded on trigger; aria-controls referencing panel id"
88
- - "[Keyboard] Esc closes panel; focus returns to trigger"
89
- - "[Contrast] verify focus ring token meets 3:1 vs background"
90
- - "[Touch] min 44x44px on mobile breakpoint"
91
- ```
92
-
93
- The executor consults this checklist when authoring each component in Step 3.
94
-
95
- ## Output back to round-executor
96
-
97
- ```yaml
98
- round.context.frontend_a11y_loaded: true
99
- round.context.frontend_a11y_checklist: [per-component checklist items]
100
- ```
101
-
102
- ## Integration
103
-
104
- - **Invoked by**: `round-executor` Step 2.6 (when `"frontend-a11y"` in `wave.skill_preloads[]`)
105
- - **Reads**: `reference/semantic-html.md`, `reference/aria-roles-states.md`, `reference/keyboard-patterns.md`, `reference/contrast-visual.md`
106
- - **Output consumed by**: `round-executor` Step 3 (implementation guidance)
107
- - **Pairs with**: `frontend-design` (invoked first in Step 2.6), `frontend-ui` + `frontend-ux` (post-implementation Step 3.8)
108
- - **Trigger rule**: `rules/frontend-accessibility-invocation.md`
@@ -1,130 +0,0 @@
1
- # ARIA Roles, States, and Properties Reference
2
-
3
- **Golden rule**: Prefer native HTML semantics. ARIA fills gaps — it does not replace semantic elements. An `<input type="checkbox">` is always better than `<div role="checkbox">`.
4
-
5
- ## When to Add a Role
6
-
7
- Use `role` ONLY when no native HTML element maps to the semantic need:
8
-
9
- | Pattern | Native element | ARIA role (fallback) |
10
- |---------|---------------|----------------------|
11
- | Dialog / modal | — | `role="dialog"` + `aria-modal="true"` |
12
- | Alerting status message | — | `role="status"` or `role="alert"` |
13
- | Tab list | — | `role="tablist"`, `role="tab"`, `role="tabpanel"` |
14
- | Custom listbox | — | `role="listbox"`, `role="option"` |
15
- | Progress indicator | `<progress>` | `role="progressbar"` if `<progress>` unstyled |
16
- | Tooltip | `title` attr (limited) | `role="tooltip"` + `aria-describedby` |
17
-
18
- ## aria-label vs aria-labelledby vs aria-describedby
19
-
20
- | Attribute | Use when | Priority |
21
- |-----------|----------|----------|
22
- | `aria-labelledby` | A visible text element names this element | Highest — overrides aria-label and native label |
23
- | `aria-label` | No visible text label exists (icon buttons, close buttons) | Medium |
24
- | `aria-describedby` | Additional descriptive text supplements the label | Lowest — supplementary, not a primary name |
25
-
26
- Examples:
27
- ```jsx
28
- // Icon button — no visible label
29
- <button aria-label="Close dialog">
30
- <Icon name="x" aria-hidden="true" />
31
- </button>
32
-
33
- // Element labelled by visible heading
34
- <section aria-labelledby="billing-heading">
35
- <h2 id="billing-heading">Billing</h2>
36
- </section>
37
-
38
- // Field with hint text
39
- <input id="password" aria-describedby="password-hint" />
40
- <span id="password-hint">Must be at least 8 characters</span>
41
- ```
42
-
43
- ## Live Regions
44
-
45
- Announce dynamic content changes to screen readers without moving focus.
46
-
47
- | Role / Attribute | Urgency | Use for |
48
- |-----------------|---------|---------|
49
- | `aria-live="polite"` | Waits for user to be idle | Status messages, form validation summaries, search result counts |
50
- | `aria-live="assertive"` | Interrupts immediately | Critical errors, session timeout warnings |
51
- | `role="status"` | Same as `aria-live="polite"` | Status messages (shorthand) |
52
- | `role="alert"` | Same as `aria-live="assertive"` | Error alerts (shorthand) |
53
-
54
- Anti-pattern: using `role="alert"` for non-urgent messages — screen reader interruptions are disruptive. Reserve for true emergencies.
55
-
56
- ```jsx
57
- // Status (polite)
58
- <div role="status" aria-live="polite">{statusMessage}</div>
59
-
60
- // Error (assertive)
61
- <div role="alert">{errorMessage}</div>
62
- ```
63
-
64
- ## Common State Attributes
65
-
66
- | Attribute | Values | Use for |
67
- |-----------|--------|---------|
68
- | `aria-expanded` | `true` / `false` | Disclosure triggers (accordion, dropdown, menu) |
69
- | `aria-pressed` | `true` / `false` / `"mixed"` | Toggle buttons (bold, like, mute) |
70
- | `aria-hidden` | `true` | Decorative elements, icon-only images — removes from accessibility tree |
71
- | `aria-checked` | `true` / `false` / `"mixed"` | Custom checkbox/radio when not using `<input type="checkbox">` |
72
- | `aria-disabled` | `true` | Visually disabled but still focusable (use sparingly) |
73
- | `aria-selected` | `true` / `false` | Selected tab, selected option in listbox |
74
- | `aria-current` | `"page"` / `"step"` / `true` | Current item in nav, current step in wizard |
75
-
76
- ```jsx
77
- // Accordion trigger
78
- <button
79
- aria-expanded={isOpen}
80
- aria-controls="panel-1"
81
- >
82
- Section title
83
- </button>
84
- <div id="panel-1" hidden={!isOpen}>...</div>
85
-
86
- // Toggle button
87
- <button
88
- aria-pressed={isBold}
89
- onClick={() => setIsBold(!isBold)}
90
- >
91
- Bold
92
- </button>
93
-
94
- // Decorative icon
95
- <svg aria-hidden="true" focusable="false">...</svg>
96
- ```
97
-
98
- ## aria-hidden Usage Rules
99
-
100
- - `aria-hidden="true"` removes element and ALL descendants from accessibility tree
101
- - Never place `aria-hidden="true"` on a focusable element (keyboard users still reach it)
102
- - Common correct uses: decorative icons, background images, duplicate visible text (when the accessible name comes from aria-label)
103
-
104
- ```jsx
105
- // Correct: icon inside labelled button
106
- <button aria-label="Delete">
107
- <TrashIcon aria-hidden="true" />
108
- </button>
109
-
110
- // Wrong: aria-hidden on focusable element
111
- <button aria-hidden="true">...</button> // users can still Tab to it
112
- ```
113
-
114
- ## Dialog Pattern
115
-
116
- ```jsx
117
- <dialog
118
- role="dialog"
119
- aria-modal="true"
120
- aria-labelledby="dialog-title"
121
- aria-describedby="dialog-description"
122
- >
123
- <h2 id="dialog-title">Confirm deletion</h2>
124
- <p id="dialog-description">This action cannot be undone.</p>
125
- <button onClick={onConfirm}>Delete</button>
126
- <button onClick={onClose}>Cancel</button>
127
- </dialog>
128
- ```
129
-
130
- Focus must move INTO the dialog on open and RETURN to the trigger on close. See `keyboard-patterns.md` for focus trap implementation.