| name | cursor-rules |
| description | Project, user, and team rules that the Cursor SDK and Agent load โ `.cursor/rules/*.mdc`, `AGENTS.md`, and the legacy `.cursorrules`. Use when authoring rules that the SDK will pick up via `local.settingSources`, or when writing rule frontmatter with the right type (always / auto-attached / agent-requested / manual). |
| metadata | {"internal":false,"source":"https://cursor.com/docs/context/rules"} |
cursor-rules
Rules are how you bake context into a project so every Agent run starts with the right instructions. The SDK reads them through local.settingSources โ see [[../cursor-sdk/references/local-options]].
When to use
- Adding repo-level coding conventions an SDK agent should follow
- Writing per-folder
AGENTS.md for nested context
- Migrating from
.cursorrules to .cursor/rules/*.mdc
- Choosing between always-on, auto-attached, agent-requested, and manual rules
File locations
- [[references/file-locations]] โ
.cursor/rules/, AGENTS.md, legacy .cursorrules
- [[references/scope-and-precedence]] โ team / project / user, hierarchy
Authoring .mdc rules
- [[references/mdc-frontmatter]] โ
description, globs, alwaysApply
- [[references/rule-types]] โ Always / Auto-attached / Agent-requested / Manual
- [[references/glob-patterns]] โ
**/*.tsx, comma-separated lists
AGENTS.md
- [[references/agents-md]] โ markdown-only, nested per directory
- [[references/agents-md-vs-rules]] โ when to pick which
SDK integration
- [[references/sdk-integration]] โ
settingSources and what loads where
- [[references/limitations]] โ Tab and Inline Edit don't read rules
Cross-links
- SDK setting sources โ [[../cursor-sdk/references/local-options]]
- Hooks (sibling .cursor/ feature) โ [[../cursor-hooks/SKILL]]
- Skills (sibling .cursor/ feature) โ [[../cursor-skills-system/SKILL]]