Skills
Cursor .mdc Glob-Scoped Rules: alwaysApply Separation + Compliance Verification Instruction Pattern
Split Cursor rules into `.cursor/rules/*.mdc` files using YAML frontmatter `globs` to scope rules to matching file types (e.g., only activate API conventions when editing `*.route.ts` files) and `alwaysApply: false` for everything context-specific. Add a meta-instruction at the top of each file: 'State which rules from this file you applied before writing code'—this forces the model to re-read and comply rather than hallucinate compliance. Files closer to the current directory override earlier files, enabling per-subdirectory rule overrides without cluttering the global config.
Source
↳ Follow the thread