home / skills / bobmatnyc / claude-mpm-skills / core
This skill helps you implement robust Next.js App Router patterns with server components, server actions, route handlers, and efficient caching.
npx playbooks add skill bobmatnyc/claude-mpm-skills --skill coreReview the files below or copy the command above to add this skill to your agents.
---
name: nextjs-core
description: Core Next.js patterns for App Router development including Server Components, Server Actions, route handlers, data fetching, and caching strategies
version: 1.1.0
category: toolchain
progressive_disclosure:
entry_point:
summary: "Server-first patterns with safe mutations (Server Actions) and explicit caching/revalidation"
tags: [nextjs, app-router]
---
# Next.js Core (App Router)
- Server Components by default; minimal `"use client"`.
- Mutations in Server Actions (validate/authz; revalidate tags/paths).
- Route handlers for APIs/webhooks; add loading/error boundaries.
Anti-patterns:
- ❌ Fetch initial data in `useEffect`.
- ❌ Cache or revalidate too broadly.
- ❌ Client-only authz.
References: see `references/` (server actions, fetching, caching, routing, auth, testing).
This skill bundles core Next.js App Router patterns to build predictable, efficient server-centric applications. It emphasizes Server Components, Server Actions for mutations, route handlers for APIs, and pragmatic data fetching and caching strategies. The guidance reduces client-side complexity and improves performance and security.
The skill inspects common App Router responsibilities: where to place Server Components versus client components, how to implement Server Actions for validated and authorized mutations, and how to structure route handlers for APIs and webhooks. It prescribes data fetching and caching tactics (granular revalidation, tags/paths) and points out anti-patterns to avoid. It also recommends loading/error boundaries around asynchronous UI.
Should I avoid all client components?
No. Use client components where interactivity or browser APIs are required, but default to Server Components for structure and performance.
How do I handle mutations securely?
Implement mutations as Server Actions, perform validation and authorization server-side, and revalidate only the necessary tags or paths.