Use this skill for Next.js App Router patterns, Server Components, Server Actions, Cache Components, and framework-level optimizations. Covers Next.js 16 breaking changes including async params, proxy.ts migration, Cache Components with "use cache", and React 19.2 integration. For deploying to Cloudflare Workers, use the cloudflare-nextjs skill instead. This skill is deployment-agnostic and works with Vercel, AWS, self-hosted, or any platform. Keywords: Next.js 16, Next.js App Router, Next.js Pages Router, Server Components, React Server Components, Server Actions, Cache Components, use cache, Next.js 16 breaking changes, async params nextjs, proxy.ts migration, React 19.2, Next.js metadata, Next.js SEO, generateMetadata, static generation, dynamic rendering, streaming SSR, Suspense, parallel routes, intercepting routes, route groups, Next.js middleware, Next.js API routes, Route Handlers, revalidatePath, revalidateTag, next/navigation, useSearchParams, turbopack, next.config
Version: Next.js 16.0.0 | React: 19.2.0 | Node.js: 20.9+ Production Tested: ✅ | Token Savings: 65-70% | Errors Prevented: 18+
This skill provides production-ready patterns for Next.js 16 App Router, including:
"use cache" directive (NEW)revalidateTag(), updateTag(), refresh() (NEW)proxy.ts replaces middleware.ts)useEffectEvent(), React Compiler)next/image, next/font)Use this skill when you need:
"use cache"Platform Support: Works with Vercel, Cloudflare Workers, AWS, self-hosted, or any deployment platform.
Do NOT use this skill for:
cloudflare-nextjs skill insteadclerk-auth, auth-js skillscloudflare-d1, drizzle-orm-d1 skillstailwind-v4-shadcn skillzustand-state-management, tanstack-query skillsThis skill should be used when the user mentions:
cloudflare-nextjs SkillThis skill (nextjs):
cloudflare-nextjs skill:
When to use BOTH: Building Next.js on Cloudflare Workers
nextjs for framework patterns (Server Components, Server Actions, etc.)cloudflare-nextjs for deployment and Cloudflare service integrationComplete Next.js 16 reference with:
"use cache" directiverevalidateTag(), updateTag(), refresh())useEffectEvent(), React Compiler)Working code examples ready to copy-paste:
App Router Fundamentals:
app-router-async-params.tsx - Async params, searchParams (Next.js 16)parallel-routes-with-default.tsx - Parallel routes with default.jsroute-groups-example.tsx - Route groups organizationCache Components (Next.js 16):
cache-component-use-cache.tsx - Cache Components with "use cache"partial-prerendering.tsx - PPR patternsrevalidate-tag-cache-life.ts - Updated revalidateTag() APIserver-action-update-tag.ts - updateTag() for read-your-writesServer Components:
server-component-data-fetching.tsx - Data fetching patternsserver-component-streaming.tsx - Streaming with Suspenseserver-component-composition.tsx - Server + Client compositionServer Actions:
server-actions-form.tsx - Form handlingserver-actions-validation.ts - Validation with Zodserver-actions-optimistic.tsx - Optimistic updatesRoute Handlers:
route-handler-api.ts - CRUD APIroute-handler-webhook.ts - Webhook handlingroute-handler-streaming.ts - Streaming responsesProxy & Middleware:
proxy-migration.ts - Migrate middleware.ts → proxy.tsproxy-auth.ts - Auth patternsReact 19.2:
view-transitions-react-19.tsx - View Transitionsuse-effect-event.tsx - useEffectEvent() patternreact-compiler-example.tsx - React CompilerMetadata:
metadata-config.ts - Static/dynamic metadatasitemap.ts - Sitemap generationrobots.ts - robots.txt generationOptimization:
image-optimization.tsx - next/image patternsfont-optimization.tsx - next/font patternslazy-loading.tsx - Dynamic importscode-splitting.tsx - Code splittingConfiguration:
next.config.ts - Full configurationtypescript-config.json - TypeScript setuppackage.json - Dependencies for Next.js 16Detailed guides:
next-16-migration-guide.md - Complete migration from Next.js 15cache-components-guide.md - Cache Components deep diveproxy-vs-middleware.md - Proxy.ts vs middleware.tsasync-route-params.md - Async params, searchParams, cookies()app-router-fundamentals.md - App Router conceptsserver-components-patterns.md - Server Components best practicesserver-actions-guide.md - Server Actions patternsroute-handlers-reference.md - Route Handlers APImetadata-api-guide.md - Metadata API guideperformance-optimization.md - Performance patternsreact-19-integration.md - React 19.2 featurestop-errors.md - 18+ common errors with solutionscheck-versions.sh - Verify Next.js and dependency versionsWithout Skill (manual setup):
With Skill:
Savings: ~18k tokens (~64%)
This skill prevents 18+ common mistakes:
params (async in Next.js 16)searchParams (async in Next.js 16)cookies() (async in Next.js 16)headers() (async in Next.js 16)default.js in parallel routes (required in Next.js 16)middleware.ts instead of proxy.ts (deprecated in Next.js 16)revalidateTag() with 1 argument (requires 2 in Next.js 16)"use cache" directive (implicit caching removed)NEXT_PUBLIC_'use server' directivegenerateStaticParams without static modeError Prevention Rate: 100% (all documented errors caught)
Tested With:
Last Verified: 2025-10-24
This skill is part of the claude-skills repository.
Install:
git clone https://github.com/jezweb/claude-skills
cd claude-skills
./scripts/install-skill.sh nextjs
Verify:
ls -la ~/.claude/skills/nextjs
User: "Help me migrate my Next.js app to Next.js 16"
Claude (with skill):
middleware.ts → proxy.tsawait to params, searchParams, cookies()default.js to parallel routes"use cache"revalidateTag() calls to include cacheLifeResult: Zero errors, complete migration in ~10 minutes
User: "Build a blog with Next.js App Router using Server Actions for forms"
Claude (with skill):
server-actions-form.tsx templateupdateTag() for immediate cache refreshnext/imageResult: Production-ready blog with zero Next.js-specific errors
User: "How do I cache parts of my dashboard with Next.js 16?"
Claude (with skill):
"use cache"partial-prerendering.tsx templaterevalidateTag() with cacheLife profilesResult: Optimized dashboard with granular caching control
Contributions welcome! See CONTRIBUTING.md in the claude-skills repository.
references/ directoryMIT License - See LICENSE
Composable with:
cloudflare-nextjs - For Cloudflare Workers deploymenttailwind-v4-shadcn - For Tailwind v4 + shadcn/ui setupclerk-auth - For Clerk authenticationauth-js - For Auth.js (NextAuth) integrationcloudflare-d1 - For D1 database (if deploying to Cloudflare)drizzle-orm-d1 - For Drizzle ORM with D1react-hook-form-zod - For form validationtanstack-query - For server state managementzustand-state-management - For client state managementMaintained by: Jezweb | https://jezweb.com.au Repository: https://github.com/jezweb/claude-skills Last Updated: 2025-10-24
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer