Prisma Cursor Rules Template
Generate production-ready Prisma Cursor rules for Project Rules (.mdc), AGENTS.md, or legacy .cursorrules. This template encodes stack-specific conventions for projects using Prisma. Type-safe ORM with schema-first design and generated database clients.
The Complete Prisma Cursor Rules
The full rule set in all three formats Cursor understands — copy the one your project uses. Project Rules (.mdc) load per-file via globs, AGENTS.md is portable across AI tools, and .cursorrules is the legacy single-file format.
Replacing a legacy file? Read the guide to migrate .cursorrules to Cursor Project Rules (.mdc) before copying this template into your project.
---
description: "Schema Design"
alwaysApply: false
---
- Use singular model names (User, not Users).
- Use camelCase for model field names.
- Use @@map and @map for consistent database naming when needed.
- Define explicit relation fields on both sides for bidirectional relations.
- Use enums for fixed sets of values.
- Use @@index and @@unique for performance and data integrity.---
description: "Query Patterns"
alwaysApply: false
---
- Use include for eager loading related records.
- Use select for partial object queries to minimize data transfer.
- Use where with typed filter conditions.
- Use pagination with take, skip, and cursor for large datasets.
- Use transactions ($transaction) for atomic multi-operation writes.
- Use interactive transactions for dependent operations.---
description: "Migrations"
alwaysApply: false
---
- Use prisma migrate dev for development migrations.
- Use prisma migrate deploy for production deployments.
- Always review migration SQL before applying in production.
- Use prisma migrate reset for development database resets.
- Use seed files for reproducible test and development data.
- Keep migrations small and focused — one logical change per migration.Customize These Rules
The generator below is preloaded with the Prisma template. Adjust indentation, quotes, naming, add your own rules, then download — no need to start from scratch on the homepage.
What This Template Covers
Required guidance
- - Schema Design
- - Query Patterns
- - Migrations
Default style
- - Indentation: 2 spaces
- - Quotes: double
- - Semicolons: enabled
- - Naming: camelCase
Optional sections: Middleware & Extensions.
Frequently Asked Questions
- What does the Prisma Cursor rules template include?
- It includes 4 rule sections covering schema design, query patterns, migrations and other Prisma development conventions.
- Can I generate Prisma Project Rules and AGENTS.md from the same template?
- Yes. The generator can export the same stack-specific guidance as modern Project Rules (.mdc), AGENTS.md, or a legacy .cursorrules file.
- Should I combine Prisma with other Cursor rules templates?
- Yes. You can combine Prisma with related templates such as TypeScript, Tailwind CSS, Docker, or backend frameworks when your project uses multiple technologies.