{"skill":{"slug":"next-upgrade","displayName":"Next Upgrade","summary":"Upgrade Next.js to the latest version following official migration guides and codemods","description":"---\nname: next-upgrade\ndescription: Upgrade Next.js to the latest version following official migration guides and codemods\nargument-hint: \"[target-version]\"\n---\n\n# Upgrade Next.js\n\nUpgrade the current project to the latest Next.js version following official migration guides.\n\n## Instructions\n\n1. **Detect current version**: Read `package.json` to identify the current Next.js version and related dependencies (React, React DOM, etc.)\n\n2. **Fetch the latest upgrade guide**: Use WebFetch to get the official upgrade documentation:\n   - Codemods: https://nextjs.org/docs/app/guides/upgrading/codemods\n   - Version-specific guides (adjust version as needed):\n     - https://nextjs.org/docs/app/guides/upgrading/version-16 \n     - https://nextjs.org/docs/app/guides/upgrading/version-15\n     - https://nextjs.org/docs/app/guides/upgrading/version-14\n\n3. **Determine upgrade path**: Based on current version, identify which migration steps apply. For major version jumps, upgrade incrementally (e.g., 13 → 14 → 15).\n\n4. **Run codemods first**: Next.js provides codemods to automate breaking changes:\n   ```bash\n   npx @next/codemod@latest <transform> <path>\n   ```\n   Common transforms:\n   - `next-async-request-api` - Updates async Request APIs (v15)\n   - `next-request-geo-ip` - Migrates geo/ip properties (v15)\n   - `next-dynamic-access-named-export` - Transforms dynamic imports (v15)\n\n5. **Update dependencies**: Upgrade Next.js and peer dependencies together:\n   ```bash\n   npm install next@latest react@latest react-dom@latest\n   ```\n\n6. **Review breaking changes**: Check the upgrade guide for manual changes needed:\n   - API changes (e.g., async params in v15)\n   - Configuration changes in `next.config.js`\n   - Deprecated features being removed\n\n7. **Update TypeScript types** (if applicable):\n   ```bash\n   npm install @types/react@latest @types/react-dom@latest\n   ```\n\n8. **Test the upgrade**:\n   - Run `npm run build` to check for build errors\n   - Run `npm run dev` and test key functionality\n","tags":{"latest":"0.1.0"},"stats":{"comments":0,"downloads":997,"installsAllTime":37,"installsCurrent":2,"stars":0,"versions":1},"createdAt":1771519413908,"updatedAt":1778491585715},"latestVersion":{"version":"0.1.0","createdAt":1771519413908,"changelog":"- Initial release of next-upgrade skill.\n- Automates upgrading Next.js projects to the latest version following official migration guides.\n- Detects current Next.js and related dependency versions.\n- Fetches relevant migration documentation and codemods from nextjs.org.\n- Guides through codemod usage, dependency updates, and required manual changes.\n- Includes steps for updating TypeScript types and verifying the upgrade.","license":null},"metadata":null,"owner":{"handle":"tuanvidev","userId":"s179baf9cy52rfsxrbtpv7hjfx83hmf9","displayName":"vi.dev","image":"https://avatars.githubusercontent.com/u/114379606?v=4"},"moderation":null}