What problem does it solve? Prisma schemas and queries that work in development often fail in production: unindexed foreign keys cause slow queries, unsafe migrations lock live tables, N+1 patterns exhaust connection pools, and Float fields corrupt monetary values. This Skill applies production-grade rules to every Prisma decision so schemas, migrations, and queries are safe and performant from the start. ## Core Features & Use Cases - Schema Design: Enforces conventions like PascalCase models, cuid IDs, Decimal for money, soft deletes, and @@index on every foreign key and filtered field. - Safe Migrations: Applies the expand-migrate-contract pattern, CREATE INDEX CONCURRENTLY, and multi-deploy strategies for NOT NULL columns on live PostgreSQL databases. - Query Optimization: Diagnoses and fixes N+1 queries with include/select, implements cursor-based pagination, upserts, transactions, and EXPLAIN ANALYZE via $queryRaw. - Connection Pooling: Configures Prisma Accelerate for serverless and sizes connection pools for long-running Fastify servers. - Use Case: A user's invoice listing endpoint times out in production. The Skill identifies an N+1 query, rewrites it with eager loading and selective fields, adds a composite index on (status, dueAt), and ships a CONCURRENTLY index migration that avoids table locks. ## Quick Start Ask the AI to design a Prisma schema for your domain or audit your existing schema and slow queries for production readiness.