The AI Prompt Death Spiral: 15-Point Production Readiness Checklist Before You Launch
The 'AI Prompt Death Spiral' occurs at roughly 80% app completion when every new prompt to Lovable, Bolt, Claude Code, or Cursor fixes one bug while breaking two existing features. Escaping this loop requires pausing blind prompt iteration and running a 15-point production readiness diagnostic across Data Security, Authentication, Billing Idempotency, Secrets, and Module Boundaries.
Symptom → Root Technical Cause → Surgical Engineering Fix
| What You Experience | Why the AI Agent / App Is Stuck | Aquarel's Surgical Engineering Fix |
|---|---|---|
| You have spent 20+ hours prompting the AI to fix the same authentication or state bug in circles | Context-window saturation and coupled state hooks cause the LLM to overwrite working edge-case handling on every edit. | Stop prompting on the monolithic file; extract isolated domain modules and lock core state behind unit tests. |
| Happy-path demo works for 1 test user, but breaks when 2 users sign in or trigger concurrent actions | Hardcoded single-tenant assumptions, missing database foreign-key constraints, and permissive RLS policies. | Run multi-tenant isolation checks and enforce strict database-level constraints and RLS policies. |
| Fear of launching to paying customers because you don't know what hidden security holes exist | AI assistants optimize for making UI errors disappear rather than enforcing defense-in-depth security. | Execute the 15-point Red/Yellow/Green Codebase Audit across Auth, RLS, Stripe, Secrets, and CI/CD. |
# Aquarel 15-Point Vibe-Code Production Readiness Rules (.cursorrules)
1. [RLS] Every public database table has RLS enabled with strict `auth.uid() = user_id` policies.
2. [Secrets] Zero `SERVICE_ROLE` or secret API keys exist in `NEXT_PUBLIC_*` or `VITE_*` variables.
3. [Auth] OAuth, magic links, and protected routes refresh SSR cookies without client redirect loops.
4. [Billing] Stripe webhooks verify raw `stripe-signature` headers and enforce `event.id` idempotency.
5. [Modularity] No UI component exceeds 250 lines; database and billing mutations live in `src/server/**`. The 15-Point Production Readiness Checklist We Run on Every 48-Hour Codebase Audit
Before any Vibe-Coded App or SaaS product takes live customer payments, we evaluate five core pillars (3 checks per pillar):
- Data & Row-Level Security (RLS): RLS enabled on all tables, tenant isolation verified, storage bucket permissions locked.
- Secrets & Environment Hygiene: Zero leaked
service_rolekeys in client bundles, server-only env guards, rotated development credentials. - Authentication & Session Integrity: SSR cookie refresh middleware, atomic user-profile creation triggers, hardened OAuth/magic-link callbacks.
- Stripe & Subscription Billing: Raw-body webhook signature verification,
event.ididempotency table, entitlement state reconciliation. - Architecture & Vibe-Safe Guardrails: Monolithic files split (<250 lines), zero
as anytype bypasses on API payloads, and rootCLAUDE.md/AGENTS.md/.cursorrulesinstalled.
Broken AI Pattern vs. Surgical Engineering Fix
- Broken AI Pattern: Prompting the LLM 20+ times in a row to “fix the login/checkout bug” inside a saturated context window, causing each commit to overwrite adjacent state hooks, disable RLS policies, or introduce duplicate helper files.
- Surgical Engineering Fix: Pause blind prompting immediately, run the 15-point Red/Yellow/Green production audit across Auth, RLS, Stripe, Secrets, and Modularity, isolate P0 fixes in staging PRs, and commit
.cursorrules/CLAUDE.mdguardrails before resuming feature work.