---
name: "prisma-orm-schema-migrations"
description: "Model relational database schemas and generate fully type-safe TypeScript clients with Prisma."
metadata:
  author: "Prisma"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "define prisma schema"
  - "run prisma migrate dev"
  - "prisma generate client"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Prisma ORM Schema Modeling & Automated Migrations

Implements Prisma: defining schema.prisma with models and relations (@relation), generating clients (prisma generate), running migrations (prisma migrate dev), seeding databases (prisma/seed.ts), and Prisma Studio.

## When to Invoke
Invoke this skill whenever you need to:
- define prisma schema
- run prisma migrate dev
- prisma generate client

## Execution SOP & Rules
1. Define models in prisma/schema.prisma with @@index and @@unique constraints.
2. Run prisma generate whenever schema definitions change to update TypeScript types.
3. Apply development migrations: npx prisma migrate dev.
4. Use npx prisma studio to inspect and edit database records in an interactive web UI.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
