@lumenflow/cli 2.2.2 → 2.3.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 (118) hide show
  1. package/README.md +147 -57
  2. package/dist/__tests__/agent-log-issue.test.js +56 -0
  3. package/dist/__tests__/cli-entry-point.test.js +66 -17
  4. package/dist/__tests__/cli-subprocess.test.js +25 -0
  5. package/dist/__tests__/init.test.js +298 -0
  6. package/dist/__tests__/initiative-plan.test.js +340 -0
  7. package/dist/__tests__/mem-cleanup-execution.test.js +19 -0
  8. package/dist/__tests__/merge-block.test.js +220 -0
  9. package/dist/__tests__/safe-git.test.js +191 -0
  10. package/dist/__tests__/state-doctor.test.js +274 -0
  11. package/dist/__tests__/wu-done.test.js +36 -0
  12. package/dist/__tests__/wu-edit.test.js +119 -0
  13. package/dist/__tests__/wu-prep.test.js +108 -0
  14. package/dist/agent-issues-query.js +4 -3
  15. package/dist/agent-log-issue.js +25 -4
  16. package/dist/backlog-prune.js +5 -4
  17. package/dist/cli-entry-point.js +11 -1
  18. package/dist/doctor.js +368 -0
  19. package/dist/flow-bottlenecks.js +6 -5
  20. package/dist/flow-report.js +4 -3
  21. package/dist/gates.js +356 -101
  22. package/dist/guard-locked.js +4 -3
  23. package/dist/guard-worktree-commit.js +4 -3
  24. package/dist/init.js +508 -86
  25. package/dist/initiative-add-wu.js +4 -3
  26. package/dist/initiative-bulk-assign-wus.js +8 -5
  27. package/dist/initiative-create.js +73 -37
  28. package/dist/initiative-edit.js +37 -21
  29. package/dist/initiative-list.js +4 -3
  30. package/dist/initiative-plan.js +337 -0
  31. package/dist/initiative-status.js +4 -3
  32. package/dist/lane-health.js +377 -0
  33. package/dist/lane-suggest.js +382 -0
  34. package/dist/mem-checkpoint.js +2 -2
  35. package/dist/mem-cleanup.js +2 -2
  36. package/dist/mem-context.js +306 -0
  37. package/dist/mem-create.js +2 -2
  38. package/dist/mem-delete.js +293 -0
  39. package/dist/mem-inbox.js +2 -2
  40. package/dist/mem-index.js +211 -0
  41. package/dist/mem-init.js +1 -1
  42. package/dist/mem-profile.js +207 -0
  43. package/dist/mem-promote.js +254 -0
  44. package/dist/mem-ready.js +2 -2
  45. package/dist/mem-signal.js +2 -2
  46. package/dist/mem-start.js +2 -2
  47. package/dist/mem-summarize.js +2 -2
  48. package/dist/mem-triage.js +2 -2
  49. package/dist/merge-block.js +222 -0
  50. package/dist/metrics-cli.js +7 -4
  51. package/dist/metrics-snapshot.js +4 -3
  52. package/dist/orchestrate-initiative.js +10 -4
  53. package/dist/orchestrate-monitor.js +379 -31
  54. package/dist/signal-cleanup.js +296 -0
  55. package/dist/spawn-list.js +6 -5
  56. package/dist/state-bootstrap.js +5 -4
  57. package/dist/state-cleanup.js +360 -0
  58. package/dist/state-doctor-fix.js +196 -0
  59. package/dist/state-doctor.js +501 -0
  60. package/dist/validate-agent-skills.js +4 -3
  61. package/dist/validate-agent-sync.js +4 -3
  62. package/dist/validate-backlog-sync.js +4 -3
  63. package/dist/validate-skills-spec.js +4 -3
  64. package/dist/validate.js +4 -3
  65. package/dist/wu-block.js +3 -3
  66. package/dist/wu-claim.js +208 -98
  67. package/dist/wu-cleanup.js +5 -4
  68. package/dist/wu-create.js +71 -46
  69. package/dist/wu-delete.js +88 -60
  70. package/dist/wu-deps.js +6 -5
  71. package/dist/wu-done-check.js +34 -0
  72. package/dist/wu-done.js +39 -12
  73. package/dist/wu-edit.js +63 -28
  74. package/dist/wu-infer-lane.js +7 -6
  75. package/dist/wu-preflight.js +23 -81
  76. package/dist/wu-prep.js +125 -0
  77. package/dist/wu-prune.js +4 -3
  78. package/dist/wu-recover.js +88 -22
  79. package/dist/wu-repair.js +7 -6
  80. package/dist/wu-spawn.js +226 -270
  81. package/dist/wu-status.js +4 -3
  82. package/dist/wu-unblock.js +5 -5
  83. package/dist/wu-unlock-lane.js +4 -3
  84. package/dist/wu-validate.js +5 -4
  85. package/package.json +16 -7
  86. package/templates/core/.lumenflow/constraints.md.template +192 -0
  87. package/templates/core/.lumenflow/rules/git-safety.md.template +27 -0
  88. package/templates/core/.lumenflow/rules/wu-workflow.md.template +48 -0
  89. package/templates/core/AGENTS.md.template +60 -0
  90. package/templates/core/LUMENFLOW.md.template +255 -0
  91. package/templates/core/UPGRADING.md.template +121 -0
  92. package/templates/core/ai/onboarding/agent-safety-card.md.template +106 -0
  93. package/templates/core/ai/onboarding/first-wu-mistakes.md.template +198 -0
  94. package/templates/core/ai/onboarding/quick-ref-commands.md.template +186 -0
  95. package/templates/core/ai/onboarding/release-process.md.template +362 -0
  96. package/templates/core/ai/onboarding/troubleshooting-wu-done.md.template +159 -0
  97. package/templates/core/ai/onboarding/wu-create-checklist.md.template +117 -0
  98. package/templates/vendors/aider/.aider.conf.yml.template +27 -0
  99. package/templates/vendors/claude/.claude/CLAUDE.md.template +52 -0
  100. package/templates/vendors/claude/.claude/settings.json.template +49 -0
  101. package/templates/vendors/claude/.claude/skills/bug-classification/SKILL.md.template +192 -0
  102. package/templates/vendors/claude/.claude/skills/code-quality/SKILL.md.template +152 -0
  103. package/templates/vendors/claude/.claude/skills/context-management/SKILL.md.template +155 -0
  104. package/templates/vendors/claude/.claude/skills/execution-memory/SKILL.md.template +304 -0
  105. package/templates/vendors/claude/.claude/skills/frontend-design/SKILL.md.template +131 -0
  106. package/templates/vendors/claude/.claude/skills/initiative-management/SKILL.md.template +164 -0
  107. package/templates/vendors/claude/.claude/skills/library-first/SKILL.md.template +98 -0
  108. package/templates/vendors/claude/.claude/skills/lumenflow-gates/SKILL.md.template +87 -0
  109. package/templates/vendors/claude/.claude/skills/multi-agent-coordination/SKILL.md.template +84 -0
  110. package/templates/vendors/claude/.claude/skills/ops-maintenance/SKILL.md.template +254 -0
  111. package/templates/vendors/claude/.claude/skills/orchestration/SKILL.md.template +189 -0
  112. package/templates/vendors/claude/.claude/skills/tdd-workflow/SKILL.md.template +139 -0
  113. package/templates/vendors/claude/.claude/skills/worktree-discipline/SKILL.md.template +138 -0
  114. package/templates/vendors/claude/.claude/skills/wu-lifecycle/SKILL.md.template +106 -0
  115. package/templates/vendors/cline/.clinerules.template +53 -0
  116. package/templates/vendors/cursor/.cursor/rules/lumenflow.md.template +34 -0
  117. package/templates/vendors/cursor/.cursor/rules.md.template +28 -0
  118. package/templates/vendors/windsurf/.windsurf/rules/lumenflow.md.template +34 -0
package/dist/wu-status.js CHANGED
@@ -180,9 +180,10 @@ async function main() {
180
180
  // Exit with appropriate code
181
181
  process.exit(getStatusExitCode(context));
182
182
  }
183
- // Guard main() for testability
184
- import { fileURLToPath } from 'node:url';
183
+ // WU-1181: Use import.meta.main instead of process.argv[1] comparison
184
+ // The old pattern fails with pnpm symlinks because process.argv[1] is the symlink
185
+ // path but import.meta.url resolves to the real path - they never match
185
186
  import { runCLI } from './cli-entry-point.js';
186
- if (process.argv[1] === fileURLToPath(import.meta.url)) {
187
+ if (import.meta.main) {
187
188
  runCLI(main);
188
189
  }
@@ -32,13 +32,13 @@ import { withMicroWorktree } from '@lumenflow/core/dist/micro-worktree.js';
32
32
  import { WUStateStore } from '@lumenflow/core/dist/wu-state-store.js';
33
33
  // WU-1574: Import backlog generator to replace BacklogManager
34
34
  import { generateBacklog, generateStatus } from '@lumenflow/core/dist/backlog-generator.js';
35
- // ensureOnMain() moved to wu-helpers.mjs (WU-1256)
36
- // ensureStaged() moved to git-staged-validator.mjs (WU-1341)
37
- // defaultWorktreeFrom() moved to wu-paths.mjs (WU-1341)
35
+ // ensureOnMain() moved to wu-helpers.ts (WU-1256)
36
+ // ensureStaged() moved to git-staged-validator.ts (WU-1341)
37
+ // defaultWorktreeFrom() moved to wu-paths.ts (WU-1341)
38
38
  const PREFIX = LOG_PREFIX.UNBLOCK;
39
39
  // WU-1574: Removed legacy backlog manipulation functions
40
40
  // All backlog/status updates now use WUStateStore + backlog generator
41
- // defaultBranchFrom() consolidated to wu-done-validators.mjs (emergency fix)
41
+ // defaultBranchFrom() consolidated to wu-done-validators.ts (emergency fix)
42
42
  function branchExists(branch) {
43
43
  try {
44
44
  getGitForCwd().run(`git rev-parse --verify ${JSON.stringify(branch)}`);
@@ -64,7 +64,7 @@ function createWorktree(doc, worktreePath, branchName) {
64
64
  getGitForCwd().run(`git worktree add ${JSON.stringify(worktreePath)} -b ${JSON.stringify(branchName)} ${GIT_REFS.ORIGIN_MAIN}`);
65
65
  }
66
66
  }
67
- // emitTelemetry() moved to telemetry.mjs as emitWUFlowEvent() (WU-1256)
67
+ // emitTelemetry() moved to telemetry.ts as emitWUFlowEvent() (WU-1256)
68
68
  /**
69
69
  * Handle lane occupancy check and enforce WIP=1 policy
70
70
  */
@@ -155,9 +155,10 @@ async function main() {
155
155
  console.log(`${PREFIX} Previous owner: ${result.previousLock?.wuId || 'unknown'}`);
156
156
  console.log(`${PREFIX} Reason: ${result.reason}`);
157
157
  }
158
- // Guard main() for testability (WU-1064)
159
- import { fileURLToPath } from 'node:url';
158
+ // WU-1181: Use import.meta.main instead of process.argv[1] comparison
159
+ // The old pattern fails with pnpm symlinks because process.argv[1] is the symlink
160
+ // path but import.meta.url resolves to the real path - they never match
160
161
  import { runCLI } from './cli-entry-point.js';
161
- if (process.argv[1] === fileURLToPath(import.meta.url)) {
162
+ if (import.meta.main) {
162
163
  runCLI(main);
163
164
  }
@@ -11,7 +11,7 @@
11
11
  * pnpm wu:validate --all # Validate all WUs
12
12
  * pnpm wu:validate --all --strict # Fail on warnings too
13
13
  *
14
- * @see {@link tools/lib/wu-schema.mjs} - Schema definitions
14
+ * @see {@link packages/@lumenflow/cli/src/lib/wu-schema.ts} - Schema definitions
15
15
  */
16
16
  import { existsSync, readFileSync, readdirSync } from 'node:fs';
17
17
  import path from 'node:path';
@@ -186,9 +186,10 @@ async function main() {
186
186
  }
187
187
  }
188
188
  }
189
- // Guard main() for testability
190
- import { fileURLToPath } from 'node:url';
189
+ // WU-1181: Use import.meta.main instead of process.argv[1] comparison
190
+ // The old pattern fails with pnpm symlinks because process.argv[1] is the symlink
191
+ // path but import.meta.url resolves to the real path - they never match
191
192
  import { runCLI } from './cli-entry-point.js';
192
- if (process.argv[1] === fileURLToPath(import.meta.url)) {
193
+ if (import.meta.main) {
193
194
  runCLI(main);
194
195
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumenflow/cli",
3
- "version": "2.2.2",
3
+ "version": "2.3.1",
4
4
  "description": "Command-line interface for LumenFlow workflow framework",
5
5
  "keywords": [
6
6
  "lumenflow",
@@ -36,6 +36,7 @@
36
36
  "bin": {
37
37
  "wu-claim": "./dist/wu-claim.js",
38
38
  "wu-done": "./dist/wu-done.js",
39
+ "wu-prep": "./dist/wu-prep.js",
39
40
  "wu-block": "./dist/wu-block.js",
40
41
  "wu-unblock": "./dist/wu-unblock.js",
41
42
  "wu-create": "./dist/wu-create.js",
@@ -60,10 +61,12 @@
60
61
  "mem-export": "./dist/mem-export.js",
61
62
  "mem-signal": "./dist/mem-signal.js",
62
63
  "mem-cleanup": "./dist/mem-cleanup.js",
64
+ "signal-cleanup": "./dist/signal-cleanup.js",
63
65
  "mem-create": "./dist/mem-create.js",
64
66
  "mem-inbox": "./dist/mem-inbox.js",
65
67
  "mem-summarize": "./dist/mem-summarize.js",
66
68
  "mem-triage": "./dist/mem-triage.js",
69
+ "mem-delete": "./dist/mem-delete.js",
67
70
  "initiative-create": "./dist/initiative-create.js",
68
71
  "initiative-edit": "./dist/initiative-edit.js",
69
72
  "initiative-list": "./dist/initiative-list.js",
@@ -88,6 +91,7 @@
88
91
  "lumenflow-gates": "./dist/gates.js",
89
92
  "lumenflow-init": "./dist/init.js",
90
93
  "lumenflow": "./dist/init.js",
94
+ "lumenflow-doctor": "./dist/doctor.js",
91
95
  "lumenflow-release": "./dist/release.js",
92
96
  "lumenflow-docs-sync": "./dist/docs-sync.js",
93
97
  "lumenflow-sync-templates": "./dist/sync-templates.js",
@@ -116,10 +120,15 @@
116
120
  "git-log": "./dist/git-log.js",
117
121
  "git-branch": "./dist/git-branch.js",
118
122
  "guard-main-branch": "./dist/guard-main-branch.js",
119
- "state-bootstrap": "./dist/state-bootstrap.js"
123
+ "state-bootstrap": "./dist/state-bootstrap.js",
124
+ "lane-health": "./dist/lane-health.js",
125
+ "lane-suggest": "./dist/lane-suggest.js",
126
+ "state-cleanup": "./dist/state-cleanup.js",
127
+ "state-doctor": "./dist/state-doctor.js"
120
128
  },
121
129
  "files": [
122
130
  "dist",
131
+ "templates",
123
132
  "LICENSE",
124
133
  "README.md"
125
134
  ],
@@ -133,11 +142,11 @@
133
142
  "pretty-ms": "^9.2.0",
134
143
  "simple-git": "^3.30.0",
135
144
  "yaml": "^2.8.2",
136
- "@lumenflow/core": "2.2.2",
137
- "@lumenflow/metrics": "2.2.2",
138
- "@lumenflow/memory": "2.2.2",
139
- "@lumenflow/initiatives": "2.2.2",
140
- "@lumenflow/agent": "2.2.2"
145
+ "@lumenflow/core": "2.3.1",
146
+ "@lumenflow/metrics": "2.3.1",
147
+ "@lumenflow/memory": "2.3.1",
148
+ "@lumenflow/agent": "2.3.1",
149
+ "@lumenflow/initiatives": "2.3.1"
141
150
  },
142
151
  "devDependencies": {
143
152
  "@vitest/coverage-v8": "^4.0.17",
@@ -0,0 +1,192 @@
1
+ # LumenFlow Constraints Capsule
2
+
3
+ **Version:** 1.0
4
+ **Last updated:** {{DATE}}
5
+
6
+ This document contains the 6 non-negotiable constraints that every agent must keep "in working memory" from first plan through `wu:done`.
7
+
8
+ ---
9
+
10
+ ## The 6 Non-Negotiable Constraints
11
+
12
+ ### 1. Worktree Discipline and Git Safety
13
+
14
+ **Rule:** Work only in worktrees, treat main as read-only, never run destructive git commands on main.
15
+
16
+ **Enforcement:**
17
+
18
+ - After `pnpm wu:claim`, immediately `cd worktrees/<lane>-wu-xxx`
19
+ - Hooks block WU commits from main checkout
20
+ - Forbidden commands on main: `git reset --hard`, `git stash`, `git clean -fd`, `git push --force`
21
+
22
+ **Why:** Worktree isolation prevents cross-contamination between parallel WUs and protects the main branch.
23
+
24
+ ---
25
+
26
+ ### 2. WUs Are Specs, Not Code
27
+
28
+ **Rule:** Respect code_paths boundaries, no feature creep, no code blocks in WU YAML files.
29
+
30
+ **Enforcement:**
31
+
32
+ - Only modify files listed in `code_paths`
33
+ - WU YAML contains acceptance criteria, not implementation code
34
+ - Scope discipline: implement only what the spec requires
35
+
36
+ **Why:** WUs define WHAT to build, not HOW. Implementation decisions belong in code, not specs.
37
+
38
+ ---
39
+
40
+ ### 3. Docs-Only vs Code WUs
41
+
42
+ **Rule:** Documentation WUs use `--docs-only` gates, code WUs run full gates.
43
+
44
+ **Enforcement:**
45
+
46
+ - `type: documentation` in WU YAML triggers docs-only mode
47
+ - `pnpm gates --docs-only` skips lint/typecheck/tests
48
+ - Path validation prevents code files in docs WUs
49
+
50
+ **Why:** Docs changes shouldn't require full test suite. Code changes must pass all gates.
51
+
52
+ ---
53
+
54
+ ### 4. LLM-First, Zero-Fallback Inference
55
+
56
+ **Rule:** Use LLMs for semantic tasks, fall back to safe defaults (never regex/keywords).
57
+
58
+ **Enforcement:**
59
+
60
+ - Prompt-based classification for ambiguous inputs
61
+ - Structured output parsing for LLM responses
62
+ - No brittle keyword matching for semantic decisions
63
+
64
+ **Why:** Regex and keyword matching are brittle. LLMs handle edge cases better.
65
+
66
+ ---
67
+
68
+ ### 5. Gates and Skip-Gates
69
+
70
+ **Rule:** Complete via `pnpm wu:done`; skip-gates only for pre-existing failures with `--reason` and `--fix-wu`.
71
+
72
+ **Enforcement:**
73
+
74
+ - `pnpm wu:done` runs gates before merge
75
+ - `--skip-gates` requires both `--reason` and `--fix-wu`
76
+ - Skip events logged to `.lumenflow/skip-gates-audit.log`
77
+
78
+ **Why:** Gates ensure quality. Skipping requires accountability and a fix plan.
79
+
80
+ ---
81
+
82
+ ### 6. Safety and Governance
83
+
84
+ **Rule:** Respect privacy rules, approved sources, security policies; when uncertain, choose safer path.
85
+
86
+ **Enforcement:**
87
+
88
+ - No hardcoded secrets (gitleaks scanning)
89
+ - RLS policies on sensitive data
90
+ - Redaction before sending to LLMs
91
+ - Stop-and-ask for auth/PII/spend changes
92
+
93
+ **Why:** Safety first. Some mistakes are irreversible.
94
+
95
+ ---
96
+
97
+ ## Mini Audit Checklist
98
+
99
+ Before running `wu:done`, verify:
100
+
101
+ - [ ] Working in worktree (not main)
102
+ - [ ] Only modified files in `code_paths`
103
+ - [ ] Gates pass (`pnpm gates` or `pnpm gates --docs-only`)
104
+ - [ ] No forbidden git commands used
105
+ - [ ] No secrets committed
106
+ - [ ] Acceptance criteria satisfied
107
+
108
+ ---
109
+
110
+ ## Quick Reference: Forbidden Commands
111
+
112
+ These commands are blocked on main checkout:
113
+
114
+ ```bash
115
+ # Data destruction
116
+ git reset --hard
117
+ git clean -fd
118
+
119
+ # Hidden work
120
+ git stash
121
+
122
+ # History rewrite
123
+ git push --force
124
+ git push -f
125
+ git rebase -i main
126
+
127
+ # Bypass safety
128
+ --no-verify
129
+ HUSKY=0
130
+
131
+ # Worktree manipulation (agents must not delete worktrees)
132
+ git worktree remove
133
+ git worktree prune
134
+ ```
135
+
136
+ **Allowed in worktrees:** Most commands are safe in isolated worktrees on lane branches.
137
+
138
+ ---
139
+
140
+ ## Agent LUMENFLOW_FORCE Usage Policy (WU-1070)
141
+
142
+ **Rule:** AI agents MUST NOT use LUMENFLOW_FORCE without explicit user approval.
143
+
144
+ **Rationale:** LUMENFLOW_FORCE bypasses all git hook protections (pre-commit, pre-push, commit-msg). While legitimate for emergency human interventions, agents using it autonomously undermines the entire workflow enforcement model.
145
+
146
+ **Enforcement:**
147
+
148
+ - All LUMENFLOW_FORCE usage is logged to `.beacon/force-bypasses.log` (git-tracked)
149
+ - Log format: `ISO_TIMESTAMP | HOOK_NAME | USER | BRANCH | REASON | CWD`
150
+ - Missing `LUMENFLOW_FORCE_REASON` triggers stderr warning
151
+
152
+ **Agent Escalation Path:**
153
+
154
+ 1. **Detect need:** Agent encounters hook blocking operation
155
+ 2. **Stop and ask:** Present situation to user with context
156
+ 3. **Get approval:** User must explicitly approve bypass with reason
157
+ 4. **Execute with audit:** Use `LUMENFLOW_FORCE_REASON="user-approved: <reason>" LUMENFLOW_FORCE=1`
158
+ 5. **Document:** Note the bypass in commit message or WU notes
159
+
160
+ **Legitimate bypass scenarios:**
161
+
162
+ - Fixing YAML parsing bugs in WU specs (spec infrastructure issue)
163
+ - Emergency production hotfixes (with user present)
164
+ - Recovering from corrupted workflow state
165
+ - Bootstrap operations when CLI not yet built
166
+
167
+ **Never bypass for:**
168
+
169
+ - Skipping failing tests
170
+ - Avoiding code review
171
+ - Working around gate failures
172
+ - Convenience or speed
173
+
174
+ ---
175
+
176
+ ## Context Limits
177
+
178
+ **When approaching context limits, spawn a fresh agent instead of continuing after compaction.**
179
+
180
+ Context compaction causes agents to lose critical rules. See [wu-sizing-guide.md](../docs/04-operations/_frameworks/lumenflow/wu-sizing-guide.md) for mandatory thresholds and the spawn-fresh protocol.
181
+
182
+ ---
183
+
184
+ ## Escalation Triggers
185
+
186
+ Stop and ask a human when:
187
+
188
+ - Same error repeats 3 times
189
+ - Auth or permissions changes required
190
+ - PII/PHI/safety issues discovered
191
+ - Cloud spend or secrets involved
192
+ - Policy changes needed
@@ -0,0 +1,27 @@
1
+ # Git Safety Rules
2
+
3
+ **Last updated:** {{DATE}}
4
+
5
+ ## Forbidden Commands on Main
6
+
7
+ ```bash
8
+ git reset --hard
9
+ git clean -fd
10
+ git stash
11
+ git push --force
12
+ --no-verify
13
+ ```
14
+
15
+ ## Safe Commands
16
+
17
+ ```bash
18
+ git status
19
+ git log
20
+ git diff
21
+ git add .
22
+ git commit -m "message"
23
+ ```
24
+
25
+ ## Merge Strategy
26
+
27
+ Use `pnpm wu:done` for all merges. Never merge manually.
@@ -0,0 +1,48 @@
1
+ # WU Workflow Rules
2
+
3
+ **Last updated:** {{DATE}}
4
+
5
+ ## WU Lifecycle
6
+
7
+ ```
8
+ ready -> in_progress -> done
9
+ |
10
+ v
11
+ blocked -> in_progress (unblocked)
12
+ ```
13
+
14
+ ## Claiming a WU
15
+
16
+ ```bash
17
+ # 1. Check lane is free
18
+ cat docs/04-operations/tasks/status.md
19
+
20
+ # 2. Claim the WU (creates worktree)
21
+ pnpm wu:claim --id WU-XXX --lane <Lane>
22
+
23
+ # 3. IMMEDIATELY cd to worktree
24
+ cd worktrees/<lane>-wu-xxx
25
+ ```
26
+
27
+ ## Completing a WU
28
+
29
+ **CRITICAL: ALWAYS run wu:done to complete a WU.**
30
+
31
+ ```bash
32
+ # 1. Ensure gates pass in worktree
33
+ pnpm gates
34
+
35
+ # 2. Return to main checkout
36
+ cd {{PROJECT_ROOT}}
37
+
38
+ # 3. Complete the WU
39
+ pnpm wu:done --id WU-XXX
40
+ ```
41
+
42
+ ## Definition of Done
43
+
44
+ - [ ] Acceptance criteria satisfied
45
+ - [ ] Gates pass
46
+ - [ ] WU YAML status = `done`
47
+ - [ ] `.beacon/stamps/WU-<id>.done` exists
48
+ - [ ] `pnpm wu:done` has been run
@@ -0,0 +1,60 @@
1
+ # Universal Agent Instructions
2
+
3
+ **Last updated:** {{DATE}}
4
+
5
+ This project uses LumenFlow workflow. For complete documentation, see [LUMENFLOW.md](LUMENFLOW.md).
6
+
7
+ ---
8
+
9
+ ## Quick Start
10
+
11
+ ```bash
12
+ # 1. Claim a WU
13
+ pnpm wu:claim --id WU-XXXX --lane <Lane>
14
+ cd worktrees/<lane>-wu-xxxx
15
+
16
+ # 2. Work in worktree, run gates
17
+ pnpm gates
18
+
19
+ # 3. Complete (ALWAYS run this!)
20
+ cd {{PROJECT_ROOT}}
21
+ pnpm wu:done --id WU-XXXX
22
+ ```
23
+
24
+ > **Complete CLI reference:** See [quick-ref-commands.md](ai/onboarding/quick-ref-commands.md)
25
+
26
+ ---
27
+
28
+ ## Critical: Always wu:done
29
+
30
+ After completing work, ALWAYS run `pnpm wu:done --id WU-XXXX` from the main checkout.
31
+
32
+ This is the single most forgotten step. See [LUMENFLOW.md](LUMENFLOW.md) for details.
33
+
34
+ ---
35
+
36
+ ## Core Principles
37
+
38
+ 1. **TDD**: Write tests first, then implementation
39
+ 2. **Worktree Discipline**: After `wu:claim`, work ONLY in the worktree
40
+ 3. **Gates Before Done**: Run `pnpm gates` before `wu:done`
41
+ 4. **Never Bypass Hooks**: No `--no-verify`
42
+
43
+ ---
44
+
45
+ ## Forbidden Commands
46
+
47
+ - `git reset --hard`
48
+ - `git push --force`
49
+ - `git stash` (on main)
50
+ - `--no-verify`
51
+
52
+ ---
53
+
54
+ ## Vendor-Specific Overlays
55
+
56
+ This file provides universal guidance for all AI agents. Additional vendor-specific configuration:
57
+
58
+ - **Claude Code**: See `CLAUDE.md` (if present)
59
+ - **Cursor**: See `.cursor/rules/lumenflow.md` (if present)
60
+ - **Windsurf**: See `.windsurf/rules/lumenflow.md` (if present)