Existing Projects
Adding LumenFlow to an existing project takes about 15 minutes. This guide walks through the process without disrupting your current workflow.
Prerequisites
Section titled “Prerequisites”Before starting:
- Git repository (any platform)
- Node.js 22+ (for CLI)
- Understanding of Work Units and Gates
Quick Overview
Section titled “Quick Overview”LumenFlow adds:
workspace.yaml- Configuration fileLUMENFLOW.md- Workflow entry point.lumenflow/- State and constraintsdocs/tasks/- WU specs and backlog (optional)- Git hooks for enforcement (optional)
It does not require:
- Changing your existing code structure
- Migrating existing tickets immediately
- Modifying CI/CD pipelines (optional enhancement)
- Team-wide adoption at once
Installation Methods
Section titled “Installation Methods”Full Setup with CLI
Section titled “Full Setup with CLI”The CLI provides the fastest path to adoption.
-
Install the CLI
bash pnpm add -D @lumenflow/clibash npm install -D @lumenflow/cli -
Initialize LumenFlow
Answer the prompts or use flags for non-interactive setup:
Agent onboarding docs are included by default. Use
--minimalto skip them.Adding to existing config files? Use
--mergemode to safely insert LumenFlow configuration into your existingAGENTS.mdor other files without overwriting your content:The merge mode uses bounded markers (
<!-- LUMENFLOW:START -->and<!-- LUMENFLOW:END -->) to safely insert and update the LumenFlow block. Running--mergetwice produces no changes on the second run (idempotent).Using a specific AI coding tool? There is no
--client/--vendorflag any more —pnpm lumenflowalways scaffolds the same universal surfaces (AGENTS.md,LUMENFLOW.md,.lumenflow/skills/,workspace.yaml) for every project, regardless of which AI tool you use. Point your tool at those files directly, or adapt them into your tool’s own config/rules/ instruction mechanism yourself — see AI Coding Assistant Integrations for how. -
Review generated files
The init command creates (agent onboarding docs are now included by default):
- workspace.yaml (your configuration) - LUMENFLOW.md (workflow entry point) - AGENTS.md (universal AI agent entry point) - .lumenflow/ - constraints.md (non-negotiable rules) - agents/ (AI agent guidance) - docs/tasks/ - backlog.md - status.md - wu/ (WU spec directory) - _frameworks/lumenflow/agent/onboarding/ - quick-ref-commands.md (CLI command reference) - first-wu-mistakes.md (common pitfalls) - troubleshooting-wu-done.md (wu:done issues) - agent-safety-card.md (safety reference)
Use
--minimalto skip agent onboarding docs if you want a lighter setup.lumenflow initno longer creates any vendor-specific overlay files (noCLAUDE.md,.cursor/,.windsurf/, etc.) — the universal surfaces above are all that get scaffolded. Adapt them into your own AI tool’s native format yourself; see AI Coding Assistant Integrations. -
Add scripts to package.json
-
Git hooks (auto-scaffolded)
lumenflow initautomatically creates.husky/pre-commit(blocks main commits) andscripts/safe-git(blocks dangerous git operations). To also run gates on commit:
Manual Setup (No CLI)
Section titled “Manual Setup (No CLI)”If you prefer not to use the CLI or are using a non-Node.js project.
-
Create configuration file
Create
workspace.yamlin your repo root: -
Create LUMENFLOW.md
-
Create directory structure
-
Create backlog.md
-
Create your first WU
Create
docs/tasks/wu/WU-001.yaml:
Mapping Existing Structure
Section titled “Mapping Existing Structure”Your Gates Are Already There
Section titled “Your Gates Are Already There”Most projects already have the tools LumenFlow gates run. Map them:
| Gate | Your Existing Command | LumenFlow Config |
| --------- | --------------------- | --------------------------- |
| Format | npm run prettier | gates.execution.format |
| Lint | npm run eslint | gates.execution.lint |
| Typecheck | npm run tsc | gates.execution.typecheck |
| Test | npm test | gates.execution.test |
Example mapping:
Your Branches Map to Lanes
Section titled “Your Branches Map to Lanes”If you have team branches or areas:
| Current Branches | LumenFlow Lanes |
| ------------------------- | ---------------------------- |
| feature/*, frontend-* | Experience: UI |
| api/*, backend-* | Framework: Core |
| infra/*, devops-* | Operations: Infrastructure |
| docs/* | Content: Documentation |
Your PRs Map to WUs
Section titled “Your PRs Map to WUs”Each pull request or ticket becomes a Work Unit:
| PR/Ticket Field | WU Field |
| --------------- | -------------- |
| Title | title |
| Description | description |
| Labels | lane, type |
| Acceptance | acceptance |
| Assignee | assigned_to |
Gradual Adoption Path
Section titled “Gradual Adoption Path”You don’t need to migrate everything at once.
Week 1: Shadow Mode
Section titled “Week 1: Shadow Mode”Run LumenFlow alongside existing workflow:
- Install and configure
- Create WUs for new work only
- Keep using existing tickets for in-progress work
- Run gates manually to test
Week 2-3: Parallel Operation
Section titled “Week 2-3: Parallel Operation”- New work starts as WUs
- Existing PRs complete normally
- When a PR completes, optionally create a retroactive WU for history
- Team familiarizes with commands
Week 4+: Full Adoption
Section titled “Week 4+: Full Adoption”- All new work uses WUs
- Close out ticket system (or keep for roadmap/epics)
- Enable git hooks (auto-scaffolded by
lumenflow init)
Coexistence Strategies
Section titled “Coexistence Strategies”Keep External Roadmap
Section titled “Keep External Roadmap”LumenFlow handles execution. Keep your roadmap tool:
Link them:
Hybrid Team Adoption
Section titled “Hybrid Team Adoption”Not everyone needs to adopt simultaneously:
| Role | Adoption Level | | --------------- | ---------------------------- | | AI Agents | Full LumenFlow (required) | | Backend Team | Full LumenFlow (recommended) | | Frontend Team | Gradual adoption | | Product Manager | Continues using roadmap tool |
Existing CI/CD
Section titled “Existing CI/CD”LumenFlow gates can run in CI without replacing your existing pipeline:
Re-running init to backfill missing entries
Section titled “Re-running init to backfill missing entries”Running lumenflow init on a repo that already has LumenFlow files is safe. For the
.gitignore specifically, init checks each entry in REQUIRED_GITIGNORE_EXCLUSIONS
against the existing file and appends only the missing ones under a
# LumenFlow (auto-added) header. No existing entries are modified or duplicated.
This is useful after upgrading @lumenflow/cli when new ephemeral paths have been added
to the exclusion list. For example, if your .gitignore is missing entries for
.lumenflow/checkpoints/ or .lumenflow/locks/, re-running init will add them:
Ignore rules do not untrack files that are already in the index. Audit the local kernel tree first,
then remove only the runtime paths you deliberately selected from the index. --cached preserves
the local files:
Repeat init or upgrade and this audit inside every independent nested Git repository; a parent repository’s ignore rules never apply across that boundary.
Treat .lumenflow/kernel/ as sensitive operational state. For a complete recoverable backup, stop
and drain every runtime using the workspace, then capture the whole tree coherently. Never copy the
active SQLite database alone: its WAL may contain committed pages and the surrounding task specs,
migration state, and evidence are part of the recovery point. The -shm sidecar is transient and
stale lock files are not restore payloads. SQLite’s Online Backup API or VACUUM INTO is suitable
only for an explicitly database-only copy; it does not freeze the rest of the runtime tree.
Common Concerns
Section titled “Common Concerns””We have hundreds of open tickets”
Section titled “”We have hundreds of open tickets””You don’t need to migrate them. Options:
- Ignore old tickets - Start fresh with WUs for new work
- Migrate incrementally - Convert tickets as you work on them
- Bulk migrate - Script conversion of existing tickets to WU YAML
”Our team isn’t ready for trunk-based development”
Section titled “”Our team isn’t ready for trunk-based development””LumenFlow supports gradual transition:
- Start with worktrees (isolated, like feature branches)
- Gates run in worktrees, merge when passing
- This feels like PRs but with automated quality
”We need code review”
Section titled “”We need code review””LumenFlow doesn’t eliminate review, it changes when:
- Gates replace mechanical review (format, lint, types, tests)
- Human review for security, architecture, judgment calls
”Our tests are slow”
Section titled “”Our tests are slow””Use gate presets with test splitting:
Or run fast tests in gates, slow tests in CI.
Verification
Section titled “Verification”After setup, verify everything works:
Next Steps
Section titled “Next Steps”- Solo Developer Workflow - Simpler setup for individuals
- Team Workflow - Team-specific practices
- CLI Reference - Full command documentation