codebyplan 1.13.41 → 1.13.42
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/skills/cbp-build-cc-skill/SKILL.md +8 -0
- package/templates/skills/cbp-build-cc-skill/reference/frontmatter-fields.md +3 -1
- package/templates/skills/cbp-round-complete/SKILL.md +7 -6
- package/templates/skills/cbp-round-end/SKILL.md +2 -2
- package/templates/skills/cbp-round-update/SKILL.md +7 -6
package/dist/cli.js
CHANGED
package/package.json
CHANGED
|
@@ -76,6 +76,14 @@ Pick the pattern that fits. This drives frontmatter choices:
|
|
|
76
76
|
|
|
77
77
|
Concrete templates: [examples/task-skill.md](examples/task-skill.md), [examples/knowledge-skill.md](examples/knowledge-skill.md), [examples/fork-skill.md](examples/fork-skill.md), [examples/dynamic-context.md](examples/dynamic-context.md).
|
|
78
78
|
|
|
79
|
+
#### Convention: User-only / permission-gated finalizer
|
|
80
|
+
|
|
81
|
+
A Task-pattern skill that must only run on explicit user confirmation is a **permission-gated finalizer**:
|
|
82
|
+
|
|
83
|
+
- MUST carry `disable-model-invocation: true` — the model cannot invoke it; only the user can (via `/skill-name`).
|
|
84
|
+
- Any upstream skill that auto-triggers it MUST instead emit a `Next: /skill-name` directive and STOP — model invocation of a `disable-model-invocation` skill is blocked at the runtime level.
|
|
85
|
+
- Canonical example: `/cbp-round-complete` (the round finalizer). `/cbp-round-update` routes a clean triage via a `Next: /cbp-round-complete` directive and stops — it cannot invoke round-complete directly.
|
|
86
|
+
|
|
79
87
|
### Step 5 — Fill the frontmatter
|
|
80
88
|
|
|
81
89
|
Read `${CLAUDE_SKILL_DIR}/templates/skill.md` as the canonical frontmatter. Fill only the fields you need — every field except `description` is optional, and even `description` falls back to the first markdown paragraph.
|
|
@@ -9,7 +9,7 @@ Source: official Claude Code skills spec. All fields are optional; `description`
|
|
|
9
9
|
| `when_to_use` | Additional trigger phrases. Appended to `description` in the listing |
|
|
10
10
|
| `argument-hint` | Autocomplete hint, e.g. `[issue-number]` |
|
|
11
11
|
| `arguments` | Named positional args, e.g. `[file mode]` → `$file`, `$mode` |
|
|
12
|
-
| `disable-model-invocation` | `true` → only user can invoke (via `/name`) |
|
|
12
|
+
| `disable-model-invocation` | `true` → only user can invoke (via `/name`). Upstream skills that auto-trigger this skill MUST emit a `Next: /name` directive instead — model invocation is blocked by the runtime; see SKILL.md Step 4 "Convention: User-only / permission-gated finalizer" |
|
|
13
13
|
| `user-invocable` | `false` → hidden from `/` menu, Claude-only |
|
|
14
14
|
| `allowed-tools` | Pre-approve tools while the skill is active |
|
|
15
15
|
| `model` | Override model for this skill's turn. **CBP skills normally OMIT this** so the skill inherits the active session model. Pinning a model (e.g. `sonnet`) forces that model and can carry the session's 1M `[1m]` context tier onto the skill, triggering "usage credits required for 1M context". Set it only as a deliberate, documented exception — see [/cbp-build-cc-mode](../../build-cc-mode/SKILL.md) |
|
|
@@ -33,3 +33,5 @@ Total skill-description budget in context: 1% of the context window (fallback 8,
|
|
|
33
33
|
| (default) | Yes | Yes | Description in context; body loads on invoke |
|
|
34
34
|
| `disable-model-invocation: true` | Yes | No | Description NOT in context; body loads on user invoke |
|
|
35
35
|
| `user-invocable: false` | No | Yes | Description in context; body loads on auto-invoke |
|
|
36
|
+
|
|
37
|
+
> **Upstream-directive rule**: a skill with `disable-model-invocation: true` cannot be invoked by another skill. Any upstream skill that auto-triggers it MUST emit a `Next: /skill-name` close-out directive and stop. See "Convention: User-only / permission-gated finalizer" in SKILL.md Step 4 for the full pattern and canonical example.
|
|
@@ -3,6 +3,7 @@ scope: org-shared
|
|
|
3
3
|
name: cbp-round-complete
|
|
4
4
|
description: Reconcile user git-add approvals, complete the round, and route to the next step
|
|
5
5
|
argument-hint: [chk-task-round | task-round]
|
|
6
|
+
disable-model-invocation: true
|
|
6
7
|
triggers: [cbp-task-check, cbp-standalone-task-check, cbp-round-input]
|
|
7
8
|
effort: low
|
|
8
9
|
---
|
|
@@ -28,9 +29,9 @@ Set `KIND` for the rest of this skill. MCP tool names vary by KIND:
|
|
|
28
29
|
|
|
29
30
|
# Round Complete Command
|
|
30
31
|
|
|
31
|
-
The **
|
|
32
|
+
The **user-invoked finalizer** for a round that `/cbp-round-update` triaged as clean. round-complete carries `disable-model-invocation: true`, so the model cannot invoke it — `/cbp-round-update` *directs* the user here with a `Next: /cbp-round-complete` directive, and the user runs it. It reconciles which files the **user** approved via `git add`, completes the round, and routes to the next step.
|
|
32
33
|
|
|
33
|
-
This skill is gated by an `ask`-tier `Skill(cbp-round-complete)` permission rule in `settings.json`. **The permission prompt IS the user confirmation** — there is NO AskUserQuestion inside this skill. If the user declines the permission, the skill does not run: nothing is synced, no round is completed, and the user can stage files and re-invoke
|
|
34
|
+
This skill is gated by an `ask`-tier `Skill(cbp-round-complete)` permission rule in `settings.json`. **The permission prompt IS the user confirmation** on the user's direct invoke — there is NO AskUserQuestion inside this skill. If the user declines the permission, the skill does not run: nothing is synced, no round is completed, and the user can stage files and re-invoke `/cbp-round-complete` when ready.
|
|
34
35
|
|
|
35
36
|
## HARD GATE — Every Step Must Execute
|
|
36
37
|
|
|
@@ -153,16 +154,16 @@ Payload: `round.context.round_complete = { staged_count, unstaged_count, route,
|
|
|
153
154
|
|
|
154
155
|
## Key Rules
|
|
155
156
|
|
|
156
|
-
- **
|
|
157
|
+
- **User-invoked only** — round-complete carries `disable-model-invocation: true`, so the model cannot invoke it. `/cbp-round-update` *directs* the user here on a clean triage (a `Next: /cbp-round-complete` directive); the user runs the skill.
|
|
158
|
+
- **Permission prompt = confirmation** — gated by `ask`-tier `Skill(cbp-round-complete)`. Because the skill is `disable-model-invocation: true`, this gate applies to the user's **direct** `/cbp-round-complete` invocation. NEVER add an AskUserQuestion to confirm running; the harness prompt is the gate. A declined permission is a clean no-op.
|
|
157
159
|
- **Step 2 (CLI) must exit 0** — if it fails, STOP before `complete_round`. The merge semantics are enforced by the CLI.
|
|
158
160
|
- **NEVER ask the user to git add files** — Step 2 only reads staging status. **NEVER stage files** — Claude does not touch the git staging area; the user's `git add` is the approval signal.
|
|
159
161
|
- **standalone KIND Step 3**: `caller_worktree_id` is REQUIRED for `complete_standalone_round` — always resolve and pass it.
|
|
160
|
-
- **Auto-triggered by `/cbp-round-update`** (clean triage), or run manually by the user.
|
|
161
162
|
|
|
162
163
|
## Integration
|
|
163
164
|
|
|
164
|
-
- **Gates**: `ask`-tier `Skill(cbp-round-complete)` permission prompt — the harness confirms before the skill runs; a decline makes NO writes. There is no in-skill AskUserQuestion.
|
|
165
|
-
- **
|
|
165
|
+
- **Gates**: `ask`-tier `Skill(cbp-round-complete)` permission prompt on the user's direct invoke — the harness confirms before the skill runs; a decline makes NO writes. There is no in-skill AskUserQuestion.
|
|
166
|
+
- **Invoked by**: the user only — round-complete carries `disable-model-invocation: true`, so the model cannot invoke it. `/cbp-round-update` *directs* the user here on a clean triage (a `Next: /cbp-round-complete` directive) but does not invoke it.
|
|
166
167
|
- **Reads (checkpoint KIND)**: `.codebyplan/state/checkpoints/<id>.json`, `.codebyplan/state/checkpoints/<id>/tasks/<id>.json`, `.codebyplan/state/checkpoints/<id>/tasks/<id>/rounds/<id>.json` (local-first; run `npx codebyplan sync` if missing; break-glass: MCP `get_current_task` / `get_rounds`). Delegates git+approval sync to `npx codebyplan round sync-approvals`.
|
|
167
168
|
- **Reads (standalone KIND)**: MCP `get_current_standalone_task` / `get_standalone_rounds` (standalone KIND still uses MCP until a later task).
|
|
168
169
|
- **Writes (checkpoint KIND)**: `codebyplan round complete` (Step 3); `codebyplan round update` (Step 4 breadcrumb). Break-glass: MCP `complete_round` / `update_round`. Round+task `files_changed` written by the CLI sync-approvals.
|
|
@@ -141,7 +141,7 @@ Example tables and the in-scope/out-of-scope classification: see `reference/find
|
|
|
141
141
|
- Skip the polish-spiral stop-gate (auto-loop has its own cap-exhausted termination).
|
|
142
142
|
- Skip Step 7's inline auto-apply (findings are deferred to the next loop round, not applied this round).
|
|
143
143
|
- Save findings via `update_round` exactly as in manual mode.
|
|
144
|
-
- Auto-trigger `/cbp-round-update` immediately. round-update triages the round and either routes to `/cbp-round-input` (spawn another round) or `/cbp-round-complete`
|
|
144
|
+
- Auto-trigger `/cbp-round-update` immediately. round-update triages the round and either routes to `/cbp-round-input` (spawn another round) or **directs the user to run** `/cbp-round-complete` on a clean exit — see cbp-round-update SKILL.md Step 2/3.
|
|
145
145
|
|
|
146
146
|
**Else (manual mode — flag absent or false):**
|
|
147
147
|
|
|
@@ -156,7 +156,7 @@ Step 7 already auto-applied in-scope findings and logged them to `round.context.
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
```
|
|
159
|
-
3. Auto-trigger `/cbp-round-update`. round-update triages the round: if out-of-scope findings (or a hard-fail) remain it routes to `/cbp-round-input` (which picks up the findings from round context and includes them in the new round's requirements automatically); if the round is clean it
|
|
159
|
+
3. Auto-trigger `/cbp-round-update`. round-update triages the round: if out-of-scope findings (or a hard-fail) remain it routes to `/cbp-round-input` (which picks up the findings from round context and includes them in the new round's requirements automatically); if the round is clean it **directs the user to run** `/cbp-round-complete` (the user-invoked finalizer that reconciles the user's `git add`s and completes the round).
|
|
160
160
|
|
|
161
161
|
## Key Rules
|
|
162
162
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
scope: org-shared
|
|
3
3
|
name: cbp-round-update
|
|
4
|
-
description: Triage a finished round (Claude-only)
|
|
4
|
+
description: Triage a finished round (Claude-only); direct user to run round-complete on a clean round, or trigger round-input when more work is needed
|
|
5
5
|
argument-hint: [chk-task-round | task-round]
|
|
6
|
-
triggers: [cbp-round-
|
|
6
|
+
triggers: [cbp-round-input]
|
|
7
7
|
effort: low
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -35,7 +35,7 @@ The completion + file-approval reconcile (`sync-approvals`, `complete_round` / `
|
|
|
35
35
|
|
|
36
36
|
## Routing in one line
|
|
37
37
|
|
|
38
|
-
- **Round is clean** →
|
|
38
|
+
- **Round is clean** → **direct the user to run** `/cbp-round-complete` (the user-invoked finalizer reconciles your `git add`s and completes the round; round-update cannot invoke it — round-complete is `disable-model-invocation: true`).
|
|
39
39
|
- **Round needs more work** → trigger `/cbp-round-input` (more changes / planning).
|
|
40
40
|
|
|
41
41
|
## Instructions
|
|
@@ -93,7 +93,7 @@ Display a one-line triage summary, e.g. `"ROUND-N triage: clean"` or `"ROUND-N t
|
|
|
93
93
|
|
|
94
94
|
### Step 3: Route
|
|
95
95
|
|
|
96
|
-
**3a — Clean → `/cbp-round-complete`.**
|
|
96
|
+
**3a — Clean → direct the user to `/cbp-round-complete`.** STOP and surface the directive: `Round clean. Next: run /cbp-round-complete to reconcile your git adds and finalize.` round-update does NOT invoke round-complete — round-complete carries `disable-model-invocation: true`, so only the user can run it (its `ask`-tier permission prompt is the user's confirmation on that direct invoke). Once the user runs it, round-complete reconciles the `git add`s, completes the round, and routes onward (all files staged → task-check; some withheld → round-input). round-update writes nothing here beyond the Step 2 summary. In `auto_loop_mode`, a clean triage is the loop's success exit — the directive applies here too (the user invokes round-complete to finalize); the loop continues only via the not-clean path in 3b, and round-complete owns the degenerate clean-but-unstaged guard.
|
|
97
97
|
|
|
98
98
|
**3b — Not clean → `/cbp-round-input`.** More changes or planning are needed. Routing is **independent of git staging** — round-input is reachable whether or not the user has staged anything (it performs its own deep analysis of the unapproved files). Two sub-cases:
|
|
99
99
|
|
|
@@ -104,7 +104,7 @@ Display a one-line triage summary, e.g. `"ROUND-N triage: clean"` or `"ROUND-N t
|
|
|
104
104
|
|
|
105
105
|
## Key Rules
|
|
106
106
|
|
|
107
|
-
- **Autonomous + Claude-only** — round-update never prompts before running. It is auto-triggered by `/cbp-round-end`.
|
|
107
|
+
- **Autonomous + Claude-only** — round-update never prompts before running. It is auto-triggered by `/cbp-round-end`. On a clean triage it **directs** the user to run `/cbp-round-complete` — it cannot invoke that skill (`disable-model-invocation: true`); the confirmation step is round-complete's own `ask`-tier permission prompt on the user's direct invoke, not an AskUserQuestion here. (The auto-loop cap-exhausted AskUserQuestion in Step 3b is a genuine user decision, not a run gate.)
|
|
108
108
|
- **Triage, never finalize** — round-update does NOT call `sync-approvals`, `complete_round`, or `complete_standalone_round`, and does NOT write file approvals. All of that is `/cbp-round-complete`.
|
|
109
109
|
- **Never touches git** — round-update reads `claude_approved` from the DB only; it never reads staging, asks the user to `git add`, or stages files.
|
|
110
110
|
- **git-add independence** — the "needs more work" route to `/cbp-round-input` fires regardless of whether files are staged. There is no clean-but-unstaged dead-end.
|
|
@@ -117,4 +117,5 @@ Display a one-line triage summary, e.g. `"ROUND-N triage: clean"` or `"ROUND-N t
|
|
|
117
117
|
- **Reads (standalone KIND)**: MCP `get_current_standalone_task`, `get_standalone_rounds` — standalone still uses MCP
|
|
118
118
|
- **Writes (checkpoint KIND)**: `codebyplan round update` — audit only (`auto_loop_decision` / `auto_loop_cap_exhausted`; break-glass: MCP `update_round`). No completion, no file-approval writes.
|
|
119
119
|
- **Writes (standalone KIND)**: MCP `update_standalone_round` — audit only — standalone still uses MCP
|
|
120
|
-
- **Triggers**: `/cbp-round-
|
|
120
|
+
- **Triggers**: `/cbp-round-input` (not-clean triage: outstanding findings, hard-fail, or unapproved Claude checks — fires independent of git staging; also the auto-loop dirty spawn), cap-exhausted prompt routes from Step 3b (any of the three options)
|
|
121
|
+
- **Directs the user to**: `/cbp-round-complete` (clean triage) — round-update cannot invoke it (`disable-model-invocation: true`); it emits a `Next: /cbp-round-complete` directive and the user runs it (its `ask`-tier permission prompt is the confirmation)
|