Stage 2 · Lesson 2 of 6
Writing project rules in .cursor/rules
's live in .cursor/rules as .mdc files, with a small block (settings between two lines of three dashes) at the top. A plain .md file in that folder is ignored. The frontmatter decides when a rule loads: alwaysApply: true for every chat, globs for matching files, a description so the Agent pulls it in when relevant, or none of these so it loads only when you @-mention it.
Type /create-rule in the Agent to draft one. Cursor also reads in the root and in subfolders, and User Rules in settings apply to all your projects. Cursor's docs suggest keeping each rule under 500 lines and adding rules only when the Agent repeats a mistake.
Common trapsaving a rule with the .md extension and wondering why the Agent never follows it.
A question to check yourself, an AI practice session and 3 cheat sheet entries come when you add the roadmap to your account. Add it
Resources for this stage
Start with
- GuideFreeCursor Documentation
Anysphere
Work through the quickstart, then the Rules and Ignore file pages