Use Cursor Agent in Real Repos

By Rogier Muller11.10.26
Use Cursor Agent in Real Repos

Start smaller than the Agent window invites you to start. Cursor's Agent helps when you want Cursor to turn a bounded request into an editable repo diff, but it still needs the repository rules, test command, and review path up front. In Cursor agent mode, I treat it as a delegated implementer, not as the owner of the change.

That is how I teach it in a Cursor workshop: write the work down, give the agent the local constraints, let it make a draft, then review the diff like you would review a teammate's PR. For Cursor for engineering teams, the useful setup is a mix of Cursor rules, cursor skills, cursor subagents, and careful MCP access, not one heroic prompt. I keep the broader pattern under Subagents and skills, because the agent gets better when the team context is structured.

Give the agent one owned change

When someone asks how to use Cursor Agent, my first answer is to cut the work down until it fits in one reviewable diff. A good task is not update checkout. A good task is add server-side validation to the checkout address field, update the existing unit test, and do not touch payment capture.

Use a real workflow boundary. In a Next.js repo, I would point Cursor Agent at app/api/checkout, the Zod schema, and the Playwright checkout test, then say which behavior must stay unchanged. That gives the agent enough room to implement, but not enough room to redesign the flow.

This sits in the Delegate step of our methodology. You are not giving away judgment. You are giving away a bounded pass at the code so your review can start from a concrete diff.

Rolling this out in your team?

We train engineering teams on their own codebase in two days. Cursor setup, shared rules and review included.

Put durable instructions where Cursor can reuse them

Do not paste the same architecture notes into every chat. Put durable repository behavior in Cursor rules, and keep task-specific detail in the prompt for the current change.

A useful rule tells the agent how this repo wants code written. For example: API handlers return typed errors, Prisma migrations are generated manually, tests live next to the route, and snapshots are not updated without a human note. Keep it short enough that a developer would actually read it.

If your team uses AGENTS.md as a repo boundary, keep it aligned with Cursor rules rather than creating two competing sources of truth. Nested files are useful when one part of the repo has different constraints, such as mobile code, infrastructure, or a legacy package. One flat file usually becomes vague.

Use skills and subagents for repeated work

Cursor skills are worth using when the same workflow appears often enough to deserve packaging. A release-note skill, migration skill, or incident-summary skill can carry the steps, examples, and commands that people otherwise retype into chat.

Cursor subagents and cursor custom agents are better for role separation. I would rather have a test-focused subagent inspect a diff for missing coverage than ask the implementation agent to grade its own work. That separation is not magic, but it changes the shape of review.

For team rollout, keep custom agents boring at first. Name the role, define the files it may touch, list the commands it can suggest, and say when it must stop. If you want a deeper curriculum for that setup, I wrote more on Cursor Training for Subagents and Skills.

Connect MCP only where live context is needed

Cursor MCP is useful when the agent needs facts outside the repo, such as an issue, a design reference, or a private document. Start with read-only access unless the workflow truly needs writes.

For the checkout example, read access to the issue tracker and pull request history may help the agent understand acceptance criteria. Write access to production data does not help it validate an address field. The smaller the integration surface, the easier the review.

Cursor background agents have the same constraint at a larger scale. They are better for independent tasks with clear branches and test commands than for vague cleanup work across a busy repo. Background execution does not remove the need for ownership.

Run Cursor Agent in this order

Use this order when the change matters and you want a repeatable team habit.

  1. Pull the latest branch and inspect the relevant files yourself.
  2. Write the task in one paragraph: desired behavior, files in scope, files out of scope, and the test command.
  3. Attach or reference the relevant Cursor rules, skill, or subagent.
  4. Ask Cursor Agent for a short plan before it edits.
  5. Reject plans that widen the scope, skip tests, or change public behavior without saying so.
  6. Let the agent edit only after the plan matches the task.
  7. Review the diff by file, not by chat transcript.
  8. Run the test command yourself or in CI.
  9. Ask for a summary of what changed and what remains risky.
  10. Commit only when you can explain the diff without the agent present.

The main limit is simple: Cursor agents can produce plausible code faster than a team can absorb it. That is helpful only when review stays smaller than the change.

Paste this operating checklist into a team note

# Cursor Agent operating checklist

## Before delegation
- The task fits in one pull request.
- The expected behavior is written in plain language.
- Files in scope are named.
- Files out of scope are named.
- The relevant Cursor rules or repo instructions are current.
- The test command is known.
- External context through MCP is read-only unless writes are required.

## During the run
- Ask for a plan before edits.
- Stop if the plan changes architecture without permission.
- Keep implementation and review as separate passes.
- Use a focused subagent when testing, security, or migration review needs a second role.
- Use background agents only for independent work with a clear branch and test path.

## Before merge
- Review the diff file by file.
- Run or verify the named tests.
- Check generated code, migrations, and snapshots manually.
- Ask Cursor Agent to summarize risk, but do not outsource acceptance.
- Commit only when a human owner can explain the change.

Further reading

Practice on one small change

Run the checklist on one low-risk bug this week, and use hands-on training on Cursor subagents and skills if you want a team room to practise the same loop together.

Related research

Train your team on Cursor

Two days on your team's own repository, onsite or remote, with a written proposal before you commit.

Book a call

Prefer to measure first? Take the free team check.