Home Benchmarks Learn Tools News
Learn · Guides · Tooling

Cursor for Web Developers.

The complete Cursor reference for web devs — modes, hooks, MCP, rules, skills, AGENTS.md, background and Cloud agents.

SPONSOR

AppSignal — Stop vibe-debugging. Every exception, every backtrace, grouped so you see patterns, not noise.

↗
On this page
  1. Setup that doesn't backfire
  2. Pick the right model per task
  3. Modes worth defining
  4. Rules vs Skills vs AGENTS.md
  5. Hooks: automation worth automating
  6. MCP servers worth the slot
  7. Background vs Cloud agents
  8. Common pitfalls
TL;DR
  • One AGENTS.md per repo. Half a page is enough — file map, conventions, "do not touch" list. That's your single biggest leverage.
  • Composer for fast, Sonnet for default, Opus for hard. Pick per task, not per session.
  • Skills > rules for capability-specific guidance. Rules apply every turn; skills load only when relevant.
  • Cloud agents for "go away and finish." Background agents for "keep working while I keep typing."
CH 01

Setup that doesn't backfire.

You don't need 12 hours of setup. You need three things in the right place: an AGENTS.md, the right model in the model picker, and a sane .cursorignore.

AGENTS.md (drop in repo root)
# Project — short name

## What this is
One-paragraph description of the app and stack.
Mention build tool, framework, package manager, deploy target.

## File map
- `src/app/`        — routes and pages
- `src/components/` — shared UI
- `src/lib/`        — server-side utilities
- `tests/e2e/`      — Playwright suites

## Conventions
- Components use BEM class naming.
- No utility CSS frameworks; design tokens live in `src/styles/tokens.css`.
- Server actions go in `*.action.ts`, not inside components.
- All copy is editable via `src/copy/` JSON files.

## Do not touch
- `legacy/` — being decommissioned, do not extend.
- `vendor/`, `dist/`, `.next/` — generated.

## Commands
- `pnpm dev` — local server
- `pnpm test` — full suite
- `pnpm lint --fix` — before commit
.cursorignore (what the agent should never read)
# build output and bloat
dist/
build/
.next/
out/
node_modules/
.turbo/
coverage/

# lockfiles confuse more than they help
package-lock.json
pnpm-lock.yaml
yarn.lock

# sensitive
.env
.env.*
*.pem

# big binary assets
public/**/*.{jpg,png,mp4,webm}

The .cursorignore matters more than it looks. If the agent thinks node_modules/ is fair game it will happily read 500MB looking for an answer.

CH 02

Pick the right model per task.

Cursor's model picker isn't a "favorite." It's a per-task choice. The Sonnet rule from the cost guide applies: most coding work is happily Sonnet-sized.

Task Model Why
Tab autocomplete Composer 2.5 Fast Latency > intelligence at this scale.
"Refactor this function" Composer 2.5 Fast or Sonnet 4.6 Composer if the change is local; Sonnet if it touches more than one file.
"Build a new component end-to-end" Sonnet 4.6 Sweet spot for multi-file work with tool calls.
"Why is this test flaking?" Opus 4.7 or GPT-5.5 Hard reasoning, often non-obvious; extended thinking pays off.
"Plan a full migration" Opus 4.7 Long-form planning is what Opus is for.
"Generate Playwright tests" GPT-5.3 Codex Codex is tuned for long autonomous test-writing runs.
"Summarize this codebase" Gemini 3.1 Pro 2M context wins when the answer is "read everything."
CH 03

Modes worth defining.

Custom modes are saved prompt-plus-tools-plus-model combos you can switch into. The built-in Ask, Agent, and Plan modes cover most work, but four custom modes are worth defining for web dev.

ModeSystem prompt seedTools enabled
Review "Read-only. Identify bugs, security issues, accessibility violations. Do not edit files." Read, search, grep. No write/shell.
Component Drafting "Build one component at a time. BEM CSS. Mobile-first. No JS framework imports unless asked." Read, write, browser MCP.
Bug Hunt "Reproduce first. Write a failing test, then fix. Confirm green, then refactor." Full stack incl. shell, Playwright MCP.
Doc Writer "Markdown only. Include real code examples. Verify the code runs before claiming it works." Read, write to docs/ only, shell.

Tip: the trick with modes is constraining tools, not just the prompt. A read-only Review mode that physically can't write files is more reliable than one with the instruction "don't write files."

CH 04

Rules vs Skills vs AGENTS.md.

They look similar. They're not. Pick the right shape for the kind of guidance you're encoding.

Mechanism Loaded Use for
AGENTS.md Once at session start Repo orientation: file map, conventions, "do not touch" list.
.cursor/rules/*.mdc Every turn (always-on or globbed) Hard constraints: "never write inline styles", "always use BEM".
.cursor/skills/*.md On-demand, agent decides Specialized capabilities: SEO templates, security audit, perf review.

The 80/20: one AGENTS.md, three or four globbed rules for must-have-every-turn conventions, then a stack of Skills for everything else. We publish a bunch of installable Skills at /skills/ built for this exact pattern.

Pitfall · "Always on" rules eat context

Every always-on rule adds tokens to every turn. A 2000-token rule run 50 turns/day on Sonnet = 100k tokens/day on input. That's $0.30/day per rule, every day. Use globs to scope rules to relevant files; reserve always-on for truly universal constraints.

CH 05

Hooks: automation worth automating.

Hooks run on agent events (pre-tool-call, post-edit, on-stop). Three are worth setting up for web dev:

  • Format on save — run Prettier after every write so the diff stays clean.
  • Lint on agent stop — run eslint --fix on edited files when the agent finishes a turn.
  • Test on stop, scoped — run only the tests affected by edited files (use vitest --related $(git diff --name-only)).

The trap is running too much in hooks. If your post-edit hook takes 12 seconds, the agent stalls 12 seconds every turn. Keep hook output under 2 seconds or move it to a CI step.

CH 06

MCP servers worth the slot.

Every MCP server you add ships its tool definitions in every prompt. The slot is not free. Five MCPs that pull their weight for web devs:

  1. Playwright MCP — drive a real browser from the agent. Game-changer for E2E test generation.
  2. Browser MCP (lightweight) — inspect DOM, take screenshots, debug layout from chat. Cheaper than spinning up Playwright if you just need a snapshot.
  3. Postgres / SQLite MCP — query your dev database without leaving the editor. Particularly good for "what does this query return?" loops.
  4. Linear or GitHub MCP — only if you live in one of them. Lets the agent read tickets and update status as work lands.
  5. Sentry / AppSignal MCP — surface real production errors as context. Pair with the observability section of the deploy guide.

Resist installing every shiny one. Two or three well-used MCPs beat a graveyard of unused ones with their tool descriptions burning context every turn.

CH 07

Background vs Cloud agents.

Three execution modes, three intents:

Mode Runs where Reach for when
Local Agent Your machine, foreground Pair-programming mode. You're watching, steering turn-by-turn.
Background Agent Your machine, headless You want to keep coding in the editor while the agent works on a parallel task.
Cloud Agent Cursor's infrastructure "Spend 45 minutes refactoring this. I'm closing my laptop. Open a PR."

Cloud agents are surprisingly cheap for what they do — Cursor amortizes the heavy lifting. Use them for: dependency upgrades, deleting dead code across a repo, scaffolding entire test suites, mechanical migrations. Don't use them for taste-heavy work (UI polish, copywriting) — you want to be in the loop for those.

PITFALLS

Common pitfalls.

Treating AGENTS.md as a manifesto

If your AGENTS.md is 6 pages of philosophy, the agent's attention dilutes. Aim for half a page. Concrete instructions only. Move long rationale into linked docs.

Auto-mode for new repos

"Auto" picks a model based on the request shape, but on an unfamiliar codebase it has no signal about complexity. Manually pick Sonnet for the first dozen turns until you've shaped a project rule that helps Auto decide.

MCP overload

15 MCP servers installed, 3 used. Each unused one is still loading its tool definitions every turn. Audit quarterly; remove anything you haven't invoked in a month.

What to read next.

  • Tool Cursor Tool profile with feature matrix and download.
  • Skills Installable SKILL.md Drop-in skills that work in Cursor — modern CSS, accessibility, security review, and more.
  • Guide · 04 Running 4 Agents at Once When you've outgrown a single Cursor window: worktrees, Conductor, the review discipline.
Changelog
  • 2026-05-18Initial publish covering Cursor 3.x feature set as of May 2026.
STATUS ● BUILDING THE FUTURE
MISSION LLM RESOURCES
VERSION BETA 3.0

BUILD WITH AI. SHIP WITH CONFIDENCE.

@WEBDEVELOPERHQ ↗
TERMS / PRIVACY
FRIENDS
Authentic Jobs ↗
Web Reference ↗
Ready.dev ↗
Fullres ↗
© 2026 WEB DEVELOPER / ALL RIGHTS RESERVED