nextjs

Implements Next.js App Router patterns for rendering, caching, data fetching, and deployment.

2|Updated Jun 8, 2026
One-click install
npx skills add https://github.com/lunaticwithaduck/easytech3d --skill nextjs-lunaticwithaduck
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nextjs
Source: https://github.com/lunaticwithaduck/easytech3d/tree/main/.claude/skills/nextjs
Command: npx skills add https://github.com/lunaticwithaduck/easytech3d --skill nextjs-lunaticwithaduck

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building production Next.js applications requires navigating App Router conventions, four overlapping caching layers, Server Component boundaries, and rendering strategy tradeoffs that are easy to get wrong. This Skill provides structured guidance and working code patterns so developers make correct architectural decisions without trial and error. ## Core Features & Use Cases - App Router Architecture: Covers nested layouts, route groups, dynamic routes, parallel routes, intercepting routes, and the "use client" boundary rule with a rendering strategy decision tree (Static, ISR, Dynamic, Streaming). - Data Fetching & Caching: Documents Server Component fetch, request memoization, the four caching layers, time-based and on-demand revalidation with revalidatePath/revalidateTag, and Suspense streaming patterns. - Server Actions & Mutations: Provides validated form actions with Zod, useActionState, optimistic updates, file uploads, and security rules for authentication and authorization checks. - Complete Implementation Examples: Includes full CRUD pattern, JWT auth with middleware and role-based access, and dynamic OG image generation with ImageResponse. - Use Case: When building a product page that mixes mostly-static content with real-time inventory, the Skill guides you to cache the product fetch with revalidate tags, use cache: 'no-store' for inventory, and stream slow sections behind Suspense boundaries. ## Quick Start Ask the assistant to help you build a Next.js App Router page with server-side data fetching, a Server Action mutation, and proper cache revalidation.

Frequently Asked Questions about nextjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between SSR, SSG, and ISR in Next.js App Router?▼

Use static rendering (default) for content that never changes, ISR with export const revalidate for content that updates infrequently, and dynamic rendering for per-user data using cookies(), headers(), or searchParams. For mixed pages, combine a static shell with Suspense boundaries around dynamic sections.

How do Server Actions work in Next.js?▼

Server Actions are async functions marked with 'use server' that run on the server and can be called from forms or event handlers. They support progressive enhancement without JavaScript, should validate input with Zod, verify authentication, and call revalidatePath after mutations.

Why does my Next.js page show stale data after a mutation?▼

Stale data appears when revalidatePath or revalidateTag is not called after a mutation. Call revalidatePath('/your-path') inside the Server Action after the database write, or tag fetches with next: { tags: ['name'] } and invalidate with revalidateTag.

When should I use "use client" in Next.js components?▼

Add "use client" only to components that need hooks, event handlers, or browser APIs, and push the directive as far down the tree as possible. Everything imported into a Client Component becomes client code, so keeping boundaries low preserves server rendering benefits.

How do I protect routes with middleware in Next.js?▼

Create middleware.ts at the project root that reads the session cookie, verifies the JWT, and redirects unauthenticated users to /login with a callbackUrl parameter. Use the config.matcher to exclude static assets and API webhooks from middleware execution.

Can I deploy a Next.js app with Docker instead of Vercel?▼

Yes, set output: 'standalone' in next.config.js and use a multi-stage Dockerfile that copies the .next/standalone output and static assets into a minimal Node.js runtime image. Self-hosting requires installing sharp for image optimization and configuring your own CDN and ISR cache persistence.