# Multi-turn best practices

> Ship complex full-stack apps without regressions by sequencing milestones cleanly, verifying each checkpoint, and knowing when to Undo instead of patching forward.

- Canonical: https://exaspark.ai/docs/multi-turn-best-practices/

## Build in vertical milestones, not mega-prompts

The single biggest difference between builders who ship polished production apps in an afternoon and builders who fight tangles for hours is **turn sequencing**.

Asking for a twelve-screen marketplace with multi-role authentication, Stripe subscriptions, email reminders, CSV exports, and an analytics dashboard in one giant opening prompt forces the Agent to juggle dozens of interdependent assumptions simultaneously. When one assumption is off, untangling it affects everything else.

Instead, build in clean **vertical milestones** — thin, working slices that you verify in **Preview** before adding the next layer. Every verified milestone locks in a rock-solid checkpoint, uses fewer credits overall, and makes regressions almost impossible.

## The four-phase milestone blueprint

Almost every real-world ExaSpark product — from local booking portals to subscription SaaS tools — ships fastest when sequenced through four clear phases.

| Phase | Primary goal | What to verify in Preview before moving on | Typical turns |
| --- | --- | --- | --- |
| **1. Design & MVP core** | Lock visual direction (optional **Design Canvas**), primary screens, and core **Cloud** tables | Main user workflow works end to end and saves accurate rows in **Cloud** | 1–3 turns |
| **2. Accounts & roles** | Add Google/email sign-in, user profiles, and strict server-side member vs admin rules | Signed-out visitors, members, and admins each see only permitted actions and data | 1–2 turns |
| **3. Payments & email** | Wire Stripe one-off, deposit, or subscription checkout, webhooks, and branded notifications | Test card payment updates **Cloud** status, unlocks member access, and triggers email cleanly | 1–2 turns |
| **4. Polish & launch QA** | Refine empty states, responsive spacing, SEO metadata, custom domain, and Android build | Clean mobile layout in **Browser Device Lab**, zero console errors, production checklist passed | 2–3 turns |

## Phase-by-phase prompt plan

See how a real five-turn sequence builds a complete coaching and class-booking business cleanly from scratch — without cramming unrelated systems into one turn:

```text
Turn 1 (Design mode — Visual anchor):
  "Explore 3 homepage directions for Northside Strength Club using our attached
   logo and gym photos: warm editorial light, crisp minimalist grid, and bold
   slate dark. Include hero, class schedule preview, and membership card."
  → Compare side by side, tweak copy with click-to-edit, adopt the winner.

Turn 2 (App mode — Core schema & primary booking flow):
  "Build this adopted design in App mode. Create Cloud tables for classes
   (title, coach, start time, capacity) and bookings (member name, email,
   class link, status). Let visitors browse the weekly schedule and book a
   spot with capacity countdown."
  → Test creating a booking in Preview and verify both Cloud tables.

Turn 3 (App mode — Accounts & server-side roles):
  "Add Google and email sign-in. Require members to sign in to manage or
   cancel their own bookings up to 12 hours before class. Add an /admin
   schedule view accessible only to admins to create classes and check in guests."
  → Test signed-out, member, and admin sessions in Preview.

Turn 4 (App mode — Stripe subscription & webhooks):
  "Add a $59/month Unlimited Membership via Stripe checkout. After payment
   succeeds, mark the member Active in Cloud, waive per-class booking fees,
   and add a Manage Billing portal button on the Account page."
  → Complete a Stripe Test mode checkout in Preview and verify status flips to Active.

Turn 5 (App mode — Polish, empty states & transactional email):
  "Send a branded confirmation email when a class is booked or canceled.
   Add friendly empty states on My Bookings and clean up mobile spacing on
   the weekly schedule calendar. Keep existing auth and Stripe logic unchanged."
  → Inspect in Browser Device Lab, switch Stripe to Live, and click Publish.
```

## Verify every checkpoint before starting the next turn

Stacking Turn 4 on top of a broken database relationship from Turn 2 is the fastest way to waste time and credits. Build a crisp two-minute verification habit between every milestone:

1. **Run the primary flow in Preview** — Click through the newly built feature exactly like a real customer, including form validation and page refreshes.
2. **Inspect Cloud database rows** — Open the **Cloud** tab and confirm new records, linked IDs, and status values actually persisted rather than living only in browser memory.
3. **Check permission boundaries** — Whenever a turn adds accounts or roles, test both an unauthorized view (signed out or regular member) and an authorized view (admin).
4. **Glance at mobile layout** — Open [Browser Device Lab](https://exaspark.ai/docs/device-lab/) after major layout turns so cramped tables or wrapped buttons get fixed immediately while context is fresh.

## Know when to click Undo vs patch forward

One of the sharpest instincts experienced ExaSpark builders develop is deciding within ten seconds whether to **patch forward** or click **Undo** and rephrase.

| Situation after a turn | Best move | Why it wins |
| --- | --- | --- |
| **Visual direction feels wrong** | **Undo**, then rephrase or switch to **Design Canvas** | Patching style overrides onto a mismatched layout creates brittle, cluttered UI |
| **Core database schema was misunderstood** | **Undo**, then name exact tables and fields plainly | Starting from clean tables beats layering migrations on wrong relationships |
| **Feature is 90% right; one label or rule is off** | **Patch forward** (click-to-edit or a 1-sentence chat turn) | Preserves all working wiring and finishes in seconds |
| **A build or runtime error banner appeared** | Click **Ask AI to fix** | Feeds the exact failure log directly to the Agent for targeted repair |
| **Two or three patch attempts still miss the mark** | **Undo** back to the last green checkpoint and split the task | Breaks loops immediately and protects both code clarity and your credit balance |

> **Note:** Never feel reluctant to click **Undo**. Checkpoints exist specifically so rolling back one turn and tightening your wording costs almost nothing and keeps your project crystal clean.

## Prevent drift in long conversations

As an app grows past twenty or thirty turns — adding referral links, seasonal discounts, new admin reports, and Android refinements — four disciplined habits keep the Agent laser-accurate.

### Keep one concern per turn

Avoid combining unrelated requests like `"Redesign the homepage hero, add annual Stripe pricing, and fix the CSV export date format"` in a single prompt. Separate visual tweaks, schema/payment updates, and bug fixes into distinct turns so each checkpoint tests cleanly and reverts cleanly if needed.

### Anchor instructions to exact names

Instead of writing `"Update the list page table"`, reference the actual route, tab, or **Cloud** table name you see in the studio: `"On /admin/orders, add a status filter dropdown wired to the Cloud orders table."` Exact anchors eliminate guesswork across large multi-page projects.

### State invariants explicitly before sensitive edits

When reshaping a screen that already houses working auth or checkout logic, add one protective sentence at the end of your prompt: `"Keep existing Google sign-in, admin role checks, and Stripe webhook handlers untouched."` Explicit guardrails protect verified subsystems from unintended refactors.

### Spend credits deliberately

Save full Agent turns for features, logic, and multi-component design work. Use direct **click-to-edit** for copy, labels, and minor spacing tweaks, and group closely related micro-copy edits on the same page into one clean pass. See [Optimizing credits](https://exaspark.ai/docs/optimizing-credits/) for detailed credit-saving patterns.

## Pre-publish checkpoint audit

Before promoting a multi-turn **Preview** to **Live**, verify each production invariant:

```text
Pre-publish audit:
[ ] Core flows re-tested in Preview after a full page reload
[ ] Cloud tables persist accurate records and links
[ ] Member vs admin rules enforced server-side
[ ] Stripe checkout verified in Test mode, then toggled to Live
[ ] Mobile screens checked in Browser Device Lab
[ ] Custom domain DNS verified (Starter/Pro) and legal links present
```

For full SEO, branded email, and monitoring steps, see the [Production checklist](https://exaspark.ai/docs/production-checklist/).

## Next steps

- [Working with the Agent](https://exaspark.ai/docs/working-with-the-agent/) — Master choice cards, click-to-edit, 1-click Undo, and Ask AI to fix.
- [Optimizing credits](https://exaspark.ai/docs/optimizing-credits/) — Practical strategies to ship more per monthly credit cycle.
- [Production checklist](https://exaspark.ai/docs/production-checklist/) — Final pre-launch checks across auth, Stripe, DNS, SEO, and mobile.
- [Preview vs Live](https://exaspark.ai/docs/preview-vs-live/) — Keep active Live customers isolated while iterating safely in Preview.

## From the blog

- [Common vibe coding mistakes](https://exaspark.ai/blog/vibe-coding-mistakes/) — Avoid prompt bloat, unverified turns, and tangled regressions.
- [How long does it take to build an app?](https://exaspark.ai/blog/how-long-does-it-take-to-build-an-app/) — Realistic timelines from MVP milestone to paying launch.
- [Do you need a technical cofounder?](https://exaspark.ai/blog/do-you-need-a-technical-cofounder/) — How structured AI workflows help solo founders ship production software.
