Ship Production Supabase Apps Without the "It Works in Dev" Nightmares — 50 Battle-Tested Prompts
Supabase tutorials make everything look easy. Production Supabase is a different story — RLS policies that block your own API calls, edge functions that timeout, realtime subscriptions that leak memory, and auth flows that break on edge cases. These 50 prompts encode the production patterns that bridge the gap between "getting started" and "running reliably at scale."
Every prompt produces Supabase-specific SQL, TypeScript, and configuration that you can deploy directly — not generic PostgreSQL advice with Supabase mentioned in passing.
What's Inside — 50 Expert Prompts
Row-Level Security (Prompts 1-10)
- 1. RLS Policy Designer — Creates comprehensive RLS policies for {{table}}: SELECT, INSERT, UPDATE, DELETE with user ownership, role-based, and team-based access patterns. Uses chain-of-thought for policy logic verification.
- 2. Multi-Tenant RLS — Implements tenant isolation for {{saas_app}}: organization-based policies, cross-tenant prevention, and admin override patterns.
- 3. RLS Performance Optimization — Analyzes and optimizes RLS policies for {{table}}: query plan analysis, index strategy, and policy simplification without reducing security.
- 4. RLS Testing Framework — Creates test suite for {{rls_policies}}: positive tests, negative tests, edge cases, and role-switching verification.
- 5-10. Additional prompts covering: hierarchical access (org > team > user), public/private content patterns, time-based access, invite-based sharing, admin bypass patterns, and RLS debugging guide.
Edge Functions & API (Prompts 11-22)
- 11. Edge Function Architecture — Designs edge function for {{use_case}}: request validation, auth verification, business logic, error handling, and response formatting.
- 12. Webhook Handler — Production webhook processor for {{service}}: signature verification, idempotency, retry handling, and dead-letter queue.
- 13. Database Trigger + Edge Function Chain — Event-driven architecture: database trigger → pg_notify → edge function for {{event_type}}.
- 14. File Processing Pipeline — Storage trigger → edge function → processing for {{file_type}}: image resizing, document parsing, virus scanning.
- 15-22. Additional prompts covering: cron jobs, payment processing, email sending, third-party API integration, rate limiting, caching, background jobs, and edge function testing.
Auth & Storage (Prompts 23-34)
- 23. Auth Flow Designer — Complete auth implementation for {{app_type}}: email/password, OAuth providers, magic links, phone auth with proper error handling and UX flows.
- 24. Custom Claims & Roles — Implements role-based auth for {{role_hierarchy}}: custom JWT claims, role assignment, and permission checking in RLS and edge functions.
- 25. Storage Policy Architecture — Storage bucket configuration for {{content_type}}: upload policies, file size limits, MIME type validation, and CDN caching.
- 26-34. Additional prompts covering: multi-factor auth, session management, account linking, user impersonation, storage organization, image transformation, presigned URLs, storage quotas, and auth hooks.
Database & Operations (Prompts 35-50)
- 35. Migration Strategy — Database migration workflow for {{change_type}}: migration file, rollback script, data backfill, and zero-downtime deployment.
- 36. Realtime Configuration — Optimized realtime subscriptions for {{feature}}: channel design, presence tracking, broadcast patterns, and connection management.
- 37. Performance Monitoring — Supabase monitoring setup: pg_stat_statements, query analysis, connection pooling, and alert configuration.
- 38-50. Additional prompts covering: database functions, computed columns, materialized views, full-text search, PostGIS integration, backup strategy, branching workflow, TypeScript type generation, testing strategy, local development setup, CI/CD pipeline, and production checklist.
Each Prompt Includes
- {{Variable}} slots — App type, data model, and auth requirements customizable
- Production-ready SQL & TypeScript — Copy-paste code for Supabase
- Technique annotation — Chain-of-thought, CRTSE, self-consistency
- Security considerations — RLS implications and attack vector analysis
- Anti-patterns — Supabase mistakes that cause data leaks and performance issues
Who This Is For
- Supabase developers moving from prototypes to production
- Full-stack developers building SaaS products on Supabase
- Indie hackers who need production-grade backend without a backend team
- Teams migrating from Firebase to Supabase
What Makes This Different
- Production-focused — No tutorials, only patterns for apps serving real users
- Security-first — RLS is not an afterthought but the foundation of every prompt
- Supabase-native — Uses Supabase features (edge functions, realtime, storage policies) not generic PostgreSQL
Works With
ChatGPT (GPT-4+), Claude (Sonnet/Opus), Gemini Pro, Cursor IDE. Best with Claude for complex SQL and RLS policy design.