Next.js 16 Expert
Production-ready React framework with Server Components, streaming, and Turbopack.
Agent Workflow (MANDATORY)
Before ANY implementation, use TeamCreate to spawn 3 agents:
- 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-16-33description: Expert Next.js 16 with Turbopack, App Router, Cache Components, proxy.ts, React 19. Use when building Next.js apps, routing, caching, server components, or migrating from v15.4metadata:5 source: https://skillmd.com/skills/fusengine/nextjs-16-36---78# Next.js 16 Expert910Production-ready React framework with Server Components, streaming, and Turbopack.1112## Agent Workflow (MANDATORY)1314Before ANY implementation, use `TeamCreate` to spawn 3 agents:15161. **fuse-ai-pilot:explore-codebase** - Analyze existing routes, components, and patterns172. **fuse-ai-pilot:research-expert** - Verify latest Next.js 16 docs via Context7/Exa183. **mcp__context7__query-docs** - Check breaking changes v15→v161920After implementation, run **fuse-ai-pilot:sniper** for validation.2122---2324## Overview2526### When to Use2728- Building new React applications with server-first architecture29- Need Server Components for optimal performance and SEO30- Implementing streaming and progressive rendering31- Migrating from Next.js 14/15 to version 1632- Using proxy.ts for route protection (replaces middleware)33- Leveraging Turbopack for faster development builds3435### Why Next.js 163637| Feature | Benefit |38|---------|---------|39| Turbopack default | 2-5x faster builds, 10x faster HMR, Webpack deprecated |40| Cache Components | Explicit caching with `use cache` directive |41| proxy.ts | Full Node.js runtime, replaces Edge middleware |42| React Compiler | Automatic memoization, no manual useMemo/useCallback |43| React 19 | View Transitions, useEffectEvent, Activity component |44| App Router | Nested layouts, parallel routes, intercepting routes |4546---4748## Breaking Changes from v154950### Critical Migration Points51521. **proxy.ts replaces middleware.ts** - Full Node.js runtime, not Edge532. **Turbopack ONLY** - Webpack completely deprecated and removed543. **`use cache` directive** - Replaces Partial Prerendering (PPR)554. **React 19 required** - New hooks and View Transitions API565. **Async params/searchParams** - Must await dynamic route params5758---5960## SOLID Architecture6162### Module-Based Structure6364Pages are thin entry points importing from feature modules:6566- `app/page.tsx` → imports from `modules/public/home/`67- `app/dashboard/page.tsx` → imports from `modules/auth/dashboard/`68- `modules/cores/` → Shared services, utilities, configurations6970### File Conventions7172- **page.tsx** - Route UI component73- **layout.tsx** - Shared UI wrapper74- **loading.tsx** - Suspense loading state75- **error.tsx** - Error boundary76- **not-found.tsx** - 404 handling7778---7980## Core Concepts8182### Server Components (Default)8384All components are Server Components by default. Use `'use client'` directive only when needed for interactivity, hooks, or browser APIs.8586### Caching Strategy8788- **`use cache`** - Mark async functions for caching89- **`cacheTag()`** - Tag cached data for targeted revalidation90- **`cacheLife()`** - Control cache duration (stale, revalidate, expire)91- **`revalidateTag()`** - Invalidate cached data on-demand9293### Data Fetching9495Server Components fetch data directly. Use `fetch()` with native caching or database queries. No need for `getServerSideProps` or `getStaticProps`.9697---9899## Reference Guide100101| Need | Reference |102|------|-----------|103| Initial setup | [installation.md](references/installation.md), [project-structure.md](references/project-structure.md) |104| Migration v15→v16 | [upgrade.md](references/upgrade.md), [middleware-migration.md](references/middleware-migration.md) |105| Routing | [app-router.md](references/app-router.md), [routing-advanced.md](references/routing-advanced.md) |106| Caching | [caching.md](references/caching.md), [cache-components.md](references/cache-components.md) |107| Server Components | [server-components.md](references/server-components.md), [directives.md](references/directives.md) |108| React 19 features | [react-19.md](references/react-19.md), [react-compiler.md](references/react-compiler.md) |109| Route protection | [proxy.md](references/proxy.md), [security.md](references/security.md) |110| SEO/Metadata | [metadata.md](references/metadata.md), [metadata-files.md](references/metadata-files.md) |111| Forms/Actions | [forms.md](references/forms.md), [data-fetching.md](references/data-fetching.md) |112| Deployment | [deployment.md](references/deployment.md), [environment.md](references/environment.md) |113114---115116## Best Practices1171181. **Server Components first** - Only add `'use client'` when necessary1192. **Colocate data fetching** - Fetch data where it's used1203. **Streaming with Suspense** - Wrap slow components in Suspense1214. **proxy.ts over middleware** - Full Node.js runtime for auth1225. **Cache explicitly** - Use `use cache` for expensive operations1236. **Parallel routes** - Load independent UI sections simultaneously124125---126127## Performance128129### Build Optimization130131- **Turbopack** - Incremental compilation, instant HMR132- **React Compiler** - Automatic memoization133- **Tree shaking** - Unused code elimination134- **Code splitting** - Automatic route-based splitting135136### Runtime Optimization137138- **Streaming** - Progressive HTML rendering139- **Partial hydration** - Only hydrate interactive components140- **Image optimization** - Automatic WebP/AVIF conversion141- **Font optimization** - Zero layout shift with next/font