next-upgrade

Detect Next.js versions, apply codemods, and update dependencies for migration.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/stamatim/agent-skills --skill next-upgrade-stamatim
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-upgrade
Source: https://github.com/stamatim/agent-skills/tree/main/.agents/skills/next-upgrade
Command: npx skills add https://github.com/stamatim/agent-skills --skill next-upgrade-stamatim

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Upgrades Next.js projects to the latest version following official migration guides and codemods, reducing manual effort and risk.

Core Features & Use Cases

  • Detect current Next.js and related dependencies versions and generate an upgrade plan.
  • Apply Next.js codemods to automate breaking changes and migrate APIs.
  • Update Next.js and peer dependencies, review breaking changes, and validate TypeScript types if present, ensuring a working build.

Quick Start

Detect the current version, apply the recommended codemods, update dependencies, and verify the project builds.

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 the latest version without breaking my project?

Upgrading Next.js safely involves detecting your current version, applying official codemods to automate breaking API changes, updating peer dependencies like React, and verifying the build to ensure a successful migration.

What are codemods and how do they help with Next.js migration?

Codemods are automated code transformation tools that apply incremental changes across major version jumps, updating deprecated Next.js APIs and syntax to reduce manual migration effort and risk.

Can I use this approach to upgrade React and React DOM alongside Next.js?

Yes, a proper Next.js upgrade identifies related peer dependencies and applies incremental version jumps for React and React DOM as appropriate, reviewing breaking changes to ensure compatibility.

How do I know which Next.js breaking changes affect my TypeScript project?

The migration process reviews breaking changes for your detected Next.js version and validates TypeScript types if present, updating dependencies to ensure a working build after applying all codemods.

What's the best way to handle multiple major version jumps in a Next.js upgrade?

Handling major version jumps requires an incremental upgrade path that applies codemods step by step, updating dependencies and verifying the development workflow at each stage to avoid build failures.

Why does my Next.js build fail after updating dependencies manually?

Manual Next.js upgrades often miss breaking API changes that codemods handle automatically; a successful migration requires applying the recommended codemods, updating dependencies, and verifying the build workflow.