Next.js App Router v16.1.6
Follow this workflow for any Next.js task.
- •Confirm the target is App Router and Next.js
16.1.6. - •Open
references/getting-started-v16.1.6.mdand use the relevant section only. - •Apply official-first patterns from the reference before using custom abstractions.
- •Keep changes minimal and consistent with the existing codebase.
- •Validate by running project lint/tests/build commands when available.
Implementation Rules
- •Prefer React Server Components by default; add Client Components only when browser APIs, local interactivity, or client hooks are required.
- •Use
Linkfor navigation; useuseRouteronly for imperative navigation. - •Use Server Functions for mutations; pair mutations with
revalidatePathorrevalidateTagwhen cached data must refresh. - •Use
error.tsx,global-error.tsx, andnot-found.tsxfor resilient error boundaries. - •Use Next.js primitives first:
next/image,next/font, metadata API, route handlers, and proxy matcher config. - •For version changes, check the upgrade notes section in the reference and prefer codemods where available.
Reference Loading Guide
- •Read section
1-4for initial app setup and routing structure. - •Read section
5-9for data flow, caching, and error handling. - •Read section
10-14for styling, images/fonts, and metadata. - •Read section
15-17for API and deployment concerns. - •Read section
18for migration work to v16.