nextjs-patterns

nextjs-patterns is a skill for Claude Code, Codex from chandrudp29/skillhub. It costs 30 tokens per session (1,019 once invoked), scanned A, original, MIT.

A set of recommended patterns for building and reviewing Next.js 14 or newer web applications with the App Router, which organizes pages and layouts as files.

In plain words
What is it for?
Use it when structuring routes and components, fetching and caching data, handling errors and loading states, validating inputs, or preparing a Next.js app for deployment.
Why use it?
It reduces common mistakes around server-side code, browser-side code, data loading, navigation, images, validation, and deployment.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Use it when structuring routes and components, fetching and caching data, handling errors and loading states, validating inputs, or preparing a Next.js app for deployment.

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

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-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/chandrudp29/skillhub/nextjs-patterns/github.svg)](https://agentmods.dev/skills/chandrudp29/skillhub/nextjs-patterns)
Your own site
<a href="https://agentmods.dev/skills/chandrudp29/skillhub/nextjs-patterns"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/nextjs-patterns/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-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/chandrudp29/skillhub/nextjs-patterns"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/nextjs-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,019 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.00030 $0.01019
Opus 5.5 $0.00012 $0.00408
Sonnet 5.5 $0.00006 $0.00204
Haiku 4.5 $0.00003 $0.00102

Measured 1mo ago against content hash 4024a13e2104, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nextjs-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 1mo 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-patterns/SKILL.md · 126 lines

How it starts

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

When to Use

Apply when building or reviewing Next.js 14+ applications using the App Router. Covers everything from component architecture to deployment.

Core Rules

  • Default to Server Components — add 'use client' only when you need interactivity, browser APIs, or React hooks
  • Never fetch in Client Components unless it's a user-triggered action — data belongs on the server
  • Co-locate page files: page.tsx, layout.tsx, loading.tsx, error.tsx in the same folder
  • Use next/image for every image — never a bare <img> tag
  • Use next/link for navigation — never <a href>
  • Validate all route params and search params with Zod before use

App Router Architecture

app/
  layout.tsx           # root layout (html, body)
  page.tsx             # homepage
  (auth)/              # route group — no URL segment
    login/page.tsx
    register/page.tsx
  dashboard/
    layout.tsx         # nested layout — sidebar, nav
    page.tsx           # /dashboard
    [id]/
      page.tsx         # /dashboard/123
      loading.tsx      # streaming skeleton
      error.tsx        # error boundary
  api/
    users/route.ts     # API route handler

Server vs Client Components

// Server Component (default) — runs on server, has async, no hooks
async function UserProfile({ userId }: { userId: string }) {
  const user = await db.user.findUnique({ where: { id: userId } });
  return <div>{user?.name}</div>;
}

// Client Component — interactive, uses hooks, browser APIs
'use client';
function LikeButton({ postId }: { postId: string }) {
  const [liked, setLiked] = useState(false);
  return <button onClick={() => setLiked(l => !l)}>{liked ? '❤️' : '🤍'}</button>;
}

Data Fetching & Caching

// Server Component data fetching
async function Posts() {
  // Cached by default, revalidates every 60s
  const posts = await fetch('https://api.example.com/posts', {
    next: { revalidate: 60 }
  }).then(r => r.json());

  // Or: no cache for real-time data
  const live = await fetch('...', { cache: 'no-store' });
}

// Server Actions for mutations
'use server';
async function createPost(formData: FormData) {
  const title = formData.get('title') as string;
  await db.post.create({ data: { title } });
  revalidatePath('/posts');
}

Read the full file on GitHub · 126 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. 1mo ago First seen · 126 lines · 30 tokens per session scan A 4024a13e2104

Subscribe to this mod's changes

nextjs-patterns is a skill published in the GitHub repository chandrudp29/skillhub (14 stars, last pushed 3mo ago), licensed MIT. It adds 30 tokens to every session and 1,019 once invoked, about $0.0001 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-08-30.

Related

Other skills, from other repositories

nextjs

Use when building, reviewing, testing, securing, or optimizing a Next.js App Router app: Server vs Client boundaries, use server actions, route handlers, the v15 vs v16 use cache caching model, metadata/SEO, auth, and Core Web Vitals. NOT framework-agnostic React or a Vite SPA (that is react), and NOT visual/UI design…

ericrisco/rsc-harness · 90 tokens

react-expert

Expert-level React development with hooks, performance optimization, state management, and modern patterns. Use when the user mentions frontend, hooks, JSX, TypeScript, or Next.js, or when the task involves Modern React, State Management, Forms, or Performance Optimization.

personamanagmentlayer/pcl · 56 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

next-application-structure

Establishes or reviews directory layout, server/client boundaries, routing, data-fetching strategy, and testing structure for Next.js 14+ App Router TypeScript applications. Invoked when the user asks to structure a Next app, set App Router conventions, or review architecture for React parity.

soulcodex/agentic · 64 tokens

nextjs-agent-first

Next.js 16.3+ agent-first features: AGENTS.md, first-party Skills, agent-browser React introspection, actionable errors. Use when building Next.js apps with AI coding agents.

S3YED/appie-kit · 44 tokens

c-browser

Headless browser automation — navigate pages, click elements, fill forms, take screenshots, scrape content using agent-browser or playwright-cli.

daxaur/openpaw · 29 tokens