@lumenflow/cli 2.17.0 → 2.18.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 (72) hide show
  1. package/README.md +24 -23
  2. package/dist/gates.js +56 -6
  3. package/dist/gates.js.map +1 -1
  4. package/dist/hooks/enforcement-generator.js +3 -3
  5. package/dist/init.js +1 -1
  6. package/dist/orchestrate-initiative.js +4 -3
  7. package/dist/orchestrate-initiative.js.map +1 -1
  8. package/dist/orchestrate-monitor.js +2 -1
  9. package/dist/orchestrate-monitor.js.map +1 -1
  10. package/dist/public-manifest.js +11 -4
  11. package/dist/public-manifest.js.map +1 -1
  12. package/dist/spawn-list.js +1 -0
  13. package/dist/spawn-list.js.map +1 -1
  14. package/dist/wu-block.js +89 -45
  15. package/dist/wu-block.js.map +1 -1
  16. package/dist/wu-brief.js +40 -0
  17. package/dist/wu-brief.js.map +1 -0
  18. package/dist/wu-claim-cloud.js +61 -0
  19. package/dist/wu-claim-cloud.js.map +1 -0
  20. package/dist/wu-claim.js +166 -57
  21. package/dist/wu-claim.js.map +1 -1
  22. package/dist/wu-cleanup-cloud.js +76 -0
  23. package/dist/wu-cleanup-cloud.js.map +1 -0
  24. package/dist/wu-cleanup.js +42 -19
  25. package/dist/wu-cleanup.js.map +1 -1
  26. package/dist/wu-create-cloud.js +40 -0
  27. package/dist/wu-create-cloud.js.map +1 -0
  28. package/dist/wu-create.js +137 -53
  29. package/dist/wu-create.js.map +1 -1
  30. package/dist/wu-delegate.js +21 -0
  31. package/dist/wu-delegate.js.map +1 -0
  32. package/dist/wu-delete.js +102 -61
  33. package/dist/wu-delete.js.map +1 -1
  34. package/dist/wu-done-auto-cleanup.js +5 -16
  35. package/dist/wu-done-auto-cleanup.js.map +1 -1
  36. package/dist/wu-done-cloud.js +46 -0
  37. package/dist/wu-done-cloud.js.map +1 -0
  38. package/dist/wu-done.js +153 -44
  39. package/dist/wu-done.js.map +1 -1
  40. package/dist/wu-edit.js +217 -55
  41. package/dist/wu-edit.js.map +1 -1
  42. package/dist/wu-prep.js +1 -1
  43. package/dist/wu-prep.js.map +1 -1
  44. package/dist/wu-recover.js +128 -55
  45. package/dist/wu-recover.js.map +1 -1
  46. package/dist/wu-release.js +99 -45
  47. package/dist/wu-release.js.map +1 -1
  48. package/dist/wu-spawn.js +108 -42
  49. package/dist/wu-spawn.js.map +1 -1
  50. package/dist/wu-state-cloud.js +39 -0
  51. package/dist/wu-state-cloud.js.map +1 -0
  52. package/dist/wu-unblock.js +99 -49
  53. package/dist/wu-unblock.js.map +1 -1
  54. package/package.json +8 -7
  55. package/templates/core/.lumenflow/constraints.md.template +31 -4
  56. package/templates/core/LUMENFLOW.md.template +31 -9
  57. package/templates/core/ai/onboarding/agent-invocation-guide.md.template +21 -13
  58. package/templates/core/ai/onboarding/agent-safety-card.md.template +2 -2
  59. package/templates/core/ai/onboarding/docs-generation.md.template +1 -1
  60. package/templates/core/ai/onboarding/lumenflow-force-usage.md.template +1 -1
  61. package/templates/core/ai/onboarding/quick-ref-commands.md.template +235 -66
  62. package/templates/core/ai/onboarding/rapid-prototyping.md +2 -2
  63. package/templates/core/ai/onboarding/starting-prompt.md.template +124 -24
  64. package/templates/core/ai/onboarding/troubleshooting-wu-done.md.template +11 -0
  65. package/templates/core/ai/onboarding/vendor-support.md.template +58 -69
  66. package/templates/vendors/claude/.claude/skills/context-management/SKILL.md.template +3 -3
  67. package/templates/vendors/claude/.claude/skills/design-first/SKILL.md.template +151 -0
  68. package/templates/vendors/claude/.claude/skills/initiative-management/SKILL.md.template +8 -8
  69. package/templates/vendors/claude/.claude/skills/library-first/SKILL.md.template +1 -0
  70. package/templates/vendors/claude/.claude/skills/multi-agent-coordination/SKILL.md.template +5 -5
  71. package/templates/vendors/claude/.claude/skills/orchestration/SKILL.md.template +19 -16
  72. package/templates/vendors/claude/.claude/skills/tdd-workflow/SKILL.md.template +2 -0
@@ -55,13 +55,6 @@ Claude Code is Anthropic's official CLI for Claude. It has the deepest integrati
55
55
  - `.claude/settings.json` - Permission configuration
56
56
  - `.claude/agents/` - Agent definitions
57
57
  - `.claude/skills/` - Skill definitions
58
- - `.mcp.json` - MCP server configuration (WU-1413)
59
-
60
- **MCP Integration:** Claude Code supports MCP (Model Context Protocol) servers. When initializing with `--client claude`, LumenFlow automatically configures the `@lumenflow/mcp` server which provides:
61
-
62
- - WU lifecycle tools (status, claim, gates)
63
- - Memory coordination tools (checkpoint, signal, inbox)
64
- - Lane management tools (health, suggest)
65
58
 
66
59
  **Auto-detection:** Environment variables `CLAUDE_PROJECT_DIR` or `CLAUDE_CODE`
67
60
 
@@ -177,93 +170,89 @@ For projects using Antigravity:
177
170
 
178
171
  ---
179
172
 
180
- ## Using Another AI?
173
+ ## Cloud Workflow Mode (Branch-PR)
181
174
 
182
- If your AI coding assistant isn't listed above, LumenFlow still works:
175
+ Cloud-hosted agents (Codex, Claude web, GitHub Actions, CI bots) cannot create local
176
+ worktrees. LumenFlow provides a first-class **branch-pr** mode for these environments.
183
177
 
184
- 1. Run `lumenflow init` to create universal entry points
185
- 2. Tell your AI to read `AGENTS.md` and `LUMENFLOW.md`
186
- 3. The workflow commands (`wu:claim`, `wu:done`, `gates`) work the same
178
+ ### Explicit Activation
187
179
 
188
- **Want enhanced integration for your AI?** See [Adding New Integrations](#adding-new-integrations) below.
180
+ Cloud mode is always available via explicit activation:
189
181
 
190
- ---
182
+ ```bash
183
+ # Flag-based
184
+ pnpm wu:claim --id WU-XXX --lane "<Lane>" --cloud
191
185
 
192
- ## All Integrations Setup
186
+ # Environment variable
187
+ LUMENFLOW_CLOUD=1 pnpm wu:claim --id WU-XXX --lane "<Lane>"
188
+ ```
193
189
 
194
- To configure all enhanced integrations at once:
190
+ Explicit activation (`--cloud` or `LUMENFLOW_CLOUD=1`) always takes precedence over
191
+ auto-detection.
195
192
 
196
- ```bash
197
- lumenflow init --client all
193
+ ### Config-Driven Auto-Detection (Opt-In)
194
+
195
+ For environments where agents should automatically enter cloud mode, enable
196
+ auto-detection in `.lumenflow.config.yaml`:
197
+
198
+ ```yaml
199
+ cloud:
200
+ auto_detect: true # default: false
201
+ env_signals:
202
+ - name: CI # presence check (any non-empty value)
203
+ - name: CODEX
204
+ - name: GITHUB_ACTIONS
205
+ equals: 'true' # exact match required
198
206
  ```
199
207
 
200
- This creates all vendor-specific configuration files alongside the universal entry points.
208
+ **Key design decisions:**
201
209
 
202
- ---
210
+ - `auto_detect` defaults to `false` (opt-in, not opt-out)
211
+ - No vendor-specific signals are hardcoded; all signals are user-configured
212
+ - Each signal supports either presence checks (`name` only) or exact-value
213
+ matches (`name` + `equals`)
214
+ - Explicit activation always wins over auto-detection
203
215
 
204
- ## MCP Server Integration
216
+ ### Cloud Lifecycle
205
217
 
206
- LumenFlow provides an MCP (Model Context Protocol) server package for deeper AI integration.
218
+ | Step | Command | What happens |
219
+ | -------- | ----------------------------------------- | ---------------------------------------------------------------- |
220
+ | Claim | `wu:claim --id WU-XXX --lane <L> --cloud` | Sets `claimed_mode: branch-pr`, creates lane branch, no worktree |
221
+ | Work | (agent works on lane branch) | Push commits to `lane/<lane>/wu-xxx` |
222
+ | Prep | `wu:prep --id WU-XXX` | Validates branch, runs gates in-place |
223
+ | Complete | `wu:done --id WU-XXX` | Creates PR, commits metadata on lane branch |
224
+ | Cleanup | `wu:cleanup --id WU-XXX` | Post-merge: creates stamp, updates state, deletes branch |
207
225
 
208
- ### What is MCP?
226
+ ### Vendor-Specific Notes
209
227
 
210
- MCP is a protocol that allows AI assistants to access tools and context from external servers. LumenFlow's MCP server (`@lumenflow/mcp`) exposes workflow tools directly to compatible AI assistants.
228
+ - **Codex**: Set `LUMENFLOW_CLOUD=1` in the environment or configure auto-detection with `name: CODEX`
229
+ - **Claude web**: Use `--cloud` flag explicitly or configure `name: CLAUDE_CODE` in env_signals
230
+ - **GitHub Actions**: Configure `name: GITHUB_ACTIONS, equals: 'true'` in env_signals
231
+ - **Antigravity**: Expected to work with explicit `--cloud` flag; auto-detection signals TBD
211
232
 
212
- ### Supported Assistants
233
+ ---
213
234
 
214
- | Assistant | MCP Support | Configuration |
215
- | ------------- | ----------- | --------------- |
216
- | Claude Code | Yes | `.mcp.json` |
217
- | Antigravity | Yes | TBD |
218
- | Cursor | No | Uses rules file |
219
- | Windsurf | No | Uses rules file |
235
+ ## Using Another AI?
220
236
 
221
- ### Setup (Claude Code)
237
+ If your AI coding assistant isn't listed above, LumenFlow still works:
222
238
 
223
- When you run `lumenflow init --client claude`, a `.mcp.json` is automatically created:
239
+ 1. Run `lumenflow init` to create universal entry points
240
+ 2. Tell your AI to read `AGENTS.md` and `LUMENFLOW.md`
241
+ 3. The workflow commands (`wu:claim`, `wu:done`, `gates`) work the same
224
242
 
225
- ```json
226
- {
227
- "mcpServers": {
228
- "lumenflow": {
229
- "command": "npx",
230
- "args": ["@lumenflow/mcp"]
231
- }
232
- }
233
- }
234
- ```
243
+ **Want enhanced integration for your AI?** See [Adding New Integrations](#adding-new-integrations) below.
235
244
 
236
- ### Manual Setup
245
+ ---
246
+
247
+ ## All Integrations Setup
237
248
 
238
- If you already have LumenFlow but need to add MCP support:
249
+ To configure all enhanced integrations at once:
239
250
 
240
251
  ```bash
241
- # Option 1: Re-run init with force to regenerate all files
242
- lumenflow init --client claude --force
243
-
244
- # Option 2: Manually create .mcp.json
245
- echo '{
246
- "mcpServers": {
247
- "lumenflow": {
248
- "command": "npx",
249
- "args": ["@lumenflow/mcp"]
250
- }
251
- }
252
- }' > .mcp.json
252
+ lumenflow init --client all
253
253
  ```
254
254
 
255
- ### Available MCP Tools
256
-
257
- The `@lumenflow/mcp` server provides these tools to AI assistants:
258
-
259
- | Tool | Description |
260
- | -------------- | ------------------------------------ |
261
- | `wu_status` | Get current WU status and location |
262
- | `wu_claim` | Claim a WU and create worktree |
263
- | `gates` | Run quality gates |
264
- | `mem_checkpoint` | Save progress checkpoint |
265
- | `mem_inbox` | Check coordination signals |
266
- | `lane_health` | Check lane configuration health |
255
+ This creates all vendor-specific configuration files alongside the universal entry points.
267
256
 
268
257
  ---
269
258
 
@@ -42,7 +42,7 @@ git add -A && git commit -m "checkpoint: progress on X"
42
42
  git push origin lane/<lane>/wu-xxx
43
43
 
44
44
  # 3. Generate fresh agent prompt
45
- pnpm wu:spawn --id WU-XXX
45
+ pnpm wu:brief --id WU-XXX --client claude-code
46
46
 
47
47
  # 4. EXIT current session (do NOT continue after compaction)
48
48
 
@@ -97,8 +97,8 @@ LumenFlow implements automatic recovery hooks that preserve context across compa
97
97
  # Generate recovery context manually (if hooks didn't fire)
98
98
  pnpm mem:recover --wu WU-XXX
99
99
 
100
- # Generate spawn prompt with full context
101
- pnpm wu:spawn --id WU-XXX
100
+ # Generate prompt with full context
101
+ pnpm wu:brief --id WU-XXX --client claude-code
102
102
  ```
103
103
 
104
104
  **Important**: The recovery hooks are a safety net. The recommended approach is still to spawn
@@ -0,0 +1,151 @@
1
+ ---
2
+ name: design-first
3
+ description: 5-step design validation before implementation. Question requirements, delete unnecessary, simplify, speed up, automate last. Use BEFORE TDD, BEFORE writing any code.
4
+ version: 1.0.0
5
+ source: .claude/skills/design-first/SKILL.md
6
+ last_updated: {{DATE}}
7
+ allowed-tools: Read, Grep, Glob
8
+ ---
9
+
10
+ # Design-First Skill (5-Step Algorithm)
11
+
12
+ Before writing code, follow these 5 steps IN ORDER. The order matters—don't optimize something that shouldn't exist.
13
+
14
+ ## When to Use
15
+
16
+ Activate this skill when:
17
+
18
+ - Starting work on a feature WU
19
+ - Creating an initiative plan
20
+ - Designing a new component or system
21
+ - Before loading tdd-workflow skill
22
+
23
+ **Critical**: This skill comes BEFORE TDD. Question whether the feature should exist before writing the first failing test.
24
+
25
+ ## The 5 Steps
26
+
27
+ ### Step 1: Question the Requirements
28
+
29
+ Before accepting any requirement, ask:
30
+
31
+ | Question | If "No" Then... |
32
+ | --------------------------------- | -------------------------------- |
33
+ | Is the requirement specific? | Get clarity before proceeding |
34
+ | Is this the real problem? | Dig deeper into root cause |
35
+ | Would users actually want this? | Validate with evidence |
36
+ | Does this already exist? | Use existing feature/library |
37
+ | Who requested this? Right person? | Verify authority to define scope |
38
+
39
+ **STOP if**: You cannot articulate the specific user problem being solved in 1-2 sentences.
40
+
41
+ ### Step 2: Try to Delete
42
+
43
+ Before building anything:
44
+
45
+ | Question | Action |
46
+ | ------------------------------------ | ------------------ |
47
+ | Can we remove this feature entirely? | Try removing it |
48
+ | What would break without it? | If nothing, cut it |
49
+ | Is this "nice to have"? | Cut for MVP |
50
+ | Are there unnecessary steps? | Eliminate them |
51
+
52
+ **The 10% Rule**: You must consider at least 3 things for deletion. If you end up keeping everything, you weren't aggressive enough. If you don't have to put back at least 10% of what you deleted, you didn't delete enough.
53
+
54
+ **Document**: What you considered deleting and why it was retained.
55
+
56
+ ### Step 3: Simplify / Optimize
57
+
58
+ Only after Steps 1-2:
59
+
60
+ - Can this use fewer abstractions?
61
+ - Can this use existing patterns? (Check codebase first)
62
+ - Can this use a library? (Load `/skill library-first`)
63
+ - Is this the simplest solution that works?
64
+
65
+ **Warning**: The most common mistake of smart engineers is optimizing something that should not exist.
66
+
67
+ ### Step 4: Speed Up
68
+
69
+ Only after Step 3:
70
+
71
+ - Are there performance bottlenecks?
72
+ - Can caching help?
73
+ - Is latency acceptable?
74
+
75
+ **Skip if**: Feature doesn't have explicit performance requirements. Don't prematurely optimize.
76
+
77
+ ### Step 5: Automate
78
+
79
+ Last step, never first:
80
+
81
+ - Is the manual process proven to work?
82
+ - Is the process stable enough to automate?
83
+ - Will automation actually help users?
84
+
85
+ **Warning**: Automating a bad process makes bad things happen faster.
86
+
87
+ ## Required Documentation
88
+
89
+ Before implementation, document in WU notes or plan:
90
+
91
+ ```yaml
92
+ design_validation:
93
+ step1_requirements:
94
+ problem: 'User cannot X because Y'
95
+ validated_by: 'User interview / data / assumption'
96
+ step2_deletion:
97
+ considered: ['Feature A', 'Component B', 'Step C']
98
+ removed: ['Component B']
99
+ retained_reason: 'Feature A needed for acceptance criteria'
100
+ step3_simplification:
101
+ approach: 'Using existing library X instead of custom code'
102
+ library_refs: ['zod', 'date-fns']
103
+ step4_speed: 'N/A - no performance requirements'
104
+ step5_automation: 'Manual first, will automate in future WU'
105
+ ```
106
+
107
+ ## Decision Tree
108
+
109
+ ```
110
+ Starting a feature?
111
+ ├─ Can you articulate the user problem in 1-2 sentences?
112
+ │ └─ NO → STOP. Clarify requirements first.
113
+
114
+ ├─ Have you considered what to delete?
115
+ │ └─ NO → STOP. List 3+ things to potentially cut.
116
+
117
+ ├─ Is there a simpler approach?
118
+ │ └─ MAYBE → Load /skill library-first, check for existing patterns
119
+
120
+ └─ All steps complete?
121
+ └─ YES → Proceed to /skill tdd-workflow
122
+ ```
123
+
124
+ ## Integration with Other Skills
125
+
126
+ | Skill | Relationship |
127
+ | --------------- | ---------------------------------------------------------- |
128
+ | `library-first` | Step 3 — Use during Simplify phase |
129
+ | `tdd-workflow` | Comes AFTER design-first. Don't test what shouldn't exist. |
130
+ | `code-quality` | Step 3 — SOLID/DRY/KISS alignment |
131
+
132
+ ## Red Flags (Stop and Reconsider)
133
+
134
+ - Writing code without answering Step 1 questions
135
+ - Keeping everything you started with (Step 2 not applied)
136
+ - Automating before manual process proven (Step 5 violation)
137
+ - Optimizing before simplifying (Steps 3-4 order violation)
138
+ - Building custom code when a library exists (Step 3 violation)
139
+
140
+ ## Anti-Patterns
141
+
142
+ | Anti-Pattern | What to Do Instead |
143
+ | -------------------------------------- | --------------------------------------- |
144
+ | "We might need this later" | YAGNI — delete it, add when needed |
145
+ | "Let me optimize this first" | Simplify first, optimize after it works |
146
+ | "I'll automate this from the start" | Prove it manually, then automate |
147
+ | "The requirement says X, so I'll do X" | Question X first |
148
+
149
+ ---
150
+
151
+ **Core Principle**: "The best code is no code. The best feature is no feature. Question everything before building anything."
@@ -124,31 +124,31 @@ Initiatives often span multiple lanes. Key coordination patterns:
124
124
  2. **Parallel execution**: Multiple lanes work simultaneously on independent WUs
125
125
  3. **Integration points**: Final WU combines work from all lanes
126
126
 
127
- ## Spawning Sub-Agents for Initiative WUs (MANDATORY)
127
+ ## Delegating Sub-Agents for Initiative WUs (MANDATORY)
128
128
 
129
- When orchestrating an initiative with multiple WUs, use `wu:spawn` to generate complete Task invocations:
129
+ When orchestrating an initiative with multiple WUs, use `wu:brief` or `wu:delegate` to generate complete Task invocations:
130
130
 
131
131
  ```bash
132
132
  # For each WU being delegated to a sub-agent:
133
- pnpm wu:spawn --id WU-1501 # Generates Task invocation with full context
134
- pnpm wu:spawn --id WU-1502
135
- pnpm wu:spawn --id WU-1503
133
+ pnpm wu:brief --id WU-1501 --client claude-code # Prompt generation only
134
+ pnpm wu:delegate --id WU-1502 --parent-wu WU-1500 # Prompt + lineage recording
135
+ pnpm wu:delegate --id WU-1503 --parent-wu WU-1500
136
136
  ```
137
137
 
138
138
  ### Orchestration Pattern
139
139
 
140
- 1. **Generate prompts**: Run `pnpm wu:spawn --id WU-XXX` for each WU
140
+ 1. **Generate prompts**: Run `pnpm wu:brief --id WU-XXX` (or `wu:delegate` for lineage) for each WU
141
141
  2. **Spawn in parallel**: Use Task tool with `run_in_background: true`
142
142
  3. **Monitor progress**: Use `pnpm mem:inbox --since 30m` (NOT TaskOutput - causes context explosion)
143
143
  4. **Synthesise**: Combine results from all sub-agents
144
144
 
145
- ### What wu:spawn Provides
145
+ ### What wu:brief/wu:delegate Provides
146
146
 
147
147
  - Context loading preamble (LUMENFLOW.md, README, lumenflow-complete, WU YAML)
148
148
  - Full acceptance criteria from WU spec
149
149
  - Constraints block at end (per "Lost in the Middle" research)
150
150
 
151
- ### When NOT to Use wu:spawn
151
+ ### When NOT to Use wu:brief/wu:delegate
152
152
 
153
153
  - Helper agents for the orchestrator's own WU (use inline context)
154
154
  - Validation agents checking orchestrator's work
@@ -90,6 +90,7 @@ library_decisions:
90
90
 
91
91
  ## Integration with Other Skills
92
92
 
93
+ - **design-first**: Library-First is Step 3 (Simplify) of the 5-step algorithm
93
94
  - **tdd-workflow**: Library selection happens BEFORE writing tests
94
95
  - **code-quality**: Library-first prevents DRY violations
95
96
 
@@ -26,16 +26,16 @@ Activate this skill when:
26
26
  - Git prevents duplicate branches = automatic locking
27
27
  - No heartbeats, no session files
28
28
 
29
- ## Spawning Sub-Agents
29
+ ## Delegating to Sub-Agents
30
30
 
31
- **Use wu:spawn** when delegating entire WU:
31
+ **Use wu:brief/wu:delegate** when delegating an entire WU:
32
32
 
33
33
  ```bash
34
- pnpm wu:spawn --id WU-XXX # Standard
35
- pnpm wu:spawn --id WU-XXX --thinking # Complex WUs
34
+ pnpm wu:brief --id WU-XXX --client claude-code # Generate prompt only
35
+ pnpm wu:delegate --id WU-XXX --parent-wu WU-YYY # Generate prompt + record lineage
36
36
  ```
37
37
 
38
- **DON'T use wu:spawn** for helper agents (code-reviewer, test-engineer) on YOUR WU.
38
+ **DON'T use wu:brief/wu:delegate** for helper agents (code-reviewer, test-engineer) on YOUR WU.
39
39
 
40
40
  ## Parallel Spawning
41
41
 
@@ -27,20 +27,23 @@ Activate this skill when:
27
27
  # ✅ CORRECT: Use orchestrate:initiative for initiatives
28
28
  pnpm orchestrate:initiative --initiative INIT-XXX
29
29
 
30
- # ✅ CORRECT: Use wu:spawn for individual WUs
31
- pnpm wu:spawn --id WU-XXX
30
+ # ✅ CORRECT: Use wu:brief for prompt generation
31
+ pnpm wu:brief --id WU-XXX --client claude-code
32
+
33
+ # ✅ CORRECT: Use wu:delegate for lineage-tracked delegation
34
+ pnpm wu:delegate --id WU-XXX --parent-wu WU-YYY
32
35
  ```
33
36
 
34
37
  **❌ NEVER do this:**
35
38
 
36
- - Directly invoke Task tool for WU execution without using wu:spawn output
39
+ - Directly invoke Task tool for WU execution without using wu:brief/wu:delegate output
37
40
  - Manually craft spawn prompts (they miss context loading, TDD directives, constraints)
38
- - Skip wu:spawn when delegating entire WUs to sub-agents
41
+ - Skip wu:brief/wu:delegate when delegating entire WUs to sub-agents
39
42
 
40
43
  **Why this matters:**
41
44
 
42
- 1. `wu:spawn` generates prompts with context loading preamble, TDD directives, and constraints block
43
- 2. Sub-agents need `wu:claim` (inside spawn prompts) to create proper lane locks and event tracking
45
+ 1. `wu:brief` generates prompts with context loading preamble, TDD directives, and constraints block
46
+ 2. Sub-agents need `wu:claim` (inside generated prompts) to create proper lane locks and event tracking
44
47
  3. Direct Task spawns bypass all safety mechanisms, coordination signals, and spawn registry tracking
45
48
 
46
49
  **If you see agents running without proper worktree claims, STOP and investigate.**
@@ -49,18 +52,18 @@ pnpm wu:spawn --id WU-XXX
49
52
 
50
53
  ## Verbatim Output Verification (WU-1131)
51
54
 
52
- When using `wu:spawn` output to invoke Task agents, you **MUST** verify the output was not truncated.
55
+ When using `wu:brief`/`wu:delegate` output to invoke Task agents, you **MUST** verify the output was not truncated.
53
56
 
54
57
  ### Truncation Detection
55
58
 
56
- `wu:spawn` output includes:
59
+ `wu:brief`/`wu:delegate` output includes:
57
60
 
58
61
  - **Warning banner** at the start with truncation instructions
59
62
  - **End sentinel** `<!-- LUMENFLOW_SPAWN_END -->` after the constraints block
60
63
 
61
64
  ### Verification Checklist
62
65
 
63
- Before spawning a sub-agent with `wu:spawn` output:
66
+ Before spawning a sub-agent with `wu:brief`/`wu:delegate` output:
64
67
 
65
68
  1. **Check for end sentinel**: The output MUST end with `<!-- LUMENFLOW_SPAWN_END -->`
66
69
  2. **Verify constraints block**: Look for `</constraints>` before the end sentinel
@@ -68,9 +71,9 @@ Before spawning a sub-agent with `wu:spawn` output:
68
71
 
69
72
  ```bash
70
73
  # 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
+ pnpm wu:brief --id WU-XXX | tail -5 # Should show LUMENFLOW_SPAWN_END
75
+ pnpm wu:brief --id WU-XXX | head -20 # Should show TRUNCATION_WARNING
76
+ pnpm wu:brief --id WU-XXX | grep -c 'constraints' # Should return 2 (open and close tags)
74
77
  ```
75
78
 
76
79
  ### What Truncation Causes
@@ -84,7 +87,7 @@ If spawn output is truncated, sub-agents will:
84
87
 
85
88
  ### If Truncation Is Detected
86
89
 
87
- 1. Re-run `wu:spawn` and capture full output
90
+ 1. Re-run `wu:brief` and capture full output
88
91
  2. If context window is too small, use `--codex` for shorter Markdown format
89
92
  3. Consider breaking WU into smaller sub-WUs if prompt is too large
90
93
 
@@ -205,16 +208,16 @@ pnpm wu:block --id WU-XXX --reason "Spawn stuck for 45 minutes"
205
208
  # For zombie lane locks
206
209
  pnpm lane:unlock "Operations: Tooling" --reason "Zombie lock (PID 12345 not running)"
207
210
 
208
- # After recovery, re-spawn
211
+ # After recovery, re-delegate
209
212
  pnpm wu:unblock --id WU-XXX
210
- pnpm wu:spawn --id WU-XXX
213
+ pnpm wu:brief --id WU-XXX
211
214
  ```
212
215
 
213
216
  ## Decision Tree
214
217
 
215
218
  ```
216
219
  Starting WU?
217
- ├── Run: pnpm wu:spawn --id WU-XXX
220
+ ├── Run: pnpm wu:brief --id WU-XXX --client <client>
218
221
  └── Review generated prompt with agent recommendations
219
222
 
220
223
  Initiative with multiple WUs?
@@ -21,6 +21,8 @@ Activate this skill when:
21
21
  - Need to understand which layer code belongs in
22
22
  - Writing use cases with dependency injection
23
23
 
24
+ **Prerequisite**: Load `/skill design-first` FIRST to question requirements and simplify before writing tests.
25
+
24
26
  **Use skill first**: Follow RED-GREEN-REFACTOR cycle and 5-step AI-TDD pattern.
25
27
 
26
28
  **Spawn test-engineer agent when**: Complex test scenarios require golden dataset creation, VCR cassette setup needed, or coverage gaps require investigation.