next-upgrade

Upgrade Next.js projects with codemods and validate via build and dev runs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Upgrade Next.js projects to the latest version while aligning React and React DOM and applying official migration guides and codemods to minimize breaking changes.

Core Features & Use Cases

  • Detect current Next.js version and related dependencies (React, React DOM, etc.)
  • Apply codemods and follow version-specific migration guides to perform automated and manual updates
  • Upgrade dependencies, review breaking changes, and validate the project with build and dev tests
  • Use Case: Migrate a Next.js app from a previous major version to the latest following official guides and codemods

Quick Start

Confirm the current Next.js version, then apply official codemods and upgrade dependencies to complete the migration.

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 safely?

To safely upgrade Next.js, this process applies official codemods to automate breaking changes, upgrades Next.js alongside compatible React and React DOM dependencies, and validates the migration using build and dev runs.

How do I migrate a Next.js app router project to a new major version?

Migrating a Next.js app router project involves detecting current dependencies, applying version-specific migration guides and codemods, updating TypeScript types, and validating the project configuration through build and dev tests.

Can I use codemods to automate breaking changes when upgrading React and Next.js?

Yes, codemods are applied to automate breaking changes during the Next.js upgrade process, aligning React and React DOM dependencies while following official migration guides to minimize manual updates.

Does this Next.js migration approach work for monorepos and single repos?

Yes, the Next.js upgrade process is applicable across both monorepos and single repos, detecting current versions and related dependencies to apply codemods and upgrade packages consistently.

What is the best way to handle TypeScript types updates during a Next.js upgrade?

The best way to handle TypeScript types updates during a Next.js upgrade is to align React and React DOM dependencies first, then apply official codemods and review configuration changes before validating with a build.

Why do I need to run build and dev tests after upgrading Next.js?

Running build and dev tests after upgrading Next.js validates that dependency upgrades, codemods, and configuration changes did not introduce breaking errors into the project.