Documents the critical v15→v16 breaking changes: proxy.ts replacing middleware.ts, Turbopack-only builds, use cache replacing Partial Prerendering, required React 19, and async params/searchParams. This skill covers core framework APIs only — for assembling a full production stack (Prisma, Better Auth, shadcn/ui, Zustand together) use nextjs-stack instead; for a pure React SPA without next.config.* use the react-expert skills instead.
Next.js 16 Expert
Production-ready React framework with Server Components, streaming, and Turbopack.
Agent Workflow (MANDATORY)
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
- fuse-ai-pilot:explore-codebase - Analyze existing routes, components, and patterns
- fuse-ai-pilot:research-expert - Verify latest Next.js 16 docs via Context7/Exa
- mcp__context7__query-docs - Check breaking changes v15→v16
After implementation, run fuse-ai-pilot:sniper for validation.
Overview
When to Use
- Building new React applications with server-first architecture
- Need Server Components for optimal performance and SEO
- Implementing streaming and progressive rendering
- Migrating from Next.js 14/15 to version 16
- Using proxy.ts for route protection (replaces middleware)
- Leveraging Turbopack for faster development builds
Why Next.js 16
| Feature |
Benefit |
| Turbopack default |
2-5x faster builds, 10x faster HMR, Webpack deprecated |
| Cache Components |
Explicit caching with use cache directive |
| proxy.ts |
Full Node.js runtime, replaces Edge middleware |
| React Compiler |
Automatic memoization, no manual useMemo/useCallback |
| React 19 |
View Transitions, useEffectEvent, Activity component |
| App Router |
Nested layouts, parallel routes, intercepting routes |
Breaking Changes from v15
Critical Migration Points
- proxy.ts replaces middleware.ts - Full Node.js runtime, not Edge
- Turbopack ONLY - Webpack completely deprecated and removed
use cache directive - Replaces Partial Prerendering (PPR)
- React 19 required - New hooks and View Transitions API
- Async params/searchParams - Must await dynamic route params
SOLID Architecture
Module-Based Structure
Pages are thin entry points importing from feature modules:
app/page.tsx → imports from modules/public/home/
app/dashboard/page.tsx → imports from modules/auth/dashboard/
modules/cores/ → Shared services, utilities, configurations
File Conventions
- page.tsx - Route UI component
- layout.tsx - Shared UI wrapper
- loading.tsx - Suspense loading state
- error.tsx - Error boundary
- not-found.tsx - 404 handling
Core Concepts
Server Components (Default)
All components are Server Components by default. Use 'use client' directive only when needed for interactivity, hooks, or browser APIs.
Caching Strategy
use cache - Mark async functions for caching
cacheTag() - Tag cached data for targeted revalidation
cacheLife() - Control cache duration (stale, revalidate, expire)
revalidateTag() - Invalidate cached data on-demand
Data Fetching
Server Components fetch data directly. Use fetch() with native caching or database queries. No need for getServerSideProps or getStaticProps.
Reference Guide
| Need |
Reference |
| Initial setup |
installation.md, project-structure.md |
| Migration v15→v16 |
upgrade.md, middleware-migration.md |
| Routing |
app-router.md, routing-advanced.md |
| Caching |
caching.md, cache-components.md |
| Server Components |
server-components.md, directives.md |
| React 19 features |
react-19.md, react-compiler.md |
| Route protection |
proxy.md, security.md |
| SEO/Metadata |
metadata.md, metadata-files.md |
| Forms/Actions |
forms.md, data-fetching.md |
| Deployment |
deployment.md, environment.md |
Best Practices
- Server Components first - Only add
'use client' when necessary
- Colocate data fetching - Fetch data where it's used
- Streaming with Suspense - Wrap slow components in Suspense
- proxy.ts over middleware - Full Node.js runtime for auth
- Cache explicitly - Use
use cache for expensive operations
- Parallel routes - Load independent UI sections simultaneously
Performance
Build Optimization
- Turbopack - Incremental compilation, instant HMR
- React Compiler - Automatic memoization
- Tree shaking - Unused code elimination
- Code splitting - Automatic route-based splitting
Runtime Optimization
- Streaming - Progressive HTML rendering
- Partial hydration - Only hydrate interactive components
- Image optimization - Automatic WebP/AVIF conversion
- Font optimization - Zero layout shift with next/font
1---2name: nextjs-163description: Use when building Next.js 16 apps — Turbopack, App Router, Cache Components, proxy.ts, v15 migration. Not for stack scaffolding (nextjs-stack) or React SPA (react-expert).4---56<objective>7Covers Next.js 16 core framework mechanics: Turbopack (default bundler, Webpack fully removed), the App Router (nested layouts, parallel/intercepting routes, file conventions like page.tsx/layout.tsx/loading.tsx/error.tsx/not-found.tsx), Cache Components (`use cache`, `cacheTag()`, `cacheLife()`, `revalidateTag()`), `proxy.ts` (full Node.js runtime, replaces Edge middleware), and React 19 integration (View Transitions, new hooks).89Documents the critical v15→v16 breaking changes: proxy.ts replacing middleware.ts, Turbopack-only builds, `use cache` replacing Partial Prerendering, required React 19, and async `params`/`searchParams`. This skill covers core framework APIs only — for assembling a full production stack (Prisma, Better Auth, shadcn/ui, Zustand together) use nextjs-stack instead; for a pure React SPA without `next.config.*` use the react-expert skills instead.10</objective>1112# Next.js 16 Expert1314Production-ready React framework with Server Components, streaming, and Turbopack.1516## Agent Workflow (MANDATORY)1718Before ANY implementation, spawn 3 agents in parallel, one `Agent` call each with a `name`:19201. **fuse-ai-pilot:explore-codebase** - Analyze existing routes, components, and patterns212. **fuse-ai-pilot:research-expert** - Verify latest Next.js 16 docs via Context7/Exa223. **mcp__context7__query-docs** - Check breaking changes v15→v162324After implementation, run **fuse-ai-pilot:sniper** for validation.2526---2728## Overview2930### When to Use3132- Building new React applications with server-first architecture33- Need Server Components for optimal performance and SEO34- Implementing streaming and progressive rendering35- Migrating from Next.js 14/15 to version 1636- Using proxy.ts for route protection (replaces middleware)37- Leveraging Turbopack for faster development builds3839### Why Next.js 164041| Feature | Benefit |42|---------|---------|43| Turbopack default | 2-5x faster builds, 10x faster HMR, Webpack deprecated |44| Cache Components | Explicit caching with `use cache` directive |45| proxy.ts | Full Node.js runtime, replaces Edge middleware |46| React Compiler | Automatic memoization, no manual useMemo/useCallback |47| React 19 | View Transitions, useEffectEvent, Activity component |48| App Router | Nested layouts, parallel routes, intercepting routes |4950---5152## Breaking Changes from v155354### Critical Migration Points55561. **proxy.ts replaces middleware.ts** - Full Node.js runtime, not Edge572. **Turbopack ONLY** - Webpack completely deprecated and removed583. **`use cache` directive** - Replaces Partial Prerendering (PPR)594. **React 19 required** - New hooks and View Transitions API605. **Async params/searchParams** - Must await dynamic route params6162---6364## SOLID Architecture6566### Module-Based Structure6768Pages are thin entry points importing from feature modules:6970- `app/page.tsx` → imports from `modules/public/home/`71- `app/dashboard/page.tsx` → imports from `modules/auth/dashboard/`72- `modules/cores/` → Shared services, utilities, configurations7374### File Conventions7576- **page.tsx** - Route UI component77- **layout.tsx** - Shared UI wrapper78- **loading.tsx** - Suspense loading state79- **error.tsx** - Error boundary80- **not-found.tsx** - 404 handling8182---8384## Core Concepts8586### Server Components (Default)8788All components are Server Components by default. Use `'use client'` directive only when needed for interactivity, hooks, or browser APIs.8990### Caching Strategy9192- **`use cache`** - Mark async functions for caching93- **`cacheTag()`** - Tag cached data for targeted revalidation94- **`cacheLife()`** - Control cache duration (stale, revalidate, expire)95- **`revalidateTag()`** - Invalidate cached data on-demand9697### Data Fetching9899Server Components fetch data directly. Use `fetch()` with native caching or database queries. No need for `getServerSideProps` or `getStaticProps`.100101---102103## Reference Guide104105| Need | Reference |106|------|-----------|107| Initial setup | [installation.md](references/installation.md), [project-structure.md](references/project-structure.md) |108| Migration v15→v16 | [upgrade.md](references/upgrade.md), [middleware-migration.md](references/middleware-migration.md) |109| Routing | [app-router.md](references/app-router.md), [routing-advanced.md](references/routing-advanced.md) |110| Caching | [caching.md](references/caching.md), [cache-components.md](references/cache-components.md) |111| Server Components | [server-components.md](references/server-components.md), [directives.md](references/directives.md) |112| React 19 features | [react-19.md](references/react-19.md), [react-compiler.md](references/react-compiler.md) |113| Route protection | [proxy.md](references/proxy.md), [security.md](references/security.md) |114| SEO/Metadata | [metadata.md](references/metadata.md), [metadata-files.md](references/metadata-files.md) |115| Forms/Actions | [forms.md](references/forms.md), [data-fetching.md](references/data-fetching.md) |116| Deployment | [deployment.md](references/deployment.md), [environment.md](references/environment.md) |117118---119120## Best Practices1211221. **Server Components first** - Only add `'use client'` when necessary1232. **Colocate data fetching** - Fetch data where it's used1243. **Streaming with Suspense** - Wrap slow components in Suspense1254. **proxy.ts over middleware** - Full Node.js runtime for auth1265. **Cache explicitly** - Use `use cache` for expensive operations1276. **Parallel routes** - Load independent UI sections simultaneously128129---130131## Performance132133### Build Optimization134135- **Turbopack** - Incremental compilation, instant HMR136- **React Compiler** - Automatic memoization137- **Tree shaking** - Unused code elimination138- **Code splitting** - Automatic route-based splitting139140### Runtime Optimization141142- **Streaming** - Progressive HTML rendering143- **Partial hydration** - Only hydrate interactive components144- **Image optimization** - Automatic WebP/AVIF conversion145- **Font optimization** - Zero layout shift with next/font