Agent skill

App Router

by davepoon in davepoon/buildwithclaude

This skill should be used when the user asks to "create a Next.js route", "add a page", "set up layouts", "implement loading states", "add error boundaries", "organize routes", "create dynamic…

MITAuto-check passedDevelopment

Install App Router

skills CLI
$ npx skills add davepoon/buildwithclaude --skill app-router -a claude-code

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

GitHub CLI
$ gh skill install davepoon/buildwithclaude 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/davepoon/buildwithclaude.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/nextjs-expert/skills/app-router .claude/skills/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
app-router
GitHub stars
3.6k
Used in
1 other repo
Token cost
~1.3k tokens
SKILL.md length
305 words
Files
6 (incl. references)
Skills in repo
246
Repo updated
First seen
Licence
MIT

At a glance

This skill should be used when the user asks to "create a Next.js route", "add a page", "set up layouts", "implement loading states", "add error boundaries", "organize routes", "create dynamic…

  • Works in 5 steps: Colocation: Keep components, tests, and… → Private folders: Use _folder for… → Route groups: Use (folder) to organize… → …
  • Asks to create a Next.js route
  • SKILL.md covers Overview, Core File Conventions, Creating Routes and Layouts, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

App Router is an agent skill from davepoon/buildwithclaude. This skill should be used when the user asks to "create a Next.js route", "add a page", "set up layouts", "implement loading states", "add error boundaries", "organize routes", "create dynamic routes", or needs guidance on Next.js App Router file conventions and routing patterns.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `examples/dynamic-routes.md`, `examples/parallel-routes.md` and `references/layouts-templates.md`).

It sits in Development, covering Error handling. It works with Next.js. The repository describes itself as: A single hub to find Claude Skills, Agents, Commands, Hooks, Plugins, and Marketplace collections to extend Claude Code, Claude Desktop, Agent SDK and OpenClaw. The licence is MIT.

When your agent uses it

  • Asks to create a Next.js route
  • Implement loading states
  • Add error boundaries
  • Organize routes

Example prompts

  • “create a Next.js route”
  • “add a page”
  • “set up layouts”
  • “/app-router”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Colocation: Keep components, tests, and styles near routes
  2. Private folders: Use _folder for non-route files
  3. Route groups: Use (folder) to organize without URL impact
  4. Parallel routes: Use @slot for complex layouts
  5. Intercepting routes: Use (.) patterns for modals

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

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

  • Network

    No URLs in SKILL.md.

    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

App Router loads about 1.3k tokens when it runs, and up to ~5.8k if it reads all its reference files. Until then it costs about 73 tokens; SKILL.md has 305 words of instructions outside code blocks.

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

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 passed

The automated check found no risky patterns in SKILL.md.

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 davepoon/buildwithclaude at commit 616deb5, republished under its MIT licence (© davepoon). 305 words, ~1,308 tokens.

Download SKILL.mdSave it as .claude/skills/app-router/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
app-router
description
This skill should be used when the user asks to "create a Next.js route", "add a page", "set up layouts", "implement loading states", "add error boundaries", "organize routes", "create dynamic routes", or needs guidance on Next.js App Router file conventions and routing patterns.
version
1.0.0

Next.js App Router Patterns

Overview

The App Router is Next.js's file-system based router built on React Server Components. It uses a app/ directory structure where folders define routes and special files control UI behavior.

Core File Conventions

Route Files

Each route segment is defined by a folder. Special files within folders control behavior:

FilePurpose
page.tsxUnique UI for a route, makes route publicly accessible
layout.tsxShared UI wrapper, preserves state across navigations
loading.tsxLoading UI using React Suspense
error.tsxError boundary for route segment
not-found.tsxUI for 404 responses
template.tsxLike layout but re-renders on navigation
default.tsxFallback for parallel routes
Folder Conventions
PatternPurposeExample
folder/Route segmentapp/blog/ → /blog
[folder]/Dynamic segmentapp/blog/[slug]/ → /blog/:slug
[...folder]/Catch-all segmentapp/docs/[...slug]/ → /docs/*
[[...folder]]/Optional catch-allapp/shop/[[...slug]]/ → /shop or /shop/*
(folder)/Route group (no URL)app/(marketing)/about/ → /about
@folder/Named slot (parallel routes)app/@modal/login/
_folder/Private folder (excluded)app/_components/

Creating Routes

Basic Route Structure

To create a new route, add a folder with page.tsx:

app/
├── page.tsx              # / (home)
├── about/
│   └── page.tsx          # /about
└── blog/
    ├── page.tsx          # /blog
    └── [slug]/
        └── page.tsx      # /blog/:slug
Page Component

A page is a Server Component by default:

tsx
// app/about/page.tsx
export default function AboutPage() {
  return (
    <main>
      <h1>About Us</h1>
      <p>Welcome to our company.</p>
    </main>
  )
}
Dynamic Routes

Access route parameters via the params prop:

tsx
// app/blog/[slug]/page.tsx
interface PageProps {
  params: Promise<{ slug: string }>
}

export default async function BlogPost({ params }: PageProps) {
  const { slug } = await params
  const post = await getPost(slug)

  return <article>{post.content}</article>
}

Layouts

Root Layout (Required)

Every app needs a root layout with <html> and <body>:

tsx
// app/layout.tsx
export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  )
}
Nested Layouts

Layouts wrap their children and preserve state:

tsx
// app/dashboard/layout.tsx
export default function DashboardLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <div className="flex">
      <Sidebar />
      <main className="flex-1">{children}</main>
    </div>
  )
}

Loading and Error States

Loading UI

Create instant loading states with Suspense:

tsx
// app/dashboard/loading.tsx
export default function Loading() {
  return <div className="animate-pulse">Loading...</div>
}
Error Boundaries

Handle errors gracefully:

tsx
// app/dashboard/error.tsx
'use client'

export default function Error({
  error,
  reset,
}: {
  error: Error
  reset: () => void
}) {
  return (
    <div>
      <h2>Something went wrong!</h2>
      <button onClick={reset}>Try again</button>
    </div>
  )
}

Route Groups

Organize routes without affecting URL structure:

app/
├── (marketing)/
│   ├── layout.tsx        # Marketing layout
│   ├── about/page.tsx    # /about
│   └── contact/page.tsx  # /contact
└── (shop)/
    ├── layout.tsx        # Shop layout
    └── products/page.tsx # /products

Metadata

Static Metadata
tsx
// app/about/page.tsx
import { Metadata } from 'next'

export const metadata: Metadata = {
  title: 'About Us',
  description: 'Learn more about our company',
}
Dynamic Metadata
tsx
// app/blog/[slug]/page.tsx
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
  const { slug } = await params
  const post = await getPost(slug)
  return { title: post.title }
}

Key Patterns

  1. Colocation: Keep components, tests, and styles near routes
  2. Private folders: Use _folder for non-route files
  3. Route groups: Use (folder) to organize without URL impact
  4. Parallel routes: Use @slot for complex layouts
  5. Intercepting routes: Use (.) patterns for modals

Resources

For detailed patterns, see:

  • references/routing-conventions.md - Complete file conventions
  • references/layouts-templates.md - Layout composition patterns
  • references/loading-error-states.md - Suspense and error handling
  • examples/dynamic-routes.md - Dynamic routing examples
  • examples/parallel-routes.md - Parallel and intercepting routes

© davepoon, 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 5 other files (references) in plugins/nextjs-expert/skills/app-router of davepoon/buildwithclaude.

  • SKILL.md
  • examples/dynamic-routes.md
  • examples/parallel-routes.md
  • references/layouts-templates.md
  • references/loading-error-states.md
  • references/routing-conventions.md

Open the folder on GitHubat commit 616deb5

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in davepoon/buildwithclaude, which our catalogue first saw on October 7, 2026.

Compare with similar skills

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.

App Router compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
App Router this skilldavepoon/buildwithclaude3.6k1 repos~1.3kAutomated safety check: PassMIT
Next Best Practicesvercel-labs/openreview1.7k18 repos~1kAutomated safety check: PassNone
Nextjsblencorp/claude-code-kit106—~2.6kAutomated safety check: PassMIT
Nextjs App RouterHoangNguyen0403/agent-skills-standard571—~993Automated safety check: PassMIT
Nextjs Data Fetchinggiuseppe-trisciuoglio/developer-kit356—~2.2kAutomated safety check: NotesMIT
Nextjs ExpertLeoYeAI/openclaw-master-skills2.2k—~4.8kAutomated safety check: PassMIT

Similar skills

  • Next Best Practices

    vercel-labs/openreview

    Official

    Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

    1.7k GitHub starsUsed in 18 repos~1k tokens
    DevelopmentAuto-check passed
  • Nextjs

    blencorp/claude-code-kit

    Next.js 15+ App Router development patterns including Server Components, Client Components, data fetching, layouts, and server actions.

    106 GitHub stars~2.6k tokensUpdated 10 mo ago
    DevelopmentAuto-check passed
  • Nextjs App Router

    HoangNguyen0403/agent-skills-standard

    Configure file-system routing with nested layouts, route groups, parallel routes, and error boundaries in Next.js App Router.

    571 GitHub stars~993 tokensUpdated today
    DevelopmentAuto-check passed
  • Nextjs Data Fetching

    giuseppe-trisciuoglio/developer-kit

    Provides Next.js App Router data fetching patterns including SWR and React Query integration, parallel data fetching, Incremental Static Regeneration (ISR), revalidation strategies, and error…

    356 GitHub stars~2.2k tokensUpdated 29 days ago
    Backend & APIsAuto-check: notes
  • Nextjs Expert

    LeoYeAI/openclaw-master-skills

    A skill your agent uses when building Next.js 14/15 applications with the App Router.

    2.2k GitHub stars~4.8k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed
  • A skill your agent uses when working on Next.js routing/middleware, error handling, Sentry/logging, user-facing notifications, performance-sensitive paths (Octopus subtitle renderer, large lists…

    105 GitHub stars~1.4k tokensUpdated 6 days ago
    Media & CreativeAuto-check passed

More from davepoon/buildwithclaude

All 246 skills in this repo
  • iOS Hig Design Guide

    davepoon/buildwithclaude

    Build, update, and apply iOS design specifications using Apple Human Interface Guidelines (HIG) source data.

    3.6k GitHub stars~735 tokensUpdated today
    Auto-check passed
  • Video Downloader

    davepoon/buildwithclaude

    Download YouTube videos with customizable quality and format options.

    3.6k GitHub starsUsed in 1 repo~871 tokens
    Auto-check passed
  • Qwen Vision

    davepoon/buildwithclaude

    A skill your agent uses when the user asks to "analyze video", "watch this video", "what happens in this video", "describe this clip", "review this footage", "classify these videos", "compare…

    3.6k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Atlas Cloud Media

    davepoon/buildwithclaude

    Discover Atlas Cloud image and video models, inspect their live schemas, and submit one confirmed media generation request with bounded GET polling.

    3.6k GitHub stars~852 tokensUpdated today
    Auto-check passed
  • Browser Extension Launch

    davepoon/buildwithclaude

    面向没有编程经验的用户,把想法做成可试用的浏览器插件,并完成检查、商店材料、审核提交和上线验证;也用于继续已有插件、排错和发布新版。用户说“帮我做个插件”“把插件上架”“继续我的插件”时使用。普通网站开发、仅查询插件知识不触发。

    3.6k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Slack Gif Creator

    davepoon/buildwithclaude

    Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives.

    3.6k GitHub starsUsed in 12 repos~4.3k tokens
    Auto-check passed

Works with

Categories

Questions about App Router

What does App Router do?

This skill should be used when the user asks to "create a Next.js route", "add a page", "set up layouts", "implement loading states", "add error boundaries", "organize routes", "create dynamic…. App Router is an agent skill from davepoon/buildwithclaude.js App Router file conventions and routing patterns.

When should I use App Router?

App Router fits situations like: asks to create a Next.js route; implement loading states; add error boundaries; organize routes.

How do I install App Router in Claude Code?

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

How do I install App Router in Codex?

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

Can I use 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 davepoon/buildwithclaude --skill 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/app-router, .gemini/skills/app-router, .github/skills/app-router and .opencode/skills/app-router in your project.

What does App Router need to run?

SKILL.md names no scripts, command-line tools or credentials: App Router is instructions for the agent only.

Does App Router access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is App Router safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does App Router use?

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 App Router use?

About 1.3k tokens (SKILL.md is roughly 5.2k 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 4.5k tokens, read only when the agent opens those files.

What are the alternatives to App Router?

Skills that share tags, products or a category with App Router: Next Best Practices (vercel-labs/openreview, 1.7k stars), Nextjs (blencorp/claude-code-kit, 106 stars), Nextjs App Router (HoangNguyen0403/agent-skills-standard, 571 stars) and Nextjs Data Fetching (giuseppe-trisciuoglio/developer-kit, 356 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains App Router?

davepoon (a GitHub user) maintains it in davepoon/buildwithclaude, which has 3,605 GitHub stars. The repository holds 246 skills in this directory. The repository was last updated on October 9, 2026.

Source: davepoon/buildwithclaude on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.