nextjs

Guides building, debugging, and migrating Next.js 16 App Router applications.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Alwahdi/mikrotik-whisperer --skill nextjs-alwahdi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs
Source: https://github.com/Alwahdi/mikrotik-whisperer/tree/main/.agents/skills/nextjs
Command: npx skills add https://github.com/Alwahdi/mikrotik-whisperer --skill nextjs-alwahdi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Next.js 16 introduced breaking changes — async request APIs, proxy.ts replacing middleware.ts, cacheHandlers replacing cacheHandler, and removed Pages Router patterns — that cause build failures and runtime errors when developers rely on outdated knowledge. This Skill provides current, version-accurate guidance so your App Router code works correctly the first time. ## Core Features & Use Cases - App Router Architecture Guidance: Covers Server Components, Client Components, Server Actions, Cache Components with 'use cache', layouts, and file conventions. - Migration Detection: Built-in validation rules flag deprecated patterns like getServerSideProps, next/router, next/head, and single-argument revalidateTag, with concrete upgrade paths. - Scaffolding & Tooling: Provides correct create-next-app flags, Geist font fixes for Tailwind v4 + shadcn, bundle analyzer usage, and upgrade commands. - Use Case: You are migrating a Pages Router app to Next.js 16 and your build fails on cookies() calls. This Skill identifies that cookies() is now async and shows the exact await pattern to fix it. ## Quick Start Ask the AI to review your Next.js app directory for Next.js 16 compatibility issues and apply the recommended App Router fixes.

Frequently Asked Questions about nextjs

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

FAQPage Schema
How do I migrate from Pages Router to App Router in Next.js?

Replace getServerSideProps and getStaticProps with async Server Components and generateStaticParams, move pages/ files into the app/ directory using layout.tsx and page.tsx conventions, and swap next/router imports for next/navigation hooks like useRouter and usePathname.

Why does cookies() or headers() throw an error in Next.js 16?

cookies(), headers(), params, and searchParams are asynchronous in Next.js 16. You must await them, for example const cookieStore = await cookies(), otherwise you get a build or runtime error in Server Components and Route Handlers.

What replaced middleware.ts in Next.js 16?

middleware.ts is renamed to proxy.ts in Next.js 16 and runs exclusively on the Node.js runtime. Place proxy.ts at the project root or inside src/ alongside app/, and export a proxy function that rewrites, redirects, or modifies headers.

How do I use the 'use cache' directive in Next.js 16?

Add 'use cache' at the top of a component or function, then configure duration with cacheLife() and invalidation tags with cacheTag(). Variants include 'use cache: remote' for cross-deployment caching and 'use cache: private' for per-user data.

Why is revalidateTag with one argument deprecated?

Next.js 16 requires a cacheLife profile as the second argument, such as revalidateTag(tag, 'max'), for stale-while-revalidate behavior. For immediate expiration inside Server Actions, use updateTag(tag) instead.

When should I use Server Actions versus Route Handlers?

Use Server Actions ('use server' functions) for form submissions and in-app mutations with revalidatePath or revalidateTag. Use Route Handlers (route.ts) for public APIs, webhooks, large file uploads, and streaming responses consumed by external clients.