Provides Next.js 16 App Router rules for caching, Server Components, routing, Server Actions, client boundaries, and a codebase audit/refactor algorithm.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pproenca-dot-skills-1:nextjsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Comprehensive Next.js 16 App Router guide for AI agents. Contains **45 rules across 9 categories**, prioritized by impact from critical (build optimization, caching strategy) through to cross-cutting codebase hygiene (dedup, dead routes, boundary coherence). Reflects Next.js 16 changes: `'use cache'` directive replacing implicit caching, `revalidateTag(tag, cacheLife)` requirement, `proxy.ts` r...
Comprehensive Next.js 16 App Router guide for AI agents. Contains 45 rules across 9 categories, prioritized by impact from critical (build optimization, caching strategy) through to cross-cutting codebase hygiene (dedup, dead routes, boundary coherence). Reflects Next.js 16 changes: 'use cache' directive replacing implicit caching, revalidateTag(tag, cacheLife) requirement, proxy.ts replacing middleware.ts, Turbopack persistent caching, App Router conventions.
Rule files describe pattern shapes (not API names) and open with a "Shapes to recognize" section listing 2–4 syntactic disguises the same break can wear. Selected high-value rules (those whose disguises are most common in practice — 'use cache', parallel-fetching, dynamic-imports, server-action-forms, client-boundary, server-vs-client-fetching) include an extra concrete "In disguise" incorrect/correct example pair to teach pattern detection beyond the grep-friendly cases.
references/_review-algorithm.md)'use cache', middleware.ts → proxy.ts, revalidateTag single-arg → with cacheLife)'use cache', unstable_cache, revalidateTag, revalidatePathproxy.ts'use client' boundaries to minimize client bundle'use client' propagation across the route tree, prop-shape drift (see Category 9)When the user asks to review, refactor, modernize, or audit Next.js code — single file or whole repo — follow references/_review-algorithm.md. Do not improvise.
Four non-negotiables from that doc:
'use client' for one button; TanStack Query fetching initial page data; a route handler doing the work of a Server Action; a hand-rolled cache layer mimicking 'use cache'; sequential fetches hidden across parent/child Server Components).{clean, N findings, n/a}). A missing category in the output is immediately visible.Single-file ad-hoc questions ("is this caching strategy right?") can go straight to the relevant rule. The algorithm exists for the multi-file and whole-repo cases.
| # | Category | Impact | Rules | Key Topics |
|---|---|---|---|---|
| 1 | Build & Bundle Optimization | CRITICAL | 5 | Turbopack, optimizePackageImports, dynamic imports, barrel files, serverExternalPackages |
| 2 | Caching Strategy | CRITICAL | 6 | 'use cache', revalidateTag+cacheLife, fetch options, segment config |
| 3 | Server Components & Data Fetching | HIGH | 6 | Parallel fetching, streaming, colocation, preload, no-client-fetch, error handling |
| 4 | Routing & Navigation | HIGH | 5 | Parallel routes, intercepting routes, prefetching, proxy.ts, notFound() |
| 5 | Server Actions & Mutations | MEDIUM-HIGH | 5 | Server actions, useFormStatus, action-result errors, useOptimistic, revalidation |
| 6 | Streaming & Loading States | MEDIUM | 5 | Suspense placement, loading.tsx, error.tsx, skeleton matching, nested Suspense |
| 7 | Metadata & SEO | MEDIUM | 4 | generateMetadata, sitemap.ts, robots.ts, opengraph-image.tsx |
| 8 | Client Components | LOW-MEDIUM | 4 | 'use client' boundary, children pattern, hydration mismatch, next/script |
| 9 | Codebase Hygiene | LOW-MEDIUM | 5 | Dedup server fetchers, route consolidation, dead routes/actions, 'use client' propagation, prop drift |
Critical patterns — get these right first:
'use cache' to Server Components/functions whose results should be cached (Next.js 16 dropped implicit fetch caching)revalidateTag(tag, cacheLife) with a profile — never the one-arg APIoptimizePackageImports for icon/utility libraries with flat-export surfaces<form action={serverAction}> instead of POST-to-/api/...Next.js 16 idioms (do NOT generate Next.js 15 patterns):
proxy.ts (Node runtime) — not middleware.ts (Edge)'use cache' — not implicit fetch cachingrevalidateTag(tag, cacheLife) — not single-arg revalidateTag(tag)useActionState — not client fetch + useStateapp/sitemap.ts — not hand-maintained public/sitemap.xmlCommon single-file mistakes — avoid these anti-patterns:
await for independent data (use Promise.all or preload)useEffect + fetch in a Client Component for initial page data'use client' at the layout level for one interactive buttonrevalidatePath/revalidateTag after a mutating Server ActionCodebase-level patterns — surface these in Category 9 sweeps:
'use client' propagating up the route tree because of one interactive leaf — demote layouts/parents to Server Components, leave a client islandindex.ts — CRITICAL (2-10x faster dev startup)optimizePackageImports — CRITICAL (200-800ms faster imports, 50-80% smaller bundles)serverExternalPackages — HIGHfetch declare its caching intent — HIGH'use cache' — CRITICALrevalidateTag(tag, cacheLife) with a profile — CRITICALcache() for dedup — HIGHawait is a waterfall — HIGH<Suspense> — HIGHpreload call — MEDIUM-HIGHuseEffect+fetch — MEDIUM-HIGHerror.tsx or ErrorBoundary — MEDIUM<Link prefetch> to traffic likelihood — MEDIUM-HIGHproxy.ts — not middleware.ts — MEDIUM-HIGHnotFound() for real HTTP 404 — MEDIUMfetch — MEDIUM-HIGHuseFormStatus — MEDIUM-HIGHloading.tsx adjacent to its page.tsx — MEDIUMerror.tsx next to it — MEDIUMgenerateMetadata for per-resource SEO — MEDIUMapp/robots.ts and per-page metadata — MEDIUMopengraph-image.tsx — LOW-MEDIUM'use client' down to the interactive leaf — LOW-MEDIUMchildren — LOW-MEDIUMnext/script with the right strategy — LOW-MEDIUM'use client' placement across the route tree — HIGHreact skillreact-hook-form skilltanstack-query skillFor the complete guide with all rules expanded: AGENTS.md
npx claudepluginhub pproenca/dot-skillsProvides Next.js 16 expertise covering App Router, server/client components, data caching, and production gotchas like async params and route collisions.
Provides Next.js 16 App Router production patterns for Server Components, Server Actions, Cache Components with 'use cache', caching APIs, Route Handlers, metadata, async params, proxy.ts migration, and React 19.2 features.
Provides Next.js 14+ best practices for App Router structure, Server/Client Components, API routes, loading/error UI, and file conventions.