Who is Eric Su?

How to Turn Cursor Into Your Senior Dev Partner (And Stop Fighting Your AI)

6 min read
Eric Su
cursoraiproductivitydeveloper-toolsworkflow

How to Turn Cursor Into Your Senior Dev Partner

TL;DR

  1. Create AGENTS.md in project root (project rules)
  2. Add global rules in Cursor Settings (your philosophy)
  3. Be specific about DON'Ts
  4. Iterate based on what annoys you
  5. Ship faster

The difference between AI that frustrates you and AI that 10x's you isn't the model. It's the 30 minutes you spend teaching it how you work.


You just downloaded Cursor. You're excited. You ask it to "build a login page" and it creates 8 files, uses inline styles, and somehow commits your API key to GitHub.

Sound familiar?

The problem isn't Cursor. The problem is Cursor doesn't know how YOU work.

Out of the box, it's like a brilliant intern on day one—talented but clueless about your standards, your codebase, and your pet peeves.

The solution? Teach it. Takes 30 minutes. Changes everything.

What You'll Learn

  • The two-file system that controls AI behavior
  • How to stop AI from creating code you hate
  • Why your DON'T list is more powerful than your DO list
  • How to make Cursor feel like it's reading your mind

The Core Problem

Cursor optimizes for "code that works." Without constraints, that means:

  • 2000-line files
  • Emoji spam
  • Documentation you didn't ask for
  • Generic, cookie-cutter UI
  • Obvious comments like // increment counter

You need to teach it what "good code" means to YOU.


The Two-File System

File #1: AGENTS.md (Project-Specific Rules)

Location: Project root
Purpose: The constitution for THIS project
Length: Under 50 lines

What Goes In AGENTS.md

1. Project Overview (2-3 sentences)

What are we building?
Why does it exist?

2. DO Section

  • Code philosophy: "meaningful names, single responsibility, DRY"
  • Design principles: "personality over cookie-cutter"
  • Required frameworks: "shadcn/ui + Tailwind"

3. DON'T Section

  • Don't commit secrets
  • Don't create markdown files unless asked
  • Don't use emojis unless requested

4. Quick Start Commands

cd backend
pnpm install
pnpm dev

Real Example:

# My Project Name

Brief description of what this project does.

## DO
- Use shadcn/ui components for UI
- Keep functions small and focused
- Handle errors gracefully with validation
- Design with personality: custom colors, varied spacing, subtle animations

## DON'T
- Don't commit secrets—use .env.example with placeholders
- Don't create MD files unless asked
- Don't use emojis unnecessarily

## Quick Start
cd backend && pnpm install && pnpm dev
cd frontend && pnpm install && pnpm dev

File #2: Cursor Rules (Global Preferences)

Location: Settings → Cursor Settings → Rules for AI
Purpose: Your engineering philosophy across ALL projects
Structure: Three layers

Layer 1: Code Principles

  • High cohesion, loose coupling
  • Single responsibility (one reason to change)
  • No returning/passing null
  • Pick ONE word per concept (fetch OR get OR retrieve—choose one)
  • Avoid deep nesting (<3 levels)

Layer 2: AI Behavior

  • Understand before editing (read files first)
  • Plan before execution (outline approach for complex tasks)
  • Follow existing patterns (match the repo's style)
  • Make small, focused changes (minimal diffs)
  • Evidence over assumption (use actual file contents)
  • Autonomous but careful (ask only when intent is ambiguous)

Layer 3: Communication Rules

  • Don't write obvious comments
  • Ask before major architectural changes
  • When asked informational questions, just answer (don't write code)
  • Don't use emojis unnecessarily
  • Never commit secrets
  • Run test builds after substantial changes

The Secret Weapon: Research Priority

Most people don't know Cursor can search docs and the web FOR you. But you need to tell it where to look.

Add this to your AGENTS.md:

## Research Priority
1. Use Exa.ai for initial research (get_code_context_exa for code)
2. Use Ref.tools for verification or after Exa fails twice
3. Only repeat searches when refining, not retrying

Why this matters: Without guidance, Cursor will:

  • Ping random documentation
  • Hallucinate outdated APIs
  • Give you pre-2023 answers

Before & After

Before Setup

You: "Build a login page"

Cursor:

  • Creates 8 separate components
  • Uses inline styles
  • No error handling
  • Commits API keys
  • Adds helpful emoji

After Setup

You: "Build a login page"

Cursor:

  • Uses your shadcn/ui components
  • Applies Tailwind utilities
  • Proper error handling with validation
  • References .env.example
  • Asks about your auth strategy before implementing

The One Rule That Changes Everything

Be specific about what you DON'T want.

Your DON'T list > Your DO list.

Why? AIs are optimizers. Give them constraints or they'll optimize for the wrong thing.

Example DON'Ts:

  • Don't create documentation files unprompted
  • Don't use emojis in code or commits
  • Don't write obvious inline comments
  • Don't commit actual secret values
  • Don't create helper scripts for one-off tasks

Getting Started (30-Minute Setup)

Step 1: Create AGENTS.md (15 minutes)

  1. Open your project root
  2. Create AGENTS.md
  3. Write:
    • 3 sentences about your project
    • 3-5 DO items (frameworks, code style, design)
    • 3-5 DON'T items (secrets, emoji, unwanted files)
    • Dev server commands

Step 2: Add Cursor Rules (15 minutes)

  1. Open Cursor Settings → Rules for AI
  2. Add 5-10 rules about:
    • How you name things
    • What you hate seeing in code
    • When AI should ask vs. just do

Step 3: Test It

Ask Cursor to refactor something small.

Pass: It maintains your style and doesn't create random docs
Fail: Look at what went wrong → add to DON'T list


Evolution Strategy

Week 1: Start with basics (AGENTS.md + 5 global rules)

Week 2-4: Notice patterns when AI misbehaves → add rules

Month 2+: Remove rules that don't change behavior

Goal: After 2-3 weeks, Cursor should feel like it's reading your mind.


The Payoff

What you'll notice:

  • Fewer "WTF just happened" moments
  • Code that matches your existing patterns
  • Less time explaining context
  • More time in flow state
  • AI that feels like a senior dev who GETS IT

Final Test

Ask Cursor to refactor a component.

If it:

  • Maintains your naming conventions
  • Follows your style guide
  • Doesn't create documentation you didn't ask for

You've nailed it.

If not:
Whatever it did wrong → add that to your DON'T list.


Now go build something.

Additional Resources