cra-to-next-migration
Audited by Runlayer on Feb 21, 2026
Malicious tool definition detected
Tool: SKILL.md [1/3] Description: --- name: cra-to-next-migration description: Comprehensive guide for migrating Create React App (CRA) projects to Next.js.
Tool: SKILL.md [2/3] Description: Provide width and height - `images-fill-prop` - Use fill for responsive images - `images-priority` - Use priority for LCP images - `images-placeholder` - Configure blur placeholders - `images-remote-patterns` - Configure remote image domains - `images-loader` - Configure custom image loaders - `images-optimization` - Understand automatic optimization ### 10.
Tool: SKILL.md [3/3]
Malicious tool definition detected
Tool: rules/api-cors.md Description: --- title: Configure CORS Properly impact: MEDIUM impactDescription: Cross-origin requests tags: api, cors, security --- ## Configure CORS Properly Configure CORS (Cross-Origin Resource Sharing) for API routes that need to be accessed from different domains.
Malicious tool definition detected
Tool: rules/api-headers-cookies.md Description: --- title: Access Headers and Cookies impact: MEDIUM impactDescription: Read request headers and cookies tags: api, headers, cookies --- ## Access Headers and Cookies Access request headers and cookies in Next.js Route Handlers.
Malicious tool definition detected
Tool: rules/api-http-methods.md Description: --- title: Export Named Functions for HTTP Methods impact: HIGH impactDescription: HTTP method handling pattern tags: api, http-methods, route-handlers --- ## Export Named Functions for HTTP Methods Export functions named after HTTP methods to handle different request types.
Malicious tool definition detected
Tool: rules/api-middleware.md Description: --- title: Implement Middleware Patterns impact: MEDIUM impactDescription: Request processing pipeline tags: api, middleware, authentication --- ## Implement Middleware Patterns Implement middleware patterns for authentication, logging, and other cross-cutting concerns.
Malicious tool definition detected
Tool: rules/api-query-params.md Description: --- title: Access Query Parameters impact: MEDIUM impactDescription: Handle URL query strings tags: api, query-params, url --- ## Access Query Parameters Access URL query parameters using the URL API in Next.js Route Handlers.
Malicious tool definition detected
Tool: rules/api-rate-limiting.md Description: --- title: Implement Rate Limiting impact: LOW impactDescription: Protect against abuse tags: api, rate-limiting, security --- ## Implement Rate Limiting Implement rate limiting to protect your API from abuse and ensure fair usage.
Malicious tool definition detected
Tool: rules/api-request-body.md Description: --- title: Parse Request Body Properly impact: MEDIUM impactDescription: Handle POST/PUT data tags: api, request-body, parsing --- ## Parse Request Body Properly Next.js Route Handlers use the Web Request API for parsing request bodies.
Malicious tool definition detected
Tool: rules/api-response-types.md Description: --- title: Return Proper Response Types impact: MEDIUM impactDescription: Different response formats tags: api, response, content-type --- ## Return Proper Response Types Return different response types from Route Handlers based on your needs.
Malicious tool definition detected
Tool: rules/api-route-handlers.md Description: --- title: Create Route Handlers in app/api impact: HIGH impactDescription: Backend API endpoints tags: api, route-handlers, backend --- ## Create Route Handlers in app/api CRA typically uses a separate backend or proxied API.
Malicious tool definition detected
Tool: rules/assets-absolute-urls.md Description: --- title: Reference Assets Without Public Prefix impact: LOW impactDescription: Simpler asset URLs tags: assets, urls, paths --- ## Reference Assets Without Public Prefix In Next.js, reference files in the `public` folder directly without any prefix or environment variable.
Malicious tool definition detected
Tool: rules/assets-favicon.md Description: --- title: Place Favicon in App Directory impact: LOW impactDescription: New favicon convention tags: assets, favicon, metadata --- ## Place Favicon in App Directory Next.js App Router supports placing favicon files directly in the `app` directory for automatic handling.
Malicious tool definition detected
Tool: rules/assets-manifest.md Description: --- title: Configure Web App Manifest impact: LOW impactDescription: PWA configuration tags: assets, manifest, pwa --- ## Configure Web App Manifest Next.js App Router can generate the web app manifest dynamically or use a static file.
Malicious tool definition detected
Tool: rules/assets-public-folder.md Description: --- title: Public Folder Works the Same Way impact: LOW impactDescription: No changes needed tags: assets, public, static-files --- ## Public Folder Works the Same Way The `public/` folder works identically in Next.js and CRA.
Malicious tool definition detected
Tool: rules/assets-static-imports.md Description: --- title: Use Static Imports for Assets impact: MEDIUM impactDescription: Better asset handling tags: assets, imports, static --- ## Use Static Imports for Assets Import images and other assets directly for automatic optimization and type safety.
Malicious tool definition detected
Tool: rules/build-bundle-analysis.md Description: --- title: Analyze Bundle Size impact: MEDIUM impactDescription: Identify large dependencies tags: build, bundle, analysis, performance --- ## Analyze Bundle Size Analyze your bundle to identify large dependencies and optimization opportunities.
Malicious tool definition detected
Tool: rules/build-docker.md Description: --- title: Configure Docker Deployment impact: LOW impactDescription: Container deployment tags: build, deployment, docker --- ## Configure Docker Deployment Deploy Next.js in Docker containers for Kubernetes, AWS ECS, or other container platforms.
Malicious tool definition detected
Tool: rules/build-output.md Description: --- title: Understand Build Output impact: LOW impactDescription: Different build structure tags: build, output, deployment --- ## Understand Build Output CRA and Next.js produce different build outputs with different deployment requirements.
Malicious tool definition detected
Tool: rules/build-scripts.md Description: --- title: Update Build Scripts impact: MEDIUM impactDescription: Different build commands tags: build, scripts, npm --- ## Update Build Scripts Replace CRA's react-scripts with Next.js build commands.
Malicious tool definition detected
Tool: rules/build-standalone.md Description: --- title: Configure Standalone Output impact: MEDIUM impactDescription: Optimized for containers tags: build, standalone, docker --- ## Configure Standalone Output Use standalone output for smaller, self-contained deployments (Docker, custom servers).
Malicious tool definition detected
Tool: rules/build-static-export.md Description: --- title: Configure Static Export impact: MEDIUM impactDescription: Pure static site generation tags: build, static-export, ssg --- ## Configure Static Export Export your Next.js app as a static site, similar to CRA's build output.
Malicious tool definition detected
Tool: rules/build-vercel.md Description: --- title: Deploy to Vercel impact: LOW impactDescription: Recommended deployment platform tags: build, deployment, vercel --- ## Deploy to Vercel Vercel is the recommended platform for deploying Next.js applications.
Malicious tool definition detected
Tool: rules/components-boundary-placement.md Description: --- title: Place Client Boundaries Strategically impact: HIGH impactDescription: Minimize client bundle size tags: components, boundaries, optimization --- ## Place Client Boundaries Strategically Push `'use client'` boundaries as low as possible in the component tree to minimize client JavaScript.
Malicious tool definition detected
Tool: rules/components-children-pattern.md Description: --- title: Pass Server Components as Children impact: MEDIUM impactDescription: Preserve Server Component benefits tags: components, children, patterns --- ## Pass Server Components as Children Use the children prop to pass Server Components into Client Components, preserving their server-rendered benefits.
Malicious tool definition detected
Tool: rules/components-composition.md Description: --- title: Use Composition to Minimize Client JS impact: HIGH impactDescription: Keep static content as Server Components tags: components, composition, patterns --- ## Use Composition to Minimize Client JS Use component composition to keep Server Components for static content while Client Components handle interactivity.
Malicious tool definition detected
Tool: rules/components-context-providers.md Description: --- title: Handle Context Providers Properly impact: HIGH impactDescription: Context requires special setup tags: components, context, providers --- ## Handle Context Providers Properly React Context uses `useContext` which requires `'use client'`.
Malicious tool definition detected
Tool: rules/components-interleaving.md Description: --- title: Interleave Server and Client Components impact: MEDIUM impactDescription: Optimal component architecture tags: components, interleaving, architecture --- ## Interleave Server and Client Components Server and Client Components can be mixed throughout your component tree.
Malicious tool definition detected
Tool: rules/components-props-serialization.md Description: --- title: Ensure Props are Serializable impact: HIGH impactDescription: Server-to-client data boundary tags: components, serialization, props --- ## Ensure Props are Serializable Props passed from Server Components to Client Components must be serializable (convertible to JSON).
Malicious tool definition detected
Tool: rules/components-server-default.md Description: --- title: Server Components are Default impact: HIGH impactDescription: Fundamental paradigm shift tags: components, server-components, rsc --- ## Server Components are Default In Next.js App Router, all components are Server Components by default.
Malicious tool definition detected
Tool: rules/components-third-party.md Description: --- title: Wrap Third-Party Client Components impact: MEDIUM impactDescription: Handle external library components tags: components, third-party, libraries --- ## Wrap Third-Party Client Components Many third-party libraries export Client Components that need `'use client'`.
Malicious tool definition detected
Tool: rules/components-use-client.md Description: --- title: Add 'use client' Directive for Client Components impact: CRITICAL impactDescription: Required for interactive components tags: components, use-client, client-components --- ## Add 'use client' Directive for Client Components In Next.js App Router, components are Server Components by default.
Malicious tool definition detected
Tool: rules/data-caching.md Description: --- title: Configure Fetch Caching Behavior impact: HIGH impactDescription: Control data freshness vs performance tags: data-fetching, caching, fetch --- ## Configure Fetch Caching Behavior Next.js extends the native fetch API with caching options.
Malicious tool definition detected
Tool: rules/data-client-fetch.md Description: --- title: Keep Client Fetches with Proper Patterns impact: MEDIUM impactDescription: Some fetches must stay client-side tags: data-fetching, client-side, swr, react-query --- ## Keep Client Fetches with Proper Patterns Some data fetching must remain client-side (user interactions, real-time updates).
Malicious tool definition detected
Tool: rules/data-client-library-init.md Description: --- title: Initialize Client-Only Libraries in useEffect impact: MEDIUM impactDescription: Module-level initialization of client libraries crashes on server tags: data, initialization, ssr, client, i18n, analytics --- ## Initialize Client-Only Libraries in useEffect Module-level initialization of client-only libraries runs on the server where browser APIs may not be available.
Malicious tool definition detected
Tool: rules/data-parallel-fetching.md Description: --- title: Fetch Data in Parallel on Server impact: HIGH impactDescription: Avoid server-side waterfalls tags: data-fetching, parallel, performance --- ## Fetch Data in Parallel on Server When fetching multiple independent pieces of data, fetch them in parallel to avoid waterfalls.
Malicious tool definition detected
Tool: rules/data-revalidation.md Description: --- title: Configure Data Revalidation Strategies impact: HIGH impactDescription: Control cache freshness tags: data-fetching, caching, revalidation, isr --- ## Configure Data Revalidation Strategies Next.js provides multiple revalidation strategies to control when cached data is refreshed.
Malicious tool definition detected
Tool: rules/data-sequential-fetching.md Description: --- title: Handle Sequential Data Dependencies impact: MEDIUM impactDescription: When data depends on previous fetches tags: data-fetching, sequential, dependencies --- ## Handle Sequential Data Dependencies When one fetch depends on another's result, handle the sequence properly while still optimizing where possible.
Malicious tool definition detected
Tool: rules/data-server-actions.md Description: --- title: Use Server Actions for Mutations impact: HIGH impactDescription: New pattern for form submissions tags: data-fetching, server-actions, mutations, forms --- ## Use Server Actions for Mutations CRA handles form submissions with client-side fetch.
Malicious tool definition detected
Tool: rules/data-streaming.md Description: --- title: Use Suspense for Streaming Data impact: MEDIUM impactDescription: Progressive page loading tags: data-fetching, streaming, suspense --- ## Use Suspense for Streaming Data Next.js supports streaming HTML with Suspense, allowing parts of the page to load progressively.
Malicious tool definition detected
Tool: rules/data-useeffect-to-rsc.md Description: --- title: Convert useEffect Fetches to Server Components impact: CRITICAL impactDescription: Core data fetching paradigm shift tags: data-fetching, server-components, useEffect, rsc --- ## Convert useEffect Fetches to Server Components CRA fetches data in useEffect on the client.
Malicious tool definition detected
Tool: rules/data-useeffect-to-ssg.md Description: --- title: Convert useEffect to getStaticProps (Pages Router) impact: HIGH impactDescription: Static generation for Pages Router tags: data-fetching, ssg, getStaticProps, pages-router --- ## Convert useEffect to getStaticProps (Pages Router) For static content that doesn't change often, use `getStaticProps` to fetch data at build time.
Malicious tool definition detected
Tool: rules/data-useeffect-to-ssr.md Description: --- title: Convert useEffect to getServerSideProps (Pages Router) impact: HIGH impactDescription: Server-side rendering for Pages Router tags: data-fetching, ssr, getServerSideProps, pages-router --- ## Convert useEffect to getServerSideProps (Pages Router) For Pages Router migrations, use `getServerSideProps` for server-side data fetching on every request.
Malicious tool definition detected
Tool: rules/deps-react19-compatibility.md Description: --- title: Upgrade Dependencies for React 19 Compatibility impact: CRITICAL impactDescription: Many packages require major version bumps tags: dependencies, react19, upgrade, compatibility --- ## Upgrade Dependencies for React 19 Compatibility Next.js 14+ with React 19 requires major version upgrades for several common packages.
Malicious tool definition detected
Tool: rules/env-build-time.md Description: --- title: Understand Build-Time vs Runtime Env Vars impact: HIGH impactDescription: Critical deployment concept tags: environment, build-time, runtime, deployment --- ## Understand Build-Time vs Runtime Env Vars Environment variables in Next.js are inlined at build time, not read at runtime by default.
Malicious tool definition detected
Tool: rules/env-local-files.md Description: --- title: Understand .env File Loading Order impact: MEDIUM impactDescription: Different precedence than CRA tags: environment, env-files, configuration --- ## Understand .env File Loading Order Next.js loads environment files in a specific order, which differs slightly from CRA.
Malicious tool definition detected
Tool: rules/env-prefix-change.md Description: --- title: Change REACT_APP_ to NEXT_PUBLIC_ impact: CRITICAL impactDescription: Required for client-side env vars tags: environment, env-vars, configuration --- ## Change REACT_APP_ to NEXT_PUBLIC_ CRA uses `REACT_APP_` prefix for browser-exposed variables.
Malicious tool definition detected
Tool: rules/env-runtime-config.md Description: --- title: Use Runtime Configuration When Needed impact: MEDIUM impactDescription: Dynamic environment values tags: environment, runtime-config, configuration --- ## Use Runtime Configuration When Needed For values that need to change without rebuilding, use runtime configuration instead of build-time env vars.
Malicious tool definition detected
Tool: rules/env-server-only.md Description: --- title: Use Non-Prefixed Vars for Server-Only impact: HIGH impactDescription: Keep secrets secure tags: environment, env-vars, security, server --- ## Use Non-Prefixed Vars for Server-Only Variables without `NEXT_PUBLIC_` prefix are only available on the server, keeping secrets secure.
Malicious tool definition detected
Tool: rules/env-validation.md Description: --- title: Validate Required Environment Variables impact: MEDIUM impactDescription: Fail fast on missing config tags: environment, validation, typescript --- ## Validate Required Environment Variables Validate environment variables at build/startup time to catch configuration errors early.
Malicious tool definition detected
Tool: rules/fonts-font-display.md Description: --- title: Configure font-display Strategy impact: MEDIUM impactDescription: Control font loading behavior tags: fonts, font-display, loading --- ## Configure font-display Strategy Configure how fonts are displayed while loading with the `display` option.
Malicious tool definition detected
Tool: rules/fonts-google-fonts.md Description: --- title: Load Google Fonts Properly impact: HIGH impactDescription: Optimized Google Font loading tags: fonts, google-fonts, next-font --- ## Load Google Fonts Properly Use `next/font/google` to load Google Fonts with automatic optimization.
Malicious tool definition detected
Tool: rules/fonts-local-fonts.md Description: --- title: Load Local Font Files impact: MEDIUM impactDescription: Self-hosted custom fonts tags: fonts, local-fonts, custom --- ## Load Local Font Files Use `next/font/local` to load custom font files with the same optimization benefits.
Malicious tool definition detected
Tool: rules/fonts-next-font.md Description: --- title: Use next/font for Optimization impact: HIGH impactDescription: Zero layout shift fonts tags: fonts, optimization, next-font --- ## Use next/font for Optimization Replace CSS font imports with `next/font` for automatic optimization and zero layout shift.
Malicious tool definition detected
Tool: rules/fonts-preload.md Description: --- title: Understand Automatic Font Preloading impact: LOW impactDescription: Fonts preloaded automatically tags: fonts, preload, performance --- ## Understand Automatic Font Preloading Next.js automatically preloads fonts configured with `next/font`.
Malicious tool definition detected
Tool: rules/fonts-variable-fonts.md Description: --- title: Configure Variable Fonts impact: MEDIUM impactDescription: Single file, all weights tags: fonts, variable-fonts, optimization --- ## Configure Variable Fonts Variable fonts provide all weights in a single file, improving performance.
Malicious tool definition detected
Tool: rules/gotchas-api-routes-edge.md Description: --- title: Edge vs Node.js Runtime impact: MEDIUM impactDescription: Different API capabilities tags: gotchas, edge, runtime, api --- ## Edge vs Node.js Runtime Next.js API routes can run on Edge or Node.js runtime.
Malicious tool definition detected
Tool: rules/gotchas-auth-race-conditions.md Description: --- title: Guard Against Auth/API Race Conditions impact: CRITICAL impactDescription: API calls failing before authentication/configuration completes is the most common migration breaking issue tags: gotchas, auth, race-condition, api --- ## Guard Against Auth/API Race Conditions The most critical migration issue: API calls executing before authentication or configuration is ready.
Malicious tool definition detected
Tool: rules/gotchas-auth-state-gating.md Description: --- title: Wait for Auth State Before Checking Roles impact: CRITICAL impactDescription: Premature redirects during auth loading cause incorrect access denials tags: gotchas, auth, roles, redirect, loading --- ## Wait for Auth State Before Checking Roles Always wait for authentication to complete before checking roles or permissions.
Malicious tool definition detected
Tool: rules/gotchas-configuration-idempotency.md Description: --- title: Ensure Configuration Idempotency with useRef impact: HIGH impactDescription: React StrictMode and fast refresh cause double initialization without guards tags: gotchas, configuration, useRef, StrictMode, initialization --- ## Ensure Configuration Idempotency with useRef Prevent duplicate initialization of services using refs.
Malicious tool definition detected
Tool: rules/gotchas-cookies.md Description: --- title: Handle Cookies in RSC impact: MEDIUM impactDescription: Reading vs setting cookies tags: gotchas, cookies, server-components --- ## Handle Cookies in RSC Cookies work differently in Server Components, Route Handlers, and Client Components.
Malicious tool definition detected
Tool: rules/gotchas-dynamic-imports.md Description: --- title: Use next/dynamic Properly impact: MEDIUM impactDescription: Code splitting patterns tags: gotchas, dynamic-import, code-splitting --- ## Use next/dynamic Properly Use `next/dynamic` for code splitting and client-only components instead of React.lazy.
Malicious tool definition detected
Tool: rules/gotchas-empty-modules.md Description: --- title: Fix Empty Module Exports impact: LOW impactDescription: TypeScript isolatedModules requirement tags: gotchas, typescript, modules --- ## Fix Empty Module Exports TypeScript's `isolatedModules` option (enabled by default in Next.js) requires every file to have at least one import or export statement.
Malicious tool definition detected
Tool: rules/gotchas-headers.md Description: --- title: Set Response Headers impact: LOW impactDescription: Headers in different contexts tags: gotchas, headers, response --- ## Set Response Headers Setting response headers works differently in various Next.js contexts.
Malicious tool definition detected
Tool: rules/gotchas-hydration-mismatch.md Description: --- title: Fix Hydration Mismatches impact: HIGH impactDescription: Server/client HTML must match tags: gotchas, hydration, ssr --- ## Fix Hydration Mismatches Hydration errors occur when server HTML doesn't match client render.
Malicious tool definition detected
Tool: rules/gotchas-hydration-nested-interactive.md Description: --- title: Avoid Nested Interactive Elements impact: HIGH impactDescription: Button inside Link or anchor causes hydration errors tags: gotchas, hydration, accessibility, html --- ## Avoid Nested Interactive Elements Nesting interactive elements (button inside a link, link inside a button) causes hydration errors in Next.js.
Malicious tool definition detected
Tool: rules/gotchas-infinite-rerender.md Description: --- title: Prevent Infinite Re-render Loops impact: HIGH impactDescription: Object/array dependencies in useEffect cause infinite loops tags: gotchas, performance, useEffect, useMemo, dependencies --- ## Prevent Infinite Re-render Loops Object and array references change on every render.
Malicious tool definition detected
Tool: rules/gotchas-middleware.md Description: --- title: Middleware Runs on Edge impact: MEDIUM impactDescription: Middleware limitations tags: gotchas, middleware, edge --- ## Middleware Runs on Edge Next.js Middleware always runs on the Edge runtime, which has limitations.
Malicious tool definition detected
Tool: rules/gotchas-nullish-coalescing.md Description: --- title: Fix Nullish Coalescing Runtime Errors impact: HIGH impactDescription: Complex expressions cause runtime errors tags: gotchas, javascript, operators, runtime --- ## Fix Nullish Coalescing Runtime Errors Complex expressions using nullish coalescing (`??`) can cause `_variable is not defined` runtime errors in Next.js due to how the code is transpiled. **Error message:** ``` ReferenceError: _someVariable is not defined ``` **Problema
Malicious tool definition detected
Tool: rules/gotchas-provider-hierarchy.md Description: --- title: Configure Provider Hierarchy Correctly impact: HIGH impactDescription: Incorrect provider order causes context and styling failures tags: gotchas, providers, context, layout --- ## Configure Provider Hierarchy Correctly Provider order matters. Providers can only access context from providers above them in the tree. Incorrect ordering causes runtime errors, styling issues, or missing context. **Recommended provider order:** ```tsx
Malicious tool definition detected
Tool: rules/gotchas-react19-class-components.md Description: --- title: Fix React 19 Class Component this Binding impact: CRITICAL impactDescription: this is undefined in setState callbacks tags: gotchas, react19, class-components, this-binding --- ## Fix React 19 Class Component this Binding React 19 changes how `this` is bound in certain callback contexts, causing `this` to be `undefined` in Promise `.then()` handlers, `setState` callbacks, and nested callbacks within class components.
Malicious tool definition detected
Tool: rules/gotchas-react19-ref-prop.md Description: --- title: Handle React 19 Ref Prop Changes impact: HIGH impactDescription: ref is now a regular prop in React 19 tags: gotchas, react19, ref, forwardRef --- ## Handle React 19 Ref Prop Changes React 19 changes how refs work: `ref` is now a regular prop, and `forwardRef` is no longer required for most use cases.
Malicious tool definition detected
Tool: rules/gotchas-redirect.md Description: --- title: Handle Redirects Properly impact: MEDIUM impactDescription: Multiple redirect methods tags: gotchas, redirect, navigation --- ## Handle Redirects Properly Next.js has multiple ways to redirect.
Malicious tool definition detected
Tool: rules/gotchas-router-push-timing.md Description: --- title: Never Call router.push During Render impact: HIGH impactDescription: Calling router.push in render body causes React errors tags: gotchas, routing, useRouter, useEffect --- ## Never Call router.push During Render Calling `router.push()` during the render phase causes React errors.
Malicious tool definition detected
Tool: rules/gotchas-router-ready.md Description: --- title: Check router.isReady for Query Params impact: MEDIUM impactDescription: Pages Router specific gotcha tags: gotchas, router, query-params, pages-router --- ## Check router.isReady for Query Params In Pages Router, query params aren't available during SSR.
Malicious tool definition detected
Tool: rules/gotchas-static-generation.md Description: --- title: Static vs Dynamic Rendering impact: HIGH impactDescription: Understanding render modes tags: gotchas, static, dynamic, rendering --- ## Static vs Dynamic Rendering Understanding when Next.js renders statically vs dynamically is crucial for performance.
Malicious tool definition detected
Tool: rules/gotchas-turbopack.md Description: --- title: Handle Turbopack Compatibility Issues impact: HIGH impactDescription: Next.js 16+ uses Turbopack by default tags: gotchas, turbopack, scss, webpack --- ## Handle Turbopack Compatibility Issues Next.js 16+ uses Turbopack as the default bundler for development.
Malicious tool definition detected
Tool: rules/gotchas-use-effect-timing.md Description: --- title: Understand useEffect in Next.js impact: MEDIUM impactDescription: useEffect timing differs tags: gotchas, useEffect, lifecycle --- ## Understand useEffect in Next.js useEffect behavior in Next.js differs from CRA due to Server Components and SSR.
Malicious tool definition detected
Tool: rules/gotchas-websocket-optional-deps.md Description: --- title: Handle WebSocket Optional Dependencies impact: HIGH impactDescription: socket.io and ws libraries have native deps that fail bundling tags: gotchas, websocket, webpack, native-modules --- ## Handle WebSocket Optional Dependencies When migrating CRA apps that use `socket.io-client` or `ws` for WebSocket connections, you may encounter bundling errors due to optional native dependencies.
Malicious tool definition detected
Tool: rules/gotchas-window-undefined.md Description: --- title: Handle window/document in SSR impact: CRITICAL impactDescription: Most common migration error tags: gotchas, ssr, browser-apis --- ## Handle window/document in SSR The most common migration issue: `window` and `document` don't exist during server-side rendering.
Malicious tool definition detected
Tool: rules/images-fill-prop.md Description: --- title: Use Fill for Responsive Images impact: MEDIUM impactDescription: Flexible image sizing tags: images, responsive, fill --- ## Use Fill for Responsive Images Use the `fill` prop when you want images to fill their parent container responsively.
Malicious tool definition detected
Tool: rules/images-loader.md Description: --- title: Configure Custom Image Loaders impact: LOW impactDescription: For custom CDN integration tags: images, loader, cdn, cloudinary --- ## Configure Custom Image Loaders Use custom loaders when using image CDNs like Cloudinary, Imgix, or custom solutions.
Malicious tool definition detected
Tool: rules/images-next-image.md Description: --- title: Replace img with next/image impact: HIGH impactDescription: Automatic image optimization tags: images, optimization, next-image --- ## Replace img with next/image Replace HTML `<img>` tags with Next.js `<Image>` component for automatic optimization.
Malicious tool definition detected
Tool: rules/images-optimization.md Description: --- title: Understand Automatic Optimization impact: MEDIUM impactDescription: Know what Next.js does tags: images, optimization, webp, avif --- ## Understand Automatic Optimization Next.js automatically optimizes images on-demand.
Malicious tool definition detected
Tool: rules/images-placeholder.md Description: --- title: Configure Blur Placeholders impact: MEDIUM impactDescription: Better loading experience tags: images, placeholder, blur, ux --- ## Configure Blur Placeholders Use blur placeholders to improve perceived performance while images load.
Malicious tool definition detected
Tool: rules/images-priority.md Description: --- title: Use Priority for LCP Images impact: HIGH impactDescription: Improves largest contentful paint tags: images, performance, lcp, priority --- ## Use Priority for LCP Images Add `priority` to images that are the Largest Contentful Paint (LCP) element for better performance.
Malicious tool definition detected
Tool: rules/images-remote-patterns.md Description: --- title: Configure Remote Image Domains impact: CRITICAL impactDescription: Required for external images tags: images, configuration, remote, domains --- ## Configure Remote Image Domains External images must be explicitly allowed in `next.config.js` for security.
Malicious tool definition detected
Tool: rules/images-required-dimensions.md Description: --- title: Provide Width and Height impact: HIGH impactDescription: Prevents layout shift tags: images, dimensions, cls --- ## Provide Width and Height Next.js Image requires width and height to prevent Cumulative Layout Shift (CLS).
Malicious tool definition detected
Tool: rules/integrations-sentry.md Description: --- title: Migrate Sentry Error Monitoring impact: MEDIUM impactDescription: Error tracking integration tags: integrations, sentry, error-monitoring --- ## Migrate Sentry Error Monitoring Replace `@sentry/browser` or `@sentry/react` with `@sentry/nextjs` for proper Next.js integration.
Malicious tool definition detected
Tool: rules/routing-basic-pages.md Description: --- title: Convert Components to File-Based Routes impact: CRITICAL impactDescription: Core routing paradigm change tags: routing, pages, app-router, file-based --- ## Convert Components to File-Based Routes CRA uses React Router for routing.
Malicious tool definition detected
Tool: rules/routing-catch-all-routes.md Description: --- title: Use [...slug] for Catch-All Routes impact: HIGH impactDescription: Handles variable path segments tags: routing, catch-all, dynamic-routes --- ## Use [...slug] for Catch-All Routes React Router uses `*` for catch-all routes.
Malicious tool definition detected
Tool: rules/routing-dynamic-routes.md Description: --- title: Use [param] Syntax for Dynamic Segments impact: CRITICAL impactDescription: Required for dynamic URLs tags: routing, dynamic-routes, params --- ## Use [param] Syntax for Dynamic Segments React Router uses `:param` syntax.
Malicious tool definition detected
Tool: rules/routing-error-boundaries.md Description: --- title: Add error.tsx for Error Handling impact: HIGH impactDescription: Built-in error boundary support tags: routing, errors, error-boundary --- ## Add error.tsx for Error Handling CRA requires manual Error Boundaries.
Malicious tool definition detected
Tool: rules/routing-hash-based.md Description: --- title: Handle Hash-Based Routing impact: MEDIUM impactDescription: Client-side hash routing patterns tags: routing, hash, client-only, spa --- ## Handle Hash-Based Routing Some CRA applications use hash-based routing (`#/path` or `#key=value`) for client-side state that shouldn't trigger server requests.
Malicious tool definition detected
Tool: rules/routing-intercepting-routes.md Description: --- title: Use (..) for Intercepting Routes impact: LOW impactDescription: Advanced modal pattern tags: routing, intercepting-routes, modals --- ## Use (..) for Intercepting Routes Intercepting routes let you show a route in a modal while keeping the background context, with the full page accessible via direct URL.
Malicious tool definition detected
Tool: rules/routing-link-component.md Description: --- title: Replace React Router Link with next/link impact: CRITICAL impactDescription: Required for client-side navigation tags: routing, link, navigation --- ## Replace React Router Link with next/link React Router's `Link` must be replaced with Next.js's `Link` component from `next/link`.
Malicious tool definition detected
Tool: rules/routing-loading-states.md Description: --- title: Add loading.tsx for Suspense impact: HIGH impactDescription: Built-in loading UI support tags: routing, loading, suspense --- ## Add loading.tsx for Suspense CRA requires manual loading states.
Malicious tool definition detected
Tool: rules/routing-nested-layouts.md Description: --- title: Convert Nested Routes to Layouts impact: HIGH impactDescription: Different nesting paradigm tags: routing, layouts, nested-routes --- ## Convert Nested Routes to Layouts React Router uses `<Outlet />` for nested routes.
Malicious tool definition detected
Tool: rules/routing-not-found.md Description: --- title: Add not-found.tsx for 404 Pages impact: MEDIUM impactDescription: Custom 404 page handling tags: routing, not-found, 404 --- ## Add not-found.tsx for 404 Pages CRA handles 404s with a catch-all route.
Malicious tool definition detected
Tool: rules/routing-optional-catch-all.md Description: --- title: Use [[...slug]] for Optional Catch-All impact: MEDIUM impactDescription: Matches routes with or without segments tags: routing, catch-all, optional, dynamic-routes --- ## Use [[...slug]] for Optional Catch-All When you need to match both the base route AND all sub-routes, use optional catch-all `[[...slug]]`.
Malicious tool definition detected
Tool: rules/routing-parallel-routes.md Description: --- title: Use @slot for Parallel Routes impact: LOW impactDescription: Advanced layout pattern tags: routing, parallel-routes, slots, layouts --- ## Use @slot for Parallel Routes Parallel routes allow rendering multiple pages in the same layout simultaneously, useful for dashboards, modals, or split views.
Malicious tool definition detected
Tool: rules/routing-programmatic-navigation.md Description: --- title: Replace useNavigate with useRouter impact: CRITICAL impactDescription: Required for programmatic navigation tags: routing, navigation, useRouter, useNavigate --- ## Replace useNavigate with useRouter React Router's `useNavigate` hook is replaced by Next.js's `useRouter` from `next/navigation`.
Malicious tool definition detected
Tool: rules/routing-protected-routes.md Description: --- title: Implement Protected Routes impact: MEDIUM impactDescription: Route protection patterns differ between CRA and Next.js tags: routing, auth, protected, middleware, layout --- ## Implement Protected Routes Next.js offers multiple patterns for route protection.
Malicious tool definition detected
Tool: rules/routing-route-groups.md Description: --- title: Use (group) Folders for Organization impact: MEDIUM impactDescription: Organize routes without affecting URLs tags: routing, route-groups, organization --- ## Use (group) Folders for Organization CRA organizes routes in code.
Malicious tool definition detected
Tool: rules/routing-use-params.md Description: --- title: Replace useParams with Next.js params impact: HIGH impactDescription: Different param access pattern tags: routing, params, useParams --- ## Replace useParams with Next.js params React Router's `useParams` hook is replaced by the `params` prop passed to page components in Next.js.
Malicious tool definition detected
Tool: rules/routing-use-search-params.md Description: --- title: Replace useSearchParams Properly impact: HIGH impactDescription: Query string handling differs tags: routing, search-params, query-string --- ## Replace useSearchParams Properly React Router's `useSearchParams` differs from Next.js's implementation.
Malicious tool definition detected
Tool: rules/seo-canonical.md Description: --- title: Set Canonical URLs impact: MEDIUM impactDescription: Prevent duplicate content tags: seo, canonical, urls --- ## Set Canonical URLs Set canonical URLs to prevent duplicate content issues with search engines.
Malicious tool definition detected
Tool: rules/seo-dynamic-metadata.md Description: --- title: Generate Dynamic Metadata impact: HIGH impactDescription: SEO for dynamic pages tags: seo, metadata, dynamic --- ## Generate Dynamic Metadata Use `generateMetadata` function for pages with dynamic content (blog posts, products, etc.).
Malicious tool definition detected
Tool: rules/seo-head-component.md Description: --- title: Migrate from next/head to Metadata API impact: HIGH impactDescription: Pages Router to App Router migration tags: seo, next-head, metadata, migration --- ## Migrate from next/head to Metadata API When migrating from Pages Router to App Router, replace `next/head` with the Metadata API.
Malicious tool definition detected
Tool: rules/seo-json-ld.md Description: --- title: Add Structured Data (JSON-LD) impact: MEDIUM impactDescription: Rich search results tags: seo, json-ld, structured-data --- ## Add Structured Data (JSON-LD) Add JSON-LD structured data for rich search results in Google.
Malicious tool definition detected
Tool: rules/seo-metadata-api.md Description: --- title: Use Metadata API Instead of react-helmet impact: HIGH impactDescription: Native SEO support tags: seo, metadata, react-helmet --- ## Use Metadata API Instead of react-helmet Replace `react-helmet` or `react-helmet-async` with Next.js's built-in Metadata API.
Malicious tool definition detected
Tool: rules/seo-opengraph.md Description: --- title: Configure Open Graph Metadata impact: MEDIUM impactDescription: Social media previews tags: seo, opengraph, social --- ## Configure Open Graph Metadata Configure Open Graph metadata for rich social media previews.
Malicious tool definition detected
Tool: rules/seo-robots.md Description: --- title: Configure Robots Meta Tags impact: MEDIUM impactDescription: Control search indexing tags: seo, robots, indexing --- ## Configure Robots Meta Tags Control how search engines index your pages with robots meta tags.
Malicious tool definition detected
Tool: rules/seo-sitemap.md Description: --- title: Generate sitemap.xml impact: MEDIUM impactDescription: Help search engines discover pages tags: seo, sitemap, indexing --- ## Generate sitemap.xml Generate a sitemap dynamically to help search engines discover and index your pages.
Malicious tool definition detected
Tool: rules/seo-twitter-cards.md Description: --- title: Configure Twitter Card Metadata impact: MEDIUM impactDescription: Twitter/X previews tags: seo, twitter, social --- ## Configure Twitter Card Metadata Configure Twitter Card metadata for rich previews on Twitter/X.
Malicious tool definition detected
Tool: rules/setup-eslint.md Description: --- title: Update ESLint for Next.js impact: MEDIUM impactDescription: Enables Next.js-specific linting tags: setup, eslint, linting --- ## Update ESLint for Next.js CRA includes ESLint via react-scripts.
Malicious tool definition detected
Tool: rules/setup-gitignore.md Description: --- title: Update .gitignore for Next.js impact: LOW impactDescription: Prevents committing build artifacts tags: setup, gitignore, git --- ## Update .gitignore for Next.js CRA and Next.js have different build output directories that should be ignored.
Malicious tool definition detected
Tool: rules/setup-initial-structure.md Description: --- title: Convert CRA Folder Structure to Next.js App Router impact: CRITICAL impactDescription: Required first step tags: setup, structure, app-router, migration --- ## Convert CRA Folder Structure to Next.js App Router CRA uses a flat `src/` structure with manual routing.
Malicious tool definition detected
Tool: rules/setup-next-config.md Description: --- title: Create and Configure next.config.js impact: CRITICAL impactDescription: Configures Next.js behavior tags: setup, config, next-config --- ## Create and Configure next.config.js CRA uses `react-scripts` with limited configuration (via `craco` or ejecting).
Malicious tool definition detected
Tool: rules/setup-package-json.md Description: --- title: Update Dependencies and Scripts impact: CRITICAL impactDescription: Required for Next.js to run tags: setup, dependencies, scripts, package-json --- ## Update Dependencies and Scripts CRA includes react-scripts which bundles all tooling.
Malicious tool definition detected
Tool: rules/setup-typescript.md Description: --- title: Migrate TypeScript Configuration impact: HIGH impactDescription: Required for TypeScript projects tags: setup, typescript, tsconfig --- ## Migrate TypeScript Configuration CRA's TypeScript setup differs from Next.js.
Malicious tool definition detected
Tool: rules/state-context-client.md Description: --- title: Context Requires 'use client' impact: HIGH impactDescription: Context API needs client directive tags: state, context, use-client --- ## Context Requires 'use client' React Context uses hooks which require `'use client'`.
Malicious tool definition detected
Tool: rules/state-jotai.md Description: --- title: Configure Jotai Properly impact: MEDIUM impactDescription: Atomic state management tags: state, jotai, atoms --- ## Configure Jotai Properly Jotai has excellent Next.js support with minimal configuration needed.
Malicious tool definition detected
Tool: rules/state-persistence.md Description: --- title: Handle State Persistence impact: MEDIUM impactDescription: localStorage/sessionStorage patterns tags: state, persistence, storage --- ## Handle State Persistence Handle localStorage and sessionStorage properly to avoid hydration issues.
Malicious tool definition detected
Tool: rules/state-recoil.md Description: --- title: Configure Recoil Properly impact: MEDIUM impactDescription: Recoil requires RecoilRoot tags: state, recoil, atoms --- ## Configure Recoil Properly Recoil requires wrapping your app in `RecoilRoot` with a Client Component.
Malicious tool definition detected
Tool: rules/state-redux.md Description: --- title: Configure Redux with Next.js impact: MEDIUM impactDescription: Redux requires special setup tags: state, redux, configuration --- ## Configure Redux with Next.js Redux requires special configuration for Next.js to handle server-side rendering properly.
Malicious tool definition detected
Tool: rules/state-server-state.md Description: --- title: Minimize Client State with RSC impact: HIGH impactDescription: Rethink state architecture tags: state, rsc, server-components --- ## Minimize Client State with RSC Server Components eliminate the need for much client-side state.
Malicious tool definition detected
Tool: rules/state-url-state.md Description: --- title: Use URL for Shareable State impact: MEDIUM impactDescription: SEO and sharing benefits tags: state, url, search-params --- ## Use URL for Shareable State Use URL search params for state that should be shareable, bookmarkable, or persist across refreshes.
Malicious tool definition detected
Tool: rules/state-zustand.md Description: --- title: Zustand Works with Hydration Care impact: MEDIUM impactDescription: Popular state library migration tags: state, zustand, hydration --- ## Zustand Works with Hydration Care Zustand works in Next.js but needs care to avoid hydration mismatches.
Malicious tool definition detected
Tool: rules/styling-component-styles.md Description: --- title: Import Component Styles Properly impact: MEDIUM impactDescription: Avoid global CSS in components tags: styling, imports, css-modules --- ## Import Component Styles Properly In Next.js App Router, component-level CSS must use CSS Modules, not global CSS imports.
Malicious tool definition detected
Tool: rules/styling-css-import-order.md Description: --- title: Control CSS Import Order in Layouts impact: HIGH impactDescription: Import order determines style cascade and specificity tags: styling, css, import, layout, cascade --- ## Control CSS Import Order in Layouts CSS import order in your layout files determines the cascade.
Malicious tool definition detected
Tool: rules/styling-css-in-js.md Description: --- title: Handle CSS-in-JS Libraries impact: HIGH impactDescription: Requires SSR configuration tags: styling, css-in-js, ssr --- ## Handle CSS-in-JS Libraries CSS-in-JS libraries need special configuration for Server-Side Rendering in Next.js.
Malicious tool definition detected
Tool: rules/styling-css-modules.md Description: --- title: CSS Modules Work with Minor Changes impact: LOW impactDescription: Mostly compatible tags: styling, css-modules --- ## CSS Modules Work with Minor Changes CSS Modules work almost identically in Next.js.
Malicious tool definition detected
Tool: rules/styling-dark-mode-hydration.md Description: --- title: Handle Dark Mode Without Hydration Mismatch impact: HIGH impactDescription: Reading theme from localStorage during SSR causes hydration errors tags: styling, dark-mode, hydration, localStorage, theme --- ## Handle Dark Mode Without Hydration Mismatch Dark mode implementations that read from localStorage during render cause hydration mismatches.
Malicious tool definition detected
Tool: rules/styling-emotion.md Description: --- title: Configure Emotion for SSR impact: HIGH impactDescription: Prevents flash of unstyled content tags: styling, emotion, ssr --- ## Configure Emotion for SSR Emotion requires specific configuration for Next.js App Router to prevent flash of unstyled content.
Malicious tool definition detected
Tool: rules/styling-global-css.md Description: --- title: Move Global CSS to app/layout.tsx impact: CRITICAL impactDescription: CSS import location changes tags: styling, css, global-styles --- ## Move Global CSS to app/layout.tsx CRA imports global CSS in `index.tsx`.
Malicious tool definition detected
Tool: rules/styling-postcss.md Description: --- title: Configure PostCSS impact: LOW impactDescription: Same configuration as CRA tags: styling, postcss, configuration --- ## Configure PostCSS PostCSS configuration in Next.js works the same as in CRA with a `postcss.config.js` file.
Malicious tool definition detected
Tool: rules/styling-sass.md Description: --- title: Configure Sass Support impact: LOW impactDescription: Requires package installation tags: styling, sass, scss --- ## Configure Sass Support CRA includes Sass support after installing `sass`.
Malicious tool definition detected
Tool: rules/styling-scss-global-syntax.md Description: --- title: Use :global Only in CSS Modules impact: HIGH impactDescription: :global syntax in regular SCSS files causes build errors tags: styling, scss, css-modules, global --- ## Use :global Only in CSS Modules The `:global` syntax is a CSS Modules feature.
Malicious tool definition detected
Tool: rules/styling-styled-components.md Description: --- title: Configure styled-components for SSR impact: HIGH impactDescription: Prevents flash of unstyled content tags: styling, styled-components, ssr --- ## Configure styled-components for SSR styled-components requires specific configuration to work with Next.js Server-Side Rendering.
Malicious tool definition detected
Tool: rules/styling-tailwind.md Description: --- title: Configure Tailwind CSS impact: MEDIUM impactDescription: Content paths differ tags: styling, tailwind, configuration --- ## Configure Tailwind CSS Tailwind CSS configuration in Next.js requires updating content paths for the App Router structure.
Malicious tool definition detected
Tool: rules/testing-api-routes.md Description: --- title: Test API Route Handlers impact: MEDIUM impactDescription: Testing backend endpoints tags: testing, api-routes, handlers --- ## Test API Route Handlers Test Route Handlers by calling them directly or using integration tests.
Malicious tool definition detected
Tool: rules/testing-async-components.md Description: --- title: Test Async Components impact: MEDIUM impactDescription: Handle async data in tests tags: testing, async, suspense --- ## Test Async Components Test components that fetch data asynchronously using proper async patterns.
Malicious tool definition detected
Tool: rules/testing-client-components.md Description: --- title: Test Client Components impact: MEDIUM impactDescription: Standard RTL patterns with mocks tags: testing, client-components, rtl --- ## Test Client Components Client Components are tested similarly to CRA components, but may need Next.js mocks.
Malicious tool definition detected
Tool: rules/testing-e2e-cypress.md Description: --- title: Configure Cypress for Next.js impact: LOW impactDescription: E2E testing setup tags: testing, cypress, e2e --- ## Configure Cypress for Next.js Configure Cypress for end-to-end testing of your Next.js application.
Malicious tool definition detected
Tool: rules/testing-e2e-playwright.md Description: --- title: Configure Playwright for Next.js impact: LOW impactDescription: Modern E2E testing tags: testing, playwright, e2e --- ## Configure Playwright for Next.js Configure Playwright for fast, reliable end-to-end testing.
Malicious tool definition detected
Tool: rules/testing-jest-config.md Description: --- title: Update Jest Configuration impact: MEDIUM impactDescription: Test setup changes tags: testing, jest, configuration --- ## Update Jest Configuration CRA includes Jest configuration.
Malicious tool definition detected
Tool: rules/testing-mocking.md Description: --- title: Mock Next.js Modules impact: MEDIUM impactDescription: Common Next.js mocks tags: testing, mocking, jest --- ## Mock Next.js Modules Common patterns for mocking Next.js specific modules in tests.
Malicious tool definition detected
Tool: rules/testing-react-testing-library.md Description: --- title: RTL Works the Same impact: LOW impactDescription: Minimal changes needed tags: testing, rtl, react-testing-library --- ## RTL Works the Same React Testing Library works the same way in Next.js for Client Components.
Malicious tool definition detected
Tool: rules/testing-server-components.md Description: --- title: Test Server Components impact: HIGH impactDescription: New testing patterns for RSC tags: testing, server-components, rsc --- ## Test Server Components Server Components require different testing approaches since they're async and run on the server.