next-upgrade

Upgrade Next.js projects to the latest version using official codemods and migration guides.

Updated Aug 21, 2025
One-click install
npx skills add https://github.com/Adithiya-S/AI-Study-Companion --skill next-upgrade-adithiya-s
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-upgrade
Source: https://github.com/Adithiya-S/AI-Study-Companion/tree/main/.agents/skills/next-upgrade
Command: npx skills add https://github.com/Adithiya-S/AI-Study-Companion --skill next-upgrade-adithiya-s

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Upgrading Next.js across major versions involves breaking API changes, deprecated features, and peer dependency conflicts that are tedious and error-prone to handle manually. ## Core Features & Use Cases - Version Detection and Upgrade Path Planning: Reads package.json to identify the current Next.js version and determines incremental migration steps for major version jumps. - Automated Codemods: Runs official @next/codemod transforms such as next-async-request-api to apply breaking changes automatically. - Dependency and Type Updates: Upgrades next, react, react-dom, and their TypeScript type packages together, then verifies the result with build and dev server checks. - Use Case: A project on Next.js 14 needs to move to the latest release; the skill fetches the official migration guides, applies the relevant codemods, updates dependencies, and validates the build. ## Quick Start Upgrade my Next.js project to the latest version and run the appropriate codemods.

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?

Detect the current version in package.json, follow the official upgrade guide at nextjs.org, run the relevant @next/codemod transforms, then update next, react, and react-dom together. Verify with npm run build and npm run dev.

How to run Next.js codemods for breaking changes?

Run npx @next/codemod@latest <transform> <path> with the transform matching your target version. Common transforms include next-async-request-api, next-request-geo-ip, and next-dynamic-access-named-export for v15 migrations.

Can I upgrade Next.js across multiple major versions at once?

No, upgrade incrementally through each major version, such as 13 to 14 to 15. Each major release has its own migration guide and codemods that must be applied in sequence to avoid missing breaking changes.

Does upgrading Next.js require updating React and TypeScript types?

Yes, Next.js peer dependencies must be upgraded together using npm install next@latest react@latest react-dom@latest. TypeScript projects should also update @types/react and @types/react-dom to matching versions.

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

Build failures typically come from unapplied breaking changes such as async request APIs in v15, outdated next.config.js options, or removed deprecated features. Check the version-specific migration guide and run the matching codemods.