Next.js App Patterns

Next.js App Patterns is a skill for Claude Code, Codex from AmariahAK/atlarix-skills. It costs 4 tokens per session (1,385 once invoked), scanned A, original, Apache-2.0.

A set of guidelines for Next.js applications using the App Router. Next.js is a React framework; the guidelines explain which code runs on the server or in the browser, how to fetch data, and how to avoid hydration bugs.

In plain words
What is it for?
Use it when building or reviewing Next.js routes, layouts, server and client components, data fetching, and deployments.
Why use it?
It helps prevent secrets or server work from reaching the browser, oversized browser code, and mismatches between server-rendered and browser-rendered pages.

Skill for Claude CodeCodex

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

Good fit Use it when building or reviewing Next.js routes, layouts, server and client components, data fetching, and deployments.

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

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 Next.js App Patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/amariahak/atlarix-skills/nextjs/github.svg)](https://agentmods.dev/skills/amariahak/atlarix-skills/nextjs)
Your own site
<a href="https://agentmods.dev/skills/amariahak/atlarix-skills/nextjs"><img src="https://agentmods.dev/badge/skills/amariahak/atlarix-skills/nextjs/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 Next.js App Patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/amariahak/atlarix-skills/nextjs"><img src="https://agentmods.dev/badge/skills/amariahak/atlarix-skills/nextjs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,385 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.00004 $0.01385
Opus 5 $0.00002 $0.00692
Sonnet 5 $0.00001 $0.00277
Haiku 4.5 $0.00000 $0.00138

Measured 7d ago against content hash 0ab77ade2398, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

Next.js App Patterns 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 7d 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.

skills/nextjs/SKILL.md · 163 lines

How it starts

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

Next.js App Patterns (App Router)

When to use this skill

Use this skill when working in a Next.js App Router codebase (Next.js 14+) and you need safe patterns for server vs client components, data fetching, routing, and deployment without introducing hydration bugs or accidental client bundles.

Core patterns

Decision tree: Server vs Client component

Rule: start server, add "use client" only when needed.

Use a Server Component when you:

  • fetch data (DB/API) and can render on the server
  • need to keep secrets on the server
  • want smaller client bundles

Use a Client Component when you:

  • use React state/effects (useState, useEffect, useRef)
  • attach event handlers (onClick, onChange)
  • use browser-only APIs (window, localStorage)
  • use client-only libs (most UI animation libs, some charts)

Pattern:

  • page.tsx / layout.tsx typically server
  • interactive leaf components client

Data fetching patterns

Prefer server fetching:

  • Fetch in Server Components with fetch() (or a server SDK)
  • Use cache, revalidate, and route segment config intentionally

Client fetching (when needed):

  • Use SWR/React Query for interactive UIs that need refetching
  • Keep request boundaries small; avoid fetching “entire page” on client

Route Handlers vs Server Actions

Use Route Handlers (app/api/.../route.ts) when:

  • you need an API surface for multiple clients
  • you need webhooks
  • you need fine control over HTTP (status, headers)

Use Server Actions when:

  • the action is primarily triggered from your UI
  • you want type-safe form submissions and simpler wiring

Avoid:

  • putting business logic directly in route handlers; call shared services

Example: route handler boundary:

// app/api/health/route.ts
import { NextResponse } from "next/server";

export async function GET() {
  return NextResponse.json({ ok: true });
}

Example: server action boundary:

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

export async function updateProfile(_formData: FormData) {
  // validate input, call server service, redirect or return structured result
}

Read the full file on GitHub · 163 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. 7d ago First seen · 163 lines · 4 tokens per session scan A 0ab77ade2398

Subscribe to this mod's changes

Next.js App Patterns is a skill published in the GitHub repository AmariahAK/atlarix-skills (2 stars, last pushed 3d ago), licensed Apache-2.0. It adds 4 tokens to every session and 1,385 once invoked, about $0.0000 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-09-03.

Related

Other skills, from other repositories

nextjs-patterns

Next.js App Router — Server Components, Actions, streaming, caching. Use when building or migrating Next.js apps.

martineserios/thebrana · 28 tokens

nextjs-expert

Expert knowledge in Next.js framework, Server-Side Rendering, Static Site Generation, App Router, Server Components, and full-stack React applications. Use when the user mentions React, SSR, SSG, the App Router, React Server Components, or full stack, or when the task involves Next.js Fundamentals, App Router…

personamanagmentlayer/pcl · 77 tokens

react-best-practices

React development guidelines with hooks, component patterns, state management, and performance optimization.

myths-labs/muse · 22 tokens

nextjs-docs

Use this skill whenever the user asks about Next.js, React full-stack development, App Router, Server Components, or building web applications with Next.js. This skill covers Next.js 16.2.7 with React 19.2, App Router, Cache Components, Turbopack, and all modern patterns. Use it for code generation, architecture…

pledgeandgrow/pledge-skills · 138 tokens

fe-build

Implements frontend components and pages for React / Next.js / Vite SPA + TypeScript projects. Use when: starting implementation after feature.md or a spec is approved, writing components, building pages. Do NOT load for: writing specs, code review, bug analysis.

sh5623/fe-rail · 57 tokens

fullstack-engineer

Consolidated web engineering skill combining backend and frontend development. Implements backend services, APIs, business logic, and web frontends (React/Next.js). Includes clean architecture, TDD, error handling, and state management patterns. Combines: software-engineer + frontend-engineer.

buiphucminhtam/forgewright · 62 tokens