Provides patterns and code examples for building Next.js 16+ applications with App Router architecture.

MITAuto-check: notesBackend & APIs

Install Nextjs App Router

skills CLI
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill nextjs-app-router -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install giuseppe-trisciuoglio/developer-kit nextjs-app-router --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/developer-kit-typescript/skills/nextjs-app-router .claude/skills/nextjs-app-router && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nextjs-app-router
GitHub stars
357
Token cost
~3.1k tokens
SKILL.md length
587 words
Files
11 (incl. references)
Skills in repo
115
Repo updated
First seen
Licence
MIT

At a glance

Provides patterns and code examples for building Next.js 16+ applications with App Router architecture.

  • Creating projects with App Router
  • SKILL.md covers Overview, When to Use, Quick Reference and Instructions, plus 4 more sections
  • Calls npx
  • Implementing Server Components and Client Components (use client)

What it does

Nextjs App Router is an agent skill from giuseppe-trisciuoglio/developer-kit. Provides patterns and code examples for building Next.js 16+ applications with App Router architecture. Use when creating projects with App Router, implementing Server Components and Client Components ("use client"), creating Server Actions for forms, building Route Handlers (route.ts), configuring caching with "use cache" directive (cacheLife, cacheTag), setting up parallel routes (@slot) or intercepting routes, migrating to proxy.ts, or working with App Router file conventions (layout.tsx, page.tsx…

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including reference files (for example `references/app-router-fundamentals.md`, `references/best-practices.md` and `references/caching-strategies.md`).

It sits in Backend & APIs, covering React components and Caching. It works with Next.js. The repository describes itself as: Modular plugin marketplace for Claude Code and agentic CLIs, with validated, spec-driven skills, agents, commands, and workflows for Java, TypeScript, Python, PHP, AWS, and AI. The licence is MIT.

When your agent uses it

  • Creating projects with App Router
  • Implementing Server Components and Client Components (use client)
  • Creating Server Actions for forms
  • Building Route Handlers (route.ts)

Example prompts

  • “use client”
  • “use cache”
  • “Use the nextjs-app-router skill to provide patterns and code examples for building Next.js 16+ applications with App Router architecture”
  • “/nextjs-app-router”

Requirements

  • Node.js
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash

What it can do on your machine

Read from SKILL.md and the folder at commit fe73fb3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Nextjs App Router loads about 3.1k tokens when it runs, and up to ~29k if it reads all its reference files. Until then it costs about 138 tokens; SKILL.md has 587 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~138
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~29k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from giuseppe-trisciuoglio/developer-kit at commit fe73fb3, republished under its MIT licence (© giuseppe-trisciuoglio). 587 words, ~3,063 tokens.

Download SKILL.mdSave it as .claude/skills/nextjs-app-router/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
nextjs-app-router
description
Provides patterns and code examples for building Next.js 16+ applications with App Router architecture. Use when creating projects with App Router, implementing Server Components and Client Components ("use client"), creating Server Actions for forms, building Route Handlers (route.ts), configuring caching with "use cache" directive (cacheLife, cacheTag), setting up parallel routes (`@slot`) or intercepting routes, migrating to proxy.ts, or working with App Router file conventions (layout.tsx, page.tsx, loading.tsx, error.tsx).
allowed-tools
Read, Write, Edit, Bash

Next.js App Router (Next.js 16+)

Build modern React applications using Next.js 16+ with App Router architecture.

Overview

This skill provides patterns for Server Components (default) and Client Components ("use client"), Server Actions for mutations and form handling, Route Handlers for API endpoints, explicit caching with "use cache" directive, parallel and intercepting routes, and Next.js 16 async APIs and proxy.ts.

When to Use

Activate when user requests involve:

  • "Create a Next.js 16 project", "Set up App Router"
  • "Server Component", "Client Component", "use client"
  • "Server Action", "form submission", "mutation"
  • "Route Handler", "API endpoint", "route.ts"
  • "use cache", "cacheLife", "cacheTag", "revalidation"
  • "parallel routes", "@slot", "intercepting routes"
  • "proxy.ts", "migrate from middleware.ts"
  • "layout.tsx", "page.tsx", "loading.tsx", "error.tsx", "not-found.tsx"
  • "generateMetadata", "next/image", "next/font"

Quick Reference

FilePurposeDirectivePurpose
page.tsxRoute page"use server"Server Action function
layout.tsxShared layout"use client"Client Component boundary
loading.tsxSuspense loading"use cache"Explicit caching (Next.js 16)
error.tsxError boundary
not-found.tsx404 page
route.tsAPI Route Handler
proxy.tsRouting boundary

Instructions

Create New Project
bash
npx create-next-app@latest my-app --typescript --tailwind --app --turbopack
Server Component

Server Components are the default in App Router. They run on the server and can use async/await.

tsx
// app/users/page.tsx
async function getUsers() {
  const apiUrl = process.env.API_URL;
  const res = await fetch(`${apiUrl}/users`);
  return res.json();
}

export default async function UsersPage() {
  const users = await getUsers();
  return <main>{users.map(user => <UserCard key={user.id} user={user} />)}</main>;
}
Client Component

Add "use client" when using hooks, browser APIs, or event handlers.

tsx
"use client";

import { useState } from "react";

export default function Counter() {
  const [count, setCount] = useState(0);
  return <button onClick={() => setCount(c => c + 1)}>Count: {count}</button>;
}
Server Action

Define actions in separate files with "use server" directive.

tsx
// app/actions.ts
"use server";

import { revalidatePath } from "next/cache";

export async function createUser(formData: FormData) {
  const name = formData.get("name") as string;
  const email = formData.get("email") as string;
  await db.user.create({ data: { name, email } });
  revalidatePath("/users");
}

Use with forms in Client Components:

tsx
"use client";

import { useActionState } from "react";
import { createUser } from "./actions";

export default function UserForm() {
  const [state, formAction, pending] = useActionState(createUser, {});
  return (
    <form action={formAction}>
      <input name="name" />
      <input name="email" type="email" />
      <button type="submit" disabled={pending}>{pending ? "Creating..." : "Create"}</button>
    </form>
  );
}

See references/server-actions.md for Zod validation, optimistic updates, and advanced patterns.

Configure Caching

Use "use cache" directive for explicit caching (Next.js 16+).

tsx
"use cache";

import { cacheLife, cacheTag } from "next/cache";

export default async function ProductPage({ params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  cacheTag(`product-${id}`);
  cacheLife("hours");
  const product = await fetchProduct(id);
  return <ProductDetail product={product} />;
}

See references/caching-strategies.md for cache profiles, on-demand revalidation, and advanced patterns.

Route Handler
ts
// app/api/users/route.ts
import { NextRequest, NextResponse } from "next/server";

export async function GET(request: NextRequest) {
  return NextResponse.json(await db.user.findMany());
}

export async function POST(request: NextRequest) {
  const body = await request.json();
  return NextResponse.json(await db.user.create({ data: body }), { status: 201 });
}

Dynamic segments use [param]:

ts
// app/api/users/[id]/route.ts
export async function GET(request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  const user = await db.user.findUnique({ where: { id } });
  if (!user) return NextResponse.json({ error: "Not found" }, { status: 404 });
  return NextResponse.json(user);
}
Next.js 16 Async APIs

All Next.js APIs are async in version 16.

tsx
import { cookies, headers } from "next/headers";

export default async function Page() {
  const cookieStore = await cookies();
  const headersList = await headers();
  const session = cookieStore.get("session")?.value;
  const userAgent = headersList.get("user-agent");
  return <div>...</div>;
}

Params and searchParams are also Promise-based:

tsx
export default async function Page({
  params,
  searchParams,
}: {
  params: Promise<{ slug: string }>;
  searchParams: Promise<{ sort?: string }>;
}) {
  const { slug } = await params;
  const { sort } = await searchParams;
  // ...
}

See references/nextjs16-migration.md for migration guide and proxy.ts configuration.

Parallel Routes

Use @folder convention for parallel route slots.

tsx
// app/dashboard/layout.tsx
export default function DashboardLayout({ children, team, analytics }: Record<string, React.ReactNode>) {
  return (
    <div>
      {children}
      <div className="grid grid-cols-2">{team}{analytics}</div>
    </div>
  );
}
tsx
// app/dashboard/@team/page.tsx
export default function TeamPage() { return <div>Team Section</div>; }

// app/dashboard/@analytics/page.tsx
export default function AnalyticsPage() { return <div>Analytics Section</div>; }

See references/routing-patterns.md for intercepting routes, route groups, and dynamic routes.

Best Practices

Server vs Client Decision:

  • Start with Server Component (default)
  • Use Client Component only for: React hooks (useState, useEffect), browser APIs (window, document), event handlers (onClick, onSubmit), or client-only libraries

Data Fetching:

  • Fetch in Server Components when possible
  • Use React's cache() for deduplication
  • Parallelize independent fetches
  • Add Suspense boundaries with loading.tsx

Performance Checklist:

  • Use loading.tsx for Suspense boundaries
  • Use next/image for optimized images
  • Use next/font for font optimization
  • Add error.tsx and not-found.tsx for error handling
Show full SKILL.md (218 more words)Show less

Examples

Example 1: Blog Post Form with Server Action

Input: Create a form to submit blog posts with Zod validation

Output:

tsx
// app/blog/actions.ts
"use server";

import { z } from "zod";
import { revalidatePath } from "next/cache";

const schema = z.object({ title: z.string().min(5), content: z.string().min(10) });

export async function createPost(formData: FormData) {
  const parsed = schema.safeParse({ title: formData.get("title"), content: formData.get("content") });
  if (!parsed.success) return { errors: parsed.error.flatten().fieldErrors };
  await db.post.create({ data: parsed.data });
  revalidatePath("/blog");
  return { success: true };
}
tsx
// app/blog/new/page.tsx
"use client";

import { useActionState } from "react";
import { createPost } from "../actions";

export default function NewPostPage() {
  const [state, formAction, pending] = useActionState(createPost, {});
  return (
    <form action={formAction}>
      <input name="title" placeholder="Title" />
      {state.errors?.title && <span>{state.errors.title[0]}</span>}
      <textarea name="content" placeholder="Content" />
      {state.errors?.content && <span>{state.errors.content[0]}</span>}
      <button type="submit" disabled={pending}>{pending ? "Publishing..." : "Publish"}</button>
    </form>
  );
}
Example 2: Cached Product Page

Input: Create a cached product page with on-demand revalidation

Output:

tsx
// app/products/[id]/page.tsx
"use cache";

import { cacheLife, cacheTag } from "next/cache";

export default async function ProductPage({ params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  cacheTag(`product-${id}`, "products");
  cacheLife("hours");
  const product = await db.product.findUnique({ where: { id } });
  if (!product) notFound();
  return <article><h1>{product.name}</h1><p>{product.description}</p></article>;
}
ts
// app/api/revalidate/route.ts
import { revalidateTag } from "next/cache";
import { NextResponse } from "next/server";

export async function POST(request: Request) {
  const { tag } = await request.json();
  revalidateTag(tag);
  return NextResponse.json({ revalidated: true });
}
Example 3: Dashboard with Parallel Routes

Input: Create a dashboard with sidebar and stats areas

Output:

tsx
// app/dashboard/layout.tsx
export default function DashboardLayout({ children, sidebar, stats }: Record<string, React.ReactNode>) {
  return (
    <div className="flex">
      <aside className="w-64">{sidebar}</aside>
      <main className="flex-1"><div className="grid grid-cols-3">{stats}</div>{children}</main>
    </div>
  );
}
tsx
// app/dashboard/@sidebar/page.tsx
export default function Sidebar() { return <nav>{/* Navigation links */}</nav>; }

// app/dashboard/@stats/page.tsx
export default async function Stats() {
  const stats = await fetchStats();
  return <><div>Users: {stats.users}</div><div>Orders: {stats.orders}</div></>;
}

Constraints and Warnings

Constraints:

  • Server Components cannot use browser APIs or React hooks
  • Client Components cannot be async (no direct data fetching)
  • cookies(), headers(), draftMode() are async in Next.js 16
  • params and searchParams are Promise-based in Next.js 16
  • Server Actions must be defined with "use server" directive

Warnings:

  • Using await in a Client Component causes a build error
  • Accessing window or document in Server Components throws an error
  • Forgetting to await cookies() or headers() in Next.js 16 returns a Promise instead of the value
  • Server Actions without proper validation can expose the database to unauthorized access
  • External Data Fetching: Server Components that fetch() third-party URLs process untrusted content — always validate, sanitize, and type-check responses; use environment variables for API URLs rather than hardcoding them

References

© giuseppe-trisciuoglio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files (references) in plugins/developer-kit-typescript/skills/nextjs-app-router of giuseppe-trisciuoglio/developer-kit.

  • SKILL.md
  • references/app-router-fundamentals.md
  • references/best-practices.md
  • references/caching-strategies.md
  • references/data-fetching.md
  • references/examples.md
  • references/metadata-api.md
  • references/nextjs16-migration.md
  • references/patterns.md
  • references/routing-patterns.md
  • references/server-actions.md

Open the folder on GitHubat commit fe73fb3

Compare with similar skills

Nextjs App Router next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Nextjs App Router compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nextjs App Router this skillgiuseppe-trisciuoglio/developer-kit357—~3.1kAutomated safety check: NotesMIT
React Best Practices V2diegosouzapw/awesome-omni-skills159—~3.5kAutomated safety check: PassMIT
Workos Widgetsusenotra/notra260—~2kAutomated safety check: PassAGPL-3.0
Apollo Clientapollographql/skills117—~1.9kAutomated safety check: PassMIT
V8 Jitvercel/next.js143k—~3.6kAutomated safety check: PassMIT
Nextjs Turbopackkurealnum/dotfiles2905 repos~540Automated safety check: PassNone

Similar skills

  • React Best Practices V2

    diegosouzapw/awesome-omni-skills

    Vercel React Best Practices workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~3.5k tokensUpdated 3 mo ago
    Frontend & DesignAuto-check passed
  • Workos Widgets

    usenotra/notra

    A skill your agent uses when the user is implementing, embedding, or debugging a WorkOS Widget — specifically the User Management, User Profile, Admin Portal SSO Connection, or Admin Portal Domain…

    260 GitHub stars~2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Apollo Client

    apollographql/skills

    Guide for building React applications with Apollo Client 4.x.

    117 GitHub stars~1.9k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • V8 Jit

    vercel/next.js

    Official

    V8 JIT optimization patterns for writing high-performance JavaScript in Next.js server internals.

    143k GitHub stars~3.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Nextjs Turbopack

    kurealnum/dotfiles

    Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.

    290 GitHub starsUsed in 5 repos~540 tokens
    Backend & APIsAuto-check passed
  • Cloudflare Nextjs

    secondsky/claude-skills

    Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).

    227 GitHub stars~5.3k tokensUpdated 13 days ago
    Backend & APIsAuto-check: notes

More from giuseppe-trisciuoglio/developer-kit

All 115 skills in this repo
  • Nestjs Drizzle Crud Generator

    giuseppe-trisciuoglio/developer-kit

    Generates complete CRUD modules for NestJS applications with Drizzle ORM.

    357 GitHub stars~1.3k tokensUpdated 1 mo ago
    Auto-check: notes
  • Spring Boot Actuator

    giuseppe-trisciuoglio/developer-kit

    Provides patterns to configure Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, and Micrometer metrics across JVM services.

    357 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check: notes
  • Spring Boot Crud Patterns

    giuseppe-trisciuoglio/developer-kit

    Provides and generates complete CRUD workflows for Spring Boot 3 services.

    357 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check: notes
  • Spring Boot Security JWT

    giuseppe-trisciuoglio/developer-kit

    Provides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based…

    357 GitHub stars~3.9k tokensUpdated 1 mo ago
    Auto-check: notes
  • AWS CLI Beast

    giuseppe-trisciuoglio/developer-kit

    Provides advanced AWS CLI patterns for managing EC2, Lambda, S3, DynamoDB, RDS, VPC, IAM, and CloudWatch.

    357 GitHub stars~1.7k tokensUpdated 1 mo ago
    Auto-check: notes
  • PR Review Comments

    giuseppe-trisciuoglio/developer-kit

    Posts review findings from a JSON file as inline comments on a GitHub Pull Request, attaching each comment to its file and line.

    357 GitHub stars~1k tokensUpdated 1 mo ago
    Auto-check: notes

Works with

Questions about Nextjs App Router

What does Nextjs App Router do?

Provides patterns and code examples for building Next.js 16+ applications with App Router architecture. Nextjs App Router is an agent skill from giuseppe-trisciuoglio/developer-kit.js 16+ applications with App Router architecture.

When should I use Nextjs App Router?

Nextjs App Router fits situations like: creating projects with App Router; implementing Server Components and Client Components (use client); creating Server Actions for forms; building Route Handlers (route.ts).

How do I install Nextjs App Router in Claude Code?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill nextjs-app-router -a claude-code`. Or copy the skill folder (plugins/developer-kit-typescript/skills/nextjs-app-router in giuseppe-trisciuoglio/developer-kit) into .claude/skills/nextjs-app-router in your project. Claude Code loads it when a task matches its description.

How do I install Nextjs App Router in Codex?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill nextjs-app-router -a codex`. Or copy the skill folder (plugins/developer-kit-typescript/skills/nextjs-app-router in giuseppe-trisciuoglio/developer-kit) into .agents/skills/nextjs-app-router in your project. Codex loads it when a task matches its description.

Can I use Nextjs App Router in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add giuseppe-trisciuoglio/developer-kit --skill nextjs-app-router -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nextjs-app-router, .gemini/skills/nextjs-app-router, .github/skills/nextjs-app-router and .opencode/skills/nextjs-app-router in your project.

What does Nextjs App Router need to run?

Going by SKILL.md and its folder, Nextjs App Router needs the command-line tools its instructions call (npx). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash.

Does Nextjs App Router access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Nextjs App Router safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Nextjs App Router use?

Nextjs App Router is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nextjs App Router use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 26k tokens, read only when the agent opens those files.

What are the alternatives to Nextjs App Router?

Skills that share tags, products or a category with Nextjs App Router: React Best Practices V2 (diegosouzapw/awesome-omni-skills, 159 stars), Workos Widgets (usenotra/notra, 260 stars), Apollo Client (apollographql/skills, 117 stars) and V8 Jit (vercel/next.js, 143k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Nextjs App Router?

giuseppe-trisciuoglio (a GitHub user) maintains it in giuseppe-trisciuoglio/developer-kit, which has 357 GitHub stars. The repository holds 115 skills in this directory. The repository was last updated on September 10, 2026.

Source: giuseppe-trisciuoglio/developer-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.