Prisma Expert - CLAUDE.md Rules for Claude Code
Transform Claude into a Prisma specialist with deep knowledge of schema modeling, migrations, query optimization, relations, and production deployment patterns.
Open the source and read safety notes before installing.
Privacy notes
- Rules reference DATABASE_URL and other secrets; store them in environment variables or a secrets manager, never in committed schema or source code.
Schema details
- Install type
- copy
- Troubleshooting
- No
Full copyable content
You are an expert Prisma developer with deep knowledge of schema modeling,
migrations, client queries, relations, and production deployment.
## Schema Design
```prisma
model Order {
id String @id @default(cuid())
customerId String
customer Customer @relation(fields: [customerId], references: [id])
status OrderStatus
createdAt DateTime @default(now())
items OrderItem[]
}
```
- Model relations explicitly with `@relation` and clear `onDelete` behavior
- Use enums for closed sets; add `@@index` for real query filters
- Keep `schema.prisma` the single source of truth; avoid hand-editing DB state
## Migrations
- Generate migrations with `prisma migrate dev` in development
- Review SQL before applying; never rewrite applied migration history
- Use `prisma db push` only for prototypes, not shared production databases
- Plan zero-downtime changes: add columns nullable first, backfill, then constrain
## Query Patterns
- Select only needed fields with `select` or `include` deliberately
- Avoid N+1 queries: use `include`/`select` or batched `findMany` with `in`
- Prefer cursor pagination over large `skip` offsets on big tables
- Use `$transaction` for multi-step writes that must succeed or roll back
## Relations and Integrity
- Understand one-to-many vs many-to-many join table behavior
- Use cascading deletes only when business rules require orphan cleanup
- Validate referential assumptions in application code for partial updates
## Production
- Configure connection pool limits for serverless vs long-lived runtimes
- Use `prisma generate` in CI; pin Prisma versions across environments
- Monitor slow queries; add indexes based on measured access patterns
## Sources
- [Prisma Schema](https://www.prisma.io/docs/orm/prisma-schema)
- [Prisma Migrate](https://www.prisma.io/docs/orm/prisma-migrate)
- [Prisma Client](https://www.prisma.io/docs/orm/prisma-client)
- [Relation queries](https://www.prisma.io/docs/orm/prisma-client/queries/relation-queries)About this resource
Prisma Expert
Production-oriented Prisma rules for schema modeling, migrations, efficient queries, and safe deployment.
Usage
Copy the copySnippet block into your project's CLAUDE.md or reference this
rule file from your agent configuration.
Sources
Source citations
Add this badge to your README
How it compares
Prisma Expert - CLAUDE.md Rules for Claude Code side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Prisma Expert - CLAUDE.md Rules for Claude Code Transform Claude into a Prisma specialist with deep knowledge of schema modeling, migrations, query optimization, relations, and production deployment patterns. Open dossier | NestJS Expert - CLAUDE.md Rules for Claude Code Transform Claude into a NestJS specialist with deep knowledge of the module system, dependency injection, decorators, providers, guards, interceptors, and microservice patterns. Open dossier | Angular Expert - CLAUDE.md Rules for Claude Code Transform Claude into an Angular specialist with deep knowledge of standalone components, Angular Signals, dependency injection, RxJS patterns, and the Angular Style Guide. Open dossier | Django Expert - CLAUDE.md Rules for Claude Code Transform Claude into a Django specialist with deep knowledge of models, views, DRF serializers, migrations, middleware, and production deployment patterns. Open dossier |
|---|---|---|---|---|
| Trust | ||||
| Install risk | Review first | Review first | Review first | Review first |
| Notes | Safety · Privacy ✓ | Safety · Privacy ✓ | Safety · Privacy · | Safety ✓ Privacy ✓ |
| Category | rules | rules | rules | rules |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | jaso0n0818 | jaso0n0818 | jaso0n0818 | jaso0n0818 |
| Added | 2026-06-17 | 2026-06-13 | 2026-06-13 | 2026-06-14 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | — missing | — missing | — missing | ✓These are advisory Django coding rules applied to your project; review migrations, ORM queries, and on_delete cascade choices before running them against a real database. |
| Privacy notes | ✓Rules reference DATABASE_URL and other secrets; store them in environment variables or a secrets manager, never in committed schema or source code. | ✓Rules reference JWT tokens and OAuth2 authentication middleware; signing keys and client secrets must be stored in environment variables or a secrets manager, not in source code. | — missing | ✓Rules reference SECRET_KEY, database credentials, and API tokens; store them in environment variables, never in settings.py committed to git. |
| Prerequisites | — none listed | — none listed | — none listed | — none listed |
| Install | — | — | — | — |
| Config | — | — | — | — |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Signals
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.