
nextjs16-skills
Key facts and links for Next.js 16. Use for planning, writing, and troubleshooting Next.js 16 changes.
Key facts and links for Next.js 16. Use for planning, writing, and troubleshooting Next.js 16 changes.
Links
- Docs: https://nextjs.org/docs
- Upgrade guide (v16): https://nextjs.org/docs/app/guides/upgrading/version-16
- Release notes/blog: https://nextjs.org/blog/next-16
Upgrade
# Automated upgrade
npx @next/codemod@canary upgrade latest
# Manual upgrade
npm install next@latest react@latest react-dom@latest
# New project
npx create-next-app@latest
Codemod covers (high-level): moves Turbopack config, migrates next lint → ESLint CLI, migrates middleware → proxy, removes some unstable_ prefixes, removes route-level experimental_ppr.
TypeScript: also upgrade @types/react and @types/react-dom.
What’s New (v16)
- Cache Components: opt-in caching via the
"use cache"directive; evolves/absorbs PPR. - Next.js DevTools MCP: Model Context Protocol integration for AI-assisted debugging.
proxy.ts: clearer network boundary;middleware.tsdeprecated for most use.- Better logs/metrics: more detailed
next devand build timing output.
Performance / DX
- Turbopack: stable; default bundler (opt out with
next dev --webpack,next build --webpack). - If you have a custom
webpackconfig,next buildmay fail (to prevent misconfiguration). Fix by migrating config, usingnext build --webpack, or using Turbopack and removing/ignoring the webpack config. - Turbopack config moved:
experimental.turbopack→ top-levelturbopackinnext.config.*. - Turbopack migration gotchas:
- Sass imports: remove the Webpack-only
~prefix (e.g.@import 'bootstrap/...';). - Browser bundles must not import Node built-ins (e.g.
fs). If unavoidable, useturbopack.resolveAliasas a stopgap.
- Sass imports: remove the Webpack-only
- Turbopack filesystem cache (dev, beta):
experimental.turbopackFileSystemCacheForDev: true. - React Compiler support: stable opt-in via
reactCompiler: true(expect higher build/compile cost). - Build Adapters API: alpha (custom build adapters).
- Routing/prefetching rewrite: layout deduplication + incremental prefetching.
Caching APIs (key signatures)
revalidateTag(tag, profile)now requires a cacheLife profile (or{ expire }) for SWR behavior.updateTag(tag)(Server Actions only): read-your-writes semantics.refresh()(Server Actions only): refresh uncached data; does not mutate cache.cacheLifeandcacheTagare stable (nounstable_prefix).
Requirements (v16)
- Node.js: 20.9+ (Node 18 not supported)
- TypeScript: 5.1+
- Browsers: Chrome/Edge/Firefox 111+, Safari 16.4+
Breaking / Behavior Changes (high-impact)
- Async Request APIs: sync access removed. Use
await params,await searchParams,await cookies(),await headers(),await draftMode(). - Tip (TypeScript):
npx next typegencan generate helpers likePageProps,LayoutProps,RouteContextto migrateparams/searchParamstypes safely. - Metadata images:
opengraph-image,twitter-image,icon,apple-iconnow receiveparams(andid) as Promises in the image function. - Sitemaps:
sitemap({ id })now receivesidas a Promise when usinggenerateSitemaps. - Parallel routes: slots require explicit
default.js. next/imagedefaults changed (cache TTL, sizes/qualities); localsrcwith query strings requiresimages.localPatterns.
Other notable behavior changes:
next devandnext builduse separate output dirs (next dev→.next/dev) and a lockfile prevents concurrent instances.- Scroll behavior: Next.js no longer overrides global
scroll-behavior: smoothduring navigations; adddata-scroll-behavior="smooth"on<html>to restore the previous override behavior. - ESLint:
@next/eslint-plugin-nextdefaults to ESLint Flat Config; legacy.eslintrcprojects may need migration.
Removed / Deprecated (high-level)
- Removed: AMP support;
next lint(use ESLint/Biome directly);eslintoption innext.config.*;serverRuntimeConfig/publicRuntimeConfig(use env vars);experimental.ppr+ route-levelexperimental_ppr;unstable_rootParams. - Deprecated:
middleware.tsfilename (preferproxy.ts);next/legacy/image;images.domains(preferimages.remotePatterns);revalidateTag(tag)single-arg form. proxy.tsnote:proxyruns onnodejsonly; Edge runtime is not supported inproxy. Keepmiddleware.tsif you must stay on Edge.- Config rename example:
skipMiddlewareUrlNormalize→skipProxyUrlNormalize.
You Might Also Like
Related Skills

cache-components
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
vercel
component-refactoring
Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component --json` shows complexity > 50 or lineCount > 300, when the user asks for code splitting, hook extraction, or complexity reduction, or when `pnpm analyze-component` warns to refactor before testing; avoid for simple/well-structured components, third-party wrappers, or when the user explicitly wants testing without refactoring.
langgenius
web-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
anthropics
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
anthropics
react-modernization
Upgrade React applications to latest versions, migrate from class components to hooks, and adopt concurrent features. Use when modernizing React codebases, migrating to React Hooks, or upgrading to latest React versions.
wshobson
tailwind-design-system
Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.
wshobson