next-upgrade

Upgrade Next.js codebases to newer major releases using official migration guides and codemods.

885|108|Updated Apr 30, 2025
One-click install
npx skills add https://github.com/legions-developer/invoicely --skill next-upgrade-legions-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-upgrade
Source: https://github.com/legions-developer/invoicely/tree/main/.agents/skills/next-upgrade
Command: npx skills add https://github.com/legions-developer/invoicely --skill next-upgrade-legions-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents breaking changes and risky upgrades when moving a Next.js app to a newer major version by aligning the upgrade to official migration guidance.

Core Features & Use Cases

  • Upgrade planning from your current versions: Detects the installed Next.js (and related) versions from package.json to choose the correct migration path, including incremental upgrades for large jumps.
  • Automated codemod application: Runs Next.js codemods for known breaking changes to reduce manual edits and speed up compliance with newer APIs.
  • Dependency and compatibility updates: Upgrades Next.js and peer dependencies together and then applies any required manual changes (config, deprecated features, and TypeScript types).
  • Use Case: You maintain an invoicing web app on an older Next.js major release; this Skill helps upgrade to the newest stable version without runtime or build failures by following the correct versioned guide steps and codemods.

Quick Start

Ask the AI to upgrade your project to the latest Next.js version by reading your package.json, applying the relevant codemods from the official migration guides, then updating Next.js and peer dependencies and running a build and dev smoke test.

Frequently Asked Questions about next-upgrade

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I upgrade Next.js to a newer major version without breaking changes?

To upgrade Next.js safely, read your package.json to detect current versions, follow official migration guides for the correct incremental path, apply codemods for known breaking changes, update peer dependencies like React, and validate with build and runtime checks.

What is the best way to handle Next.js App Router migration and dependency updates?

Handling Next.js App Router migration requires aligning peer dependencies like React and React DOM during version jumps, applying required manual config changes, and updating TypeScript types while following the official versioned upgrade guide.

Can I use codemods to automate Next.js migration steps for my monorepo?

Yes, you can use Next.js codemods to automate known breaking changes in monorepos, reducing manual edits and speeding up API compliance by selecting an incremental upgrade path based on your detected current version.

How does dependency alignment work when upgrading Next.js and React together?

Dependency alignment during a Next.js upgrade works by upgrading Next.js, React, React DOM, and related peer packages together, ensuring compatibility across the monorepo before applying manual config and TypeScript type updates.

Do I need to run build and dev smoke tests after applying Next.js codemods?

Yes, you need to run build and dev smoke tests after applying Next.js codemods and updating dependencies to validate the upgrade result and catch any runtime or build failures.

Why does my Next.js upgrade fail when jumping multiple major versions?

A Next.js upgrade often fails across large version jumps if you skip incremental steps; safely upgrading requires following the correct versioned guide, applying specific codemods, and aligning peer dependencies progressively.