Cursor Rules Collection — Community .mdc Config Rules
Community-curated collection of Cursor AI .mdc rule files for 40+ tech stacks. Drop a rule file into your project and Cursor follows your coding standards automatically. 5,000+ stars.
What it is
The Cursor Rules Collection is a community-curated set of .mdc configuration files for Cursor AI, covering 40+ technology stacks. These rule files teach Cursor your project's coding conventions, architectural patterns, preferred libraries, and naming standards. Instead of repeating instructions in every prompt, you drop a .mdc file into your project and Cursor follows the rules automatically.
Developers using Cursor who want consistent, project-aware code suggestions without manual prompt engineering benefit most. The collection covers frameworks like Next.js, React, Vue, Django, FastAPI, Go, Rust, and many more.
How it saves time or tokens
Without rules files, developers spend tokens re-explaining project conventions in every Cursor session. The .mdc files front-load this context so Cursor generates code that matches your project from the start. A well-configured rules file reduces back-and-forth corrections by 50% or more. The community collection means you do not need to write rules from scratch -- find your tech stack, customize the file, and start coding.
How to use
- Browse the collection and find rules for your tech stack:
git clone https://github.com/PatrickJS/awesome-cursorrules.git
ls awesome-cursorrules/rules/
- Copy the relevant .mdc file to your project's
.cursor/rules/directory:
mkdir -p .cursor/rules
cp awesome-cursorrules/rules/nextjs-typescript.mdc .cursor/rules/
- Open your project in Cursor. The rules are automatically loaded and applied to all AI interactions.
Example
# Example .mdc rule file for Next.js + TypeScript
Code Style
- Use TypeScript strict mode
- Prefer server components by default
- Use 'use client' directive only when needed
- Import from '@/' path alias
Architecture
- App Router (not Pages Router)
- Server Actions for mutations
- Zod for validation
- Tailwind CSS for styling
Naming
- Components: PascalCase
- Files: kebab-case
- API routes: route.ts in app/api/
Testing
- Vitest for unit tests
- Playwright for E2E
- Test files colocated with source
Related on TokRepo
- AI Coding Tools -- Coding agents and developer configuration tools
- Prompt Library -- Curated prompts and system instructions for AI tools
Common pitfalls
- Rules files are only effective in Cursor IDE. They do not transfer to Claude Code, Copilot, or other AI coding tools without conversion to each tool's format.
- Overly specific rules can conflict with each other. Keep rules high-level and focused on conventions rather than dictating exact implementations.
- The community collection is maintained by contributors with varying quality. Review and customize any rule file before adopting it -- do not blindly trust all suggestions.
Frequently Asked Questions
A .mdc file is Cursor's configuration format for AI rules. It uses Markdown with frontmatter to define instructions that Cursor follows during code generation. Rules can specify coding conventions, architecture patterns, preferred libraries, and naming standards.
You can use multiple .mdc files in the .cursor/rules/ directory. Cursor loads all of them. Organize by concern -- one for code style, one for architecture, one for testing. This makes rules modular and reusable across projects.
Yes. The collection is open source on GitHub. Submit a pull request with your .mdc file following the contribution guidelines. Include the tech stack, framework version, and a brief description.
Rules files add context to every Cursor interaction, which increases token usage slightly. However, the reduction in correction prompts typically results in net token savings. Keep rules concise to minimize overhead.
Not directly. Claude Code uses CLAUDE.md and .claude/rules/ files with a different format. The concepts are similar -- both define project conventions for AI agents -- but the file formats and loading mechanisms differ.
Citations (3)
- Awesome Cursor Rules GitHub— Community-curated Cursor rules for 40+ tech stacks
- Cursor Documentation— Cursor supports .mdc rule files for AI configuration
- Anthropic Claude Code Documentation— AI coding assistants benefit from project-specific context
Related on TokRepo
Source & Thanks
Created by Pontus Ab and community. Licensed under MIT.
cursor.directory — ⭐ 5,000+
Thanks to the community for standardizing AI-generated code quality.