Loading...
Loading...
Comprehensive guide for migrating Create React App (CRA) projects to Next.js. Use when migrating a CRA app, converting React Router to file-based routing, or adopting Next.js patterns like Server Components, App Router, or image optimization.
npx skill4agent add vercel-labs/migration-skills cra-to-next-migrationnpm info next version^16.0.0| Priority | Category | Impact | Prefix | Rules |
|---|---|---|---|---|
| 1 | Project Setup | CRITICAL | | 6 |
| 2 | Dependencies | CRITICAL | | 1 |
| 3 | Routing | CRITICAL | | 17 |
| 4 | Data Fetching | CRITICAL | | 11 |
| 5 | Components | HIGH | | 9 |
| 6 | Environment Variables | HIGH | | 6 |
| 7 | Styling | HIGH | | 12 |
| 8 | Public Assets | MEDIUM | | 5 |
| 9 | Images | MEDIUM | | 8 |
| 10 | Fonts | MEDIUM | | 6 |
| 11 | SEO & Metadata | MEDIUM | | 9 |
| 12 | API Routes | MEDIUM | | 9 |
| 13 | State Management | MEDIUM | | 8 |
| 14 | Integrations | MEDIUM | | 1 |
| 15 | Testing | LOW | | 9 |
| 16 | Build & Deploy | LOW | | 7 |
| 17 | Common Gotchas | HIGH | | 24 |
setup-initial-structuresetup-package-jsonsetup-next-configsetup-typescriptsetup-eslintsetup-gitignoredeps-react19-compatibilityrouting-basic-pagesrouting-dynamic-routesrouting-catch-all-routesrouting-optional-catch-allrouting-route-groupsrouting-parallel-routesrouting-intercepting-routesrouting-link-componentrouting-programmatic-navigationrouting-use-paramsrouting-use-search-paramsrouting-nested-layoutsrouting-loading-statesrouting-error-boundariesrouting-not-foundrouting-hash-basedrouting-protected-routesdata-useeffect-to-rscdata-useeffect-to-ssrdata-useeffect-to-ssgdata-client-fetchdata-server-actionsdata-revalidationdata-streamingdata-parallel-fetchingdata-sequential-fetchingdata-cachingdata-client-library-initcomponents-use-clientcomponents-server-defaultcomponents-boundary-placementcomponents-compositioncomponents-interleavingcomponents-props-serializationcomponents-children-patterncomponents-context-providerscomponents-third-partyenv-prefix-changeenv-server-onlyenv-runtime-configenv-local-filesenv-build-timeenv-validationstyling-global-cssstyling-css-modulesstyling-sassstyling-tailwindstyling-css-in-jsstyling-styled-componentsstyling-emotionstyling-component-stylesstyling-postcssstyling-scss-global-syntaxstyling-css-import-orderstyling-dark-mode-hydrationassets-public-folderassets-static-importsassets-absolute-urlsassets-faviconassets-manifestimages-next-imageimages-required-dimensionsimages-fill-propimages-priorityimages-placeholderimages-remote-patternsimages-loaderimages-optimizationfonts-next-fontfonts-google-fontsfonts-local-fontsfonts-variable-fontsfonts-font-displayfonts-preloadseo-metadata-apiseo-dynamic-metadataseo-opengraphseo-twitter-cardsseo-json-ldseo-canonicalseo-robotsseo-sitemapseo-head-componentapi-route-handlersapi-http-methodsapi-request-bodyapi-query-paramsapi-headers-cookiesapi-response-typesapi-middlewareapi-corsapi-rate-limitingstate-context-clientstate-zustandstate-reduxstate-jotaistate-recoilstate-url-statestate-server-statestate-persistenceintegrations-sentrytesting-jest-configtesting-react-testing-librarytesting-server-componentstesting-client-componentstesting-async-componentstesting-mockingtesting-e2e-cypresstesting-e2e-playwrighttesting-api-routesbuild-scriptsbuild-outputbuild-standalonebuild-static-exportbuild-bundle-analysisbuild-vercelbuild-dockergotchas-window-undefinedgotchas-hydration-mismatchgotchas-use-effect-timinggotchas-router-readygotchas-dynamic-importsgotchas-api-routes-edgegotchas-middlewaregotchas-static-generationgotchas-redirectgotchas-headersgotchas-cookiesgotchas-turbopackgotchas-empty-modulesgotchas-nullish-coalescinggotchas-react19-class-componentsgotchas-react19-ref-propgotchas-websocket-optional-depsgotchas-auth-race-conditionsgotchas-auth-state-gatinggotchas-configuration-idempotencygotchas-hydration-nested-interactivegotchas-router-push-timinggotchas-infinite-rerendergotchas-provider-hierarchy# Check for WebSocket libraries (needs webpack fallback config)
grep -E "(socket\.io|\"ws\")" package.json
# Check for SCSS :export syntax (may need --webpack flag)
grep -r ":export" --include="*.scss" src/
# Check for SVG ReactComponent imports (needs SVGR config)
grep -r "ReactComponent" --include="*.ts" --include="*.tsx" src/
# List all REACT_APP_ environment variables
grep -roh "REACT_APP_[A-Z_]*" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" src/ | sort -u
# Check for Redux extraReducers using object notation (must convert to builder pattern for RTK v2)
grep -r "extraReducers:" --include="*.js" --include="*.jsx" --include="*.ts" --include="*.tsx" src/
# Check for /app/ paths that need updating if using (app) route group
grep -rE "(href|to|push|replace|redirect).*['\"]\/app\/" --include="*.js" --include="*.jsx" --include="*.ts" --include="*.tsx" src/| Scan Result | Rules to Read |
|---|---|
| socket.io or ws in package.json | |
| |
| |
| |
| |
| |
rules/setup-initial-structure.md
rules/routing-basic-pages.md
rules/data-useeffect-to-rsc.mdnpm run devnpm run buildnpm start#room=abc,key=xyz