Cursor Rules are persistent instructions that tell the AI how to behave in your specific project. They're the difference between generic AI output and code that matches your team's exact conventions.
| Format | Location | Capabilities |
|---|---|---|
| .cursorrules (legacy) | Project root | Single file, always loaded |
| .cursor/rules/*.mdc (modern) | .cursor/rules/ directory | YAML frontmatter, glob patterns, conditional loading |
--- description: Enforce TypeScript best practices for components globs: src/components/** alwaysApply: false --- # Component Standards - Use functional components exclusively - Prefer named exports over default exports - Always define a Props interface - Use React.FC<Props> type annotation
alwaysApply: true)globs (e.g., frontend vs backend rules)alwaysApply: true rule consumes context window space in every interaction. Keep foundational rules under 200-300 words and modularize into separate files.