How Cursor uses system prompts via rules
Cursor AI rules are system prompts stored in your project files or in Cursor's global Settings, which tell Cursor how to write code, what scope to operate within, and what constraints to follow before it generates or modifies any code. Cursor has two distinct levels of rules that stack: global rules for all projects, and project-level rules that override or extend them for a specific codebase.
What to put in your Cursor rules
Global rules (Settings → Rules for AI)
- Language and framework defaults - "Always use TypeScript. Prefer React functional components with hooks."
- Scope control - "Never modify files outside the directory I specify in my request."
- Uncertainty handling - "If you are unsure whether a change is correct, describe what you would do and ask if I want to proceed."
- Testing - "Write unit tests for all new functions unless I say otherwise."
- Comments - "Add JSDoc comments for all exported functions. Keep inline comments minimal."
Project rules (.cursor/rules/)
- Architecture decisions and patterns for this project
- Specific libraries and their preferred usage patterns
- Naming conventions for components, files, and variables
- Directories and files that are off-limits for modification
- Any legacy code areas that need special handling
System prompt vs master prompt vs user prompt in Cursor
| Layer | Where in Cursor | What it controls | Scope |
|---|---|---|---|
| Global rules | Settings → Rules for AI | Universal coding preferences and behavior | All projects |
| Project rules | .cursor/rules/ or .cursorrules | Codebase context, architecture, scope limits | This project only |
| User prompt | Composer or Chat input | The specific coding task | This task only |
Common questions
Should I use .cursorrules or .cursor/rules/?
.cursorrules still works but is legacy. .cursor/rules/ with .mdc files is the recommended modern approach. For simple projects .cursorrules is fine. For complex projects with multiple contexts .cursor/rules/ gives much more control.
How do Cursor rules interact with Chat vs Composer?
Rules apply to both. In Composer (multi-file editing), scope control rules are especially important because Composer can modify multiple files at once.
How is Cursor different from Windsurf?
Both use project-level rules files but file names differ. Cursor's rules system supports multiple scoped files. Windsurf's Cascade has stronger default multi-file context awareness. See our Windsurf guide for comparison.
Build your Cursor system prompt now
Answer a short set of questions and get a master prompt engineered specifically for Cursor. Free, no account needed.
Cursor prompts free · 3 builds/month · Pro is $19/month for unlimited builds and Advanced mode