@lumenflow/cli 2.2.1 → 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.
- package/README.md +147 -57
- package/dist/__tests__/agent-log-issue.test.js +56 -0
- package/dist/__tests__/cli-entry-point.test.js +66 -17
- package/dist/__tests__/cli-subprocess.test.js +25 -0
- package/dist/__tests__/init.test.js +298 -0
- package/dist/__tests__/initiative-plan.test.js +340 -0
- package/dist/__tests__/mem-cleanup-execution.test.js +19 -0
- package/dist/__tests__/merge-block.test.js +220 -0
- package/dist/__tests__/release.test.js +28 -0
- package/dist/__tests__/safe-git.test.js +191 -0
- package/dist/__tests__/state-doctor.test.js +274 -0
- package/dist/__tests__/wu-done.test.js +36 -0
- package/dist/__tests__/wu-edit.test.js +119 -0
- package/dist/__tests__/wu-prep.test.js +108 -0
- package/dist/agent-issues-query.js +4 -3
- package/dist/agent-log-issue.js +25 -4
- package/dist/backlog-prune.js +5 -4
- package/dist/cli-entry-point.js +11 -1
- package/dist/doctor.js +368 -0
- package/dist/flow-bottlenecks.js +6 -5
- package/dist/flow-report.js +4 -3
- package/dist/gates.js +468 -116
- package/dist/guard-locked.js +4 -3
- package/dist/guard-worktree-commit.js +4 -3
- package/dist/init.js +508 -86
- package/dist/initiative-add-wu.js +4 -3
- package/dist/initiative-bulk-assign-wus.js +8 -5
- package/dist/initiative-create.js +73 -37
- package/dist/initiative-edit.js +37 -21
- package/dist/initiative-list.js +4 -3
- package/dist/initiative-plan.js +337 -0
- package/dist/initiative-status.js +4 -3
- package/dist/lane-health.js +377 -0
- package/dist/lane-suggest.js +382 -0
- package/dist/mem-checkpoint.js +2 -2
- package/dist/mem-cleanup.js +2 -2
- package/dist/mem-context.js +306 -0
- package/dist/mem-create.js +2 -2
- package/dist/mem-delete.js +293 -0
- package/dist/mem-inbox.js +2 -2
- package/dist/mem-index.js +211 -0
- package/dist/mem-init.js +1 -1
- package/dist/mem-profile.js +207 -0
- package/dist/mem-promote.js +254 -0
- package/dist/mem-ready.js +2 -2
- package/dist/mem-signal.js +2 -2
- package/dist/mem-start.js +2 -2
- package/dist/mem-summarize.js +2 -2
- package/dist/mem-triage.js +2 -2
- package/dist/merge-block.js +222 -0
- package/dist/metrics-cli.js +7 -4
- package/dist/metrics-snapshot.js +4 -3
- package/dist/orchestrate-initiative.js +10 -4
- package/dist/orchestrate-monitor.js +379 -31
- package/dist/signal-cleanup.js +296 -0
- package/dist/spawn-list.js +6 -5
- package/dist/state-bootstrap.js +5 -4
- package/dist/state-cleanup.js +360 -0
- package/dist/state-doctor-fix.js +196 -0
- package/dist/state-doctor.js +501 -0
- package/dist/validate-agent-skills.js +4 -3
- package/dist/validate-agent-sync.js +4 -3
- package/dist/validate-backlog-sync.js +7 -84
- package/dist/validate-skills-spec.js +4 -3
- package/dist/validate.js +7 -107
- package/dist/wu-block.js +3 -3
- package/dist/wu-claim.js +208 -98
- package/dist/wu-cleanup.js +5 -4
- package/dist/wu-create.js +71 -46
- package/dist/wu-delete.js +88 -60
- package/dist/wu-deps.js +6 -5
- package/dist/wu-done-check.js +34 -0
- package/dist/wu-done.js +60 -24
- package/dist/wu-edit.js +63 -28
- package/dist/wu-infer-lane.js +7 -6
- package/dist/wu-preflight.js +23 -81
- package/dist/wu-prep.js +125 -0
- package/dist/wu-prune.js +4 -3
- package/dist/wu-recover.js +88 -22
- package/dist/wu-repair.js +7 -6
- package/dist/wu-spawn.js +226 -270
- package/dist/wu-status.js +4 -3
- package/dist/wu-unblock.js +5 -5
- package/dist/wu-unlock-lane.js +4 -3
- package/dist/wu-validate.js +5 -4
- package/package.json +16 -7
- package/templates/core/.lumenflow/constraints.md.template +192 -0
- package/templates/core/.lumenflow/rules/git-safety.md.template +27 -0
- package/templates/core/.lumenflow/rules/wu-workflow.md.template +48 -0
- package/templates/core/AGENTS.md.template +60 -0
- package/templates/core/LUMENFLOW.md.template +255 -0
- package/templates/core/UPGRADING.md.template +121 -0
- package/templates/core/ai/onboarding/agent-safety-card.md.template +106 -0
- package/templates/core/ai/onboarding/first-wu-mistakes.md.template +198 -0
- package/templates/core/ai/onboarding/quick-ref-commands.md.template +186 -0
- package/templates/core/ai/onboarding/release-process.md.template +362 -0
- package/templates/core/ai/onboarding/troubleshooting-wu-done.md.template +159 -0
- package/templates/core/ai/onboarding/wu-create-checklist.md.template +117 -0
- package/templates/vendors/aider/.aider.conf.yml.template +27 -0
- package/templates/vendors/claude/.claude/CLAUDE.md.template +52 -0
- package/templates/vendors/claude/.claude/settings.json.template +49 -0
- package/templates/vendors/claude/.claude/skills/bug-classification/SKILL.md.template +192 -0
- package/templates/vendors/claude/.claude/skills/code-quality/SKILL.md.template +152 -0
- package/templates/vendors/claude/.claude/skills/context-management/SKILL.md.template +155 -0
- package/templates/vendors/claude/.claude/skills/execution-memory/SKILL.md.template +304 -0
- package/templates/vendors/claude/.claude/skills/frontend-design/SKILL.md.template +131 -0
- package/templates/vendors/claude/.claude/skills/initiative-management/SKILL.md.template +164 -0
- package/templates/vendors/claude/.claude/skills/library-first/SKILL.md.template +98 -0
- package/templates/vendors/claude/.claude/skills/lumenflow-gates/SKILL.md.template +87 -0
- package/templates/vendors/claude/.claude/skills/multi-agent-coordination/SKILL.md.template +84 -0
- package/templates/vendors/claude/.claude/skills/ops-maintenance/SKILL.md.template +254 -0
- package/templates/vendors/claude/.claude/skills/orchestration/SKILL.md.template +189 -0
- package/templates/vendors/claude/.claude/skills/tdd-workflow/SKILL.md.template +139 -0
- package/templates/vendors/claude/.claude/skills/worktree-discipline/SKILL.md.template +138 -0
- package/templates/vendors/claude/.claude/skills/wu-lifecycle/SKILL.md.template +106 -0
- package/templates/vendors/cline/.clinerules.template +53 -0
- package/templates/vendors/cursor/.cursor/rules/lumenflow.md.template +34 -0
- package/templates/vendors/cursor/.cursor/rules.md.template +28 -0
- package/templates/vendors/windsurf/.windsurf/rules/lumenflow.md.template +34 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Quick Reference: LumenFlow Commands
|
|
2
|
+
|
|
3
|
+
**Last updated:** {{DATE}}
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Project Setup
|
|
8
|
+
|
|
9
|
+
| Command | Description |
|
|
10
|
+
| --------------------------------------------- | -------------------------------------------------- |
|
|
11
|
+
| `pnpm exec lumenflow init` | Scaffold minimal LumenFlow core |
|
|
12
|
+
| `pnpm exec lumenflow init --full` | Add docs + agent onboarding + task scaffolding |
|
|
13
|
+
| `pnpm exec lumenflow init --framework <name>` | Add framework hint + overlay docs |
|
|
14
|
+
| `pnpm exec lumenflow init --force` | Overwrite existing files |
|
|
15
|
+
| `pnpm exec lumenflow docs:sync` | Sync agent docs to existing project (for upgrades) |
|
|
16
|
+
| `pnpm exec lumenflow docs:sync --force` | Overwrite existing agent docs |
|
|
17
|
+
| `pnpm exec lumenflow doctor` | Diagnose LumenFlow configuration issues |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## WU Management
|
|
22
|
+
|
|
23
|
+
| Command | Description |
|
|
24
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
|
|
25
|
+
| `pnpm wu:create --id WU-XXX --lane <Lane> --title "Title" --description "..." --acceptance "..." --code-paths "path" --test-paths-unit "path" --exposure backend-only --spec-refs "lumenflow://plans/WU-XXX-plan.md"` | Create new WU (default: spec branch mode) |
|
|
26
|
+
| `pnpm wu:create ... --direct` | Create WU directly on main (legacy/emergency) |
|
|
27
|
+
| `pnpm wu:create ... --plan` | Also create plan template in $LUMENFLOW_HOME/plans/ |
|
|
28
|
+
| `pnpm wu:claim --id WU-XXX --lane <Lane>` | Claim WU (auto-merges spec branch if needed) |
|
|
29
|
+
| `pnpm wu:spawn --id WU-XXX --client <client>` | Spawn sub-agent prompt with client guidance |
|
|
30
|
+
| `pnpm wu:edit --id WU-1039 --exposure backend-only` | Edit WU spec (supports exposure updates on done WUs) |
|
|
31
|
+
| `pnpm wu:done --id WU-XXX` | Complete WU (merge, stamp, cleanup) - primary method |
|
|
32
|
+
| `pnpm wu:block --id WU-XXX --reason "Reason"` | Block a WU |
|
|
33
|
+
| `pnpm wu:unblock --id WU-XXX` | Unblock a WU |
|
|
34
|
+
| `pnpm wu:cleanup --id WU-XXX` | PR-only: cleanup after PR merge (see note below) |
|
|
35
|
+
| `pnpm wu:cleanup --artifacts` | Remove build artifacts in current worktree |
|
|
36
|
+
| `pnpm wu:delete --id WU-XXX` | Delete WU spec and cleanup |
|
|
37
|
+
| `pnpm wu:unlock-lane --lane <Lane>` | Unlock stuck lane |
|
|
38
|
+
|
|
39
|
+
### wu:done vs wu:cleanup
|
|
40
|
+
|
|
41
|
+
**IMPORTANT:** Use `wu:done` for completing WUs. `wu:cleanup` is NOT a replacement for `wu:done`.
|
|
42
|
+
|
|
43
|
+
| Command | Purpose | When to Use |
|
|
44
|
+
| ------------ | ------------------------------------------ | ------------------------------ |
|
|
45
|
+
| `wu:done` | Complete WU: run gates, merge, stamp, push | Always use this to finish a WU |
|
|
46
|
+
| `wu:cleanup` | Remove worktree/branch after PR merge | PR-based workflows only (rare) |
|
|
47
|
+
|
|
48
|
+
**wu:cleanup is PR-only:** When `gh` CLI is available, `wu:cleanup` requires the PR to be merged before it will run. It checks the PR merge status via GitHub API and blocks if the PR is not merged. This prevents accidental cleanup of work-in-progress WUs.
|
|
49
|
+
|
|
50
|
+
**Common mistake:** Agents sometimes try to run `wu:cleanup` after `wu:done` fails. This is incorrect. If `wu:done` fails:
|
|
51
|
+
|
|
52
|
+
1. Fix the underlying issue (gate failures, merge conflicts, etc.)
|
|
53
|
+
2. Re-run `wu:done --id WU-XXX`
|
|
54
|
+
|
|
55
|
+
Do NOT use `wu:cleanup` to work around `wu:done` failures.
|
|
56
|
+
|
|
57
|
+
### wu:edit Write Modes
|
|
58
|
+
|
|
59
|
+
`wu:edit` has two distinct modes depending on WU status:
|
|
60
|
+
|
|
61
|
+
| WU Status | Write Mode | Target Location |
|
|
62
|
+
| ------------- | -------------- | --------------------------------- |
|
|
63
|
+
| `ready` | MICRO_WORKTREE | main (via temp branch + ff-merge) |
|
|
64
|
+
| `in_progress` | WORKTREE | Active worktree directly |
|
|
65
|
+
|
|
66
|
+
**Key behavior:**
|
|
67
|
+
|
|
68
|
+
- **Ready WUs**: Edits go to main via a micro-worktree transaction (same as `wu:create`)
|
|
69
|
+
- **In-progress WUs**: Edits write directly to the active worktree's WU YAML file
|
|
70
|
+
|
|
71
|
+
This means `wu:edit` on an `in_progress` WU automatically propagates to the worktree - no manual sync needed. When `wu:done` runs, it uses `readWUPreferWorktree()` which reads from the worktree first, ensuring your edits are preserved.
|
|
72
|
+
|
|
73
|
+
**Common confusion:** Agents sometimes think they need to manually sync edits to the worktree. This is unnecessary - `wu:edit` handles it automatically based on WU status.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Gates
|
|
78
|
+
|
|
79
|
+
| Command | Description |
|
|
80
|
+
| ------------------------ | -------------------------- |
|
|
81
|
+
| `pnpm gates` | Run all quality gates |
|
|
82
|
+
| `pnpm gates --docs-only` | Run gates for docs changes |
|
|
83
|
+
| `pnpm format` | Format all files |
|
|
84
|
+
| `pnpm lint` | Run linter |
|
|
85
|
+
| `pnpm typecheck` | Run TypeScript check |
|
|
86
|
+
| `pnpm test` | Run tests |
|
|
87
|
+
| `pnpm lane:health` | Check lane config health |
|
|
88
|
+
| `pnpm lane:suggest` | Suggest lane for code paths|
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Memory (Session Context)
|
|
93
|
+
|
|
94
|
+
| Command | Description |
|
|
95
|
+
| --------------------------------- | -------------------------- |
|
|
96
|
+
| `pnpm mem:init --wu WU-XXX` | Initialize memory for WU |
|
|
97
|
+
| `pnpm mem:checkpoint --wu WU-XXX` | Save progress checkpoint |
|
|
98
|
+
| `pnpm mem:ready --wu WU-XXX` | Check pending nodes |
|
|
99
|
+
| `pnpm mem:inbox --wu WU-XXX` | Check coordination signals |
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Git (Safe Operations)
|
|
104
|
+
|
|
105
|
+
| Command | Description |
|
|
106
|
+
| ------------------------------------ | ------------------------- |
|
|
107
|
+
| `git status` | Check working tree status |
|
|
108
|
+
| `git add .` | Stage all changes |
|
|
109
|
+
| `git commit -m "type: message"` | Commit with message |
|
|
110
|
+
| `git push origin lane/<lane>/wu-xxx` | Push to remote |
|
|
111
|
+
| `git fetch origin` | Fetch remote changes |
|
|
112
|
+
| `git rebase origin/main` | Update from main |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Navigation
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# After claiming, go to worktree
|
|
120
|
+
cd worktrees/<lane>-wu-xxx
|
|
121
|
+
|
|
122
|
+
# Return to main for wu:done
|
|
123
|
+
cd /path/to/main
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Workflow Sequence
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# 1. Create (default: spec branch mode, never writes to main)
|
|
132
|
+
pnpm wu:create --id WU-001 --lane "Framework: Core" --title "Add feature" \
|
|
133
|
+
--description "Context: ...\nProblem: ...\nSolution: ..." \
|
|
134
|
+
--acceptance "Criterion 1" --acceptance "Criterion 2" \
|
|
135
|
+
--code-paths "packages/@lumenflow/core/src/example.ts" \
|
|
136
|
+
--test-paths-unit "packages/@lumenflow/core/__tests__/example.test.ts" \
|
|
137
|
+
--exposure backend-only \
|
|
138
|
+
--spec-refs "lumenflow://plans/WU-001-plan.md"
|
|
139
|
+
|
|
140
|
+
# 2. Claim (auto-merges spec/wu-001 to main, creates worktree)
|
|
141
|
+
pnpm wu:claim --id WU-001 --lane "Framework: Core"
|
|
142
|
+
cd worktrees/framework-core-wu-001
|
|
143
|
+
|
|
144
|
+
# 3. Work (TDD)
|
|
145
|
+
# ... write tests first, then code ...
|
|
146
|
+
|
|
147
|
+
# 4. Commit
|
|
148
|
+
git add .
|
|
149
|
+
git commit -m "feat: add feature"
|
|
150
|
+
git push origin lane/framework-core/wu-001
|
|
151
|
+
|
|
152
|
+
# 5. Gates
|
|
153
|
+
pnpm gates
|
|
154
|
+
|
|
155
|
+
# 6. Complete
|
|
156
|
+
cd /path/to/main
|
|
157
|
+
pnpm wu:done --id WU-001
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Commit Message Format
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
type(scope): description
|
|
166
|
+
|
|
167
|
+
Types: feat, fix, docs, style, refactor, test, chore
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Examples:
|
|
171
|
+
|
|
172
|
+
- `feat(api): add user endpoint`
|
|
173
|
+
- `fix(auth): resolve token expiry`
|
|
174
|
+
- `docs: update README`
|
|
175
|
+
- `test: add unit tests for calculator`
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## File Paths
|
|
180
|
+
|
|
181
|
+
| Path | Description |
|
|
182
|
+
| ----------------------------------------- | -------------------- |
|
|
183
|
+
| `docs/04-operations/tasks/wu/WU-XXX.yaml` | WU specification |
|
|
184
|
+
| `docs/04-operations/tasks/status.md` | Current status board |
|
|
185
|
+
| `.lumenflow/stamps/WU-XXX.done` | Completion stamp |
|
|
186
|
+
| `worktrees/<lane>-wu-xxx/` | Worktree directory |
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
# LumenFlow Release Process
|
|
2
|
+
|
|
3
|
+
**Last updated:** {{DATE}}
|
|
4
|
+
|
|
5
|
+
This document covers the complete release process for LumenFlow, including versioning, npm publishing, documentation updates, and the GitHub App.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
LumenFlow has several components that need to stay in sync:
|
|
12
|
+
|
|
13
|
+
| Component | Location | Deployment |
|
|
14
|
+
| -------------- | ----------------------- | ----------------------------------- |
|
|
15
|
+
| npm packages | `packages/@lumenflow/*` | Auto via GitHub Actions on tag push |
|
|
16
|
+
| Starlight docs | `apps/docs/` | Manual via Vercel CLI |
|
|
17
|
+
| GitHub App | `apps/github-app/` | Auto via Vercel Git integration |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Release Command
|
|
22
|
+
|
|
23
|
+
The `pnpm release` command automates the entire release process:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pnpm release --release-version 1.3.0
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### What It Does
|
|
30
|
+
|
|
31
|
+
1. Validates semver version format
|
|
32
|
+
2. Ensures clean working directory on main branch
|
|
33
|
+
3. Bumps all `@lumenflow/*` package versions using micro-worktree isolation
|
|
34
|
+
4. Builds all packages
|
|
35
|
+
5. Creates and pushes git tag `vX.Y.Z`
|
|
36
|
+
6. Publishes to npm
|
|
37
|
+
|
|
38
|
+
### Options
|
|
39
|
+
|
|
40
|
+
| Flag | Description |
|
|
41
|
+
| --------------------------- | --------------------------------------- |
|
|
42
|
+
| `--release-version <X.Y.Z>` | **Required.** Semver version to release |
|
|
43
|
+
| `--dry-run` | Preview changes without making them |
|
|
44
|
+
| `--skip-publish` | Bump and tag only (no npm publish) |
|
|
45
|
+
| `--skip-build` | Skip build step (use existing dist) |
|
|
46
|
+
| `--version`, `-V` | Show CLI version |
|
|
47
|
+
| `--help`, `-h` | Show help |
|
|
48
|
+
|
|
49
|
+
### Examples
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Full release
|
|
53
|
+
pnpm release --release-version 1.3.0
|
|
54
|
+
|
|
55
|
+
# Preview what would happen
|
|
56
|
+
pnpm release --release-version 1.3.0 --dry-run
|
|
57
|
+
|
|
58
|
+
# Version bump and tag only (CI will publish)
|
|
59
|
+
pnpm release --release-version 1.3.0 --skip-publish
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Authentication
|
|
63
|
+
|
|
64
|
+
For npm publish, set one of these environment variables:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
export NPM_TOKEN=<your-npm-token>
|
|
68
|
+
# or
|
|
69
|
+
export NODE_AUTH_TOKEN=<your-npm-token>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Get a token at: https://www.npmjs.com/settings/tokens
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Version Bumping (Manual)
|
|
77
|
+
|
|
78
|
+
If you need to bump versions manually without the release command:
|
|
79
|
+
|
|
80
|
+
All `@lumenflow/*` packages share the same version number for simplicity.
|
|
81
|
+
|
|
82
|
+
### Packages to Update
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
packages/@lumenflow/core/package.json
|
|
86
|
+
packages/@lumenflow/cli/package.json
|
|
87
|
+
packages/@lumenflow/memory/package.json
|
|
88
|
+
packages/@lumenflow/agent/package.json
|
|
89
|
+
packages/@lumenflow/metrics/package.json
|
|
90
|
+
packages/@lumenflow/initiatives/package.json
|
|
91
|
+
packages/@lumenflow/shims/package.json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Manual Version Bump
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Update all package.json files
|
|
98
|
+
# Change "version": "1.2.0" to "1.3.0" in each file
|
|
99
|
+
|
|
100
|
+
# Verify versions match
|
|
101
|
+
grep '"version"' packages/@lumenflow/*/package.json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Semantic Versioning
|
|
105
|
+
|
|
106
|
+
- **Patch** (1.2.x): Bug fixes, docs updates
|
|
107
|
+
- **Minor** (1.x.0): New features, non-breaking changes
|
|
108
|
+
- **Major** (x.0.0): Breaking changes (rare)
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## npm Publishing
|
|
113
|
+
|
|
114
|
+
### Trigger
|
|
115
|
+
|
|
116
|
+
Publishing is triggered by pushing a git tag matching `v*`:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
git tag -a v1.3.0 -m "v1.3.0 - Description of changes"
|
|
120
|
+
git push origin v1.3.0
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Workflow
|
|
124
|
+
|
|
125
|
+
The `.github/workflows/publish.yml` workflow:
|
|
126
|
+
|
|
127
|
+
1. Checks out the tagged commit
|
|
128
|
+
2. Installs dependencies
|
|
129
|
+
3. Builds all packages
|
|
130
|
+
4. Publishes to npm with `pnpm -r publish --access public`
|
|
131
|
+
|
|
132
|
+
### Required Secrets
|
|
133
|
+
|
|
134
|
+
- **`NPM_TOKEN`**: npm automation token with publish access to `@lumenflow` scope
|
|
135
|
+
- Generate at: <https://www.npmjs.com/settings/tokens>
|
|
136
|
+
- Type: Automation token (bypasses 2FA)
|
|
137
|
+
- Store in: GitHub repo settings → Secrets → Actions
|
|
138
|
+
|
|
139
|
+
### Troubleshooting npm Publish
|
|
140
|
+
|
|
141
|
+
#### Token Issues
|
|
142
|
+
|
|
143
|
+
If you see "Access token expired or revoked":
|
|
144
|
+
|
|
145
|
+
- Regenerate npm token and update `NPM_TOKEN` secret
|
|
146
|
+
|
|
147
|
+
#### Package Not Found (404)
|
|
148
|
+
|
|
149
|
+
If you see "404 Not Found" for a package:
|
|
150
|
+
|
|
151
|
+
- Check if package has `"private": true` (should NOT be published)
|
|
152
|
+
- Apps (`apps/*`) should have `"private": true`
|
|
153
|
+
- Only `packages/@lumenflow/*` should be published
|
|
154
|
+
|
|
155
|
+
#### Re-running Failed Workflow
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
gh run list --workflow=publish.yml --limit 5
|
|
159
|
+
gh run rerun <run-id>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Verifying Publication
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npm view @lumenflow/cli versions --json | tail -5
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Starlight Documentation
|
|
171
|
+
|
|
172
|
+
The public docs at <https://lumenflow.dev> are built from `apps/docs/`.
|
|
173
|
+
|
|
174
|
+
### Deployment
|
|
175
|
+
|
|
176
|
+
Starlight docs are deployed **manually** via Vercel CLI:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
cd apps/docs
|
|
180
|
+
pnpm build
|
|
181
|
+
vercel --prod
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### When to Deploy
|
|
185
|
+
|
|
186
|
+
- After any changes to `apps/docs/src/content/docs/**`
|
|
187
|
+
- After version bumps (to update any version references)
|
|
188
|
+
- After adding new features documented in Starlight
|
|
189
|
+
|
|
190
|
+
### Vercel Project
|
|
191
|
+
|
|
192
|
+
- **Project**: `lumenflow-docs` (ID: `prj_myK4BzfHKctGhxfvALJaMOXVLx4g`)
|
|
193
|
+
- **Domain**: lumenflow.dev
|
|
194
|
+
- **Team**: hellm-ai
|
|
195
|
+
|
|
196
|
+
### Important Notes
|
|
197
|
+
|
|
198
|
+
- **No private repo links**: Starlight docs are public; never link to `github.com/hellmai/os`
|
|
199
|
+
- **Link to GitHub App**: Use <https://github.com/apps/lumenflow-by-hellmai> for GitHub links
|
|
200
|
+
- **Link to npm**: Use <https://www.npmjs.com/org/lumenflow> for package links
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## GitHub App
|
|
205
|
+
|
|
206
|
+
The LumenFlow GitHub App provides workflow enforcement for teams.
|
|
207
|
+
|
|
208
|
+
### Components
|
|
209
|
+
|
|
210
|
+
- **App manifest**: `apps/github-app/app.yml`
|
|
211
|
+
- **Webhook handler**: `apps/github-app/api/webhook.ts`
|
|
212
|
+
- **Validation endpoints**: `apps/github-app/api/validate-token.ts`
|
|
213
|
+
|
|
214
|
+
### Deployment
|
|
215
|
+
|
|
216
|
+
The GitHub App is deployed **automatically** via Vercel Git integration when changes are pushed to `main`.
|
|
217
|
+
|
|
218
|
+
- **Project**: `lumenflow-app` (ID: `prj_JKfcHVb4QjzAxdjCIJwaUf5PWusG`)
|
|
219
|
+
- **URL**: <https://lumenflow-app.vercel.app>
|
|
220
|
+
|
|
221
|
+
### Package Configuration
|
|
222
|
+
|
|
223
|
+
The `apps/github-app/package.json` must have `"private": true` to prevent npm publish attempts.
|
|
224
|
+
|
|
225
|
+
### Environment Variables (Vercel)
|
|
226
|
+
|
|
227
|
+
| Variable | Description |
|
|
228
|
+
| ----------------------- | ---------------------------- |
|
|
229
|
+
| `GITHUB_APP_ID` | GitHub App ID |
|
|
230
|
+
| `GITHUB_PRIVATE_KEY` | PEM private key for app auth |
|
|
231
|
+
| `GITHUB_WEBHOOK_SECRET` | Webhook signature secret |
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Release Checklist
|
|
236
|
+
|
|
237
|
+
### Before Release
|
|
238
|
+
|
|
239
|
+
- [ ] All acceptance criteria met
|
|
240
|
+
- [ ] Gates pass (`pnpm gates`)
|
|
241
|
+
- [ ] CHANGELOG updated (if maintained)
|
|
242
|
+
|
|
243
|
+
### Release Steps (Automated)
|
|
244
|
+
|
|
245
|
+
Use the release command for the standard workflow:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# Preview first
|
|
249
|
+
pnpm release --release-version 1.3.0 --dry-run
|
|
250
|
+
|
|
251
|
+
# Execute release
|
|
252
|
+
pnpm release --release-version 1.3.0
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
This handles version bump, build, tag, and npm publish automatically.
|
|
256
|
+
|
|
257
|
+
### Release Steps (Manual)
|
|
258
|
+
|
|
259
|
+
If you need more control:
|
|
260
|
+
|
|
261
|
+
1. **Complete WU** (includes version bump commit)
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
pnpm wu:done --id WU-XXXX
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
2. **Create and push tag**
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
git tag -a v1.3.0 -m "v1.3.0 - Summary of changes"
|
|
271
|
+
git push origin v1.3.0
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
3. **Verify npm publish**
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
gh run list --workflow=publish.yml --limit 1
|
|
278
|
+
# Wait for completion, then verify
|
|
279
|
+
npm view @lumenflow/cli version
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
4. **Create GitHub release**
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
gh release create v1.3.0 --title "v1.3.0 - Title" --notes "Release notes..."
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
5. **Deploy Starlight docs** (if content changed)
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
cd apps/docs && pnpm build && vercel --prod
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### After Release
|
|
295
|
+
|
|
296
|
+
- [ ] Verify npm packages accessible: `npm view @lumenflow/cli`
|
|
297
|
+
- [ ] Verify docs updated: <https://lumenflow.dev>
|
|
298
|
+
- [ ] Verify GitHub App functional (if changed)
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Keeping Components in Sync
|
|
303
|
+
|
|
304
|
+
| Change Type | npm | Docs | GitHub App |
|
|
305
|
+
| ---------------- | ------------- | ------ | ------------ |
|
|
306
|
+
| Bug fix in CLI | Tag + publish | No | No |
|
|
307
|
+
| New CLI command | Tag + publish | Update | No |
|
|
308
|
+
| Docs-only update | No | Deploy | No |
|
|
309
|
+
| GitHub App fix | No | No | Auto on push |
|
|
310
|
+
| Full release | Tag + publish | Deploy | Auto |
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Troubleshooting Deployments
|
|
315
|
+
|
|
316
|
+
### npm publish fails
|
|
317
|
+
|
|
318
|
+
1. Check `NPM_TOKEN` secret is valid
|
|
319
|
+
2. Check all `apps/*/package.json` have `"private": true`
|
|
320
|
+
3. Re-run: `gh run rerun <run-id>`
|
|
321
|
+
|
|
322
|
+
### Vercel deploy fails
|
|
323
|
+
|
|
324
|
+
1. Check build locally: `cd apps/docs && pnpm build`
|
|
325
|
+
2. Check Vercel CLI auth: `vercel whoami`
|
|
326
|
+
3. Check project link: `vercel link`
|
|
327
|
+
|
|
328
|
+
### GitHub App webhook failures
|
|
329
|
+
|
|
330
|
+
1. Check Vercel deployment logs
|
|
331
|
+
2. Verify environment variables set
|
|
332
|
+
3. Check webhook secret matches GitHub App settings
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Known Warnings
|
|
337
|
+
|
|
338
|
+
These warnings appear during `pnpm install` and are expected:
|
|
339
|
+
|
|
340
|
+
### Cyclic workspace dependencies
|
|
341
|
+
|
|
342
|
+
```
|
|
343
|
+
WARN There are cyclic workspace dependencies: @lumenflow/core, @lumenflow/memory
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**Why:** `@lumenflow/core` has `@lumenflow/memory` as an **optional peer dependency** for advanced features, while `@lumenflow/memory` depends on `@lumenflow/core` for base utilities. This is intentional architecture.
|
|
347
|
+
|
|
348
|
+
### Deprecated subdependencies
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
WARN 5 deprecated subdependencies found: glob@7.2.3, inflight@1.0.6, path-match@1.2.4, ...
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
**Why:** These come from transitive dependencies of packages like `vercel`. They cannot be fixed without upstream updates.
|
|
355
|
+
|
|
356
|
+
### Ignored build scripts
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
Ignored build scripts: esbuild@..., sharp@...
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
**Why:** pnpm ignores build scripts by default for security. These packages work correctly without their postinstall scripts in our use case.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Troubleshooting: wu:done Not Run
|
|
2
|
+
|
|
3
|
+
**Last updated:** {{DATE}}
|
|
4
|
+
|
|
5
|
+
This is the most common mistake agents make. This document explains why it happens and how to fix it.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## The Problem
|
|
10
|
+
|
|
11
|
+
Agents complete their work, write "To Complete: pnpm wu:done --id WU-XXX" in their response, and then **stop without actually running the command**.
|
|
12
|
+
|
|
13
|
+
### Why This Happens
|
|
14
|
+
|
|
15
|
+
1. **Confusion about scope**: Agent thinks completion is a "next step" for the human
|
|
16
|
+
2. **Fear of overstepping**: Agent hesitates to take "final" actions
|
|
17
|
+
3. **Missing context**: Agent doesn't realize wu:done is expected to be run immediately
|
|
18
|
+
4. **Token limits**: Agent runs out of context and summarizes remaining steps
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## The Fix
|
|
23
|
+
|
|
24
|
+
### Rule: ALWAYS Run wu:done
|
|
25
|
+
|
|
26
|
+
After gates pass, you MUST run:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cd /path/to/main
|
|
30
|
+
pnpm wu:done --id WU-XXX
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Do NOT:
|
|
34
|
+
|
|
35
|
+
- Ask "Should I run wu:done?"
|
|
36
|
+
- Write "To Complete: pnpm wu:done"
|
|
37
|
+
- Wait for permission
|
|
38
|
+
- Treat it as a "future step"
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Correct Completion Flow
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# 1. In worktree, run gates
|
|
46
|
+
pnpm gates
|
|
47
|
+
|
|
48
|
+
# 2. If gates pass, return to main
|
|
49
|
+
cd /path/to/main
|
|
50
|
+
|
|
51
|
+
# 3. IMMEDIATELY run wu:done
|
|
52
|
+
pnpm wu:done --id WU-XXX
|
|
53
|
+
|
|
54
|
+
# 4. Report success with the wu:done output
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## What wu:done Does
|
|
60
|
+
|
|
61
|
+
When you run `pnpm wu:done --id WU-XXX`:
|
|
62
|
+
|
|
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
|
|
70
|
+
|
|
71
|
+
**This is the ONLY way to complete a WU.** Manual steps will leave things in an inconsistent state.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Exposure Auto-Fill (WU-1041)
|
|
76
|
+
|
|
77
|
+
If a WU is missing `exposure`, `wu:done` auto-sets a safe default:
|
|
78
|
+
|
|
79
|
+
- **Content lanes** → `documentation`
|
|
80
|
+
- **Framework/Operations lanes** → `backend-only`
|
|
81
|
+
|
|
82
|
+
Existing exposure values are preserved.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Symptoms of Incomplete WU
|
|
87
|
+
|
|
88
|
+
If wu:done wasn't run, you'll see:
|
|
89
|
+
|
|
90
|
+
- Worktree still exists: `ls worktrees/`
|
|
91
|
+
- No stamp: `ls .lumenflow/stamps/WU-XXX.done` returns nothing
|
|
92
|
+
- Status unchanged: WU still shows as `in_progress`
|
|
93
|
+
- Branch not merged: Changes only on lane branch
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Recovery
|
|
98
|
+
|
|
99
|
+
If a previous agent forgot to run wu:done:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# 1. Check worktree exists
|
|
103
|
+
ls worktrees/
|
|
104
|
+
|
|
105
|
+
# 2. If it does, run wu:done
|
|
106
|
+
pnpm wu:done --id WU-XXX
|
|
107
|
+
|
|
108
|
+
# 3. If worktree was deleted but branch exists
|
|
109
|
+
# This is a bad state - may need manual recovery
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Why This Matters
|
|
115
|
+
|
|
116
|
+
An incomplete WU causes problems:
|
|
117
|
+
|
|
118
|
+
1. **Lane blocked**: WIP=1 means no other work can start
|
|
119
|
+
2. **Work lost**: Changes might not reach main
|
|
120
|
+
3. **Context lost**: Next agent doesn't know work is done
|
|
121
|
+
4. **Process broken**: The whole workflow depends on wu:done
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Checklist Before Ending Session
|
|
126
|
+
|
|
127
|
+
- [ ] Did I run `pnpm gates` in the worktree?
|
|
128
|
+
- [ ] Did gates pass?
|
|
129
|
+
- [ ] Did I `cd` back to main?
|
|
130
|
+
- [ ] Did I run `pnpm wu:done --id WU-XXX`?
|
|
131
|
+
- [ ] Did wu:done complete successfully?
|
|
132
|
+
|
|
133
|
+
If any answer is "no", you're not done yet.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Anti-Patterns
|
|
138
|
+
|
|
139
|
+
### WRONG:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
I've completed all the work. To finish:
|
|
143
|
+
1. Run `pnpm wu:done --id WU-123`
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### RIGHT:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Actually run it
|
|
150
|
+
cd /home/project/main
|
|
151
|
+
pnpm wu:done --id WU-123
|
|
152
|
+
# Output: WU-123 completed successfully
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Then report:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
WU-123 completed successfully. Changes merged to main, stamp created.
|
|
159
|
+
```
|