Upgrade Next.js to the latest version following official migration guides and codemods
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
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:
Update dependencies: Upgrade Next.js and peer dependencies together, using the exact [target-version] passed by the user for the current step. If no target version was provided, use the next incremental version identified in Step 3 instead of jumping straight to latest. Determine <supported-react-version> from the official upgrade guide for that target Next.js version, since React and React DOM peer requirements can change between releases: