Layer .cursor/rules/*.mdc by scope
Per-folder .mdc rules with globs beat one giant .cursorrules — the model only sees what's relevant to the file it's editing.
- Type: Prompt
- Tags: Coding Agent Hacks, Intermediate, Cursor
- Updated: 2026-10-01
Prompt
Per-folder .mdc rules with globs beat one giant .cursorrules — the model only sees what's relevant to the file it's editing. Cursor's modern rule system lets you scope rules with a `globs:` frontmatter field. Put TS conventions in `rules/typescript.mdc` (globs: **/*.ts), API patterns in `rules/api.mdc` (globs: app/api/**), etc. Smaller, more relevant prompts → fewer hallucinated patterns. Implementation example: --- description: API route conventions globs: app/api/**/*.ts alwaysApply: false --- - Validate inputs with zod at the top of the handler - Return NextResponse.json — never raw Response - Errors: throw ApiError(status, code, message)
More prompts
- Expense Report Automation System — Save More Time
- Meeting Scheduling Link Standardization — Save More Time
- Invoice Generation and Delivery Automation — Save More Time
- Document Template Automation Library — Save More Time
- Calendar Management Automation Rules — Save More Time
- File Organization and Naming System — Save More Time
- Recurring Payment Automation Setup — Save More Time
- Data Entry Elimination Framework — Save More Time