Cursor Rules Generator
Create a Cursor rule file (.mdc) with the right frontmatter for how you want it applied: always, agent-decided, auto-attached to matching files, or manual. The output updates live and runs entirely in your browser.
Generated rule
Save to .cursor/rules/my-rule.mdc
Add a description. An agent-requested rule with no description can never be auto-selected.
Common questions
- Where do Cursor rules live?
- Project rules live in the .cursor/rules directory as .mdc files, which pair a small block of YAML frontmatter with a Markdown body. The frontmatter fields are description, globs, and alwaysApply, and which ones you set determines when Cursor applies the rule.
- What is the difference between the four rule types?
- Always apply sets alwaysApply: true so the rule is in every request. Agent decides provides only a description and lets the agent pull the rule in when it is relevant. Auto-attach uses globs so the rule loads when a matching file is in context. Manual has no frontmatter fields and is only applied when you @-mention it.
- Does Cursor also read AGENTS.md?
- Yes. Modern Cursor versions read an AGENTS.md file at the repository root in addition to .cursor/rules. You can use AGENTS.md for broad project guidance and .mdc rules for more targeted, file-scoped instructions.