codebyplan 1.13.21 → 1.13.23
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 +0 -109
- package/dist/cli.js +44 -516
- package/package.json +1 -1
- package/templates/hooks/README.md +2 -52
- package/templates/hooks/cbp-test-hooks.sh +0 -71
- package/templates/hooks/hooks.json +0 -20
- package/templates/rules/todo-backend.md +3 -3
- package/templates/settings.project.base.json +0 -21
- package/templates/skills/cbp-build-cc-settings/reference/cbp-permission-policy.md +1 -1
- package/templates/skills/cbp-checkpoint-create/SKILL.md +2 -2
- package/templates/skills/cbp-round-execute/SKILL.md +0 -18
- package/templates/skills/cbp-session-end/SKILL.md +11 -8
- package/templates/skills/cbp-task-complete/SKILL.md +0 -14
- package/templates/skills/cbp-task-start/SKILL.md +0 -8
- package/templates/skills/cbp-todo/SKILL.md +1 -1
- package/templates/skills/cbp-todo/qa-regression.md +1 -1
- package/templates/hooks/cbp-cmux-branch-watch.sh +0 -39
- package/templates/hooks/cbp-cmux-workspace-sync.sh +0 -19
- package/templates/skills/cbp-setup-cmux/SKILL.md +0 -170
package/package.json
CHANGED
|
@@ -224,63 +224,13 @@ After a `complete_round` MCP call succeeds, reconciles the round's `files_change
|
|
|
224
224
|
|
|
225
225
|
---
|
|
226
226
|
|
|
227
|
-
### `cbp-cmux-workspace-sync.sh` — SessionStart, matcher `*`
|
|
228
|
-
|
|
229
|
-
On every session start, syncs the active [cmux](https://github.com/nicholasgasior/cmux) workspace title to the current git branch, the workspace description to the repo folder basename (the directory that contains `.git/`), and applies the workspace color from `.codebyplan/cmux.json` via `cmux workspace-action --action set-color`. All three actions are delegated to `codebyplan cmux-sync`. If no `workspace_color` is configured, a one-line nudge is printed to stdout prompting the user to run `/cbp-setup-cmux`.
|
|
230
|
-
|
|
231
|
-
**Blocks vs warns**: never blocks — exit 0 on every path. A SessionStart hook must never prevent a session from opening.
|
|
232
|
-
|
|
233
|
-
**Skips when**: `$CMUX_WORKSPACE_ID` is unset (not running inside a cmux workspace). No-ops silently — cmux is an optional integration and repos without it are completely unaffected.
|
|
234
|
-
|
|
235
|
-
**cmux binary resolution order**: `$CMUX_BUNDLED_CLI_PATH` → `$CMUX_CLAUDE_HOOK_CMUX_BIN` → `cmux` on `$PATH`. All three are resolved by the `codebyplan cmux-sync` subcommand; the hook itself does not replicate this logic.
|
|
236
|
-
|
|
237
|
-
**Opt out**: settings.json override removing this entry, or plugin disable.
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
### `cbp-cmux-branch-watch.sh` — PostToolUse, matcher `Bash`
|
|
242
|
-
|
|
243
|
-
After any Bash tool call that contains a `git checkout` or `git switch` invocation, syncs the active cmux workspace title to the current branch and the workspace description to the repo folder basename. The match is broad — it also fires on file-restore forms like `git checkout -- <file>` — but `codebyplan cmux-sync` is idempotent, so a redundant sync on a non-branch-change is harmless, and a real branch change is never missed.
|
|
244
|
-
|
|
245
|
-
**Blocks vs warns**: never blocks — exit 0 on every path. PostToolUse hooks must never abort Claude.
|
|
246
|
-
|
|
247
|
-
**Skips when**: `$CMUX_WORKSPACE_ID` is unset; or the Bash command contains no `git checkout` / `git switch`; or `jq` is not on `$PATH` (safe parse failure → exit 0). Outside cmux or on commands without checkout/switch, the hook exits immediately with no work done.
|
|
248
|
-
|
|
249
|
-
**cmux binary resolution order**: same as `cbp-cmux-workspace-sync.sh` — delegated to `codebyplan cmux-sync`.
|
|
250
|
-
|
|
251
|
-
**Opt out**: settings.json override removing the PostToolUse Bash entry for this hook, or plugin disable.
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
### Auto dev server (`codebyplan cmux-serve`)
|
|
256
|
-
|
|
257
|
-
At the start of each round, `cbp-round-execute` (Step 2a) calls `codebyplan cmux-serve --files "<round files>"` to auto-start the dev server for any app whose source files are touched. The subcommand probes each allocated port via `node:net`, starts a `cmux new-split` terminal pane + sends the dev command for any non-listening app, then opens a browser pane. If the port is already listening (another worktree) it only opens the browser pane. No hook registration is needed — the skill invokes the subcommand directly. Gated by `auto_dev_server` in `.codebyplan/cmux.json`; no-op outside cmux.
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
### Status surface (`codebyplan cmux-status`)
|
|
262
|
-
|
|
263
|
-
The lifecycle skills push CodeByPlan development state into the cmux workspace sidebar via `codebyplan cmux-status`. No hook registration is needed — the skills invoke the subcommand directly:
|
|
264
|
-
|
|
265
|
-
| Skill | What is pushed |
|
|
266
|
-
| --- | --- |
|
|
267
|
-
| `cbp-task-start` (Step 4.5) | `--checkpoint "CHK-NNN: title" --task "TASK-N: title"` |
|
|
268
|
-
| `cbp-task-complete` (Step 7.3) | `--task "TASK-N: title done" --progress completed/total` |
|
|
269
|
-
| `cbp-round-execute` (Step 3d) | `--qa "R{n} {status}"` where status ∈ completed / blocked / re-triggering |
|
|
270
|
-
|
|
271
|
-
**`auto_status` toggle.** Gated by the `auto_status` field in `.codebyplan/cmux.json` (configured via `/cbp-setup-cmux`). When `auto_status` is `false`, every call is a no-op. Default is `true` (enabled).
|
|
272
|
-
|
|
273
|
-
**No-op outside cmux.** `codebyplan cmux-status` checks for `$CMUX_WORKSPACE_ID` before doing anything. Outside a cmux workspace it exits immediately — safe to call unconditionally from skills and hooks.
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
227
|
## Supporting (not registered)
|
|
278
228
|
|
|
279
229
|
### `test-hooks.sh` — invoked by `auto-test-hooks.sh`
|
|
280
230
|
|
|
281
|
-
Test suite for the plugin's
|
|
231
|
+
Test suite for the plugin's 9 registered hooks. Runs two passes:
|
|
282
232
|
|
|
283
|
-
1. **Header check** — every registered hook (`lint-format-on-edit`, `test-coverage-gate`, `pre-commit-quality-gate`, `maestro-yaml-validate`, `auto-test-hooks`, `mcp-migration-guard`, `validate-git-stash-deny`, `cbp-mcp-round-sync
|
|
233
|
+
1. **Header check** — every registered hook (`lint-format-on-edit`, `test-coverage-gate`, `pre-commit-quality-gate`, `maestro-yaml-validate`, `auto-test-hooks`, `mcp-migration-guard`, `validate-git-stash-deny`, `cbp-mcp-round-sync`) carries the required `# Hook:` and `# Purpose:` header comments. `statusline` uses its own `# Claude Code Status Line` marker.
|
|
284
234
|
2. **Functional smoke tests** — each hook is invoked with synthetic stdin matching its fast-path / graceful-degrade input; all must exit 0.
|
|
285
235
|
|
|
286
236
|
Not in `hooks.json` — invoked indirectly via `auto-test-hooks.sh` on hook edits, or directly via `bash ${CLAUDE_PLUGIN_ROOT}/hooks/test-hooks.sh`.
|
|
@@ -255,77 +255,6 @@ fi
|
|
|
255
255
|
|
|
256
256
|
echo ""
|
|
257
257
|
|
|
258
|
-
# ===== HOOK SMOKE TESTS — cbp-cmux-workspace-sync + cbp-cmux-branch-watch =====
|
|
259
|
-
echo "## Hook Smoke Tests — cbp-cmux-workspace-sync + cbp-cmux-branch-watch (CHK-162)"
|
|
260
|
-
|
|
261
|
-
# --- cbp-cmux-workspace-sync.sh ---
|
|
262
|
-
|
|
263
|
-
if [ ! -f "$HOOKS_DIR/cbp-cmux-workspace-sync.sh" ]; then
|
|
264
|
-
test_result "cbp-cmux-workspace-sync.sh present" "passed" "missing"
|
|
265
|
-
else
|
|
266
|
-
test_result "cbp-cmux-workspace-sync.sh present" "passed" "passed"
|
|
267
|
-
|
|
268
|
-
FIRST_LINE=$(head -1 "$HOOKS_DIR/cbp-cmux-workspace-sync.sh")
|
|
269
|
-
if echo "$FIRST_LINE" | grep -q '^#!/'; then
|
|
270
|
-
test_result "cbp-cmux-workspace-sync.sh has shebang" "passed" "passed"
|
|
271
|
-
else
|
|
272
|
-
test_result "cbp-cmux-workspace-sync.sh has shebang" "passed" "missing"
|
|
273
|
-
fi
|
|
274
|
-
|
|
275
|
-
if grep -q '@scope: org-shared' "$HOOKS_DIR/cbp-cmux-workspace-sync.sh"; then
|
|
276
|
-
test_result "cbp-cmux-workspace-sync.sh has @scope: org-shared" "passed" "passed"
|
|
277
|
-
else
|
|
278
|
-
test_result "cbp-cmux-workspace-sync.sh has @scope: org-shared" "passed" "missing"
|
|
279
|
-
fi
|
|
280
|
-
|
|
281
|
-
# Graceful-degrade: CMUX_WORKSPACE_ID unset → fast-path exit 0, no output
|
|
282
|
-
ACTUAL_EXIT=$(env -u CMUX_WORKSPACE_ID bash "$HOOKS_DIR/cbp-cmux-workspace-sync.sh" <<< '{}' >/dev/null 2>&1; echo $?)
|
|
283
|
-
if [ "$ACTUAL_EXIT" = "0" ]; then
|
|
284
|
-
test_result "cbp-cmux-workspace-sync.sh graceful-degrade (no CMUX_WORKSPACE_ID) exits 0" "passed" "passed"
|
|
285
|
-
else
|
|
286
|
-
test_result "cbp-cmux-workspace-sync.sh graceful-degrade (no CMUX_WORKSPACE_ID) exits 0" "passed" "failed"
|
|
287
|
-
fi
|
|
288
|
-
fi
|
|
289
|
-
|
|
290
|
-
# --- cbp-cmux-branch-watch.sh ---
|
|
291
|
-
|
|
292
|
-
if [ ! -f "$HOOKS_DIR/cbp-cmux-branch-watch.sh" ]; then
|
|
293
|
-
test_result "cbp-cmux-branch-watch.sh present" "passed" "missing"
|
|
294
|
-
else
|
|
295
|
-
test_result "cbp-cmux-branch-watch.sh present" "passed" "passed"
|
|
296
|
-
|
|
297
|
-
FIRST_LINE=$(head -1 "$HOOKS_DIR/cbp-cmux-branch-watch.sh")
|
|
298
|
-
if echo "$FIRST_LINE" | grep -q '^#!/'; then
|
|
299
|
-
test_result "cbp-cmux-branch-watch.sh has shebang" "passed" "passed"
|
|
300
|
-
else
|
|
301
|
-
test_result "cbp-cmux-branch-watch.sh has shebang" "passed" "missing"
|
|
302
|
-
fi
|
|
303
|
-
|
|
304
|
-
if grep -q '@scope: org-shared' "$HOOKS_DIR/cbp-cmux-branch-watch.sh"; then
|
|
305
|
-
test_result "cbp-cmux-branch-watch.sh has @scope: org-shared" "passed" "passed"
|
|
306
|
-
else
|
|
307
|
-
test_result "cbp-cmux-branch-watch.sh has @scope: org-shared" "passed" "missing"
|
|
308
|
-
fi
|
|
309
|
-
|
|
310
|
-
# Graceful-degrade: CMUX_WORKSPACE_ID unset → fast-path exit 0
|
|
311
|
-
ACTUAL_EXIT=$(env -u CMUX_WORKSPACE_ID bash "$HOOKS_DIR/cbp-cmux-branch-watch.sh" <<< '{"tool_input":{"command":"git checkout main"}}' >/dev/null 2>&1; echo $?)
|
|
312
|
-
if [ "$ACTUAL_EXIT" = "0" ]; then
|
|
313
|
-
test_result "cbp-cmux-branch-watch.sh graceful-degrade (no CMUX_WORKSPACE_ID) exits 0" "passed" "passed"
|
|
314
|
-
else
|
|
315
|
-
test_result "cbp-cmux-branch-watch.sh graceful-degrade (no CMUX_WORKSPACE_ID) exits 0" "passed" "failed"
|
|
316
|
-
fi
|
|
317
|
-
|
|
318
|
-
# Non-checkout command → no-op exit 0 (even with CMUX_WORKSPACE_ID set, non-checkout should skip sync)
|
|
319
|
-
ACTUAL_EXIT=$(CMUX_WORKSPACE_ID=test-ws bash "$HOOKS_DIR/cbp-cmux-branch-watch.sh" <<< '{"tool_input":{"command":"git status"}}' >/dev/null 2>&1; echo $?)
|
|
320
|
-
if [ "$ACTUAL_EXIT" = "0" ]; then
|
|
321
|
-
test_result "cbp-cmux-branch-watch.sh non-checkout command exits 0" "passed" "passed"
|
|
322
|
-
else
|
|
323
|
-
test_result "cbp-cmux-branch-watch.sh non-checkout command exits 0" "passed" "failed"
|
|
324
|
-
fi
|
|
325
|
-
fi
|
|
326
|
-
|
|
327
|
-
echo ""
|
|
328
|
-
|
|
329
258
|
# ===== SUMMARY =====
|
|
330
259
|
echo "=== TEST SUMMARY ==="
|
|
331
260
|
echo -e "Passed: ${GREEN}$PASSED${NC}"
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"hooks": {
|
|
3
|
-
"SessionStart": [
|
|
4
|
-
{
|
|
5
|
-
"matcher": "*",
|
|
6
|
-
"hooks": [
|
|
7
|
-
{
|
|
8
|
-
"type": "command",
|
|
9
|
-
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/cbp-cmux-workspace-sync.sh"
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
3
|
"PreToolUse": [
|
|
15
4
|
{
|
|
16
5
|
"matcher": "Edit|Write|MultiEdit",
|
|
@@ -70,15 +59,6 @@
|
|
|
70
59
|
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/cbp-mcp-round-sync.sh"
|
|
71
60
|
}
|
|
72
61
|
]
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"matcher": "Bash",
|
|
76
|
-
"hooks": [
|
|
77
|
-
{
|
|
78
|
-
"type": "command",
|
|
79
|
-
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/cbp-cmux-branch-watch.sh"
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
62
|
}
|
|
83
63
|
]
|
|
84
64
|
}
|
|
@@ -9,7 +9,7 @@ paths:
|
|
|
9
9
|
|
|
10
10
|
# Todo backend — queue contract, invariants, and writer obligations
|
|
11
11
|
|
|
12
|
-
The todos queue is materialised by `apps/todo-worker` (CHK-122) and consumed by `/cbp-todo`
|
|
12
|
+
The todos queue is materialised by `apps/todo-worker` (CHK-122) and consumed by `/cbp-todo` (via `mcp__codebyplan__get_todos`). This rule documents what every contributor to the MCP write tools, the worker, or the SQL schema must respect.
|
|
13
13
|
|
|
14
14
|
## 1. Six workflow invariants — DB-layer guards, never bypassable
|
|
15
15
|
|
|
@@ -46,7 +46,7 @@ MCP write → enqueueTodoJob → todos_jobs (status='pending')
|
|
|
46
46
|
|
|
47
47
|
## 3. Priority sort_order bands
|
|
48
48
|
|
|
49
|
-
The worker emits todos with these `sort_order` ranges. Lower = surfaces first in
|
|
49
|
+
The worker emits todos with these `sort_order` ranges. Lower = surfaces first in the todo queue.
|
|
50
50
|
|
|
51
51
|
| Band | sort_order | State |
|
|
52
52
|
|------|-----------|-------|
|
|
@@ -59,7 +59,7 @@ The worker emits todos with these `sort_order` ranges. Lower = surfaces first in
|
|
|
59
59
|
|
|
60
60
|
## 4. Command + args mapping
|
|
61
61
|
|
|
62
|
-
`
|
|
62
|
+
The queue head (`get_todos` `rows[0]`) maps to one of these slash commands. The worker stamps `command` + `metadata.context` based on workflow state:
|
|
63
63
|
|
|
64
64
|
| State | Command | Required context |
|
|
65
65
|
|-------|---------|------------------|
|
|
@@ -61,19 +61,11 @@
|
|
|
61
61
|
"Skill(cbp-standalone-task-create)",
|
|
62
62
|
"Skill(cbp-standalone-task-start)",
|
|
63
63
|
"Skill(cbp-standalone-task-complete)",
|
|
64
|
-
"mcp__codebyplan__accept_invite",
|
|
65
|
-
"mcp__codebyplan__change_role",
|
|
66
|
-
"mcp__codebyplan__create_launch",
|
|
67
|
-
"mcp__codebyplan__update_launch",
|
|
68
|
-
"mcp__codebyplan__delete_launch",
|
|
69
64
|
"mcp__codebyplan__create_organization",
|
|
70
65
|
"mcp__codebyplan__create_project",
|
|
71
66
|
"mcp__codebyplan__create_repo",
|
|
72
67
|
"mcp__codebyplan__delete_session_log",
|
|
73
68
|
"mcp__codebyplan__delete_worktree",
|
|
74
|
-
"mcp__codebyplan__invite_member",
|
|
75
|
-
"mcp__codebyplan__remove_member",
|
|
76
|
-
"mcp__codebyplan__revoke_invite",
|
|
77
69
|
"mcp__codebyplan__release_assignment",
|
|
78
70
|
"Bash(codebyplan setup:*)",
|
|
79
71
|
"Bash(npx codebyplan setup:*)",
|
|
@@ -126,7 +118,6 @@
|
|
|
126
118
|
"Skill(cbp-round-input)",
|
|
127
119
|
"Skill(cbp-round-start)",
|
|
128
120
|
"Skill(cbp-session-start)",
|
|
129
|
-
"Skill(cbp-setup-cmux)",
|
|
130
121
|
"Skill(cbp-setup-e2e)",
|
|
131
122
|
"Skill(cbp-setup-eslint)",
|
|
132
123
|
"Skill(cbp-ship-configure)",
|
|
@@ -145,10 +136,7 @@
|
|
|
145
136
|
"mcp__codebyplan__get_eslint_presets",
|
|
146
137
|
"mcp__codebyplan__get_eslint_repo_config",
|
|
147
138
|
"mcp__codebyplan__get_file_changes",
|
|
148
|
-
"mcp__codebyplan__get_launch",
|
|
149
|
-
"mcp__codebyplan__get_launches",
|
|
150
139
|
"mcp__codebyplan__get_library_doc_job",
|
|
151
|
-
"mcp__codebyplan__get_next_action",
|
|
152
140
|
"mcp__codebyplan__get_repos",
|
|
153
141
|
"mcp__codebyplan__get_rounds",
|
|
154
142
|
"mcp__codebyplan__get_server_config",
|
|
@@ -159,7 +147,6 @@
|
|
|
159
147
|
"mcp__codebyplan__get_task_templates",
|
|
160
148
|
"mcp__codebyplan__get_tasks",
|
|
161
149
|
"mcp__codebyplan__get_todos",
|
|
162
|
-
"mcp__codebyplan__get_work_plan",
|
|
163
150
|
"mcp__codebyplan__get_worktrees",
|
|
164
151
|
"mcp__codebyplan__list_tech_stack_sync_sessions",
|
|
165
152
|
"mcp__codebyplan__get_chunk",
|
|
@@ -184,8 +171,6 @@
|
|
|
184
171
|
"mcp__codebyplan__update_session_state",
|
|
185
172
|
"mcp__codebyplan__create_worktree",
|
|
186
173
|
"mcp__codebyplan__flag_stale_chunk",
|
|
187
|
-
"mcp__codebyplan__list_invites",
|
|
188
|
-
"mcp__codebyplan__list_members",
|
|
189
174
|
"mcp__codebyplan__update_eslint_repo_config",
|
|
190
175
|
"mcp__codebyplan__update_server_config",
|
|
191
176
|
"mcp__codebyplan__update_task_template",
|
|
@@ -193,12 +178,6 @@
|
|
|
193
178
|
"Bash(npx codebyplan whoami:*)",
|
|
194
179
|
"Bash(codebyplan resolve-worktree:*)",
|
|
195
180
|
"Bash(npx codebyplan resolve-worktree:*)",
|
|
196
|
-
"Bash(codebyplan cmux-sync:*)",
|
|
197
|
-
"Bash(npx codebyplan cmux-sync:*)",
|
|
198
|
-
"Bash(codebyplan cmux-status:*)",
|
|
199
|
-
"Bash(npx codebyplan cmux-status:*)",
|
|
200
|
-
"Bash(codebyplan cmux-serve:*)",
|
|
201
|
-
"Bash(npx codebyplan cmux-serve:*)",
|
|
202
181
|
"Bash(codebyplan version-status:*)",
|
|
203
182
|
"Bash(npx codebyplan version-status:*)",
|
|
204
183
|
"Bash(codebyplan statusline:*)",
|
|
@@ -31,7 +31,7 @@ Precedence is `deny > ask > allow`; arrays union across scopes (managed/user/pro
|
|
|
31
31
|
|
|
32
32
|
- **Production-shipment skills**: `cbp-ship`, `cbp-ship-main`, `cbp-checkpoint-end` — these promote/deploy to production, so they prompt even in an otherwise auto-allowed setup.
|
|
33
33
|
- **Lifecycle / state-transition skills**: `cbp-checkpoint-start`, `cbp-checkpoint-create`, `cbp-checkpoint-check`, `cbp-checkpoint-complete`, `cbp-round-update`, `cbp-session-end`, `cbp-task-complete`, `cbp-standalone-task-create`, `cbp-standalone-task-start`, `cbp-standalone-task-complete` — these open or close checkpoints, tasks, rounds, and sessions (advancing workflow state in the database), so they stop for explicit confirmation rather than running autonomously.
|
|
34
|
-
- **Destructive / admin
|
|
34
|
+
- **Destructive / admin MCP tools**: `delete_session_log`, `delete_worktree`, `create_repo`, `release_assignment`. (The launch and member-admin tools were dropped from the MCP surface in CHK-180 — those concerns are web-app only now.)
|
|
35
35
|
- **Mutating / external / clobber-risk CLI commands** (both prefixes): `setup`, `login`, `logout`, `upgrade-auth`, `config` (can overwrite committed `.codebyplan/` files), `branch` (rewrites branch config), `ship`, `claude` (`install`/`update`/`uninstall` overwrite `.claude/`).
|
|
36
36
|
|
|
37
37
|
### `deny` — unchanged
|
|
@@ -20,7 +20,7 @@ Runs INLINE. This is the **mechanical** stage only: capture raw user input, infe
|
|
|
20
20
|
|
|
21
21
|
### Step 1: Check for Existing Checkpoint Data
|
|
22
22
|
|
|
23
|
-
Source `repo_id` from `.codebyplan/repo.json`. If `$ARGUMENTS` contains a checkpoint number,
|
|
23
|
+
Source `repo_id` from `.codebyplan/repo.json`. If `$ARGUMENTS` contains a checkpoint number, load it via MCP `get_checkpoints`. If the checkpoint already has `ideas[]` with descriptions, reuse `ideas[].description` (do not re-ask) and skip Step 2.
|
|
24
24
|
|
|
25
25
|
### Step 2: Get Checkpoint Description
|
|
26
26
|
|
|
@@ -113,6 +113,6 @@ Auto-trigger `/cbp-checkpoint-plan {NNN}` in the same context. This skill create
|
|
|
113
113
|
## Integration
|
|
114
114
|
|
|
115
115
|
- **Runs inline**: mechanical setup only — no assessment, research, Q&A, plan, or tasks
|
|
116
|
-
- **Reads**: MCP `
|
|
116
|
+
- **Reads**: MCP `get_checkpoints`; `.codebyplan/repo.json`, `.codebyplan/git.json`; `npx codebyplan resolve-worktree`
|
|
117
117
|
- **Writes**: MCP `create_checkpoint` (description-only ideas + deadline + optional worktree_id), `update_checkpoint` (branch_name)
|
|
118
118
|
- **Triggers**: `/cbp-checkpoint-plan` (auto)
|
|
@@ -57,16 +57,6 @@ Read the plan from round context (`context.planner_output`). If no plan: `No app
|
|
|
57
57
|
|
|
58
58
|
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.
|
|
59
59
|
|
|
60
|
-
### Step 2a: Auto-Dev-Server (cmux)
|
|
61
|
-
|
|
62
|
-
Fire the dev-server hook at round-execution start. Self-no-ops outside cmux or when `auto_dev_server` is disabled in `.codebyplan/cmux.json`.
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
npx codebyplan cmux-serve --files "<comma-separated approved_plan.files_to_modify[].path>"
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
The subcommand reads `.codebyplan/server.json` `port_allocations[]`, resolves which apps' source dirs intersect the round's files, probes each allocated port, and starts a cmux terminal split + browser pane for any app not already serving. Idempotent — if the port is already listening it only opens the browser pane (mitigating the multi-worktree port collision).
|
|
69
|
-
|
|
70
60
|
### Step 3: Route Execution Path
|
|
71
61
|
|
|
72
62
|
Inspect `approved_plan.files_to_modify[]` and `approved_plan.round_type`. Four execution paths exist; pick the one that matches BEFORE Step 3a/3b.
|
|
@@ -153,14 +143,6 @@ If the approved plan includes database schema changes, RLS policies, or type gen
|
|
|
153
143
|
- `status: 'blocked'` → present blocker to user via AskUserQuestion, resolve, re-spawn executor with remaining work
|
|
154
144
|
- Deliverables incomplete → re-spawn executor with remaining deliverables (max 3 re-triggers). After 3 re-triggers, save partial output and proceed.
|
|
155
145
|
|
|
156
|
-
### Step 3d: Push cmux QA Status
|
|
157
|
-
|
|
158
|
-
Push the round's QA outcome to the cmux workspace sidebar. Self-no-ops outside cmux or when `auto_status` is disabled. Status is one of: `completed`, `blocked`, or `re-triggering`.
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
npx codebyplan cmux-status --qa "R{round_number} {status}"
|
|
162
|
-
```
|
|
163
|
-
|
|
164
146
|
### Step 4: Dev-Server Probe (rounds 2+, web/desktop profile)
|
|
165
147
|
|
|
166
148
|
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).
|
|
@@ -27,18 +27,21 @@ Always write a session log for this session — **even if empty**. `/cbp-session
|
|
|
27
27
|
|
|
28
28
|
Snapshot the current next-action so the next `/cbp-session-start` (Step 4.5) can auto-resume. The handoff write-path + payload shape are specified inline here and in `/cbp-session-start` Step 4.5 (freshness gate).
|
|
29
29
|
|
|
30
|
-
1. Call MCP `
|
|
31
|
-
2. If
|
|
30
|
+
1. Call MCP `get_todos({ repo_id, worktree_id })` and take the queue head `rows[0]` (rows are ordered by `sort_order`; `rows[0]` is the current next-action). The worker stamps `command`, `instructions`, `state`, and the entity ids `checkpoint_id` / `task_id` / `round_id` on every row.
|
|
31
|
+
2. If `rows[0]` exists and its `command` is non-empty (active work in flight):
|
|
32
32
|
```yaml
|
|
33
33
|
handoff:
|
|
34
|
-
command: <
|
|
35
|
-
instructions: <
|
|
36
|
-
state: <
|
|
37
|
-
context:
|
|
34
|
+
command: <rows[0].command> # e.g. "/cbp-round-update"
|
|
35
|
+
instructions: <rows[0].instructions> # human-readable trigger reason
|
|
36
|
+
state: <rows[0].state> # workflow state label
|
|
37
|
+
context: # entity ids used by the Step 4.5 freshness probe
|
|
38
|
+
checkpoint_id: <rows[0].checkpoint_id>
|
|
39
|
+
task_id: <rows[0].task_id>
|
|
40
|
+
round_id: <rows[0].round_id>
|
|
38
41
|
captured_at: <ISO now> # for entity-drift freshness comparison
|
|
39
42
|
captured_session_log_id: <current session log id>
|
|
40
43
|
```
|
|
41
|
-
3. If `command` is empty / idle
|
|
44
|
+
3. If the queue is empty or `rows[0].command` is empty / idle: set `handoff = null` so the next session's probe falls through to `/cbp-todo`.
|
|
42
45
|
4. Hold `handoff` in context for Step 1's `update_session_log` call below — it ships in the same write as `ended_at` and `summary`.
|
|
43
46
|
|
|
44
47
|
Continuing Step 1:
|
|
@@ -157,7 +160,7 @@ You can close this window.
|
|
|
157
160
|
## Integration
|
|
158
161
|
|
|
159
162
|
- **Triggered by**: user invocation (prompted by `/cbp-todo` when no work remains)
|
|
160
|
-
- **Reads**: `.codebyplan/repo.json`, `.codebyplan/git.json` (`branch_config.production` for the Step 1.6 home-branch fast-forward), MCP `get_session_logs` (resolve current log), MCP `get_current_task`, MCP `get_rounds`, MCP `
|
|
163
|
+
- **Reads**: `.codebyplan/repo.json`, `.codebyplan/git.json` (`branch_config.production` for the Step 1.6 home-branch fast-forward), MCP `get_session_logs` (resolve current log), MCP `get_current_task`, MCP `get_rounds`, MCP `get_todos` (Step 1.3 handoff snapshot — queue head `rows[0]`); `npx codebyplan version-status` (Step 1.7 package-freshness gate)
|
|
161
164
|
- **Writes**: MCP `update_session_log` (with `ended_at` + `handoff` per TASK-2 alias surface; or `create_session_log` fallback), MCP `update_session_state` (deactivate)
|
|
162
165
|
- **Spawns**: none
|
|
163
166
|
- **Triggers**: none at the skill-contract level. Step 1.5 may invoke `/cbp-git-commit` inline on user approval; Step 1.7 may invoke `/cbp-git-commit` on the `newer:true AND guarded:false` update path (committing changed `.claude/` and `.codebyplan/` paths).
|
|
@@ -138,20 +138,6 @@ Skip the push only when nothing was committed in Step 5 AND `/cbp-merge-main` re
|
|
|
138
138
|
|
|
139
139
|
Call `complete_task(task_id)`. The server resolves the caller's worktree identity from the JWT/ctx and enforces the mutate-lock (CHK-140 TASK-3 — `caller_worktree_id` input field removed). The server auto-clears `assigned_user_id` + `assigned_worktree_id` on the task; if this was the last sibling task, it also clears the parent checkpoint's assignment. (Per CHK-104 hard-lock.)
|
|
140
140
|
|
|
141
|
-
### Step 7.3: Push cmux Status (task done + progress)
|
|
142
|
-
|
|
143
|
-
Push completion status and checkpoint progress to the cmux workspace sidebar. Self-no-ops outside cmux or when `auto_status` is disabled.
|
|
144
|
-
|
|
145
|
-
Compute progress from the `get_tasks` data already loaded by the routing step: `completed = count of tasks with status 'completed'`, `total = total task count for the checkpoint`. For standalone tasks (no checkpoint), omit `--progress`.
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
# Checkpoint-bound task:
|
|
149
|
-
npx codebyplan cmux-status --task "TASK-{N}: {task-title} done" --progress {completed}/{total}
|
|
150
|
-
|
|
151
|
-
# Standalone task:
|
|
152
|
-
npx codebyplan cmux-status --task "TASK-{N}: {task-title} done"
|
|
153
|
-
```
|
|
154
|
-
|
|
155
141
|
### Step 8: Run Cleanup + Migration (inline)
|
|
156
142
|
|
|
157
143
|
Apply the `cleanup` skill inline to remove orphan references to deleted/modified files. Then apply `migration` to propagate renames/moves to consumers. Both run without sub-agent spawns. Skip cleanup if no deletions/modifications; skip migration if cleanup handled everything.
|
|
@@ -228,14 +228,6 @@ Display context summary:
|
|
|
228
228
|
- **Previous rounds**: [count] completed
|
|
229
229
|
```
|
|
230
230
|
|
|
231
|
-
### Step 4.5: Push cmux Status
|
|
232
|
-
|
|
233
|
-
Push the active checkpoint and task context to the cmux workspace sidebar. Self-no-ops outside cmux or when `auto_status` is disabled in `.codebyplan/cmux.json`.
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
npx codebyplan cmux-status --checkpoint "CHK-{NNN}: {checkpoint-title}" --task "TASK-{N}: {task-title}"
|
|
237
|
-
```
|
|
238
|
-
|
|
239
231
|
### Step 5: Set Task Status
|
|
240
232
|
|
|
241
233
|
Use MCP `update_task(task_id, status: "in_progress")`.
|
|
@@ -44,7 +44,7 @@ With `USER_ID` resolved, call MCP `get_todos({ repo_id, user_id, worktree_id })`
|
|
|
44
44
|
|
|
45
45
|
- The head carries `command`, `instructions`, `state`, `metadata`, `worktree_id`, `checkpoint_id`, `task_id`.
|
|
46
46
|
- The routing context (checkpoint/task) lives in **`rows[0].metadata`**.
|
|
47
|
-
- `get_todos` is **pure-read** — `apps/todo-worker` is the sole regen authority. NEVER call `
|
|
47
|
+
- `get_todos` is **pure-read** — `apps/todo-worker` is the sole regen authority. NEVER call `regenerate_todos_for_repo`.
|
|
48
48
|
- Empty array, or `USER_ID` unavailable → go to Step 3 (empty-queue fallback).
|
|
49
49
|
|
|
50
50
|
Queue `command` values may use the `/codebyplan:<name>` plugin-namespace form (e.g. `/codebyplan:round-start`); treat each as the matching `/cbp-<name>` skill for the Step 2 matrix.
|
|
@@ -12,7 +12,7 @@ Repo under test: `2ff6d405-39c5-47b8-a6d1-59f998ac0537`. Resolve a real `user_id
|
|
|
12
12
|
|
|
13
13
|
## Preconditions
|
|
14
14
|
|
|
15
|
-
- `get_todos` is the only Step 1 read — confirm no `
|
|
15
|
+
- `get_todos` is the only Step 1 read — confirm no `regenerate_todos_for_repo` call remains (`grep -n 'regenerate_todos_for_repo' SKILL.md` → no hits).
|
|
16
16
|
- Step 0 uses `resolve-worktree --json` and `whoami --json`.
|
|
17
17
|
|
|
18
18
|
## Scenario A — caller owns the work → auto-trigger
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# @scope: org-shared
|
|
3
|
-
# Hook: PostToolUse Bash
|
|
4
|
-
# Purpose: After a Bash tool call that contains a git checkout or git switch command,
|
|
5
|
-
# sync the active cmux workspace title to the current git branch and the
|
|
6
|
-
# workspace description to the repo folder basename.
|
|
7
|
-
# Delegates entirely to `codebyplan cmux-sync` — no cmux or git logic here.
|
|
8
|
-
# Matching is broad: it also fires on file-restore forms such as
|
|
9
|
-
# `git checkout -- <file>`. That is intentional — `codebyplan cmux-sync` is
|
|
10
|
-
# idempotent, so a redundant sync on a non-branch-change is harmless, and the
|
|
11
|
-
# broad match guarantees a real branch change is never missed.
|
|
12
|
-
# No-ops silently when CMUX_WORKSPACE_ID is unset or the command contains no
|
|
13
|
-
# checkout/switch. Exit 0 on every path — never blocks tool execution.
|
|
14
|
-
|
|
15
|
-
# Fast-path: skip npx spawn when clearly not in a cmux workspace.
|
|
16
|
-
[ -n "$CMUX_WORKSPACE_ID" ] || exit 0
|
|
17
|
-
|
|
18
|
-
# Parse stdin — PostToolUse hooks receive JSON on stdin.
|
|
19
|
-
# Guard against jq absence: if jq is not available the whole block is skipped.
|
|
20
|
-
if command -v jq >/dev/null 2>&1; then
|
|
21
|
-
INPUT=$(cat 2>/dev/null || true)
|
|
22
|
-
CMD=$(echo "$INPUT" | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
23
|
-
|
|
24
|
-
# Run the sync when the command contains git checkout/switch. Broad match by design:
|
|
25
|
-
# also catches file-restore forms (e.g. `git checkout -- <file>`); cmux-sync is
|
|
26
|
-
# idempotent so a redundant sync is harmless, and a real branch change is never missed.
|
|
27
|
-
if ! echo "$CMD" | grep -qE 'git[[:space:]]+(checkout|switch)' 2>/dev/null; then
|
|
28
|
-
exit 0
|
|
29
|
-
fi
|
|
30
|
-
else
|
|
31
|
-
# jq not available — drain stdin and skip.
|
|
32
|
-
cat >/dev/null 2>&1 || true
|
|
33
|
-
exit 0
|
|
34
|
-
fi
|
|
35
|
-
|
|
36
|
-
# Delegate to the CLI subcommand (self-no-ops when cmux binary is absent).
|
|
37
|
-
npx codebyplan cmux-sync >/dev/null 2>&1 || true
|
|
38
|
-
|
|
39
|
-
exit 0
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# @scope: org-shared
|
|
3
|
-
# Hook: SessionStart
|
|
4
|
-
# Purpose: On session start, sync the active cmux workspace title to the current git branch
|
|
5
|
-
# and the workspace description to the repo folder basename.
|
|
6
|
-
# Delegates entirely to `codebyplan cmux-sync` — no cmux or git logic here.
|
|
7
|
-
# No-ops silently when CMUX_WORKSPACE_ID is unset (not inside a cmux workspace).
|
|
8
|
-
# Exit 0 on every path — never blocks session start.
|
|
9
|
-
|
|
10
|
-
# Fast-path: skip npx spawn when clearly not in a cmux workspace.
|
|
11
|
-
[ -n "$CMUX_WORKSPACE_ID" ] || exit 0
|
|
12
|
-
|
|
13
|
-
# Drain stdin — SessionStart hooks receive JSON on stdin; we don't use it.
|
|
14
|
-
cat >/dev/null 2>&1
|
|
15
|
-
|
|
16
|
-
# Delegate to the CLI subcommand (self-no-ops when cmux binary is absent).
|
|
17
|
-
npx codebyplan cmux-sync >/dev/null 2>&1 || true
|
|
18
|
-
|
|
19
|
-
exit 0
|