What problem does it solve? Prisma schemas and queries that work in development often fail in production: missing indexes 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 on live PostgreSQL databases. ## 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 to avoid locking live tables. - Query Optimization: Diagnoses and fixes N+1 queries with include/select, implements cursor-based pagination, upserts, transactions, and EXPLAIN ANALYZE via raw SQL. - 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, adds eager loading with select, adds a composite index on (status, dueAt), and switches offset pagination to cursor-based pagination. ## Quick Start Ask the assistant to audit your Prisma schema and slow queries, for example: "Review my schema.prisma and fix the slow invoice query using production-safe patterns."