agentleFS
ku5icku5ic/claude-kit/skills/next-app-router-patterns/SKILL.md

next-app-router-patterns

Skill2 starsChanged 8 days agoMITView on GitHub

Next.js App Router patterns for server/client boundary, data fetching and caching, server actions, streaming, parallel and intercepting routes, edge vs node runtime, and review checklist. Use whenever the project contains a `next.config.*`, an `app/` directory with `page`/`layout`/`route` files, or `next` in `package.json`, OR the user asks about the App Router, server and client components, server actions, or route handlers, even if Next.js is not mentioned by name.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default assumption: Next.js 16 (current stable as of writing) with the App Router.

    line 8
  2. Very specific:

    Verify via package.json or lockfile: caching model and cacheComponents flag differ between 15.x and 16.x.

    line 11

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Next.js App Router patterns

Default assumption: Next.js 16 (current stable as of writing) with the App Router. Pages Router patterns are out of scope.

  • Cache Components is the new caching model in 16 (opt-in via cacheComponents: true); the previous caching model is still supported when the flag is off.
  • Verify via package.json or lockfile: caching model and cacheComponents flag differ between 15.x and 16.x.

Reference files

FileCovers
reference/anti-patterns.mdSeverity-labeled anti-patterns: cache scoping, server/client boundary, streaming errors
reference/server-and-client.md"use client" propagation, server vs client constraints, serialization, server-only
reference/caching.mdCache Components vs previous model, fetch defaults, segment config, revalidation
reference/server-actions.mdServer Functions, "use server", form actions, validation, revalidation
reference/streaming.mdloading.tsx, <Suspense>, error boundaries, Partial Prerendering
reference/routing.mdFile conventions, dynamic segments, parallel/intercepting routes, metadata
reference/runtime.mdNode vs Edge, Proxy (renamed from Middleware in v16), runtime config
reference/client-bundle.mdnext/image, next/font, next/dynamic, tree-shaking and bundle audits

Out of scope

  • Pages Router projects (pages/ only, no app/ directory). The patterns differ enough that this skill would mislead.
  • React projects without Next.js (use the React skill alone).

References

Version notes

Checked: 2026-09-26 against https://nextjs.org/blog, https://nextjs.org/docs/app/api-reference/file-conventions/proxy and https://nextjs.org/docs/app/guides/upgrading/version-16

  • 16.3 (2026-08-03): no guidance change. Proxy runs on Node.js only; a project that needs the Edge runtime keeps middleware.ts (proxy docs).
  • 16.0: middleware renamed to proxy (types NextMiddleware -> NextProxy, MiddlewareConfig -> ProxyConfig, skipMiddlewareUrlNormalize -> skipProxyUrlNormalize); PPR stable and default under Cache Components; one-argument revalidateTag(tag) deprecated, pass a cacheLife profile (upgrade guide; examples fixed 2026-09-26).
  • 15.0: fetch() and Route Handler GET no longer cached by default; 15.5 gave the middleware file stable Node.js runtime support.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.