Next.js App Router
Installation
SKILL.md
Next.js App Router
Default to Server Components; reach for Client Components only for interactivity, state, or browser APIs. The two costly mistakes this skill prevents are the accidental client tree - one 'use client' placed high that drags the whole page into the browser bundle - and accidental caching, where fetch's default caching silently serves stale data and the team "fixes" it by sprinkling force-dynamic everywhere, losing all caching.
Operating procedure
Step 1: gather inputs
Collect before writing a route (label guesses as guesses):
- Per piece of data on the page: is it per-request/per-user, or shared and cacheable? If cacheable, what staleness is acceptable (seconds, minutes, hours)?
- Which UI elements genuinely need interactivity, state, effects, or browser APIs.
- Mutations on the page and what data they invalidate.
- Auth model: does rendering depend on cookies/headers (forces dynamic rendering)?