src/orchestrator/plugins/prisma/SKILL.md
Prisma ORM schema design, migrations, client generation, and query patterns. Use when designing database schemas, writing migrations, querying data, or managing Prisma Client.
npx skillsauth add etylsarin/opencastle prisma-databaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
For project-specific database schema and connection details, see database-config.md.
npx prisma init # Initialize Prisma in the project
npx prisma generate # Generate Prisma Client from schema
npx prisma migrate dev # Create and apply migration (dev)
npx prisma migrate deploy # Apply pending migrations (production)
npx prisma migrate reset # Reset database and apply all migrations
npx prisma db push # Push schema changes without migration
npx prisma db pull # Introspect database into schema
npx prisma db seed # Run seed script
npx prisma studio # Open visual database editor
npx prisma format # Format schema file
npx prisma validate # Validate schema syntax
// prisma/schema.prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
email String @unique
name String?
posts Post[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([email])
@@map("users")
}
model Post {
id String @id @default(cuid())
title String
content String?
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
authorId String
@@index([authorId])
@@map("posts")
}
cuid() or uuid() for IDs in distributed systems (avoid serial increments).createdAt and updatedAt timestamps for auditability and migrations.@relation definitions and add @@index on frequently queried columns.@map/@@map uses when renaming to prevent accidental column/table mismatches.npx prisma migrate dev during development to generate migrations; inspect the generated SQL before applying.npx prisma migrate deploy in CI/CD; never run migrate dev in production.npx prisma generate.npx prisma migrate dev --name <desc> locally to generate SQL.prisma/migrations/<timestamp>/migration.sql for destructive operations and add backfills as needed.npx prisma migrate deploy and assert clean application.For query patterns, singleton client pattern, and runnable CRUD examples see REFERENCE.md in this directory.
development
Defines 10 sequential validation gates: secret scanning, lint/test/build checks, blast radius analysis, dependency auditing, browser testing, cache management, regression checks, and smoke tests. Use when running pre-deploy validation or CI checks, CI/CD pipelines, deployment pipeline validation, pre-merge checks, continuous integration, or pull request validation.
development
Generates test plans, writes unit/integration/E2E test files, identifies coverage gaps, and flags common testing anti-patterns. Use when writing tests, creating test suites, planning test strategies, mocking dependencies, measuring code coverage, or test planning.
development
Provides model routing rules, validates delegation prerequisites, supplies cost tracking templates, and defines dead-letter queue formats for Team Lead orchestration. Load when assigning tasks to agents, choosing model tiers, starting a delegation session, running a multi-agent workflow, delegating work, choosing which model to use, or assigning tasks.
testing
Saves and restores session state including task progress, file changes, and delegation history. Use when saving progress, resuming interrupted work, picking up where you left off, or checkpointing current work.