nextjs-app-router

nextjs-app-router is a skill for Claude Code, Codex from saajunaid/caddis-plugin. It costs 49 tokens per session (2,257 once invoked), scanned A, original, MIT.

A guide to the Next.js App Router, the part of Next.js used to organize pages, layouts, server-rendered components, data loading, and API-like route handlers. It covers the conventions introduced in Next.js 13 and later.

In plain words
What is it for?
Use it when building Next.js applications with server and client components, server actions, middleware, metadata, loading and error pages, or nested routes.
Why use it?
It helps you choose the correct file structure and understand which code runs on the server or in the browser.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building Next.js applications with server and client components, server actions, middleware, metadata, loading and error pages, or nested routes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/saajunaid/caddis-plugin/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 saajunaid/caddis-plugin --skill nextjs-app-router
Clone the repo
git clone --depth 1 https://github.com/saajunaid/caddis-plugin

Made for: Claude Code, Codex.

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/saajunaid/caddis-plugin/nextjs-app-router/github.svg)](https://agentmods.dev/skills/saajunaid/caddis-plugin/nextjs-app-router)
Your own site
<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/nextjs-app-router"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/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/saajunaid/caddis-plugin/nextjs-app-router"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/nextjs-app-router.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,257 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.
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.00049 $0.02257
Opus 5.5 $0.00020 $0.00903
Sonnet 5.5 $0.00010 $0.00451
Haiku 4.5 $0.00005 $0.00226

Measured 2mo ago against content hash 1dbe9da8a279, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.

.github/skills/frontend/nextjs-app-router/SKILL.md · 272 lines

How it starts

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

Next.js App Router Skill

Covers Next.js 13+ App Router conventions. Companion to react-dev (typing) and react-best-practices (patterns). Always read those for React-level decisions.

1. File Conventions

app/
├── layout.tsx          # Root shell — fonts, providers, global nav. Always present.
├── page.tsx            # Default route segment UI
├── loading.tsx         # Suspense boundary UI while segment loads
├── error.tsx           # Error boundary ('use client' required)
├── not-found.tsx       # 404 for segment
├── template.tsx        # Re-mounts on navigation (vs layout which persists)
├── (marketing)/        # Route group — no URL segment, just org
│   ├── about/page.tsx
│   └── pricing/page.tsx
├── dashboard/
│   ├── layout.tsx      # Nested layout (persists across dashboard routes)
│   └── settings/page.tsx
└── api/
    └── webhook/route.ts  # Route handler

Key Rules

  • error.tsx must be 'use client' — React error boundaries require it.
  • loading.tsx wraps the segment's page.tsx in <Suspense> automatically.
  • template.tsx re-mounts children on every navigation; use only when fresh mount is needed.
  • Route groups (group) do not affect URL paths — use for layout isolation or code organisation.

2. Server vs Client Components — Decision Tree

Does this component need:
  - useState / useReducer?           → 'use client'
  - useEffect?                       → 'use client'
  - Browser APIs (window, document)? → 'use client'
  - Event listeners?                 → 'use client'
  - Framer Motion / animation libs?  → 'use client'
  - Third-party client-side context? → 'use client'
  Otherwise:                         → Server Component (default)

Composition Pattern

// ✅ GOOD: Push 'use client' to the leaf
// app/dashboard/page.tsx — Server Component
import { InteractiveChart } from './interactive-chart'

export default async function DashboardPage() {
  const data = await fetchData()  // Direct async/await — no useEffect needed
  return <InteractiveChart initialData={data} />
}

// interactive-chart.tsx
'use client'
export function InteractiveChart({ initialData }: { initialData: Data }) {
  const [filter, setFilter] = useState('all')
  // ...
}

Read the full file on GitHub · 272 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. 2mo ago Changed · -34 tokens per session 1dbe9da8a279
  2. 2mo ago First seen · 272 lines · 83 tokens per session scan A 0ac6edbf8635

Subscribe to this mod's changes

nextjs-app-router is a skill published in the GitHub repository saajunaid/caddis-plugin (0 stars, last pushed 3d ago), licensed MIT. It adds 49 tokens to every session and 2,257 once invoked, about $0.0002 per session on Opus 5.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-09-03.

Related

nextjs-app-router compared with skills from other repositories

nextjs-app-router next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nextjs-app-routersaajunaid/caddis-pluginSkill03d agoMITA49Claude Code, Codex
rn-best-practicesLykhoyda/rn-dev-agentSkill201mo agoMITA98Claude Code
rn-feature-devLykhoyda/rn-dev-agentSkill201mo agoMITA34Claude Code, Codex
vercel-composition-patternsLykhoyda/rn-dev-agentSkill201mo agoMITA58Claude Code, Codex
vercel-react-best-practicesLykhoyda/rn-dev-agentSkill201mo agoMITA67Claude Code, Codex
agent-spec-mobile-react-nativeruvnet/rufloSkill83ktodayMITA22Claude Code
canvas-webappBlackBeltTechnology/pi-agent-dashboardSkill357todayMITA99Claude Code, Codex