Cursor Rules are persistent instructions that tell the AI how to behave. They're the difference between generic AI output and code that matches your team's exact conventions — because LLMs don't retain memory between completions, rules provide that persistent context. There are four kinds:
| Kind | Location | Scope |
|---|---|---|
| Project Rules | .cursor/rules/*.mdc | Version-controlled, per-project (nested dirs supported) |
| AGENTS.md | Project root (or subdirectories) | Plain-markdown alternative — open standard, no frontmatter needed |
| User Rules | Cursor Settings → Rules | Global, all your projects (agent chat only — not Ctrl+K) |
| Team Rules | Team dashboard (Team/Enterprise) | Org-wide, optionally enforced. Precedence: Team → Project → User |
.mdc extension — plain .md files in .cursor/rules/ are silently ignored. The legacy root .cursorrules file still works but is deprecated.--- 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 - Reference the canonical example: @src/components/Button.tsx
alwaysApply: true — loaded into every agent interactiondescription when relevantglobs@filename instead of pasting code into the rule/create-rule in the agent inputalwaysApply: true rule consumes context window space in every interaction. Keep foundational rules lean and modular. Also note: rules never affect Tab autocomplete — only agent interactions.Your team wants consistent AI behavior across the repo. Create the .cursor/rules directory and drop in your first MDC rule file.