prisma-expert

sickn33/antigravity-awesome-skills · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill prisma-expert
0 commentsdiscussion
summary

Expert guidance on Prisma schema design, migrations, query optimization, and database operations.

  • Diagnoses and fixes schema design issues including relation definitions, indexing, and field type mismatches across PostgreSQL, MySQL, and SQLite
  • Provides migration strategies for resolving conflicts, failed deployments, and shadow database issues with safe production workflows
  • Optimizes queries to eliminate N+1 problems, over-fetching, and missing indexes through progressive fixes from
skill.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

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

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

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

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:

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

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

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:

# Enable query logging
# In schema.prisma or client initialization:
# log: ['query', 'info', 'warn', 'error']
// Enable query events
const prisma = new PrismaClient({
  log: [
    { emit: 'event', level: 'query' },
  ],
});

prisma.$on('query', (e) => {
  console.log('Query: ' + e.query);
  console.log('Duration: ' + e.duration + 'ms');
});

Prioritized Fixes:

  1. Minimal: Add includes for related data to avoid N+1
  2. Better: Use select to fetch only needed fields
  3. Complete: Use raw queries for complex aggregations, implement caching

Optimized Query Patterns:

// BAD: N+1 problem
const users = await prisma.user.findMany();
for (const user of users) {
  const posts = await prisma.post.findMany({ where: { authorId: user.id } });
}

// GOOD: Include relations
const users = await prisma.user.findMany({
  include: { posts: true }
});

// BETTER: Select only needed fields
const users = await prisma.user.findMany({
  select: {
    id: true,
    email: true,
    posts: {
      select: { id: true, title: true }
    }
  }
});

// BEST for complex queries: Use $queryRaw
const result = await prisma.$queryRaw`
  SELECT u.id, u.email, COUNT(p.id) as post_count
  FROM users u
  LEFT JOIN posts p ON p.author_id = u.id
  GROUP BY u.id
`;

Resources:

Connection Management

Common Issues:

  • Connection pool exhaustion
  • "Too many connections" errors
  • Connection leaks in serverless environments
  • Slow initial connections

Diagnosis:

# Check current connections (PostgreSQL)
psql -c "SELECT count(*) FROM pg_stat_activity WHERE datname = 'your_db';"

Prioritized Fixes:

  1. Minimal: Configure connection limit in DATABASE_URL
  2. Better: Implement proper connection lifecycle management
  3. Complete: Use connection pooler (PgBouncer) for high-traffic apps

Connection Configuration:

// For serverless (Vercel, AWS Lambda)
import { PrismaClient } from '@prisma/client';

const globalForPrisma = global as unknown as { prisma: PrismaClient };

export const prisma =
  globalForPrisma.prisma ||
  new PrismaClient({
    log: process.env.NODE_ENV === 'development' ? ['query'] : [],
  });

if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;

// Graceful shutdown
process.on('beforeExit', async () => {
  await prisma.$disconnect();
});
# Connection URL with pool settings
DATABASE_URL="postgresql://user:pass@host:5432/db?connection_limit=5&pool_timeout=10"

Resources:

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill prisma-expert

The skills CLI fetches prisma-expert from GitHub repository sickn33/antigravity-awesome-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/prisma-expert

Reload or restart Cursor to activate prisma-expert. Access the skill through slash commands (e.g., /prisma-expert) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.749 reviews
  • Kwame Rahman· Dec 24, 2024

    Solid pick for teams standardizing on skills: prisma-expert is focused, and the summary matches what you get after install.

  • Neel Wang· Dec 20, 2024

    Useful defaults in prisma-expert — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Ganesh Mohane· Dec 16, 2024

    prisma-expert fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Sakura Johnson· Dec 16, 2024

    prisma-expert reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Valentina Rahman· Dec 8, 2024

    prisma-expert has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Aisha Rao· Nov 27, 2024

    Useful defaults in prisma-expert — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Aanya Jain· Nov 23, 2024

    prisma-expert reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Aarav Verma· Nov 15, 2024

    I recommend prisma-expert for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Hiroshi Thompson· Nov 11, 2024

    prisma-expert has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Rahul Santra· Nov 7, 2024

    prisma-expert is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

showing 1-10 of 49

1 / 5