create-claude-cabinet 0.25.1 → 0.25.3

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 CHANGED
@@ -463,6 +463,7 @@ const MODULES = {
463
463
  'skills/plan/phases/verify-plan.md',
464
464
  'skills/execute/phases/verify-emit.md',
465
465
  'skills/debrief/phases/verify-coverage.md',
466
+ 'skills/orient/phases/verify-backfill.md',
466
467
  ],
467
468
  postInstall: 'verify-setup',
468
469
  },
@@ -874,6 +875,7 @@ async function run() {
874
875
  const alwaysCopyPhases = [
875
876
  'skills/onboard', 'skills/seed',
876
877
  'skills/cc-upgrade', 'skills/cc-extract',
878
+ 'skills/verify',
877
879
  ];
878
880
  const isSkill = tmpl.startsWith('skills/') && !alwaysCopyPhases.some(p => tmpl.startsWith(p));
879
881
  const results = await copyTemplates(srcPath, destPath, {
@@ -909,6 +911,19 @@ async function run() {
909
911
  continue;
910
912
  }
911
913
 
914
+ // Phase file customization guard — mirrors copy.js:48-59 for the
915
+ // single-file install path. If the destination path is a phase
916
+ // file and the on-disk content differs from upstream (operator
917
+ // edited it), preserve it. This keeps the documented "customize
918
+ // by editing the phase file" affordance intact across upgrades.
919
+ const isPhaseFile = tmpl.includes('/phases/') || tmpl.includes('\\phases\\');
920
+ if (isPhaseFile && existingContent.trim() !== '' && existingContent.trim() !== incoming.trim()) {
921
+ console.log(` Preserved customized phase: ${tmpl}`);
922
+ totalSkipped++;
923
+ allManifest[mPath] = hashContent(existingContent);
924
+ continue;
925
+ }
926
+
912
927
  if (flags.yes || dirState === 'existing-install') {
913
928
  // If file is in the old manifest, it's upstream-managed — overwrite.
914
929
  // If not, it's project-created — skip.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-claude-cabinet",
3
- "version": "0.25.1",
3
+ "version": "0.25.3",
4
4
  "description": "Claude Cabinet — opinionated process scaffolding for Claude Code projects",
5
5
  "bin": {
6
6
  "create-claude-cabinet": "bin/create-claude-cabinet.js"
@@ -0,0 +1,108 @@
1
+ # Verify-Plan Backfill
2
+
3
+ **Contract: v0.x soft — may change before v1.0.** This phase is part
4
+ of the `/verify` integration with `/orient`. Customization phase
5
+ (opt-in), copied into your project only when the `verify` module is
6
+ selected during `npx create-claude-cabinet`.
7
+
8
+ **Runs:** after work-scan, before briefing. Pairs with
9
+ [verify-coverage on /debrief] — verify-coverage catches drift on
10
+ acts that already shipped; this phase catches the same gap on the
11
+ *front* end, at planning time, on acts still pending.
12
+
13
+ ## What this phase does
14
+
15
+ Surfaces pending plans in pib-db whose surface area touches UI but
16
+ whose notes lack a `## Verify Plan` section. Advisory only — never
17
+ auto-modifies an action. The operator decides whether to re-plan the
18
+ act (adding the section) or accept the drift.
19
+
20
+ ## No-op guards
21
+
22
+ This phase exits silently in two cases — checked in order:
23
+
24
+ 1. **The project has no `e2e/features/` directory.** Without the
25
+ runtime installed, there are no feature files to be out of sync
26
+ with. Skip.
27
+ 2. **No pending actions match the UI heuristic.** No Attention Items
28
+ entry, no warning.
29
+
30
+ Detection for guard 1:
31
+
32
+ ```bash
33
+ test -d e2e/features
34
+ ```
35
+
36
+ If either guard trips, skip the phase entirely. No briefing line.
37
+
38
+ ## Detection algorithm
39
+
40
+ 1. **Query pib-db for pending UI-touching actions without a Verify
41
+ Plan section.** The default heuristic matches the surface-area path
42
+ patterns used by `verify-coverage.md`:
43
+
44
+ ```sql
45
+ SELECT fid, text, notes FROM actions
46
+ WHERE completed = 0
47
+ AND deleted_at IS NULL
48
+ AND (
49
+ notes LIKE '%webapp/frontend/%'
50
+ OR notes LIKE '%components/%'
51
+ OR notes LIKE '%pages/%'
52
+ OR notes LIKE '%app/%'
53
+ )
54
+ AND notes NOT LIKE '%## Verify Plan%'
55
+ ORDER BY created ASC;
56
+ ```
57
+
58
+ Run via `node scripts/pib-db.mjs query "<sql>"` or, if the project
59
+ has a `phases/ui-paths.md` override, substitute those paths.
60
+
61
+ 2. **Per match, judge whether it really is UI-touching.** The path
62
+ heuristic over-matches (e.g., an action that merely mentions
63
+ `webapp/frontend/` in a passing comment). Read the action's
64
+ `## Surface Area` section if present and confirm the listed files
65
+ include a UI path. If not, drop the match silently.
66
+
67
+ 3. **Cap at 5 entries.** If more than 5 match, list the 5
68
+ oldest-created and append a "(+N more — run /pulse for full list)"
69
+ note. Don't dump 20 entries into the orient briefing.
70
+
71
+ ## Output
72
+
73
+ For each remaining match, emit one Attention Items entry:
74
+
75
+ > **`<fid>`** — `<action text>`
76
+ > Pending plan touches UI but lacks a `## Verify Plan` section.
77
+ > Suggest: `/verify backfill <fid>` to draft the section interactively,
78
+ > or accept drift — `/debrief` will flag this act on completion if
79
+ > it ships uncovered.
80
+
81
+ The entries go in the briefing's **Attention Items** section,
82
+ alongside any items surfaced by deferred-check, health-checks, etc.
83
+
84
+ ## What this phase does NOT do
85
+
86
+ - It does not modify action notes. The operator runs `/plan <fid>`
87
+ to backfill, or chooses to accept the drift.
88
+ - It does not file new actions or projects.
89
+ - It does not block orient. Even with 5 backfill candidates, orient
90
+ completes; the Attention Items accumulate.
91
+ - It does not look at *completed* acts — that's verify-coverage's job
92
+ on `/debrief`.
93
+
94
+ ## Tuning to reduce false positives
95
+
96
+ Two common refinements:
97
+
98
+ 1. **Path override.** A project's `phases/ui-paths.md` (if defined)
99
+ replaces the default path list. See `verify-coverage.md` for the
100
+ same pattern.
101
+ 2. **Per-act opt-out.** An action can declare in its notes that it's
102
+ intentionally backend-only:
103
+ ```
104
+ ## Verify Coverage
105
+ Skip: this change is internal — no UI behavior changed.
106
+ ```
107
+ This phase reads that line and skips the act, same as
108
+ verify-coverage does.
@@ -4,9 +4,10 @@ description: |
4
4
  Walkthrough verification harness. Cucumber + Playwright scenarios with
5
5
  human-in-the-loop verdict pauses (P/I/S/N) for subjective checks.
6
6
  Subcommands: bare (run the suite), 'learn' (bootstrap from cold start),
7
- 'update <change>' (sync feature files to a code change). Use when:
8
- "verify", "/verify", "/verify learn", "/verify update", "run walkthrough",
9
- "verify scenarios", after a multi-PR umbrella ships.
7
+ 'update <change>' (sync feature files to a code change), 'backfill <fid>'
8
+ (add a Verify Plan section to a pending action's notes). Use when:
9
+ "verify", "/verify", "/verify learn", "/verify update", "/verify backfill",
10
+ "run walkthrough", "verify scenarios", after a multi-PR umbrella ships.
10
11
  related:
11
12
  - type: file
12
13
  path: .claude/skills/verify/phases/discover.md
@@ -26,10 +27,13 @@ related:
26
27
  - type: file
27
28
  path: .claude/skills/verify/phases/scenario-template.md
28
29
  role: "Gherkin scenario template (cost+role tags, NN.NN checkIds)"
30
+ - type: file
31
+ path: .claude/skills/verify/phases/backfill.md
32
+ role: "How to draft a ## Verify Plan section for a pending action"
29
33
  - type: file
30
34
  path: cabinet/_briefing.md
31
35
  role: "Project identity and configuration"
32
- argument-hint: "subcommand — 'learn', 'update <change>', or empty to run"
36
+ argument-hint: "subcommand — 'learn', 'update <change>', 'backfill <fid>', or empty to run"
33
37
  user-invocable: true
34
38
  standing-mandate: []
35
39
  ---
@@ -47,6 +51,13 @@ If `$ARGUMENTS` is provided:
47
51
  extending an existing scenario set.
48
52
  - **'update <change-description>'**: Sync feature files to a code change.
49
53
  The change can be a pib-db action fid, a diff snippet, or free-text.
54
+ - **'backfill <fid>'**: Add a `## Verify Plan` section to a pending action's
55
+ notes. For actions that were planned before the verify module existed,
56
+ or planned without Verify Plan questions surfaced. Reads the existing
57
+ notes, interviews the user one question at a time about UI surface and
58
+ feature-file edits, drafts the section, and appends via
59
+ `pib_update_action`. Does NOT modify feature files — that's `/execute`'s
60
+ job at action ship time.
50
61
 
51
62
  ## Purpose
52
63
 
@@ -175,6 +186,30 @@ may want a new scenario, not an edit to an existing one).
175
186
  The proposed edits are presented inline. User approves, the skill
176
187
  writes them.
177
188
 
189
+ ### Mode D: `/verify backfill <fid>` — add Verify Plan to pending action
190
+
191
+ Read `phases/backfill.md` for the full flow. Brief overview:
192
+
193
+ 1. **Load the action.** Call `pib_get_action <fid>`. Read the
194
+ action's `text` and `notes` (especially the `## Surface Area`
195
+ section). Confirm the action is pending (`completed = 0`) — if
196
+ already shipped, redirect the user to `/verify update <fid>`.
197
+ 2. **Read existing feature files.** `ls e2e/features/*.feature` so
198
+ the interview can reference real scenarios and checkIds.
199
+ 3. **Interview, one question at a time.** Per CLAUDE.md global
200
+ convention. Walk the user through: which features need edits,
201
+ what verb (ADD/MODIFY/REMOVE/NEW), what anchor or scenario name.
202
+ 4. **Draft the section.** Format matches `verify-plan.md`'s output
203
+ spec (one `- features/<file>.feature:` line per entry).
204
+ 5. **Show the diff.** Display the action's current notes alongside
205
+ the proposed appended section.
206
+ 6. **Confirm + write.** On approval, call `pib_update_action` with
207
+ the augmented notes. Without approval, exit without changes.
208
+
209
+ This mode does NOT modify feature files. That's `/execute`'s job
210
+ once the action runs. Backfill only adds the planning artifact so
211
+ `/execute`'s `verify-emit` phase has something to read.
212
+
178
213
  ## Phase Summary
179
214
 
180
215
  | Phase | Absent = | What it customizes |
@@ -185,6 +220,7 @@ writes them.
185
220
  | `generate.md` | Default: write .feature + step stubs from calibrated draft | Generation rules (collision handling, naming) |
186
221
  | `update.md` | Default: action fid / diff / free-text dispatch | How change descriptions map to edits |
187
222
  | `scenario-template.md` | Default: Gherkin with cost+role tags, NN.NN checkIds | Project-specific scenario shape |
223
+ | `backfill.md` | Default: interview-driven Verify Plan section drafting | Project-specific backfill questions |
188
224
 
189
225
  ## Principles
190
226
 
@@ -0,0 +1,164 @@
1
+ # Backfill — add a Verify Plan section to a pending action
2
+
3
+ Default behavior for `/verify backfill <fid>`. The mode adds a
4
+ `## Verify Plan` section to a pending pib-db action's notes so
5
+ `/execute`'s `verify-emit` phase can read it later. Does NOT touch
6
+ feature files — that's `/execute`'s job at action ship time.
7
+
8
+ ## Inputs
9
+
10
+ - A pib-db action fid (`act:abc12345`). Passed as `$ARGUMENTS` to
11
+ `/verify backfill`. If missing or malformed, ask the user for
12
+ it; don't guess from context.
13
+
14
+ ## Preconditions
15
+
16
+ 1. The action exists. If `pib_get_action <fid>` returns nothing,
17
+ exit with "no action found for <fid>".
18
+ 2. The action is pending (`completed = 0`). If already shipped,
19
+ tell the user: "act:<fid> already shipped on <date>. To sync
20
+ feature files retroactively, use `/verify update <fid>` instead."
21
+ 3. The action's notes don't already have a `## Verify Plan` section.
22
+ If they do, ask: "act:<fid> already has a Verify Plan section.
23
+ Replace it or skip?"
24
+ 4. `e2e/features/` exists. If not, recommend `/verify learn` first.
25
+
26
+ ## Workflow
27
+
28
+ ### 1. Load and summarize
29
+
30
+ Print:
31
+
32
+ ```
33
+ Backfilling Verify Plan for act:abc12345 — <action text>
34
+
35
+ Current Surface Area (from notes):
36
+ - files: webapp/frontend/src/components/Foo.tsx
37
+ - files: webapp/frontend/src/hooks/useFoo.ts
38
+ ```
39
+
40
+ If no Surface Area section is found, say so and proceed to step 2 —
41
+ the user may want to add one inline.
42
+
43
+ ### 2. Show available feature files
44
+
45
+ ```
46
+ e2e/features/:
47
+ 01-desktop-rewrite.feature (@api-small, @as-user)
48
+ 02-browse-history.feature (@free, @as-user)
49
+ 04-admin-spot-check.feature (@free, @as-admin)
50
+ ...
51
+ ```
52
+
53
+ Read the first two lines of each `.feature` file to surface its
54
+ tags. Skip features tagged `@manual` from suggestions unless the
55
+ action explicitly mentions iOS/mobile.
56
+
57
+ ### 3. Interview, one question at a time
58
+
59
+ Per CLAUDE.md global convention — never batch. Each answer shapes
60
+ the next question. Typical sequence:
61
+
62
+ **Q1 — surface area mapping.**
63
+
64
+ > "act:abc12345 touches webapp/frontend/src/components/Foo.tsx.
65
+ > Which feature file(s) exercise that component or the route it
66
+ > renders on?"
67
+
68
+ Wait for answer. If unclear, propose candidates based on:
69
+ - The action's notes mentioning a route (`/admin`, `/history`)
70
+ - The scenario names in `e2e/features/`
71
+ - Cabinet-qa subagent if multiple plausible matches
72
+
73
+ **Q2 — edit verb.**
74
+
75
+ For each chosen feature file, ask:
76
+
77
+ > "For features/04-admin-spot-check.feature, what kind of edit?
78
+ > - ADD step after an existing anchor
79
+ > - MODIFY an existing step's assertion
80
+ > - NEW scenario in a new file
81
+ > - REMOVE a step (for deprecations)"
82
+
83
+ Wait for answer.
84
+
85
+ **Q3 — specifics.**
86
+
87
+ Depending on the verb, follow up:
88
+ - **ADD step after <anchor>**: "What's the anchor checkId, and what
89
+ should the new step assert?"
90
+ - **MODIFY step <checkId>**: "Which step? What should the new
91
+ assertion text say?"
92
+ - **NEW scenario**: "Scenario name? Tags (cost + role)? Brief
93
+ description of the journey?"
94
+ - **REMOVE step <checkId>**: "Which checkId? Confirm — removed
95
+ steps invalidate prior verdicts."
96
+
97
+ Wait for answer.
98
+
99
+ **Repeat Q1–Q3** for each additional feature file the action
100
+ touches. After the user signals "that's all," proceed.
101
+
102
+ ### 4. Draft the section
103
+
104
+ Format matches `verify-plan.md`'s output spec exactly so
105
+ `verify-emit` parses it identically to plan-time output:
106
+
107
+ ```markdown
108
+ ## Verify Plan
109
+
110
+ - features/04-admin-spot-check.feature: ADD step after the existing
111
+ "admin-history-list-loads" check — verify the new "balance owed"
112
+ column renders for users with outstanding refunds (4.12b
113
+ admin-balance-owed-column).
114
+ - features/14-downloaded-files.feature: (deferred) NEW scenario for
115
+ the bulk-download flow — requires Phase B framework migration to
116
+ ship first.
117
+ ```
118
+
119
+ Edit verbs: `ADD step after <anchor>`, `MODIFY step <checkId>`,
120
+ `NEW scenario`, `REMOVE step <checkId>`. Use `(deferred)` prefix
121
+ for entries that depend on other work.
122
+
123
+ ### 5. Show the diff
124
+
125
+ Display:
126
+
127
+ ```
128
+ Existing notes:
129
+ ─────────────
130
+ <truncated existing notes — last 20 lines>
131
+
132
+ Proposed appended section:
133
+ ──────────────────────────
134
+ ## Verify Plan
135
+
136
+ <the drafted section from step 4>
137
+ ```
138
+
139
+ ### 6. Confirm and write
140
+
141
+ > "Append this Verify Plan section to act:abc12345's notes? (y/n)"
142
+
143
+ If yes:
144
+ - Call `pib_update_action <fid> --notes "<existing_notes>\n\n<new_section>"`
145
+ - Confirm: "Updated act:abc12345 with Verify Plan (N entries)."
146
+
147
+ If no:
148
+ - Exit without changes.
149
+
150
+ ## Out of scope
151
+
152
+ - Modifying feature files. That's `/execute`'s `verify-emit` phase
153
+ when the action runs.
154
+ - Re-running the full /plan flow (acceptance criteria, surface area,
155
+ cabinet review). Backfill is narrow — Verify Plan section only.
156
+ - Creating new actions. The action already exists by definition.
157
+
158
+ ## When to escalate to a full /plan
159
+
160
+ If the interview reveals the action is mis-scoped — e.g., the user
161
+ realizes the surface area listed in the notes is wrong — recommend
162
+ re-planning the whole action via `/plan` instead. Backfill is only
163
+ useful when the action's scope and surface area are correct and
164
+ just the Verify Plan layer is missing.