Cursor

Verified against Cursor · 2026-07-28

Run a major dependency upgrade through Cursor agent mode in stages, not one shot

A triage-then-migrate-then-verify brief for upgrading a dependency across a codebase in agent mode, with a confirm gate before any file changes so the blast radius is reviewed as a plan, not a diff.

Cursor 2.1

The prompt

Ready to copy — highlighted parts are example details you can swap.

Upgrade react-router-dom from 6.22.0 to 7.1.0 across this codebase. Do this in three explicit stages and stop between each for confirmation before continuing.

STAGE 1 — TRIAGE
Search the codebase for every usage of react-router-dom's APIs. Cross-reference against these known breaking changes and report which usages are affected before changing anything:
useNavigate's replace option moved into a NavigateOptions object; <Switch> was removed in favor of nested <Routes>; loader/action data APIs changed shape.

STAGE 2 — MIGRATE
Only after triage is confirmed: update the dependency version and migrate each affected usage found in Stage 1. Do not touch files that only import the package without using an affected API.

STAGE 3 — VERIFY
Run the build, typecheck, and test suite. If anything fails that Stage 1 did not predict, stop and report it as a gap in the triage — don't silently patch around it.

Do not upgrade any other dependency as a side effect, even a peer dependency, without naming it and asking first.
Customize the highlighted detailsoptional — the prompt above already works

Why this works

An unscoped 'upgrade this package' request in agent mode tends to bump the version number and then start editing whatever breaks at typecheck time, which quietly conflates two very different categories of change: code the migration guide says must change, and code that merely needs a type assertion to compile without actually being correct. Forcing a triage-then-confirm gate before any file is touched means the blast radius gets reviewed while it's still a list of usages, not after it's already a diff applied across dozens of files under the pressure of 'the build is currently broken, let's just fix it.' Treating a Stage 3 failure the triage didn't predict as a reportable gap, rather than something to patch around silently, catches breaking changes that weren't in the notes fed to it in the first place — a real risk, since migration-guide breaking-changes lists are routinely incomplete for edge-case APIs, and an agent that just makes the error go away will hide exactly the case you most needed to know about.

What you get back

STAGE 1 — TRIAGE Found 14 usages of react-router-dom across 9 files. - 3 usages of useNavigate with a { replace: true } second argument — AFFECTED (API shape changed). - 1 usage of <Switch> in src/App.tsx — AFFECTED (removed in v7, needs <Routes>). - 10 usages of <Link>/<Route> with no changed props — NOT AFFECTED. Awaiting confirmation before Stage 2.

Verified against

Cursor 2.1 · 2026-07-28

Changelog

  • 2026-07-28 Initial publish, verified against Cursor 2.1 agent mode on a react-router-dom v6-to-v7 upgrade.

Need this built into your business?

If a prompt isn't enough — custom software, built and maintained for you — that's Scult's day job.

EXPLORE CUSTOM SOFTWARE
All Cursor prompts

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY