next-upgrade
Automated Next.js version upgrades with official codemods and migration guide integration.
- Detects current Next.js version from
package.jsonand fetches version-specific upgrade documentation from official guides - Runs Next.js codemods automatically to handle breaking changes like async Request APIs, geo/IP property migrations, and dynamic import transformations
- Handles incremental upgrades for major version jumps (e.g., 13 → 14 → 15) and updates peer dependencies (React, React DOM, TypeScript types) in a single step
- Validates upgrades by running build and dev commands to catch errors before completion
Upgrade Next.js
Upgrade the current project to the latest Next.js version following official migration guides.
Instructions
-
Detect current version: Read
package.jsonto identify the current Next.js version and related dependencies (React, React DOM, etc.) -
Fetch the latest upgrade guide: Use WebFetch to get the official upgrade documentation:
- Codemods: https://nextjs.org/docs/app/guides/upgrading/codemods
- Version-specific guides (adjust version as needed):
-
Determine upgrade path: Based on current version, identify which migration steps apply. For major version jumps, upgrade incrementally (e.g., 13 → 14 → 15).
-
Run codemods first: Next.js provides codemods to automate breaking changes:
More from vercel-labs/next-skills
next-best-practices
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
84.0Knext-cache-components
Next.js 16 Cache Components - PPR, use cache directive, cacheLife, cacheTag, updateTag
27.6Knext-best-practice
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
2