Rules provide reusable context included at the start of the model context. Project rules live in .cursor/rules as version-controlled .mdc files with frontmatter. Cursor also supports User Rules, Team Rules and AGENTS.md as a simpler alternative.
What it does
Where Cursor Rules runs and what it adds, from its documentation
Project rules in .cursor/rules as .mdc files with description, globs and alwaysApply frontmatter
Four apply modes: Always, Intelligently (by description), Specific Files (globs), Manual (@-mention)
User Rules (global), Team Rules (dashboard, Team/Enterprise plans) and AGENTS.md
/create-rule in Agent chat generates a rule file
When to use it
Good fit
Encode codebase conventions that Agent should follow every session
Scope guidance to certain paths with globs
Share rules with a team via Team Rules
Not for
Plain .md files in .cursor/rules: they are ignored; use .mdc or AGENTS.md
Copying whole style guides: use a linter instead
How to install Cursor Rules
You need: Cursor
Type /create-rule in Agent and describe the rule, or open Customize > Rules > Add Rule
Rule is saved to .cursor/rules/.mdc
Set frontmatter: description, globs, alwaysApply
Commit the folder so the team shares it
Configuration example (from the official docs)
---
globs: src/components/**/*.tsx
alwaysApply: false
---
- Use named exports, not default exports
Not stated by the maintainers: Cursor is closed source; repo_url is a placeholder for the public getcursor org, not a verified rules repo; docs.cursor.com/en/context/rules served an SPA shell; content read from cursor.com/docs/rules; Public source repository (closed source or not verified).