next-upgrade
Installation
Summary
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
SKILL.md
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).