codebyplan 1.13.21 → 1.13.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/templates/rules/todo-backend.md +3 -3
- package/templates/settings.project.base.json +0 -14
- 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-session-end/SKILL.md +11 -8
- package/templates/skills/cbp-todo/SKILL.md +1 -1
- package/templates/skills/cbp-todo/qa-regression.md +1 -1
package/dist/cli.js
CHANGED
package/package.json
CHANGED
|
@@ -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:*)",
|
|
@@ -145,10 +137,7 @@
|
|
|
145
137
|
"mcp__codebyplan__get_eslint_presets",
|
|
146
138
|
"mcp__codebyplan__get_eslint_repo_config",
|
|
147
139
|
"mcp__codebyplan__get_file_changes",
|
|
148
|
-
"mcp__codebyplan__get_launch",
|
|
149
|
-
"mcp__codebyplan__get_launches",
|
|
150
140
|
"mcp__codebyplan__get_library_doc_job",
|
|
151
|
-
"mcp__codebyplan__get_next_action",
|
|
152
141
|
"mcp__codebyplan__get_repos",
|
|
153
142
|
"mcp__codebyplan__get_rounds",
|
|
154
143
|
"mcp__codebyplan__get_server_config",
|
|
@@ -159,7 +148,6 @@
|
|
|
159
148
|
"mcp__codebyplan__get_task_templates",
|
|
160
149
|
"mcp__codebyplan__get_tasks",
|
|
161
150
|
"mcp__codebyplan__get_todos",
|
|
162
|
-
"mcp__codebyplan__get_work_plan",
|
|
163
151
|
"mcp__codebyplan__get_worktrees",
|
|
164
152
|
"mcp__codebyplan__list_tech_stack_sync_sessions",
|
|
165
153
|
"mcp__codebyplan__get_chunk",
|
|
@@ -184,8 +172,6 @@
|
|
|
184
172
|
"mcp__codebyplan__update_session_state",
|
|
185
173
|
"mcp__codebyplan__create_worktree",
|
|
186
174
|
"mcp__codebyplan__flag_stale_chunk",
|
|
187
|
-
"mcp__codebyplan__list_invites",
|
|
188
|
-
"mcp__codebyplan__list_members",
|
|
189
175
|
"mcp__codebyplan__update_eslint_repo_config",
|
|
190
176
|
"mcp__codebyplan__update_server_config",
|
|
191
177
|
"mcp__codebyplan__update_task_template",
|
|
@@ -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)
|
|
@@ -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).
|
|
@@ -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
|