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 canonical capability defaults. Client capabilities_map values are execution metadata and cannot replace canonical methodology.
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.
Host-native memory and caches are advisory only. They must not become a second
LumenFlow policy or replacement brief. Canonical .lumenflow/ skills and the
rendered handoff always take precedence; report stale or malicious memory and
leave unrelated user-owned files intact.
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.
On supported JavaScript projects, initialization derives test_incremental from an explicit
changed-test script or Vitest, Jest, Nx, or Turbo evidence. A declared tests.unit list runs first,
followed by one related sweep only for changed code it did not cover. safety-critical-test and
test share that execution, and an unchanged successful wu:prep checkpoint is reused by
wu:done.
LumenFlow runs test_full only when scope is unsafe or missing, test configuration/untracked files
make impact analysis unsafe, change detection fails, a main-snapshot comparison is required, or the
operator explicitly passes --full-tests. Commands marked fresh_on_completion: true remain a
separate completion check because their external state can change after prep.
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 every agent host and human contributor.
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:
LUMENFLOW_WEB_WORKSPACE_ROOT is a path-safety boundary, not an authorization grant. It may be a
shared host root containing sibling workspaces, but an authenticated caller can mutate only the
selected workspace whose top-level workspace.yaml.id exactly matches the caller’s workspace
identity. A mismatch fails before pack generation, registry access, filesystem mutation, subprocess
execution, or any other body-driven side effect. Same-workspace requests continue normally.
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 are repository-level and work regardless of the agent host. lumenflow init manages LUMENFLOW.md, canonical .lumenflow/skills/, configuration, and workflow state. It
does not create, modify, delete, require, or treat a host’s instruction, skill, agent, or hook
files as authoritative. Compatibility diagnostics may observe a file’s presence without reporting
it as health or managed state.
Configure your project-owned host instructions to read LUMENFLOW.md and then
LUMENFLOW.local.md when present. Load canonical skills from .lumenflow/skills/ through the
host’s own mechanism without maintaining a second LumenFlow-authored copy. See AI Coding
Assistant Integrations for the portable
connection pattern.
Verify: Ask your AI assistant “What are the LumenFlow safety rules?” Once its project-owned
instructions point to LUMENFLOW.md, it should mention worktree discipline, forbidden git
commands, and LUMENFLOW_FORCE.
Test that safety mechanisms work: