prisma-expert

Diagnose and fix Prisma schema design, migrations, query performance, and connection issues.

2|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/SkinnnyJay/simpill-utils --skill prisma-expert-skinnnyjay
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-expert
Source: https://github.com/SkinnnyJay/simpill-utils/tree/main/.agents/skills/prisma-expert
Command: npx skills add https://github.com/SkinnnyJay/simpill-utils --skill prisma-expert-skinnnyjay

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Prisma ORM projects frequently hit schema relation errors, failed migrations, N+1 query bottlenecks, and connection pool exhaustion, and this Skill provides structured playbooks to diagnose and resolve each category. ## Core Features & Use Cases - Schema Design Review: Validates relation definitions, indexes, enums, and field types with prioritized fixes from minimal to complete. - Migration Troubleshooting: Handles migration conflicts, failed production deployments, and shadow database issues using prisma migrate status, resolve, and deploy workflows. - Query Optimization: Detects N+1 problems and over-fetching, then applies include/select patterns or raw queries for complex aggregations. - Use Case: A production deploy fails because a migration left the database inconsistent. The Skill walks through checking migration status, resolving the failed migration with prisma migrate resolve, and establishing a safe deploy workflow. ## Quick Start Ask the assistant to diagnose why your Prisma queries are slow or why a migration failed, and it will detect your environment and apply the appropriate playbook.

Frequently Asked Questions about prisma-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix N+1 query problems in Prisma?▼

Fix N+1 queries in Prisma by using include to fetch relations in a single query instead of looping with separate findMany calls. For better performance, use select to retrieve only needed fields, and use $queryRaw for complex aggregations.

How to resolve a failed Prisma migration in production?▼

Resolve a failed production migration by running prisma migrate status to identify the issue, then use prisma migrate resolve with --applied or --rolled-back to mark the migration state. Never use migrate dev in production; always use migrate deploy.

Does Prisma support connection pooling for serverless deployments?▼

Prisma supports connection pooling via the connection_limit and pool_timeout parameters in DATABASE_URL. For serverless environments like Vercel or AWS Lambda, cache the PrismaClient instance globally and consider a pooler like PgBouncer for high traffic.

Why does my Prisma schema have relation errors at runtime?▼

Relation errors usually come from missing @relation directives, incorrect fields/references mappings, or undefined cascade behaviors. Run npx prisma validate and prisma format to catch schema issues, and define explicit onDelete and onUpdate behaviors.

When should I use raw queries instead of Prisma Client?▼

Use $queryRaw only for complex aggregations or queries Prisma Client cannot express, such as multi-table GROUP BY reports. For standard CRUD and relation fetching, Prisma Client queries with select and include are safer and type-checked.