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.
npx skills add chandrudp29/skillhub --skill nextjs-patternsgit clone --depth 1 https://github.com/chandrudp29/skillhubWrote 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.
[](https://agentmods.dev/skills/chandrudp29/skillhub/nextjs-patterns)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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
fetchin 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.tsxin the same folder - Use
next/imagefor every image — never a bare<img>tag - Use
next/linkfor 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');
}
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.
- 1mo ago First seen · 126 lines · 30 tokens per session scan A 4024a13e2104
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.
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…
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.
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…
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.
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.
c-browser
Headless browser automation — navigate pages, click elements, fill forms, take screenshots, scrape content using agent-browser or playwright-cli.