Rules: prisma
Prisma's own skills (
prisma/skills) own the API; these rules own what must hold whichever skill is loaded — they live here, not in thedev-prismapointer, becau
Affected files
These rules apply to files matching the following patterns:
**/schema.prisma**/prisma/****/prisma.config.***/*prisma*
Detailed rules
Prisma Rules
Prisma's own skills (prisma/skills) own the API; these rules
own what must hold whichever skill is loaded — they live here, not in the dev-prisma pointer,
because a session may load the pointer, a vendor skill, or no skill at all (measured,
eval/skill-triggering/FINDINGS.md); a rule loaded by the files holds in every case.
Migrations
- NEVER use
prisma migrate devin production. Alwaysprisma migrate deploy. - NEVER rename a field in one migration. Two steps: add the new column → backfill → remove the old one (avoids prod downtime).
prisma generateMUST run after every schema change. Add it to the CI build step.
Security
- NEVER commit
.envwithDATABASE_URL. Always.env.examplewith placeholders. - YOU MUST use
selectinstead ofincludewhen you know the fields — never fetchpasswordHashor another sensitive column without explicit need (security + perf).
Performance
- YOU MUST add an index on every foreign key and on every column in frequent WHERE clauses.
- Singleton PrismaClient (HMR-safe
globalThispattern in dev) — avoid connection leaks.
Automatic application
These rules are automatically applied by Claude during:
- Reading the matching files
- Modifying code
- Suggestions and fixes