@lumenflow/cli 2.9.0 → 2.10.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.
- package/README.md +1 -1
- package/dist/hooks/enforcement-generator.js +256 -5
- package/dist/hooks/enforcement-sync.js +52 -6
- package/dist/init.js +51 -2
- package/dist/mem-recover.js +221 -0
- package/package.json +6 -6
- package/templates/core/LUMENFLOW.md.template +24 -0
- package/templates/core/ai/onboarding/first-wu-mistakes.md.template +47 -0
- package/templates/core/ai/onboarding/lumenflow-force-usage.md.template +183 -0
- package/templates/core/ai/onboarding/quick-ref-commands.md.template +68 -55
- package/templates/core/ai/onboarding/release-process.md.template +58 -4
- package/templates/core/ai/onboarding/starting-prompt.md.template +67 -3
- package/templates/vendors/claude/.claude/hooks/pre-compact-checkpoint.sh +102 -0
- package/templates/vendors/claude/.claude/hooks/session-start-recovery.sh +74 -0
- package/templates/vendors/claude/.claude/settings.json.template +42 -0
- package/templates/vendors/claude/.claude/skills/context-management/SKILL.md.template +23 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumenflow/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Command-line interface for LumenFlow workflow framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lumenflow",
|
|
@@ -151,11 +151,11 @@
|
|
|
151
151
|
"pretty-ms": "^9.2.0",
|
|
152
152
|
"simple-git": "^3.30.0",
|
|
153
153
|
"yaml": "^2.8.2",
|
|
154
|
-
"@lumenflow/core": "2.
|
|
155
|
-
"@lumenflow/metrics": "2.
|
|
156
|
-
"@lumenflow/
|
|
157
|
-
"@lumenflow/agent": "2.
|
|
158
|
-
"@lumenflow/
|
|
154
|
+
"@lumenflow/core": "2.10.0",
|
|
155
|
+
"@lumenflow/metrics": "2.10.0",
|
|
156
|
+
"@lumenflow/initiatives": "2.10.0",
|
|
157
|
+
"@lumenflow/agent": "2.10.0",
|
|
158
|
+
"@lumenflow/memory": "2.10.0"
|
|
159
159
|
},
|
|
160
160
|
"devDependencies": {
|
|
161
161
|
"@vitest/coverage-v8": "^4.0.17",
|
|
@@ -53,6 +53,30 @@ cd /path/to/main && pnpm wu:done --id WU-XXXX
|
|
|
53
53
|
|
|
54
54
|
---
|
|
55
55
|
|
|
56
|
+
## When to Use Initiatives
|
|
57
|
+
|
|
58
|
+
Use **Initiatives** for multi-phase work spanning multiple WUs:
|
|
59
|
+
|
|
60
|
+
- **Product visions**: "Build a task management app"
|
|
61
|
+
- **Larger features**: Work requiring multiple WUs across lanes
|
|
62
|
+
- **Complex projects**: Anything that needs phased delivery
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Create an initiative for multi-phase work
|
|
66
|
+
pnpm initiative:create --id INIT-001 --title "Feature Name" \
|
|
67
|
+
--description "..." --phase "Phase 1: MVP" --phase "Phase 2: Polish"
|
|
68
|
+
|
|
69
|
+
# Add WUs to the initiative
|
|
70
|
+
pnpm initiative:add-wu --initiative INIT-001 --wu WU-XXX --phase 1
|
|
71
|
+
|
|
72
|
+
# Track progress
|
|
73
|
+
pnpm initiative:status --id INIT-001
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Skip initiatives** for: single-file bug fixes, small docs updates, isolated refactoring.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
56
80
|
## Setup Notes (Common First-Run Failures)
|
|
57
81
|
|
|
58
82
|
### Lane inference (sub-lanes)
|
|
@@ -224,6 +224,53 @@ pnpm prettier --write <files> # Safe in worktree
|
|
|
224
224
|
|
|
225
225
|
---
|
|
226
226
|
|
|
227
|
+
## Mistake 12: Not Acting on Implied Directives
|
|
228
|
+
|
|
229
|
+
### Wrong
|
|
230
|
+
|
|
231
|
+
```text
|
|
232
|
+
Agent: [presents research findings about a bug]
|
|
233
|
+
User: "so update 1348 then?"
|
|
234
|
+
Agent: [no response or asks "should I update it?"]
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Right
|
|
238
|
+
|
|
239
|
+
```text
|
|
240
|
+
Agent: [presents research findings about a bug]
|
|
241
|
+
User: "so update 1348 then?"
|
|
242
|
+
Agent: Updating WU-1348 with these findings now.
|
|
243
|
+
[Edits the WU YAML file]
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### How to Update a WU
|
|
247
|
+
|
|
248
|
+
**Option 1: CLI command**
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
pnpm wu:edit --id WU-1348 --notes "Research findings: ..."
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Option 2: Direct file edit**
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# Edit docs/04-operations/tasks/wu/WU-1348.yaml directly
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Recognizing Implied Directives
|
|
261
|
+
|
|
262
|
+
Phrases that mean "do this now":
|
|
263
|
+
|
|
264
|
+
- "so do X then?" / "so X then?"
|
|
265
|
+
- "update that" / "add that"
|
|
266
|
+
- "fix it" / "make that change"
|
|
267
|
+
- "go ahead" / "proceed"
|
|
268
|
+
- "sounds good, do it"
|
|
269
|
+
|
|
270
|
+
**Rule:** Information + user confirmation = immediate action. Don't ask "should I proceed?" when user already implied yes.
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
227
274
|
## Quick Checklist
|
|
228
275
|
|
|
229
276
|
Before starting any WU:
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# LUMENFLOW_FORCE Usage Investigation
|
|
2
|
+
|
|
3
|
+
**Last updated:** {{DATE}}
|
|
4
|
+
|
|
5
|
+
This document presents the findings from WU-1220, investigating improper LUMENFLOW_FORCE usage in agent sessions and providing prevention recommendations.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Executive Summary
|
|
10
|
+
|
|
11
|
+
Analysis of `.beacon/force-bypasses.log` reveals that LUMENFLOW_FORCE is used extensively, but almost exclusively by human operators (user "Tom") rather than AI agents. The vast majority of uses are for legitimate infrastructure operations such as:
|
|
12
|
+
|
|
13
|
+
- Release version pushes
|
|
14
|
+
- Micro-worktree recovery operations
|
|
15
|
+
- State synchronization
|
|
16
|
+
- Emergency fixes
|
|
17
|
+
|
|
18
|
+
**Key Finding:** AI agents are NOT the primary concern. The existing safeguards (documentation, audit logging) are working as designed. The force bypass mechanism serves its intended purpose: enabling humans to perform legitimate administrative operations while maintaining an audit trail.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Root Cause Analysis
|
|
23
|
+
|
|
24
|
+
### Observations from Audit Log
|
|
25
|
+
|
|
26
|
+
Analysis of 347 logged bypass events shows:
|
|
27
|
+
|
|
28
|
+
| Category | Count | Description |
|
|
29
|
+
| --------------------- | ----- | ----------------------------------------------- |
|
|
30
|
+
| Release operations | ~45 | Pushing version tags, npm releases |
|
|
31
|
+
| Infrastructure repair | ~100 | wu:claim auto-repair, micro-worktree recovery |
|
|
32
|
+
| State sync | ~80 | Syncing repair commits, pushing orphan repairs |
|
|
33
|
+
| Emergency fixes | ~30 | P0 fixes, backlog corruption recovery |
|
|
34
|
+
| No reason provided | ~90 | Human operations without LUMENFLOW_FORCE_REASON |
|
|
35
|
+
|
|
36
|
+
### Log Entry Patterns
|
|
37
|
+
|
|
38
|
+
**Legitimate human operations:**
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
{{DATE}}T14:08:55.172Z | pre-push | Tom | main | release v1.6.0 | {{PROJECT_ROOT}}
|
|
42
|
+
{{DATE}}T10:41:23.185Z | pre-push | Tom | main | Recovery: wu:done partially completed, merging remaining changes
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Missing reason (human oversight, not agent misuse):**
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
{{DATE}}T11:52:15.459Z | pre-commit | Tom | main | (no reason provided)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Why Agents Are Not The Problem
|
|
52
|
+
|
|
53
|
+
1. **Agents follow documented rules:** The constraints.md and agent-safety-card.md clearly state that agents MUST NOT use LUMENFLOW_FORCE without explicit user approval.
|
|
54
|
+
|
|
55
|
+
2. **Hooks block direct commits:** The pre-commit hook blocks WU commits from main, forcing agents through the proper worktree workflow.
|
|
56
|
+
|
|
57
|
+
3. **Most bypasses are push operations:** The audit log shows ~70% of bypasses are `pre-push` hooks, which are typically administrative operations (releases, repairs) performed by humans.
|
|
58
|
+
|
|
59
|
+
4. **No evidence of agent abuse:** None of the logged entries indicate an AI agent autonomously using LUMENFLOW_FORCE to skip tests or avoid gates.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Current Safeguards
|
|
64
|
+
|
|
65
|
+
### Documentation Safeguards
|
|
66
|
+
|
|
67
|
+
1. **constraints.md** (Section 7): "AI agents MUST NOT use LUMENFLOW_FORCE without explicit user approval"
|
|
68
|
+
|
|
69
|
+
2. **agent-safety-card.md**: Complete section on "Emergency Override (LUMENFLOW_FORCE)" with:
|
|
70
|
+
- When emergency override is appropriate
|
|
71
|
+
- When NOT to use emergency override
|
|
72
|
+
- Step-by-step escalation process
|
|
73
|
+
- Audit trail requirements
|
|
74
|
+
|
|
75
|
+
3. **starting-prompt.md** (Rule 5): Explicit guidance on LUMENFLOW_FORCE usage
|
|
76
|
+
|
|
77
|
+
### Technical Safeguards
|
|
78
|
+
|
|
79
|
+
1. **Audit logging:** All bypasses logged to `.beacon/force-bypasses.log` with timestamp, hook, user, branch, reason, and working directory.
|
|
80
|
+
|
|
81
|
+
2. **Warning when no reason:** If LUMENFLOW_FORCE_REASON is not provided, a warning is printed.
|
|
82
|
+
|
|
83
|
+
3. **Git-tracked audit log:** The `.beacon/force-bypasses.log` file is version controlled, providing historical accountability.
|
|
84
|
+
|
|
85
|
+
4. **Hook enforcement:** Pre-commit, commit-msg, pre-push, and prepare-commit-msg hooks all check for LUMENFLOW_FORCE before allowing bypass.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Investigation Conclusion
|
|
90
|
+
|
|
91
|
+
**The original concern ("agent used LUMENFLOW_FORCE to commit directly to main instead of using proper worktree workflow") appears to be unfounded based on audit log analysis.**
|
|
92
|
+
|
|
93
|
+
The audit log shows:
|
|
94
|
+
|
|
95
|
+
- All 347 bypass events were attributed to "Tom" (human operator)
|
|
96
|
+
- No entries indicate AI agent autonomous bypass
|
|
97
|
+
- Legitimate use cases: releases, repairs, emergency fixes, state sync
|
|
98
|
+
|
|
99
|
+
If an agent did use LUMENFLOW_FORCE improperly, it would have been:
|
|
100
|
+
|
|
101
|
+
1. Logged with the agent's session context
|
|
102
|
+
2. Visible as a pattern of non-administrative bypasses
|
|
103
|
+
3. Associated with test skipping or gate avoidance
|
|
104
|
+
|
|
105
|
+
None of these patterns appear in the audit log.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Prevention Recommendations
|
|
110
|
+
|
|
111
|
+
Despite the finding that this is not currently a problem, the following recommendations strengthen the existing safeguards:
|
|
112
|
+
|
|
113
|
+
### 1. Enhanced Audit Log Format (Low Effort)
|
|
114
|
+
|
|
115
|
+
Add agent/session identification to bypass log entries:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
# Current format:
|
|
119
|
+
TIMESTAMP | HOOK | USER | BRANCH | REASON | CWD
|
|
120
|
+
|
|
121
|
+
# Enhanced format:
|
|
122
|
+
TIMESTAMP | HOOK | USER | BRANCH | REASON | CWD | SESSION_TYPE | SESSION_ID
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Where `SESSION_TYPE` could be: `human`, `claude-code`, `cursor`, `windsurf`, `unknown`
|
|
126
|
+
|
|
127
|
+
### 2. Periodic Audit Review (Process)
|
|
128
|
+
|
|
129
|
+
Establish a monthly review of `.beacon/force-bypasses.log` to identify:
|
|
130
|
+
|
|
131
|
+
- High volume of "no reason provided" entries
|
|
132
|
+
- Unexpected patterns in bypass usage
|
|
133
|
+
- Any entries that don't match expected administrative operations
|
|
134
|
+
|
|
135
|
+
### 3. Agent Context Marker (Technical)
|
|
136
|
+
|
|
137
|
+
When an agent uses LUMENFLOW_FORCE with approval, require the reason to include an agent marker:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Require format for agent-initiated bypasses
|
|
141
|
+
LUMENFLOW_FORCE_REASON="agent-approved: <reason>" LUMENFLOW_FORCE=1 git ...
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
This allows filtering agent bypasses from human bypasses in audit analysis.
|
|
145
|
+
|
|
146
|
+
### 4. Real-Time Alert (Optional, Higher Effort)
|
|
147
|
+
|
|
148
|
+
Add optional webhook/notification when LUMENFLOW_FORCE is used without a reason containing "release", "repair", "recovery", or "sync":
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
# .lumenflow.config.yaml
|
|
152
|
+
force_bypass:
|
|
153
|
+
alert_webhook: https://...
|
|
154
|
+
exempt_patterns:
|
|
155
|
+
- release
|
|
156
|
+
- repair
|
|
157
|
+
- recovery
|
|
158
|
+
- sync
|
|
159
|
+
- tag
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Summary
|
|
165
|
+
|
|
166
|
+
| Finding | Status |
|
|
167
|
+
| ---------------------------------- | ------------------------------ |
|
|
168
|
+
| AI agents misusing LUMENFLOW_FORCE | **Not observed** |
|
|
169
|
+
| Human administrative use | Working as designed |
|
|
170
|
+
| Audit trail completeness | Good, but ~26% missing reasons |
|
|
171
|
+
| Documentation coverage | Comprehensive |
|
|
172
|
+
| Technical enforcement | Effective |
|
|
173
|
+
|
|
174
|
+
**Conclusion:** The existing LUMENFLOW_FORCE mechanism and its safeguards are functioning correctly. The concern that prompted this investigation was not validated by audit log evidence. The recommendations above are incremental improvements, not urgent fixes.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Related Documents
|
|
179
|
+
|
|
180
|
+
- [.lumenflow/constraints.md](../../../../../../.lumenflow/constraints.md) - Section 7: Agent LUMENFLOW_FORCE Usage Policy
|
|
181
|
+
- [agent-safety-card.md](agent-safety-card.md) - Emergency Override section
|
|
182
|
+
- [starting-prompt.md](starting-prompt.md) - Rule 5: Know When to Use LUMENFLOW_FORCE
|
|
183
|
+
- [WU-1070](../../../../tasks/wu/WU-1070.yaml) - Original WU for LUMENFLOW_FORCE policy
|
|
@@ -4,32 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
Complete reference for all CLI commands. Organized by category for quick discovery.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
cd worktrees/<lane>-wu-xxx
|
|
17
|
-
|
|
18
|
-
# 2. Work in worktree, then run gates
|
|
19
|
-
pnpm gates # For code changes
|
|
20
|
-
pnpm gates --docs-only # For documentation only
|
|
21
|
-
|
|
22
|
-
# 3. Prepare for completion (from worktree)
|
|
23
|
-
pnpm wu:prep --id WU-XXX
|
|
24
|
-
|
|
25
|
-
# 4. Complete (from main - copy command from wu:prep output)
|
|
26
|
-
cd /path/to/main && pnpm wu:done --id WU-XXX
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
**Key rules:**
|
|
30
|
-
- Always work in worktrees, never on main
|
|
31
|
-
- Always run `wu:done` to complete (not just documenting it)
|
|
32
|
-
- Use `wu:prep` first (runs gates), then `wu:done` (merges)
|
|
7
|
+
> **Tip (WU-1358):** For complete option lists, always run `<package_manager> <command> --help`.
|
|
8
|
+
> This shows all available flags including inline options that may not appear in generated docs.
|
|
9
|
+
>
|
|
10
|
+
> ```bash
|
|
11
|
+
> # Examples
|
|
12
|
+
> pnpm wu:edit --help # See all wu:edit options
|
|
13
|
+
> npm run wu:claim -- --help
|
|
14
|
+
> yarn wu:create --help
|
|
15
|
+
> ```
|
|
33
16
|
|
|
34
17
|
---
|
|
35
18
|
|
|
@@ -37,19 +20,21 @@ cd /path/to/main && pnpm wu:done --id WU-XXX
|
|
|
37
20
|
|
|
38
21
|
**For this monorepo (development):**
|
|
39
22
|
|
|
40
|
-
| Command
|
|
41
|
-
|
|
|
42
|
-
| `pnpm setup`
|
|
43
|
-
| `pnpm build`
|
|
44
|
-
| `pnpm build:dist`
|
|
45
|
-
| `pnpm dev`
|
|
46
|
-
| `pnpm clean`
|
|
47
|
-
| `pnpm pack:all`
|
|
48
|
-
| `pnpm lumenflow:init`
|
|
49
|
-
| `pnpm docs:sync`
|
|
50
|
-
| `pnpm sync:templates`
|
|
51
|
-
| `pnpm lumenflow:upgrade`
|
|
52
|
-
| `pnpm lumenflow:doctor`
|
|
23
|
+
| Command | Description |
|
|
24
|
+
| -------------------------- | --------------------------------------- |
|
|
25
|
+
| `pnpm setup` | Install deps and build CLI (first time) |
|
|
26
|
+
| `pnpm build` | Build all packages |
|
|
27
|
+
| `pnpm build:dist` | Build distribution packages |
|
|
28
|
+
| `pnpm dev` | Start development mode |
|
|
29
|
+
| `pnpm clean` | Clean build artifacts and caches |
|
|
30
|
+
| `pnpm pack:all` | Pack all packages for distribution |
|
|
31
|
+
| `pnpm lumenflow:init` | Scaffold LumenFlow in a project |
|
|
32
|
+
| `pnpm docs:sync` | Sync agent docs (for upgrades) |
|
|
33
|
+
| `pnpm sync:templates` | Sync templates to project |
|
|
34
|
+
| `pnpm lumenflow:upgrade` | Upgrade LumenFlow packages |
|
|
35
|
+
| `pnpm lumenflow:doctor` | Diagnose LumenFlow configuration |
|
|
36
|
+
| `pnpm lumenflow:integrate` | Generate enforcement hooks for client |
|
|
37
|
+
| `pnpm lumenflow commands` | List all available CLI commands |
|
|
53
38
|
|
|
54
39
|
**For external projects (end users):**
|
|
55
40
|
|
|
@@ -120,22 +105,23 @@ pnpm exec lumenflow --client all # All clients
|
|
|
120
105
|
|
|
121
106
|
## Memory & Sessions
|
|
122
107
|
|
|
123
|
-
| Command | Description
|
|
124
|
-
| ----------------------------------- |
|
|
125
|
-
| `pnpm mem:init --wu WU-XXX` | Initialize memory for WU
|
|
126
|
-
| `pnpm mem:start --wu WU-XXX` | Start a memory session
|
|
127
|
-
| `pnpm mem:checkpoint --wu WU-XXX` | Save progress checkpoint
|
|
128
|
-
| `pnpm mem:
|
|
129
|
-
| `pnpm mem:
|
|
130
|
-
| `pnpm mem:
|
|
131
|
-
| `pnpm mem:
|
|
132
|
-
| `pnpm mem:
|
|
133
|
-
| `pnpm mem:
|
|
134
|
-
| `pnpm mem:
|
|
135
|
-
| `pnpm mem:
|
|
136
|
-
| `pnpm mem:context
|
|
137
|
-
| `pnpm mem:
|
|
138
|
-
| `pnpm mem:
|
|
108
|
+
| Command | Description |
|
|
109
|
+
| ----------------------------------- | ----------------------------------- |
|
|
110
|
+
| `pnpm mem:init --wu WU-XXX` | Initialize memory for WU |
|
|
111
|
+
| `pnpm mem:start --wu WU-XXX` | Start a memory session |
|
|
112
|
+
| `pnpm mem:checkpoint --wu WU-XXX` | Save progress checkpoint |
|
|
113
|
+
| `pnpm mem:recover --wu WU-XXX` | Generate recovery context (WU-1390) |
|
|
114
|
+
| `pnpm mem:ready --wu WU-XXX` | Check pending nodes |
|
|
115
|
+
| `pnpm mem:export --wu WU-XXX` | Export memory as markdown |
|
|
116
|
+
| `pnpm mem:create "msg" --wu WU-XXX` | Create memory node (bug discovery) |
|
|
117
|
+
| `pnpm mem:signal "msg" --wu WU-XXX` | Broadcast coordination signal |
|
|
118
|
+
| `pnpm mem:inbox --wu WU-XXX` | Check coordination signals |
|
|
119
|
+
| `pnpm mem:summarize --wu WU-XXX` | Summarize memory context |
|
|
120
|
+
| `pnpm mem:triage --wu WU-XXX` | Triage discovered bugs |
|
|
121
|
+
| `pnpm mem:context --wu WU-XXX` | Get context for current lane/WU |
|
|
122
|
+
| `pnpm mem:context ... --lane <L>` | Filter context by lane (WU-1292) |
|
|
123
|
+
| `pnpm mem:delete --id <node-id>` | Delete/archive a memory node |
|
|
124
|
+
| `pnpm mem:cleanup` | Clean up stale memory data |
|
|
139
125
|
|
|
140
126
|
---
|
|
141
127
|
|
|
@@ -444,3 +430,30 @@ pnpm mem:inbox --since 30m # Check for signals (NOT TaskOutput)
|
|
|
444
430
|
# Capture bug, don't fix out-of-scope
|
|
445
431
|
pnpm mem:create 'Bug: description' --type discovery --tags bug --wu WU-XXX
|
|
446
432
|
```
|
|
433
|
+
|
|
434
|
+
### Enforcement Hooks (WU-1367)
|
|
435
|
+
|
|
436
|
+
Configure hooks that enforce workflow compliance for Claude Code:
|
|
437
|
+
|
|
438
|
+
```yaml
|
|
439
|
+
# In .lumenflow.config.yaml
|
|
440
|
+
agents:
|
|
441
|
+
clients:
|
|
442
|
+
claude-code:
|
|
443
|
+
enforcement:
|
|
444
|
+
hooks: true
|
|
445
|
+
block_outside_worktree: true
|
|
446
|
+
require_wu_for_edits: true
|
|
447
|
+
warn_on_stop_without_wu_done: true
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
```bash
|
|
451
|
+
# Generate hooks after configuration
|
|
452
|
+
pnpm lumenflow:integrate --client claude-code
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
Hooks provide automatic enforcement at the tool level:
|
|
456
|
+
|
|
457
|
+
- **block_outside_worktree**: Blocks Write/Edit to main when worktrees exist
|
|
458
|
+
- **require_wu_for_edits**: Requires a claimed WU for Write/Edit operations
|
|
459
|
+
- **warn_on_stop_without_wu_done**: Warns when session ends with active worktrees
|
|
@@ -30,10 +30,11 @@ pnpm release --release-version 1.3.0
|
|
|
30
30
|
|
|
31
31
|
1. Validates semver version format
|
|
32
32
|
2. Ensures clean working directory on main branch
|
|
33
|
-
3.
|
|
34
|
-
4.
|
|
35
|
-
5.
|
|
36
|
-
6.
|
|
33
|
+
3. Syncs templates with source docs (`pnpm sync:templates`)
|
|
34
|
+
4. Bumps all `@lumenflow/*` package versions using micro-worktree isolation
|
|
35
|
+
5. Builds all packages
|
|
36
|
+
6. Creates and pushes git tag `vX.Y.Z`
|
|
37
|
+
7. Publishes to npm
|
|
37
38
|
|
|
38
39
|
### Options
|
|
39
40
|
|
|
@@ -73,6 +74,58 @@ Get a token at: https://www.npmjs.com/settings/tokens
|
|
|
73
74
|
|
|
74
75
|
---
|
|
75
76
|
|
|
77
|
+
## Template Synchronization (WU-1353)
|
|
78
|
+
|
|
79
|
+
CLI templates (`packages/@lumenflow/cli/templates/`) are synced from source docs to ensure new projects get up-to-date onboarding content.
|
|
80
|
+
|
|
81
|
+
### Sync Templates
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Sync source docs to CLI templates
|
|
85
|
+
pnpm sync:templates
|
|
86
|
+
|
|
87
|
+
# Preview without writing files
|
|
88
|
+
pnpm sync:templates --dry-run
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Check for Drift (CI)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Check if templates are out of sync with source
|
|
95
|
+
pnpm sync:templates --check-drift
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The `--check-drift` flag compares templates with their source files. If drift is detected:
|
|
99
|
+
|
|
100
|
+
- Exit code 1 (fails CI)
|
|
101
|
+
- Lists drifting files
|
|
102
|
+
- Suggests running `pnpm sync:templates`
|
|
103
|
+
|
|
104
|
+
### What Gets Synced
|
|
105
|
+
|
|
106
|
+
| Source | Template |
|
|
107
|
+
| -------------------------------- | ------------------------------------------------------------- |
|
|
108
|
+
| `.lumenflow/constraints.md` | `templates/core/.lumenflow/constraints.md.template` |
|
|
109
|
+
| `LUMENFLOW.md` | `templates/core/LUMENFLOW.md.template` |
|
|
110
|
+
| `docs/.../agent/onboarding/*.md` | `templates/core/ai/onboarding/*.md.template` |
|
|
111
|
+
| `.claude/skills/*/SKILL.md` | `templates/vendors/claude/.claude/skills/*/SKILL.md.template` |
|
|
112
|
+
|
|
113
|
+
### Template Variables
|
|
114
|
+
|
|
115
|
+
During sync, content is transformed:
|
|
116
|
+
|
|
117
|
+
- `YYYY-MM-DD` dates become `{{DATE}}`
|
|
118
|
+
- Absolute paths become `{{PROJECT_ROOT}}` (when applicable)
|
|
119
|
+
|
|
120
|
+
### When to Sync
|
|
121
|
+
|
|
122
|
+
- Before every release (included in release checklist)
|
|
123
|
+
- After updating source onboarding docs
|
|
124
|
+
- After modifying constraints or workflow rules
|
|
125
|
+
- CI drift check runs on every push to main
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
76
129
|
## Version Bumping (Manual)
|
|
77
130
|
|
|
78
131
|
If you need to bump versions manually without the release command:
|
|
@@ -241,6 +294,7 @@ The `apps/github-app/package.json` must have `"private": true` to prevent npm pu
|
|
|
241
294
|
- [ ] All acceptance criteria met
|
|
242
295
|
- [ ] Gates pass (`pnpm gates`)
|
|
243
296
|
- [ ] Pre-release checks pass (`pnpm pre-release:check`)
|
|
297
|
+
- [ ] Templates synced (`pnpm sync:templates` - ensures CLI templates match source docs)
|
|
244
298
|
- [ ] CHANGELOG updated (if maintained)
|
|
245
299
|
|
|
246
300
|
### Release Steps (Automated)
|
|
@@ -6,11 +6,56 @@ This is the complete onboarding document for AI agents working with LumenFlow. R
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## When Starting From Product Vision
|
|
10
|
+
|
|
11
|
+
If you are starting a new project or feature from a product vision (e.g., "Build a task management app"), **do NOT create standalone WUs immediately**. Instead, follow the initiative-first workflow:
|
|
12
|
+
|
|
13
|
+
### 4-Step Initiative Workflow
|
|
14
|
+
|
|
15
|
+
1. **Create an Initiative**: Capture the vision as an initiative
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm initiative:create --id INIT-001 --title "Task Management App" \
|
|
19
|
+
--description "Build a task management application with..." \
|
|
20
|
+
--phase "Phase 1: Core MVP" --phase "Phase 2: Collaboration"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. **Define Phases**: Break the vision into logical phases (MVP, iteration, polish)
|
|
24
|
+
|
|
25
|
+
3. **Create WUs under the Initiative**: Each WU belongs to a phase
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm wu:create --lane "Core: Platform" --title "Add task model" \
|
|
29
|
+
--description "..." --acceptance "..." --code-paths "..." \
|
|
30
|
+
&& pnpm initiative:add-wu --initiative INIT-001 --wu WU-XXX --phase 1
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
4. **Track Progress**: Use `pnpm initiative:status --id INIT-001` to see overall progress
|
|
34
|
+
|
|
35
|
+
### Why Initiatives Matter
|
|
36
|
+
|
|
37
|
+
- **Avoid orphan WUs**: Without initiative structure, agents create disconnected WUs that lack coherent scope
|
|
38
|
+
- **Better coordination**: Phases enable parallel work across lanes
|
|
39
|
+
- **Clear completion criteria**: The initiative tracks when all phases are done
|
|
40
|
+
- **Visibility**: Stakeholders can see multi-phase progress
|
|
41
|
+
|
|
42
|
+
### When to Skip Initiatives
|
|
43
|
+
|
|
44
|
+
Only skip initiatives for:
|
|
45
|
+
|
|
46
|
+
- Single-file bug fixes
|
|
47
|
+
- Small documentation updates
|
|
48
|
+
- Isolated refactoring tasks
|
|
49
|
+
|
|
50
|
+
If work spans multiple WUs or multiple days, create an initiative first.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
9
54
|
## Quick Start (Copy This)
|
|
10
55
|
|
|
11
56
|
```bash
|
|
12
57
|
# 1. Check your assigned WU
|
|
13
|
-
cat
|
|
58
|
+
cat docs/04-operations/tasks/wu/WU-XXXX.yaml
|
|
14
59
|
|
|
15
60
|
# 2. Claim the WU (creates isolated worktree)
|
|
16
61
|
pnpm wu:claim --id WU-XXXX --lane "Lane Name"
|
|
@@ -160,7 +205,7 @@ git add . && git commit -m "your message"
|
|
|
160
205
|
**Fix:** Regenerate the backlog or manually add the missing WU:
|
|
161
206
|
|
|
162
207
|
```bash
|
|
163
|
-
# In worktree, edit
|
|
208
|
+
# In worktree, edit docs/04-operations/tasks/backlog.md
|
|
164
209
|
# Add the missing WU reference in the appropriate section
|
|
165
210
|
```
|
|
166
211
|
|
|
@@ -254,6 +299,7 @@ pnpm wu:spawn --id WU-XXXX --client <client-type>
|
|
|
254
299
|
| ----------------------------------------- | --------------------------------- | --------------------- |
|
|
255
300
|
| `pnpm wu:status --id WU-XXX` | Show WU state and valid commands | Check current state |
|
|
256
301
|
| `pnpm wu:claim --id WU-XXX --lane "Lane"` | Claim WU and create worktree | Start working |
|
|
302
|
+
| `pnpm wu:edit --id WU-XXX --field value` | Edit WU spec fields | Update notes/desc |
|
|
257
303
|
| `pnpm wu:spawn --id WU-XXX --client X` | Spawn sub-agent for parallel work | Complex WUs |
|
|
258
304
|
| `pnpm gates` | Run quality gates | Before wu:done |
|
|
259
305
|
| `pnpm gates --docs-only` | Run docs-only gates | For documentation WUs |
|
|
@@ -266,7 +312,7 @@ pnpm wu:spawn --id WU-XXXX --client <client-type>
|
|
|
266
312
|
|
|
267
313
|
```
|
|
268
314
|
/path/to/repo/
|
|
269
|
-
├──
|
|
315
|
+
├── docs/04-operations/tasks/
|
|
270
316
|
│ ├── backlog.md # All WUs listed here
|
|
271
317
|
│ └── wu/WU-XXXX.yaml # Individual WU specs
|
|
272
318
|
├── worktrees/
|
|
@@ -310,6 +356,24 @@ Before reporting a WU complete, verify:
|
|
|
310
356
|
2. **Read error messages:** They usually include fix commands
|
|
311
357
|
3. **Check gate logs:** `.logs/gates-*.log` in worktree
|
|
312
358
|
4. **Recovery command:** `pnpm wu:recover --id WU-XXX`
|
|
359
|
+
5. **Use --help for full options:** `<package_manager> <command> --help`
|
|
360
|
+
|
|
361
|
+
### Rule: Always Check --help for Full Options (WU-1358)
|
|
362
|
+
|
|
363
|
+
CLI documentation may not include all available options. Before using a command, **always run `--help`** to see the complete list:
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Examples (substitute your package manager)
|
|
367
|
+
pnpm wu:edit --help
|
|
368
|
+
npm run wu:claim -- --help
|
|
369
|
+
yarn wu:create --help
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
This ensures you see:
|
|
373
|
+
|
|
374
|
+
- All available flags (including inline options not in generated docs)
|
|
375
|
+
- Required vs optional parameters
|
|
376
|
+
- Default values and descriptions
|
|
313
377
|
|
|
314
378
|
---
|
|
315
379
|
|