@lumenflow/cli 2.4.0 → 2.5.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.
Files changed (147) hide show
  1. package/README.md +11 -8
  2. package/dist/__tests__/init-config-lanes.test.js +131 -0
  3. package/dist/__tests__/init-docs-structure.test.js +119 -0
  4. package/dist/__tests__/init-lane-inference.test.js +125 -0
  5. package/dist/__tests__/init-onboarding-docs.test.js +132 -0
  6. package/dist/__tests__/init-quick-ref.test.js +145 -0
  7. package/dist/__tests__/init-scripts.test.js +207 -0
  8. package/dist/__tests__/init-template-portability.test.js +97 -0
  9. package/dist/__tests__/init.test.js +7 -2
  10. package/dist/__tests__/initiative-add-wu.test.js +420 -0
  11. package/dist/__tests__/initiative-plan-replacement.test.js +162 -0
  12. package/dist/__tests__/initiative-remove-wu.test.js +458 -0
  13. package/dist/__tests__/onboarding-smoke-test.test.js +211 -0
  14. package/dist/__tests__/path-centralization-cli.test.js +234 -0
  15. package/dist/__tests__/plan-create.test.js +126 -0
  16. package/dist/__tests__/plan-edit.test.js +157 -0
  17. package/dist/__tests__/plan-link.test.js +239 -0
  18. package/dist/__tests__/plan-promote.test.js +181 -0
  19. package/dist/__tests__/templates-sync.test.js +219 -0
  20. package/dist/__tests__/wu-create-strict.test.js +118 -0
  21. package/dist/__tests__/wu-edit-strict.test.js +109 -0
  22. package/dist/__tests__/wu-validate-strict.test.js +113 -0
  23. package/dist/flow-bottlenecks.js +4 -2
  24. package/dist/gates.js +22 -0
  25. package/dist/init.js +670 -87
  26. package/dist/initiative-add-wu.js +112 -16
  27. package/dist/initiative-remove-wu.js +248 -0
  28. package/dist/onboarding-smoke-test.js +400 -0
  29. package/dist/orchestrate-init-status.js +37 -9
  30. package/dist/orchestrate-initiative.js +10 -4
  31. package/dist/plan-create.js +199 -0
  32. package/dist/plan-edit.js +235 -0
  33. package/dist/plan-link.js +233 -0
  34. package/dist/plan-promote.js +231 -0
  35. package/dist/sync-templates.js +137 -5
  36. package/dist/wu-block.js +16 -5
  37. package/dist/wu-claim.js +15 -9
  38. package/dist/wu-create.js +50 -2
  39. package/dist/wu-deps.js +3 -1
  40. package/dist/wu-done.js +14 -5
  41. package/dist/wu-edit.js +35 -0
  42. package/dist/wu-prep.js +131 -8
  43. package/dist/wu-spawn.js +14 -1
  44. package/dist/wu-unblock.js +34 -2
  45. package/dist/wu-validate.js +25 -17
  46. package/package.json +11 -7
  47. package/templates/core/.lumenflow/constraints.md.template +61 -3
  48. package/templates/core/AGENTS.md.template +2 -2
  49. package/templates/core/LUMENFLOW.md.template +85 -23
  50. package/templates/core/ai/onboarding/agent-invocation-guide.md.template +157 -0
  51. package/templates/core/ai/onboarding/agent-safety-card.md.template +227 -0
  52. package/templates/core/ai/onboarding/docs-generation.md.template +277 -0
  53. package/templates/core/ai/onboarding/first-wu-mistakes.md.template +49 -7
  54. package/templates/core/ai/onboarding/quick-ref-commands.md.template +343 -110
  55. package/templates/core/ai/onboarding/release-process.md.template +8 -2
  56. package/templates/core/ai/onboarding/starting-prompt.md.template +407 -0
  57. package/templates/core/ai/onboarding/test-ratchet.md.template +131 -0
  58. package/templates/core/ai/onboarding/troubleshooting-wu-done.md.template +91 -38
  59. package/templates/core/ai/onboarding/vendor-support.md.template +219 -0
  60. package/templates/vendors/claude/.claude/skills/context-management/SKILL.md.template +13 -1
  61. package/templates/vendors/claude/.claude/skills/execution-memory/SKILL.md.template +14 -16
  62. package/templates/vendors/claude/.claude/skills/orchestration/SKILL.md.template +48 -4
  63. package/templates/vendors/claude/.claude/skills/worktree-discipline/SKILL.md.template +5 -1
  64. package/templates/vendors/claude/.claude/skills/wu-lifecycle/SKILL.md.template +19 -8
  65. package/dist/__tests__/init-plan.test.js +0 -340
  66. package/dist/agent-issues-query.d.ts +0 -16
  67. package/dist/agent-log-issue.d.ts +0 -10
  68. package/dist/agent-session-end.d.ts +0 -10
  69. package/dist/agent-session.d.ts +0 -10
  70. package/dist/backlog-prune.d.ts +0 -84
  71. package/dist/cli-entry-point.d.ts +0 -8
  72. package/dist/deps-add.d.ts +0 -91
  73. package/dist/deps-remove.d.ts +0 -17
  74. package/dist/docs-sync.d.ts +0 -50
  75. package/dist/file-delete.d.ts +0 -84
  76. package/dist/file-edit.d.ts +0 -82
  77. package/dist/file-read.d.ts +0 -92
  78. package/dist/file-write.d.ts +0 -90
  79. package/dist/flow-bottlenecks.d.ts +0 -16
  80. package/dist/flow-report.d.ts +0 -16
  81. package/dist/gates.d.ts +0 -94
  82. package/dist/git-branch.d.ts +0 -65
  83. package/dist/git-diff.d.ts +0 -58
  84. package/dist/git-log.d.ts +0 -69
  85. package/dist/git-status.d.ts +0 -58
  86. package/dist/guard-locked.d.ts +0 -62
  87. package/dist/guard-main-branch.d.ts +0 -50
  88. package/dist/guard-worktree-commit.d.ts +0 -59
  89. package/dist/index.d.ts +0 -10
  90. package/dist/init-plan.d.ts +0 -80
  91. package/dist/init-plan.js +0 -337
  92. package/dist/init.d.ts +0 -46
  93. package/dist/initiative-add-wu.d.ts +0 -22
  94. package/dist/initiative-bulk-assign-wus.d.ts +0 -16
  95. package/dist/initiative-create.d.ts +0 -28
  96. package/dist/initiative-edit.d.ts +0 -34
  97. package/dist/initiative-list.d.ts +0 -12
  98. package/dist/initiative-status.d.ts +0 -11
  99. package/dist/lumenflow-upgrade.d.ts +0 -103
  100. package/dist/mem-checkpoint.d.ts +0 -16
  101. package/dist/mem-cleanup.d.ts +0 -29
  102. package/dist/mem-create.d.ts +0 -17
  103. package/dist/mem-export.d.ts +0 -10
  104. package/dist/mem-inbox.d.ts +0 -35
  105. package/dist/mem-init.d.ts +0 -15
  106. package/dist/mem-ready.d.ts +0 -16
  107. package/dist/mem-signal.d.ts +0 -16
  108. package/dist/mem-start.d.ts +0 -16
  109. package/dist/mem-summarize.d.ts +0 -22
  110. package/dist/mem-triage.d.ts +0 -22
  111. package/dist/metrics-cli.d.ts +0 -90
  112. package/dist/metrics-snapshot.d.ts +0 -18
  113. package/dist/orchestrate-init-status.d.ts +0 -11
  114. package/dist/orchestrate-initiative.d.ts +0 -12
  115. package/dist/orchestrate-monitor.d.ts +0 -11
  116. package/dist/release.d.ts +0 -117
  117. package/dist/rotate-progress.d.ts +0 -48
  118. package/dist/session-coordinator.d.ts +0 -74
  119. package/dist/spawn-list.d.ts +0 -16
  120. package/dist/state-bootstrap.d.ts +0 -92
  121. package/dist/sync-templates.d.ts +0 -52
  122. package/dist/trace-gen.d.ts +0 -84
  123. package/dist/validate-agent-skills.d.ts +0 -50
  124. package/dist/validate-agent-sync.d.ts +0 -36
  125. package/dist/validate-backlog-sync.d.ts +0 -37
  126. package/dist/validate-skills-spec.d.ts +0 -40
  127. package/dist/validate.d.ts +0 -60
  128. package/dist/wu-block.d.ts +0 -16
  129. package/dist/wu-claim.d.ts +0 -74
  130. package/dist/wu-cleanup.d.ts +0 -35
  131. package/dist/wu-create.d.ts +0 -69
  132. package/dist/wu-delete.d.ts +0 -21
  133. package/dist/wu-deps.d.ts +0 -13
  134. package/dist/wu-done.d.ts +0 -225
  135. package/dist/wu-edit.d.ts +0 -63
  136. package/dist/wu-infer-lane.d.ts +0 -17
  137. package/dist/wu-preflight.d.ts +0 -47
  138. package/dist/wu-prune.d.ts +0 -16
  139. package/dist/wu-recover.d.ts +0 -37
  140. package/dist/wu-release.d.ts +0 -19
  141. package/dist/wu-repair.d.ts +0 -60
  142. package/dist/wu-spawn-completion.d.ts +0 -10
  143. package/dist/wu-spawn.d.ts +0 -192
  144. package/dist/wu-status.d.ts +0 -25
  145. package/dist/wu-unblock.d.ts +0 -16
  146. package/dist/wu-unlock-lane.d.ts +0 -19
  147. package/dist/wu-validate.d.ts +0 -16
@@ -2,185 +2,418 @@
2
2
 
3
3
  **Last updated:** {{DATE}}
4
4
 
5
+ Complete reference for all CLI commands. Organized by category for quick discovery.
6
+
5
7
  ---
6
8
 
7
- ## Project Setup
9
+ ## Setup & Development
10
+
11
+ **For this monorepo (development):**
12
+
13
+ | Command | Description |
14
+ | ------------------------ | --------------------------------------- |
15
+ | `pnpm setup` | Install deps and build CLI (first time) |
16
+ | `pnpm build` | Build all packages |
17
+ | `pnpm build:dist` | Build distribution packages |
18
+ | `pnpm dev` | Start development mode |
19
+ | `pnpm clean` | Clean build artifacts and caches |
20
+ | `pnpm pack:all` | Pack all packages for distribution |
21
+ | `pnpm lumenflow:init` | Scaffold LumenFlow in a project |
22
+ | `pnpm docs:sync` | Sync agent docs (for upgrades) |
23
+ | `pnpm sync:templates` | Sync templates to project |
24
+ | `pnpm lumenflow:upgrade` | Upgrade LumenFlow packages |
25
+ | `pnpm lumenflow:doctor` | Diagnose LumenFlow configuration |
26
+
27
+ **For external projects (end users):**
28
+
29
+ ```bash
30
+ # Install CLI
31
+ pnpm add -D @lumenflow/cli # or: npm install -D @lumenflow/cli
32
+
33
+ # Initialize LumenFlow
34
+ pnpm exec lumenflow
8
35
 
9
- | Command | Description |
10
- | --------------------------------------------- | -------------------------------------------------- |
11
- | `pnpm exec lumenflow init` | Scaffold minimal LumenFlow core |
12
- | `pnpm exec lumenflow init --full` | Add docs + agent onboarding + task scaffolding |
13
- | `pnpm exec lumenflow init --framework <name>` | Add framework hint + overlay docs |
14
- | `pnpm exec lumenflow init --force` | Overwrite existing files |
15
- | `pnpm exec lumenflow docs:sync` | Sync agent docs to existing project (for upgrades) |
16
- | `pnpm exec lumenflow docs:sync --force` | Overwrite existing agent docs |
17
- | `pnpm exec lumenflow doctor` | Diagnose LumenFlow configuration issues |
36
+ # With client-specific overlays
37
+ pnpm exec lumenflow --client claude # Claude Code
38
+ pnpm exec lumenflow --client cursor # Cursor IDE
39
+ pnpm exec lumenflow --client all # All clients
40
+ ```
18
41
 
19
42
  ---
20
43
 
21
- ## WU Management
44
+ ## WU Lifecycle
45
+
46
+ | Command | Description |
47
+ | --------------------------------------------- | ---------------------------------------------- |
48
+ | `pnpm wu:create --id WU-XXX --lane <Lane> ..` | Create new WU spec (see required fields below) |
49
+ | `pnpm wu:claim --id WU-XXX --lane <Lane>` | Claim WU and create worktree |
50
+ | `pnpm wu:prep --id WU-XXX` | Run gates in worktree, prep for wu:done |
51
+ | `pnpm wu:done --id WU-XXX` | Complete WU (merge, stamp, cleanup) from main |
52
+ | `pnpm wu:edit --id WU-XXX --field value` | Edit WU spec fields |
53
+ | `pnpm wu:block --id WU-XXX --reason "..."` | Block WU with reason |
54
+ | `pnpm wu:unblock --id WU-XXX` | Unblock WU |
55
+ | `pnpm wu:release --id WU-XXX` | Release orphaned WU (in_progress to ready) |
56
+ | `pnpm wu:status --id WU-XXX` | Show WU status, location, valid commands |
57
+ | `pnpm wu:spawn --id WU-XXX --client <client>` | Generate sub-agent spawn prompt |
58
+ | `pnpm wu:spawn --id WU-XXX --no-context` | Spawn prompt without memory context injection |
59
+
60
+ ### WU Maintenance
61
+
62
+ | Command | Description |
63
+ | -------------------------------- | ---------------------------------------- |
64
+ | `pnpm wu:validate --id WU-XXX` | Validate WU spec |
65
+ | `pnpm wu:preflight --id WU-XXX` | Pre-flight checks before wu:done |
66
+ | `pnpm wu:recover --id WU-XXX` | Analyze and fix WU state inconsistencies |
67
+ | `pnpm wu:repair --id WU-XXX` | Repair WU state issues |
68
+ | `pnpm wu:prune` | Clean stale worktrees |
69
+ | `pnpm wu:cleanup --id WU-XXX` | Cleanup after PR merge (PR-only) |
70
+ | `pnpm wu:deps --id WU-XXX` | Show WU dependencies |
71
+ | `pnpm wu:infer-lane --id WU-XXX` | Infer lane from code paths/description |
72
+ | `pnpm wu:delete --id WU-XXX` | Delete WU spec and cleanup |
73
+ | `pnpm wu:unlock-lane --lane <L>` | Unlock stuck lane |
22
74
 
23
- | Command | Description |
24
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
25
- | `pnpm wu:create --id WU-XXX --lane <Lane> --title "Title" --description "..." --acceptance "..." --code-paths "path" --test-paths-unit "path" --exposure backend-only --spec-refs "lumenflow://plans/WU-XXX-plan.md"` | Create new WU (default: spec branch mode) |
26
- | `pnpm wu:create ... --direct` | Create WU directly on main (legacy/emergency) |
27
- | `pnpm wu:create ... --plan` | Also create plan template in $LUMENFLOW_HOME/plans/ |
28
- | `pnpm wu:claim --id WU-XXX --lane <Lane>` | Claim WU (auto-merges spec branch if needed) |
29
- | `pnpm wu:spawn --id WU-XXX --client <client>` | Spawn sub-agent prompt with client guidance |
30
- | `pnpm wu:edit --id WU-1039 --exposure backend-only` | Edit WU spec (supports exposure updates on done WUs) |
31
- | `pnpm wu:done --id WU-XXX` | Complete WU (merge, stamp, cleanup) - primary method |
32
- | `pnpm wu:block --id WU-XXX --reason "Reason"` | Block a WU |
33
- | `pnpm wu:unblock --id WU-XXX` | Unblock a WU |
34
- | `pnpm wu:cleanup --id WU-XXX` | PR-only: cleanup after PR merge (see note below) |
35
- | `pnpm wu:cleanup --artifacts` | Remove build artifacts in current worktree |
36
- | `pnpm wu:delete --id WU-XXX` | Delete WU spec and cleanup |
37
- | `pnpm wu:unlock-lane --lane <Lane>` | Unlock stuck lane |
75
+ ---
38
76
 
39
- ### wu:done vs wu:cleanup
77
+ ## Gates & Quality
78
+
79
+ | Command | Description |
80
+ | --------------------------------- | -------------------------------- |
81
+ | `pnpm gates` | Run all quality gates |
82
+ | `pnpm gates --docs-only` | Run gates for docs changes |
83
+ | `pnpm format` | Format all files (Prettier) |
84
+ | `pnpm format:check` | Check formatting without changes |
85
+ | `pnpm lint` | Run ESLint |
86
+ | `pnpm typecheck` | Run TypeScript type checking |
87
+ | `pnpm test` | Run all tests (Vitest) |
88
+ | `pnpm spec:linter` | Validate WU specs (all) |
89
+ | `pnpm lane:health` | Check lane config health |
90
+ | `pnpm lane:suggest --paths "..."` | Suggest lane for code paths |
40
91
 
41
- **IMPORTANT:** Use `wu:done` for completing WUs. `wu:cleanup` is NOT a replacement for `wu:done`.
92
+ ---
42
93
 
43
- | Command | Purpose | When to Use |
44
- | ------------ | ------------------------------------------ | ------------------------------ |
45
- | `wu:done` | Complete WU: run gates, merge, stamp, push | Always use this to finish a WU |
46
- | `wu:cleanup` | Remove worktree/branch after PR merge | PR-based workflows only (rare) |
94
+ ## Memory & Sessions
95
+
96
+ | Command | Description |
97
+ | ----------------------------------- | ---------------------------------- |
98
+ | `pnpm mem:init --wu WU-XXX` | Initialize memory for WU |
99
+ | `pnpm mem:start --wu WU-XXX` | Start a memory session |
100
+ | `pnpm mem:checkpoint --wu WU-XXX` | Save progress checkpoint |
101
+ | `pnpm mem:ready --wu WU-XXX` | Check pending nodes |
102
+ | `pnpm mem:export --wu WU-XXX` | Export memory as markdown |
103
+ | `pnpm mem:create "msg" --wu WU-XXX` | Create memory node (bug discovery) |
104
+ | `pnpm mem:signal "msg" --wu WU-XXX` | Broadcast coordination signal |
105
+ | `pnpm mem:inbox --wu WU-XXX` | Check coordination signals |
106
+ | `pnpm mem:summarize --wu WU-XXX` | Summarize memory context |
107
+ | `pnpm mem:triage --wu WU-XXX` | Triage discovered bugs |
108
+ | `pnpm mem:context --wu WU-XXX` | Get context for current lane/WU |
109
+ | `pnpm mem:context ... --lane <L>` | Filter context by lane (WU-1292) |
110
+ | `pnpm mem:delete --id <node-id>` | Delete/archive a memory node |
111
+ | `pnpm mem:cleanup` | Clean up stale memory data |
47
112
 
48
- **wu:cleanup is PR-only:** When `gh` CLI is available, `wu:cleanup` requires the PR to be merged before it will run. It checks the PR merge status via GitHub API and blocks if the PR is not merged. This prevents accidental cleanup of work-in-progress WUs.
113
+ ---
49
114
 
50
- **Common mistake:** Agents sometimes try to run `wu:cleanup` after `wu:done` fails. This is incorrect. If `wu:done` fails:
115
+ ## State Management
51
116
 
52
- 1. Fix the underlying issue (gate failures, merge conflicts, etc.)
53
- 2. Re-run `wu:done --id WU-XXX`
117
+ | Command | Description |
118
+ | ---------------------- | --------------------------- |
119
+ | `pnpm state:doctor` | Diagnose state store issues |
120
+ | `pnpm state:cleanup` | Clean up stale state data |
121
+ | `pnpm signal:cleanup` | Clean up stale signals |
122
+ | `pnpm state:bootstrap` | Bootstrap state store |
123
+ | `pnpm backlog:prune` | Clean stale backlog entries |
54
124
 
55
- Do NOT use `wu:cleanup` to work around `wu:done` failures.
125
+ ---
56
126
 
57
- ### wu:edit Write Modes
127
+ ## Dependencies
58
128
 
59
- `wu:edit` has two distinct modes depending on WU status:
129
+ | Command | Description |
130
+ | ------------------------------- | ------------------------------ |
131
+ | `pnpm deps:add --pkg <name>` | Add dependency to package |
132
+ | `pnpm deps:remove --pkg <name>` | Remove dependency from package |
60
133
 
61
- | WU Status | Write Mode | Target Location |
62
- | ------------- | -------------- | --------------------------------- |
63
- | `ready` | MICRO_WORKTREE | main (via temp branch + ff-merge) |
64
- | `in_progress` | WORKTREE | Active worktree directly |
134
+ ---
135
+
136
+ ## Plans
137
+
138
+ 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`).
65
139
 
66
- **Key behavior:**
140
+ ### Plan Storage
67
141
 
68
- - **Ready WUs**: Edits go to main via a micro-worktree transaction (same as `wu:create`)
69
- - **In-progress WUs**: Edits write directly to the active worktree's WU YAML file
142
+ Plans are stored in the repo at `docs/04-operations/plans/` by default (configurable via `directories.plansDir` in `.lumenflow.config.yaml`).
70
143
 
71
- This means `wu:edit` on an `in_progress` WU automatically propagates to the worktree - no manual sync needed. When `wu:done` runs, it uses `readWUPreferWorktree()` which reads from the worktree first, ensuring your edits are preserved.
144
+ | Command | Description |
145
+ | ----------------------------------------------------- | ------------------------------------------- |
146
+ | `pnpm initiative:plan --initiative INIT-XXX` | Link existing plan to initiative |
147
+ | `pnpm initiative:plan --initiative INIT-XXX --create` | Create plan template and link to initiative |
72
148
 
73
- **Common confusion:** Agents sometimes think they need to manually sync edits to the worktree. This is unnecessary - `wu:edit` handles it automatically based on WU status.
149
+ ### Linking Plans
150
+
151
+ **To an initiative:**
152
+
153
+ ```bash
154
+ # Create a new plan template
155
+ pnpm initiative:plan --initiative INIT-001 --create
156
+
157
+ # Link an existing plan file
158
+ pnpm initiative:plan --initiative INIT-001 --plan docs/04-operations/plans/my-plan.md
159
+ ```
160
+
161
+ **To a WU (via spec_refs):**
162
+
163
+ ```bash
164
+ # When creating a WU
165
+ pnpm wu:create --id WU-123 --lane "Framework: Core" --title "Feature" \
166
+ --spec-refs "lumenflow://plans/WU-123-plan.md"
167
+
168
+ # Or edit an existing WU
169
+ pnpm wu:edit --id WU-123 --spec-refs "lumenflow://plans/WU-123-plan.md"
170
+ ```
171
+
172
+ ### Plan URI Format
173
+
174
+ Plans use the `lumenflow://plans/` URI scheme for references:
175
+
176
+ - `lumenflow://plans/INIT-001-auth-system.md` - Initiative plan
177
+ - `lumenflow://plans/WU-123-plan.md` - WU-specific plan
74
178
 
75
179
  ---
76
180
 
77
- ## Gates
181
+ ## Initiatives
78
182
 
79
- | Command | Description |
80
- | ------------------------ | -------------------------- |
81
- | `pnpm gates` | Run all quality gates |
82
- | `pnpm gates --docs-only` | Run gates for docs changes |
83
- | `pnpm format` | Format all files |
84
- | `pnpm lint` | Run linter |
85
- | `pnpm typecheck` | Run TypeScript check |
86
- | `pnpm test` | Run tests |
87
- | `pnpm lane:health` | Check lane config health |
88
- | `pnpm lane:suggest` | Suggest lane for code paths|
183
+ | Command | Description |
184
+ | ------------------------------------------------------------- | ----------------------------- |
185
+ | `pnpm initiative:create --id INIT-XXX ...` | Create new initiative |
186
+ | `pnpm initiative:edit --id INIT-XXX ...` | Edit initiative fields |
187
+ | `pnpm initiative:list` | List all initiatives |
188
+ | `pnpm initiative:status --id INIT-XXX` | Show initiative status |
189
+ | `pnpm initiative:add-wu --initiative INIT-XXX --wu WU-XXX` | Add WU to initiative |
190
+ | `pnpm initiative:remove-wu --initiative INIT-XXX --wu WU-XXX` | Remove WU from initiative |
191
+ | `pnpm initiative:bulk-assign --id INIT-XXX` | Bulk assign WUs to initiative |
89
192
 
90
193
  ---
91
194
 
92
- ## Memory (Session Context)
195
+ ## Orchestration
93
196
 
94
- | Command | Description |
95
- | --------------------------------- | -------------------------- |
96
- | `pnpm mem:init --wu WU-XXX` | Initialize memory for WU |
97
- | `pnpm mem:checkpoint --wu WU-XXX` | Save progress checkpoint |
98
- | `pnpm mem:ready --wu WU-XXX` | Check pending nodes |
99
- | `pnpm mem:inbox --wu WU-XXX` | Check coordination signals |
197
+ | Command | Description |
198
+ | -------------------------------------------- | -------------------------------- |
199
+ | `pnpm orchestrate:initiative --id INIT-XXX` | Orchestrate initiative execution |
200
+ | `pnpm orchestrate:init-status --id INIT-XXX` | Compact initiative progress view |
201
+ | `pnpm orchestrate:monitor` | Monitor spawn/agent activity |
202
+ | `pnpm spawn:list` | List active spawned agents |
100
203
 
101
204
  ---
102
205
 
103
- ## Git (Safe Operations)
206
+ ## Metrics & Flow
104
207
 
105
- | Command | Description |
106
- | ------------------------------------ | ------------------------- |
107
- | `git status` | Check working tree status |
108
- | `git add .` | Stage all changes |
109
- | `git commit -m "type: message"` | Commit with message |
110
- | `git push origin lane/<lane>/wu-xxx` | Push to remote |
111
- | `git fetch origin` | Fetch remote changes |
112
- | `git rebase origin/main` | Update from main |
208
+ | Command | Description |
209
+ | ----------------------- | ---------------------------- |
210
+ | `pnpm flow:report` | Generate flow metrics report |
211
+ | `pnpm flow:bottlenecks` | Identify flow bottlenecks |
212
+ | `pnpm metrics:snapshot` | Capture metrics snapshot |
113
213
 
114
214
  ---
115
215
 
116
- ## Navigation
216
+ ## Documentation
117
217
 
118
- ```bash
119
- # After claiming, go to worktree
120
- cd worktrees/<lane>-wu-xxx
218
+ | Command | Description |
219
+ | -------------------- | -------------------------- |
220
+ | `pnpm docs:generate` | Generate CLI documentation |
221
+ | `pnpm docs:validate` | Validate CLI documentation |
121
222
 
122
- # Return to main for wu:done
123
- cd /path/to/main
124
- ```
223
+ ---
224
+
225
+ ## Release
226
+
227
+ | Command | Description |
228
+ | ------------------------ | ------------------------------- |
229
+ | `pnpm release` | Run release workflow |
230
+ | `pnpm pre-release:check` | Pre-release validation checks |
231
+ | `pnpm changeset` | Create changeset for versioning |
232
+ | `pnpm version` | Apply changeset versions |
233
+ | `pnpm release:changeset` | Build and publish via changeset |
234
+
235
+ ---
236
+
237
+ ## Agent Utilities
238
+
239
+ | Command | Description |
240
+ | ------------------------- | ---------------------------------- |
241
+ | `pnpm agent:issues-query` | Query GitHub issues for agent work |
125
242
 
126
243
  ---
127
244
 
128
- ## Workflow Sequence
245
+ ## Workflow Sequence (Quick Reference)
129
246
 
130
247
  ```bash
131
- # 1. Create (default: spec branch mode, never writes to main)
132
- pnpm wu:create --id WU-001 --lane "Framework: Core" --title "Add feature" \
133
- --description "Context: ...\nProblem: ...\nSolution: ..." \
248
+ # 1. Create WU
249
+ pnpm wu:create --id WU-XXX --lane "Framework: Core" --title "Add feature" \
250
+ --description "Context: ... Problem: ... Solution: ..." \
134
251
  --acceptance "Criterion 1" --acceptance "Criterion 2" \
135
- --code-paths "packages/@lumenflow/core/src/example.ts" \
136
- --test-paths-unit "packages/@lumenflow/core/__tests__/example.test.ts" \
252
+ --code-paths "src/file.ts" \
253
+ --test-paths-unit "src/__tests__/file.test.ts" \
137
254
  --exposure backend-only \
138
- --spec-refs "lumenflow://plans/WU-001-plan.md"
255
+ --spec-refs "~/.lumenflow/plans/WU-XXX-plan.md"
139
256
 
140
- # 2. Claim (auto-merges spec/wu-001 to main, creates worktree)
141
- pnpm wu:claim --id WU-001 --lane "Framework: Core"
142
- cd worktrees/framework-core-wu-001
257
+ # 2. Claim (creates worktree)
258
+ pnpm wu:claim --id WU-XXX --lane "Framework: Core"
259
+ cd worktrees/framework-core-wu-xxx
143
260
 
144
- # 3. Work (TDD)
261
+ # 3. Implement (TDD)
145
262
  # ... write tests first, then code ...
146
263
 
147
264
  # 4. Commit
148
- git add .
149
- git commit -m "feat: add feature"
150
- git push origin lane/framework-core/wu-001
265
+ git add . && git commit -m "feat: description"
151
266
 
152
- # 5. Gates
153
- pnpm gates
267
+ # 5. Prep (runs gates in worktree)
268
+ pnpm wu:prep --id WU-XXX
154
269
 
155
- # 6. Complete
156
- cd /path/to/main
157
- pnpm wu:done --id WU-001
270
+ # 6. Complete (from main - copy from wu:prep output)
271
+ cd /path/to/main && pnpm wu:done --id WU-XXX
158
272
  ```
159
273
 
160
274
  ---
161
275
 
162
- ## Commit Message Format
276
+ ## wu:create Required Fields (Code WUs)
277
+
278
+ For code changes, you must include **all** of the following (or wu:create will fail):
279
+
280
+ - `--description`
281
+ - `--acceptance` (repeatable, at least one)
282
+ - `--code-paths` (repeatable)
283
+ - `--test-paths-unit` or `--test-paths-e2e` (automated tests required)
284
+ - `--exposure` (ui | api | backend-only | documentation)
285
+ - `--spec-refs` (required for type: feature)
286
+
287
+ Documentation WUs can omit code/test paths but should set `--type documentation` and `--exposure documentation`.
288
+
289
+ ---
290
+
291
+ ## Strict WU Validation (WU-1329)
292
+
293
+ **WU validation is strict by default.** Commands validate that code paths and test paths actually exist on disk.
294
+
295
+ ### Affected Commands
163
296
 
297
+ | Command | Strict Behavior |
298
+ | ------------------- | --------------------------------------------------- |
299
+ | `wu:create` | Validates `--code-paths` and `--test-paths-*` exist |
300
+ | `wu:edit` | Validates edited paths exist |
301
+ | `wu:validate` | Treats warnings as errors by default |
302
+ | `initiative:add-wu` | Validates WU schema and completeness before linking |
303
+
304
+ ### Strict Mode (Default)
305
+
306
+ When strict validation runs:
307
+
308
+ - Non-existent `code_paths` cause **failure**
309
+ - Non-existent `test_paths` cause **failure**
310
+ - Validation warnings are treated as **errors**
311
+
312
+ This prevents WU specs from referencing files that do not exist, improving spec quality and reducing broken WUs.
313
+
314
+ ### Bypassing Strict Validation
315
+
316
+ Use `--no-strict` to bypass path existence checks (not recommended):
317
+
318
+ ```bash
319
+ # Create WU with paths that don't exist yet (planning ahead)
320
+ pnpm wu:create --lane "Framework: Core" --title "New feature" \
321
+ --code-paths "src/new-file.ts" \
322
+ --no-strict
323
+
324
+ # Validate with warnings as advisory only
325
+ pnpm wu:validate --id WU-XXX --no-strict
164
326
  ```
165
- type(scope): description
166
327
 
167
- Types: feat, fix, docs, style, refactor, test, chore
328
+ **When to use `--no-strict`:**
329
+
330
+ - Planning WUs before implementation (paths don't exist yet)
331
+ - Migrating specs from external systems
332
+ - Emergency situations (logged for audit)
333
+
334
+ **Usage is logged** for accountability.
335
+
336
+ ### Agent Expectations
337
+
338
+ Agents should:
339
+
340
+ 1. **Prefer strict mode** (default) for all WU operations
341
+ 2. **Avoid `--no-strict`** unless explicitly necessary
342
+ 3. **Fix path issues** rather than bypassing validation
343
+ 4. **Create files first** before referencing them in WU specs
344
+
345
+ ---
346
+
347
+ ## Lane Inference Requirement (Sub-Lanes)
348
+
349
+ If you use a sub-lane like `Experience: UI`, you **must** have a lane taxonomy:
350
+
351
+ - Ensure `.lumenflow.lane-inference.yaml` exists, or
352
+ - Generate it with `pnpm lane:suggest --output .lumenflow.lane-inference.yaml`
353
+
354
+ Without this file, sub-lane validation will fail.
355
+
356
+ ---
357
+
358
+ ## Local / Offline Behavior (No Remote)
359
+
360
+ By default, `wu:create` and `wu:claim` expect an `origin` remote and will fetch `origin/main`.
361
+
362
+ For local-only or offline development, add this to `.lumenflow.config.yaml`:
363
+
364
+ ```yaml
365
+ git:
366
+ requireRemote: false
168
367
  ```
169
368
 
170
- Examples:
369
+ When `requireRemote: false`:
370
+
371
+ - `wu:create` skips remote fetch operations
372
+ - `wu:claim` works without pushing to origin
373
+ - Useful for air-gapped environments, testing/evaluation, or pre-remote development
374
+
375
+ When `requireRemote: true` (default):
171
376
 
172
- - `feat(api): add user endpoint`
173
- - `fix(auth): resolve token expiry`
174
- - `docs: update README`
175
- - `test: add unit tests for calculator`
377
+ - Operations fail with a clear error if no `origin` remote exists
378
+ - Ensures team visibility via remote branches
176
379
 
177
380
  ---
178
381
 
179
- ## File Paths
382
+ ## Key File Paths
180
383
 
181
384
  | Path | Description |
182
385
  | ----------------------------------------- | -------------------- |
183
386
  | `docs/04-operations/tasks/wu/WU-XXX.yaml` | WU specification |
184
387
  | `docs/04-operations/tasks/status.md` | Current status board |
388
+ | `docs/04-operations/tasks/backlog.md` | Backlog summary |
185
389
  | `.lumenflow/stamps/WU-XXX.done` | Completion stamp |
186
390
  | `worktrees/<lane>-wu-xxx/` | Worktree directory |
391
+
392
+ ---
393
+
394
+ ## Common Patterns
395
+
396
+ ### wu:prep + wu:done (Two-Step Completion)
397
+
398
+ ```bash
399
+ # From worktree: run gates, get instruction
400
+ pnpm wu:prep --id WU-XXX
401
+ # Output: cd /path/to/main && pnpm wu:done --id WU-XXX
402
+
403
+ # From main: merge, stamp, cleanup
404
+ cd /path/to/main && pnpm wu:done --id WU-XXX
405
+ ```
406
+
407
+ ### Memory Checkpoint (Progress Safety)
408
+
409
+ ```bash
410
+ pnpm mem:checkpoint --wu WU-XXX # Before risky operations
411
+ pnpm mem:inbox --since 30m # Check for signals (NOT TaskOutput)
412
+ ```
413
+
414
+ ### Bug Discovery (Mid-WU)
415
+
416
+ ```bash
417
+ # Capture bug, don't fix out-of-scope
418
+ pnpm mem:create 'Bug: description' --type discovery --tags bug --wu WU-XXX
419
+ ```
@@ -171,6 +171,8 @@ npm view @lumenflow/cli versions --json | tail -5
171
171
 
172
172
  The public docs at <https://lumenflow.dev> are built from `apps/docs/`.
173
173
 
174
+ **Automatic Generation:** CLI and config reference docs are automatically generated from code. See [Automatic Docs Generation](./docs-generation.md) for details on the single-source-of-truth pattern.
175
+
174
176
  ### Deployment
175
177
 
176
178
  Starlight docs are deployed **manually** via Vercel CLI:
@@ -238,6 +240,7 @@ The `apps/github-app/package.json` must have `"private": true` to prevent npm pu
238
240
 
239
241
  - [ ] All acceptance criteria met
240
242
  - [ ] Gates pass (`pnpm gates`)
243
+ - [ ] Pre-release checks pass (`pnpm pre-release:check`)
241
244
  - [ ] CHANGELOG updated (if maintained)
242
245
 
243
246
  ### Release Steps (Automated)
@@ -261,6 +264,7 @@ If you need more control:
261
264
  1. **Complete WU** (includes version bump commit)
262
265
 
263
266
  ```bash
267
+ pnpm pre-release:check
264
268
  pnpm wu:done --id WU-XXXX
265
269
  ```
266
270
 
@@ -303,12 +307,14 @@ If you need more control:
303
307
 
304
308
  | Change Type | npm | Docs | GitHub App |
305
309
  | ---------------- | ------------- | ------ | ------------ |
306
- | Bug fix in CLI | Tag + publish | No | No |
307
- | New CLI command | Tag + publish | Update | No |
310
+ | Bug fix in CLI | Tag + publish | Auto\* | No |
311
+ | New CLI command | Tag + publish | Auto\* | No |
308
312
  | Docs-only update | No | Deploy | No |
309
313
  | GitHub App fix | No | No | Auto on push |
310
314
  | Full release | Tag + publish | Deploy | Auto |
311
315
 
316
+ \* CLI/config reference docs regenerate automatically during `wu:done` when trigger files change. See [Automatic Docs Generation](./docs-generation.md).
317
+
312
318
  ---
313
319
 
314
320
  ## Troubleshooting Deployments