nextjs

Guides Next.js App Router changes for pages, route handlers, caching, and rendering boundaries.

1|Updated Sep 15, 2026
One-click install
npx skills add https://github.com/amoai-tech/mdeai --skill nextjs-amoai-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs
Source: https://github.com/amoai-tech/mdeai/tree/main/.claude/skills/nextjs
Command: npx skills add https://github.com/amoai-tech/mdeai --skill nextjs-amoai-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Making changes to a Next.js application requires knowing which framework boundary owns the behavior: page, layout, route handler, cache, middleware, or build configuration. This Skill classifies the change, enforces MDE-specific invariants like narrow use client boundaries and authenticated route handlers, and prevents workarounds that mask unrelated bugs. ## Core Features & Use Cases - Change Classification: Categorizes work as page/layout, route handler, rendering boundary, cache, build, or deployment behavior before editing code. - MDE Invariant Enforcement: Keeps server-only secrets out of client components, requires authentication before privileged writes in route handlers, and treats caching as observable behavior. - Version-Sensitive Verification: Checks the installed Next.js version (16.2.6) and official documentation before relying on framework APIs. - Use Case: When adding a new API endpoint to the MDE app, use this Skill to confirm the route handler authenticates before privileged writes, matches existing src/app patterns, and passes targeted type, lint, and build checks. ## Quick Start Ask the assistant to implement a Next.js App Router change in the MDE app, such as adding a route handler or adjusting a server/client component boundary, and have it verify the result with targeted type and lint checks.

Frequently Asked Questions about nextjs

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

FAQPage Schema
How do I decide between a server component and a client component in Next.js?

Default to server components and add `use client` only where interactivity, hooks, or browser APIs require it. Keep the client boundary as narrow as practical and never place server-only secrets or privileged clients inside client components.

How do I add a route handler in the Next.js App Router?

Create a route file under `src/app` following the nearest existing pattern, then authenticate and authorize before any privileged write. Verify the change with targeted type, lint, and build checks rather than relying on manual inspection.

Does Next.js caching behavior need explicit configuration?

Treat caching and revalidation as observable behavior, not an implementation detail. Verify version-sensitive caching semantics against the installed Next.js version and official documentation before changing fetch or revalidate settings.

When should I add middleware in a Next.js app?

Do not add middleware, rewrites, or dynamic rendering merely to work around an unrelated bug. Add middleware only when the cross-cutting concern genuinely belongs at the request edge, and route unknown root causes to systematic debugging first.

Why does my Next.js change behave differently after upgrading versions?

Framework APIs for caching, rendering, and route handlers change between Next.js versions. Inspect the installed version first and consult current official documentation for version-sensitive behavior before modifying code.