Cursor (.cursor/rules/*.mdc)
Cursor’s modern multi-file rules system. Each .mdc file declares a description, optional file globs for scoping, and an alwaysApply flag. Multiple rules files compose; each one only loads when its glob or alwaysApply matches.
File path
.cursor/rules/main.mdcLength cap (recommended)
~400 lines
Frontmatter
Yes (YAML)
File globs
Yes
Format quirks
- Files live in .cursor/rules/ and end in .mdc
- Required frontmatter: description, globs, alwaysApply
- Globs can scope a rule to specific files (e.g. **/*.tsx)
- Multiple .mdc files compose at request time
Browse stack examples
Every stack page in the library has a one-click copy button for Cursor (.cursor/rules/*.mdc). Open any of these and pick "Cursor (.cursor/rules/*.mdc)" from the format dropdown.
Next.js (App Router) + TypeScript
Next.js App Router (TypeScript, Server Components)
Next.js + Supabase (Auth, Postgres, RLS)
Next.js + Prisma + Postgres
React 19 + TypeScript (Vite)
React Native + Expo (managed workflow)
Python + FastAPI + SQLAlchemy + Alembic
Python + Django + DRF
Python + pandas + numpy + scikit-learn (Jupyter)
PyTorch + Hugging Face + W&B
Node.js + Express + TypeScript
Turborepo + pnpm + TypeScript
Official docs: https://docs.cursor.com/context/rules