nextjs▌
jezweb/claude-skills · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Build Next.js 16 apps with async route params, Server Components, Cache Components, and Partial Prerendering.
- ›Covers 25+ documented errors and solutions, including async params migration, parallel routes with required default.js , and \"use cache\" directive patterns
- ›Supports Cache Components with revalidateTag() , updateTag() , and refresh() APIs for opt-in caching and stale-while-revalidate strategies
- ›Includes proxy.ts migration (replaces deprecated middleware.ts), Turbopack produc
Next.js App Router - Production Patterns
Version: Next.js 16.1.1 React Version: 19.2.3 Node.js: 20.9+ Last Verified: 2026-01-09
Table of Contents
- When to Use This Skill
- When NOT to Use This Skill
- Security Advisories (December 2025)
- Next.js 16.1 Updates
- Next.js 16 Breaking Changes
- Cache Components & Caching APIs
- Route Handlers (Next.js 16 Updates)
- Proxy vs Middleware
- Parallel Routes - default.js Required
- React 19.2 Features
- Turbopack (Stable in Next.js 16)
- Common Errors & Solutions
- Templates & Resources
When to Use This Skill
Focus: Next.js 16 breaking changes and knowledge gaps (December 2024+).
Use this skill when you need:
- Next.js 16 breaking changes (async params, proxy.ts, parallel routes default.js, removed features)
- 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 (avoid breaking change errors)
- Async route params (
params,searchParams,cookies(),headers()now async) - Parallel routes with default.js (REQUIRED in Next.js 16)
- React 19.2 features (View Transitions,
useEffectEvent(), React Compiler) - Turbopack (stable and default in Next.js 16)
- Image defaults changed (TTL, sizes, qualities in Next.js 16)
- Error prevention (25 documented Next.js 16 errors with solutions)
When NOT to Use This Skill
Do NOT use this skill for:
- Cloudflare Workers deployment → Use
cloudflare-nextjsskill instead - Pages Router patterns → This skill covers App Router ONLY (Pages Router is legacy)
- Authentication libraries → Use
clerk-auth,better-auth, or other auth-specific skills - Database integration → Use
cloudflare-d1,drizzle-orm-d1, or database-specific skills - UI component libraries → Use
tailwind-v4-shadcnskill for Tailwind + shadcn/ui - State management → Use
zustand-state-management,tanstack-queryskills - Form libraries → Use
react-hook-form-zodskill - Vercel-specific features → Refer to Vercel platform documentation
- Next.js Enterprise features (ISR, DPR) → Refer to Next.js Enterprise docs
- Deployment configuration → Use platform-specific deployment skills
Relationship with Other Skills:
- cloudflare-nextjs: For deploying Next.js to Cloudflare Workers (use BOTH skills together if deploying to Cloudflare)
- tailwind-v4-shadcn: For Tailwind v4 + shadcn/ui setup (composable with this skill)
- clerk-auth: For Clerk authentication in Next.js (composable with this skill)
- better-auth: For Better Auth integration (composable with this skill)
Security Advisories (December 2025)
CRITICAL: Three security vulnerabilities were disclosed in December 2025 affecting Next.js with React Server Components:
| CVE | Severity | Affected | Description |
|---|---|---|---|
| CVE-2025-66478 | CRITICAL (10.0) | 15.x, 16.x | Server Component arbitrary code execution |
| CVE-2025-55184 | HIGH | 13.x-16.x | Denial of Service via malformed request |
| CVE-2025-55183 | MEDIUM | 13.x-16.x | Source code exposure in error responses |
Action Required: Upgrade to Next.js 16.1.1 or later immediately.
npm update next
# Verify: npm list next should show 16.1.1+
References:
Next.js 16.1 Updates (December 2025)
New in 16.1:
- Turbopack File System Caching (STABLE): Now enabled by default in development
- Next.js Bundle Analyzer: New experimental feature for bundle analysis
- Improved Debugging: Enhanced
next dev --inspectsupport - Security Fixes: Addresses CVE-2025-66478, CVE-2025-55184, CVE-2025-55183
Next.js 16 Breaking Changes
IMPORTANT: Next.js 16 introduces multiple breaking changes. Read this section carefully if migrating from Next.js 15 or earlier.
1. Async Route Parameters (BREAKING)
Breaking Change: params, searchParams, cookies(), headers(), draftMode() are now async and must be awaited.
Before (Next.js 15):
// ❌ This no longer works in Next.js 16
export default function Page({ params, searchParams }: {
params: { slug: string }
searchParams: { query: string }
}) {
const slug = params.slug // ❌ Error: params is a Promise
const query = searchParams.query // ❌ Error: searchParams is a Promise
return <div>{slug}</div>
}
After (Next.js 16):
// ✅ Correct: await params and searchParams
export default async function Page({ params, searchParams }: {
params: Promise<{ slug: string }>
searchParams: Promise<{ query: string }>
}) {
const { slug } = await params // ✅ Await the promise
const { query } = await searchParams // ✅ Await the promise
return <div>{slug}</div>
}
Applies to:
paramsin pages, layouts, route handlerssearchParamsin pagescookies()fromnext/headersheaders()fromnext/headersdraftMode()fromnext/headers
Migration:
// ❌ Before
import { cookies, headers } from 'next/headers'
export function MyComponent() {
const cookieStore = cookies() // ❌ Sync access
const headersList = headers() // ❌ Sync access
}
// ✅ After
import { cookies, headers } from 'next/headers'
export async function MyComponent() {
const cookieStore = await cookies() // ✅ Async access
const headersList = await headers() // ✅ Async access
}
Codemod: Run npx @next/codemod@canary upgrade latest to automatically migrate.
Codemod Limitations (Community-sourced): The official codemod handles ~80% of async API migrations but misses edge cases:
- Async APIs accessed in custom hooks
- Conditional logic accessing params
- Components imported from external packages
- Complex server actions with multiple async calls
After running the codemod, search for @next-codemod-error comments marking places it couldn't auto-fix.
Manual Migration for Client Components:
// For client components, use React.use() to unwrap promises
'use client';
import { use } from 'react';
export default function ClientComponent({
params
}: {
params: Promise<{ id: string }>
}) {
const { id } = use(params); // Unwrap Promise in client
return <div>{id}</div>;
}
See Template: templates/app-router-async-params.tsx
2. Middleware → Proxy Migration (BREAKING)
Breaking Change: middleware.ts is deprecated in Next.js 16. Use proxy.ts instead.
Why the Change: proxy.ts makes the network boundary explicit by running on Node.js runtime (not Edge runtime). This provides better clarity between edge middleware and server-side proxies.
Migration Steps:
- Rename file:
middleware.ts→proxy.ts - Rename function:
middleware→proxy - Update config:
matcher→config.matcher(same syntax)
Before (Next.js 15):
// middleware.ts ❌ Deprecated in Next.js 16
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
export function middleware(request: NextRequest) {
const response = NextResponse.next()
response.headers.set('x-custom-header', 'value')
return response
}
export const config = {
matcher: '/api/:path*',
}
After (Next.js 16):
// proxy.ts ✅ New in Next.js 16
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
export function proxy(request: NextRequest) {
const response = NextResponse.next()
response.headers.set('x-custom-header', 'value')
return rHow to use nextjs on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add nextjs
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches nextjs from GitHub repository jezweb/claude-skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate nextjs. Access the skill through slash commands (e.g., /nextjs) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ Use When
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid When
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.5★★★★★38 reviews- ★★★★★Pratham Ware· Dec 8, 2024
I recommend nextjs for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Arya Thomas· Dec 8, 2024
nextjs reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Liam Reddy· Dec 4, 2024
nextjs has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Dev White· Nov 27, 2024
nextjs has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Dev Shah· Nov 23, 2024
nextjs reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★James Sharma· Oct 18, 2024
Useful defaults in nextjs — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Kofi Rahman· Oct 14, 2024
I recommend nextjs for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Nikhil Kim· Sep 25, 2024
We added nextjs from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Olivia Gill· Sep 9, 2024
nextjs has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Oshnikdeep· Sep 1, 2024
Keeps context tight: nextjs is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 38