Skip to content

Skill for Next.js 16 App Router covering Server Components, Server Actions, and Cache Components on React 19.2.

CCM score
53 of 100
version
3.12.0
GitHub stars
254
View on GitHub

Own this plugin? Claim it

What it does

  • Adds the nextjs skill, covering App Router patterns, Server Components, Server Actions, Route Handlers, and Metadata API
  • Documents Next.js 16 breaking changes such as async params, proxy.ts replacing middleware.ts, and required default.js in parallel routes
  • Covers Cache Components with the "use cache" directive, plus revalidateTag(), updateTag(), and refresh() caching APIs
  • Designed for React 19.2 apps on any deployment platform; Cloudflare Workers work is handled by a separate skill

Next.js 16 with App Router, Server Components, Server Actions, Cache Components. Use for React 19.2 apps, SSR, or encountering async params, proxy.ts migration, use cache errors.

Add marketplace

/plugin marketplace add secondsky/claude-skills

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install nextjs@claude-skills

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Next.js App Router - Production Patterns

Version: Next.js 16.2.0 React Version: 19.2.0 Node.js: 20.9+ Last Verified: 2025-11-21

Table of Contents

  1. When to Use This Skill
  2. When NOT to Use This Skill
  3. Next.js 16 Breaking Changes
  4. Cache Components & Caching APIs
  5. Server Components
  6. Server Actions
  7. Route Handlers
  8. React 19.2 Features
  9. Metadata API
  10. Image & Font Optimization
  11. Top 5 Critical Errors
  12. Performance Patterns
  13. TypeScript Configuration

When to Use This Skill

Use this skill when you need:

  • Next.js 16 App Router patterns (layouts, loading, error boundaries, routing)
  • Server Components best practices (data fetching, composition, streaming)
  • Server Actions patterns (forms, mutations, revalidation, error handling)
  • Cache Components with "use cache" directive (NEW in Next.js 16)
  • New caching APIs: revalidateTag(), updateTag(), refresh() (Updated in Next.js 16)
  • Migration from Next.js 15 to 16 (async params, proxy.ts, parallel routes)
  • Route Handlers (API endpoints, webhooks, streaming responses)
  • Proxy patterns (proxy.ts replaces middleware.ts in Next.js 16)
  • Async route params (params, searchParams, cookies(), headers() now async)
  • Parallel routes with default.js (breaking change in Next.js 16)
  • React 19.2 features (View Transitions, useEffectEvent(), React Compiler)
  • Metadata API (SEO, Open Graph, Twitter Cards, sitemaps)
  • Image optimization (next/image with updated defaults in Next.js 16)
  • Performance optimization (lazy loading, code splitting, PPR, ISR)

When NOT to Use This Skill

Do NOT use this skill for:

  • Cloudflare Workers deployment → Use the cloudflare-nextjs skill (OpenNext adapter: @opennextjs/cloudflare, getCloudflareContext, caching tiers, Workers-specific errors). Note: cloudflare-nextjs covers the proxy.ts exception for Cloudflare (keep middleware.ts there).
  • Pages Router patterns → This skill covers App Router ONLY (Pages Router is legacy)
  • Authentication libraries → Use clerk-auth, auth-js, or other auth-specific skills
  • Database integration → Use cloudflare-d1, drizzle-orm-d1, or database-specific skills
  • UI component libraries → Use tailwind-v4-shadcn skill for Tailwind + shadcn/ui
  • State management → Use zustand-state-management, tanstack-query skills
  • Form libraries → Use react-hook-form-zod skill

Next.js 16 Breaking Changes

CRITICAL: Next.js 16 has multiple breaking changes. For detailed migration steps, see references/next-16-migration-guide.md.

Breaking ChangeBeforeAfter
Async paramsparams.slugconst { slug } = await params
Async headerscookies() syncawait cookies()
Middlewaremiddleware.tsproxy.ts (renamed)
Parallel routesdefault.js optionaldefault.js required
CachingAuto-cached fetchOpt-in with "use cache"
revalidateTag()1 argument2 arguments (tag + cacheLife)
Node.js18.x+20.9+ required
React18.x19.2+ required

Quick Fix for Async Params:

// ✅ Next.js 16 pattern
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
  const { id } = await params
  return <div>{id}</div>
}

Codemod: bunx @next/codemod@canary upgrade latest

See: references/next-16-migration-guide.md for complete migration guide with examples.


Cache Components & Caching APIs

"use cache" Directive (NEW in Next.js 16)

'use cache'

export async function BlogPosts() {
  const posts = await db.posts.findMany()
  return posts.map(post => <article key={post.id}>{post.title}</article>)
}

Caching APIs Summary

APIPurposeExample
"use cache"Opt-in component/function caching'use cache' at top
revalidateTag()Invalidate by tagrevalidateTag('posts', 'max')
updateTag()Update cache without revalidationupdateTag('posts', newData)
refresh()Refresh current pagerefresh()
revalidatePath()Invalidate by pathrevalidatePath('/posts')

PPR (Partial Prerendering)

// next.config.ts
const config = { experimental: { ppr: true } }

// page.tsx
export const experimental_ppr = true

export default function Page() {
  return (
    <>
      <StaticHeader />
      <Suspense fallback={<Skeleton />}>
        <DynamicContent />
      </Suspense>
    </>
  )
}

See: references/caching-apis.md for complete caching API reference with ISR, tag-based revalidation, and advanced patterns.


Server Components

Server Components are the default in App Router. They run on the server and can fetch data, access databases, and keep logic server-side.

// app/posts/page.tsx (Server Component by default)
export default async function PostsPage() {
  const posts = await db.posts.findMany()
  return <div>{posts.map(p => <article key={p.id}>{p.title}</article>)}</div>
}

Streaming with Suspense

import { Suspense } from 'react'

export default function Page() {
  return (
    <div>
      <Header />
      <Suspense fallback={<Skeleton />}>
        <Posts />
      </Suspense>
    </div>
  )
}

Server vs Client Components

Server ComponentsClient Components
Data fetching, DB accessInteractivity (onClick)
Sensitive logicReact hooks (useState)
Large dependenciesBrowser APIs
Static contentReal-time updates

Client Component (requires 'use client'):

'use client'
import { useState } from 'react'
export function Counter() {
  const [count, setCount] = useState(0)
  return <button onClick={() => setCount(count + 1)}>{count}</button>
}

Server Actions

Server Actions are async functions that run on the server, callable from Client or Server Components.

Basic Server Action

// app/actions.ts
'use server'

import { revalidatePath } from 'next/cache'

export async function createPost(formData: FormData) {
  const title = formData.get('title') as string
  await db.posts.create({ data: { title } })
  revalidatePath('/posts')
}

Form Handling

// Server Component Form (simplest)
import { createPost } from './actions'

export default function NewPostPage() {
  return (
    <form action={createPost}>
      <input name="title" required />
      <button type="submit">Create</button>
    </form>
  )
}

Available Patterns

PatternUse CaseReference
Client Form with LoadinguseFormState + useFormStatustemplates/server-action-form.tsx
Error HandlingReturn { error } or { success }references/server-actions-patterns.md
Optimistic UpdatesuseOptimistic hookreferences/server-actions-patterns.md
File UploadFormData + blob storagereferences/server-actions-patterns.md
Redirect After Actionredirect() functionreferences/server-actions-patterns.md

See: references/server-actions-patterns.md for error handling, optimistic updates, file uploads, and advanced patterns.


Route Handlers

Route Handlers are the App Router equivalent of API Routes.

// app/api/posts/route.ts
export async function GET(request: Request) {
  const posts = await db.posts.findMany()
  return Response.json({ posts })
}

export async function POST(request: Request) {
  const body = await request.json()
  const post = await db.posts.create({ data: body })
  return Response.json({ post }, { status: 201 })
}

Dynamic Routes (with async params):

// app/api/posts/[id]/route.ts
export async function GET(
  request: Request,
  { params }: { params: Promise<{ id: string }> }
) {
  const { id } = await params // Await in Next.js 16
  const post = await db.posts.findUnique({ where: { id } })
  return post ? Response.json({ post }) : Response.json({ error: 'Not found' }, { status: 404 })
}

See: templates/route-handler-api.ts for search params, webhooks, and streaming patterns.


React 19.2 Features

FeatureUsage
React Compilerexperimental: { reactCompiler: true } - Auto-memoization
View TransitionsuseTransition() + router.push()
useEffectEventStable event handlers without deps

Metadata API

// Static metadata
export const metadata: Metadata = {
  title: 'My Blog',
  description: 'A blog about Next.js',
  openGraph: { title: 'My Blog', images: ['/og-image.jpg'] },
}

// Dynamic metadata (await params in Next.js 16)
export async function generateMetadata({ params }: { params: Promise<{ id: string }> }) {
  const { id } = await params
  const post = await db.posts.findUnique({ where: { id } })
  return { title: post.title, description: post.excerpt }
}

Image & Font Optimization

// next/image
import Image from 'next/image'
<Image src="/profile.jpg" alt="Profile" width={500} height={500} priority />

// next/font
import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'], variable: '--font-inter' })
<html className={inter.variable}>

Remote images: Configure images.remotePatterns in next.config.ts.


Top 5 Critical Errors

Error 1: params is a Promise

Error: Type 'Promise<{ id: string }>' is not assignable to type '{ id: string }'

Solution: Await params in Next.js 16:

export default async function Page({ params }: { params: Promise<{ id: string }> }) {
  const { id } = await params
}

Error 2: middleware.ts is deprecated

Warning: middleware.ts is deprecated. Use proxy.ts instead.

Solution: Rename file and function:

// Rename: middleware.ts → proxy.ts
// Rename function: middleware → proxy
export function proxy(request: NextRequest) {
  // Same logic
}

Error 3: Parallel route missing default.js

Error: Parallel route @modal was matched but no default.js was found

Solution: Add default.tsx:

// app/@modal/default.tsx
export default function ModalDefault() {
  return null
}

Error 4: Cannot use React hooks in Server Component

Error: You're importing a component that needs useState. It only works in a Client Component

Solution: Add 'use client':

'use client'

import { useState } from 'react'

export function Counter() {
  const [count, setCount] = useState(0)
  return <button onClick={() => setCount(count + 1)}>{count}</button>
}

Error 5: fetch() not caching

Cause: Next.js 16 uses opt-in caching with "use cache".

Solution: Add "use cache" directive:

'use cache'

export async function getPosts() {
  const response = await fetch('/api/posts')
  return response.json()
}

See All 18 Errors: references/error-catalog.md


Performance Patterns

PatternUsage
Lazy Loadingconst HeavyComp = dynamic(() => import('./Heavy'), { ssr: false })
Code SplittingAutomatic per route - each page.tsx gets own bundle
TurbopackDefault in Next.js 16, opt out with --webpack flag
PPRexperimental: { ppr: true } + <Suspense> boundaries

TypeScript Configuration

{
  "compilerOptions": {
    "strict": true,
    "baseUrl": ".",
    "paths": { "@/*": ["./*"] }
  }
}

When to Load References

ReferenceLoad When...
next-16-migration-guide.mdMigrating from Next.js 15, async params errors, proxy.ts setup
server-actions-patterns.mdError handling, optimistic updates, file uploads, advanced forms
caching-apis.mdISR, tag-based revalidation, updateTag(), refresh(), PPR details
error-catalog.mdDebugging any Next.js error, comprehensive error solutions
top-errors.mdQuick fixes for the 5 most common Next.js errors

Bundled Resources

TypeFiles
Referenceserror-catalog.md, top-errors.md, next-16-migration-guide.md, server-actions-patterns.md, caching-apis.md
Templatesasync-params-page.tsx, server-action-form.tsx, route-handler-api.ts, cache-component-use-cache.tsx, parallel-routes-with-default.tsx, proxy-migration.ts

Related Skills

SkillPurpose
cloudflare-nextjsDeploy to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare)
tailwind-v4-shadcnStyling
clerk-authAuthentication
drizzle-orm-d1Database
react-hook-form-zodForms
zustand-state-managementClient state

Official Docs: https://nextjs.org/docs | App Router: https://nextjs.org/docs/app


Version: Next.js 16.2.0 | React 19.2.0 | Node.js 20.9+ | TypeScript 5.9+ Production Tested: E-commerce, SaaS, content sites | Token Savings: 65-70%

Readme

Next.js App Router - Production Patterns

Version: Next.js 16.2.0 | React: 19.2.0 | Node.js: 20.9+ Production Tested: ✅ | Token Savings: 65-70% | Errors Prevented: 18+


What This Skill Provides

This skill provides production-ready patterns for Next.js 16 App Router, including:

  • ✅ Next.js 16 breaking changes (async params, proxy.ts, parallel routes)
  • ✅ Cache Components with "use cache" directive (NEW)
  • ✅ Updated caching APIs: revalidateTag(), updateTag(), refresh() (NEW)
  • ✅ Server Components (data fetching, streaming, composition)
  • ✅ Server Actions (forms, mutations, validation, error handling)
  • ✅ Route Handlers (API endpoints, webhooks, streaming)
  • ✅ Proxy patterns (proxy.ts replaces middleware.ts)
  • ✅ Parallel Routes & Route Groups
  • ✅ React 19.2 features (View Transitions, useEffectEvent(), React Compiler)
  • ✅ Metadata API (SEO, Open Graph, sitemaps)
  • ✅ Image & Font optimization (next/image, next/font)
  • ✅ Turbopack configuration (stable in Next.js 16)
  • ✅ Performance patterns (lazy loading, code splitting, PPR)
  • ✅ TypeScript configuration

When to Use This Skill

Use this skill when you need:

  • Next.js App Router patterns (any deployment platform)
  • Server Components best practices
  • Server Actions for forms and mutations
  • Cache Components with "use cache"
  • Migration from Next.js 15 to 16
  • React 19.2 integration patterns
  • Performance optimization with Turbopack
  • SEO with Metadata API

Platform Support: Works with Vercel, Cloudflare Workers, AWS, self-hosted, or any deployment platform.


When NOT to Use This Skill

Do NOT use this skill for:

  • Cloudflare Workers deployment → Use the cloudflare-nextjs skill (OpenNext adapter: @opennextjs/cloudflare, getCloudflareContext, caching tiers, Workers-specific errors)
  • Pages Router → This skill is App Router only (Pages Router is legacy)
  • Authentication → Use clerk-auth, auth-js skills
  • Database integration → Use cloudflare-d1, drizzle-orm-d1 skills
  • UI components → Use tailwind-v4-shadcn skill
  • State management → Use zustand-state-management, tanstack-query skills

Auto-Trigger Keywords

This skill should be used when the user mentions:

Next.js Core

  • next.js app router
  • app router patterns
  • next.js 16
  • nextjs 16
  • next.js app directory
  • app directory patterns

Server Components

  • next.js server components
  • server components patterns
  • nextjs server components
  • rsc patterns
  • react server components next.js
  • server component data fetching
  • server component streaming
  • suspense next.js
  • streaming next.js

Server Actions

  • next.js server actions
  • server actions patterns
  • server actions forms
  • nextjs server actions
  • form handling next.js
  • server mutations next.js
  • revalidate next.js
  • server action validation

Cache Components (NEW in Next.js 16)

  • cache components next.js
  • use cache directive
  • "use cache" next.js
  • partial prerendering next.js
  • ppr next.js
  • next.js caching
  • revalidateTag next.js
  • updateTag next.js
  • cache invalidation next.js

Route Handlers

  • next.js route handlers
  • route handlers api
  • app router api routes
  • next.js api endpoints
  • api routes app router
  • route.ts next.js
  • route handler patterns

Proxy & Middleware

  • proxy.ts next.js
  • next.js proxy
  • middleware.ts deprecated
  • next.js middleware
  • middleware patterns next.js
  • request interception next.js

Routing Patterns

  • parallel routes next.js
  • route groups next.js
  • intercepting routes next.js
  • default.js next.js
  • catch-all routes next.js
  • optional catch-all routes
  • dynamic routes next.js

Metadata & SEO

  • next.js metadata api
  • metadata next.js
  • generateMetadata next.js
  • next.js seo
  • open graph next.js
  • sitemap next.js
  • robots.txt next.js

Image & Font Optimization

  • next/image
  • next image optimization
  • image component next.js
  • responsive images next.js
  • next/font
  • font optimization next.js
  • google fonts next.js
  • local fonts next.js

Performance

  • turbopack next.js
  • next.js performance
  • lazy loading next.js
  • code splitting next.js
  • dynamic import next.js
  • next.js bundle size
  • fast refresh next.js

React 19.2 Integration

  • react 19 next.js
  • view transitions next.js
  • useEffectEvent next.js
  • react compiler next.js
  • react 19.2 features

Migration & Breaking Changes

  • migrate next.js 16
  • next.js 16 breaking changes
  • async params next.js
  • searchParams async
  • cookies() await
  • headers() await
  • parallel routes default.js
  • revalidateTag two arguments

TypeScript

  • next.js typescript
  • typescript configuration next.js
  • path aliases next.js
  • type-safe routing next.js

Error Messages (Auto-trigger on errors)

  • "params is a Promise"
  • "searchParams is a Promise"
  • "cookies() requires await"
  • "headers() requires await"
  • "middleware.ts is deprecated"
  • "Parallel route was matched but no default.js"
  • "revalidateTag requires 2 arguments"
  • "Failed to compile with Turbopack"
  • "Cannot use React hooks in Server Component"

Disambiguation from Other Skills

vs cloudflare-nextjs Skill

This skill (nextjs):

  • ✅ Framework-level patterns (App Router, Server Components, Server Actions)
  • ✅ Works with ANY deployment platform (Vercel, Cloudflare, AWS, self-hosted)
  • ✅ Next.js 16 features and migration guide
  • ❌ Does NOT cover Cloudflare Workers deployment

cloudflare-nextjs skill (OpenNext Cloudflare adapter — @opennextjs/cloudflare):

  • ✅ Cloudflare Workers deployment patterns
  • ✅ OpenNext adapter configuration
  • ✅ Cloudflare services integration (D1, R2, KV, Workers AI)
  • ❌ Does NOT cover general Next.js patterns

When to use BOTH: Building Next.js on Cloudflare Workers

  • Use nextjs for framework patterns (Server Components, Server Actions, etc.)
  • Use cloudflare-nextjs for deployment and Cloudflare service integration

What You Get

📄 SKILL.md (~2000 lines)

Complete Next.js 16 reference with:

  • Next.js 16 breaking changes (async params, proxy.ts, Cache Components)
  • Server Components patterns (data fetching, streaming, composition)
  • Server Actions (forms, validation, error handling, optimistic updates)
  • Cache Components with "use cache" directive
  • Updated caching APIs (revalidateTag(), updateTag(), refresh())
  • Route Handlers (API endpoints, webhooks, streaming)
  • Proxy vs Middleware migration guide
  • Parallel Routes & Route Groups (with required default.js)
  • React 19.2 features (View Transitions, useEffectEvent(), React Compiler)
  • Metadata API (SEO, Open Graph, sitemaps)
  • Image & Font optimization (next/image, next/font)
  • Performance patterns (Turbopack, lazy loading, code splitting)
  • TypeScript configuration
  • 18+ common errors with solutions

📁 Templates (20+)

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.js
  • route-groups-example.tsx - Route groups organization

Cache Components (Next.js 16):

  • cache-component-use-cache.tsx - Cache Components with "use cache"
  • partial-prerendering.tsx - PPR patterns
  • revalidate-tag-cache-life.ts - Updated revalidateTag() API
  • server-action-update-tag.ts - updateTag() for read-your-writes

Server Components:

  • server-component-data-fetching.tsx - Data fetching patterns
  • server-component-streaming.tsx - Streaming with Suspense
  • server-component-composition.tsx - Server + Client composition

Server Actions:

  • server-actions-form.tsx - Form handling
  • server-actions-validation.ts - Validation with Zod
  • server-actions-optimistic.tsx - Optimistic updates

Route Handlers:

  • route-handler-api.ts - CRUD API
  • route-handler-webhook.ts - Webhook handling
  • route-handler-streaming.ts - Streaming responses

Proxy & Middleware:

  • proxy-migration.ts - Migrate middleware.ts → proxy.ts
  • proxy-auth.ts - Auth patterns

React 19.2:

  • view-transitions-react-19.tsx - View Transitions
  • use-effect-event.tsx - useEffectEvent() pattern
  • react-compiler-example.tsx - React Compiler

Metadata:

  • metadata-config.ts - Static/dynamic metadata
  • sitemap.ts - Sitemap generation
  • robots.ts - robots.txt generation

Optimization:

  • image-optimization.tsx - next/image patterns
  • font-optimization.tsx - next/font patterns
  • lazy-loading.tsx - Dynamic imports
  • code-splitting.tsx - Code splitting

Configuration:

  • next.config.ts - Full configuration
  • typescript-config.json - TypeScript setup
  • package.json - Dependencies for Next.js 16

📚 References (10+)

Detailed guides:

  • next-16-migration-guide.md - Complete migration from Next.js 15
  • cache-components-guide.md - Cache Components deep dive
  • proxy-vs-middleware.md - Proxy.ts vs middleware.ts
  • async-route-params.md - Async params, searchParams, cookies()
  • app-router-fundamentals.md - App Router concepts
  • server-components-patterns.md - Server Components best practices
  • server-actions-guide.md - Server Actions patterns
  • route-handlers-reference.md - Route Handlers API
  • metadata-api-guide.md - Metadata API guide
  • performance-optimization.md - Performance patterns
  • react-19-integration.md - React 19.2 features
  • top-errors.md - 18+ common errors with solutions

🛠️ Scripts

  • check-versions.sh - Verify Next.js and dependency versions

Errors Prevented

This skill prevents 18+ common mistakes:

  1. ❌ Not awaiting params (async in Next.js 16)
  2. ❌ Not awaiting searchParams (async in Next.js 16)
  3. ❌ Not awaiting cookies() (async in Next.js 16)
  4. ❌ Not awaiting headers() (async in Next.js 16)
  5. ❌ Missing default.js in parallel routes (required in Next.js 16)
  6. ❌ Using middleware.ts instead of proxy.ts (deprecated in Next.js 16)
  7. ❌ revalidateTag() with 1 argument (requires 2 in Next.js 16)
  8. ❌ Not using "use cache" directive (implicit caching removed)
  9. ❌ Using React hooks in Server Components
  10. ❌ Importing Server Component into Client Component
  11. ❌ Not configuring remote images in next.config
  12. ❌ Missing font variable in HTML element
  13. ❌ Environment variables not prefixed with NEXT_PUBLIC_
  14. ❌ Server Action missing 'use server' directive
  15. ❌ Incorrect TypeScript path aliases
  16. ❌ Route collisions with Route Groups
  17. ❌ Using generateStaticParams without static mode
  18. ❌ Turbopack incompatibility (now stable, but may need webpack fallback)

Error Prevention Rate: 100% (all documented errors caught)


Production Validation

Tested With:

  • Next.js 16.2.0
  • React 19.2.0
  • Node.js 20.9+
  • Turbopack (stable)
  • Vercel deployment
  • Self-hosted deployment

Last Verified: 2025-10-24


Installation

This skill is part of the claude-skills repository.

Install:

# Add the marketplace once (if not already added)
/plugin marketplace add https://github.com/secondsky/claude-skills

# Install this plugin
/plugin install nextjs@claude-skills

Verify:

ls -la ~/.claude/skills/nextjs

Usage Examples

Example 1: Migrating to Next.js 16

User: "Help me migrate my Next.js app to Next.js 16"

Claude (with skill):

  • ✅ Identifies breaking changes (async params, proxy.ts, Cache Components)
  • ✅ Provides migration templates
  • ✅ Updates middleware.ts → proxy.ts
  • ✅ Adds await to params, searchParams, cookies()
  • ✅ Adds default.js to parallel routes
  • ✅ Migrates from implicit caching to "use cache"
  • ✅ Updates revalidateTag() calls to include cacheLife

Result: Zero errors, complete migration in ~10 minutes


Example 2: Building a Blog with Server Actions

User: "Build a blog with Next.js App Router using Server Actions for forms"

Claude (with skill):

  • ✅ Uses server-actions-form.tsx template
  • ✅ Implements validation with Zod
  • ✅ Uses updateTag() for immediate cache refresh
  • ✅ Adds optimistic updates for UI feedback
  • ✅ Configures Metadata API for SEO
  • ✅ Optimizes images with next/image

Result: Production-ready blog with zero Next.js-specific errors


Example 3: Optimizing Performance with Cache Components

User: "How do I cache parts of my dashboard with Next.js 16?"

Claude (with skill):

  • ✅ Explains Cache Components with "use cache"
  • ✅ Provides partial-prerendering.tsx template
  • ✅ Shows static header + dynamic user info pattern
  • ✅ Implements revalidateTag() with cacheLife profiles
  • ✅ Uses Turbopack for fast builds

Result: Optimized dashboard with granular caching control


Contributing

Contributions welcome! See CONTRIBUTING.md in the claude-skills repository.


Support


License

MIT License - See LICENSE


Related Skills

Composable with:

  • cloudflare-nextjs - For Cloudflare Workers deployment via the OpenNext adapter (@opennextjs/cloudflare)
  • tailwind-v4-shadcn - For Tailwind v4 + shadcn/ui setup
  • clerk-auth - For Clerk authentication
  • auth-js - For Auth.js (NextAuth) integration
  • cloudflare-d1 - For D1 database (if deploying to Cloudflare)
  • drizzle-orm-d1 - For Drizzle ORM with D1
  • react-hook-form-zod - For form validation
  • tanstack-query - For server state management
  • zustand-state-management - For client state management

Changelog

v1.0.0 (2025-10-24)

  • Initial release
  • Next.js 16.2.0 support
  • React 19.2.0 integration
  • 20+ templates
  • 10+ reference guides
  • 18+ error preventions
  • Production tested

Maintained by: Claude Skills Maintainers | https://github.com/secondsky/claude-skills Repository: https://github.com/secondsky/claude-skills Last Updated: 2025-10-24

Details

Marketplace
secondsky/claude-skills
Source
plugins/nextjs
Category
Frontend
Keywords
nextjs, frontend, components, ssr, migration, async
Listed since
Apr 7, 2026

Questions

What does the nextjs plugin add to Claude Code?

The nextjs plugin provides production patterns for Next.js 16 App Router, covering Server Components, Server Actions, Route Handlers, Cache Components with the use cache directive, and proxy.ts replacing middleware.ts. It also includes React 19.2 integration, the Metadata API, and migration guidance from Next.js 15 to 16.

Is the nextjs plugin good for Cloudflare Workers deployments?

The plugin covers framework-level patterns that work on any deployment platform, including Vercel, AWS, and self-hosted setups. It does not cover Cloudflare Workers deployment, which the separate cloudflare-nextjs skill handles, so the README suggests using both together for that case.

How do I install the nextjs plugin in Claude Code?

Run /plugin marketplace add secondsky/claude-skills first, then run /plugin install nextjs@claude-skills. The second command adds the nextjs plugin from the marketplace you just added.

Where does the nextjs plugin stand in the Frontend & UI Code category?

The nextjs plugin is listed in the Frontend & UI Code category on Claude Marketplaces, alongside frontend-design, taste-skill, storybook and front-end-checklist. It focuses on Next.js App Router work, covering Server Components, Server Actions, and migration from Next.js 15 to 16.

More from secondsky/claude-skills

All 122

Similar to nextjs

More Frontend & UI Code