DDS Vibe Academy Cursor 3.3 composer-2 New Branch / Class 01
Masterclass 29 / May 2026

The Ultimate Cursor
Masterclass. Agent-first.

The complete masterclass on Cursor 3.x — the agent-first AI IDE. 12 modules from the new Agents Window to the five primitives (Rules, Skills, Subagents, Hooks, MCP). 100 paste-ready prompts. 6 reusable skill packages. 8 production templates. Composer 2 mastery, Bugbot, the Plugin Marketplace, Build in Parallel. Beginner to expert. No fluff.

12
Modules
100
Prompts
~14h
Workload
$0
Course Cost
Quick Answer

Cursor 3.3 (released May 7, 2026) is the current version of the agent-first AI IDE from Anysphere. The 3.x line introduced the Agents Window as the default surface, replacing the classic file-tree-first IDE view — though the classic IDE remains available and you can toggle between them at any time.

The mental model that matters most: every Cursor capability today fits into five primitives — Rules (.cursor/rules/*.mdc), Skills (.cursor/skills/*/SKILL.md), Subagents (.cursor/agents/), Hooks (.cursor/hooks.json), and MCP servers (.cursor/mcp.json). Plugins from the Marketplace bundle one or more of these into single installable packages.

This masterclass walks every primitive end-to-end with 100 paste-ready prompts, 6 reusable skill packages, 8 production templates, and the honest decision matrix against Claude Code, Windsurf, Copilot, and Antigravity.

Author Robert McCullock, Architect-CEO, Design Delight Studio
Verified Against Cursor changelog, official docs, May 2026
Scope Beginner to expert. Solo, team, enterprise patterns.
Who This Is For

Three personas, three paths through the masterclass.

This is a 12-module curriculum plus reference sections. Most readers do not need every module on the first pass. Pick the persona closest to your situation and the path below points to the modules that pay back fastest.

Beginner

You have never opened Cursor.

You have heard the hype. You want to install Cursor, ship your first useful change, and understand the mental model before drowning in features.

  • Read Modules 1, 2, 4, 5 in order
  • Skip Modules 6, 7, 9, 10, 11 on the first pass
  • Use Auto mode until you understand credits
Power User

You ship daily inside Cursor.

You want the five primitives mastered, multi-agent workflows running cleanly, and your team's .cursor/rules stack locked in.

  • Read all 12 modules in order
  • Modules 3, 6, 7, 10 are your daily reference
  • The 6 Skill packages save hours per week
Engineering Lead

You roll Cursor out to a team.

You need cost discipline, team marketplaces, Bugbot in CI, enterprise SSO, and the honest answer on Cursor vs Claude Code for your specific stack.

  • Modules 8, 9, 11, 12 are your daily reference
  • Module 7 (MCP) for the security hardening section
  • The cost calculator answers the budget question
The Mental Model
FIVE PRIMITIVES ARCHITECTURE

Every Cursor capability fits in one of these five buckets. Master the buckets, master the IDE.

R
Rules
.cursor/rules/*.mdc

Persistent context. YAML frontmatter (description, globs, alwaysApply). Always-on or glob-scoped or description-loaded. Project > User precedence.

S
Skills
.cursor/skills/*/SKILL.md

Dynamic capability modules. Loaded only when the agent decides relevant. Bundle scripts, references, templates. Invoke via slash command or auto-discovery.

A
Subagents
.cursor/agents/

Parallel specialized agents. Own context window. Own tool access. Own model selection. Run frontend + backend + tests in parallel.

H
Hooks
.cursor/hooks.json

Deterministic scripts. Run before/after agent actions. PreToolUse, PostToolUse, stop, beforeSubmitPrompt. Hard guardrails, no AI judgment.

M
MCP
.cursor/mcp.json

External tool connections. stdio or Streamable HTTP transport. Hard limit ~40 tools across all servers combined. Project config wins.

Plugins = Bundled Primitives

Plugins from the Marketplace package one or more of these five primitives into a single installable unit. Launched February 17, 2026 with Cursor 2.5. Launch partners: Amplitude, AWS, Figma, Linear, Stripe, Cloudflare, Vercel, Databricks, Snowflake, Hex. Browse at cursor.com/marketplace or install via /add-plugin in the editor.

module-01_master-the-new-reality.mdc module-02.mdc module-03.mdc
MODULE 01 / 12

Master the New Reality

Cursor changed more in the six months between October 2025 and May 2026 than in its previous two years combined. Cursor 3.x rebuilt the entire interface around agents. Composer 2 shipped as a proprietary frontier model. Bugbot moved from beta to a 70%+ resolution rate across 2M+ PRs/month. The Plugin Marketplace launched. The five primitives architecture solidified. This module is the orientation.

You will leave this module able to:

  • Explain what Cursor 3.x is, the Agents Window, and the five primitives architecture
  • Pick the right plan (Hobby / Pro / Pro+ / Ultra / Teams / Enterprise) for your workflow
  • Understand the credit-based pricing model and how to avoid surprise bills

1.1 What Cursor actually is today

Cursor is a fork of VS Code with AI woven into every layer. Originally a smarter autocomplete in 2023, by mid-2025 it had Composer multi-file editing, by late 2025 it had Background Agents and Bugbot, and on April 2, 2026 it launched Cursor 3.0 with the Agents Window as the new default interface.

The current version as of this writing is Cursor 3.3, released May 7, 2026. The 3.x line added:

  • Agents Window (3.0) — the new agent-first default surface, replacing the file-tree-first IDE view. You can still toggle back to classic IDE mode at any time.
  • Tiled Layout (3.0) — split panes for running and managing multiple agents in parallel, persistent across sessions.
  • Canvases (3.1) — interactive visualizations and dashboards rendered inside agent chats; durable artifacts in the side panel.
  • Quick-action pills (3.2) — pin your most-used skills as one-tap actions.
  • Build in Parallel (3.3) — auto-identifies independent parts of a plan and runs them simultaneously as async subagents.
  • New PR review experience (3.3) — Reviews, Commits, Changes tabs all inside Cursor.

1.2 The five primitives

The most useful mental model for the entire Cursor surface today is the five primitives architecture. See the diagram above. Everything you configure in Cursor is one of these five things or a plugin that bundles them.

1.3 Pricing reality in May 2026

Cursor switched from request-based to credit-based billing in June 2025 — a change that generated real community backlash but is now the stable model. Each paid plan includes a credit pool equal to the subscription price. Tab completions and Auto mode use minimal credits. Manually selecting frontier models like Claude Opus or GPT-5 burns credits at the underlying API rates.

Cursor pricing tiers as of May 2026 with included usage and best fit.
Plan Price Included Usage Best For
HobbyFreeLimited Tab + AgentEvaluating Cursor; students with edu email
Pro$20/mo$20 credit pool, Auto unlimitedDaily individual developer use
Pro+$60/mo3x Pro usage on Claude/GPT/GeminiHeavy agent users hitting Pro limits
Ultra$200/mo20x Pro usage + priority featuresFull-time AI-native development
Teams$40/user/moPro-equivalent + admin + SSO3+ developer teams
EnterpriseCustomPooled usage + audit + self-hosted poolCompliance, security review, on-prem

1.4 The 60-second decision tree

  1. Never used Cursor? → Start on Hobby. Free, no credit card.
  2. Code daily and want AI everywhere? → Pro ($20). Sufficient for ~90% of working developers.
  3. Burning through Pro credits every month? → Pro+ ($60). 3x usage, identical features.
  4. Running agents continuously, treating Cursor as infrastructure? → Ultra ($200).
  5. Team of 3+ developers? → Teams ($40/seat) for centralized billing and shared rules.
  6. Compliance, audit, SSO, on-prem? → Enterprise. Contact sales.

1.5 Three things to do today

  1. Install Cursor from cursor.com/download. It works on macOS, Windows, Linux.
  2. Open a real project (not a toy). Press Cmd+Shift+P and type "Agents Window" to see the new interface.
  3. Skim Module 2 for the mental model, then return to Module 3 to set up your first .cursor/rules file.
The Honest Take

If you spent the last year ignoring Cursor because the early experience was rough or the pricing changes were chaotic, May 2026 is a fair time to look again. The five primitives architecture, Composer 2's 200K context, Bugbot's 70%+ resolution rate, and the Plugin Marketplace add up to a meaningfully different product than the one you remember. Whether Cursor or Claude Code is the right primary tool for you is Module 12's job. Either way, you should know what Cursor actually does in 2026.

module-01.mdc module-02_the-cursor-mental-model.mdc module-03.mdc
MODULE 02 / 12

The Cursor Mental Model

Cursor exposes nine distinct surfaces for interacting with AI. Each has a different cost, latency, and ideal use case. The biggest productivity unlock is matching the surface to the job — most developers waste credits by reaching for Agent Mode when Inline Edit would have done it in a second.

You will leave this module able to:

  • Pick the right Cursor surface for any given task instantly
  • Understand how Auto mode routing saves credits without sacrificing quality
  • Know when to escalate from Composer to Agent to Background Agents

2.1 The nine surfaces

The nine Cursor surfaces, what they do, when to use them, and approximate credit cost.
Surface Shortcut What it does When to use Credit cost
Tab Tab Inline autocomplete suggestions Line-by-line coding flow Minimal (often free)
Chat Cmd+L Sidebar Q&A about the codebase Understanding code; asking questions Low
Inline Edit Cmd+K Edit selected code via natural language Single-file targeted edits, refactors Low
Composer Cmd+I Multi-file edits with planning Adding features touching 2-10 files Medium
Agent Cmd+I (Agent mode) Autonomous multi-step task execution Open-ended tasks, "let it run" Medium-High
Background Agents Cmd+Shift+P Long-running agents off the main thread Tests running while you code; PR reviews Medium
Cloud Agents Agents Window Agents running in Cursor cloud VMs Heavy refactors; multi-hour tasks High
Bugbot GitHub PR auto-trigger Automated PR review + Autofix Every PR ~$1.00-1.50/run
Browser / Design Mode Cmd+Shift+D Annotate live UI; preview app Frontend work, design-to-code Medium

2.2 The escalation ladder

The single most useful habit: start at the cheapest surface that could possibly work, escalate only when needed.

  1. Tab first. If autocomplete can finish the line, let it.
  2. Cmd+K next. For "change this function to do X", select the function and press Cmd+K. Don't open Composer.
  3. Cmd+L for questions. "How does the auth flow work?" goes in Chat, not Composer.
  4. Cmd+I for multi-file edits. Composer is the right tool for features that touch 2-10 files.
  5. Agent Mode for open-ended. "Add OAuth support" with unclear scope = Agent Mode.
  6. Background Agents for parallel. Tests running, lint fixing, doc generating — all in parallel to your active work.
  7. Cloud Agents for heavy. Multi-hour migrations, large refactors, tasks that would tie up your local machine.

2.3 Auto mode: the secret to credit discipline

Auto mode is Cursor's automatic model routing. It picks a cost-efficient model (typically Cursor's Auto model at roughly $0.25/M cache, $1.25/M input, $6.00/M output) for whatever task you give it. Auto mode usage on paid plans does not draw from your credit pool — it is effectively unlimited.

Credit-saving rule

Default to Auto mode. Only manually pick a frontier model (Claude Opus 4.6, GPT-5, Composer 2) when you have a specific reason: complex architectural reasoning, large refactor needing deep code understanding, or final review of important work. Treating frontier models like infrastructure rather than a default tool is the difference between $20/month and $200/month.

2.4 Composer 2 vs Auto vs frontier models

Composer 2 deserves its own module (Module 4), but here is the quick frame: it is Cursor's proprietary coding-specialized model. Cheaper than Claude Opus, faster than GPT-5, and competitive on coding-specific benchmarks. For most multi-file Composer tasks, Composer 2 (or Auto routing to it) is the right answer. Reserve frontier models for tasks that need broad reasoning beyond pure coding.

2.5 The browser and Design Mode

Cursor's built-in browser opens, navigates, and prompts against local websites. Design Mode (Cmd+Shift+D) lets you annotate and target UI elements directly. Shift+drag selects an area, Cmd+L adds the selection to chat, Option+click adds an element to the input.

This is the right tool for frontend iteration. Instead of describing "the button on the top-right of the settings page", click it. Instead of asking "why is this layout broken", point at it.

module-02.mdc module-03_rules-the-cursor-rules-system.mdc module-04.mdc
MODULE 03 / 12

Rules: The .cursor/rules System

Rules are the highest-ROI configuration in Cursor. A team running with well-crafted rules consistently generates code that matches their stack, conventions, and constraints — without re-explaining everything in every conversation. The single biggest mistake new Cursor users make is skipping this module.

You will leave this module able to:

  • Write .mdc rule files with correct frontmatter
  • Use globs and alwaysApply to scope rules without bloating context
  • Structure project rules, user rules, and AGENTS.md for a team

3.1 The structure

Rules live in .cursor/rules/ at the repo root. Each rule is a .mdc file (markdown with YAML frontmatter). The legacy .cursorrules file at the repo root still works for backwards compatibility, but the directory pattern is the current recommended structure.

my-project/ ├── .cursor/ │ ├── rules/ │ │ ├── 000-style-guide.mdc (alwaysApply: true) │ │ ├── 100-typescript.mdc (globs: **/*.ts, **/*.tsx) │ │ ├── 200-react-components.mdc (globs: components/**/*) │ │ ├── 300-api-routes.mdc (globs: app/api/**/*) │ │ └── 400-shopify-liquid.mdc (globs: sections/**/*.liquid) │ ├── agents/ │ ├── hooks.json │ └── mcp.json ├── AGENTS.md (project-root alternative) └── .cursorignore

3.2 The three rule types

  1. Always-on rules. Frontmatter has alwaysApply: true. Prepended to every conversation. Use sparingly — bloated always-on rules destroy context quality.
  2. Glob-scoped rules. Frontmatter has globs: "**/*.ts" or similar. Only loaded when matching files are in context. Use for stack-specific rules (React conventions, Python style, Liquid patterns).
  3. Description-only rules. Frontmatter has only description. Loaded when the agent decides they are relevant based on the description. Use for procedural how-tos that should only activate when needed.

3.3 Anatomy of a rule file

--- description: TypeScript conventions, strict-mode patterns, and forbidden constructs for this codebase. globs: "**/*.ts,**/*.tsx" alwaysApply: false --- # TypeScript Rules ## Strict Mode - TypeScript strict mode is REQUIRED. No `any` unless typed via `unknown` first and narrowed. - No `as` casts except when bridging to external libraries with broken types. - No non-null assertions (`!`). Use proper narrowing or throw with context. ## Imports - Use `import type { ... }` for type-only imports. - Path aliases via `@/` for internal modules; never relative `../../../`. ## Patterns - Async functions always return `Promise<Result<T, E>>` for fallible operations. Use the `Result` type from `@/lib/result.ts`. Never throw across module boundaries. - React components use function syntax + named export. No default exports for components. - Server actions live in `app/actions/` and have the `"use server"` directive. ## Forbidden - `console.log` in committed code (use the logger from `@/lib/log.ts`). - Inline styles. Use Tailwind utility classes via `cn()` helper. - Direct database access from components. Always go through `/lib/db/` repositories.

3.4 Frontmatter rules

  • description — keyword-rich, helps the agent decide when to load the rule. The single most important field for description-only rules.
  • globs — comma-separated glob patterns. Rule loads when matching files enter context.
  • alwaysApply — true or false. Use sparingly. A few critical always-on rules beat dozens of bloated ones.

3.5 Precedence: Team → Project → User

Three locations for rules, in order of priority when there's a conflict:

  1. Team rules — configured in the Cursor team dashboard. Apply to every team member, every project.
  2. Project rules.cursor/rules/ in the repo. Apply to anyone working in the project.
  3. User rules — Cursor Settings > Rules. Apply to you across all projects.

3.6 AGENTS.md as a project-root alternative

For smaller projects, a single AGENTS.md at the repo root works as a plain markdown alternative to the .cursor/rules/ directory. No frontmatter required. Same idea: persistent instructions that shape every AI interaction in the project. Use AGENTS.md when you want one simple file. Use .cursor/rules/ when you want composable, glob-scoped rules that grow with the project.

3.7 The 5 highest-ROI rules to write first

  1. Style guide (alwaysApply) — naming conventions, formatting, file structure, banned patterns. Keep under 200 lines.
  2. Stack rules (globs by language) — TypeScript rules in **/*.ts, Python rules in **/*.py, etc.
  3. Architecture rules (globs by directory) — "components must not import from app/api/", "lib/ has no React imports", etc.
  4. Testing rules (globs by test pattern) — required coverage, naming, the testing library to use.
  5. Brand voice rules (alwaysApply for content-heavy projects) — tone, banned words, copy patterns.
Composable, not exhaustive

Keep each rule file under 500 lines. Split by concern. Reference (don't copy) long runbooks; link to a docs/ file or external URL instead. Start simple, add rules when the agent keeps making the same mistake. A bloated rules directory teaches the agent nothing; a focused one teaches it everything that matters.

module-03.mdc module-04_composer-2-mastery.mdc module-05.mdc
MODULE 04 / 12

Composer 2 Mastery

Composer 2 is Cursor's proprietary coding-specialized model, released March 19, 2026. It is the only first-party model in the IDE and the one Auto mode routes to most often for substantive coding work. This module is everything you need to use it well.

You will leave this module able to:

  • Understand what Composer 2 is, what it scores, and when to use it
  • Decide between Composer 2, Auto mode, and frontier models per task
  • Structure long-horizon Composer prompts for the 200K context window

4.1 The hard facts

  • Released: March 19, 2026
  • Context window: 200,000 tokens
  • Base model: Kimi K2.5 with Cursor's continued pretraining + reinforcement learning (confirmed March 20, 2026 after user discovery in API headers)
  • Pricing: $0.50/M input, $2.50/M output (Standard); $1.50/M input, $7.50/M output (Fast variant, set as default)
  • Benchmarks: 61.3 CursorBench, 61.7 Terminal-Bench 2.0, 73.7 SWE-bench Multilingual
  • Cost vs Composer 1.5: ~86% cheaper

4.2 What Composer 2 actually is

A coding-specialized model trained in two phases: continued pretraining on coding-specific data first, then large-scale reinforcement learning on long-horizon coding tasks. The RL phase uses "compaction-in-the-loop" — the model learns to compress its own context to roughly 1,000 tokens when approaching length thresholds, which reduces compaction error by 50% versus prior methods.

Practical implication: Composer 2 can run for hundreds of sequential actions without losing the plot. This is what makes it useful for actual multi-file refactors, not just for single-file edits.

4.3 When to pick Composer 2 over Claude/GPT

Decision matrix for picking Composer 2, Auto routing, or a frontier model.
Task type Best choice Why
Multi-file refactor in existing codebaseComposer 2Optimized for exactly this; 200K context handles big diffs
Implementing a feature spec across 5-10 filesComposer 2Coding-specialized; cheaper than Opus
Long-horizon task (hundreds of steps)Composer 2Compaction-in-the-loop training
Architectural reasoning, system designClaude Opus 4.6/4.7Broader reasoning, not coding-specific
Hardest coding benchmarks (SWE-bench top tier)GPT-5 / Opus 4.7Composer 2 trails GPT-5 at 75.1 on Terminal-Bench
Routine completions and small editsAuto modeRoutes to the cheapest sufficient model, no credit burn
Document writing, planning, non-codeFrontier modelsComposer is coding-optimized, weaker on prose

4.4 The 200K context — how to actually use it

200K tokens is roughly 150,000 words of code and context. That is several large files plus your entire .cursor/rules stack plus the relevant docs. To exploit it well:

  1. Start with discovery. Ask Composer to scan the relevant directory and tell you what it finds before writing code. This loads the right context.
  2. Use @ mentions deliberately. @codebase for broad discovery; @filename for focused work; @folder for module-scoped context.
  3. Break work into named goals. "Goal 1: create the service layer. Goal 2: add the API endpoint. Goal 3: write tests. Start with Goal 1 and show me before moving on."
  4. Pause at boundaries. Approve the plan before implementation. Approve each file before the next. Long-horizon does not mean uncontrolled.

4.5 The "scan, plan, implement" template

Phase 1 — SCAN Scan the @src directory and tell me: 1. The main architecture patterns you observe 2. How state management works in this codebase 3. Where the API layer lives 4. Existing test patterns and frameworks Pause and wait for me before continuing. --- Phase 2 — PLAN I want to add [FEATURE]. Before writing code, give me: 1. The files you will create 2. The files you will modify 3. The existing patterns you will follow 4. Any open questions about the requirements Wait for my approval before implementing. --- Phase 3 — IMPLEMENT Implement the approved plan. Goals in order: 1. Create the service layer in /src/services/ 2. Add the API endpoint in /src/api/ 3. Update types in /src/types/ 4. Write unit tests for the service Constraints: - Follow the patterns in /src/services/user.service.ts - Don't break existing API contracts - All new functions need JSDoc - Use the Result<T, E> pattern for fallible operations Start with Goal 1. Pause and show me the diff before moving to Goal 2.
Composer 2 disclosure note

Cursor did not initially disclose the Kimi K2.5 base for Composer 2 in the March 19 launch post. Users discovered it in API headers on March 20. Lin Qiao (CEO of Fireworks AI) confirmed Cursor was license-compliant from day one through Fireworks. Moonshot AI confirmed the arrangement as an authorized commercial partnership. Cursor founders acknowledged the non-disclosure was a miss and committed to base-model transparency going forward. This matters if you have policy requirements around model provenance.

module-04.mdc module-05_agent-mode-deep-dive.mdc module-06.mdc
MODULE 05 / 12

Agent Mode Deep Dive

Composer with Agent Mode turned on is when Cursor stops being autocomplete and becomes a coworker. You describe a task in natural language, the agent makes a plan, edits files, runs commands, and shows you a diff to approve. The "let it run" workflow is where Cursor 3.x diverges hardest from VS Code + Copilot.

You will leave this module able to:

  • Activate Agent Mode and understand the difference from Composer
  • Use approval gates, sandboxes, and worktrees to run safely
  • Recognize when a task is wrong for Agent Mode and stay with Composer

5.1 Agent Mode vs Composer

Composer in default mode plans, edits, and stops. Agent Mode plans, edits, runs commands, reads output, course-corrects, and continues until the task is done or you stop it. The escalation is from "edit my files" to "go execute this task."

5.2 The approval gate system

  • File edit approval — by default the agent asks before touching files
  • Terminal command approval — by default the agent asks before running commands
  • Sandbox mode — agent runs in an isolated environment; can approve "everything in sandbox" once for the session
  • YOLO / Run Everything mode — no approval gates. Use only with full Git commits and a clean branch.

5.3 The worktree pattern

Cursor 3 added the /worktree command that creates a separate Git worktree so the agent's changes happen in isolation. Pair with /best-of-n to run the same task in parallel across multiple models in their own worktrees, then compare outcomes. This is the safest way to let an agent run.

/worktree feature-oauth # spin up isolated worktree /best-of-n 3 implement OAuth # run same task 3x in parallel

5.4 The "scan, plan, build, verify" loop

  1. Scan — agent reads relevant files, asks clarifying questions if scope is ambiguous
  2. Plan — agent proposes file changes and approach. You approve.
  3. Build — agent implements. Approval gates trigger per-file.
  4. Verify — agent runs tests, lint, build. Self-corrects on failures.

5.5 When NOT to use Agent Mode

  • Single-file edits — Cmd+K is faster and cheaper
  • Quick questions — Cmd+L (Chat) is faster and free
  • Code you don't understand — Agent will commit code you can't review. Stay with Composer + manual approval per change.
  • Tightly coupled changes — Agent's planning can fragment dependent changes. Better as a tight Composer plan.
  • Brand-critical content — Agent will make creative choices. Stay tight on tone and review every diff.
Sandbox safety

Agent Mode + YOLO mode + production credentials in the environment = a bad day. Always run Agent Mode either: (a) on a clean branch with no production secrets in env, (b) in a worktree, or (c) in Cursor's sandbox mode. Cursor 2.5 added granular network and filesystem access controls to the sandbox — use them.

module-05.mdc module-06_subagents-and-parallel-work.mdc module-07.mdc
MODULE 06 / 12

Subagents and Parallel Work

Subagents are independent specialized agents with their own context window, tool access, and model selection. They run in parallel with the main agent. Cursor 3.3's "Build in Parallel" feature automatically identifies independent parts of a plan and runs them simultaneously as async subagents. This is the feature that makes Cursor materially faster than its competitors for many real workflows.

You will leave this module able to:

  • Define custom subagents in .cursor/agents/
  • Use the frontend/backend split pattern and the test-runner pattern
  • Use Build in Parallel for plans the model can auto-split

6.1 Built-in subagents

Cursor ships default subagents you can use without configuration:

  • Explore — researches the codebase, returns a focused summary
  • Bash — runs terminal commands in isolation
  • Browser — drives the in-editor browser for verification

6.2 Custom subagent structure

Custom subagents live in .cursor/agents/ (project) or ~/.cursor/agents/ (user). Each is a markdown file with YAML frontmatter:

--- name: test-runner description: Runs the test suite, reports failures, suggests fixes. Use when the main agent has made changes and you want test feedback before continuing. model: composer-2 tools: - bash - read_file --- # Test Runner Subagent Your job is to run the test suite for the project and report failures. ## Workflow 1. Detect the testing framework (vitest, jest, pytest, etc.) 2. Run the test suite with the appropriate command 3. Parse the output 4. For each failure, identify: - The test that failed - The assertion that failed - The file and line where the failure occurred - Likely cause based on recent changes 5. Return a structured report to the parent agent ## Constraints - Do not modify test files unless explicitly asked - Do not modify source files - If the test suite cannot be detected or run, return that fact clearly - Pass through any environment-specific test commands from package.json scripts

6.3 The three highest-ROI subagent patterns

Pattern A: Frontend / Backend split

The most immediately useful pattern. Define a shared TypeScript interface or Zod schema first. Spawn two subagents: one implements the React component against the interface, the other implements the API endpoint to match. When both finish, integration usually works on the first try.

Pattern B: Test runner in the background

Main agent writes implementation. A test-runner subagent (see file above) runs the test suite continuously in the background. Every time the main agent saves a file, the test subagent runs relevant tests and reports failures back to the main conversation. The main agent does not have to stop coding to run tests.

Pattern C: 3-agent PR review pipeline

  1. Subagent A: Linting and formatting. Runs ESLint, Prettier, custom rules. Auto-fixes what it can.
  2. Subagent B: Security analysis. Checks for SQL injection patterns, exposed secrets, insecure dependencies.
  3. Subagent C: Test coverage. Runs tests with coverage enabled, identifies untested code paths, flags coverage regressions.

Each subagent produces a focused report. The main agent collates results into a single review summary. The full review runs in roughly the time of any single check sequentially.

6.4 Build in Parallel (Cursor 3.3)

Cursor 3.3 added a one-click "Build in Parallel" button that does the multi-subagent dispatch automatically. It scans your plan, identifies independent parts, runs them simultaneously, and keeps dependent steps in order. For plans with clear parallelism (e.g., "update 8 components to use the new design tokens"), this is the right default.

6.5 The shared-contract rule

The single biggest mistake with subagents: skipping the shared contract. If your frontend and backend subagents work without an explicit shared TypeScript interface or Zod schema, integration will break in subtle ways. Always have the main agent generate the contract first, then hand it to both subagents as a hard requirement. This pattern is non-negotiable for production work.

Subagent context isolation

Each subagent has its own context window. This is a feature, not a limitation — it keeps the main conversation clean and focused. But it also means subagents don't see what the main agent or other subagents are doing in real time. Communication happens through the explicit return value of the subagent. Plan your prompts accordingly.

module-06.mdc module-07_mcp-the-connector-layer.mdc module-08.mdc
MODULE 07 / 12

MCP: The Connector Layer

Model Context Protocol is the open standard for connecting AI applications to external tools through a single consistent interface. In Cursor, MCP is what turns the agent from "a text-only assistant inside the editor" into "an agent that can read Slack, query Postgres, open GitHub issues, and check Datadog logs." This is the longest module in the masterclass because MCP is also the surface where most users hit walls — context limits, security CVEs, and silent tool failures.

You will leave this module able to:

  • Configure .cursor/mcp.json with stdio and Streamable HTTP servers
  • Manage the 40-tool ceiling without losing access to your stack
  • Harden MCP security against MCPoison-class attacks and credential leaks

7.1 The architecture

MCP defines three moving pieces:

  • Hosts — the application that uses MCP. Cursor is the host.
  • Clients — connectors inside the host that handle individual server connections.
  • Servers — the lightweight programs on the other end. They expose tools via JSON-RPC 2.0. Each server exposes a set of named tools (e.g., github.create_issue, postgres.query).

When you open Cursor, the agent scans your enabled MCP servers, loads the tools they expose, and the agent decides which tools to call as part of any given task.

7.2 The two transports

  • stdio — server runs locally on your machine as a child process. Cursor communicates over stdin/stdout. The most common setup for individual developers. Does NOT work over remote SSH.
  • Streamable HTTP — server runs as an independent process (locally or remotely). Cursor connects over HTTP. The right choice for team environments, remote servers, and SSH workflows.

7.3 Configuration: .cursor/mcp.json

Two locations:

  • Project.cursor/mcp.json in the repo root. Applies only to that project. Commit it (without secrets).
  • Global~/.cursor/mcp.json. Applies everywhere. Personal API keys go here.

Same server in both files? Project config wins.

{ "mcpServers": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${env:GITHUB_PAT}" } }, "postgres": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "${env:DATABASE_URL}"] }, "linear": { "type": "http", "url": "https://mcp.linear.app/sse", "headers": { "Authorization": "Bearer ${env:LINEAR_TOKEN}" } }, "sentry": { "command": "npx", "args": ["-y", "@sentry/mcp-server"], "env": { "SENTRY_AUTH_TOKEN": "${env:SENTRY_TOKEN}", "SENTRY_ORG": "your-org" } } } }

7.4 The 40-tool ceiling

Cursor has a hard practical ceiling of roughly 40 active tools across all your MCP servers combined. Exceed it and two things happen: you get a warning, and the agent silently loses access to some tools. It just cannot see them anymore.

The limit exists for a reason: each tool definition burns context tokens. Once you stack 40+ tool descriptions into the system prompt, the LLM's ability to pick the right one for any given task deteriorates noticeably.

What to do:

  1. Open Cursor Settings > Tools & MCP. Each server shows its tools.
  2. Toggle off tools you are not actively using. Most MCP servers expose 5-20 tools; you rarely need all of them.
  3. Prefer servers exposing 5-10 well-defined tools over mega-servers trying to do 30 things.
  4. Use project-level config to limit each repo's MCP stack to what that project actually needs.

7.5 The 12 essential MCP servers

Twelve MCP servers most working developers benefit from. Pick 4-6 to start; the 40-tool ceiling will stop you before the full list.
Server What it does Best for Transport
GitHubManage repos, PRs, issues, code reviewEvery developerstdio (Docker)
GitLocal repo operations — diffs, commits, blameEvery developerstdio
PostgresNatural language queries against any Postgres DBBackend, data workstdio
LinearIssue tracking, sprint planning, cross-issue contextProduct teamsHTTP (official)
SentryPull error stack traces, breadcrumbs into contextProduction debuggingstdio
PlaywrightBrowser automation, E2E tests, screenshotsFrontend, QAstdio
Context7Up-to-date version-specific library docsEvery developer (no API key)stdio
FigmaRead Figma designs, frames, design tokensDesign-to-code workHTTP
StripeRead products, prices, payments; build integrationsE-commerce, billingHTTP (official)
VercelDeployments, env vars, logs, project configFrontend deploymentHTTP (official)
AWSS3, Lambda, CloudWatch, IAM read operationsCloud infrastructureHTTP (official)
Brave SearchReal-time web search using Brave's indexResearch, fresh infostdio

7.6 Security: the CVEs that matter

MCP servers run with your credentials

Every MCP server is, for all practical purposes, a fully trusted integration. Whatever permissions you hand a server — database access, GitHub tokens, API keys — it will use them. If a server is compromised or malicious, it has everything you gave it. Treat each one like you would treat a production credential.

The CVEs you should know about:

  • CVE-2025-54136 (MCPoison) — Check Point Research found that Cursor pinned trust to the MCP server's key name in the config file, not to the actual command being run. An attacker who could modify .cursor/mcp.json (e.g., via a malicious PR) could swap the command behind a trusted-looking name. Cursor patched this; the lesson stands.
  • Multiple 2025 CVEs targeting MCP server trust models. Snyk and others have published research throughout 2025-2026 on supply-chain attacks targeting MCP servers, skills marketplaces (including the ClawHub incident in January 2026), and plugin distributions.

7.7 Hardening checklist

  1. Never commit secrets in .cursor/mcp.json. Use ${env:VAR_NAME} references; set env vars in your shell.
  2. Check security scores on the MCP Marketplace before installing. Every listing includes a security report.
  3. Review the command field every time .cursor/mcp.json changes. A malicious PR can swap a binary.
  4. Limit credentials to read-only where possible. A GitHub PAT with full repo write access is a much bigger blast radius than a read-only one.
  5. For team environments, prefer the HTTP transport with a centrally-managed MCP gateway. Easier audit, easier rotation.
  6. Run npm audit on stdio servers periodically. They are npm packages with all the usual supply-chain risks.

7.8 Troubleshooting the silent failures

The most frustrating MCP problem: Cursor shows no error, no warning, and tools just are not showing up. Nine times out of ten, it is one of these:

  • Missing mcpServers root key. Cursor silently ignores the entire file.
  • Node.js or Python not on PATH. The stdio command fails to launch.
  • Package version doesn't exist. @some-org/mcp-server@9.9.9 when only 0.1.0 exists.
  • Forgetting -y with npx. The process hangs forever waiting for "y" at the install prompt with no interactive terminal.
  • Empty or missing environment variable. ${env:GITHUB_PAT} resolves to empty and the server can't auth.

Fastest debug path: copy the command from mcp.json verbatim and run it in a terminal. Whatever error Cursor was swallowing prints to your screen.

Portability dividend

MCP servers are not Cursor-specific. The same server that works in Cursor also works in Claude Code, Windsurf, VS Code Copilot, and any other MCP-compliant host. Configure once, use everywhere. This portability is why investing time in your MCP stack pays back even if you eventually switch primary IDEs.

module-07.mdc module-08_plugin-marketplace.mdc module-09.mdc
MODULE 08 / 12

Plugin Marketplace

Launched February 17, 2026 with Cursor 2.5, the Plugin Marketplace is the official distribution platform for plugins that bundle one or more of the five primitives (MCP servers, skills, subagents, hooks, rules) into a single installable package. Browse at cursor.com/marketplace or install via /add-plugin in the editor.

You will leave this module able to:

  • Install plugins safely and understand what each plugin is bundling
  • Build a team marketplace for shared internal plugins
  • Distinguish Default Off / Default On / Required plugin distribution modes

8.1 The 10 launch partners

Cursor 2.5 launched with first-party plugins from ten partners spanning design, payments, infrastructure, and analytics:

The ten Plugin Marketplace launch partners and the workflow stage each covers.
PartnerCategoryWhat it adds
FigmaDesignRead frames, design tokens, component specs
LinearProject mgmtIssues, sprints, status; cross-issue context
StripePaymentsProducts, prices, payment links; integration builder
VercelDeploymentDeployments, env vars, logs, project config
CloudflareEdge / DNSWorkers, DNS records, Pages projects
AWSCloud infraS3, Lambda, CloudWatch, IAM operations
DatabricksData platformNotebooks, SQL warehouses, workflows
SnowflakeData warehouseTables, queries, warehouse operations
HexData notebooksProject context, runs, exports
AmplitudeProduct analyticsEvents, charts, dashboards into agent context

8.2 Why plugins matter

Before plugins, configuring all five primitives for a stack meant manually wiring an MCP server, writing a SKILL.md, defining subagents, configuring hooks, and writing rules. Five files, five mental models, lots of glue.

A plugin installs all five at once. The Stripe plugin, as one example, bundles a Stripe MCP server (for API access), a SKILL.md (for "build a Stripe integration" workflows), rules for Stripe API conventions, and pre-configured agent behaviors for payments work. One click. One install. Five primitives, configured.

8.3 Installing plugins

  1. Browse cursor.com/marketplace or type /add-plugin in the editor
  2. Review what the plugin bundles (MCP servers, skills, subagents, hooks, rules)
  3. Click Install. Plugins configure themselves; no manual mcp.json editing
  4. Open Cursor Settings > Plugins to view, configure, or uninstall

8.4 Team marketplaces

Teams and Enterprise plans can create custom team marketplaces with private plugins. Admins control which plugins are available to the team and how they distribute. Three distribution modes:

  • Default Off — users discover the plugin in the marketplace and can opt in
  • Default On — users get the plugin installed automatically but can opt out
  • Required — users always have the plugin and cannot uninstall it

Use Required for plugins that enforce team standards (e.g., a custom BUGBOT.md, mandatory security rules). Use Default On for plugins most of the team needs (e.g., the company's internal Linear plugin). Use Default Off for niche stack plugins.

8.5 The Cursor Team Kit reference

Cursor publishes their internal CI, code review, and testing workflows as a public reference plugin: the Cursor Team Kit. Open it and study how Cursor itself uses Cursor — the rules, skills, and automation patterns are unusually high-quality references.

8.6 Publishing your own plugin

Submissions accepted at cursor.com/marketplace/publish. A plugin is a bundle of any combination of the five primitives plus a manifest. The marketplace runs a security review on every submission before listing.

When to build a plugin vs glue it manually

Plugin if: shared across > 3 projects, used by > 3 people, includes MCP servers with credentials, or has > 200 lines of configuration. Glue manually if: project-specific, one-developer use, or just a few rules and a SKILL.md. Don't over-engineer; the marketplace is best for genuinely reusable bundles.

module-08.mdc module-09_bugbot-for-production-quality.mdc module-10.mdc
MODULE 09 / 12

Bugbot for Production Quality

Bugbot is Cursor's automated PR review agent — and as of May 2026, the most credible AI-powered code review tool on the market. It reviews every PR, posts inline comments on potential issues, and with Autofix enabled it spins up cloud agents in isolated VMs that push proposed fixes directly to your PR branch. Cursor's own engineering team uses it heavily; so do Sentry, Discord, Rippling, and dozens of other major shops.

You will leave this module able to:

  • Enable Bugbot with Autofix and configure effort levels
  • Write BUGBOT.md custom rules that match your team's standards
  • Decide when Bugbot's higher effort levels pay back the cost

9.1 The numbers that matter

  • 2M+ PRs per month reviewed across all customers
  • 70%+ resolution rate — issues flagged get fixed before merge
  • 35%+ Autofix merge rate — Cursor's cloud agents push fixes that get merged without modification
  • $1.00-$1.50 average cost per run on the new usage-based billing
  • 40% time savings on code review reported by Rippling
  • 80% resolution rate at default effort — high effort finds 35% more bugs at constant resolution rate

9.2 How Bugbot actually works

Bugbot is built on a fully agentic architecture (rebuilt fall 2025 from a pipeline-based design). The agent reasons over the diff dynamically, calls tools as needed, and decides where to investigate deeper rather than following a fixed sequence of passes.

  1. PR opens / updates. Bugbot detects the trigger via GitHub webhook.
  2. Agent reads the diff and surrounding code paths. Uses semantic search across the repo.
  3. For each candidate issue, the agent traces attacker-controlled input to real sinks. Verifies whether existing controls (auth checks, schema validation, framework escaping) already block exploitation.
  4. Bug classification. Trained classifiers separate genuine bugs from false positives. Issues categorized by type (logic, security, edge case, race condition) and severity.
  5. Inline PR comments. Findings posted at exact line numbers with explanation, impact, and suggested fix approach.
  6. (Optional) Autofix. If enabled, cloud agents spawn in their own VMs, generate fix implementations, and push them as commits to the PR branch.

9.3 The four effort levels

Bugbot's usage-based billing (rolling out by June 2026) introduces configurable effort levels:

Bugbot effort levels with cost, latency, and what they catch.
EffortCostLatencyWhat it catches
Low~$0.50FastObvious logic bugs, syntax issues, common patterns
Default~$1.00-$1.50StandardLogic + security + edge cases. 80% resolution rate.
High~$3.00-$5.00SlowerDefault + deeper analysis. 35% more bugs found at same 80% resolution rate.
CustomVariableVariableConfigurable logic decides effort per PR based on size, files touched, risk

Default for most teams. High effort for security-sensitive repos, infrastructure code, or large refactors. Custom logic is the right answer for teams with mixed-risk codebases — small documentation PRs get low effort, anything touching auth or billing gets high.

9.4 BUGBOT.md — custom rules

Drop a BUGBOT.md in your repo root to define team standards. Bugbot uses it to score PRs against your specific conventions, not just generic best practices.

# Bugbot Rules for [Project Name] ## Required - Every new API endpoint must have input validation via Zod schemas. - Every database write must be wrapped in a transaction. - Every async function returning a Promise must handle rejections explicitly. - No `console.log` in committed code. Use the logger. ## Forbidden - `any` type in TypeScript. Use `unknown` and narrow. - Inline SQL. Always use the query builder or stored procedures. - Importing from `app/api/` into anything outside `app/api/`. - Hardcoded secrets, API keys, or credentials anywhere. ## Security-critical paths The following files handle authentication, authorization, or payments. Bugbot should review changes to these with extra care: - `app/api/auth/**` - `app/api/billing/**` - `lib/auth/**` - `lib/stripe/**` ## Test coverage - New code in `lib/` must have unit tests. - New API endpoints must have integration tests. - Coverage regressions of more than 2% should be flagged. ## Migration patterns - Database migrations must be backwards-compatible for at least one deploy cycle. - Frontend changes must be feature-flagged if they affect > 5% of users.

9.5 Cross-model review pattern

If your team uses Claude Code (or any other AI) to write PRs, run Bugbot as the cross-model reviewer. Bugbot uses Cursor's own model stack, so when it reviews Claude-written code (or vice versa), you get genuine diversity-of-perspective benefits. As Sentry's David Cramer put it: "The hit rate from Bugbot is insane. Catching bugs early saves huge downstream cost."

The pattern is fire-and-forget once configured:

  1. Describe what you want to Claude Code / Cursor Agent / any other AI
  2. The AI opens the PR on GitHub
  3. Within minutes, Bugbot reviews and Autofix agents push fix commits
  4. By the time you open the PR for human review, the obvious stuff is handled
  5. Your review starts from a cleaner baseline

9.6 The four-agent security stack

Cursor's own security team publishes their four-agent stack as a reference pattern for teams who need security-specific review (not just general bug-finding):

  1. Agentic Security Review — runs on every PR; prompt-tuned to a specific threat model; can block CI on security findings without blocking on general code quality issues.
  2. Vuln Hunter — divides the existing codebase into segments and searches each one for vulnerabilities. Security team triages and fixes via @Cursor in Slack.
  3. Anybump — automated dependency patching with reachability analysis. Determines which CVEs are actually impactful in your code, traces relevant paths, runs tests, opens a patch PR if no breakage.
  4. Invariant Sentinel — daily monitoring for drift against security and compliance properties. Catches changes that violate invariants like "no PII in logs" or "all API endpoints require auth."

Cursor publishes these as automation templates. Other security teams customize them for their own threat models.

9.7 False positives and how to manage them

Bugbot is aggressive by design — it errs on the side of flagging potential issues. Some flags will be wrong. Two practical rules:

  • Resolution rate over flag count. Bugbot optimizes for bugs that get fixed, not raw flag volume. If your team is dismissing > 30% of flags, write more BUGBOT.md rules to teach it your conventions.
  • LLMs confidently flag false issues sometimes. A parameterized SQL query is safe; if Bugbot calls it injection, it misread the data flow. Use the inline comment thread to push back; Bugbot updates its model from this feedback.
ROI math

At ~$1.00-$1.50 per PR run on default effort, a team shipping 50 PRs/week is looking at roughly $200-$300/month in Bugbot costs. Compare to the cost of one production incident, one auth regression that ships, or one hour of senior engineer review time per day across the team. The math is not close.

module-09.mdc module-10_hooks-skills-custom-automations.mdc module-11.mdc
MODULE 10 / 12

Hooks, Skills, and Custom Automations

Hooks and Skills are the two primitives where Cursor genuinely diverges from Claude Code, Windsurf, and Copilot. Hooks are deterministic — they run real scripts with real consequences. Skills are dynamic — they teach the agent how to do something specific, packaged for reuse. Together they enable the "agent runs the workflow you defined" pattern.

You will leave this module able to:

  • Write .cursor/hooks.json with PreToolUse, PostToolUse, stop, and beforeSubmitPrompt hooks
  • Author SKILL.md files for repeatable domain workflows
  • Build the loop-until-done pattern with a stop hook and scratchpad

10.1 Hooks: deterministic guardrails

Hooks are scripts. They execute real code with real consequences, with no AI judgment involved. This is what makes them different from rules. A rule says "the agent should run the formatter before saving"; a hook makes sure the formatter runs whether the agent wants to or not.

Cursor supports four hook types as of May 2026:

  • PreToolUse — fires before the agent calls any tool. Can modify the call or block it.
  • PostToolUse — fires after a tool call completes. Can run formatters, lint, or validation.
  • beforeSubmitPrompt — fires before the agent submits a prompt. Can modify the prompt, inject context, or block submission.
  • stop — fires when an agent run completes or aborts. Can decide to continue the loop.

10.2 The hooks.json structure

{ "hooks": { "PostToolUse": [ { "matcher": "edit_file", "command": "bash .cursor/hooks/format-on-save.sh" }, { "matcher": "write_file", "command": "bash .cursor/hooks/format-on-save.sh" } ], "PreToolUse": [ { "matcher": "run_terminal", "command": "bash .cursor/hooks/block-dangerous.sh" } ], "stop": [ { "command": "bun .cursor/hooks/grind.ts" } ] } }

10.3 The loop-until-done pattern

One of the most powerful Cursor patterns: a stop hook reads the conversation status, checks for a "DONE" marker in a scratchpad file, and if the work isn't done, returns a followup_message that keeps the agent grinding.

import { readFileSync, existsSync } from "fs"; interface StopHookInput { conversation_id: string; status: "completed" | "aborted" | "error"; loop_count: number; } const input: StopHookInput = await Bun.stdin.json(); const MAX_ITERATIONS = 5; if (input.status !== "completed" || input.loop_count >= MAX_ITERATIONS) { console.log(JSON.stringify({})); process.exit(0); } const scratchpad = existsSync(".cursor/scratchpad.md") ? readFileSync(".cursor/scratchpad.md", "utf-8") : ""; if (scratchpad.includes("DONE")) { console.log(JSON.stringify({})); } else { console.log(JSON.stringify({ followup_message: `[Iteration ${input.loop_count + 1}/${MAX_ITERATIONS}] Continue working. Update .cursor/scratchpad.md with DONE when complete.` })); }

The pattern: ask the agent to work toward a goal and to mark a scratchpad file with DONE when complete. The stop hook automatically keeps the agent going up to MAX_ITERATIONS times until DONE is written. This is how teams build agents that "just keep working until the tests pass."

10.4 Skills: dynamic capability modules

Skills sit alongside Rules but serve a different purpose. Rules describe persistent project conventions. Skills encode the steps for a recurring domain task — scaffolding a new database migration, releasing a hotfix, running a release checklist, generating a feature flag.

Skills live in .cursor/skills/<skill-name>/SKILL.md. Each skill folder can include optional scripts/, references/, and assets/ directories.

--- name: release-hotfix description: Cuts a hotfix release. Use when a critical bug needs to ship to production outside the normal release cycle. --- # Release Hotfix Skill ## When to use Invoke this skill when: - A critical bug is in production - The fix has been approved by an engineering lead - The change is small (under 50 LOC) and well-tested ## Workflow ### 1. Verify preconditions - Confirm the bug is actually critical (not just urgent) - Confirm the fix is in `main` and tests pass - Confirm an engineering lead has approved the hotfix ### 2. Create the hotfix branch ```bash git checkout -b hotfix/[issue-id]-[short-description] main ``` ### 3. Cherry-pick the fix - Identify the merge commit on main - Cherry-pick into the hotfix branch - Run the test suite locally ### 4. Tag the release - Bump the patch version in package.json - Update CHANGELOG.md with the hotfix entry - Tag: `v[major].[minor].[patch+1]` ### 5. Open the PR - Title: `Hotfix: [short description]` - Link to the original bug issue - Tag the release manager for review ### 6. After merge - Trigger production deploy via the release workflow - Verify the fix in production - Update the bug issue with deploy timestamp - Notify the team in #releases ## References - See `references/hotfix-checklist.md` for the full pre-merge checklist - See `references/rollback-procedure.md` for the rollback workflow if the hotfix breaks something

10.5 Skills vs Rules vs Subagents

When to reach for each primitive based on what you are trying to accomplish.
Use caseRight primitiveWhy
Project conventions (style, naming, banned patterns)RulesPersistent, always-on (or glob-scoped)
Recurring multi-step task (release, migration, scaffold)SkillsProcedural; loads only when needed
Parallel specialized work (frontend + backend)SubagentsIndependent context; runs in parallel
Deterministic guardrails (formatter, secret check)HooksReal script, no AI judgment
External tool access (Postgres, GitHub, Sentry)MCPStandard protocol for tool integrations

10.6 Custom commands

Reusable workflows triggered with / in the agent input live in .cursor/commands/. Examples: /pr, /fix-issue, /review, /update-deps, /docs. Each is a markdown file with a prompt template. Cursor 3.2 added quick-action pills that let you pin commonly-used commands as one-tap buttons.

The build-vs-borrow rule

Before writing a custom skill or hook, check the marketplace. Most common workflows (release management, dependency updates, security scans) already exist as plugins. Borrow first, customize second, build from scratch only when nothing fits.

module-10.mdc module-11_production-engineering-cost-discipline.mdc module-12.mdc
MODULE 11 / 12

Production Engineering and Cost Discipline

Cursor works fine for solo developers out of the box. Cursor at team scale needs deliberate engineering. This module is what you set up before rolling Cursor out to 5+ developers, or before your monthly bill scares your finance team.

You will leave this module able to:

  • Set up Teams or Enterprise plans with shared rules and pooled usage
  • Apply cost discipline patterns that keep monthly bills predictable
  • Use the Cursor SDK for CI/CD agents and custom agent platforms

11.1 Teams plan setup checklist

  1. Move billing to a single corporate card (the $40/seat consolidates personal Pro subs)
  2. Configure shared .cursor/rules via the team dashboard
  3. Set up the team marketplace for shared internal plugins
  4. Enable Privacy Mode org-wide (guarantees code is not stored or trained on)
  5. Configure role-based access control for who can install plugins, view usage, manage billing
  6. Set spend limits per user to prevent runaway monthly bills

11.2 Cost discipline patterns

Cost discipline patterns ranked by approximate monthly savings on a team of 10.
PatternSavingsImplementation effort
Default to Auto mode (free pool)$200-500/moTrain team; one rule in .cursor/rules
Reserve frontier models for hard tasks only$100-300/moCultural — review usage dashboard weekly
Cache repeated context (rules don't re-bill)$50-150/moAlready automatic if rules are well-structured
Use Composer 2 over Claude/GPT for coding$100-400/moMake Composer 2 the default in team settings
Cap context window — don't dump entire repos$50-200/moUse @ mentions deliberately; train the team
Batch Bugbot to default effort (not high)$100-500/moCustom logic for which PRs get high effort
Set hard spend limits per userVariableOne-time admin configuration

11.3 Watching the dashboard

cursor.com/dashboard shows real-time credit consumption broken down by user and by feature. Admins should review weekly:

  • Top spenders — are they shipping enough work to justify the cost?
  • Feature breakdown — Bugbot, Cloud Agents, frontier model usage
  • Spike detection — sudden jumps usually indicate someone left an agent running
  • Per-product surface usage — clients vs Cloud Agents vs automations vs Bugbot vs Security Review

11.4 Enterprise admin controls

Cursor's Enterprise plan added several admin controls in 2026 worth knowing about:

  • Granular model allow/blocklists — block entire providers or specific model configurations
  • Soft spend limits with usage alerts — alerts instead of hard cutoffs that block users
  • Detailed usage filtering — by user, by product surface (clients, Cloud Agents, automations, Bugbot, Security Review)
  • Self-hosted pool — run Cloud Agents on your own infrastructure (Google Cloud Run, custom pools)
  • SAML/OIDC SSO + audit logs — standard enterprise security stack

11.5 The Cursor SDK for CI/CD

The Cursor SDK gives programmatic access to every model in Cursor for use outside the IDE. Teams ship custom agents from CI/CD pipelines:

  • PR summary agents — generate change summaries on every PR open
  • CI failure root-cause agents — when a build breaks, an agent reads the failure logs and posts a probable cause
  • Stale-PR fixers — agents that rebase old PRs and resolve conflicts
  • Custom agent platforms — internal apps that let non-engineers query data through agents without writing code
name: PR Summary on: pull_request: types: [opened, synchronize] jobs: summarize: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Run Cursor agent env: CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }} run: | npx @cursor/sdk run \ --model composer-2 \ --task "Summarize the changes in this PR for the team. Focus on: what changed, why it matters, what reviewers should pay extra attention to. Output as a single GitHub comment in markdown." \ --context "$(git diff origin/main...HEAD)" \ --output-format github-comment

11.6 Git discipline with agents

Hard rules that prevent agent-caused disasters:

  1. Agents always work on branches. Never run an agent against main with auto-commit enabled.
  2. Use /worktree for risky tasks. Isolated worktrees mean an agent error doesn't pollute your local main.
  3. Commit before agent runs. A clean working tree means easy revert via git reset --hard.
  4. Review every diff. Even with Bugbot. Even with high-confidence agents. Even when you trust the model.
  5. No agent-only commits to main. All agent work goes through PR review at minimum.
The pilot-week pattern

Before rolling Cursor out to a team or before forecasting a monthly budget, run a 1-week pilot at your actual workload. Multiply the weekly burn by 4.3 and add a 20% buffer for your monthly estimate. Numbers based on a free trial week underestimate; numbers based on real work at your actual scale do not.

module-11.mdc module-12_comparison-limits-honest-take.mdc
MODULE 12 / 12

Comparison, Limits, and the Honest Take

Cursor is the best AI-native IDE in May 2026. It is not the only good tool. It is not the right primary for every developer. This module is the honest decision matrix vs Claude Code, Windsurf, Copilot, Antigravity, and Aider — and the failure modes that no Cursor marketing page will tell you about.

You will leave this module able to:

  • Pick the right primary tool for your actual workflow
  • Recognize Cursor's hard failure modes before they cost you a week
  • Build a multi-tool workflow that uses each tool's strengths

12.1 The five major AI coding tools in May 2026

Major AI coding tools as of May 2026 with positioning, pricing, and best-fit workflows.
Tool Form factor Pricing Best for
Cursor AI-native IDE (VS Code fork) + Agents Window $20-$200/mo individual; $40/seat team IDE-first workflows; multi-file editing; teams
Claude Code Terminal-native agent $20-$200/mo subscription or API tokens Deep autonomous tasks; large context; CI agents
Windsurf AI-native IDE (VS Code fork) + Cascade $20/mo Pro (raised from $15 in March 2026) Autonomous "Flows"; Cognition-backed since July 2025
GitHub Copilot IDE plugin (VS Code, JetBrains, etc.) + Agent Mode $10/mo individual; $19/seat business Enterprise standardization; mixed IDE teams
Google Antigravity Browser-native development surface Subscription via Google AI Cloud-native development; Google ecosystem

12.2 Cursor vs Claude Code — the head-to-head

This is the comparison most developers actually care about. The honest answer: many production teams use both.

Cursor vs Claude Code across the dimensions that matter most for day-to-day work.
DimensionCursor winsClaude Code wins
IDE experienceX (VS Code fork)
Multi-file Composer editingX
Tab autocomplete qualityX (proprietary model)
Terminal-native automationX
Deep reasoning depthX (Opus 4.7)
Single-context window sizeX (1M tokens, tool default 200K)
Plugin MarketplaceX (10+ launch partners)
PR review automationX (Bugbot)
Cloud agents in VMsX (Background Agents)
Open ecosystem (MCP servers)~ Tied~ Tied
Cost at scaleX (Composer 2 cheaper than Opus)
2026 developer survey "loved" ratingX (46% vs 19%)

The practical answer: most working developers in May 2026 use Cursor for daily IDE work (Tab, Composer, multi-file edits) and Claude Code for weekly deep tasks (large refactors, security audits, multi-agent parallel work). The tools complement more than compete.

12.3 Cursor's hard limits

  • 40-tool MCP ceiling. Hard cap that silently breaks once exceeded. Active management required.
  • Credit-based pricing is unpredictable for some workflows. If you live in frontier models, expect to budget for overages or graduate to Ultra.
  • Mobile and remote SSH workflows are second-class. Most heavy features (Cloud Agents, Bugbot) assume a desktop GUI session.
  • Composer 2 trails GPT-5 on the hardest coding benchmarks. 61.7 vs 75.1 on Terminal-Bench 2.0. For the toughest 10% of tasks, frontier models still win.
  • Background Agents work best with well-structured, modern codebases. A legacy monolith with inconsistent conventions needs more manual steering.
  • JetBrains support exists but is younger than the VS Code experience. ACP launched March 2026; expect feature drift between editors.
  • The pace of change is its own cost. The Cursor you learned six months ago is not the Cursor of today. Plan to re-read the changelog quarterly.

12.4 When NOT to make Cursor your primary

  • You live in JetBrains and your team standardizes on it (Copilot or Windsurf may fit better)
  • You need to embed AI coding into a customer-facing product (Cursor SDK works, but Claude API may be cheaper)
  • You spend 80%+ of your time on autonomous long-running tasks (Claude Code's terminal-native model is leaner)
  • You need on-prem or air-gapped (Enterprise self-hosted works, but Aider or local models may be simpler)
  • You are a hobbyist who codes < 4 hours/week (the free tier is fine, the paid tier rarely pays back)

12.5 The multi-tool workflow

Most professional teams in May 2026 run 2-3 tools in combination:

  1. Cursor as the daily IDE. Tab, Composer, multi-file work, MCP integrations, Bugbot.
  2. Claude Code for deep tasks. Multi-hour refactors, security audits, anything where you want Opus 4.7's reasoning depth and 1M context.
  3. GitHub Copilot or Windsurf as the team baseline. If standardization across a large org is the constraint, the Copilot/Windsurf-as-baseline + Cursor-or-Claude-for-individual-power-users pattern is common.
The honest final take

If you spend most of your time in an IDE, learn Cursor. The five primitives architecture, Composer 2's 200K context, the Plugin Marketplace, and Bugbot add up to a category-defining product in May 2026. Pair it with Claude Code for the autonomous long-running work where terminal-native + 1M context wins. Don't tie your entire workflow to a single tool — every dominant AI coding tool of the last three years has been displaced by something better within 18 months. The skills (rules, skills, subagents, hooks, MCP) port; the tool that hosts them will change.

Reference: 100 Paste-Ready Prompts

The Cursor Prompt Library

One hundred production-tested prompts across ten categories. Each follows the "scan, plan, build, verify" pattern from Module 4. Replace bracketed placeholders with your specifics. Save the ones that work for your stack as your personal prompt library.

Setup & Configuration Prompts (01-10)

01Setup

Scan this codebase and generate a starter .cursor/rules/000-style-guide.mdc file with alwaysApply true. Include naming conventions, file structure rules, banned patterns, and import discipline based on what you observe.

02Setup

Generate a glob-scoped .cursor/rules/100-[language].mdc file for [TypeScript/Python/Go/Rust] in this repo. Read existing files to infer conventions. Include strict-mode patterns, forbidden constructs, and required patterns.

03Setup

Audit my current .cursor/rules/ directory. Identify rules that are too long (over 500 lines), bloat the always-on context, or duplicate concerns. Suggest a refactored structure.

04Setup

Generate a .cursorignore file for this repo. Include build outputs, dependencies, secrets, large assets, and anything else that should not enter agent context or semantic search.

05Setup

Create an AGENTS.md at the project root summarizing this repo for any agent: tech stack, architecture, where to find things, conventions, common commands, and how to test.

06Setup

Set up a starter .cursor/mcp.json with GitHub, Git, and Postgres servers. Use env vars for all secrets. Add comments explaining what each server enables.

07Setup

Audit my .cursor/mcp.json for security issues: hardcoded secrets, untrusted commands, missing -y flags with npx, unsafe defaults. Suggest fixes.

08Setup

Create a BUGBOT.md for this repo. Read the codebase to infer team standards. Include required patterns, forbidden patterns, security-critical paths, and test coverage requirements.

09Setup

Set up a .cursor/hooks.json that runs the project's formatter on every file edit, and blocks any terminal command that contains rm -rf or accesses production env vars.

10Setup

Bootstrap the entire .cursor/ directory for this repo from scratch: rules, hooks, mcp.json, ignore file, and one starter skill. Use my existing code as the source of truth for conventions.

Composer 2 Prompts (11-20)

11Composer

Phase 1 — SCAN. Read @src and tell me: main architecture patterns, how state management works, where the API layer lives, existing test patterns. Pause before continuing.

12Composer

Phase 2 — PLAN. I want to add [FEATURE]. Give me the files you will create, files you will modify, patterns you will follow, and any open questions. Wait for approval.

13Composer

Phase 3 — IMPLEMENT goal-by-goal. Goal 1: [...]. Goal 2: [...]. Goal 3: [...]. Start with Goal 1 and pause before Goal 2 with the diff for me to review.

14Composer

Add a new [feature type] to this codebase. Follow the existing patterns in @[reference file]. Use the Result<T, E> pattern for fallible operations. Write tests for every public function.

15Composer

Refactor @[file] to extract [responsibility] into a separate module. Preserve all existing behavior. Update tests. Show me the diff before saving.

16Composer

Implement [feature] across the stack. Frontend in @components/, API in @app/api/, types in @types/, tests in @tests/. Generate the shared TypeScript interface first, then implement against it.

17Composer

Migrate @[file] from [old pattern] to [new pattern]. Apply the same migration to all files that follow the same pattern in @[directory]. Show me the diff per file before saving.

18Composer

Add comprehensive JSDoc comments to every exported function in @[file]. Include param types, return types, error conditions, and one usage example per function.

19Composer

Implement [feature] using Composer 2 specifically. Use the 200K context window — load all relevant files via @ mentions before writing any code. Plan first, implement second.

20Composer

Convert this design mockup [attached image] into a React component using the patterns in @components/ui/. Match spacing, typography, and color exactly. Use only Tailwind utility classes.

Agent Mode Prompts (21-30)

21Agent

Agent task: Add OAuth login (GitHub provider) to this app. Plan first, run tests after every file change, show me each diff before committing. Use the worktree command first.

22Agent

Run the test suite. For each failure, identify the test, the assertion, the file and line, and the most likely cause based on recent changes. Then propose fixes one at a time.

23Agent

Audit this codebase for [security issue type — exposed secrets, SQL injection, XSS, auth bypass]. For each finding, trace the attacker-controlled input to the real sink. Verify existing controls.

24Agent

Add comprehensive error handling to @[directory]. Wrap fallible operations in Result types, add explicit error logging, and propagate context. Test edge cases.

25Agent

Set up Vitest (or Jest) in this project. Add config, install deps, create a sample test, run it. Then write a test for @[file].

26Agent

Generate full unit test coverage for @[directory]. Write tests, run them, fix any source bugs revealed, repeat until coverage is > 80% and all tests pass.

27Agent

Set up CI for this repo: GitHub Actions workflow that runs lint, type-check, tests, and build on every PR. Use the latest stable action versions. Cache deps appropriately.

28Agent

Add Dependabot config to this repo. Group minor and patch updates weekly. Major updates require manual review. Open PRs against a non-protected branch.

29Agent

Improve performance of @[file/function]. Profile first to identify the actual bottleneck. Apply optimizations. Re-profile to verify improvement. Document the change.

30Agent

Migrate from [framework A] to [framework B] in @[directory]. Plan the migration in phases. Run the test suite after each phase. Rollback if any phase breaks.

Subagent Prompts (31-40)

31Subagent

Define a shared TypeScript interface for [feature]. Then spawn two subagents: one to implement the React component against the interface, one to implement the API endpoint to match.

32Subagent

Use Build in Parallel to update all components in @components/ to use the new design tokens from @lib/tokens.ts. Identify independent file groups and run them simultaneously.

33Subagent

Set up a 3-subagent PR review pipeline: Subagent A runs lint and formatting, Subagent B runs security analysis, Subagent C runs test coverage. Collate results into one report.

34Subagent

Define a custom .cursor/agents/test-runner.md subagent that runs the test suite, parses output, and reports failures with file/line/cause. Use model: composer-2 and tools: bash, read_file.

35Subagent

Use the Explore subagent to research how [feature/pattern] is implemented across this codebase. Return a focused summary of the relevant files and conventions.

36Subagent

Spawn a docs subagent in parallel with implementation. As the main agent writes @[feature], the docs subagent writes the README section, API docs, and example usage.

37Subagent

Define a .cursor/agents/migration-runner.md subagent that applies a single migration step at a time, runs tests, and pauses for approval before continuing.

38Subagent

Use the Browser subagent to verify the UI for @[page]. Take screenshots at different viewports (375, 768, 1200). Report any visual regressions from the previous deploy.

39Subagent

Spawn a security-review subagent in parallel with feature implementation. Its job is to flag any auth, input-validation, or secret-handling concerns in real time.

40Subagent

Run /best-of-n 3 on this task using composer-2, opus-4.7, and gpt-5. Compare the three implementations. Pick the best one or merge the strongest parts of each.

Refactor Prompts (41-50)

41Refactor

Extract the repeated [pattern] from @[file] into a single helper function in @lib/. Update all callers. Run tests to verify nothing broke.

42Refactor

This file is too long ([N] lines). Suggest a split into smaller modules by responsibility. Show me the proposed structure before implementing.

43Refactor

Replace every instance of [old pattern] with [new pattern] across @[directory]. Use the same migration discipline: plan first, implement file-by-file, run tests after each.

44Refactor

Convert @[file] from [class-based / callback / promise chain] to [hooks / async-await / Result]. Preserve behavior. Add tests if missing.

45Refactor

Audit @[directory] for code duplication. Group duplicated logic into shared utilities. Report the lines-of-code reduction.

46Refactor

Add proper TypeScript types to @[file]. Remove every any. Use unknown with narrowing where input shape is uncertain. No as casts.

47Refactor

Convert all relative imports in @[directory] to path aliases using the @/ prefix configured in tsconfig.json.

48Refactor

Add comprehensive error boundaries to the React component tree in @app/. Each route gets its own boundary with a fallback UI and error reporting hook.

49Refactor

Modernize @[file]. Replace deprecated APIs with current equivalents. Update to latest syntax (e.g., optional chaining, nullish coalescing). Run the type checker after.

50Refactor

This component re-renders too often. Profile it, identify unnecessary re-renders, apply memoization with useMemo/useCallback/React.memo where it actually helps. Measure before and after.

Debug Prompts (51-60)

51Debug

[Paste error stack trace]. Find the root cause in the codebase. Trace from the error site back to the first contributing function. Propose a fix.

52Debug

This test passes locally but fails in CI. Investigate the difference. Common causes: timezone, file ordering, env vars, network access, parallel test pollution.

53Debug

Use the Sentry MCP server to pull the last 10 errors of type [error type]. Find the common root cause. Propose a fix.

54Debug

[Paste failing log output]. Identify the contributing factors. Walk me through what happened in chronological order. Suggest a fix that addresses the root cause not the symptom.

55Debug

The bug only reproduces on production data. Without exposing PII, sketch how to write a regression test using anonymized fixture data that captures the same pattern.

56Debug

This async function sometimes deadlocks. Investigate. Look for missing awaits, resource contention, promise chains that never resolve. Add timeout handling where appropriate.

57Debug

[Screenshot of broken UI]. Identify what's wrong, find the responsible component, propose a fix. Test at 375px, 768px, and 1200px viewports.

58Debug

Use git blame on @[file] to find when [behavior/bug] was introduced. Show me the commit and the diff. Suggest a fix or revert.

59Debug

This API endpoint is slow. Profile it. Find the slow query or function. Optimize. Verify the improvement.

60Debug

Reproduce the bug locally. Walk me through the reproduction steps. Once reproduced, identify the root cause and propose a fix with a regression test.

Test Prompts (61-70)

61Test

Write comprehensive unit tests for @[file]. Cover happy paths, edge cases, error paths, and boundary conditions. Use the test framework already in this project.

62Test

Add integration tests for @app/api/[route]. Test the full HTTP request/response cycle including auth, validation errors, and the happy path.

63Test

Generate E2E tests using Playwright for the [user flow]. Use the patterns in existing tests. Test in Chrome, Firefox, and WebKit.

64Test

Write a test that reproduces this bug: [bug description]. Run it to confirm it fails. Then fix the bug and verify the test passes.

65Test

Audit test coverage in @[directory]. Identify untested functions, untested branches, and weak assertions. Add tests to address the gaps.

66Test

This test is flaky. Investigate the source of flakiness: race conditions, time-dependent assertions, network calls, ordering assumptions. Fix it for good.

67Test

Generate property-based tests for @[function] using fast-check (or equivalent). Test invariants that should hold for all inputs.

68Test

Set up visual regression testing for @app/[page] using Playwright screenshots. Establish a baseline. Add the comparison step to CI.

69Test

Generate fixtures and factories for @[entity] using the patterns in @tests/factories/. Cover all variants of the entity that appear in tests.

70Test

Run the full test suite. For every failure, identify the test, the assertion, the file and line, and the most likely cause. Propose fixes one by one.

Documentation & Migration Prompts (71-80)

71Doc

Generate a README for this repo. Include: what it does, how to install, how to run locally, how to test, how to deploy, architecture overview. Use the actual stack.

72Doc

Generate an OpenAPI spec for the routes in @app/api/. Read the validation schemas and types to infer the spec accurately.

73Doc

Add JSDoc/TSDoc comments to every exported function in @[directory]. Include @param, @returns, @throws, and one usage example.

74Doc

Generate ARCHITECTURE.md from the code. Diagram the major modules, their responsibilities, and the data flow between them. Use mermaid for the diagram.

75Doc

Write a CONTRIBUTING.md based on this repo's actual conventions. Include setup, branch naming, commit format, PR process, code style.

76Migration

Plan a migration from [old version] to [new version] of [framework]. Identify breaking changes, required code updates, test impact, and a rollback plan.

77Migration

Migrate this app from CommonJS to ESM. Update package.json, tsconfig, imports/exports. Run the test suite. Fix any broken imports.

78Migration

Convert all class components in @components/ to function components with hooks. Preserve behavior. Run tests after each conversion.

79Migration

Migrate this project from npm to pnpm. Update lockfiles, scripts, CI workflows. Confirm everything still installs and runs.

80Migration

Replace [library A] with [library B] across the codebase. Use the worktree command. Apply the migration file-by-file. Test after each.

MCP-Driven Prompts (81-90)

81MCP

Use the GitHub MCP server to list open PRs assigned to me. For each, summarize the changes and flag anything risky.

82MCP

Use the Linear MCP server to fetch all issues in the current sprint. Show me which are blocked and what's blocking them.

83MCP

Use the Postgres MCP server to run [query]. Read the schema first if you don't know the table structure. Format the results.

84MCP

Use the Sentry MCP server to pull the last 24 hours of errors for [service]. Group by error type. Identify the top 3 by impact.

85MCP

Use the Figma MCP server to read the design at [Figma URL]. Implement it as a React component using @components/ui/ patterns.

86MCP

Use the Vercel MCP server to check the last deployment's status, logs, and any failed builds. Diagnose if anything failed.

87MCP

Use the Stripe MCP server to create a test product, price, and payment link. Walk me through the integration to use them in this app.

88MCP

Use the Context7 MCP server to fetch the current docs for [library]. Then implement [feature] using the documented API. Cite the doc references.

89MCP

Use the Playwright MCP server to navigate to [URL], take a screenshot, and verify [expected element/behavior] is present.

90MCP

Audit my .cursor/mcp.json. Count active tools across all servers. If > 35 (approaching the 40-tool ceiling), suggest which tools to disable.

Bugbot & Review Prompts (91-100)

91Review

Review my staged changes (git diff --staged). Find logic bugs, security issues, edge cases, and style violations. Propose fixes inline.

92Review

Review this PR through the lens of BUGBOT.md. For each violation of the required or forbidden patterns, flag the line and explain.

93Review

Audit @[directory] for security issues: SQL injection, XSS, exposed secrets, insecure dependencies, auth bypass. Trace each issue to a real sink.

94Review

Review this PR for breaking changes. Identify any API contract changes, schema migrations, or behavior changes that downstream consumers need to know about.

95Review

Configure Bugbot to use high effort on PRs touching @app/api/auth/, @app/api/billing/, or @lib/auth/. Default effort everywhere else.

96Review

Run a 3-subagent review pipeline on this PR: lint, security, coverage. Collate into one report with severity rankings.

97Review

Review this PR's tests for quality, not just presence. Flag tests that don't actually test the behavior, weak assertions, missing edge cases.

98Review

Audit dependency upgrades in this PR. For each upgraded package, check the changelog for breaking changes. Run reachability analysis on any flagged CVEs.

99Review

Review this commit history. Flag commits that should have been split into multiple, commits with poor messages, or commits that mix concerns.

100Review

Generate a structured PR description for the changes in git diff origin/main...HEAD. Include: what changed, why, risk assessment, what reviewers should focus on.

Reuse pattern

Copy all 100 into a markdown file at .cursor/prompts.md in your repo. Reference them by number: "Run prompt 31 for the user-settings feature." Pair with the Skills Library below to turn the most-used ones into reusable SKILL.md files invoked via slash commands.

Reference: 6 Reusable Skill Packages

Skill Packages: Paste-Ready Rules & SKILL.md Files

Six complete configurations you can drop into .cursor/rules/ and .cursor/skills/ today. Each one is production-tested. Customize the bracketed placeholders for your stack.

Skill 01

TypeScript / React Strict Mode

Locks TypeScript strict mode, forbids common escape hatches, enforces a Result<T, E> pattern for fallible operations, and codifies React component conventions. Drop in any TS/React project.

--- description: TypeScript strict-mode conventions, React component patterns, banned escape hatches. globs: "**/*.ts,**/*.tsx" alwaysApply: false --- # TypeScript Strict Rules ## TypeScript - TypeScript strict mode is REQUIRED. No `any` unless first typed as `unknown` and narrowed. - No `as` casts except when bridging to external libraries with broken types. Document the cast. - No non-null assertions (`!`). Use proper narrowing or throw with context. - Use `import type { ... }` for type-only imports. - Path aliases via `@/` for internal modules. Never relative `../../../` beyond one level up. ## Result pattern - Fallible operations return `Promise<Result<T, E>>`. Use the Result type from `@/lib/result.ts`. - Never throw across module boundaries. Convert errors to Result at the boundary. - Use `if (result.ok) { ... } else { ... }` narrowing. Never access `.value` without checking `.ok` first. ## React components - Function components only. No class components. - Named exports for components. No default exports. - Props interfaces named `[Component]Props`. Co-located in the same file. - Use `cn()` helper from `@/lib/cn.ts` for conditional class names. No template strings for classes. - Server actions live in `app/actions/`. Always start with `"use server"`. ## Forbidden - `console.log` in committed code. Use the logger from `@/lib/log.ts`. - Inline styles. Use Tailwind utility classes via `cn()`. - Direct database access from components. Route through `/lib/db/` repositories. - Inline SQL strings. Always use the query builder or stored procedures. - Hardcoded secrets, API keys, or credentials anywhere. ## State management - Local state: useState. - Cross-component state: zustand (or your team's choice). Never prop-drill more than 2 levels. - Server state: tanstack-query. No useEffect for data fetching. - URL state: nuqs or framework router params. Never duplicate URL state in local state.
Skill 02

Python / FastAPI Production

Python 3.12+ conventions, FastAPI patterns, async-first, Pydantic v2, structured logging, no globals. The full production-ready Python rule set.

--- description: Python 3.12+ and FastAPI production conventions, async patterns, Pydantic v2, structured logging. globs: "**/*.py" alwaysApply: false --- # Python / FastAPI Production Rules ## Python - Python 3.12+ required. Use modern syntax: union types with `|`, `match` statements, walrus operator where it improves readability. - Type hints on every function signature. No untyped public functions. - Use `from __future__ import annotations` at the top of every module for cleaner forward references. - Use `pathlib.Path`, never `os.path` strings. - Use f-strings. No `.format()` and no `%` formatting. ## Async-first - All I/O is async. Use `httpx` not `requests`. Use `asyncpg` not `psycopg2`. - No sync ORM calls in async route handlers. Use `SQLAlchemy 2.x async` or `SQLModel async`. - `asyncio.gather` for parallel I/O. `asyncio.wait_for` for timeouts. - Never block the event loop. CPU-bound work goes through `run_in_executor` or a worker queue. ## FastAPI - Routes live in `app/routers/`. One router per domain. - Request/response models are Pydantic v2 BaseModel. Use Field with constraints. - Dependencies via `Depends()`. Never read globals; use dependency injection. - Exception handlers convert domain errors to HTTPException with structured detail. - Background tasks: BackgroundTasks for simple, RQ/Celery for durable. ## Pydantic v2 - Use `model_config = ConfigDict(...)` not the old `class Config`. - Use `Field(default=...)` not `=` defaults for complex types. - Use `field_validator` and `model_validator` for cross-field validation. - Use `ConfigDict(frozen=True)` for value objects. ## Logging - Structured logging via `structlog`. Never `print()`. - Every log line includes a `request_id` from the FastAPI middleware. - Log levels: DEBUG for dev only, INFO for normal flow, WARNING for recoverable, ERROR for handled exceptions, CRITICAL for paged. - Never log secrets, PII, or full request bodies. ## Database - Migrations via Alembic. One migration per logical change. - Never modify a migration once merged to main. - Use repository pattern: routes call services, services call repositories, repositories call ORM. - Transactions explicit via `async with session.begin():`. ## Testing - Pytest with `pytest-asyncio`. Mark async tests with `@pytest.mark.asyncio`. - Use fixtures for database setup. Tear down via transaction rollback, not DELETE. - Test the integration layer, not just unit. FastAPI's TestClient + a test DB. ## Forbidden - `from x import *` star imports. - Mutable default arguments (`def f(items=[])`). - Global state. Use dependency injection. - `eval` or `exec` under any circumstances. - `assert` statements for runtime validation (they get stripped in optimized mode).
Skill 03

Shopify Liquid Theme

Shopify section conventions, scoped CSS, schema validation, the {% raw %} escape pattern, no jQuery, performance budgets.

--- description: Shopify Liquid theme conventions, scoped CSS, schema validation, performance budgets. globs: "sections/**/*.liquid,snippets/**/*.liquid,templates/**/*.json" alwaysApply: false --- # Shopify Liquid Theme Rules ## Sections - All sections live in `sections/`. One section per file. - Section file = section template + scoped CSS + schema in one file. - Scope all CSS via `#{{ section_id }}` selector pattern. Assign at the top of the file: `{%- assign section_id = 'my-section-' | append: section.id -%}` - No `!important` on `body`, `html`, `header`, or `footer` selectors. ## Liquid syntax - Comments inside `{%- liquid -%}` blocks use `#` syntax. NOT `comment`/`endcomment`. - Wrap ALL JavaScript Liquid examples in raw blocks (raw...endraw with Liquid tag delimiters). Prevents Liquid parsing of variables. - Use `| escape` on any user-provided string written to HTML attributes. - Use `| json` for embedding Liquid values in JavaScript. ## Schema - Range setting rule: `(max - min) / step >= 3`. Always. - Range setting rule: `(default - min) % step == 0`. Always. - url-type settings: `default` MUST be empty string or null. Never a placeholder URL. - Color-scheme settings: include both light and dark schemes if the section spans both. - Remove dead settings. UnusedAssign warnings indicate config drift. ## CSS - Self-hosted WOFF2 fonts only. Never `@import url('https://fonts.googleapis.com/...')`. - One external preconnect maximum (typically reviews/social proof). Shopify Basic limit. - Use CSS custom properties for color, spacing, font scale. Never hardcoded hex in component CSS. ## JavaScript - IIFE pattern for section JS. No global namespace pollution. - No jQuery. Native DOM APIs only. - Lazy-load images with `loading="lazy"` and `decoding="async"`. - `fetchpriority="high"` only on the LCP element. - Use IntersectionObserver for scroll-triggered effects. ## SEO - Every page must have exactly one `<h1>`. Use semantic heading hierarchy from there. - Every `<table>` must have a `<caption>` element. - JSON-LD schemas: globals (Organization, WebSite, BreadcrumbList) owned by theme.liquid. Page-specific schemas owned by the section. Never duplicate. - Page-specific schemas use `@id` references back to canonical Person/Organization. ## Performance - Mobile PageSpeed score >= 75 required. Cap at ~78-82 on Shopify Basic. - TBT (Total Blocking Time) <= 60ms. - No inline styles in section templates. All styles in the scoped `<style>` block. ## Forbidden - `OEKO-TEX` references in any DDS-related content. Never. (GOTS, GRS, OCS, PETA-Approved Vegan, Fair Trade ONLY.) - Internal links to pages not confirmed live on the storefront. - `console.log` in committed JS. - Inline `<script>` blocks with secrets or API keys.
Skill 04

Next.js Production

Next.js App Router conventions, server vs client component discipline, server actions, caching strategy, image optimization, the production-grade rule set.

--- description: Next.js App Router production conventions, server/client component discipline, caching, server actions. globs: "app/**/*,components/**/*,lib/**/*" alwaysApply: false --- # Next.js Production Rules ## App Router - Use the App Router (`app/`). Pages Router (`pages/`) is deprecated for new code. - Server Components by default. Add `"use client"` only when needed. - Triggers for `"use client"`: useState, useEffect, event handlers, browser-only APIs. - Co-locate page-specific components inside the route directory. ## Server vs client discipline - Keep `"use client"` at the leaves. Don't mark a layout client just to use one hook. - Server Components can import client components. Client components cannot import server components. - Pass server-fetched data as props from server to client components. Don't fetch in client. - Use `Suspense` boundaries around server data. Don't cascade loading states. ## Server actions - Server actions live in `app/actions/[domain].ts`. Always start the file with `"use server"`. - Validate inputs with Zod inside the action. Never trust the client. - Return `{ ok: true, data }` or `{ ok: false, error }` shapes. Don't throw across the boundary. - Use `revalidatePath` or `revalidateTag` after mutations. ## Data fetching - Server Components fetch directly. `await fetch(...)` with appropriate `cache` and `revalidate` options. - Use React's `cache()` to dedupe identical fetches within a request. - Use `fetch` not custom HTTP libraries; Next.js patches it for cache integration. - Client-side fetching only when truly needed: tanstack-query, not raw useEffect. ## Caching - Default fetch behavior: force-cache. Add `cache: 'no-store'` for fresh-every-request data. - Use `revalidate: N` for ISR. Use `tags: ['name']` for selective invalidation. - Static pages: no special config needed. Dynamic pages: use the `dynamic = 'force-dynamic'` export. ## Images - Always use next/image. Never raw `<img>` in production. - Provide `width` and `height` to prevent CLS. Use `fill` for responsive images with sized parent. - Use `priority` on the LCP image only. Lazy by default. - Modern formats: AVIF preferred, WebP fallback. Configure in next.config. ## Forbidden - `useEffect` for data fetching. Use Server Components or tanstack-query. - Direct database access from client components. - API routes in app/api/ for internal calls; use server actions or server components. - Importing server-only modules in client components. Use `import "server-only"` to enforce.
Skill 05

Brand-Voice-Locker

Universal brand-voice rule pattern for content-heavy projects. Lock tone, forbidden words, sentence structure, and channel-specific patterns. Customize the bracketed placeholders.

--- description: Brand voice, tone, and copy conventions. Applies to all content-bearing files. globs: "**/*.mdx,**/*.md,**/copy/**/*,**/content/**/*" alwaysApply: true --- # [BRAND NAME] Voice & Tone Rules ## Identity - Brand: [BRAND NAME] - Audience: [PRIMARY AUDIENCE] - Purpose: [WHAT THE BRAND DOES] - One-line positioning: "[POSITIONING STATEMENT]" ## Voice attributes - [ATTRIBUTE 1]: e.g. "Direct" — short sentences, no hedging - [ATTRIBUTE 2]: e.g. "Confident" — declarative, not conditional - [ATTRIBUTE 3]: e.g. "Specific" — concrete examples, not abstractions - [ATTRIBUTE 4]: e.g. "Warm" — second person, conversational ## Forbidden words and phrases The agent must NEVER use these: - "Unleash" / "unlock" / "leverage" / "synergy" / "ecosystem" (overused buzzwords) - "Just" / "simply" / "easy" (minimizing) - "Game-changing" / "revolutionary" / "next-gen" (hype) - "Powered by AI" (vague, says nothing) - [Add brand-specific forbidden words] - Emojis in any body copy. Headlines only if explicitly requested. ## Forbidden patterns - Hashtags in body content. Social-only. - Rhetorical questions in headlines. - "We" overuse — three "We" sentences in a row triggers a rewrite. - Em dashes everywhere — pick spots deliberately. ## Required patterns - One-sentence paragraphs are allowed and encouraged for emphasis. - Specific numbers beat round numbers. "47% faster" beats "much faster." - Active voice beats passive. "We ship every Friday" beats "Releases are shipped on Fridays." - Verbs before adjectives. "Lasts 10 years" beats "Long-lasting product." ## Channel adaptations - Headlines: under 8 words. Verb forward. No questions. - Subheads: 12-20 words. One claim, one supporting detail. - Body: 15-25 word sentences. One idea per sentence. - CTAs: 2-4 words. Action verb + outcome. "Get the masterclass" not "Learn more." - Email subject lines: 35-45 characters. Specific outcome, not curiosity bait. - Tweets/X posts: 100-150 characters. Hook + payoff. ## Required signoffs / boilerplate - Every blog post ends with: "[BOILERPLATE LINE]" - Every product page includes: "[REQUIRED DISCLOSURE]" - Every email signs off with: "[SIGN-OFF]"
Skill 06

Test-Driven Loop SKILL.md

A full Skill (not just a Rule) that drives an iterate-until-tests-pass workflow. Pair with the stop-hook pattern from Module 10 for hands-off completion.

--- name: test-driven-loop description: Iteratively implement a feature with the test suite as the success criterion. Loops until tests pass or MAX_ITERATIONS is hit. --- # Test-Driven Loop Skill ## When to use Invoke this skill when: - The acceptance criteria can be expressed as failing tests - You want hands-off completion of a well-scoped feature - You're willing to let the agent run for 3-5 iterations ## Workflow ### 1. Write the failing tests first Before implementing anything, write the tests that define done. - Unit tests for any new pure logic - Integration tests for any new boundary crossing (HTTP, DB, queue) - One end-to-end test that proves the user-visible behavior Run the test suite. Confirm the new tests fail for the right reason (missing implementation, not test bugs). ### 2. Create the scratchpad Create `.cursor/scratchpad.md` with the plan: - Feature: [name] - Test files: [list] - Implementation files to create/modify: [list] - Open questions: [list, or "none"] ### 3. Implement, one goal at a time Work toward the first goal. Run tests. If green, move to next goal. If red, read the failure, fix the root cause (not the test), retry. ### 4. The stop-hook continues the loop This skill pairs with `.cursor/hooks/grind.ts` (see Module 10). When the agent's run completes: - If scratchpad contains "DONE", stop - If iteration count >= MAX_ITERATIONS, stop and report failure - Otherwise, the hook re-prompts the agent to continue ### 5. Mark DONE Once all tests pass, update `.cursor/scratchpad.md`: - Add "DONE" anywhere in the file - Add a short summary of what was implemented - Add any followup work to a separate "Followup" section ## Constraints - Never modify test files to make them pass. Tests define the contract. - Never disable failing tests. If a test is wrong, fix the test in a separate commit. - Pause if a test failure reveals a design problem (the spec is wrong, not the code). - Stop if MAX_ITERATIONS is hit. Don't loop indefinitely. ## References - See `references/test-writing-patterns.md` for the testing patterns this team uses - See `references/red-green-refactor.md` for the canonical TDD cycle - Pair with the test-runner subagent (`.cursor/agents/test-runner.md`) for parallel test execution
Reference: 8 Production Templates

Production Templates

Eight common workflows distilled into reusable prompt templates. Save them as Custom Commands in .cursor/commands/ or paste-and-go.

TEMPLATE 01

Full Project Init

Bootstrap the entire .cursor/ directory for a new repo. Rules, hooks, mcp.json, ignore, one starter skill. Cursor reads your existing code to infer conventions.

Best for: New repo onboarding
TEMPLATE 02

Multi-File Refactor

Replace a pattern across many files. Worktree + plan + file-by-file implementation + test after each. Uses Build in Parallel when files are independent.

Best for: Migrations, lint-fix sweeps
TEMPLATE 03

Test Suite Generation

Generate full test coverage for a module. Write, run, fix bugs in source revealed, repeat until coverage > 80% and all green.

Best for: Untested legacy modules
TEMPLATE 04

Security Review

Audit a directory for SQL injection, XSS, exposed secrets, auth bypass, insecure dependencies. Each finding traces input to sink.

Best for: Pre-launch security pass
TEMPLATE 05

Dependency Upgrade

Bump a major dependency. Read changelog, identify breaking changes, apply migration file-by-file, run tests after each. Rollback plan included.

Best for: React 18 → 19, Node 20 → 22, etc.
TEMPLATE 06

Design-to-Code

Convert a Figma frame (via Figma MCP) into a React component using existing patterns. Match spacing, typography, color exactly.

Best for: Frontend implementation from design
TEMPLATE 07

Codebase Q&A

Use the Explore subagent to research how something works. Returns a focused summary of relevant files and conventions. Good before any new feature.

Best for: Onboarding to a new codebase
TEMPLATE 08

Stack Migration

Replace library/framework A with B. Phase plan, per-phase test verification, rollback at each phase. Worktree isolated.

Best for: Vitest → Jest, npm → pnpm, etc.
Cost Reality

Monthly Burn by Surface

Estimates for a developer who uses Cursor 4-6 hours/day on a Pro plan. Actual burn varies wildly with model selection and workflow.

Approximate monthly cost contribution by Cursor surface on a Pro plan. Auto mode does not count against the credit pool.
Surface Light user Medium user Heavy user
Tab autocomplete~$0 (Auto)~$0 (Auto)~$0 (Auto)
Cmd+L Chat (Auto)~$0~$0~$0
Composer 2 multi-file$2-5$8-15$20-40
Agent Mode (Composer 2)$3-8$15-30$40-80
Frontier models (Opus, GPT-5)$5-15$30-80$100-300
Cloud Agents$0-5$10-25$30-100
Bugbot (5 PRs/week)$15-30$20-30$25-45
Bugbot (25 PRs/week)$100-150$120-180
Approximate total$25-60$80-180$200-700
Right planPro ($20)Pro+ ($60) or UltraUltra ($200)
The discipline rule

If your monthly Cursor bill is more than 5x your Pro subscription price, your team has a model-selection problem, not a Cursor problem. Switch to Auto mode by default. Reserve frontier models for the genuinely hard 10% of tasks. Make Composer 2 the team default. Most bills drop 60-80% within a week of applying this discipline.

Reference: 35-Item Production Checklist

Production Checklist

Run through this checklist before declaring your Cursor setup production-ready. Thirty-five items across seven categories. Tick them off as you go.

Setup (5)

  • Setup 01Cursor installed and signed in. Auto-update enabled.
  • Setup 02.cursor/ directory created in repo root. Committed (without secrets).
  • Setup 03.cursorignore covers build outputs, deps, secrets, large assets.
  • Setup 04AGENTS.md or .cursor/rules/000-style-guide.mdc exists with project-wide conventions.
  • Setup 05Team plan chosen (Hobby / Pro / Pro+ / Ultra / Teams / Enterprise) for actual usage profile.

Rules (5)

  • Rules 01At least one alwaysApply style guide rule (under 200 lines).
  • Rules 02Glob-scoped rules per language/stack (TypeScript, Python, Liquid, etc.).
  • Rules 03Each rule file under 500 lines. Bloated rules split by concern.
  • Rules 04Frontmatter on every .mdc file: description, globs (if scoped), alwaysApply.
  • Rules 05Team rules configured in the Cursor dashboard if on a Teams or Enterprise plan.

MCP (5)

  • MCP 01.cursor/mcp.json at project root with 3-6 essential servers.
  • MCP 02All secrets referenced via ${env:VAR_NAME}. No hardcoded API keys.
  • MCP 03Active tool count under 35 (buffer to the 40-tool ceiling).
  • MCP 04Security scores reviewed for each installed plugin from the marketplace.
  • MCP 05Credentials scoped to minimum permissions (read-only where possible).

Agent Safety (5)

  • Safety 01Agents always run on branches, never directly against main.
  • Safety 02Sandbox mode configured with network and filesystem access controls.
  • Safety 03YOLO/Run Everything mode disabled in any environment with production secrets.
  • Safety 04Worktree pattern used for risky multi-file tasks (/worktree command).
  • Safety 05Clean working tree before agent runs. Easy git reset path.

Bugbot (5)

  • Bugbot 01Bugbot enabled on the main repo via GitHub integration.
  • Bugbot 02BUGBOT.md exists with team-specific required and forbidden patterns.
  • Bugbot 03Autofix enabled. Cloud agents push fix commits to PR branches.
  • Bugbot 04Effort level configured (default everywhere, high on security-critical paths).
  • Bugbot 05False-positive rate monitored. Rules updated when team dismisses > 30% of flags.

Cost Discipline (5)

  • Cost 01Auto mode is the team default. Frontier models reserved for genuinely hard tasks.
  • Cost 02Composer 2 set as default for substantive coding work.
  • Cost 03Usage dashboard reviewed weekly for spend spikes and per-user patterns.
  • Cost 04Spend limits set per user (soft on Enterprise, hard on Teams).
  • Cost 05Pilot week run before forecasting monthly budget. Multiplier 4.3x + 20% buffer.

Production (5)

  • Production 01Privacy Mode enabled org-wide. Code not stored or used for training.
  • Production 02SAML/OIDC SSO configured on Enterprise plans.
  • Production 03Audit logs reviewed monthly for unusual access or usage.
  • Production 04Cursor SDK integrated in CI for PR summaries and failure root-cause agents.
  • Production 05Quarterly Cursor changelog review. Update internal docs when major features ship.
Audit cadence

Setup and Rules items: one-time on initial setup. MCP and Agent Safety: revisit when adding new servers or plugins. Bugbot and Cost: weekly review during the first month, monthly thereafter. Production: quarterly. Make the audit a calendar event, not a vibe.

Frequently Asked Questions

Cursor Masterclass FAQ

Sixteen questions answered. Mirrors the FAQPage JSON-LD schema for SEO.

DDS Vibe Academy / Cursor Branch

You have the full Cursor 3.x stack now.

Twelve modules. One hundred prompts. Six skill packages. Eight production templates. The honest decision matrix. The cost calculator. The 35-item checklist. Everything you need to go from never-touched-Cursor to shipping production-grade multi-agent workflows.