Skip to content

Quickstart (Agents)

You are here to set up LumenFlow. That is your only job in the setup phase.

  • ✅ Initialize LumenFlow in this repo
  • ✅ Create an Initiative if the user provided a vision doc or multi-phase plan
  • ✅ Complete lane lifecycle and create the first Work Unit (WU)
  • ✅ Stop and hand off
  • ❌ Do not implement features
  • ❌ Do not write schemas/models/components
  • ❌ Do not refactor or optimize code
  • ❌ Do not scaffold project templates (Next.js/Vite/etc.) during setup. If the user wants a stack, create a WU after setup.
  • ❌ Do not ask the user to choose templates/frameworks during setup. Ask only for client type; defer stack choices to a WU.
  • ❌ Do not proceed past setup without explicit user approval
  1. LumenFlow installed and activated. CLI installed; pnpm lumenflow --client <client> completed; pnpm wu:create --help works.
  2. LumenFlow enforced. Run pnpm lumenflow:doctor; errors are blockers. Work happens only in claimed WUs; no edits on main; gates run before wu:done.
  3. Lane lifecycle configured. Run pnpm lane:setup, pnpm lane:validate, pnpm lane:lock before first delivery WU.
  4. Next step chosen with the user. Create one of: Discovery WU, concrete task WU, or Initiative for multi-phase vision. Stop after selection.

Supported clients: claude, cursor, windsurf, codex, cline, aider, all, none

If you don’t know the user’s client, ask before running init. If their client isn’t listed, use --client none for generic files only.

lumenflow init automatically scaffolds scripts/safe-git and .husky/pre-commit. If doctor still reports errors:

  1. Check if Husky is installed: Run pnpm add -D husky && pnpm exec husky if missing
  2. Check node_modules: Run pnpm install to ensure dependencies are set up
  3. Read the specific error message: Doctor explains what’s wrong and how to fix it

If errors persist after these steps, ask the user for help. Do not proceed to work until doctor passes.

Lane overlap warnings: Informational only. Do not edit workspace.yaml manually during setup.

Use this ladder after setup:

  1. Multi-phase vision or roadmap → Create an Initiative first, then a Discovery WU to translate it into a small backlog.
  2. Clear single task → Create one concrete WU for that task.
  3. Unclear or exploratory → Create a Discovery WU: “Define next steps after LumenFlow setup.”
  4. Tech stack or scaffolding request → Create a WU: “Set up <stack> after LumenFlow setup.”

Stop after creating the next artifact. Do not claim a WU without explicit approval.

If the user says the project is multi-phase or shares a vision doc, create an Initiative before any WU:

pnpm initiative:create \
  --id INIT-001 \
  --slug "project-name" \
  --title "Project Name" \
  --owner "team@example.com"

pnpm initiative:edit --id INIT-001 --add-phase "Phase 1: MVP"
pnpm initiative:edit --id INIT-001 --add-phase "Phase 2: Core"

If a command is not listed here, do not run it during setup. If you are unsure about a command, run <command> --help first. Do not guess.

CommandPurpose
node --versionVerify toolchain (require ≥22)
pnpm --versionVerify toolchain (require ≥9)
git --versionVerify toolchain (require ≥2)
git initNew project only
pnpm initOnly if no package.json and user approved
pnpm add -D @lumenflow/cliInstall LumenFlow CLI
pnpm lumenflow --client <client>Initialize LumenFlow (new repos)
pnpm lumenflow --client <client> --mergeInitialize LumenFlow (existing repos)
pnpm lumenflow:doctorVerify enforcement (errors block)
pnpm lumenflow:doctor --deepOptional: extended WU validation
pnpm wu:create --helpVerify scripts were injected
pnpm lumenflow:integrate --client claude-codeRegenerate enforcement hooks (auto-run by init)
pnpm initiative:create ...Create an initiative
pnpm initiative:edit ...Add initiative phases
pnpm lane:setupCreate/update draft lane artifacts
pnpm lane:validateValidate lane artifacts
pnpm lane:lockLock lane lifecycle for WU creation
pnpm lane:statusCheck lane lifecycle status
pnpm wu:create ...Create first WU
pnpm wu:status --id WU-XXXConfirm WU status
pnpm wu:claim --id WU-XXX --lane "..."Only if user explicitly says “proceed”
git add -A && git commit -m "..."Commit scaffold/LumenFlow setup only

Read-only commands allowed: pwd, ls, cat, rg, git status.

If a script command is not found, rerun pnpm lumenflow:commands and use the current documented command instead of guessing older executable aliases.

  1. Verify toolchain

    node --version   # Requires ≥22
    pnpm --version   # Requires ≥9
    git --version    # Requires ≥2

    If any version is below minimum, stop and inform the user.

  2. Initialize the repo (only if empty)

    git init
  3. Ensure package.json exists

    If there is no package.json, create one. LumenFlow needs it to install the CLI and register scripts.

    pnpm init
  4. Scaffold a tech stack only if the user explicitly asked

    Keep this minimal. Do not add feature code.

    pnpm create next-app@latest . --typescript --tailwind --eslint --app --yes
    # or: pnpm create vite@latest . --template react-ts
    # or: pnpm create astro@latest . --template minimal

    If you scaffolded, commit the baseline:

    git add -A && git commit -m "chore: initial scaffold"
  5. Install LumenFlow

    pnpm add -D @lumenflow/cli
  6. Initialize LumenFlow

    pnpm lumenflow --client claude
    # or: pnpm lumenflow --client codex
    # or: pnpm lumenflow --client cursor
    # or: pnpm lumenflow --client windsurf
    # or: pnpm lumenflow --client cline
    # or: pnpm lumenflow --client aider
    # or: pnpm lumenflow --client none  # generic files only

    This is the canonical bootstrap-all path. It writes workspace.yaml and bootstraps Software Delivery settings under workspace.yaml > software_delivery.

    software_delivery:
      gates:
        minCoverage: 90

    Treat this as a shape reference for the generated config. Manage it through the CLI and init flow; do not hand-edit workspace.yaml during setup.

  7. Verify scripts were injected

    pnpm wu:create --help
  8. Commit LumenFlow setup

    git add -A && git commit -m "chore: add lumenflow"
  9. Create initiative (only if a vision doc exists)

    pnpm initiative:create \
      --id INIT-001 \
      --slug "project-name" \
      --title "Project Name" \
      --owner "team@example.com"
    
    pnpm initiative:edit --id INIT-001 --add-phase "Phase 1: Foundation"
    pnpm initiative:edit --id INIT-001 --add-phase "Phase 2: Core Features"

    Optional: connect the workspace to LumenFlow Cloud after bootstrap.

    pnpm cloud:connect \
      --endpoint https://control-plane.example.com \
      --org-id <org-id> \
      --project-id <project-id> \
      --token-env LUMENFLOW_CONTROL_PLANE_TOKEN
  10. Configure lane lifecycle

    pnpm lane:setup
    pnpm lane:validate
    pnpm lane:lock
  11. Create the first WU (do not implement)

    pnpm wu:create \
      --lane "<Lane from workspace.yaml software_delivery.lanes>" \
      --title "<Short task title>" \
      --type feature \
      --exposure backend-only \
      --description "<What this task accomplishes>" \
      --acceptance "<Measurable success criterion>"

    --spec-refs is optional; add it when a plan file exists (e.g., --spec-refs "lumenflow://plans/my-plan.md").

    If you created an initiative, add: --initiative INIT-001.

    Do not claim or implement unless the user explicitly says “proceed”.

  1. Verify toolchain

    node --version   # Requires ≥22
    pnpm --version   # Requires ≥9
    git --version    # Requires ≥2

    If any version is below minimum, stop and inform the user.

  2. Install LumenFlow

    pnpm add -D @lumenflow/cli
  3. Initialize with merge mode

    pnpm lumenflow --client claude --merge
    # Supported: claude, cursor, windsurf, codex, cline, aider, none

    Merge mode still uses bootstrap-all semantics and keeps workspace.yaml as canonical config.

  4. Verify scripts were injected

    pnpm wu:create --help
  5. Commit LumenFlow setup

    git add -A && git commit -m "chore: add lumenflow"
  6. Create initiative (optional)

    If the user provided a vision doc or multi-phase plan:

    pnpm initiative:create \
      --id INIT-001 \
      --slug "project-name" \
      --title "Project Name" \
      --owner "team@example.com"
  7. Configure lane lifecycle

    pnpm lane:setup
    pnpm lane:validate
    pnpm lane:lock
  8. Create the first WU (do not implement)

    pnpm wu:create \
      --lane "<Lane from workspace.yaml software_delivery.lanes>" \
      --title "<Short task title>" \
      --type feature \
      --exposure backend-only \
      --description "<What this task accomplishes>" \
      --acceptance "<Measurable success criterion>"

    If you created an initiative, add: --initiative INIT-001.

    Do not claim or implement unless the user explicitly says “proceed”.

    After setup is complete, do not create or modify any files (including notes or docs). The only allowed actions are creating an Initiative/WU and asking clarifying questions. Any real work must happen inside a claimed WU.

Copy this template and fill in the values:

## Setup Complete - Handoff

Note: The commands below are for the agent to run in a later session (not the user).

### Current State

- LumenFlow initialized: Yes
- Initiative: INIT-001 "Project Name" (if created)
- Current WU: WU-0001 "Your task title" (created, not claimed)
- Repo: /path/to/repo

### Next Session Instructions

1. Read `LUMENFLOW.md` in the project root
2. Check status: `pnpm wu:status --id WU-0001`
3. If user confirms, claim WU: `pnpm wu:claim --id WU-0001 --lane "..."`
4. Enter worktree: `cd worktrees/<lane>-wu-0001`
5. Implement the WU acceptance criteria
6. Run gates: `pnpm wu:prep --id WU-0001`
7. Complete (from main): `pnpm wu:done --id WU-0001`

After setup is complete, do **not** create files or folders on main. If the user
shares new material (docs, specs, notes), capture it in the WU description and
save it only after the WU is claimed and the worktree is active.

### Critical Rules

- ALL implementation work happens in WUs
- NEVER edit files on main branch
- NEVER manually edit WU YAML files
- ALWAYS run `wu:done` to complete work

These actions will break the workflow.

Do NotInstead
Work on main branchWork in a worktree after wu:claim
Manually create WU YAML filesUse pnpm wu:create
Manually edit WU YAML statusUse pnpm wu:block, pnpm wu:unblock, or pnpm wu:release
Use git worktree add directlyUse pnpm wu:claim
Run wu:done from a worktreeRun from main checkout
Use --no-verify to skip hooksFix hook failures properly
Manually edit backlog.md or status.mdLet CLI regenerate from state
Manually edit workspace.yamlUse CLI commands and lumenflow-doctor
Run pnpm init by defaultOnly if user requested a bare Node project
Run pnpm lumenflow:doctorUse pnpm lumenflow:doctor
Fix enforcement without approvalAsk, then apply explicit fixes if approved
Ask more than 2 setup questionsUse defaults; ask only essential questions
Ask user to choose templates/frameworksAsk only for client; defer stack choices to WU
Scaffold a tech stack during setupCreate a WU after setup, then scaffold
Create files/folders after setupOnly create files inside a claimed WU
Save user-provided docs during setupCapture in WU, save in worktree after claim
Write feature code before a WU existsCreate a WU first
Continue after setupStop, hand off, and wait

All work flows through WUs and Initiatives only:

  1. pnpm wu:create
  2. pnpm wu:claim → enter worktree
  3. Implement acceptance criteria
  4. pnpm wu:prep
  5. pnpm wu:done

If a user asks for work outside a WU, create a WU first and wait for approval.