Skip to main content
Cursor is an AI-powered code editor built on top of VS Code. It includes AI chat, inline code generation, and an agent mode that can autonomously make multi-file edits. Cursor reads AGENTS.md to give its AI features consistent project context — the same instructions that guide other agents apply in Cursor as well.

Cursor

Cursor — AI-powered code editor.

How Cursor uses AGENTS.md

Cursor picks up AGENTS.md as part of its project context. When you open a repository in Cursor, its AI features — including chat, Cmd+K inline edits, and agent mode — can reference the instructions in AGENTS.md to stay consistent with your project’s conventions. Placing AGENTS.md at the repository root makes it available project-wide. In a monorepo, you can place additional AGENTS.md files in subdirectories; the closest file to the code being edited takes precedence.
Keep your AGENTS.md focused on actionable rules — build commands, style conventions, and structural notes. Cursor’s AI uses this context most effectively when the instructions are specific and concrete.

Example AGENTS.md for Cursor users

AGENTS.md
# AGENTS.md

## Stack
- Next.js 14 with App Router
- Tailwind CSS for styling
- Prisma + PostgreSQL
- Vitest for unit tests, Playwright for end-to-end

## Build and test
- Install dependencies: `pnpm install`
- Start dev server on :3000: `pnpm dev`
- Production build: `pnpm build`
- Vitest unit tests: `pnpm test`
- Playwright end-to-end tests: `pnpm test:e2e`
- Lint: `pnpm lint`

## Code style
- Use Tailwind utility classes; avoid inline styles
- Components go in `src/components/` — one file per component
- Server components by default; add `'use client'` only when needed
- Use Zod for all runtime validation

## File structure
- `src/app/` — Next.js App Router pages and layouts
- `src/components/` — shared React components
- `src/lib/` — utilities and shared logic
- `src/server/` — server-only code (database, auth)
- `prisma/` — Prisma schema and migrations

## Commits
- Conventional Commits: `feat:`, `fix:`, `chore:`, `docs:`
- Keep PRs small and focused on one feature or fix

Build docs developers (and LLMs) love