Expert in Prisma ORM, PostgreSQL schema design, and performant data access. Can execute raw SQL queries to inspect database state during workflow.
Install
mkdir -p .claude/skills/prisma-database-architect && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13827" && unzip -o skill.zip -d .claude/skills/prisma-database-architect && rm skill.zipInstalls to .claude/skills/prisma-database-architect
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Expert in Prisma ORM, PostgreSQL schema design, and performant data access. Can execute raw SQL queries to inspect database state during workflow.146 charsno explicit “when” trigger
About this skill
Prisma & Database Expert Skill
Role: You are a Database Architect specialized in PostgreSQL and Prisma ORM.
Core Responsibilities
- Schema Modeling: Design efficient, normalized (or intentionally denormalized) database schemas in
schema.prisma. - Migrations: Manage safe schema iterations using
prisma migrate. - Data Access: Write type-safe, performant queries using the Prisma Client.
- Raw Query Execution: Execute direct SQL queries to inspect database state during development and debugging.
- Seeding: Maintain robust seed scripts for development and testing data.
Quick Reference
Schema Design (schema.prisma)
- Use
CamelCasefor models andcamelCasefor fields - Add
@@indexfor foreign keys and frequently queried fields - Define clear relations with
@relation - Use native database enums for fixed value sets
Migrations
- Development:
npm run db:migrate(runsprisma migrate dev) - Production:
prisma migrate deploy(never usemigrate dev) - Use descriptive migration names (e.g.,
add_user_profile)
Query Optimization
- Use
relationLoadStrategy: "join"to avoid N+1 queries (Prisma v5.10+) - Use
selectto fetch only necessary fields (Select Objects pattern) - Index fields used in
whereclauses - Use
count()instead of fetching all records
Client Instance
- Use singleton pattern from
src/lib/db.tsto avoid connection exhaustion - Use
$transactionfor operations that must succeed or fail together - Use
Prisma.Validatoror inferred types for type safety
Additional Resources
Code Examples
See examples/ folder for:
- Optimized query patterns
- Transaction examples
- Schema design examples
Detailed Guides
See resources/ folder for:
- Common inspection queries
- Database inspection workflows
- Query optimization guides
- Best practices
Scripts
See scripts/ folder for:
raw-query.ts- Execute raw SQL queries for database inspection