@lumenflow/cli 3.18.0 → 3.19.0

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 (63) hide show
  1. package/README.md +44 -43
  2. package/dist/config-set.js +10 -1
  3. package/dist/config-set.js.map +1 -1
  4. package/dist/docs-sync.js +123 -6
  5. package/dist/docs-sync.js.map +1 -1
  6. package/dist/gate-co-change.js +28 -6
  7. package/dist/gate-co-change.js.map +1 -1
  8. package/dist/gates-runners.js +108 -12
  9. package/dist/gates-runners.js.map +1 -1
  10. package/dist/initiative-edit.js +8 -3
  11. package/dist/initiative-edit.js.map +1 -1
  12. package/dist/lumenflow-upgrade.js +50 -0
  13. package/dist/lumenflow-upgrade.js.map +1 -1
  14. package/dist/public-manifest.js +1 -1
  15. package/dist/public-manifest.js.map +1 -1
  16. package/dist/sync-templates.js +13 -0
  17. package/dist/sync-templates.js.map +1 -1
  18. package/dist/wu-block.js +10 -0
  19. package/dist/wu-block.js.map +1 -1
  20. package/dist/wu-claim-validation.js +3 -1
  21. package/dist/wu-claim-validation.js.map +1 -1
  22. package/dist/wu-claim.js +3 -1
  23. package/dist/wu-claim.js.map +1 -1
  24. package/dist/wu-done-memory-telemetry.js +5 -1
  25. package/dist/wu-done-memory-telemetry.js.map +1 -1
  26. package/dist/wu-done-ownership.js +6 -0
  27. package/dist/wu-done-ownership.js.map +1 -1
  28. package/dist/wu-edit-operations.js +4 -4
  29. package/dist/wu-edit-operations.js.map +1 -1
  30. package/dist/wu-prep.js +88 -13
  31. package/dist/wu-prep.js.map +1 -1
  32. package/dist/wu-recover.js +15 -0
  33. package/dist/wu-recover.js.map +1 -1
  34. package/dist/wu-release.js +10 -1
  35. package/dist/wu-release.js.map +1 -1
  36. package/dist/wu-spawn-prompt-builders.js +27 -2
  37. package/dist/wu-spawn-prompt-builders.js.map +1 -1
  38. package/dist/wu-state-mutation-ownership.js +136 -0
  39. package/dist/wu-state-mutation-ownership.js.map +1 -0
  40. package/dist/wu-unblock.js +10 -0
  41. package/dist/wu-unblock.js.map +1 -1
  42. package/package.json +111 -110
  43. package/packs/agent-runtime/.turbo/turbo-build.log +1 -1
  44. package/packs/agent-runtime/package.json +1 -1
  45. package/packs/sidekick/.turbo/turbo-build.log +1 -1
  46. package/packs/sidekick/package.json +1 -1
  47. package/packs/software-delivery/.turbo/turbo-build.log +1 -1
  48. package/packs/software-delivery/package.json +1 -1
  49. package/templates/core/AGENTS.md.template +157 -32
  50. package/templates/core/LUMENFLOW.md.template +44 -29
  51. package/templates/core/_frameworks/lumenflow/wu-sizing-guide.md.template +644 -0
  52. package/templates/core/ai/onboarding/agent-invocation-guide.md.template +5 -5
  53. package/templates/core/ai/onboarding/agent-safety-card.md.template +1 -0
  54. package/templates/core/ai/onboarding/docs-generation.md.template +94 -4
  55. package/templates/core/ai/onboarding/first-15-mins.md.template +1 -1
  56. package/templates/core/ai/onboarding/first-wu-mistakes.md.template +2 -1
  57. package/templates/core/ai/onboarding/initiative-orchestration.md.template +21 -21
  58. package/templates/core/ai/onboarding/quick-ref-commands.md.template +102 -95
  59. package/templates/core/ai/onboarding/release-process.md.template +12 -12
  60. package/templates/core/ai/onboarding/starting-prompt.md.template +31 -31
  61. package/templates/vendors/claude/.claude/skills/initiative-management/SKILL.md.template +2 -2
  62. package/templates/vendors/claude/.claude/skills/multi-agent-coordination/SKILL.md.template +2 -2
  63. package/templates/vendors/claude/.claude/skills/orchestration/SKILL.md.template +3 -3
@@ -14,6 +14,87 @@ LumenFlow automatically generates CLI and configuration reference documentation
14
14
  | ---------------- | --------------------------------------------------------- | ------------------------------------------------- |
15
15
  | CLI Reference | `packages/@lumenflow/cli/src/**` | `apps/docs/src/content/docs/reference/cli.mdx` |
16
16
  | Config Reference | `packages/@lumenflow/core/src/lumenflow-config-schema.ts` | `apps/docs/src/content/docs/reference/config.mdx` |
17
+ | MCP Reference | `packages/@lumenflow/mcp/src/tools.ts` | `apps/docs/src/content/docs/reference/mcp.mdx` |
18
+
19
+ ## Example Tagging Conventions
20
+
21
+ Docs example parity now distinguishes between copy-paste workflow examples and illustrative
22
+ snippets:
23
+
24
+ - `<!-- lumenflow-example: strict -->` marks a code block as a copy-paste example. Use this when
25
+ the block is intended to reflect the current command surface and full workflow ordering.
26
+ - `<!-- lumenflow-example: illustrative -->` marks a block as explanatory only. It is still
27
+ scanned for obvious command drift where practical, but it is excluded from strict workflow checks
28
+ such as `wu:claim` → `wu:brief` → `wu:prep` → `wu:done`.
29
+ - `<!-- lumenflow-example: historical -->`, `legacy`, and `placeholder` are reserved for
30
+ compatibility, migration, or incomplete examples that intentionally do not match the current
31
+ live command surface.
32
+ - Strict CLI shell examples are additionally validated against the live `pnpm <command> --help`
33
+ surface for each referenced public command. Unknown flags, retired option names, and missing
34
+ required option values fail docs parity.
35
+ - Strict YAML and JSON config examples are additionally validated against the live configuration
36
+ schemas. Unknown keys, invalid shapes, and stale config forms fail docs parity.
37
+ - Strict MCP JSON payload examples with `"name"` and `"arguments"` are additionally validated
38
+ against the live MCP registry and the target tool's input schema. Required fields, enum values,
39
+ and payload shapes must all remain valid.
40
+
41
+ Place the comment immediately above the fenced code block it applies to:
42
+
43
+ ````md
44
+ <!-- lumenflow-example: illustrative -->
45
+
46
+ ```bash
47
+ pnpm wu:status --id WU-123
48
+ ```
49
+ ````
50
+
51
+ If no tag is present, shell code blocks are treated as illustrative by default. Add a `strict` tag
52
+ whenever readers are expected to copy-paste a current workflow or command sequence.
53
+
54
+ For strict CLI examples, prefer complete commands that reflect the live flag surface:
55
+
56
+ ````md
57
+ <!-- lumenflow-example: strict -->
58
+
59
+ ```bash
60
+ pnpm wu:create --lane "Framework: Core" --title "Add feature" \
61
+ --description "Context: ... Problem: ... Solution: ..." \
62
+ --acceptance "Criterion 1" \
63
+ --code-paths "src/file.ts" \
64
+ --test-paths-unit "src/__tests__/file.test.ts" \
65
+ --exposure backend-only
66
+ ```
67
+ ````
68
+
69
+ For strict config examples, prefer a real schema-backed snippet instead of pseudocode:
70
+
71
+ ````md
72
+ <!-- lumenflow-example: strict -->
73
+
74
+ ```yaml
75
+ software_delivery:
76
+ gates:
77
+ minCoverage: 90
78
+ ```
79
+ ````
80
+
81
+ For MCP payload examples, prefer:
82
+
83
+ ````md
84
+ <!-- lumenflow-example: strict -->
85
+
86
+ ```json
87
+ {
88
+ "name": "wu_status",
89
+ "arguments": {
90
+ "id": "WU-1234"
91
+ }
92
+ }
93
+ ```
94
+ ````
95
+
96
+ Use `illustrative` when a payload is intentionally partial or schematic and should not be enforced
97
+ against the full schema.
17
98
 
18
99
  ---
19
100
 
@@ -117,8 +198,9 @@ This runs `tools/generate-cli-docs.ts` which:
117
198
  1. Extracts command metadata from CLI package.json bin entries
118
199
  2. Imports WU_OPTIONS from `@lumenflow/core` for option definitions
119
200
  3. Extracts config schemas using Zod 4's native `toJSONSchema()`
120
- 4. Generates MDX files with tables and code blocks
121
- 5. Formats output with Prettier
201
+ 4. Reads the built MCP tool registry from `packages/@lumenflow/mcp/dist/tools.js`
202
+ 5. Generates MDX files with tables and code blocks
203
+ 6. Formats output with Prettier
122
204
 
123
205
  ### Validate Documentation
124
206
 
@@ -149,7 +231,8 @@ The generator is integrated into Turbo for caching:
149
231
  ],
150
232
  "outputs": [
151
233
  "apps/docs/src/content/docs/reference/cli.mdx",
152
- "apps/docs/src/content/docs/reference/config.mdx"
234
+ "apps/docs/src/content/docs/reference/config.mdx",
235
+ "apps/docs/src/content/docs/reference/mcp.mdx"
153
236
  ]
154
237
  }
155
238
  ```
@@ -164,7 +247,7 @@ The generator is integrated into Turbo for caching:
164
247
 
165
248
  ## Output Files
166
249
 
167
- The generator produces two MDX files:
250
+ The generator produces three MDX files:
168
251
 
169
252
  ### CLI Reference (`cli.mdx`)
170
253
 
@@ -180,6 +263,13 @@ The generator produces two MDX files:
180
263
  - Environment variable overrides documented
181
264
  - Validation command shown
182
265
 
266
+ ### MCP Reference (`mcp.mdx`)
267
+
268
+ - Generated from the live MCP tool registry in `packages/@lumenflow/mcp/src/tools.ts`
269
+ - Category counts derived from the registered tool set at generation time
270
+ - Per-tool headings and input parameter tables generated from tool schemas
271
+ - Validation fails if the committed MCP reference drifts from the registry
272
+
183
273
  ---
184
274
 
185
275
  ## Adding New CLI Commands
@@ -10,7 +10,7 @@ A fast start for agents entering an existing LumenFlow project.
10
10
 
11
11
  ```bash
12
12
  ls LUMENFLOW.md AGENTS.md workspace.yaml
13
- pnpm exec lumenflow doctor
13
+ pnpm lumenflow:doctor
14
14
  ```
15
15
 
16
16
  If the doctor reports a repo-level problem, stop there and fix it before claiming work.
@@ -22,6 +22,7 @@ git push origin main
22
22
  ```bash
23
23
  # Claim first, then work in worktree
24
24
  pnpm wu:claim --id WU-123 --lane Core
25
+ pnpm wu:brief --id WU-123 --client <client>
25
26
  cd worktrees/core-wu-123
26
27
  vim src/feature.ts
27
28
  git commit -m "feat: add feature"
@@ -330,7 +331,7 @@ sizing_estimate:
330
331
  strategy: checkpoint-resume
331
332
  ```
332
333
 
333
- 3. **Split the WU** only if the work is no longer atomic or should land independently (see [wu-sizing-guide.md](../../wu-sizing-guide.md) section 3 for splitting patterns).
334
+ 3. **Split the WU** only if the work is no longer atomic or should land independently (see [wu-sizing-guide.md](./wu-sizing-guide.md) section 3 for splitting patterns).
334
335
 
335
336
  **Strict mode:** Teams can enforce sizing compliance for delegated work with `--strict-sizing` on `wu:brief`. In strict mode, missing or non-compliant sizing metadata blocks the operation.
336
337
 
@@ -45,7 +45,7 @@ Before accepting the wave plan, sanity-check the decomposition. If several WUs s
45
45
  | Checkpoint-per-wave | `pnpm orchestrate:initiative -i INIT-XXX -c` | Large initiatives (>3 WUs or >2 waves) |
46
46
  | Continuous | `pnpm orchestrate:initiative -i INIT-XXX` | Small initiatives (<=3 WUs, 1-2 waves) |
47
47
  | Manual brief/delegate | `pnpm wu:brief --id WU-XXX --client <client>` per WU | Testing individual WUs, debugging |
48
- | Manual self-implement | `pnpm wu:brief --id WU-XXX --client <client>` per WU | Self-implementation (records evidence) |
48
+ | Manual self-implement | `pnpm wu:brief --id WU-XXX --client <client>` per WU | You are implementing without sub-agent |
49
49
 
50
50
  Checkpoint-per-wave is recommended for most initiatives. It processes one wave at a time and writes a manifest before exiting, giving you control between waves.
51
51
 
@@ -61,8 +61,6 @@ pnpm wu:brief --id WU-100 --client claude-code
61
61
  pnpm wu:delegate --id WU-100 --parent-wu WU-050 --client claude-code
62
62
  ```
63
63
 
64
- `wu:brief` always outputs full WU context AND records evidence. Use it for both delegation and self-implementation.
65
-
66
64
  **Use `wu:delegate` (not `wu:brief`) when:**
67
65
 
68
66
  - You are the orchestrator agent managing the initiative
@@ -75,6 +73,8 @@ pnpm wu:delegate --id WU-100 --parent-wu WU-050 --client claude-code
75
73
  - You still need `wu:brief` evidence for `wu:done` policy
76
74
  - You will implement directly in the current session
77
75
 
76
+ `wu:brief` always outputs full WU context and records evidence in a single step. There is no separate evidence-only mode.
77
+
78
78
  **Verification checklist before spawning:**
79
79
 
80
80
  1. The generated prompt ends with `<!-- LUMENFLOW_SPAWN_END -->`
@@ -270,7 +270,7 @@ pnpm wu:brief --id WU-100 --client claude-code
270
270
  pnpm orchestrate:monitor # Shows "Zombie lock (PID XXXXX not running)"
271
271
 
272
272
  # 2. Unlock the lane
273
- pnpm lane:unlock "Framework: Core" --reason "Zombie lock (PID 12345 not running)"
273
+ pnpm wu:unlock-lane --lane "Framework: Core" --reason "Zombie lock (PID 12345 not running)"
274
274
 
275
275
  # 3. Release and re-claim the WU
276
276
  pnpm wu:release --id WU-100
@@ -375,23 +375,23 @@ pnpm delegation:list --initiative INIT-XXX --json
375
375
 
376
376
  ## Quick Reference: All Orchestration Commands
377
377
 
378
- | Command | Description |
379
- | --------------------------------------------------- | ------------------------------------------------------------- |
380
- | `pnpm orchestrate:initiative -i INIT-XXX --dry-run` | Preview wave plan without executing |
381
- | `pnpm orchestrate:initiative -i INIT-XXX -c` | Execute one wave then checkpoint and exit |
382
- | `pnpm orchestrate:initiative -i INIT-XXX` | Execute all waves continuously |
383
- | `pnpm orchestrate:init-status -i INIT-XXX` | Compact progress view |
384
- | `pnpm orchestrate:monitor` | Detect stuck agents and zombie locks |
385
- | `pnpm wu:brief --id WU-XXX --client <client>` | **MANDATORY after wu:claim.** Generate prompt + evidence |
386
- | `pnpm wu:delegate --id WU-XXX --parent-wu <P>` | Generate prompt + record delegation |
387
- | `pnpm delegation:list --initiative INIT-XXX` | View delegation tree |
388
- | `pnpm mem:signal "msg" --wu WU-XXX` | Broadcast coordination signal |
389
- | `pnpm mem:inbox --since <duration>` | Read coordination signals |
390
- | `pnpm mem:checkpoint "msg" --wu WU-XXX` | Save progress checkpoint |
391
- | `pnpm mem:ready --wu WU-XXX` | Check pending work/checkpoints |
392
- | `pnpm wu:block --id WU-XXX --reason "..."` | Block stuck WU |
393
- | `pnpm wu:unblock --id WU-XXX` | Unblock recovered WU |
394
- | `pnpm wu:release --id WU-XXX` | Release abandoned WU for re-claim |
378
+ | Command | Description |
379
+ | --------------------------------------------------- | -------------------------------------------------------- |
380
+ | `pnpm orchestrate:initiative -i INIT-XXX --dry-run` | Preview wave plan without executing |
381
+ | `pnpm orchestrate:initiative -i INIT-XXX -c` | Execute one wave then checkpoint and exit |
382
+ | `pnpm orchestrate:initiative -i INIT-XXX` | Execute all waves continuously |
383
+ | `pnpm orchestrate:init-status -i INIT-XXX` | Compact progress view |
384
+ | `pnpm orchestrate:monitor` | Detect stuck agents and zombie locks |
385
+ | `pnpm wu:brief --id WU-XXX --client <client>` | **MANDATORY after wu:claim.** Generate prompt + evidence |
386
+ | `pnpm wu:delegate --id WU-XXX --parent-wu <P>` | Generate prompt + record delegation |
387
+ | `pnpm delegation:list --initiative INIT-XXX` | View delegation tree |
388
+ | `pnpm mem:signal "msg" --wu WU-XXX` | Broadcast coordination signal |
389
+ | `pnpm mem:inbox --since <duration>` | Read coordination signals |
390
+ | `pnpm mem:checkpoint "msg" --wu WU-XXX` | Save progress checkpoint |
391
+ | `pnpm mem:ready --wu WU-XXX` | Check pending work/checkpoints |
392
+ | `pnpm wu:block --id WU-XXX --reason "..."` | Block stuck WU |
393
+ | `pnpm wu:unblock --id WU-XXX` | Unblock recovered WU |
394
+ | `pnpm wu:release --id WU-XXX` | Release abandoned WU for re-claim |
395
395
 
396
396
  ---
397
397
 
@@ -56,25 +56,25 @@ Run `--help` first, then run the real command with explicit flags.
56
56
 
57
57
  **For this monorepo (development):**
58
58
 
59
- | Command | Description |
60
- | -------------------------------------------------- | -------------------------------------------------------------- |
61
- | `pnpm setup` | Install deps and build CLI (first time) |
62
- | `pnpm bootstrap` | Build CLI with dependency closure (worktree-safe) |
63
- | `pnpm build` | Build all packages |
64
- | `pnpm build:dist` | Build distribution packages |
65
- | `pnpm dev` | Start development mode |
66
- | `pnpm clean` | Clean build artifacts and caches |
67
- | `pnpm pack:all` | Pack all packages for distribution |
68
- | `pnpm exec lumenflow init` | Scaffold LumenFlow in a project |
69
- | `pnpm exec lumenflow init --docs-structure simple` | Use simple docs structure (`docs/tasks`) |
70
- | `pnpm exec lumenflow init --docs-structure arc42` | Use arc42 docs structure (`{{DOCS_OPERATIONS_PATH}}`) |
71
- | `pnpm docs:sync --vendor <type>` | Refresh selected vendor bootstrap assets outside upgrade |
72
- | `pnpm sync:templates` | Sync repo docs into bundled templates |
73
- | `pnpm lumenflow:upgrade` | Upgrade LumenFlow packages |
74
- | `pnpm lumenflow:doctor` | Diagnose LumenFlow configuration |
75
- | `pnpm lumenflow:integrate` | Generate enforcement hooks for client |
76
- | `pnpm cloud:connect` | Configure cloud control-plane access |
77
- | `npx lumenflow commands` | List all available CLI commands |
59
+ | Command | Description |
60
+ | ---------------------------------------- | --------------------------------------------------------------------------------------- |
61
+ | `pnpm setup` | Install deps and build CLI (first time) |
62
+ | `pnpm bootstrap` | Build CLI with dependency closure (worktree-safe) |
63
+ | `pnpm build` | Build all packages |
64
+ | `pnpm build:dist` | Build distribution packages |
65
+ | `pnpm dev` | Start development mode |
66
+ | `pnpm clean` | Clean build artifacts and caches |
67
+ | `pnpm pack:validate` | Validate a pack manifest and implementation surface |
68
+ | `pnpm lumenflow` | Scaffold LumenFlow in a project |
69
+ | `pnpm lumenflow --docs-structure simple` | Use simple docs structure (`docs/tasks`) |
70
+ | `pnpm lumenflow --docs-structure arc42` | Use arc42 docs structure (`{{DOCS_OPERATIONS_PATH}}`) |
71
+ | `pnpm docs:sync` | Refresh managed docs, onboarding docs, and vendor assets (run by upgrade automatically) |
72
+ | `pnpm sync:templates` | Sync repo docs into bundled templates |
73
+ | `pnpm lumenflow:upgrade` | Upgrade LumenFlow packages |
74
+ | `pnpm lumenflow:doctor` | Diagnose LumenFlow configuration |
75
+ | `pnpm lumenflow:integrate` | Generate enforcement hooks for client |
76
+ | `pnpm cloud:connect` | Configure cloud control-plane access |
77
+ | `npx lumenflow commands` | List all available CLI commands |
78
78
 
79
79
  **For external projects (end users):**
80
80
 
@@ -83,12 +83,12 @@ Run `--help` first, then run the real command with explicit flags.
83
83
  pnpm add -D @lumenflow/cli # or: npm install -D @lumenflow/cli
84
84
 
85
85
  # Initialize LumenFlow
86
- pnpm exec lumenflow init
86
+ pnpm lumenflow
87
87
 
88
88
  # With client-specific overlays
89
- pnpm exec lumenflow init --client claude # Claude Code
90
- pnpm exec lumenflow init --client cursor # Cursor IDE
91
- pnpm exec lumenflow init --client all # All clients
89
+ pnpm lumenflow --client claude # Claude Code
90
+ pnpm lumenflow --client cursor # Cursor IDE
91
+ pnpm lumenflow --client all # All clients
92
92
  ```
93
93
 
94
94
  ---
@@ -98,30 +98,29 @@ pnpm exec lumenflow init --client all # All clients
98
98
  These commands use **micro-worktree isolation** internally — they handle their own
99
99
  commit and push atomically. Do NOT wrap them in a WU or use raw `pnpm update`/`git commit`.
100
100
 
101
- | Command | Description |
102
- | ------------------------------------------------- | ------------------------------------------------ |
103
- | `pnpm lumenflow:upgrade --version 3.5.0` | Upgrade all 7 @lumenflow/\* packages |
104
- | `pnpm lumenflow:upgrade --latest` | Upgrade to latest version |
105
- | `pnpm lumenflow:upgrade --latest --dry-run` | Preview upgrade without executing |
106
- | `pnpm config:set --key <dotpath> --value <value>` | Set workspace.yaml config (Zod-validated) |
107
- | `pnpm config:get --key <dotpath>` | Read workspace.yaml config |
108
- | `pnpm cloud:connect` | Configure cloud control-plane access |
109
- | `pnpm docs:sync --vendor <type>` | Optional targeted refresh for vendor/bootstrap assets |
110
- | `pnpm sync:templates` | Sync repo docs into bundled templates |
101
+ | Command | Description |
102
+ | ------------------------------------------------- | --------------------------------------------------------------------- |
103
+ | `pnpm lumenflow:upgrade --version 3.5.0` | Upgrade all 7 @lumenflow/\* packages |
104
+ | `pnpm lumenflow:upgrade --latest` | Upgrade to latest version |
105
+ | `pnpm lumenflow:upgrade --latest --dry-run` | Preview upgrade without executing |
106
+ | `pnpm config:set --key <dotpath> --value <value>` | Set workspace.yaml config (Zod-validated) |
107
+ | `pnpm config:get --key <dotpath>` | Read workspace.yaml config |
108
+ | `pnpm cloud:connect` | Configure cloud control-plane access |
109
+ | `pnpm docs:sync` | Refresh managed docs, onboarding docs, and vendor assets (standalone) |
110
+ | `pnpm sync:templates` | Sync repo docs into bundled templates |
111
111
 
112
112
  **Key principle:** If a LumenFlow CLI command exists for the operation, use it instead of
113
113
  raw pnpm/git. These tooling commands commit directly to main via micro-worktree — no dirty
114
114
  files, no manual git, no WU ceremony. Only actual **code changes** need WUs.
115
115
 
116
- `docs:sync` refreshes managed docs, the scaffolded onboarding set, and selected vendor bootstrap
117
- assets. Managed docs are refreshed automatically during `pnpm lumenflow:upgrade --latest`, and
118
- bootstrap files update safely via merge-block markers.
116
+ `lumenflow:upgrade` runs `docs:sync` internally as part of the upgrade transaction. You do not
117
+ need to run `docs:sync` separately after upgrading. Standalone `docs:sync` is only needed when
118
+ you want to refresh docs without upgrading packages (e.g., after manually editing templates).
119
119
 
120
- For existing installs, upgrade packages first with `pnpm lumenflow:upgrade --latest`. That command
121
- automatically syncs managed docs, onboarding docs, and configured vendor assets. Use
122
- `pnpm docs:sync --vendor <type>` only when you want an additional targeted refresh outside upgrade.
123
- The improved default `wu:brief` behavior comes from the package upgrade itself. New installs get
124
- those defaults automatically, and `.lumenflow/templates/` remains optional unless you want custom overrides.
120
+ `docs:sync` handles two categories of files:
121
+
122
+ - **Managed docs** (`LUMENFLOW.md`, `.lumenflow/constraints.md`) always force-synced from templates
123
+ - **Bootstrap docs** (`AGENTS.md`, vendor files) merge-block update only (user content outside `LUMENFLOW:START`/`END` markers is preserved)
125
124
 
126
125
  > **Anti-pattern:** Do NOT use `pnpm update @lumenflow/*` to upgrade packages.
127
126
  > This leaves dirty `package.json` and `pnpm-lock.yaml` on main.
@@ -131,27 +130,27 @@ those defaults automatically, and `.lumenflow/templates/` remains optional unles
131
130
 
132
131
  ## WU Lifecycle
133
132
 
134
- | Command | Description |
135
- | -------------------------------------------------------------- | --------------------------------------------------------------------- |
136
- | `pnpm wu:create --lane <Lane> --title "..." ..` | Create new WU spec (ID auto-generated; see fields below) |
137
- | `pnpm wu:claim --id WU-XXX --lane <Lane>` | Claim WU and create worktree (default) |
138
- | `pnpm wu:claim --id WU-XXX --lane <L> --cloud` | Claim WU in cloud/branch-pr mode (no worktree) |
139
- | `pnpm wu:prep --id WU-XXX [--full-tests]` | Run gates, prep for wu:done (`tests.unit` scoped by default) |
140
- | `pnpm wu:done --id WU-XXX` | Complete WU (merge or PR, stamp, cleanup) |
141
- | `pnpm wu:edit --id WU-XXX --description "..."` | Edit WU spec fields (run --help for all flags) |
142
- | `pnpm wu:escalate --id WU-XXX` | Show escalation status for a WU |
143
- | `pnpm wu:escalate --resolve --id WU-XXX` | Resolve escalation (sets resolved_by/resolved_at) |
144
- | `pnpm approval:request --type <type> --subject <json>` | Request control-plane approval for an action |
145
- | `pnpm approval:review --id <approvalId> --decision <decision>` | Resolve an approval decision (`approved`/`rejected`/`expired`) |
146
- | `pnpm approval:list [--status <status>]` | List approvals with optional status/type filters |
147
- | `pnpm wu:block --id WU-XXX --reason "..."` | Block WU with reason |
148
- | `pnpm wu:unblock --id WU-XXX` | Unblock WU |
149
- | `pnpm wu:release --id WU-XXX` | Release orphaned WU (in_progress to ready) |
150
- | `pnpm wu:status --id WU-XXX` | Show WU status, location, valid commands |
151
- | `pnpm wu:brief --id WU-XXX --client <client>` | **MANDATORY after wu:claim.** Generate handoff prompt + record evidence. wu:done blocks without this |
152
- | `pnpm wu:brief --id WU-XXX --no-context` | Generate prompt without memory context injection |
153
- | `pnpm wu:delegate --id WU-XXX --parent-wu <P>` | Generate prompt, record lineage, and store brief hash attestation |
154
- | `pnpm wu:sandbox --id WU-XXX -- <cmd>` | Run command through hardened WU sandbox backend |
133
+ | Command | Description |
134
+ | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
135
+ | `pnpm wu:create --lane <Lane> --title "..." ..` | Create new WU spec (ID auto-generated; see fields below) |
136
+ | `pnpm wu:claim --id WU-XXX --lane <Lane>` | Claim WU and create worktree (default) |
137
+ | `pnpm wu:claim --id WU-XXX --lane <L> --cloud` | Claim WU in cloud/branch-pr mode (no worktree) |
138
+ | `pnpm wu:prep --id WU-XXX [--full-tests]` | Run gates, prep for wu:done (`tests.unit` scoped by default) |
139
+ | `pnpm wu:done --id WU-XXX` | Complete WU (merge or PR, stamp, cleanup) |
140
+ | `pnpm wu:edit --id WU-XXX --description "..."` | Edit WU spec fields (run --help for all flags) |
141
+ | `pnpm wu:escalate --id WU-XXX` | Show escalation status for a WU |
142
+ | `pnpm wu:escalate --resolve --id WU-XXX` | Resolve escalation (sets resolved_by/resolved_at) |
143
+ | `pnpm approval:request --type <type> --subject <json>` | Request control-plane approval for an action |
144
+ | `pnpm approval:review --id <approvalId> --decision <decision>` | Resolve an approval decision (`approved`/`rejected`/`expired`) |
145
+ | `pnpm approval:list [--status <status>]` | List approvals with optional status/type filters |
146
+ | `pnpm wu:block --id WU-XXX --reason "..."` | Block WU with reason |
147
+ | `pnpm wu:unblock --id WU-XXX` | Unblock WU |
148
+ | `pnpm wu:release --id WU-XXX` | Release orphaned WU (in_progress to ready) |
149
+ | `pnpm wu:status --id WU-XXX` | Show WU status, location, valid commands |
150
+ | `pnpm wu:brief --id WU-XXX --client <client>` | **MANDATORY after wu:claim.** Generate handoff prompt + record evidence. wu:done blocks without this (WU-2379) |
151
+ | `pnpm wu:brief --id WU-XXX --no-context` | Generate prompt without memory context injection |
152
+ | `pnpm wu:delegate --id WU-XXX --parent-wu <P>` | Generate prompt, record lineage, and store brief hash attestation |
153
+ | `pnpm wu:sandbox --id WU-XXX -- <cmd>` | Run command through hardened WU sandbox backend |
155
154
 
156
155
  ### WU Maintenance
157
156
 
@@ -174,23 +173,27 @@ those defaults automatically, and `.lumenflow/templates/` remains optional unles
174
173
 
175
174
  ## Gates & Quality
176
175
 
177
- | Command | Description |
178
- | ------------------------------------------------- | ----------------------------------------------- |
179
- | `pnpm gates` | Run all quality gates |
180
- | `pnpm gates --docs-only` | Run gates for docs changes |
181
- | `pnpm format` | Format all files (Prettier) |
182
- | `pnpm format:check` | Check formatting without changes |
183
- | `pnpm lint` | Run ESLint |
184
- | `pnpm typecheck` | Run TypeScript type checking |
185
- | `pnpm test` | Run all tests (Vitest) |
186
- | `pnpm spec:linter` | Validate WU specs (all) ¹ |
187
- | `pnpm lane:health` | Check lane config health |
188
- | `pnpm lane:suggest --output workspace.lanes.yaml` | Generate a workspace lane-definition snippet |
189
- | `pnpm lane:status` | Show lane lifecycle status |
190
- | `pnpm lane:setup` | Create/update draft lane config |
191
- | `pnpm lane:validate` | Validate lane draft artifacts |
192
- | `pnpm lane:lock` | Lock lane lifecycle for WU create |
193
- | `pnpm lane:edit --name <L>` | Edit lane definition (rename, wip-limit, paths) |
176
+ | Command | Description |
177
+ | ------------------------------------------------------------------ | ----------------------------------------------- |
178
+ | `pnpm gates` | Run all quality gates |
179
+ | `pnpm gates --docs-only` | Run gates for docs changes |
180
+ | `pnpm format` | Format all files (Prettier) |
181
+ | `pnpm format:check` | Check formatting without changes |
182
+ | `pnpm lint` | Run ESLint |
183
+ | `pnpm typecheck` | Run TypeScript type checking |
184
+ | `pnpm test` | Run all tests (Vitest) |
185
+ | `pnpm spec:linter` | Validate WU specs (all) ¹ |
186
+ | `pnpm lane:health` | Check lane config health |
187
+ | `pnpm lane:suggest --output workspace.lanes.yaml` | Generate a workspace lane-definition snippet |
188
+ | `pnpm lane:status` | Show lane lifecycle status |
189
+ | `pnpm lane:setup` | Create/update draft lane config |
190
+ | `pnpm lane:validate` | Validate lane draft artifacts |
191
+ | `pnpm lane:lock` | Lock lane lifecycle for WU create |
192
+ | `pnpm lane:edit --name <L>` | Edit lane definition (rename, wip-limit, paths) |
193
+ | `pnpm gate:co-change --add --name <N> --trigger <G> --require <G>` | Add co-change gate rule |
194
+ | `pnpm gate:co-change --remove --name <N>` | Remove co-change gate rule |
195
+ | `pnpm gate:co-change --edit --name <N> --severity <S>` | Edit co-change gate rule |
196
+ | `pnpm gate:co-change --list` | List all co-change rules (built-in + custom) |
194
197
 
195
198
  ¹ **Script aliases:** `spec:linter` and `tasks:validate` are pnpm script aliases
196
199
  for `wu:validate --all`. They are not standalone CLI commands.
@@ -327,18 +330,18 @@ If the plan exists only in conversation, use `--plan` on `wu:create` to generate
327
330
  stub in `$LUMENFLOW_HOME/plans/` and automatically set the WU's `plan` field to the
328
331
  `lumenflow://plans/` URI. Feature WUs should have a `plan` field; notes do not replace the plan link.
329
332
 
330
- | Command | Description |
331
- | ------------------------------------------------------------------------ | ------------------------------------------------------------------- |
332
- | `pnpm plan:create --id INIT-XXX --title "..."` | Create a repo-native plan file in configured `directories.plansDir` |
333
- | `pnpm plan:create --id INIT-XXX --title "..." --from <path>` | Import external plan file into repo plansDir |
333
+ | Command | Description |
334
+ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------- |
335
+ | `pnpm plan:create --id INIT-XXX --title "..."` | Create a repo-native plan file in configured `directories.plansDir` |
336
+ | `pnpm plan:create --id INIT-XXX --title "..." --from <path>` | Import external plan file into repo plansDir |
334
337
  | `pnpm plan:edit --id INIT-XXX --section Goal --content "..."` | Edit plan section (auto-resolves file from initiative metadata) |
335
- | `pnpm plan:edit --id WU-XXX --file my-plan.md --section Goal --content "..."` | Edit plan by explicit filename |
336
- | `pnpm plan:link --id INIT-XXX --plan lumenflow://plans/INIT-XXX-plan.md` | Link plan URI to initiative or WU |
337
- | `pnpm plan:promote --id INIT-XXX` | Promote plan to approved (auto-resolves from initiative metadata) |
338
- | `pnpm plan:promote --id WU-XXX --file my-plan.md` | Promote plan by explicit filename |
339
- | `pnpm initiative:plan --initiative INIT-XXX --plan <path>` | Link plan to initiative (auto-imports external files into repo) |
340
- | `pnpm initiative:plan --initiative INIT-XXX --create` | Create blank plan template and link to initiative |
341
- | `pnpm initiative:plan --initiative INIT-XXX --create --plan <path>` | Import external plan content into new template and link |
338
+ | `pnpm plan:edit --id WU-XXX --file my-plan.md --section Goal --content "..."` | Edit plan by explicit filename |
339
+ | `pnpm plan:link --id INIT-XXX --plan lumenflow://plans/INIT-XXX-plan.md` | Link plan URI to initiative or WU |
340
+ | `pnpm plan:promote --id INIT-XXX` | Promote plan to approved (auto-resolves from initiative metadata) |
341
+ | `pnpm plan:promote --id WU-XXX --file my-plan.md` | Promote plan by explicit filename |
342
+ | `pnpm initiative:plan --initiative INIT-XXX --plan <path>` | Link plan to initiative (auto-imports external files into repo) |
343
+ | `pnpm initiative:plan --initiative INIT-XXX --create` | Create blank plan template and link to initiative |
344
+ | `pnpm initiative:plan --initiative INIT-XXX --create --plan <path>` | Import external plan content into new template and link |
342
345
 
343
346
  ### Linking Plans
344
347
 
@@ -544,6 +547,8 @@ pnpm gates # Now works
544
547
 
545
548
  ## Workflow Sequence (Quick Reference)
546
549
 
550
+ <!-- lumenflow-example: strict -->
551
+
547
552
  ```bash
548
553
  # 0. Check available options (do this before first use of any command)
549
554
  pnpm wu:create --help
@@ -559,6 +564,7 @@ pnpm wu:create --lane "Framework: Core" --title "Add feature" \
559
564
 
560
565
  # 2. Claim (creates worktree) -- use the ID from wu:create output
561
566
  pnpm wu:claim --id WU-1990 --lane "Framework: Core"
567
+ pnpm wu:brief --id WU-1990 --client <client>
562
568
  cd worktrees/framework-core-wu-1990
563
569
 
564
570
  # 2b. Bootstrap (build CLI for dist-backed commands)
@@ -727,13 +733,13 @@ When `requireRemote: true` (default):
727
733
 
728
734
  ## Key File Paths
729
735
 
730
- | Path | Description |
731
- | ----------------------------------------- | -------------------- |
736
+ | Path | Description |
737
+ | -------------------------------------- | -------------------- |
732
738
  | `{{DOCS_TASKS_PATH}}/wu/WU-XXX.yaml` | WU specification |
733
739
  | `{{DOCS_TASKS_PATH}}/status.md` | Current status board |
734
740
  | `{{DOCS_TASKS_PATH}}/backlog.md` | Backlog summary |
735
- | `.lumenflow/stamps/WU-XXX.done` | Completion stamp |
736
- | `worktrees/<lane>-wu-xxx/` | Worktree directory |
741
+ | `.lumenflow/stamps/WU-XXX.done` | Completion stamp |
742
+ | `worktrees/<lane>-wu-xxx/` | Worktree directory |
737
743
 
738
744
  ---
739
745
 
@@ -772,6 +778,7 @@ For cloud agents that cannot use local worktrees:
772
778
  # 1. Claim in cloud mode
773
779
  pnpm wu:claim --id WU-XXX --lane "<Lane>" --cloud
774
780
  # Or: LUMENFLOW_CLOUD=1 pnpm wu:claim --id WU-XXX --lane "<Lane>"
781
+ pnpm wu:brief --id WU-XXX --client <client>
775
782
 
776
783
  # 2. Work on lane branch, push commits
777
784
 
@@ -835,4 +842,4 @@ For a complete picture of how all WU commands, memory tools, and orchestration t
835
842
  - **[Failure-Mode Runbook](../../lumenflow-agent-capsule.md)** -- Concrete remediation for main-behind-origin, partial-claim state, spawn-provenance enforcement, and wu:recover usage
836
843
  - **[Troubleshooting wu:done](./troubleshooting-wu-done.md)** -- Most common agent mistake (two-step wu:prep + wu:done workflow)
837
844
  - **[First WU Mistakes](./first-wu-mistakes.md)** -- Common first-time pitfalls and how to avoid them
838
- - **[WU Sizing Guide](../../wu-sizing-guide.md)** -- Context safety triggers, complexity assessment, and session strategies
845
+ - **[WU Sizing Guide](./wu-sizing-guide.md)** -- Context safety triggers, complexity assessment, and session strategies
@@ -30,7 +30,7 @@ pnpm release --release-version 1.3.0 --skip-publish
30
30
 
31
31
  1. Validates semver version format
32
32
  2. Ensures clean working directory on main branch
33
- 3. Syncs templates with source docs (`pnpm sync:templates`)
33
+ 3. Syncs templates with source docs (`pnpm lumenflow:sync-templates`)
34
34
  4. Bumps all `@lumenflow/*` package versions using micro-worktree isolation
35
35
  5. Builds all packages
36
36
  6. Creates and pushes git tag `vX.Y.Z`
@@ -79,24 +79,24 @@ CLI templates (`packages/@lumenflow/cli/templates/`) are synced from source docs
79
79
 
80
80
  ```bash
81
81
  # Sync source docs to CLI templates
82
- pnpm sync:templates
82
+ pnpm lumenflow:sync-templates
83
83
 
84
84
  # Preview without writing files
85
- pnpm sync:templates --dry-run
85
+ pnpm lumenflow:sync-templates --dry-run
86
86
  ```
87
87
 
88
88
  ### Check for Drift (CI)
89
89
 
90
90
  ```bash
91
91
  # Check if templates are out of sync with source
92
- pnpm sync:templates --check-drift
92
+ pnpm lumenflow:sync-templates --check-drift
93
93
  ```
94
94
 
95
95
  The `--check-drift` flag compares templates with their source files. If drift is detected:
96
96
 
97
97
  - Exit code 1 (fails CI)
98
98
  - Lists drifting files
99
- - Suggests running `pnpm sync:templates`
99
+ - Suggests running `pnpm lumenflow:sync-templates`
100
100
 
101
101
  ### What Gets Synced
102
102
 
@@ -345,12 +345,12 @@ rm packages/@lumenflow/packs/software-delivery/lumenflow-packs-software-delivery
345
345
 
346
346
  ### Vercel Projects Reference
347
347
 
348
- | Project | Domain | Purpose |
349
- | ----------------- | ------------------------ | ----------------------- |
350
- | `web` | registry.lumenflow.dev | Pack registry + web app |
351
- | `docs` | lumenflow.dev | Starlight documentation |
352
- | `lumenflow-dev` | lumenflow-dev.vercel.app | Monorepo preview |
353
- | `cloud` | cloud.lumenflow.dev | Control plane |
348
+ | Project | Domain | Purpose |
349
+ | --------------- | ------------------------ | ----------------------- |
350
+ | `web` | registry.lumenflow.dev | Pack registry + web app |
351
+ | `docs` | lumenflow.dev | Starlight documentation |
352
+ | `lumenflow-dev` | lumenflow-dev.vercel.app | Monorepo preview |
353
+ | `cloud` | cloud.lumenflow.dev | Control plane |
354
354
 
355
355
  ### Troubleshooting Pack Publishing
356
356
 
@@ -379,7 +379,7 @@ The `@lumenflow/docs` package requires `d2` (diagramming tool) which is not avai
379
379
  - [ ] All acceptance criteria met
380
380
  - [ ] Gates pass (`pnpm gates`)
381
381
  - [ ] Pre-release checks pass (`pnpm pre-release:check`)
382
- - [ ] Templates synced (`pnpm sync:templates` - ensures CLI templates match source docs)
382
+ - [ ] Templates synced (`pnpm lumenflow:sync-templates` - ensures CLI templates match source docs)
383
383
  - [ ] CHANGELOG updated (if maintained)
384
384
 
385
385
  ### Release Steps (Automated)