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 template focuses Cursor AI on concrete Prisma practices instead of generic coding advice. Required sections are always included; optional sections can be enabled when they match your project.
Required guidance
- Schema Design
- Query Patterns
- Migrations
Default style
- Indentation: 2 spaces
- Quotes: double
- Semicolons: enabled
- Naming: camelCase
Optional sections: Middleware & Extensions.
Example Prisma Rules
The generator turns these sections into Project Rules with frontmatter, AGENTS.md, or a single .cursorrules file depending on the output format you choose.
Schema Design
- 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.
Query Patterns
- 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.
Migrations
- 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.
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.