Not Running wu:done
The single most common mistake agents make is completing work, then stopping without running pnpm wu:done. This leaves the WU incomplete.
This guide helps AI agents get productive with LumenFlow quickly, covering common mistakes and essential safety practices.
Before starting any WU:
pnpm wu:claimpnpm wu:brief --id WU-XXX --client <client> (required — canonical handoff source of truth + evidence)## Memory Context block in your wu:brief output before codingcode_pathsPrevious agents on this WU may have already captured bugs, architecture decisions, and coordination signals. After wu:claim, wu:brief is the singular canonical handoff source of truth. It auto-embeds those records into the generated prompt under a ## Memory Context section — read it before writing code, or you will rewrite work that is already done.
The section includes:
wu:claim (24h window if no claim event found)If the section surfaces something non-obvious, act on it before coding. If it’s empty, carry on — but capture your own discoveries during the WU with mem:create.
For ad-hoc lookups mid-WU (rarely needed; the brief is normally sufficient):
See Memory Layer concepts for the full workflow cadence and the shared-vs-vendor-personal classification rule.
wu:brief always includes baseline skill guidance such as lifecycle, worktree, and TDD/bug/context hints. It can also include a ### Generated Skill Hints section derived from the work classifier and the active client’s capabilities_map.
Generated hints are measured before they are injected. The section token tells you how to treat them:
LUMENFLOW_SKILL_HINTS_INJECTED means the configured mapping met the precision/recall threshold and the listed skills are usable recommendations.LUMENFLOW_SKILL_HINTS_REPORT_ONLY means candidates were measured but not injected because quality was below threshold or report_only is enabled. Do not load skills from candidate names in this mode.LUMENFLOW_SKILL_HINTS_DISABLED means generated hints are disabled for the client.Configure this per client:
Skill-hint evaluation results are rendered directly into the generated prompt body (the ### Generated Skill Hints section) — they are not currently persisted to any NDJSON telemetry file.
For a fresh setup, use one command:
This flow creates workspace.yaml, installs the default pack, and pins its
integrity automatically. Re-running onboard is non-destructive and updates
the existing workspace flow instead of blindly overwriting.
Not Running wu:done
The single most common mistake agents make is completing work, then stopping without running pnpm wu:done. This leaves the WU incomplete.
After wu:prep passes, you MUST run:
Do NOT:
Wrong:
Right:
The WU says code_paths: [src/api/**] but you edit src/ui/component.ts.
Fix: Only edit files within the specified code_paths. If you need other files, that’s a different WU.
Wrong:
Right:
Wrong:
Right:
The WU says “Add user profile endpoint” but you also:
Fix: Implement exactly what the acceptance criteria specify. Create new WUs for other changes.
Wrong: Start coding immediately based on the title.
Right:
Wrong:
Right:
Wrong:
Right:
If the failing gate is migration verification:
pnpm db:preflightpnpm wu:prep --id WU-123If you need to pause:
Do NOT leave uncommitted changes in the worktree.
Wrong:
Right:
LumenFlow enforces safety at the repository level, protecting all agents (Claude, Cursor, Windsurf, etc.) and humans.
Use scripts/safe-git instead of system git to block destructive operations:
These run for everyone on every commit:
| Hook | What It Does |
| ---------------------- | ------------------------------------------------------------------------- |
| Secret scanning | Blocks commits containing AWS/GitHub/OpenAI keys |
| Absolute path scanning | Blocks common home-dir absolute paths (use ~ or relative paths instead) |
| Lockfile sync | Blocks dependency changes without lockfile update |
| Worktree discipline | Blocks main commits when worktrees exist |
All blocked actions are logged for visibility:
.lumenflow/safety-blocks.log – Blocked safety violations.lumenflow/force-bypasses.log – Emergency LUMENFLOW_FORCE bypassesQuick reference for safe LumenFlow operation.
| Trigger | Action | | --------------------------- | --------- | | Same error repeats 3 times | Stop, ask | | Auth or permissions changes | Stop, ask | | PII/secrets involved | Stop, ask | | Cloud spend decisions | Stop, ask | | Policy changes required | Stop, ask | | Anything feels irreversible | Stop, ask |
| Action | Why |
| ------------------------ | ----------------- |
| git reset --hard | Data loss risk |
| git push --force | History rewrite |
| --no-verify | Bypasses safety |
| git stash (on main) | Hides work |
| git clean -fd | Deletes files |
| Work in main after claim | Breaks isolation |
| Skip wu:done | Incomplete WU |
| Use absolute paths | Bypasses worktree |
| Action | Why | | -------------------------- | ---------------- | | Read WU spec first | Understand scope | | cd to worktree after claim | Isolation | | Write tests before code | TDD | | Run wu:prep before wu:done | Quality | | Run wu:done | Complete WU | | Stay within code_paths | Scope discipline | | Use relative paths | Respect worktree | | Verify pwd before file ops | Avoid path trap |
Max 3 Attempts Rule:
If the same error happens 3 times:
Gate Failures:
wu:prepChoose the safer path:
Before ending any session, verify:
pnpm wu:prep --id WU-XXX in the worktree?cd back to main?pnpm wu:done --id WU-XXX?If any answer is “no”, you’re not done yet.
If wu:done wasn’t run, you’ll see:
ls worktrees/ls .lumenflow/stamps/WU-XXX.done returns nothingin_progressIf a previous session forgot to run wu:done:
When you run pnpm wu:done --id WU-XXX (after a successful wu:prep):
This is the ONLY way to complete a WU. Manual steps leave things inconsistent.
LUMENFLOW_FORCE_REASON and LUMENFLOW_FORCE=1 (see example below)All bypasses are logged:
To enable management actions and AG-UI run streaming in the web app, configure
runtime access in apps/web/.env.local:
Then run the web app and verify the runtime is available:
Runtime routes to know:
POST /api/ag-ui/v1/run streams RunAgent SSE outputGET /api/health reports runtime/workspace availabilityIf runtime is not configured, preview mode returns actionable diagnostics with the exact env vars above.
The safety mechanisms above (git wrapper, Husky hooks, LUMENFLOW_FORCE audit trail) are enforced at
the repository level and work identically regardless of which AI client you use. lumenflow init
no longer scaffolds any client-specific overlay (CLAUDE.md, .claude/skills/, .claude/agents/,
.cursor/rules/lumenflow.md, .windsurf/rules/lumenflow.md, or similar) — that projection was
retired in WU-3543. Folding AGENTS.md/LUMENFLOW.md into your tool’s own instruction mechanism is
now a repo-owner task; see AI Coding Assistant
Integrations for the integration depths and
a copyable enforcement-hook example.
Verify: Ask your AI assistant “What are the LumenFlow safety rules?” - once you’ve adapted the universal files into your client’s own mechanism, it should mention worktree discipline, forbidden git commands, and LUMENFLOW_FORCE.
Test that safety mechanisms work: