Lesson 933 of 2116
Cursor Rules: Teach The Editor Your Repo
Cursor works better when repo rules explain architecture, commands, style, and boundaries before the agent edits.
Lesson map
What this lesson covers
Learning path
The main moves in order
- 1Cursor Rules: Teach The Editor Your Repo
- 2Cursor Agent Mode vs Chat: Pick The Right Loop
- 3Cursor Agent Mode vs Chat: Pick The Right Loop
- 4Context Is Cursor's Fuel
Concept cluster
Terms to connect while reading
Section 1
Cursor Rules: Teach The Editor Your Repo
Cursor works better when repo rules explain architecture, commands, style, and boundaries before the agent edits.
- 1Name the job before naming the tool.
- 2Write the smallest useful scope the agent can finish.
- 3Run the result as a user, not as a fan of the tool.
- 4Inspect the diff, data access, and failure path before sharing.
Use this as the working prompt or checklist for the lesson.
Write rules: use existing UI components, run pnpm typecheck, never edit migrations without asking, prefer server actions for secrets, keep changes scoped.- What should the user be able to do when this is finished?
- What data should the app or agent never expose?
- What test proves the change works?
- What rollback path exists if the output is wrong?
Key terms in this lesson
Section 2
Cursor Agent Mode vs Chat: Pick The Right Loop
Section 3
Cursor Agent Mode vs Chat: Pick The Right Loop
Use chat for questions and design thinking. Use agent mode when you want edits, commands, and verification.
- 1Name the job before naming the tool.
- 2Write the smallest useful scope the agent can finish.
- 3Run the result as a user, not as a fan of the tool.
- 4Inspect the diff, data access, and failure path before sharing.
Use this as the working prompt or checklist for the lesson.
Ask chat to explain the billing flow. Then start agent mode with: implement the smallest fix, run tests, and summarize changed files.- What should the user be able to do when this is finished?
- What data should the app or agent never expose?
- What test proves the change works?
- What rollback path exists if the output is wrong?
Section 4
Context Is Cursor's Fuel
Section 5
Context Is Cursor's Fuel
The right files in context matter more than a dramatic prompt. Add the route, component, type, test, and error output.
- 1Name the job before naming the tool.
- 2Write the smallest useful scope the agent can finish.
- 3Run the result as a user, not as a fan of the tool.
- 4Inspect the diff, data access, and failure path before sharing.
Use this as the working prompt or checklist for the lesson.
Attach src/app/signup/page.tsx, SignupForm.tsx, session.ts, and the failing test. Fix the plan label bug without touching pricing copy.- What should the user be able to do when this is finished?
- What data should the app or agent never expose?
- What test proves the change works?
- What rollback path exists if the output is wrong?
Section 6
Review Before Accepting Cursor Changes
Section 7
Review Before Accepting Cursor Changes
Cursor can apply multi-file edits quickly. Slow down at the accept step and scan for unrelated files, weakened tests, and broad rewrites.
- 1Name the job before naming the tool.
- 2Write the smallest useful scope the agent can finish.
- 3Run the result as a user, not as a fan of the tool.
- 4Inspect the diff, data access, and failure path before sharing.
Use this as the working prompt or checklist for the lesson.
Before accepting, ask Cursor to group changes by purpose. Reject any hunk not tied to the stated bug. Run the affected test after accepting.- What should the user be able to do when this is finished?
- What data should the app or agent never expose?
- What test proves the change works?
- What rollback path exists if the output is wrong?
Section 8
When Cursor Is Not The Right Tool
Section 9
When Cursor Is Not The Right Tool
Cursor is excellent inside the editor. Switch to Codex, Claude Code, or a cloud agent when the task needs long-running autonomy or parallel PRs.
- 1Name the job before naming the tool.
- 2Write the smallest useful scope the agent can finish.
- 3Run the result as a user, not as a fan of the tool.
- 4Inspect the diff, data access, and failure path before sharing.
Use this as the working prompt or checklist for the lesson.
Classify three tasks: rename a component, migrate auth, audit 300 lessons. Pick Cursor, CLI agent, or cloud agent for each and justify the choice.- What should the user be able to do when this is finished?
- What data should the app or agent never expose?
- What test proves the change works?
- What rollback path exists if the output is wrong?
End-of-lesson quiz
Check what stuck
15 questions · Score saves to your progress.
Tutor
Curious about “Cursor Rules: Teach The Editor Your Repo”?
Ask anything about this lesson. I’ll answer using just what you’re reading — short, friendly, grounded.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Creators · 40 min
AGENTS.md Scope And Precedence In Codex
Codex reads project guidance files so the agent can follow local conventions. Scope and precedence decide which instruction wins.
Creators · 40 min
Hermes As A Local Agent Brain
Hermes is useful when you need open-weight instruction following, tool-call discipline, and local control more than frontier-model peak reasoning.
Creators · 14 min
Handoff From Claude Design To Codex Or Claude Code
A prototype is not a production implementation. Handoff should include tokens, components, states, data, constraints, and acceptance checks.
