Cursor9 minUpdated on 7/6/2026

The best Cursor rules by stack

Cursor generates code fast, but without a frame it ignores your conventions and your stack: a badly structured component here, an inconsistent style there. Cursor rules fix that: they are rule files that durably frame the AI on your project (framework, style, best practices). Rather than writing your own from scratch, this guide selects the best ready-to-use rules, sorted by stack, and shows how to add them to your project. One useful note: in Cursor, the 'rule' (always active) differs from the 'skill' (loaded on demand); the items below are rules.

Written byJulien Descourbes·Founder of llm-skills.com
The best Cursor rules by stack

Key takeaways

  • A Cursor rule is a file that frames Cursor's AI on your project: conventions, framework, code style.
  • You add it in the .cursor/rules folder (.mdc files) or via the older .cursorrules at the root; Cursor applies it automatically.
  • The most effective move is to start from a ready-to-use rule for your stack rather than writing your own from scratch.
  • A nuance to know: the rule is always active, the skill loads on demand. Here, these are rules.
The basics

What is a Cursor rule and how do you add it to a project?

A Cursor rule is a file that frames the behaviour of Cursor's AI on your project: your conventions, your stack, your code style. Instead of re-explaining your rules on every prompt, you set them once and Cursor applies them across the project.

Two formats coexist. The older .cursorrules, a single file at the root. And the new .cursor/rules system, a folder of .mdc files (Project Rules) you activate by folder or by file type, which is more flexible. To install a rule, you create the .cursor/rules folder, drop the file in it, and Cursor takes it into account automatically.

A word on vocabulary, because it is confusing. Cursor distinguishes the rule (always active in context) from the skill (loaded on demand, as in Claude Code). The items selected below, sorted by stack, are rules ready to copy into your project.

React and Next.js

Which Cursor rules for a Next.js and Tailwind project?

The most requested front-end stack deserves its rules. A Next.js rule frames the App Router, Server Components and file conventions. A Tailwind rule holds the consistency of utility classes and avoids wild custom CSS. A React and TypeScript rule sets hooks, prop typing and component structure.

The value is direct: Cursor stops generating a button or a form that ignores your design system, and follows your conventions from one component to the next. You keep a consistent front end without reviewing everything.

Three Cursor rules for your React and Next.js front end:

Python back end

Which Cursor rules for a Python back end with FastAPI or Django?

On the Python back-end side, two frameworks dominate. A FastAPI rule frames routes, Pydantic models, async and dependencies; a production-oriented variant adds structure, validation and error handling. A Django rule holds models, views and the framework's conventions.

These rules avoid the trap of generic Python code: Cursor respects your framework's idioms and your project organisation, instead of spitting out a tutorial example. You gain consistency across the whole API.

Three Cursor rules for your Python back end:

Go and Java

Which Cursor rules for a Go or Java Spring API?

For compiled languages, convention discipline matters even more. A Go rule frames structure, error handling and scalability patterns. A Java Spring Boot rule holds the layers, dependency injection and JPA. A Kotlin Spring rule does the same on the Kotlin side.

Cursor benefits from knowing the idioms of these ecosystems, where generic code passes review poorly. With the right rule, it produces a service aligned with your team's conventions rather than an approximate style.

Three Cursor rules for your Go and Java APIs:

Other front ends

Which Cursor rules for Astro Angular or Flutter?

React is not alone. An Astro rule frames content-oriented sites, with little JavaScript by default. An Angular and TypeScript rule holds the architecture, modules and typing. A Flutter rule structures a mobile app, its widgets and state management.

The idea stays the same whatever the framework: give Cursor your ecosystem's conventions so it produces idiomatic code. An Astro, Angular or Flutter project does not have the same rules as a React one.

Three Cursor rules for other modern front ends:

Tests and quality

Which Cursor rules to frame tests and code quality?

Beyond the framework, cross-cutting rules hold quality. A Cypress rule frames end-to-end tests; a Jest rule structures unit tests; a JavaScript and TypeScript quality rule enforces readability, strict typing and best practices whatever the project.

These rules act as a guardrail: Cursor writes tests consistent with your approach and code that passes review the first time. That is the difference between code that works and maintainable code.

Three Cursor rules for your tests and quality:

Take action

Where should you start with Cursor rules?

Start with your main stack: a Next.js and Tailwind rule for a React front end, a FastAPI or Django rule for a Python back end. Create the .cursor/rules folder, drop the rule in it, and test on a real feature to see the difference.

Then add a cross-cutting quality and testing rule that applies to the whole project. Two or three well-chosen rules beat a pile of files Cursor ends up ignoring. Check the source of each rule before adopting it.

Keep the blog's rule: the rule frames Cursor, you validate the result. A good Cursor rule does not replace your judgement, it makes the AI's code consistent with your conventions from the first draft.

Frequently asked questions about Cursor rules

What is the difference between a Cursor rule and a skill?

A Cursor rule is always active: it frames the AI continuously on your project. A skill loads on demand for a specific task, as in Claude Code. Cursor recently added skills on top of rules; to frame your stack day to day, rules are what you need.

Where do you put a Cursor rules file?

In your project's .cursor/rules folder, as .mdc files (Project Rules). The older .cursorrules format, a single file at the root, still works. Cursor applies the rule automatically once it is in place.

Do you have to write your own Cursor rules?

Not necessarily. For most common stacks, a ready-to-use rule covers the essentials. You start from that base and adjust it to your conventions, which is much faster than writing from a blank page.

Do Cursor rules slow Cursor down?

No, as long as you stay targeted. A rule well scoped by folder or file type only adds useful context. Piling up too many generic rules dilutes the context; two or three precise rules are better.

Ready to take action?

Explore the skills and plugins matched to your needs and install them in minutes in your AI coding tool.