AI Across the Stack: Lessons from Building Invoicing

By Erika Smith, Brian Chitester, Anant Jain

TL;DR: By leveraging a "Context-First" AI workflow, we shipped Coinbase Business Invoicing in weeks instead of months. We transitioned from manual UI mocking to code-first prototyping and used scoped repository sandboxing to enable safe, cross-stack iteration.


Coinbase Logo

How We 10x'ed Velocity from Idea to Customer

AI stack

Building for the onchain economy requires high-integrity systems. When we set out to build Invoicing, a tool for crypto and stablecoin payments, we faced a classic engineering bottleneck: the friction between high-velocity prototyping and the rigid standards of our production stack.

Traditionally, new features at Coinbase used to undergo a linear lifecycle: high-fidelity mocks, manual stubbing of backend services, and exhaustive test backfilling. This process ensures quality but throttles speed. Our goal was to use AI to compress this lifecycle without sacrificing the "Coinbase Standard."

By integrating AI across the full development lifecycle, a 2-person team shipped in weeks what typically takes months. AI accelerated exploration; PM and Design co-shaped the UX and produced the final mocks we shipped.

1. Prototyping: Closing the Design-to-Code Gap

The "old way" involved waiting for polished Figma mocks before writing a single line of React. This created a serial dependency that delayed feedback loops.

The Innovation: Image-to-Component Rules

We bypassed the mock-up phase by prototyping directly in Cursor. Instead of generic prompts, we fed the LLM screenshots of existing UI surfaces and a custom .cursorrules file.

  • The Constraint: AI often hallucinates non-existent design system components.

  • The Fix: We prompted the AI to analyze our internal library first, generating a set of "best practice" implementation rules.

  • The Result: We moved from "screenshot" to "functional UI-only mock" using production components in a single session. This compressed the loop between Product, Design, and Engineering from about 2 weeks to about 1 day.

CB Business AI
CB Biz image 3

Day 1 prototype vs. shipped product: The AI mock (left) established the core structure with real system components; PM and Design evolved it into the production experience (right).

2. Cross-Stack Context: The Sandbox Pattern

AI stack scope

Engineering at scale often means navigating a labyrinth of microservices. A single change like adding a due_date field to an invoice requires updates across the API gateway, the invoicing service, and the frontend.

The "Learned Lesson": Context over Cleverness

Generic AI assistance fails in a complex monorepo or across multiple repositories because the context window becomes saturated with noise.

We implemented a Scoped Sandbox Pattern:

  1. Isolation: We created dedicated workspaces containing only the specific repositories relevant to the feature (e.g., web-app, invoicing-api).

  2. Context Priming: We used "Plan Mode" to index the workspace and maintained CLAUDE.md files, living documents that tracked architectural decisions and schema changes.

While this restricted the AI's "global" knowledge of our infrastructure, it drastically increased the precision of its code generation - fewer hallucinated API contracts meant less time spent on back-and-forth fixes.

3. Stability: Backfilling Quality

In the early prototyping phase, we made a conscious decision: optimize for speed of change over 100% test coverage. We knew that writing tests for a shifting schema is a recipe for wasted story points.

Scaling Quality Post-Stabilization

Once the product requirements reached a steady state, we used AI to eliminate the "Testing Debt" that usually accumulates during rapid development.

  • Edge Case Discovery: We used LLMs to analyze our UI logic and generate unit tests for edge cases (handling partial payments or expired signatures) that are often overlooked in manual sweeps.

  • E2E Test Generation: We used AI to scaffold end-to-end tests that simulated real user flows - creating an invoice, sending it, and completing payment - across the full stack. This gave us confidence that cross-service interactions held up under realistic conditions.

  • Instrumentation: AI identified missing analytics hooks and generated the boilerplate for event tracking, ensuring we had 100% observability on day one.

4. Operational Impact: The "Work Around the Work"

Beyond the code, we targeted the coordination overhead.

  • PR Automation: AI generated technical descriptions by diffing the changes against our CLAUDE.md plan.

  • Sync-to-Spec: We automated the conversion of unstructured Slack threads into structured Linear tickets.

This reclaimed roughly 2 hours per engineer per week, shifting our focus from administrative synchronization to core systems design.

Guardrails and the Human Element

AI assists with roughly 40% of the code written at Coinbase. However, we maintain strict boundaries:

  1. Zero-Trust Data: AI tools operate within privacy-safe boundaries. No secrets, customer PII, or non-public financials ever enter the context window.

  2. Human Attribution: AI proposes, humans commit. Every line of generated code undergoes the same peer-review process as manual code.

  3. The "Judgment" Moat: Foundational product modeling such as the relational logic between invoices and recurring billing plans remains a human-only task. These decisions involve long-term business trade-offs that an LLM cannot infer from a codebase.

Final Results

By integrating AI across the stack, we compressed timelines and raised the quality bar.

  • Lead Time: Prototype to production in weeks, not months.

  • Test Density: Increased by 60% compared to manual backfilling.

  • Scope: A 2-person team delivered what would typically require 4+ engineers.

As code generation becomes a commodity, the value of code review, architectural judgment, and clear technical documentation becomes the new premium.

Recent stories

Disclaimers: Derivatives trading through the Coinbase Advanced platform is offered to eligible EEA customers by Coinbase Financial Services Europe Ltd. (CySEC License 374/19). In order to access derivatives, customers will need to pass through our standard assessment checks to determine their eligibility and suitability for this product.