next-upgrade

Upgrade Next.js applications to latest releases with codemods and dependency updates.

Updated Aug 8, 2024
One-click install
npx skills add https://github.com/CAPJackie/x --skill next-upgrade-capjackie
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-upgrade
Source: https://github.com/CAPJackie/x/tree/main/.agents/skills/next-upgrade
Command: npx skills add https://github.com/CAPJackie/x --skill next-upgrade-capjackie

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Next.js major and minor upgrades can break apps due to changed APIs, deprecated features, and required codemods, making upgrades risky and time-consuming.

Core Features & Use Cases

  • Version discovery from your project: Detects your current Next.js/React/React DOM versions by inspecting package.json.
  • Official upgrade guidance and path planning: Selects the correct migration steps based on your current version and recommends incremental upgrades for large jumps.
  • Codemods plus dependency alignment: Runs Next.js codemods first, then upgrades Next.js and peer dependencies together, and validates required breaking changes.
  • Use Case: Upgrading a production App Router project when moving from Next.js 13 to 14 to 15, handling async request behavior and other breaking changes with minimal downtime.

Quick Start

Tell the AI to upgrade your Next.js project to the latest version using the next-upgrade skill.

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 without breaking changes?

To upgrade Next.js safely, you must read package.json to detect current versions, fetch official migration guides, run @next/codemod transforms, update peer dependencies together, and verify via build and dev testing.

What is the best way to handle a major Next.js migration for an App Router project?

The best way to handle a major Next.js migration is by applying incremental upgrades for large version jumps, utilizing official migration steps and codemods to manage breaking changes like async request behavior with minimal downtime.

How do @next/codemod transforms work when updating React and Next.js dependencies?

@next/codemod transforms work by executing first during an upgrade to automatically refactor deprecated APIs, ensuring that Next.js, React, and peer dependencies are aligned and updated together before validating breaking changes.

Does this Next.js upgrade process support large version jumps from 13 to 15?

Yes, the Next.js upgrade process supports large jumps by recommending incremental upgrades, fetching official upgrading documentation for each step, and applying appropriate codemods to prevent unplanned major-version breaks.

Why does upgrading Next.js and React together require fetching official migration guides?

Upgrading Next.js and React together requires fetching official migration guides because major releases introduce changed APIs and deprecated features, making manual upgrades risky without official path planning and codemods.