← Back to Projects

Autonomous SaaS Builder

Autonomous Build Pipeline · Proof of Concept

A 7-agent autonomous build loop that incrementally constructed a SaaS prototype over 146 cycles — each cycle planning a feature, writing the code, running QA, and self-deploying. The result: a working proof-of-concept trucking business management app with auth, subscriptions, AI receipt scanning, and 27 shipped features — built without manual coding. This is a prototype demonstrating the pipeline, not a production product.

Agent 1
Planner
Reads project memory and decides the next feature to build
Agent 2
Builder
Implements the feature in Next.js 14 + TypeScript, end-to-end
Agent 3
Validator
Runs TypeScript checks and a full production build to catch errors
Agent 4
QA
Writes and runs Playwright end-to-end tests against the live app
Agent 5
Evaluator
Reviews quality, decides pass/fail, marks feature complete
Agent 6
Journalist
Writes a structured log of what was built and why
Agent 7
State Writer
Updates project_memory.json so the next cycle picks up correctly
TruckerFlow v7
Live Prototype
Next.js 14 · PostgreSQL · Stripe (test mode) · 27 features · 146 build cycles
A trucking business management SaaS for owner-operators — log loads and expenses, see real P&L, scan receipts with AI, generate IFTA reports, and project income. Full auth, subscriptions, and data export included.
Demo account — pre-loaded with realistic trucking data
Email: demo@truckerflow.com   Password: demo
Trip & expense tracking with cost-per-mile calculations
AI receipt scanner — snap a photo, data fills automatically
IFTA mileage report generation
Income projection calculator with break-even rate
Stripe subscription billing (test mode, no real charge)
Two-factor authentication, forgot password, email verification

Project Overview

TruckerFlow is an experiment in autonomous software construction. Instead of building the app manually, I designed a multi-agent loop where seven Claude Code agents collaborate in sequence — one plans, one builds, one validates, one tests, one evaluates, one documents, and one updates shared state — and the loop repeats, adding one feature per cycle.

Over 146 cycles, the pipeline grew the app from a blank Next.js scaffold into a working prototype with authentication, Stripe subscriptions, AI-powered document scanning, IFTA reporting, two-factor auth, data export, and more. No feature was written by hand. The agents made architectural decisions, wrote database schemas, implemented API routes, built UI components, and fixed their own bugs through QA feedback loops.

This is a prototype and proof of concept, not a production product. The goal was to answer a specific question: can a well-structured agentic pipeline produce genuinely usable software — not just scaffolding or toy code? The answer is yes, with bugs, with rough edges, and with the right prompt architecture. The pipeline itself is the project; the app is the evidence it worked.

What This Demonstrates

Engineering Decisions

  • Scoped each agent to a single responsibility — preventing context overflow and making failures recoverable without rerunning the full cycle
  • Used project_memory.json as a persistent state file so each cycle correctly inherits everything the previous cycles built, across separate Claude sessions
  • Chose Next.js output: 'standalone' mode so the build artifact is fully self-contained and deployable with a single pm2 restart
  • Designed the QA agent to write its own Playwright tests per feature rather than maintain a fixed test suite — tests evolve with the app automatically
  • Separated the Validator (build-time errors) from the Evaluator (quality judgment) so a green build doesn't automatically mean a complete feature
  • Used NextAuth v5 with a custom basePath to serve the app at a subpath of a shared VPS, avoiding the need for a dedicated server

Problem-Solving Process

  1. Prompt architecture first: Spent time defining the 7-agent contract — what each agent reads, what it writes, and what constitutes success — before writing any app code
  2. State machine over scripts: Built the loop as a bash state machine with a paused file and blockers log, so the pipeline can be stopped and restarted without data loss
  3. Feedback loops: If the QA agent fails, the Evaluator marks the feature incomplete and the Planner re-queues it next cycle — no human intervention needed to recover from a failed build
  4. Prompt specificity: Each agent prompt includes the full current app state summary, the project memory, and explicit output contracts — reducing hallucination and ensuring consistent decisions across 146 cycles
  5. Production-first mindset: The Builder agent was instructed to write production-quality code from the start — real error handling, real database transactions, real auth patterns — not prototype shortcuts

Professional Outcome

  • Working prototype with 27 shipped features across auth, billing, AI, reporting, and mobile — built entirely by the agent pipeline
  • Practical experience designing multi-agent systems with state management, failure recovery, and QA gating
  • Deep understanding of Next.js App Router, standalone deployment, and subpath hosting in production
  • Demonstrates ability to design agentic pipelines that produce real, deployable software — and honest understanding of where prototype quality ends and production hardening begins

Key Features

Trip & Expense Tracking

Log loads and expenses in seconds. Automatic cost-per-mile, revenue-per-mile, and net income calculated from real records — not estimates.

AI Receipt Scanner

Snap a photo of a fuel receipt or invoice. Claude extracts vendor, amount, date, and category automatically — no manual data entry.

Settlement & Bank Import

Upload a carrier settlement PDF or bank statement CSV. The app parses line items and maps them to expenses without a fixed template.

IFTA Reports & P&L

Quarterly IFTA mileage reports by state, monthly P&L breakdowns, and a customizable dashboard of widgets built from the user's own data.

Income Projection Calculator

Project monthly and per-load profitability with adjustable cost rows. Shows the minimum rate per mile needed to break even before accepting a load.

Full Auth & Subscriptions

NextAuth v5 with credentials, 2FA via email OTP, forgot password, and Stripe subscription billing with trial, monthly, and annual plans.

How It Works

A bash state machine (saas-run.sh) drives the loop. Each cycle, it invokes all seven Claude Code agents in sequence, passing the current app directory and project memory to each. The loop is controlled by a paused file and a blockers.json log — if an agent encounters something it can't resolve, it writes a blocker and the cycle stops cleanly for human review.

  1. Planner: Reads project_memory.json (features complete, features pending, current phase) and decides the next feature. Outputs a brief spec to a cycle_plan.md file.
  2. Builder: Reads the cycle plan and the existing codebase, then implements the feature end-to-end — schema migrations, API routes, server components, client components, and any required config changes.
  3. Validator: Runs tsc --noEmit and npm run build. If either fails, it attempts to fix the errors before passing control to QA. Writes a build report.
  4. QA: Writes Playwright tests for the new feature and runs them against the live app at localhost:3007. Records pass/fail results and any regressions in other features.
  5. Evaluator: Reviews the QA results and the built feature against the cycle plan. Marks the feature as complete or incomplete, with a quality note.
  6. Journalist: Writes a structured entry to the build log — what was built, what decisions were made, what tests passed.
  7. State Writer: Updates project_memory.json — moves the feature from pending to complete, increments the cycle counter, records the timestamp.

After the State Writer completes, the loop either starts the next cycle immediately (if a timer-based scheduler is active) or waits for the next scheduled run via systemd.

Tech Stack

Next.js 14 TypeScript React 18 Tailwind CSS NextAuth v5 Prisma ORM PostgreSQL Stripe Claude AI (Anthropic) Resend (Email) Playwright pm2 Caddy Bash Ubuntu VPS

Skills Demonstrated

  • Multi-agent autonomous system design with state machine, failure recovery, and QA gating
  • Prompt engineering for iterative, stateful code generation across 146 separate Claude sessions
  • Full-stack Next.js 14 — App Router, server components, API routes, standalone deployment
  • Production auth patterns: NextAuth v5, 2FA, JWT, secure session management
  • Stripe integration: subscriptions, webhooks, trial periods, billing portal
  • AI feature integration: Anthropic Claude for receipt and document parsing
  • Linux server administration: systemd, pm2, Caddy reverse proxy, HTTPS, subpath routing
  • Independent end-to-end product delivery — architecture, build pipeline, and production deployment