What it does
Cursor's rules feature gives the Agent persistent instructions. Project rules are .mdc files in .cursor/rules, and there are also User Rules, Team Rules and plain AGENTS.md files.
Who it's for
Cursor users who are tired of repeating the same instructions every chat.
How to set it up
Type /create-rule in Cursor's Agent chat and describe the rule, or add one from Customize → Rules → Add Rule.
Rules are saved as .mdc files in .cursor/rules (plain .md files there are ignored). Commit them to git. Example rule:
markdown--- globs: src/components/**/*.tsx alwaysApply: false --- - Use named exports, not default exportsPick how each applies: Always Apply, Apply Intelligently (by description), Apply to Specific Files (globs), or Apply Manually (@-mention). Keep each under ~500 lines.
Check the official docs for the latest steps.
Example prompts
/create-rule Use named exports and Tailwind for all components in src/components.Following our project rules, create a new API route for user settings.Write an AGENTS.md for this repo based on package.json and the folder structure.Demo
Demo coming soon
A short walkthrough of Cursor Rules in action.