Skip to main content
rulesSource-backedReview first Safety · Privacy

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.

by jaso0n0818·added 2026-06-17·
HarnessClaude Code
Review first review before installing

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

Show that Prisma Expert - CLAUDE.md Rules for Claude Code is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/rules/prisma-expert.svg)](https://heyclau.de/entry/rules/prisma-expert)

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.

FieldPrisma 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 riskReview firstReview firstReview firstReview first
Notes Safety · Privacy Safety · Privacy Safety · Privacy · Safety Privacy
Categoryrulesrulesrulesrules
Sourcesource-backedsource-backedsource-backedsource-backed
Authorjaso0n0818jaso0n0818jaso0n0818jaso0n0818
Added2026-06-172026-06-132026-06-132026-06-14
Platforms
Claude Code
Claude Code
Claude Code
Claude Code
Source repo
Safety notes— missing— missing— missingThese 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 notesRules 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.— missingRules 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
ClaimUnclaimedUnclaimedUnclaimedUnclaimed

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.