Cursor Rules: Where They Go and How to Share Them
Cursor reads project rules from .mdc files in .cursor/rules/. Each file starts with a short frontmatter block that says when the rule applies, followed by Markdown instructions. The single .cursorrules file at the repository root is the older, legacy format. Commit .cursor/rules/ to give the whole team the same rules.
Updated
What is in a .mdc rule file?
Frontmatter, then Markdown. The frontmatter tells Cursor when to include the rule; the Markdown is what the agent reads.
--- description: Write release notes from the pull requests merged since the last tag. alwaysApply: false --- # Release notes 1. Find the last tag with `git describe --tags --abbrev=0`. 2. List the pull requests merged since then. 3. Group them under Features, Fixes and Internal.
description: what the rule is for. WithalwaysApply: falseand no globs, the agent decides from this line whether to pull the rule in.globs: file patterns, such assrc/**/*.tsx, that attach the rule when matching files are in play.alwaysApply:trueputs the rule in every request. Keep that for a few short, universal rules.
How do .cursor/rules, .cursorrules and AGENTS.md differ?
.cursor/rules/ holds many scoped rules and is the current format. .cursorrules is one legacy file. AGENTS.md is a plain Markdown file that many agents read, not only Cursor.
| File | What it is | When to use it |
|---|---|---|
.cursor/rules/*.mdc | One file per rule, each with its own frontmatter. | Rules for Cursor, scoped to parts of the codebase. |
.cursorrules | A single file at the repository root. | Older projects. Move its contents into .cursor/rules/ when you can. |
AGENTS.md | Plain Markdown, no frontmatter. A convention many coding agents read. | Instructions every agent on the project should see, whichever one each person uses. |
Can I use a SKILL.md as a Cursor rule?
Yes. Deftro turns a skill into a rule when it installs it: the skill's description becomes the rule's description, and its steps become the body.
npx @deftro/cli install <handle>/<slug> --agent cursor
The rule is written to .cursor/rules/<slug>.mdc with alwaysApply: false, so Cursor includes it when a request matches the description. Any other files in the skill are copied to .cursor/rules/<slug>/ and listed at the end of the rule. Without --agent, the CLI writes for every agent folder it finds in the project, so one skill serves the Cursor and Claude Code users on the same team.
More guides
What are agent skills?
What an agent skill is, what goes in a SKILL.md, and how Claude Code, Cursor, Codex and Antigravity load them. With examples you can install.Install Claude Code skills
Where Claude Code looks for skills, how to install one with a single command, and how to keep a team on the same reviewed version.Skills vs MCP
Skills are instructions an agent reads; MCP servers are tools it calls. When to use each, and how they work together in Claude Code and Cursor.