next-upgrade

Upgrade Next.js projects to the latest version with codemods and dependency updates.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the risk and guesswork from upgrading a Next.js application by guiding the project through version-aware migration steps, dependency updates, and required code changes.

Core Features & Use Cases

  • Version Detection: Identifies the current Next.js and React dependency versions before planning the upgrade path.
  • Official Migration Guidance: Uses the relevant Next.js upgrade docs to apply the correct steps for major version changes.
  • Codemod-First Workflow: Runs recommended codemods to automate repetitive breaking-change migrations.
  • Build and Runtime Validation: Verifies the upgrade by checking for build issues and testing the app after changes.
  • Use Case: A developer moving a production app from an older Next.js release to the latest version can use this Skill to sequence the upgrade safely and reduce manual migration errors.

Quick Start

Ask the skill to upgrade the current Next.js project to the latest target version, applying the relevant migration guidance, codemods, dependency updates, and validation checks.

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 safely?

A safe Next.js upgrade requires detecting current versions, applying official migration guidance, running codemods for breaking changes, updating peer dependencies, and verifying the build to ensure a structured transition to the latest supported version.

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

Codemods are automated code transformation tools that handle repetitive breaking-change migrations during a Next.js upgrade. Running them automates code modifications, reducing manual migration errors and ensuring codebase alignment with new major version requirements.

Can I use this Next.js migration workflow for both App Router and Pages Router?

Yes, the Next.js upgrade workflow applies to both App Router and Pages Router codebases. It handles major-version migrations by aligning dependencies and applying necessary manual breaking-change fixes across different router architectures.

How do I fix breaking changes when updating Next.js dependencies?

To fix breaking changes when updating Next.js dependencies, apply official migration guidance and execute recommended codemods. This automates repetitive code transformations, while manual fixes address remaining issues for peer dependency alignment.

What is the best way to verify a Next.js build after a major version upgrade?

The best way to verify a Next.js build after an upgrade is to run build verification checks and test the application runtime. This validates that dependency updates and codemod executions resolved all build issues successfully.

Why does my Next.js build fail after a major version migration?

A Next.js build often fails after a major version migration due to misaligned peer dependencies or unresolved breaking changes. Running recommended codemods and applying official migration guidance manually resolves these build issues.