nextjs

A coding and review guide for modern Next.js applications, a React framework for building web applications. It covers the newer App Router, server-rendered components, server actions, data access, caching, and older Pages Router projects.

In plain words
What is it for?
Use it when writing or reviewing Next.js pages, layouts, forms, data loading, API routes, and components that use the App Router or Pages Router.
Why use it?
It helps developers choose the right server or browser-side boundary and avoid mixing rules from Next.js’s two routing systems.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/ndisisnd/cook/nextjs
Any agent
npx skills add ndisisnd/cook --skill nextjs
Clone the repo
git clone --depth 1 https://github.com/ndisisnd/cook

Made for: Claude Code, Codex.

Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,525 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00040 $0.02525
Opus 5 $0.00020 $0.01262
Sonnet 5 $0.00008 $0.00505
Haiku 4.5 $0.00004 $0.00252

Measured 2d ago against content hash fafb07edba04, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nextjs 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 2d 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.

standards/nextjs/SKILL.md · 179 lines

How it starts

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

Next.js

Invocation Protocol

When invoked directly as /nextjs, read this file first and apply the critical rules below before editing. Then read standards/nextjs/_INDEX.md and load only the additional refs/*.md entries whose file patterns or keywords match the task.

If both App Router and Pages Router signals appear, apply the Router Decision below before loading App Router-specific refs. For a Pages Router-only project, load refs/pages-router.md and treat App Router refs as informational unless the migration explicitly touches app/.

Router Decision

App Router is the default for new work. If the project uses pages/, treat App Router rules as informational and load refs/pages-router.md; do not apply app/ conventions, Server Components, or Server Actions to a Pages Router-only project.

P0 - Server & Client Components

  • App Router uses React Server Components by default. Keep pages and layouts as Server Components unless they need hooks, browser APIs, or event handlers.
  • Push 'use client' to interactive leaves such as buttons, forms, charts, and wrappers. Do not mark the tree root client-side.
  • Compose Server Components through Client Component children; never import a Server Component into a Client Component.
  • Server-to-Client props must be serializable: strings, numbers, booleans, plain objects, and arrays. Convert Date to strings and avoid functions, classes, Map, Set, and Symbol values except Server Actions marked 'use server'.
  • Never pass secrets, raw ORM models, or full DB objects to the client. Use DTOs and server-only for sensitive modules.
  • Avoid browser-only values (window, Date.now(), layout reads) in initial render; defer with a mounted state when needed.

Detail -> refs/server-components.md

P0 - Data Fetching & Access

  • Fetch directly in async Server Components or call DB/service/DAL functions directly. Never fetch your own /api route from RSCs or server-side hooks.
  • Pick cache behavior deliberately: cache: 'force-cache' for static data, next: { revalidate: N } for ISR, and cache: 'no-store' for request-time data.
  • Parallelize independent work with Promise.all() and push slow fetches down behind <Suspense> instead of blocking the page root.
  • Centralize secure data access in services/, lib/data.ts, or dal/ modules with import 'server-only'.
  • Verify auth inside every DAL function, transform raw DB/API data into DTOs, and wrap shared reads with React cache() where render-cycle deduplication is needed.
  • Use Server Actions or Route Handlers as bridges for Client Components; Client Components must not import DAL modules.

Read the full file on GitHub · 179 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. 2d ago First seen · 179 lines · 40 tokens per session scan A fafb07edba04

Subscribe to this mod's changes

nextjs is a skill published in the GitHub repository ndisisnd/cook (2 stars, last pushed 22d ago), licensed MIT. It adds 40 tokens to every session and 2,525 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-31.

Related

Other skills, from other repositories

moai-ref-react-patterns

React/Next.js component design patterns, state management strategies, and project structure reference for frontend development. Agent-extending skill that amplifies frontend domain work (spawned via Agent(general-purpose) with frontend instructions) with production-grade React patterns. NOT for: backend API design…

modu-ai/moai-adk · 72 tokens

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance…

CherryHQ/cherry-studio · 67 tokens

moai-domain-frontend

Frontend development specialist covering React 19, Next.js 16, Vue 3.5, and modern UI/UX patterns with component architecture. Use when building web UIs, implementing components, optimizing frontend performance, or integrating state management.

modu-ai/moai-adk · 54 tokens

frontend-patterns

React/TypeScript/xterm.js patterns for ClaudeTerminal frontend.

talayash/agentrium · 16 tokens

presentation

インタラクティブな React プレゼンテーションアーティファクトを作成する。キーボード操作によるスライド送り、サムネイル一覧、全画面表示、16:9 自動フィット対応。.

ishida-supsys/oretachi · 55 tokens

wireframe

インタラクティブな React ワイヤーフレームアーティファクトを作成する。エンティティバインディング表示(W コンポーネント)、画面遷移図(OverviewScreen)、デスクトップ全画面レイアウト対応。.

ishida-supsys/oretachi · 62 tokens