nextjs-expert

Implements and debugs Next.js 16 App Router patterns including server components, caching, and route handlers.

1|Updated Aug 18, 2026
One-click install
npx skills add https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent --skill nextjs-expert-scsm-unrestrict
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-expert
Source: https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent/tree/main/frontend-engineer/skills/nextjs-expert
Command: npx skills add https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent --skill nextjs-expert-scsm-unrestrict

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Next.js 16 introduces breaking changes like Promise-based route params, Turbopack route collisions, and Cache Components that cause silent production failures even when code compiles and dev mode works fine. This Skill provides the correct patterns, gotcha fixes, and production checklists so your App Router code works in real deployments, not just locally. ## Core Features & Use Cases - Next.js 16 Gotcha Fixes: Correct handling of Promise-based params and searchParams, avoidance of app/sitemap.ts vs app/sitemap/page.tsx route collisions, and build-time verification before pushing. - Full App Router Coverage: Server and Client Components, Server Actions, route handlers, middleware, metadata generation, streaming with Suspense, and error boundaries. - Data & Caching Strategies: fetch caching modes, ISR revalidation, tag-based invalidation, and Cache Components (cacheComponents: true with 'use cache'). - Use Case: Your dynamic route works in next dev but 404s in production. The Skill identifies the synchronous params access, rewrites the page as an async component awaiting params, and reminds you to run next build before pushing. ## Quick Start Ask the agent to review or build a Next.js App Router page, for example: "Fix my dynamic post page that 404s in production and add proper metadata generation."

Frequently Asked Questions about nextjs-expert

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

FAQPage Schema
Why does my Next.js dynamic route 404 in production but work in dev?

In Next.js 16, route params are a Promise, so synchronous access like params.slug compiles but silently 404s every request in production. Make the page or handler async and await params before destructuring the values.

How do I fix the Next.js build error about duplicate routes with sitemap or robots?

The collision happens when app/sitemap.ts, robots.ts, manifest.ts, or icon.ts coexists with a same-named folder like app/sitemap/page.tsx. Turbopack fails the production build while dev mode masks it, so rename the page route to something distinct.

How do I revalidate cached data in Next.js App Router?

Use revalidatePath to invalidate a specific route or revalidateTag to invalidate all fetches tagged with a given label. You can also set time-based revalidation with the next.revalidate option on fetch for ISR behavior.

When should I use Server Components vs Client Components in Next.js?

Use Server Components by default for data fetching and static rendering since they reduce client JavaScript. Add the 'use client' directive only when you need hooks, event handlers, browser APIs, or context providers.

Does Next.js 16 still support Partial Prerendering?

Partial Prerendering matured into Cache Components in Next.js 16, enabled with cacheComponents: true at the top level of next.config rather than under experimental. Mark static parts with the 'use cache' directive and wrap dynamic parts in Suspense boundaries.