Command Palette

Search for a command to run...

YepAPI
Free · All Tools

Prisma Agent Skill

Prisma schema design, migrations, and query optimization.

prismaormdatabasemigrations

The Skill

Full content, every format. Copy it, download it, or install with one command.

SKILL.md
---
description: Prisma schema design, migrations, and query optimization.
homepage: https://yepapi.com/skills/prisma
metadata:
  tags: [prisma, orm, database, migrations]
---

# Prisma

## Rules

- Schema in `prisma/schema.prisma` — single source of truth
- Use `select` over `include` — fetch only needed fields
- Transactions for multi-step mutations: `prisma.$transaction([...])`
- Soft deletes via `deletedAt DateTime?` field + middleware filter
- Indexes on frequently queried fields: `@@index([fieldName])`
- Relations: always define both sides (`@relation`)
- Migrations: `npx prisma migrate dev --name descriptive-name`
- Connection pooling for serverless: use Prisma Accelerate or PgBouncer
- Type generation: `npx prisma generate` after schema changes

## Avoid

- `include: { relation: true }` when you only need one field — use `select` instead
- N+1 queries — use `include` or `select` with nested relations
- Raw SQL when Prisma API can handle it — only use `$queryRaw` for complex aggregations
- `prisma.table.findMany()` without `take` limit — always paginate

Install

Why Use the Prisma Skill?

Without this skill, your AI guesses at prisma patterns. It might hallucinate deprecated APIs, use outdated conventions, or miss best practices entirely. With it, your AI follows a proven ruleset — every suggestion aligns with current standards.

Drop this skill into your project and your AI instantly knows the rules. Better code suggestions, fewer errors, faster shipping.

Try These Prompts

These prompts work better with the Prisma skill installed. Your AI knows the context and writes code that fits.

"Design a Prisma schema with proper relations, indexes, and enum types"

"Create Prisma migrations with seed data and type-safe query helpers"

"Build a data access layer with Prisma that handles pagination, filtering, and includes"

Prisma skill — FAQ

It provides Prisma schema design, migration patterns, and query optimization rules. Your AI generates correct Prisma schemas with proper relations, indexes, and type-safe queries.

Run `npx skills add YepAPI/skills --skill prisma` in your project root. This copies the skill file into your repo where your AI coding tool can read it automatically.

The skill covers proper indexing, select/include to avoid over-fetching, raw SQL for complex queries, and connection pooling. It also includes patterns for avoiding the N+1 query problem.

Want more skills?

Browse all 110 free skills for builders.

See All Skills