next-upgrade

Automate Next.js upgrades with codemods and validate builds.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the process of upgrading a Next.js project to the latest major version, reducing manual steps and the risk of breaking changes.

Core Features & Use Cases

  • Codemod-driven upgrades: apply official Next.js codemods to migrate APIs and configuration.
  • Incremental version jumps: handle major version steps (e.g., 13 → 14 → 15) in safe, incremental moves.
  • Dependency & config updates: update Next.js, React, React DOM, and related config (next.config.js) while preserving project behavior.

Quick Start

Upgrade a Next.js project by running automated codemods, updating dependencies, and validating 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 major version safely?

The safest way to upgrade Next.js is applying official codemods to migrate APIs and configuration, handling major version jumps incrementally to preserve project behavior.

How do Next.js codemods work during a major version migration?

Next.js codemods work by automatically applying transformations to your codebase, updating APIs and configuration to match the target version. They handle incremental version steps, ensuring your project's behavior is preserved while updating dependencies like React and React DOM.

Can I upgrade a Next.js project using the app directory or pages router?

Yes, you can upgrade a Next.js project whether it uses the app directory or the pages router. The upgrade process applies official codemods and dependency updates to both routing architectures, preserving existing project behavior while moving to the latest version.

What is the best way to handle incremental Next.js version jumps?

The best way to handle incremental Next.js version jumps is to move through major versions in safe, sequential steps, applying official codemods and updating dependencies at each stage before validating the build to ensure stability.

Do I need access to specific files to automate a Next.js upgrade?

Yes, you need access to your project's package.json and next.config.js files to automate a Next.js upgrade. These files are required to update dependencies and configuration while applying official codemods to migrate the codebase.

Why does upgrading Next.js and React dependencies cause breaking changes?

Upgrading Next.js and React dependencies causes breaking changes when major version updates introduce API modifications or configuration requirements. Applying official codemods during the upgrade process automatically migrates these APIs and updates configuration to prevent build failures.