Software Delivery Pack onboarding
This guide covers agent onboarding for the Software Delivery
Pack . The commands, safety mechanisms, and WU lifecycle
described here are pack-specific tools that operate through the kernel .
This guide helps AI agents get productive with LumenFlow quickly, covering common mistakes and essential safety practices.
Before starting any WU:
For a fresh setup, use one command:
pnpm onboard --yes --domain software-delivery
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.
Confusion about scope - Agent thinks completion is a “next step” for humans
Fear of overstepping - Agent hesitates to take “final” actions
Token limits - Agent runs out of context and summarizes remaining steps
Missing context - Agent doesn’t realize wu:done should run immediately
After wu:prep passes, you MUST run:
cd /path/to/main
pnpm wu:done --id WU-XXX
Do NOT:
Ask “Should I run wu:done?”
Write “To Complete: pnpm wu:done”
Wait for permission
Treat it as a “future step”
# 1. In worktree, run gates via wu:prep
pnpm wu:prep --id WU-XXX
# 2. If wu:prep passes, return to main
cd /path/to/main
# 3. IMMEDIATELY run wu:done
pnpm wu:done --id WU-XXX
# 4. Report success with the wu:done output
Wrong:
# Working directly in main
vim src/feature.ts
git commit -m "feat: add feature"
git push origin main
Right:
# Claim first, then work in worktree
pnpm wu:claim --id WU-123 --lane Core
cd worktrees/core-wu-123
vim src/feature.ts
git commit -m "feat: add feature"
git push origin lane/core/wu-123
cd /path/to/main
pnpm wu:done --id WU-123
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:
1. Write the feature
2. Maybe write tests later
3. Tests are hard, skip them
Right:
1. Write failing test
2. Run test (confirm RED)
3. Write minimum code
4. Run test (confirm GREEN)
5. Refactor if needed
Wrong:
git reset --hard HEAD
git push --force
git commit --no-verify
Right:
git add .
git commit -m "feat: description"
git push origin lane/core/wu-123
The WU says “Add user profile endpoint” but you also:
Refactor the database schema
Add email notifications
Redesign the UI
Fix: Implement exactly what the acceptance criteria specify. Create new WUs for other changes.
Wrong: Start coding immediately based on the title.
Right:
Read the full WU YAML
Understand acceptance criteria
Review code_paths
Check dependencies
Then start
Wrong:
pnpm wu:claim --id WU-123 --lane Core
# Still in main directory
vim src/feature.ts # WRONG!
Right:
pnpm wu:claim --id WU-123 --lane Core
cd worktrees/core-wu-123 # IMMEDIATELY
vim src/feature.ts # Now it's safe
Wrong:
Gates failed but I think the code is fine.
Let me use --skip-gates.
Right:
Gates failed. Let me read the error:
- TypeScript error in src/api/handler.ts
- Missing return type
Fix: Add the return type.
Re-run: pnpm wu:prep --id WU-123
If you need to pause:
# Commit your work
git add .
git commit -m "wip: partial progress"
git push origin lane/core/wu-123
Do NOT leave uncommitted changes in the worktree.
Wrong:
// Using absolute paths bypasses worktree isolation
Write ({
file_path : '$HOME/project/src/feature.ts' , // WRONG!
content : '...' ,
});
Right:
// Relative paths respect worktree context
Write ({
file_path : 'src/feature.ts' , // Correct
content : '...' ,
});
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:
# Use the safe wrapper
./scripts/safe-git status
./scripts/safe-git commit -m "feat: add feature"
# These are blocked automatically:
./scripts/safe-git worktree remove ... # BLOCKED
./scripts/safe-git reset --hard # BLOCKED
./scripts/safe-git clean -fd # BLOCKED
./scripts/safe-git push --force # BLOCKED
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 bypasses
Quick 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 --hardData loss risk git push --forceHistory rewrite --no-verifyBypasses safety git stash (on main)Hides work git clean -fdDeletes 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:
Stop trying
Document what happened
Ask for help
Gate Failures:
Read the error message
Fix the underlying issue
Re-run wu:prep
Never use --skip-gates for new failures
# Check lane availability
cat docs/04-operations/tasks/status.md
# Claim a WU
pnpm wu:claim --id WU-XXX --lane < Lan e >
# Work in worktree
cd worktrees/ < lan e > -wu-xxx
# Run gates in worktree
pnpm wu:prep --id WU-XXX # Code changes
pnpm wu:prep --id WU-XXX --docs-only # Docs changes
# Complete WU
cd /path/to/main
pnpm wu:done --id WU-XXX
Choose the safer path:
Don’t modify files outside code_paths
Don’t bypass hooks
Don’t skip gates
Ask rather than assume
Before ending any session, verify:
If any answer is “no”, you’re not done yet.
If wu:done wasn’t run, you’ll see:
Worktree still exists: ls worktrees/
No stamp: ls .lumenflow/stamps/WU-XXX.done returns nothing
Status unchanged: WU still shows as in_progress
Branch not merged: Changes only on lane branch
If a previous session forgot to run wu:done:
# 1. Check worktree exists
ls worktrees/
# 2. If it does, run wu:done
pnpm wu:done --id WU-XXX
# 3. If worktree was deleted but branch exists
# This is a bad state - may need manual recovery
pnpm wu:recover --id WU-XXX
When you run pnpm wu:done --id WU-XXX (after a successful wu:prep):
Validates the worktree exists and has commits
Fast-forward merges to main
Creates the done stamp
Updates status and backlog docs
Removes the worktree
Pushes to origin
This is the ONLY way to complete a WU. Manual steps leave things inconsistent.
Fixing YAML parsing bugs in WU specs
Emergency production hotfixes (with user present)
Recovering from corrupted workflow state
Bootstrap operations when CLI not yet built
Skipping failing tests
Avoiding code review
Working around gate failures
Convenience or speed
Get user approval - Stop and ask before using LUMENFLOW_FORCE
Execute with audit trail - Use LUMENFLOW_FORCE_REASON and LUMENFLOW_FORCE=1 (see example below)
Document - Add a note to WU YAML explaining the bypass
LUMENFLOW_FORCE_REASON = "user-approved: <reason>" LUMENFLOW_FORCE = 1 git < comman d >
# Bypass safe-git for reset --hard
LUMENFLOW_FORCE_REASON = "user-approved: recovering corrupted state" LUMENFLOW_FORCE = 1 git reset --hard HEAD
# Bypass hook for commit with false positive
LUMENFLOW_FORCE_REASON = "user-approved: false positive secret detection" LUMENFLOW_FORCE = 1 git commit -m "fix: update config"
All bypasses are logged:
ISO_TIMESTAMP|BYPASSED|COMMAND_OR_HOOK|USER|BRANCH|REASON|CWD
To enable management actions and AG-UI run streaming in the web app, configure
runtime access in apps/web/.env.local:
LUMENFLOW_WEB_ENABLE_KERNEL_RUNTIME = 1
LUMENFLOW_WEB_WORKSPACE_ROOT = /absolute/path/to/your/workspace
Then run the web app and verify the runtime is available:
pnpm --filter @lumenflow/web dev
Runtime routes to know:
POST /api/ag-ui/v1/run streams RunAgent SSE output
GET /api/health reports runtime/workspace availability
If runtime is not configured, preview mode returns actionable diagnostics with
the exact env vars above.
Claude Code automatically respects LumenFlow safety through:
CLAUDE.md - Entry point referencing safety rules
.claude/skills/ - Skills include safety context
.claude/agents/ - Agent definitions include constraints
No additional setup required.
Cursor uses .cursor/rules/lumenflow.md for safety rules.
# Initialize with Cursor overlay
lumenflow init --client cursor
Verify: Ask Cursor AI “What are the LumenFlow safety rules?” - it should mention worktree discipline, forbidden git commands, and LUMENFLOW_FORCE.
Windsurf uses .windsurf/rules/lumenflow.md for safety rules.
# Initialize with Windsurf overlay
lumenflow init --client windsurf
Verify: Ask in Cascade “What safety mechanisms does this project use?” - it should mention safe-git wrapper, Husky hooks, and audit logs.
Test that safety mechanisms work:
# Verify safe-git blocks dangerous commands
./scripts/safe-git reset --hard HEAD
# Should show: === LUMENFLOW SAFETY BLOCK ===
# Verify hooks are installed
ls -la .husky/
# Verify bypass works with audit
LUMENFLOW_FORCE_REASON = "testing" LUMENFLOW_FORCE = 1 ./scripts/safe-git --version
# Should succeed and log to .lumenflow/force-bypasses.log