@lumenflow/cli 3.2.1 → 3.2.2

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.
@@ -33,6 +33,7 @@ Run `--help` first, then run the real command with explicit flags.
33
33
  | Metrics & Flow | `pnpm flow:report --help` | `pnpm flow:report` |
34
34
  | Documentation | `pnpm docs:validate --help` | `pnpm docs:validate` |
35
35
  | Release | `pnpm pre-release:check --help` | `pnpm pre-release:check` |
36
+ | Configuration | `pnpm config:set --help` | `pnpm config:set --key methodology.testing --value test-after` |
36
37
  | Agent Utilities | `pnpm agent:issues-query --help` | `pnpm agent:issues-query` |
37
38
 
38
39
  ---
@@ -77,21 +78,21 @@ pnpm exec lumenflow --client all # All clients
77
78
 
78
79
  ## WU Lifecycle
79
80
 
80
- | Command | Description |
81
- | ---------------------------------------------- | ------------------------------------------------ |
82
- | `pnpm wu:create --id WU-XXX --lane <Lane> ..` | Create new WU spec (see required fields below) |
83
- | `pnpm wu:claim --id WU-XXX --lane <Lane>` | Claim WU and create worktree (default) |
84
- | `pnpm wu:claim --id WU-XXX --lane <L> --cloud` | Claim WU in cloud/branch-pr mode (no worktree) |
85
- | `pnpm wu:prep --id WU-XXX [--full-tests]` | Run gates, prep for wu:done (`tests.unit` scoped by default) |
86
- | `pnpm wu:done --id WU-XXX` | Complete WU (merge or PR, stamp, cleanup) |
87
- | `pnpm wu:edit --id WU-XXX --description "..."` | Edit WU spec fields (run --help for all flags) |
88
- | `pnpm wu:block --id WU-XXX --reason "..."` | Block WU with reason |
89
- | `pnpm wu:unblock --id WU-XXX` | Unblock WU |
90
- | `pnpm wu:release --id WU-XXX` | Release orphaned WU (in_progress to ready) |
91
- | `pnpm wu:status --id WU-XXX` | Show WU status, location, valid commands |
92
- | `pnpm wu:brief --id WU-XXX --client <client>` | Generate handoff prompt (does not execute) |
93
- | `pnpm wu:brief --id WU-XXX --no-context` | Generate prompt without memory context injection |
94
- | `pnpm wu:delegate --id WU-XXX --parent-wu <P>` | Generate prompt and record delegation lineage |
81
+ | Command | Description |
82
+ | ----------------------------------------------- | ------------------------------------------------------------ |
83
+ | `pnpm wu:create --lane <Lane> --title "..." ..` | Create new WU spec (ID auto-generated; see fields below) |
84
+ | `pnpm wu:claim --id WU-XXX --lane <Lane>` | Claim WU and create worktree (default) |
85
+ | `pnpm wu:claim --id WU-XXX --lane <L> --cloud` | Claim WU in cloud/branch-pr mode (no worktree) |
86
+ | `pnpm wu:prep --id WU-XXX [--full-tests]` | Run gates, prep for wu:done (`tests.unit` scoped by default) |
87
+ | `pnpm wu:done --id WU-XXX` | Complete WU (merge or PR, stamp, cleanup) |
88
+ | `pnpm wu:edit --id WU-XXX --description "..."` | Edit WU spec fields (run --help for all flags) |
89
+ | `pnpm wu:block --id WU-XXX --reason "..."` | Block WU with reason |
90
+ | `pnpm wu:unblock --id WU-XXX` | Unblock WU |
91
+ | `pnpm wu:release --id WU-XXX` | Release orphaned WU (in_progress to ready) |
92
+ | `pnpm wu:status --id WU-XXX` | Show WU status, location, valid commands |
93
+ | `pnpm wu:brief --id WU-XXX --client <client>` | Generate handoff prompt (does not execute) |
94
+ | `pnpm wu:brief --id WU-XXX --no-context` | Generate prompt without memory context injection |
95
+ | `pnpm wu:delegate --id WU-XXX --parent-wu <P>` | Generate prompt and record delegation lineage |
95
96
 
96
97
  ### WU Maintenance
97
98
 
@@ -112,18 +113,22 @@ pnpm exec lumenflow --client all # All clients
112
113
 
113
114
  ## Gates & Quality
114
115
 
115
- | Command | Description |
116
- | --------------------------------- | -------------------------------- |
117
- | `pnpm gates` | Run all quality gates |
118
- | `pnpm gates --docs-only` | Run gates for docs changes |
119
- | `pnpm format` | Format all files (Prettier) |
120
- | `pnpm format:check` | Check formatting without changes |
121
- | `pnpm lint` | Run ESLint |
122
- | `pnpm typecheck` | Run TypeScript type checking |
123
- | `pnpm test` | Run all tests (Vitest) |
124
- | `pnpm spec:linter` | Validate WU specs (all) ¹ |
125
- | `pnpm lane:health` | Check lane config health |
126
- | `pnpm lane:suggest --paths "..."` | Suggest lane for code paths |
116
+ | Command | Description |
117
+ | --------------------------------- | --------------------------------- |
118
+ | `pnpm gates` | Run all quality gates |
119
+ | `pnpm gates --docs-only` | Run gates for docs changes |
120
+ | `pnpm format` | Format all files (Prettier) |
121
+ | `pnpm format:check` | Check formatting without changes |
122
+ | `pnpm lint` | Run ESLint |
123
+ | `pnpm typecheck` | Run TypeScript type checking |
124
+ | `pnpm test` | Run all tests (Vitest) |
125
+ | `pnpm spec:linter` | Validate WU specs (all) ¹ |
126
+ | `pnpm lane:health` | Check lane config health |
127
+ | `pnpm lane:suggest --paths "..."` | Suggest lane for code paths |
128
+ | `pnpm lane:status` | Show lane lifecycle status |
129
+ | `pnpm lane:setup` | Create/update draft lane config |
130
+ | `pnpm lane:validate` | Validate lane draft artifacts |
131
+ | `pnpm lane:lock` | Lock lane lifecycle for WU create |
127
132
 
128
133
  ¹ **Script aliases:** `spec:linter` and `tasks:validate` are pnpm script aliases
129
134
  for `wu:validate --all`. They are not standalone CLI commands.
@@ -211,6 +216,30 @@ Supported mismatch fixes:
211
216
 
212
217
  ---
213
218
 
219
+ ## Configuration
220
+
221
+ | Command | Description |
222
+ | ------------------------------------------------- | ----------------------------------------------- |
223
+ | `pnpm config:get --key <dotpath>` | Read a value from `workspace.yaml` |
224
+ | `pnpm config:set --key <dotpath> --value <value>` | Set a value in `workspace.yaml` (Zod-validated) |
225
+
226
+ `config:set` validates against the Zod schema before writing and uses the micro-worktree
227
+ pattern for atomic commits. Always use these commands instead of raw Write/Edit on
228
+ `workspace.yaml`. See [Constraint 9](../../../../../.lumenflow/constraints.md)
229
+ and [YAML editing policy](../../../../../.lumenflow/rules/yaml-editing-policy.md).
230
+
231
+ **Common dotpaths:**
232
+
233
+ | Dotpath | Type | Example Values |
234
+ | --------------------------------- | ------- | --------------------------- |
235
+ | `methodology.testing` | enum | `tdd`, `test-after`, `none` |
236
+ | `gates.minCoverage` | number | `0`-`100` |
237
+ | `gates.enableCoverage` | boolean | `true`, `false` |
238
+ | `experimental.context_validation` | boolean | `true`, `false` |
239
+ | `git.requireRemote` | boolean | `true`, `false` |
240
+
241
+ ---
242
+
214
243
  ## Dependencies
215
244
 
216
245
  | Command | Description |
@@ -222,15 +251,15 @@ Supported mismatch fixes:
222
251
 
223
252
  ## Plans
224
253
 
225
- Plans are markdown documents that capture goals, scope, approach, and success criteria before implementation begins. They link to WUs (via `spec_refs`) and initiatives (via `related_plan`).
254
+ Plans are markdown documents that capture goals, scope, approach, and success criteria before implementation begins. They link to WUs (via the `plan` field, WU-1683) and initiatives (via `related_plan`).
226
255
 
227
256
  ### Plan Storage
228
257
 
229
258
  Plans are stored in the repo at `docs/04-operations/plans/` by default (configurable via `directories.plansDir` in `workspace.yaml`).
230
259
 
231
260
  If the plan exists only in conversation, use `--plan` on `wu:create` to generate a lightweight
232
- stub in `$LUMENFLOW_HOME/plans/`, then summarize the conversation there and reference it via
233
- `spec_refs`. Feature WUs require `spec_refs`; notes do not replace the plan link.
261
+ stub in `$LUMENFLOW_HOME/plans/` and automatically set the WU's `plan` field to the
262
+ `lumenflow://plans/` URI. Feature WUs should have a `plan` field; notes do not replace the plan link.
234
263
 
235
264
  | Command | Description |
236
265
  | ------------------------------------------------------------------------ | ------------------------------------------------------------- |
@@ -263,15 +292,17 @@ pnpm initiative:plan --initiative INIT-001 --create
263
292
  pnpm initiative:plan --initiative INIT-001 --plan docs/04-operations/plans/my-plan.md
264
293
  ```
265
294
 
266
- **To a WU (via spec_refs):**
295
+ **To a WU (via `plan` field, WU-1683):**
267
296
 
268
297
  ```bash
269
- # When creating a WU
270
- pnpm wu:create --id WU-123 --lane "Framework: Core" --title "Feature" \
271
- --spec-refs "lumenflow://plans/WU-123-plan.md"
298
+ # When creating a WU (--plan auto-generates and links)
299
+ pnpm wu:create --lane "Framework: Core" --title "Feature" --plan
300
+
301
+ # Or edit an existing WU with a specific plan URI
302
+ pnpm wu:edit --id WU-123 --plan "lumenflow://plans/WU-123-plan.md"
272
303
 
273
- # Or edit an existing WU
274
- pnpm wu:edit --id WU-123 --spec-refs "lumenflow://plans/WU-123-plan.md"
304
+ # Or use plan:link
305
+ pnpm plan:link --id WU-123 --plan lumenflow://plans/WU-123-plan.md
275
306
  ```
276
307
 
277
308
  ### Plan URI Format
@@ -396,18 +427,18 @@ pnpm gates # Now works
396
427
  # 0. Check available options (do this before first use of any command)
397
428
  pnpm wu:create --help
398
429
 
399
- # 1. Create WU
400
- pnpm wu:create --id WU-XXX --lane "Framework: Core" --title "Add feature" \
430
+ # 1. Create WU (ID auto-generated)
431
+ pnpm wu:create --lane "Framework: Core" --title "Add feature" \
401
432
  --description "Context: ... Problem: ... Solution: ..." \
402
433
  --acceptance "Criterion 1" --acceptance "Criterion 2" \
403
434
  --code-paths "src/file.ts" \
404
435
  --test-paths-unit "src/__tests__/file.test.ts" \
405
- --exposure backend-only \
406
- --spec-refs "~/.lumenflow/plans/WU-XXX-plan.md"
436
+ --exposure backend-only
437
+ # Output: Created WU-1990 at docs/.../wu/WU-1990.yaml
407
438
 
408
- # 2. Claim (creates worktree)
409
- pnpm wu:claim --id WU-XXX --lane "Framework: Core"
410
- cd worktrees/framework-core-wu-xxx
439
+ # 2. Claim (creates worktree) -- use the ID from wu:create output
440
+ pnpm wu:claim --id WU-1990 --lane "Framework: Core"
441
+ cd worktrees/framework-core-wu-1990
411
442
 
412
443
  # 2b. Bootstrap (build CLI for dist-backed commands)
413
444
  pnpm bootstrap
@@ -419,10 +450,10 @@ pnpm bootstrap
419
450
  git add . && git commit -m "feat: description"
420
451
 
421
452
  # 5. Prep (runs gates in worktree)
422
- pnpm wu:prep --id WU-XXX
453
+ pnpm wu:prep --id WU-1990
423
454
 
424
455
  # 6. Complete (from main - copy from wu:prep output)
425
- cd /path/to/main && pnpm wu:done --id WU-XXX
456
+ cd /path/to/main && pnpm wu:done --id WU-1990
426
457
  ```
427
458
 
428
459
  ---
@@ -437,9 +468,24 @@ For code changes, you must include **all** of the following (or wu:create will f
437
468
  - `--test-paths-unit` or `--test-paths-e2e` (automated tests required)
438
469
  - `--exposure` (ui | api | backend-only | documentation)
439
470
  - `--spec-refs` (required for type: feature)
471
+ - `--plan` (optional, auto-generates plan file and sets `plan` field — WU-1683)
440
472
 
441
473
  Documentation WUs can omit code/test paths but should set `--type documentation` and `--exposure documentation`.
442
474
 
475
+ **Auto-generated IDs (recommended):** Omit `--id` and let `wu:create` assign the next sequential ID. Capture the output for dependency chaining:
476
+
477
+ ```bash
478
+ # Create first WU (ID auto-generated)
479
+ pnpm wu:create --lane "Framework: Core" --title "First WU" ...
480
+ # Output: Created WU-1990
481
+
482
+ # Create second WU blocked by the first
483
+ pnpm wu:create --lane "Framework: Core" --title "Second WU" --blocked-by WU-1990 ...
484
+ # Output: Created WU-1991
485
+ ```
486
+
487
+ > **Note:** Use `--id` only when re-creating a specific WU or for migration tooling.
488
+
443
489
  ---
444
490
 
445
491
  ## Strict WU Validation (WU-1329)
@@ -498,14 +544,27 @@ Agents should:
498
544
 
499
545
  ---
500
546
 
501
- ## Lane Inference Requirement (Sub-Lanes)
547
+ ## Lane Lifecycle Requirement
502
548
 
503
- If you use a sub-lane like `Experience: UI`, you **must** have a lane taxonomy:
549
+ Before the first delivery WU, complete lane lifecycle once per project:
504
550
 
505
- - Ensure `.lumenflow.lane-inference.yaml` exists, or
506
- - Generate it with `pnpm lane:suggest --output .lumenflow.lane-inference.yaml`
551
+ ```bash
552
+ pnpm lane:setup
553
+ pnpm lane:validate
554
+ pnpm lane:lock
555
+ ```
507
556
 
508
- Without this file, sub-lane validation will fail.
557
+ Lifecycle states:
558
+
559
+ - `unconfigured` -> next step `pnpm lane:setup`
560
+ - `draft` -> next step `pnpm lane:lock`
561
+ - `locked` -> delivery WUs can be created
562
+
563
+ Check current lifecycle state any time:
564
+
565
+ ```bash
566
+ pnpm lane:status
567
+ ```
509
568
 
510
569
  ---
511
570
 
@@ -56,6 +56,10 @@ If you are starting a new project or feature from a product vision (e.g., "Build
56
56
  3. **Create WUs under the Initiative**: Each WU belongs to a phase
57
57
 
58
58
  ```bash
59
+ pnpm lane:setup
60
+ pnpm lane:validate
61
+ pnpm lane:lock
62
+
59
63
  pnpm wu:create --lane "Core: Platform" --title "Add task model" \
60
64
  --description "..." --acceptance "..." --code-paths "..." \
61
65
  && pnpm initiative:add-wu --initiative INIT-001 --wu WU-XXX --phase 1
@@ -168,10 +172,15 @@ all signals are user-configured.
168
172
 
169
173
  ## Before Creating WUs
170
174
 
171
- If you plan to use sub-lanes like `Experience: UI`, make sure lane inference is configured:
175
+ Before the first delivery WU in a project, complete lane lifecycle:
176
+
177
+ ```bash
178
+ pnpm lane:setup
179
+ pnpm lane:validate
180
+ pnpm lane:lock
181
+ ```
172
182
 
173
- - `.lumenflow.lane-inference.yaml` must exist for sub-lane validation, or
174
- - Generate it with `pnpm lane:suggest --output .lumenflow.lane-inference.yaml`
183
+ Use `pnpm lane:status` to verify lifecycle state and recommended next step.
175
184
 
176
185
  **No remote yet?** `wu:create` expects `origin/main`. If your repo is local-only, add a remote
177
186
  before running `wu:create`. `wu:claim` supports `--no-push` for local-only work.
@@ -274,6 +283,55 @@ LUMENFLOW_FORCE=1 LUMENFLOW_FORCE_REASON="backlog corruption recovery" git push
274
283
 
275
284
  ---
276
285
 
286
+ ## Safe Configuration Modification (Constraint 9)
287
+
288
+ **Never use Write or Edit tools to modify YAML configuration files.** Always use the dedicated CLI commands.
289
+
290
+ ### Modifying workspace.yaml
291
+
292
+ ```bash
293
+ # Read a config value
294
+ pnpm config:get --key methodology.testing
295
+
296
+ # Set a config value (validates against Zod schema, uses atomic commit)
297
+ pnpm config:set --key methodology.testing --value test-after
298
+
299
+ # Set a boolean
300
+ pnpm config:set --key gates.enableCoverage --value false
301
+
302
+ # Set a number
303
+ pnpm config:set --key gates.minCoverage --value 85
304
+
305
+ # Append to an array
306
+ pnpm config:set --key agents.methodology.principles --value Library-First,KISS
307
+ ```
308
+
309
+ ### Modifying WU YAML Specs
310
+
311
+ ```bash
312
+ # Edit WU fields (run --help for all available flags)
313
+ pnpm wu:edit --id WU-XXX --description "Updated description"
314
+
315
+ # Create new WU (never manually Write a YAML file)
316
+ pnpm wu:create --lane "Framework: Core" --title "Add feature" \
317
+ --description "..." --acceptance "..."
318
+ ```
319
+
320
+ ### Why This Matters
321
+
322
+ Raw-editing YAML files with Write/Edit tools bypasses:
323
+
324
+ 1. **Schema validation** -- `config:set` validates against the Zod schema
325
+ 2. **Atomic commits** -- `config:set` uses micro-worktree for safe writes
326
+ 3. **Audit trail** -- CLI commands produce structured log entries
327
+ 4. **Type coercion** -- Automatic boolean/number/array handling
328
+
329
+ **Exception:** Reading YAML files with the Read tool is acceptable for inspection.
330
+
331
+ For the full policy, see [.lumenflow/rules/yaml-editing-policy.md](../../../../../.lumenflow/rules/yaml-editing-policy.md) and Constraint 9 in [.lumenflow/constraints.md](../../../../../.lumenflow/constraints.md).
332
+
333
+ ---
334
+
277
335
  ## Common Failure Scenarios and Recovery
278
336
 
279
337
  ### Scenario 1: "BLOCKED: Direct commit to main"
@@ -565,7 +623,7 @@ rm -rf /tmp/nextjs-scaffold
565
623
 
566
624
  - [LUMENFLOW.md](../../../../../LUMENFLOW.md) - Main workflow documentation
567
625
  - [AGENTS.md](../../../../../AGENTS.md) - Universal agent entry point
568
- - [.lumenflow/constraints.md](../../../../../.lumenflow/constraints.md) - The 8 non-negotiable rules
626
+ - [.lumenflow/constraints.md](../../../../../.lumenflow/constraints.md) - The 9 non-negotiable rules
569
627
  - [troubleshooting-wu-done.md](troubleshooting-wu-done.md) - Why agents forget wu:done
570
628
  - [first-wu-mistakes.md](first-wu-mistakes.md) - Common mistakes to avoid
571
629
  - [quick-ref-commands.md](quick-ref-commands.md) - Command reference
@@ -50,10 +50,12 @@ cd /path/to/main && pnpm wu:done --id WU-XXX
50
50
  pnpm wu:block --id WU-XXX --reason "..."
51
51
  pnpm wu:unblock --id WU-XXX
52
52
 
53
- # Create (full spec)
54
- pnpm wu:create --id WU-999 --lane "Operations" --title "Add feature" \
53
+ # Create (full spec -- ID auto-generated)
54
+ pnpm wu:create --lane "Operations" --title "Add feature" \
55
55
  --description "Context: ... Problem: ... Solution: ..." \
56
56
  --acceptance "Feature works" --code-paths "src/a.ts" --validate
57
+ # Output: Created WU-999
58
+ # Note: Use --id only when re-creating a specific WU or for migration tooling.
57
59
 
58
60
  # Edit spec
59
61
  pnpm wu:edit --id WU-XXX --description "..." --acceptance "..."