nextjs-pages-to-app
Installation
SKILL.md
Migrate Next.js: Pages → App Router
The Pages → App migration looks daunting but Next.js supports both routers in the same project. Migrate incrementally, route by route. This skill is the order and the gotchas.
When to use
- Existing Pages-router app on Next.js 13+ (App router available since 13.4 stable).
- Want Server Components (RSC), nested layouts, streaming, parallel routes.
- Refactoring opportunity coincides with router migration.
When NOT to use
- Greenfield app — start with App router directly.
- App on Next < 13 — upgrade Next first.
- Heavy
getStaticPaths+ISR coverage where Pages router is already optimal — App router's equivalent is fine but the migration win is small.
The principle: coexist, don't cut over
Both routers can run in the same app. pages/ and app/ directories are read together. Migrate route-by-route. Never do a big-bang cutover for a non-trivial app.