wp2next upgrade
Brings a site built with an older wp2next up to the installed version, on a branch, and proves nothing visible changed.
| Synopsis | wp2next upgrade [<project path>] [--to <version>] [--dry-run] (Claude desktop and Claude Code plugin: /wp2next:upgrade; Codex: $wp2next upgrade; Cursor: /wp2next upgrade) |
|---|---|
| Changes code | Yes, on branch wp2next/upgrade-<version>. Production isn't touched until you merge, and you do the merging |
| Touches outside services | It asks before pulling, before pushing the branch (which makes Vercel build a preview), before sending a test form (a real submission) and before opening a pull request. A rollback after merging is also asked first |
| Reads | wp2next.json (wp2next.version), the project's code, the release notes and their migration notes, the installed skill's reference files |
| Writes | Code and dependency changes on the branch, a plan and report in .wp2next/upgrade/<version>/, wp2next.version and lighthouse.lastRun in wp2next.json, the project CLAUDE.md |
What it does
- Works out the versions: from the project's
wp2next.versionto the installed version (or--to). A project from wp2next 1.x has nowp2next.json;upgradecreates one from what's in the repo. If the skill is older than the project, it tells you to runupdatefirst. - Writes a plan from every release's migration notes in between: config-key changes, changed reference files, the Node 24 + pnpm 11 toolchain move, the Next.js 15 → 16 checklist when the jump crosses it, and how long it usually takes (an hour or two for a typical marketing site, longer if the screenshot diff finds problems). It waits for your yes.
- Checks first: a clean tree on the default branch, and lint, typecheck and build passing before the upgrade, so later failures belong to the upgrade. If the old build fails, it stops; fixing it is a separate job.
- Baseline: refreshes the measuring scripts, then captures screenshots, routes, head tags and a Lighthouse run of the current production build.
- Upgrades: toolchain, codemods, the Next.js 16 checklist, layout changes, config migrations, and the reference files the project copied, which it diffs and asks about file by file.
- Re-verifies: lint, typecheck, build, then the same captures; screenshots, routes and head tags must match, and Lighthouse is compared before and after.
- Preview and report: pushes the branch after your yes, checks the Vercel preview (Node 24.x, pnpm 11.10.0), writes a report, records the new version, and offers a pull request.
Rollback: before merging, delete the branch; production never changed. After merging, Vercel's instant rollback plus reverting the merge commit.
After the upgrade it offers optimize if parity was signed off.
Arguments and options
| Argument | Effect |
|---|---|
| (none) | Upgrade the project in the current folder to the installed version |
<project path> | The project to upgrade |
--to <version> | Upgrade to a specific version instead of the installed one |
--dry-run | Show the plan only; change nothing |
Examples
For Claude desktop
/wp2next:upgrade --dry-run/wp2next:upgrade --dry-run$wp2next upgrade --dry-run/wp2next upgrade --dry-runwp2next upgrade: run the upgrade after reviewing the plan.wp2next upgrade --to 2.0.0: stop at a specific release.
Related
- Updating wp2next and older sites
update(run first) ·changelog·status·optimize- Release and migration notes:
skills/wp2next/CHANGELOG.md (external site) - Agent instructions:
references/commands/upgrade.md (external site)