Skip to content

Idea to Shipping

This guide walks through building SpendSense, a personal finance categorizer, from initial idea to deployed app. You’ll see how LumenFlow structures AI-assisted development, enabling any coding agent to understand and execute your project.

SpendSense — a local-first personal finance app that:

  • Imports transactions from CSV (bank exports)
  • Auto-categorizes spending using a rules engine
  • Learns from your corrections
  • Shows monthly spending dashboards

This isn’t a trivial example. Building it requires research into transaction categorization, financial data patterns, and local-first architecture — perfect for showcasing LumenFlow’s structured approach.

Before writing code, validate your idea and make key technical decisions. Use your preferred AI tool (Claude, GPT, etc.) for market research and technical discovery.

  • Categorization: How do banks categorize transactions? (MCC codes, merchant matching)
  • Data Sources: Financial APIs (Plaid, Teller) vs CSV import — what’s the MVP scope?
  • Patterns: Rule-based matching vs ML classification — which handles 80% of cases?
  • Security: How to handle financial data safely? (local-first, no credential storage)

Your research crystallizes into a product brief — the source of truth for everything that follows.

# SpendSense - Personal Finance Categorizer

## Problem

Manual transaction categorization is tedious. Bank categories are inconsistent.

## Research Findings

- MCC (Merchant Category Codes) provide baseline categorization
- Rule-based matching (merchant name → category) handles 80% of cases
- ML needed only for ambiguous merchants
- Start with CSV import, add Plaid later (reduces initial scope)

## MVP Features

1. CSV transaction import (bank export format)
2. Auto-categorization via rules engine
3. Manual override with learning
4. Monthly spending dashboard

## Technical Decisions

- Stack: Next.js + SQLite (local-first, no cloud dependency)
- No auth in MVP (local file storage)
- Categories: Standard set (Groceries, Transport, etc.) + custom user categories

Create your project and initialize LumenFlow.

mkdir spendsense && cd spendsense
git init
pnpm create next-app . --typescript --tailwind --app
pnpm add -D @lumenflow/cli
pnpm exec lumenflow --client claude --full

Option B: Existing Project or Non-Empty Directory

Section titled “Option B: Existing Project or Non-Empty Directory”

When create-next-app fails because your directory is not empty, use a temp directory:

# 1. Create Next.js app in a temp directory
pnpm create next-app /tmp/nextjs-scaffold --typescript --tailwind --app

# 2. Merge the scaffolding into your existing project
cp -rn /tmp/nextjs-scaffold/* .
cp -rn /tmp/nextjs-scaffold/.* . 2>/dev/null || true

# 3. Install dependencies and initialize LumenFlow
pnpm install
pnpm add -D @lumenflow/cli
pnpm exec lumenflow --client claude --full

# 4. Clean up
rm -rf /tmp/nextjs-scaffold
FileYou Use It ForAgents Use It For
AGENTS.mdReference docsEntry point — first file any agent reads
CLAUDE.mdReference docsClient-specific instructions, skills, hooks
.lumenflow.config.yamlConfigure lanes, gatesLane definitions, gate commands to run
.lumenflow/constraints.mdUnderstand rulesNon-negotiable constraints to follow
docs/.../backlog.mdTrack work visuallyFind ready WUs to claim

This is the magic moment. Drop PRODUCT_BRIEF.md into your project and ask your agent:

“Read PRODUCT_BRIEF.md and create a LumenFlow initiative with WUs organized into phases: Foundation, Categorization Engine, UI, Polish.”

  1. Reads PRODUCT_BRIEF.md — extracts requirements, technical decisions, and MVP scope

  2. Creates an Initiative — the container for related work

    pnpm initiative:create --id INIT-001 --slug spendsense-mvp --title "SpendSense MVP"
  3. Generates Work Units — each with full specs the agent (or another agent) can execute

# WU-001.yaml - What the agent generates
id: WU-001
title: Set up SQLite schema for transactions
lane: 'Framework: Core'
type: feature
status: ready
initiative: INIT-001
phase: 1
description: |
  Create the database schema for storing imported transactions.
  Reference: PRODUCT_BRIEF.md#technical-decisions
acceptance:
  - Transaction table with: id, date, amount, description, merchant, category
  - Category table with: id, name, parent_id (for hierarchy)
  - Indexes on date and category for dashboard queries
code_paths:
  - src/lib/db/schema.ts
  - src/lib/db/migrations/
test_paths:
  unit:
    - src/lib/db/__tests__/schema.test.ts
WUTitleLanePhase
WU-001SQLite schema for transactionsFramework: Core1
WU-002CSV parser for bank formatsFramework: Core1
WU-003Rule-based categorization engineFramework: Core2
WU-004Category learning from correctionsFramework: Core2
WU-005Transaction list with filtersExperience: UI3
WU-006Monthly spending dashboardExperience: UI3
WU-007Import flow wizardExperience: UI3
WU-008Error handling and edge casesFramework: Core4
WU-009Deploy to VercelOperations: Infra4

Now execute the roadmap. You can work WU-by-WU, or orchestrate parallel execution across lanes.

pnpm wu:claim --id WU-001 --lane "Framework: Core"
# Agent is now in worktrees/framework-core-wu-001
  1. Worktree created — isolated git branch, no conflicts with main

  2. Agent reads WU YAML — knows exactly what to build, where to put it

  3. Loads relevant skills/skill tdd-workflow for test-first approach

  4. Implements against acceptance criteria — each criterion becomes a checklist item

  5. Runs gatespnpm wu:prep --id WU-001 validates format, lint, types, tests

  6. Completespnpm wu:done --id WU-001 merges to main, creates completion stamp

For larger initiatives, orchestrate multiple agents working in parallel:

# Preview the execution plan
pnpm orchestrate:initiative --initiative INIT-001 --dry-run

Output:

Wave 0: WU-001, WU-002 (parallel - no dependencies)
Wave 1: WU-003, WU-004 (depends on Wave 0)
Wave 2: WU-005, WU-006, WU-007 (depends on Wave 1)
Wave 3: WU-008, WU-009 (depends on Wave 2)

Agents don’t work in isolation. The memory layer enables coordination:

# Agent signals progress
pnpm mem:signal "Schema complete, ready for review" --wu WU-001

# Other agents (or you) check inbox
pnpm mem:inbox --since 1h

Once all WUs complete, verify and deploy:

# Check initiative completion
pnpm initiative:status --id INIT-001

# All stamps present = all WUs done
ls .lumenflow/stamps/
# WU-001.done  WU-002.done  WU-003.done ...

# Deploy
npx vercel

From the agent’s perspective, here’s what it consumed and how:

What Agent ReadWhat Agent Did
AGENTS.mdUnderstood project workflow, found entry points
PRODUCT_BRIEF.mdExtracted requirements, generated WUs
WU-001.yamlKnew scope, paths, acceptance criteria
.lumenflow.config.yamlUnderstood lanes, ran correct gate commands
/skill tdd-workflowApplied test-first methodology
pnpm wu:prep outputFixed issues before completion
.lumenflow/stamps/Verified dependencies before proceeding

This is the power of LumenFlow: structured context that any agent can consume.

Structured Chaos

LumenFlow turns a product brief into executable work units. No more “where do I start?” — the roadmap is generated.

Agent-Native

AGENTS.md + WU YAML = agents understand your project without special prompting. Works with any AI coding assistant.

Parallel by Default

Worktree isolation + lane separation = safe concurrent execution. Multiple agents, no conflicts.

Gates as Guardrails

Agents can’t merge broken code. Format, lint, typecheck, and tests run before completion.

Coordination Built-In

Memory layer + stamps = agents know what’s done and what’s blocked. Handoffs happen automatically.