nextjs-app-router

nextjs-app-router is a skill for Claude Code from johnku2011/boilerplates-with-ai-skills. It costs 33 tokens per session (555 once invoked), scanned A, original, MIT.

A set of guidelines for building pages and API endpoints with the Next.js App Router, a way to organize Next.js applications around folders and routes. It explains when code should run on the server or in the browser.

In plain words
What is it for?
Use it when adding pages, shared layouts, route handlers, data fetching, or server-side form changes in a Next.js project.
Why use it?
It helps avoid server-and-browser compatibility errors, unnecessary client-side data loading, and missing loading or error states.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it when adding pages, shared layouts, route handlers, data fetching, or server-side form changes in a Next.js project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/johnku2011/boilerplates-with-ai-skills/nextjs-app-router
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add johnku2011/boilerplates-with-ai-skills --skill nextjs-app-router
Clone the repo
git clone --depth 1 https://github.com/johnku2011/boilerplates-with-ai-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nextjs-app-router

README.md
[![agentmods](https://agentmods.dev/badge/skills/johnku2011/boilerplates-with-ai-skills/nextjs-app-router/github.svg)](https://agentmods.dev/skills/johnku2011/boilerplates-with-ai-skills/nextjs-app-router)
Your own site
<a href="https://agentmods.dev/skills/johnku2011/boilerplates-with-ai-skills/nextjs-app-router"><img src="https://agentmods.dev/badge/skills/johnku2011/boilerplates-with-ai-skills/nextjs-app-router/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nextjs-app-router

Your own site · 80×15
<a href="https://agentmods.dev/skills/johnku2011/boilerplates-with-ai-skills/nextjs-app-router"><img src="https://agentmods.dev/badge/skills/johnku2011/boilerplates-with-ai-skills/nextjs-app-router.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 555 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.00555
Opus 5 $0.00016 $0.00278
Sonnet 5 $0.00007 $0.00111
Haiku 4.5 $0.00003 $0.00056

Measured 13d ago against content hash 766cefae14cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

nextjs-app-router scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

boilerplates/nextjs-app/skills/nextjs-app-router/SKILL.md · 63 lines

How it starts

The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Next.js App Router

Overview

Build features the App Router way: server components by default, client components only when needed, and colocated routes under app/.

Process

  1. Add a route by creating app/<segment>/page.tsx; add layout.tsx for shared UI and loading.tsx/error.tsx for states.
  2. Keep components as React Server Components unless they need state, effects, or browser APIs. Add "use client" only to those leaf components.
  3. Fetch data in server components with async/await; avoid client-side fetching for initial render when the server can do it.
  4. Put API endpoints in app/api/<name>/route.ts using the Web Request/ Response APIs.
  5. Verify with npm run build (catches server/client boundary and type errors).

Data Fetching

  • Prefer fetch in Server Components with Next.js caching options (cache, next.revalidate) documented in code comments when non-default.
  • Use loading.tsx for slow segments; avoid blocking the entire page.
  • Mutations: Server Actions or Route Handlers — validate input server-side.

Route Handlers

  • Export named HTTP functions (GET, POST, …) from route.ts.
  • Return Response.json() with correct status codes.
  • Never import client-only modules into route.ts.

Guidelines

  • Never import server-only modules (fs, secrets, DB clients) into client components.
  • Read secrets from environment variables on the server only; never expose them via NEXT_PUBLIC_* unless they are truly public.
  • Keep page.tsx thin; move logic into small, typed functions under src/ or colocated lib/.
  • Prefer next/link and next/image over raw anchors/images.
  • Colocate tests for pure helpers; run npm run build before claiming done.

Deployment

See the shared deploy-vercel skill when shipping to Vercel.

Anti-patterns

  • Marking entire pages "use client" to avoid thinking about server boundaries.
  • Fetching secrets or private APIs from the browser.
  • Giant page.tsx files mixing UI, data access, and validation.

Read the full file on GitHub · 63 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 63 lines · 33 tokens per session scan A 766cefae14cb

Subscribe to this mod's changes

nextjs-app-router is a skill published in the GitHub repository johnku2011/boilerplates-with-ai-skills (240 stars, last pushed 19d ago), licensed MIT. It adds 33 tokens to every session and 555 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

visual-ralph

Visual Ralph orchestration for frontend UI from generated references, static references, or live URL targets, using $ultragoal with built-in visual verdict and pixel-diff evidence until the implementation matches and leaves a reproducible design system.

Yeachan-Heo/oh-my-codex · 52 tokens

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

create-site

Creates a new Power Pages code site (SPA) using React, Angular, Vue, or Astro. Guides through the full process from initial concept to deployed site: requirements discovery, scaffolding, component planning, design, implementation, validation, and deployment. Use when the user wants to create, build, or scaffold a new…

microsoft/power-platform-skills · 73 tokens

prototype-web

A clickable, high-fidelity web product prototype with navigation, a hero section, feature cards, steps, social proof, and optional pricing. It is designed to resemble a finished landing page while remaining a prototype.

nexu-io/html-anything · 24 tokens

menu-transitions-rtl

Animate react-horizontal-scrolling-menu scrolling and build right-to-left menus: noPolyfill defaults to true since v8, so transitionDuration (default 500), a custom-easing-function transitionBehavior, and per-call ScrollOptions { duration, boundary } on scrollToItem/scrollNext/scrollPrev are silently ignored unless…

asmyshlyaev177/react-horizontal-scrolling-menu · 137 tokens