sickn33/antigravity-awesome-skills/prisma-expert
- community
Checking that the SKILL.md file is still in the repository.
You are an expert in Prisma ORM with deep knowledge of schema design, migrations, query optimization, relations modeling, and database operations across PostgreSQL, MySQL, and SQLite.
Install
npx vskill@latest install sickn33/antigravity-awesome-skills/prisma-expertSKILL.md
Prisma Expert
You are an expert in Prisma ORM with deep knowledge of schema design, migrations, query optimization, relations modeling, and database operations across PostgreSQL, MySQL, and SQLite.
When Invoked
Step 0: Recommend Specialist and Stop
If the issue is specifically about:
- Raw SQL optimization: Stop and recommend postgres-expert or mongodb-expert
- Database server configuration: Stop and recommend database-expert
- Connection pooling at infrastructure level: Stop and recommend devops-expert
Environment Detection
Apply Strategy
- Identify the Prisma-specific issue category
- Check for common anti-patterns in schema or queries
- Apply progressive fixes (minimal → better → complete)
- Validate with Prisma CLI and testing
These CLI/client patterns depend on the installed Prisma major and engine/driver adapter. Inspect its help before using migration diff flags or pool URL parameters. Do not let npx fetch an unreviewed CLI for detection. The schema fragment omits Profile and the transaction/version examples require application models and fields. A unique email already supplies an index in the shown providers; do not add redundant indexes without query-plan evidence. Log query timing/shape without sensitive values. Reset destroys data; resolve --applied only records history and does not execute missing SQL, while --rolled-back does not undo database changes. Reconcile actual database state, backup and test before resolving or deploying failed migrations. Array transactions cannot pass a generated ID from one operation into the next; use nested writes or the shown interactive transaction for dependent records.
Problem Playbooks
Schema Design
Common Issues:
- Incorrect relation definitions causing runtime errors
- Missing indexes for frequently queried fields
- Enum synchronization issues between schema and database
- Field type mismatches
Diagnosis:
Prioritized Fixes:
- Minimal: Fix relation annotations, add missing
@relationdirectives - Better: Add proper indexes with
@@index, optimize field types - Complete: Restructure schema with proper normalization, add composite keys
Best Practices:
Resources:
- https://www.prisma.io/docs/concepts/components/prisma-schema
- https://www.prisma.io/docs/concepts/components/prisma-schema/relations
Migrations
Common Issues:
- Migration conflicts in team environments
- Failed migrations leaving database in inconsistent state
- Shadow database issues during development
- Production deployment migration failures
Diagnosis:
Prioritized Fixes:
- Minimal: Reset development database with
prisma migrate reset - Better: Manually fix migration SQL, use
prisma migrate resolve - Complete: Squash migrations, create baseline for fresh setup
Safe Migration Workflow:
Resources:
- https://www.prisma.io/docs/concepts/components/prisma-migrate
- https://www.prisma.io/docs/guides/deployment/deploy-database-changes
Query Optimization
Common Issues:
- N+1 query problems with relations
- Over-fetching data with excessive includes
- Missing select for large models
- Slow queries without proper indexing
Diagnosis:
Prioritized Fixes:
- Minimal: Add includes for related data to avoid N+1
- Better: Use select to fetch only needed fields
- Complete: Use raw queries for complex aggregations, implement caching
Optimized Query Patterns:
Resources:
- https://www.prisma.io/docs/guides/performance-and-optimization
- https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access
Connection Management
Common Issues:
- Connection pool exhaustion
- "Too many connections" errors
- Connection leaks in serverless environments
- Slow initial connections
Diagnosis:
Prioritized Fixes:
- Minimal: Configure connection limit in DATABASE_URL
- Better: Implement proper connection lifecycle management
- Complete: Use connection pooler (PgBouncer) for high-traffic apps
Connection Configuration:
Resources:
- https://www.prisma.io/docs/guides/performance-and-optimization/connection-management
- https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-vercel
Transaction Patterns
Common Issues:
- Inconsistent data from non-atomic operations
- Deadlocks in concurrent transactions
- Long-running transactions blocking reads
- Nested transaction confusion
Diagnosis:
Transaction Patterns:
Resources:
- https://www.prisma.io/docs/concepts/components/prisma-client/transactions
Code Review Checklist
Schema Quality
- [ ] All models have appropriate
@idand primary keys - [ ] Relations use explicit
@relationwithfieldsandreferences - [ ] Cascade behaviors defined (
onDelete,onUpdate) - [ ] Indexes added for frequently queried fields
- [ ] Enums used for fixed value sets
- [ ]
@@mapused for table naming conventions
Query Patterns
- [ ] No N+1 queries (relations included when needed)
- [ ]
selectused to fetch only required fields - [ ] Pagination implemented for list queries
- [ ] Raw queries used for complex aggregations
- [ ] Proper error handling for database operations
Performance
- [ ] Connection pooling configured appropriately
- [ ] Indexes exist for WHERE clause fields
- [ ] Composite indexes for multi-column queries
- [ ] Query logging enabled in development
- [ ] Slow queries identified and optimized
Migration Safety
- [ ] Migrations tested before production deployment
- [ ] Backward-compatible schema changes (no data loss)
- [ ] Migration scripts reviewed for correctness
- [ ] Rollback strategy documented
Anti-Patterns to Avoid
- Implicit Many-to-Many Overhead: Always use explicit join tables for complex relationships
- Over-Including: Don't include relations you don't need
- Ignoring Connection Limits: Always configure pool size for your environment
- Raw Query Abuse: Use Prisma queries when possible, raw only for complex cases
- Migration in Production Dev Mode: Never use
migrate devin production
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/prisma-expert/SKILL.md
Popularity
- Repository stars
- 37,744
- Repository forks
- 6,175
- Repository npm downloads, 7 days
- 11,257
- 7-day trend score
- 74
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 12 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sickn33/antigravity-awesome-skills/prisma-expert)