.cursorrules

Project-level configuration file placed at the repository root. Contents are automatically injected into every AI interaction in the project — Chat, Composer, Tab completion. The most impactful Cursor configuration.

Syntax

cursor
# .cursorrules

## Stack
## File structure
## Coding standards
## Patterns to follow
## Patterns to avoid
## Testing conventions

Example

cursor
# .cursorrules

## Stack
- Next.js 14 App Router, TypeScript strict, Tailwind CSS, Supabase

## Coding Standards
- Named exports only — no default exports except Next.js pages
- All component props have explicit TypeScript interfaces
- Use const by default; let only when reassignment is necessary

## File Structure
- Components: src/components/[domain]/ComponentName.tsx
- Server actions: src/app/actions/[domain].ts

## Do not
- Import lodash — use native array methods
- Use any — always provide specific types
- Use useEffect for data fetching — use server components