Cursor: .cursor/rules/*.mdc location, format and template
Where Cursor reads project instructions, whether it reads AGENTS.md, and what the format allows. From the official documentation, checked Oct 7, 2026. See also Cursor: pricing, popularity and alternatives.
Project files
.cursor/rules/*.mdc(subfolders allowed)AGENTS.mdat the root and in subfolders
Global (all projects)
- User Rules in Cursor settings (stored in the app, not a file); Team Rules from the dashboard on Team and Enterprise plans
AGENTS.md
✓ Yes, at the root and in subfolders.
Format and limits
- Project rules must use the
.mdcextension; a plain.mdfile in.cursor/rulesis ignored. - Front matter:
description,globs,alwaysApply. Always =alwaysApply: true; per file = globs; agent decides = description only; manual = neither, then @-mention the rule. - Keep each rule under 500 lines and split big ones.
- Rules don't affect Tab completions.
Sources: cursor.com/docs/context/rules
Templates
Cursor rule for React components
.cursor/rules/react-components.mdc---
description: Conventions for React components
globs: src/components/**/*.tsx
alwaysApply: false
---
- Function components with named exports.
- Props type named `<Component>Props`, declared above the component.
- Styling with the existing Tailwind classes; no inline style objects.
- Each new component gets a test next to it.
AGENTS.md for a TypeScript project
AGENTS.md# AGENTS.md
## Project
One paragraph: what this repository does and who uses it.
## Commands
- Install: `pnpm install`
- Dev server: `pnpm dev`
- Tests: `pnpm test` (run before you finish)
- Lint and types: `pnpm lint && pnpm typecheck`
## Layout
- `src/app/`: routes and pages
- `src/lib/`: shared logic, no UI code
- `tests/`: mirrors `src/`
## Conventions
- TypeScript strict mode; avoid `any`.
- Follow the patterns already in `src/` before adding new ones.
- Small, focused functions; name things for what they do.
## Boundaries
- Never read or edit `.env*` files or commit secrets.
- Ask before adding a dependency or changing a public API.
## Done means
Tests pass, lint is clean, and the change is explained in the PR description.
Written by AgentGid as a starting point; swap in your own commands and folders.
Other agents
Claude Code CLAUDE.mdOpenAI Codex AGENTS.mdGitHub Copilot .github/copilot-instructions.mdGemini CLI GEMINI.mdWindsurf (Devin Desktop) .windsurf/rules/*.mdCline .clinerules/Roo Code .roo/rules/Aider CONVENTIONS.mdZed .rulesJetBrains Junie .junie/AGENTS.mdKiro .kiro/steering/*.mdAmp AGENTS.mdContinue .continue/rules/goose AGENTS.md / .goosehintsOpenCode AGENTS.mdKilo Code AGENTS.mdAugment Code .augment/rules/Factory Droid AGENTS.mdQwen Code QWEN.mdWarp AGENTS.mdDevin AGENTS.mdJules AGENTS.mdReplit Agent replit.mdCrush CRUSH.md / AGENTS.md