create-claude-cabinet 0.32.0 → 0.33.1
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/lib/cli.js +5 -2
- package/lib/engagement-setup.js +61 -0
- package/package.json +1 -1
- package/templates/README.md +1 -1
- package/templates/cabinet/checkpoint-protocol.md +48 -0
- package/templates/engagement/pib-db-patches/pib-db-lib.mjs +685 -0
- package/templates/engagement/pib-db-patches/pib-db-mcp-server.mjs +443 -0
- package/templates/engagement/pib-db-patches/pib-db-schema.sql +129 -0
- package/templates/engagement/pib-db-patches/pib-db.mjs +239 -0
- package/templates/hooks/action-completion-gate.sh +1 -1
- package/templates/skills/cc-upgrade/SKILL.md +6 -0
- package/templates/skills/cc-upgrade/phases/execute-group-workflow-split-detect.md +74 -0
- package/templates/skills/execute-group/SKILL.md +184 -97
- package/templates/workflows/execute-group-complete.js +303 -0
- package/templates/workflows/execute-group-implement.js +243 -0
- package/templates/workflows/execute-group.js +0 -506
package/lib/cli.js
CHANGED
|
@@ -9,6 +9,7 @@ const { create: createMetadata, read: readMetadata } = require('./metadata');
|
|
|
9
9
|
const { setupDb } = require('./db-setup');
|
|
10
10
|
const { setupVerifyRuntime } = require('./verify-setup');
|
|
11
11
|
const { setupSiteAuditRuntime } = require('./site-audit-setup');
|
|
12
|
+
const { setupEngagement } = require('./engagement-setup');
|
|
12
13
|
const { reset } = require('./reset');
|
|
13
14
|
|
|
14
15
|
const VERSION = require('../package.json').version;
|
|
@@ -485,7 +486,7 @@ const MODULES = {
|
|
|
485
486
|
mandatory: false,
|
|
486
487
|
default: true,
|
|
487
488
|
lean: true,
|
|
488
|
-
templates: ['skills/plan', 'skills/execute', 'skills/generate-plan-groups', 'skills/execute-group', 'workflows/execute-group.js', 'skills/investigate', 'cabinet/checkpoint-protocol.md'],
|
|
489
|
+
templates: ['skills/plan', 'skills/execute', 'skills/generate-plan-groups', 'skills/execute-group', 'workflows/execute-group-implement.js', 'workflows/execute-group-complete.js', 'skills/investigate', 'cabinet/checkpoint-protocol.md'],
|
|
489
490
|
},
|
|
490
491
|
'compliance': {
|
|
491
492
|
name: 'Compliance Stack (rules + enforcement)',
|
|
@@ -599,6 +600,7 @@ const MODULES = {
|
|
|
599
600
|
default: false,
|
|
600
601
|
lean: false,
|
|
601
602
|
requires: ['work-tracking'],
|
|
603
|
+
postInstall: 'engagement-setup',
|
|
602
604
|
templates: [
|
|
603
605
|
'skills/engagement',
|
|
604
606
|
'skills/engagement-progress',
|
|
@@ -1269,6 +1271,7 @@ async function run() {
|
|
|
1269
1271
|
const POST_INSTALL_HANDLERS = {
|
|
1270
1272
|
'verify-setup': setupVerifyRuntime,
|
|
1271
1273
|
'site-audit-setup': setupSiteAuditRuntime,
|
|
1274
|
+
'engagement-setup': setupEngagement,
|
|
1272
1275
|
};
|
|
1273
1276
|
for (const moduleKey of selectedModules) {
|
|
1274
1277
|
const mod = MODULES[moduleKey];
|
|
@@ -1280,7 +1283,7 @@ async function run() {
|
|
|
1280
1283
|
}
|
|
1281
1284
|
try {
|
|
1282
1285
|
console.log('');
|
|
1283
|
-
const result = handler({ dryRun: !!flags.dryRun });
|
|
1286
|
+
const result = handler({ dryRun: !!flags.dryRun, projectDir });
|
|
1284
1287
|
for (const r of result.results || []) console.log(` 📋 ${r}`);
|
|
1285
1288
|
} catch (err) {
|
|
1286
1289
|
console.log(` ⚠ ${mod.postInstall} failed: ${err.message}`);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* engagement-setup.js — extend pib-db files with engagement schema v5
|
|
3
|
+
* when the engagement module is installed.
|
|
4
|
+
*
|
|
5
|
+
* Dispatched from cli.js's postInstall pipeline. Idempotent: skips
|
|
6
|
+
* files that already contain the engagement code (detected by marker).
|
|
7
|
+
*
|
|
8
|
+
* The base pib-db templates (owned by work-tracking) ship schema v1-v4.
|
|
9
|
+
* The engagement module stores the complete engagement-inclusive versions
|
|
10
|
+
* of the pib-db files in templates/engagement/pib-db-patches/. When
|
|
11
|
+
* engagement is selected, this handler copies those over the base
|
|
12
|
+
* versions, keeping the base templates clean for consumers who don't
|
|
13
|
+
* opt into engagement.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
|
|
19
|
+
const MARKER = 'ENGAGEMENT_EVENT_KINDS';
|
|
20
|
+
const FILES = ['pib-db-lib.mjs', 'pib-db-mcp-server.mjs', 'pib-db-schema.sql', 'pib-db.mjs'];
|
|
21
|
+
|
|
22
|
+
function setupEngagement({ dryRun, projectDir } = {}) {
|
|
23
|
+
const results = [];
|
|
24
|
+
const scriptsDir = path.join(projectDir, 'scripts');
|
|
25
|
+
const patchDir = path.join(projectDir, '.claude', 'engagement', 'pib-db-patches');
|
|
26
|
+
|
|
27
|
+
if (!fs.existsSync(patchDir)) {
|
|
28
|
+
results.push('engagement-setup: patch dir not found — skipping (templates not yet copied)');
|
|
29
|
+
return { results };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
for (const file of FILES) {
|
|
33
|
+
const target = path.join(scriptsDir, file);
|
|
34
|
+
const source = path.join(patchDir, file);
|
|
35
|
+
|
|
36
|
+
if (!fs.existsSync(source)) {
|
|
37
|
+
results.push(`${file}: engagement patch not found — skipped`);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!fs.existsSync(target)) {
|
|
42
|
+
results.push(`${file}: target not found (work-tracking not installed?) — skipped`);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const existing = fs.readFileSync(target, 'utf8');
|
|
47
|
+
if (existing.includes(MARKER)) {
|
|
48
|
+
results.push(`${file}: already has engagement code — skipped`);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (!dryRun) {
|
|
53
|
+
fs.copyFileSync(source, target);
|
|
54
|
+
}
|
|
55
|
+
results.push(`${file}: applied engagement-inclusive version`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return { results };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = { setupEngagement };
|
package/package.json
CHANGED
package/templates/README.md
CHANGED
|
@@ -40,7 +40,7 @@ templates, see [EXTENSIONS.md](EXTENSIONS.md).
|
|
|
40
40
|
| `skills/debrief-quick/` | Quick debrief variant — core phases only, skip presentation. |
|
|
41
41
|
| `skills/execute/` | Execute a plan with cabinet member checkpoints. 3-checkpoint protocol (pre-implementation, per-file-group, pre-commit). 5 phase files. |
|
|
42
42
|
| `skills/generate-plan-groups/` | Scheduler: find plans with surface-area declarations, build a conflict graph, persist conflict-free parallel groups as pib-db `grp:` tags. Does not execute — hands each group to /execute-group. |
|
|
43
|
-
| `skills/execute-group/` | Runner: execute one generated group
|
|
43
|
+
| `skills/execute-group/` | Runner: execute one generated group as a 3-stage pipeline — interactive cabinet pre-review (CP1) the operator decides on, then the `execute-group-implement.js` workflow (parallel worktree implementation + sequential merge) and the `execute-group-complete.js` workflow (advisory review + integration + completion report), with operator checkpoints between stages. |
|
|
44
44
|
| `skills/cc-extract/` | Analyze project artifacts and propose upstream extraction candidates for Claude Cabinet. |
|
|
45
45
|
| `skills/investigate/` | Structured codebase exploration: frame, observe, hypothesize, test, conclude. |
|
|
46
46
|
| `skills/cc-link/` | Set up local development linking for Claude Cabinet source repo work. |
|
|
@@ -27,6 +27,36 @@ set of conflict-free plans implemented concurrently in separate worktrees,
|
|
|
27
27
|
then merged together. `/execute` never exercises that scope — it runs one
|
|
28
28
|
plan at a time and uses only the first three.
|
|
29
29
|
|
|
30
|
+
## Checkpoint modes — who acts on the verdict
|
|
31
|
+
|
|
32
|
+
The scope says *what* is reviewed. The **mode** says *what happens to the
|
|
33
|
+
verdict*. This distinction is load-bearing: an autonomous gate that reverts
|
|
34
|
+
or halts on a false-positive `stop` is fragile and expensive. The default for
|
|
35
|
+
high-stakes reviews is to put judgment in front of the operator.
|
|
36
|
+
|
|
37
|
+
| Mode | Where it runs | What a `stop`/`pause` does | Used by |
|
|
38
|
+
|------|---------------|----------------------------|---------|
|
|
39
|
+
| **Interactive CP** | Main session (skill level) | Surfaced to the operator, who decides (proceed / drop / override / abort). Never automatic. | `/execute-group` CP1 |
|
|
40
|
+
| **Advisory CP** | Workflow | Recorded in the Completion Report as a concern. Never halts or reverts. The only automatic gate alongside it is `/validate`. | `/execute-group` CP3 |
|
|
41
|
+
| **Full CP** | Main session or workflow | Halts on `stop`, escalates 3+ `pause` to a halt, requires explicit override. The classic gate. | `/execute` CP1/CP2/CP3 |
|
|
42
|
+
|
|
43
|
+
**Why Interactive and Advisory exist.** `/execute-group` once ran CP1 and CP3
|
|
44
|
+
as autonomous gates inside a single workflow: a cabinet `stop` halted the run
|
|
45
|
+
or reverted a merge with no human in the loop. False positives there cost real
|
|
46
|
+
money (a CP1 halted twice consecutively — 1.6M+ tokens — on concerns the plan
|
|
47
|
+
text already addressed). Moving CP1 to interactive (operator decides) and CP3
|
|
48
|
+
to advisory (concerns recorded, `/validate` is the only hard gate) keeps the
|
|
49
|
+
review signal while removing the destructive autonomous action.
|
|
50
|
+
|
|
51
|
+
### Interactive CP adds a required `addressed_by_plan` field
|
|
52
|
+
|
|
53
|
+
At Interactive CP (`/execute-group` CP1, `pre-impl` scope), each agent's
|
|
54
|
+
verdict carries one extra **required** field, `addressed_by_plan` — the list
|
|
55
|
+
of risks the plan already handles. The agent must enumerate these *first*,
|
|
56
|
+
before raising any concern. This forces the plan-first discipline structurally:
|
|
57
|
+
a risk listed in `addressed_by_plan` cannot also be raised as a concern. It is
|
|
58
|
+
the direct fix for the false-positive halts.
|
|
59
|
+
|
|
30
60
|
## Step 1 — Select which members to spawn
|
|
31
61
|
|
|
32
62
|
Spawn one Agent per cabinet member that matches **either**:
|
|
@@ -107,8 +137,26 @@ Each agent returns exactly this shape:
|
|
|
107
137
|
}
|
|
108
138
|
```
|
|
109
139
|
|
|
140
|
+
At **Interactive CP** (`/execute-group` CP1), add the required
|
|
141
|
+
`addressed_by_plan` array described above:
|
|
142
|
+
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"cabinet_member": "name",
|
|
146
|
+
"addressed_by_plan": ["risks the plan already handles"],
|
|
147
|
+
"verdict": "continue" | "pause" | "stop",
|
|
148
|
+
"concerns": [ ... ]
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
110
152
|
## Step 4 — Apply escalation
|
|
111
153
|
|
|
154
|
+
The escalation below is **Full CP** behavior (used by `/execute`). For
|
|
155
|
+
**Interactive CP** the verdicts are surfaced to the operator severity-first
|
|
156
|
+
and the operator decides — no automatic halt. For **Advisory CP** the concerns
|
|
157
|
+
are recorded in the Completion Report and nothing halts or reverts; `/validate`
|
|
158
|
+
is the only automatic gate. See "Checkpoint modes" above.
|
|
159
|
+
|
|
112
160
|
Collect every verdict, then:
|
|
113
161
|
|
|
114
162
|
- **Any `stop`** → halt. Show the concern. Require an explicit override
|