DEV Community

Vlad Zoff
Vlad Zoff

Posted on • Originally published at codapult.dev

I Spent $200 in API Credits Prompting an Agent to Build a Starter. Here’s Why I Still Clone Boilerplates.

Last month I decided to test a simple hypothesis: with top-tier models like Claude Opus 4.8 and GPT-5.6 running inside CLI agents, is the SaaS boilerplate officially dead?

I opened a fresh directory, booted up an agentic loop, and asked it to scaffold a production-ready Next.js 16 app with Better-Auth, Stripe subscriptions, Tailwind v4, and Drizzle ORM.

Three hours and a $180 Anthropic invoice later, I had my answer.


The Brutal Math of Multi-File Context

When people say "AI coding is basically free," they are usually talking about generating a single UI component or a standalone utility function. That costs pennies.

That math completely falls apart the second you ask an agent to build a multi-page architecture across 30+ interconnected files.

Agentic workflows don't just write code—they inspect directory trees, run terminal checks, read type definitions, and edit files across multiple passes. Every time the agent makes a tool call, runs npm run build, or checks why a Server Component failed to re-render, it re-sends the entire repository context back into the model.

Add thousands of reasoning tokens per pass, and a single multi-turn session to wire up auth, session cookies, and Stripe webhooks easily burns through $150 to $300+ in raw API credits.

You are effectively paying AI providers hundreds of dollars to have an agent repeatedly re-invent standard authentication flows from scratch.


The Cohesion Problem: 70+ Modules Don't Just "Prompt" Together

Models like Opus 4.8 and GPT-5.6 are brilliant at generating localized logic. But a production SaaS isn't a collection of isolated files—it is a tightly coupled web of dependencies.

A real foundation requires 70+ modules and 30+ database tables all speaking the exact same language:

  • Auth & Identity: Better-Auth configured for Passkeys, 2FA, SSO, and multi-tenant Organizations.
  • Billing Lifecycles: Webhook handlers for both Stripe and LemonSqueezy, subscription seats, grace periods, and usage metering.
  • System Layer: Admin dashboards, granular RBAC, and i18n localization routing.

When you try to prompt an agent into building this graph from scratch, type drift is inevitable. The database schema slightly diverges from the session middleware; the RBAC checks miss an edge case in server actions; the payment webhooks break when a workspace ID is passed as undefined instead of a string.

Fixing these cross-module integration bugs requires constant back-and-forth prompts, burning through tokens just to get basic features to stop breaking each other.


The Day-2 Infrastructure Trap

Agents excel at building things that run on localhost:3000 via npm run dev. They are notoriously unreliable when preparing code for production infrastructure.

Getting a project ready for production means setting up Infrastructure as Code (IaC):

  • Valid Docker Compose files for local production mirrors.
  • Clean Terraform or Pulumi manifests.
  • Ready-to-deploy Kubernetes Helm charts.
  • Multi-database flexibility, like swapping between PostgreSQL and edge-ready Turso SQLite via an environment variable (DB_PROVIDER).

When you ask an agent to generate valid Helm charts or Terraform manifests alongside app code, it frequently hallucinates configuration keys or outputs outdated syntax. Debugging a failing deployment pipeline through an AI agent can cost $30 to $50 in API compute alone, purely spent fixing minor syntax errors in YAML and HCL files.


AI Code is a Dead-End Fork

Code generated by a prompt session is a static snapshot in time. It has no lineage and no upstream repository.

Six months from now, when Next.js introduces breaking API changes, Tailwind v4 releases a major patch, or security vulnerabilities surface in your auth dependencies, your AI-generated starter becomes instant technical debt. Your only recourse is to feed the whole codebase back into an agent and hope it doesn't break your custom business logic while refactoring.

A purpose-built boilerplate provides a Git upstream remote. When core security patches, framework migrations, or new features drop, you pull them directly with git pull upstream. You own a living codebase backed by an active maintainer, not an unmaintainable single-shot generation.


The Agent Baby-Sitting Tax

Even if API tokens were completely free, there is the time cost.

Current agents are fast, but they aren't autonomous enough for you to write one prompt and walk away while a full application builds itself. You are forced to sit at your terminal baby-sitting the process:

  • Reviewing diffs to make sure the agent didn't mess up Next.js 16's async request APIs (cookies(), headers(), or route params).
  • Approving terminal executions and watching builds fail because a webhook route missed a signature check.
  • Guiding the model through fixing subtle hydration mismatches between server and client states.

If you ever decide to customize the setup mid-build—for instance, removing multi-tenancy while keeping organization billing—asking an agent to refactor its own freshly written code usually results in broken imports and orphaned schema tables.

Compare that to running an interactive CLI installer like npx create-codapult, which prompts you for feature flags upfront and instantly outputs a clean, trimmed codebase in seconds.


Save Your Compute Budget for What Actually Matters

Top-tier models are incredible at writing complex, unique business logic that sets your product apart. Using high-reasoning compute to re-generate standard Stripe subscription lifecycles, Tailwind v4 configs, and DB schemas is a waste of capital.

You’re paying premium rates for the AI equivalent of laying a brick foundation.


Skip the Scaffolding Prompts

This is exactly why I built Codapult.

It is a clean, modular Next.js 16 SaaS starter designed to save you from prompt fatigue and context drain:

  • Complete Foundation: Better-Auth (Passkeys, SSO, 2FA), Stripe & LemonSqueezy billing, Tailwind v4, Drizzle ORM, and i18n out of the box.
  • Production Infrastructure: Pre-configured Docker, Terraform, Kubernetes Helm charts, and flexible DB routing (PostgreSQL / Turso SQLite).
  • Extensible Architecture: Need specialized capabilities later? Drop in official modules like the AI Kit, CRM, or Helpdesk without touching the core framework.
  • Maintainable Lifetime: Stay updated effortlessly via the Git upstream CLI workflow.

You run git clone or use npx create-codapult, drop in your .env variables, and start building actual features immediately.

Save your high-tier tokens for your core product.


Codapult includes a complete, production-ready Next.js 16 stack out of the box — Better-Auth, Stripe/LemonSqueezy billing lifecycles, Tailwind v4, Drizzle ORM, IaC configs, and modular plugins — saving you hundreds of dollars in API compute and hours of agent orchestration. Explore the architecture in the documentation.

How are you balancing agentic workflows with pre-built boilerplate architecture in your projects? Are you fully prompting, or cloning first?

Top comments (0)