MR
Mayur Rathi
@mayurrathi
⭐ 40.7k GitHub stars

Prisma Expert

Prisma Expert is an design AI skill with a core value of Prisma ORM expert for schema design, migrations, query optimization, relations modeling, and database operations. It helps developers solve real-world problems in the design domain, boosting efficiency, automating repetitive tasks, and optimizing workflows.

Prisma ORM expert for schema design, migrations, query optimization, relations modeling, and database operations. Use PROACTIVELY for Prisma schema issues, migration problems, query performance, re...

Last verified on: 2026-07-07

Quick Facts

Category design
Works With Claude
Source sickn33/antigravity-awesome-skills
Stars ⭐ 40.7k
Last Verified 2026-07-07
Risk Level Low
mkdir -p ./skills/prisma-expert && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/prisma-expert/SKILL.md -o ./skills/prisma-expert/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# 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

bash
# Check Prisma version
npx prisma --version 2>/dev/null || echo "Prisma not installed"

# Check database provider
grep "provider" prisma/schema.prisma 2>/dev/null | head -1

# Check for existing migrations
ls -la prisma/migrations/ 2>/dev/null | head -5

# Check Prisma Client generation status
ls -la node_modules/.prisma/client/ 2>/dev/null | head -3

Apply Strategy

1. Identify the Prisma-specific issue category

2. Check for common anti-patterns in schema or queries

3. Apply progressive fixes (minimal → better → complete)

4. Validate with Prisma CLI and testing


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:**

bash
# Validate schema
npx prisma validate

# Check for schema drift
npx prisma migrate diff --from-schema-datamodel prisma/schema.prisma --to-schema-datasource prisma/schema.prisma

# Format schema
npx prisma format

**Prioritized Fixes:**

1. **Minimal**: Fix relation annotations, add missing `@relation` directives

2. **Better**: Add proper indexes with `@@index`, optimize field types

3. **Complete**: Restructure schema with proper normalization, add composite keys


**Best Practices:**

prisma
// Good: Explicit relations with clear naming
model User {
  id        String   @id @default(cuid())
  email     String   @unique
  posts     Post[]   @relation("UserPosts")
  profile   Profile? @relation("UserProfile")
  
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  
  @@index([email])
  @@map("users")
}

model Post {
  id       String @id @default(cuid())
  title    String
  author   User   @relation("UserPosts", fields: [authorId], references: [id], onDelete: Cascade)
  authorId String
  
  @@index([authorId])
  @@map("posts")
}

**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:**

bash
# Check migration status
npx prisma migrate status

# View pending migrations
ls -la prisma/migrations/

# Check migration history table
# (use database-specific command)

**Prioritized Fixes:**

1. **Minimal**: Reset development database with `prisma migrate reset`

2. **Better**: Manually fix migration SQL, use `prisma migrate resolve`

3. **Complete**: Squash migrations, create baseline for fresh setup


**Safe Migration Workflow:**

bash
# Development
npx prisma migrate dev --name descriptive_name

# Production (never use migrate dev!)
npx prisma migrate deploy

# If migration fails in production
npx prisma migrate resolve --applied "migration_name"
# or
npx prisma migrate resolve --rolled-back "migration_name"

**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:**

bash
# Enable query

🎯 Best For

  • Claude users
  • Designers
  • Creative professionals
  • Product teams

💡 Use Cases

  • Design system documentation
  • Component specification creation

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Prisma Expert to Your Work

    Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.

  4. 4

    Review and Refine

    Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.

❓ Frequently Asked Questions

Does Prisma Expert generate production-ready design specs?

It generates detailed specifications that developers can use directly. Review and adjust for your specific design system.

How do I install Prisma Expert?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/prisma-expert/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Not reading the full skill

Skills contain important context and edge cases beyond the quick start.

🔗 Related Skills