next-upgrade

Upgrade Next.js projects by applying official migration codemods and updating dependencies.

1|Updated Sep 8, 2010
One-click install
npx skills add https://github.com/Nivl/melvin.la --skill next-upgrade-nivl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-upgrade
Source: https://github.com/Nivl/melvin.la/tree/main/.agents/skills/next-upgrade
Command: npx skills add https://github.com/Nivl/melvin.la --skill next-upgrade-nivl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Upgrade Next.js projects to the latest stable version by applying official migration codemods and updating dependencies.

Core Features & Use Cases

  • Detect current Next.js version from package.json and related dependencies (React, React DOM, etc.)
  • Fetch official upgrade guides and codemods from Next.js documentation
  • Determine upgrade path and perform incremental migrations for major version jumps
  • Run codemods to automate breaking changes and update dependencies accordingly
  • Review breaking changes, update configurations, and validate with builds and tests
  • Update TypeScript types if applicable and ensure compatibility across the stack
  • Provide documentation of changes and migration notes for the project

Quick Start

Identify the current Next.js version from package.json, then apply the official codemods and update dependencies to upgrade to the latest major release.

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 upgrade Next.js safely, you need to apply official migration codemods, update related React and TypeScript dependencies, and run build checks to validate breaking changes. This ensures compatibility across your stack during the migration.

Can I migrate Next.js projects across multiple major version jumps at once?

You should perform incremental migrations for major version jumps rather than upgrading Next.js directly. The process determines the upgrade path, executes codemods sequentially, and updates configurations to handle breaking changes safely.

How do codemods help with a Next.js migration?

Codemods automate breaking changes by fetching and applying official transformation scripts from Next.js documentation. They update your codebase to match new API changes and app directory structures required by the latest version.

Do I need to update React and TypeScript dependencies when upgrading Next.js?

Yes, upgrading Next.js requires updating related React, React DOM, and TypeScript dependencies to ensure compatibility. The migration process detects current versions from package.json and modifies dependencies accordingly.

What happens if my build fails after a Next.js version upgrade?

If your build fails after a Next.js version upgrade, you need to review the documented breaking changes and migration notes. The upgrade process runs build and dev checks to validate configurations and identify compatibility issues.

Does upgrading Next.js handle migrations to the new app directory?

Yes, upgrading Next.js handles migrations to the new app directory by applying official codemods and interpreting upgrade guides. It modifies your project structure to support the latest API changes and directory conventions.