@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
@@ -1,8 +1,17 @@
1
- # Troubleshooting: wu:done Not Run
1
+ # Troubleshooting: wu:prep and wu:done Workflow
2
2
 
3
3
  **Last updated:** {{DATE}}
4
4
 
5
- This is the most common mistake agents make. This document explains why it happens and how to fix it.
5
+ This is the most common mistake agents make. This document explains the two-step completion workflow introduced in WU-1223.
6
+
7
+ ---
8
+
9
+ ## The New Workflow (WU-1223)
10
+
11
+ As of WU-1223, completion is a **two-step process**:
12
+
13
+ 1. **From worktree**: Run `pnpm wu:prep --id WU-XXX` (runs gates, prints copy-paste instruction)
14
+ 2. **From main**: Run `pnpm wu:done --id WU-XXX` (merge + cleanup only)
6
15
 
7
16
  ---
8
17
 
@@ -21,54 +30,87 @@ Agents complete their work, write "To Complete: pnpm wu:done --id WU-XXX" in the
21
30
 
22
31
  ## The Fix
23
32
 
24
- ### Rule: ALWAYS Run wu:done
33
+ ### Rule: Use wu:prep Then wu:done
25
34
 
26
- After gates pass, you MUST run:
35
+ After implementation is complete:
27
36
 
28
37
  ```bash
29
- cd /path/to/main
30
- pnpm wu:done --id WU-XXX
38
+ # Step 1: From worktree, run wu:prep
39
+ pnpm wu:prep --id WU-XXX
40
+ # This runs gates and prints a copy-paste instruction
41
+
42
+ # Step 2: Copy-paste the instruction from wu:prep output
43
+ cd /path/to/main && pnpm wu:done --id WU-XXX
31
44
  ```
32
45
 
33
46
  Do NOT:
34
47
 
35
48
  - Ask "Should I run wu:done?"
36
49
  - Write "To Complete: pnpm wu:done"
37
- - Wait for permission
38
- - Treat it as a "future step"
50
+ - Run wu:done directly from a worktree (it will error)
51
+ - Skip wu:prep and go directly to wu:done from main (gates won't run in worktree)
39
52
 
40
53
  ---
41
54
 
42
55
  ## Correct Completion Flow
43
56
 
44
57
  ```bash
45
- # 1. In worktree, run gates
46
- pnpm gates
58
+ # 1. In worktree, run wu:prep
59
+ pnpm wu:prep --id WU-XXX
60
+ # Output includes: cd /path/to/main && pnpm wu:done --id WU-XXX
47
61
 
48
- # 2. If gates pass, return to main
49
- cd /path/to/main
62
+ # 2. Copy-paste the wu:done command from the output
63
+ cd /path/to/main && pnpm wu:done --id WU-XXX
50
64
 
51
- # 3. IMMEDIATELY run wu:done
52
- pnpm wu:done --id WU-XXX
53
-
54
- # 4. Report success with the wu:done output
65
+ # 3. Report success with the wu:done output
55
66
  ```
56
67
 
57
68
  ---
58
69
 
59
- ## What wu:done Does
70
+ ## What wu:prep Does (WU-1223)
71
+
72
+ When you run `pnpm wu:prep --id WU-XXX` from a worktree:
73
+
74
+ 1. Validates you're in a worktree (errors if in main)
75
+ 2. Runs gates in the worktree
76
+ 3. Prints copy-paste instruction for wu:done
77
+
78
+ ## What wu:done Does (WU-1223)
79
+
80
+ When you run `pnpm wu:done --id WU-XXX` from main:
81
+
82
+ 1. Validates you're in main checkout (errors if in worktree)
83
+ 2. Fast-forward merges the lane branch to main
84
+ 3. Creates the done stamp
85
+ 4. Updates status and backlog docs
86
+ 5. Removes the worktree
87
+ 6. Pushes to origin
88
+
89
+ **This two-step process is the ONLY way to complete a WU.** Manual steps will leave things in an inconsistent state.
90
+
91
+ ---
92
+
93
+ ## Error Messages
94
+
95
+ ### "wu:done must be run from main checkout"
96
+
97
+ If you see this error, you ran wu:done from a worktree. Use wu:prep instead:
98
+
99
+ ```bash
100
+ # You're in the worktree - use wu:prep
101
+ pnpm wu:prep --id WU-XXX
102
+ # Then follow the copy-paste instruction it prints
103
+ ```
60
104
 
61
- When you run `pnpm wu:done --id WU-XXX`:
105
+ ### "wu:prep must be run from a worktree"
62
106
 
63
- 1. Validates the worktree exists and has commits
64
- 2. Runs gates in the worktree (not main)
65
- 3. Fast-forward merges to main
66
- 4. Creates the done stamp
67
- 5. Updates status and backlog docs
68
- 6. Removes the worktree
69
- 7. Pushes to origin
107
+ If you see this error, you ran wu:prep from main. Navigate to the worktree:
70
108
 
71
- **This is the ONLY way to complete a WU.** Manual steps will leave things in an inconsistent state.
109
+ ```bash
110
+ # Navigate to worktree first
111
+ cd worktrees/<lane>-wu-xxx
112
+ pnpm wu:prep --id WU-XXX
113
+ ```
72
114
 
73
115
  ---
74
116
 
@@ -76,8 +118,8 @@ When you run `pnpm wu:done --id WU-XXX`:
76
118
 
77
119
  If a WU is missing `exposure`, `wu:done` auto-sets a safe default:
78
120
 
79
- - **Content lanes** `documentation`
80
- - **Framework/Operations lanes** `backend-only`
121
+ - **Content lanes** -> `documentation`
122
+ - **Framework/Operations lanes** -> `backend-only`
81
123
 
82
124
  Existing exposure values are preserved.
83
125
 
@@ -102,11 +144,12 @@ If a previous agent forgot to run wu:done:
102
144
  # 1. Check worktree exists
103
145
  ls worktrees/
104
146
 
105
- # 2. If it does, run wu:done
106
- pnpm wu:done --id WU-XXX
147
+ # 2. If it does, navigate there and run wu:prep
148
+ cd worktrees/<lane>-wu-xxx
149
+ pnpm wu:prep --id WU-XXX
107
150
 
108
- # 3. If worktree was deleted but branch exists
109
- # This is a bad state - may need manual recovery
151
+ # 3. Follow the copy-paste instruction
152
+ cd /path/to/main && pnpm wu:done --id WU-XXX
110
153
  ```
111
154
 
112
155
  ---
@@ -124,9 +167,9 @@ An incomplete WU causes problems:
124
167
 
125
168
  ## Checklist Before Ending Session
126
169
 
127
- - [ ] Did I run `pnpm gates` in the worktree?
128
- - [ ] Did gates pass?
129
- - [ ] Did I `cd` back to main?
170
+ - [ ] Did I run `pnpm wu:prep --id WU-XXX` in the worktree?
171
+ - [ ] Did wu:prep (gates) pass?
172
+ - [ ] Did I `cd` back to main using the copy-paste instruction?
130
173
  - [ ] Did I run `pnpm wu:done --id WU-XXX`?
131
174
  - [ ] Did wu:done complete successfully?
132
175
 
@@ -143,12 +186,22 @@ I've completed all the work. To finish:
143
186
  1. Run `pnpm wu:done --id WU-123`
144
187
  ```
145
188
 
146
- ### RIGHT:
189
+ ### ALSO WRONG:
147
190
 
148
191
  ```bash
149
- # Actually run it
150
- cd /home/project/main
192
+ # Running wu:done from worktree (will error)
151
193
  pnpm wu:done --id WU-123
194
+ ```
195
+
196
+ ### RIGHT:
197
+
198
+ ```bash
199
+ # Step 1: From worktree, run wu:prep
200
+ pnpm wu:prep --id WU-123
201
+ # Output: cd /path/to/main && pnpm wu:done --id WU-123
202
+
203
+ # Step 2: Copy-paste the instruction
204
+ cd /path/to/main && pnpm wu:done --id WU-123
152
205
  # Output: WU-123 completed successfully
153
206
  ```
154
207
 
@@ -0,0 +1,219 @@
1
+ # AI Coding Assistant Integrations
2
+
3
+ **Last updated:** {{DATE}}
4
+
5
+ ---
6
+
7
+ ## Works with Any AI
8
+
9
+ **LumenFlow is friction-free for any AI coding assistant.** If your AI can read project files, it can use LumenFlow.
10
+
11
+ ### Universal Entry Points
12
+
13
+ Every LumenFlow project includes these plain markdown files that work with ANY AI:
14
+
15
+ | File | Purpose |
16
+ | --------------------------- | ---------------------------------------- |
17
+ | `AGENTS.md` | Universal agent instructions |
18
+ | `LUMENFLOW.md` | Workflow fundamentals and critical rules |
19
+ | `.lumenflow/constraints.md` | Non-negotiable constraints |
20
+
21
+ **No vendor lock-in.** Point any AI at these files and it understands the workflow.
22
+
23
+ ```bash
24
+ # Initialize with universal files only (works with any AI)
25
+ lumenflow init
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Enhanced Integrations
31
+
32
+ For popular AI coding assistants, LumenFlow provides **optional enhanced integrations** with deeper features like auto-detection, skills, and vendor-specific configurations.
33
+
34
+ | Assistant | Config File | Auto-detected | Enhanced Features |
35
+ | ----------- | ------------------------------ | ------------- | ------------------------------- |
36
+ | Claude Code | `CLAUDE.md`, `.claude/` | Yes | Skills, agents, hooks, settings |
37
+ | Cursor | `.cursor/rules/lumenflow.md` | Yes | Rules integration |
38
+ | Windsurf | `.windsurf/rules/lumenflow.md` | Yes | Rules integration |
39
+ | Cline | `.clinerules` | No | Rules file |
40
+ | Codex | `AGENTS.md` (native) | No | Uses universal files directly |
41
+ | Aider | `.aider.conf.yml` | No | Config file |
42
+ | Antigravity | `AGENTS.md` (native) | Unknown | Research phase |
43
+
44
+ ---
45
+
46
+ ## Integration Details
47
+
48
+ ### Claude Code (Anthropic)
49
+
50
+ Claude Code is Anthropic's official CLI for Claude. It has the deepest integration with LumenFlow.
51
+
52
+ **Config Files:**
53
+
54
+ - `CLAUDE.md` - Root-level instructions
55
+ - `.claude/settings.json` - Permission configuration
56
+ - `.claude/agents/` - Agent definitions
57
+ - `.claude/skills/` - Skill definitions
58
+
59
+ **Auto-detection:** Environment variables `CLAUDE_PROJECT_DIR` or `CLAUDE_CODE`
60
+
61
+ **Initialize:**
62
+
63
+ ```bash
64
+ lumenflow init --client claude
65
+ ```
66
+
67
+ ### Cursor
68
+
69
+ Cursor is an AI-first code editor built on VS Code.
70
+
71
+ **Config Files:**
72
+
73
+ - `.cursor/rules/lumenflow.md` - LumenFlow rules
74
+
75
+ **Auto-detection:** Environment variables starting with `CURSOR_`
76
+
77
+ **Initialize:**
78
+
79
+ ```bash
80
+ lumenflow init --client cursor
81
+ ```
82
+
83
+ ### Windsurf
84
+
85
+ Windsurf (Codeium) is an AI IDE with agentic capabilities.
86
+
87
+ **Config Files:**
88
+
89
+ - `.windsurf/rules/lumenflow.md` - LumenFlow rules
90
+
91
+ **Auto-detection:** Environment variables starting with `WINDSURF_`
92
+
93
+ **Initialize:**
94
+
95
+ ```bash
96
+ lumenflow init --client windsurf
97
+ ```
98
+
99
+ ### Cline
100
+
101
+ Cline is an autonomous coding agent that works in VS Code.
102
+
103
+ **Config Files:**
104
+
105
+ - `.clinerules` - LumenFlow rules (root-level)
106
+
107
+ **Auto-detection:** Not supported
108
+
109
+ **Initialize:**
110
+
111
+ ```bash
112
+ lumenflow init --client cline
113
+ ```
114
+
115
+ ### OpenAI Codex
116
+
117
+ Codex reads the AGENTS.md file directly for universal instructions.
118
+
119
+ **Config Files:**
120
+
121
+ - `AGENTS.md` - Universal agent instructions (always created)
122
+
123
+ **Initialize:**
124
+
125
+ ```bash
126
+ lumenflow init # AGENTS.md is created by default
127
+ ```
128
+
129
+ ### Aider
130
+
131
+ Aider is a terminal-based pair programming tool.
132
+
133
+ **Config Files:**
134
+
135
+ - `.aider.conf.yml` - Aider configuration
136
+
137
+ **Initialize:**
138
+
139
+ ```bash
140
+ lumenflow init --client aider
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Antigravity (Research Phase)
146
+
147
+ **Status:** Research Phase
148
+
149
+ Antigravity is Google's AI IDE, announced in November 2025. It is MCP-based and appears to read `AGENTS.md` natively.
150
+
151
+ ### What We Know
152
+
153
+ - **Announced:** November 2025
154
+ - **Platform:** Google's AI IDE
155
+ - **Protocol:** MCP (Model Context Protocol)
156
+ - **Agent Config:** Appears to read `AGENTS.md` natively (similar to Codex)
157
+
158
+ ### Research Links
159
+
160
+ - [Google Codelabs - Getting Started with Antigravity](https://codelabs.developers.google.com/getting-started-google-antigravity)
161
+ - Google AI documentation (when available)
162
+
163
+ ### Current Recommendation
164
+
165
+ For projects using Antigravity:
166
+
167
+ 1. Ensure `AGENTS.md` is present (created by default with `lumenflow init`)
168
+ 2. The universal instructions in AGENTS.md should work out of the box
169
+ 3. Report any issues for future vendor-specific support
170
+
171
+ ---
172
+
173
+ ## Using Another AI?
174
+
175
+ If your AI coding assistant isn't listed above, LumenFlow still works:
176
+
177
+ 1. Run `lumenflow init` to create universal entry points
178
+ 2. Tell your AI to read `AGENTS.md` and `LUMENFLOW.md`
179
+ 3. The workflow commands (`wu:claim`, `wu:done`, `gates`) work the same
180
+
181
+ **Want enhanced integration for your AI?** See [Adding New Integrations](#adding-new-integrations) below.
182
+
183
+ ---
184
+
185
+ ## All Integrations Setup
186
+
187
+ To configure all enhanced integrations at once:
188
+
189
+ ```bash
190
+ lumenflow init --client all
191
+ ```
192
+
193
+ This creates all vendor-specific configuration files alongside the universal entry points.
194
+
195
+ ---
196
+
197
+ ## Sync Vendor Configs
198
+
199
+ To ensure all vendor configs are in sync with the template:
200
+
201
+ ```bash
202
+ # Check if configs are in sync
203
+ ./scripts/sync-vendor-configs.sh --check
204
+
205
+ # Regenerate all configs from template
206
+ ./scripts/sync-vendor-configs.sh
207
+ ```
208
+
209
+ ---
210
+
211
+ ## Adding New Integrations
212
+
213
+ To add enhanced integration for a new AI coding assistant:
214
+
215
+ 1. Update `templates/vendor-rules.template.md` (single source of truth)
216
+ 2. Add vendor config path to `scripts/sync-vendor-configs.sh`
217
+ 3. Add scaffolding in `packages/@lumenflow/cli/src/init.ts`
218
+ 4. Update this integrations document
219
+ 5. Test with `lumenflow init --client <vendor>`
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: context-management
3
3
  description: Session checkpoint patterns, output bypass for large results, when to spawn fresh sub-agents. Use for long-running sessions, context exhaustion, or agent coordination.
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  source: docs/04-operations/_frameworks/lumenflow/agent/onboarding/agent-invocation-guide.md
6
6
  source_sections: Context Tiers, Session Management, Wave Orchestration
7
7
  last_updated: {{DATE}}
@@ -76,6 +76,17 @@ pnpm mem:ready --wu WU-123 # Shows pending work
76
76
  pnpm mem:inbox --wu WU-123 # Check signals from other agents
77
77
  ```
78
78
 
79
+ ### Optional: Pre-Clear Checkpoint Hook
80
+
81
+ If your client supports hooks, add a pre-clear/pre-compaction hook that runs:
82
+
83
+ ```bash
84
+ pnpm mem:checkpoint "Pre-clear: <summary>" --wu WU-XXX --trigger pre-clear
85
+ ```
86
+
87
+ This is a safety net for when humans forget to checkpoint. It does **not** replace the
88
+ spawn-fresh protocol; still exit and spawn a new agent after `/clear`.
89
+
79
90
  ## Output Bypass Pattern
80
91
 
81
92
  For large results that would exhaust context:
@@ -151,5 +162,6 @@ Always load context in this order for best comprehension:
151
162
 
152
163
  ## Version History
153
164
 
165
+ - **v1.3.0** ({{DATE}}): Added pre-clear checkpoint hook guidance
154
166
  - **v1.1.0** ({{DATE}}): Added wave orchestration pattern cross-reference
155
167
  - **v1.0.0** ({{DATE}}): Initial skill created
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: execution-memory
3
3
  description: Memory layer for session tracking, context recovery, and agent coordination. Use when resuming work after /clear, coordinating with parallel agents, or managing long-running sessions.
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  source: docs/04-operations/_frameworks/lumenflow/agent/onboarding/quick-ref-commands.md
6
6
  source_sections: Memory Commands
7
7
  last_updated: {{DATE}}
@@ -26,23 +26,18 @@ Activate automatically when:
26
26
 
27
27
  ## Quick Reference: Storage Location
28
28
 
29
- All memory data is stored in `.beacon/memory/`:
29
+ All memory data is stored in `.lumenflow/memory/` as append-only JSONL:
30
30
 
31
31
  ```
32
- .beacon/memory/
33
- ├── sessions/ # Session metadata by session ID
34
- │ └── <session-id>.json # Session start time, WU link, tier
35
- ├── checkpoints/ # Progress checkpoints
36
- └── <wu-id>/ # Checkpoints grouped by WU
37
- │ └── <timestamp>.md # Individual checkpoint
38
- ├── discoveries/ # Bugs, ideas, discoveries
39
- │ └── <node-id>.json # Discovery node with type, status
40
- ├── signals/ # Inter-agent coordination signals
41
- │ └── <timestamp>-<wu>.json # Signal with lane, message
42
- └── summaries/ # Rollup summaries for compaction
43
- └── <wu-id>-summary.md # Summarised session history
32
+ .lumenflow/memory/
33
+ ├── memory.jsonl # Session/checkpoint/discovery/summary nodes
34
+ ├── relationships.jsonl # Optional node relationships (blocks, related)
35
+ ├── signals.jsonl # Inter-agent coordination signals
36
+ └── config.yaml # Retention policy defaults
44
37
  ```
45
38
 
39
+ Legacy docs may mention `.beacon/memory/`; the current source of truth is `.lumenflow/memory/`.
40
+
46
41
  ## Automatic Integration
47
42
 
48
43
  The memory layer integrates automatically with WU lifecycle commands:
@@ -51,7 +46,7 @@ The memory layer integrates automatically with WU lifecycle commands:
51
46
 
52
47
  When you run `pnpm wu:claim`:
53
48
 
54
- 1. Creates session node in `.beacon/memory/sessions/`
49
+ 1. Creates session node in `.lumenflow/memory/memory.jsonl`
55
50
  2. Links session to WU ID
56
51
  3. Records baseline main SHA for recovery
57
52
 
@@ -60,7 +55,7 @@ When you run `pnpm wu:claim`:
60
55
  When you run `pnpm wu:done`:
61
56
 
62
57
  1. Creates pre-gates checkpoint (recovery point if gates fail)
63
- 2. Broadcasts completion signal to parallel agents
58
+ 2. Broadcasts completion signal to parallel agents (`signals.jsonl`)
64
59
  3. Checks `mem:inbox` for recent signals from other agents
65
60
  4. Ends session and marks as completed
66
61
 
@@ -181,6 +176,9 @@ For long sessions (>20 tool calls):
181
176
  4. **Query ready nodes**: `pnpm mem:ready --wu WU-XXX`
182
177
  5. **Continue from checkpoint**
183
178
 
179
+ If your client supports hooks, add a pre-clear hook that runs `pnpm mem:checkpoint` automatically
180
+ before `/clear` or `/compact` to avoid losing context.
181
+
184
182
  ## Discovery Lifecycle
185
183
 
186
184
  Discoveries captured via `mem:create` follow this lifecycle:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: orchestration
3
3
  description: Agent orchestration dashboard and initiative execution. Use when running initiatives, monitoring spawned agents, or debugging stuck spawns.
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  source: packages/@lumenflow/cli/src/orchestrate.ts
6
6
  last_updated: {{DATE}}
7
7
  allowed-tools: Read, Bash, Grep
@@ -47,6 +47,49 @@ pnpm wu:spawn --id WU-XXX
47
47
 
48
48
  ---
49
49
 
50
+ ## Verbatim Output Verification (WU-1131)
51
+
52
+ When using `wu:spawn` output to invoke Task agents, you **MUST** verify the output was not truncated.
53
+
54
+ ### Truncation Detection
55
+
56
+ `wu:spawn` output includes:
57
+
58
+ - **Warning banner** at the start with truncation instructions
59
+ - **End sentinel** `<!-- LUMENFLOW_SPAWN_END -->` after the constraints block
60
+
61
+ ### Verification Checklist
62
+
63
+ Before spawning a sub-agent with `wu:spawn` output:
64
+
65
+ 1. **Check for end sentinel**: The output MUST end with `<!-- LUMENFLOW_SPAWN_END -->`
66
+ 2. **Verify constraints block**: Look for `</constraints>` before the end sentinel
67
+ 3. **Check warning banner**: The start should contain `LUMENFLOW_TRUNCATION_WARNING`
68
+
69
+ ```bash
70
+ # Quick verification commands
71
+ pnpm wu:spawn --id WU-XXX | tail -5 # Should show LUMENFLOW_SPAWN_END
72
+ pnpm wu:spawn --id WU-XXX | head -20 # Should show TRUNCATION_WARNING
73
+ pnpm wu:spawn --id WU-XXX | grep -c 'constraints' # Should return 2 (open and close tags)
74
+ ```
75
+
76
+ ### What Truncation Causes
77
+
78
+ If spawn output is truncated, sub-agents will:
79
+
80
+ - Miss TDD directives (skip writing tests first)
81
+ - Miss constraints block (ignore safety rules)
82
+ - Miss worktree discipline (edit main instead of worktree)
83
+ - Miss wu:done instructions (ask for permission instead of completing)
84
+
85
+ ### If Truncation Is Detected
86
+
87
+ 1. Re-run `wu:spawn` and capture full output
88
+ 2. If context window is too small, use `--codex` for shorter Markdown format
89
+ 3. Consider breaking WU into smaller sub-WUs if prompt is too large
90
+
91
+ ---
92
+
50
93
  ## Commands
51
94
 
52
95
  ```bash
@@ -171,12 +214,13 @@ pnpm wu:spawn --id WU-XXX
171
214
 
172
215
  ```
173
216
  Starting WU?
174
- ├── Run: pnpm orchestrate:monitor
175
- └── Review agent status and recommendations
217
+ ├── Run: pnpm wu:spawn --id WU-XXX
218
+ └── Review generated prompt with agent recommendations
176
219
 
177
220
  Initiative with multiple WUs?
178
221
  ├── Run: pnpm orchestrate:initiative -i INIT-XXX --dry-run
179
- └── Review wave plan, then execute
222
+ ├── Review wave plan
223
+ └── Run: pnpm orchestrate:init-status -i INIT-XXX for progress
180
224
 
181
225
  Agent appears stuck or crashed?
182
226
  ├── Run: pnpm orchestrate:monitor
@@ -61,6 +61,10 @@ Write({
61
61
 
62
62
  3. **Use relative paths for ALL file operations**
63
63
 
64
+ 4. **Docs-only exception (documentation WUs)**:
65
+ - Read-only commands may run from main.
66
+ - **All file writes still require a worktree** (claim first if needed).
67
+
64
68
  ## Quick Detection
65
69
 
66
70
  **Red flags** (you're about to fall into the trap):
@@ -115,7 +119,7 @@ About to use Write/Edit/Read?
115
119
  │ ├─ YES → Use RELATIVE paths only
116
120
  │ └─ NO → Did I claim a WU?
117
121
  │ ├─ YES → cd worktrees/<lane>-wu-xxx first
118
- │ └─ NO → Claim WU or use docs-only paths
122
+ │ └─ NO → Claim WU or use docs-only paths (read-only only)
119
123
  └─ Path starts with "/" ?
120
124
  ├─ YES → STOP! Convert to relative path
121
125
  └─ NO → Safe to proceed
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: wu-lifecycle
3
- description: Work Unit claim/block/done workflow automation. Use when claiming WUs, blocking/unblocking, running wu:done, or understanding WU state transitions.
4
- version: 2.1.0
3
+ description: Work Unit claim/block/done workflow automation. Use when claiming WUs, blocking/unblocking, running wu:prep + wu:done, or understanding WU state transitions.
4
+ version: 2.2.0
5
5
  source: docs/04-operations/_frameworks/lumenflow/lumenflow-complete.md
6
6
  source_sections: §2.4, §6 (WU Lifecycle)
7
7
  last_updated: {{DATE}}
@@ -38,9 +38,13 @@ ready → in_progress → waiting/blocked → done
38
38
  pnpm wu:claim --id WU-XXX --lane <lane>
39
39
  cd worktrees/<lane>-wu-xxx # IMMEDIATELY
40
40
 
41
- # Complete WU (from main)
42
- cd ../..
43
- pnpm wu:done --id WU-XXX
41
+ # Complete WU - TWO STEPS (WU-1223)
42
+ # Step 1: From worktree, run wu:prep
43
+ pnpm wu:prep --id WU-XXX
44
+ # This prints: cd /path/to/main && pnpm wu:done --id WU-XXX
45
+
46
+ # Step 2: From main, run wu:done (copy-paste from wu:prep output)
47
+ cd /path/to/main && pnpm wu:done --id WU-XXX
44
48
 
45
49
  # Block/Unblock
46
50
  pnpm wu:block --id WU-XXX --reason "..."
@@ -59,11 +63,18 @@ pnpm wu:prune --execute # Clean stale worktrees
59
63
  pnpm wu:cleanup --id WU-XXX # After PR merge
60
64
  ```
61
65
 
62
- ## wu:done Workflow
66
+ ## wu:prep + wu:done Workflow (WU-1223)
67
+
68
+ **Two-step completion:**
69
+
70
+ 1. `wu:prep` (from worktree): Runs gates, prints copy-paste instruction
71
+ 2. `wu:done` (from main): Fast-forward merge, stamp, cleanup
72
+
73
+ **wu:done workflow (from main):**
63
74
 
64
- 1. Runs gates in worktree
75
+ 1. Validates running from main (errors if in worktree)
65
76
  2. Fast-forward merge to main
66
- 3. Creates `.beacon/stamps/WU-XXX.done`
77
+ 3. Creates `.lumenflow/stamps/WU-XXX.done`
67
78
  4. Updates backlog.md + status.md
68
79
  5. Removes worktree
69
80