Cursor project rules work best when they are small, scoped and easy to maintain. Instead of keeping every instruction in one large file, split your rules into focused .mdc files.
Suggested structure
project/
.cursor/
rules/
project-overview.mdc
code-style.mdc
framework-rules.mdc
testing.mdc
Example .mdc rule
---
description: "React component conventions"
globs: "**/*.tsx"
alwaysApply: false
---
- Use functional components.
- Define explicit TypeScript props.
- Keep components focused and testable.
- Prefer accessible HTML before custom abstractions.
When to use globs
Use globs when a rule only applies to a subset of the project:
globs: "**/*.tsx"
globs: "src/**/*.{ts,tsx}"
globs: "app/**"
When to use AGENTS.md
Use AGENTS.md when you want a simpler markdown instruction file that can be read by coding agents and does not need MDC frontmatter.
Free generator
I made a free generator that creates .cursor/rules/*.mdc, AGENTS.md and legacy .cursorrules output:
Top comments (0)