dev-nextjs

dev-nextjs is a skill for Claude Code from christopherlouet/claude-base. It costs 50 tokens per session (2,527 once invoked), scanned A, original, MIT.

A guide to developing Next.js applications with the App Router, server-rendered components, server actions, caching, streaming, and middleware.

In plain words
What is it for?
Use it when working in the app folder, creating routes, choosing between server and client components, handling requests, or configuring middleware.
Why use it?
It clarifies how Next.js's newer routing model works and helps prevent incorrect use of client-side code, routes, or data loading.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { createPost } from "../actions";.

Good fit Use it when working in the app folder, creating routes, choosing between server and client components, handling requests, or configuring middleware.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/christopherlouet/claude-base
agentmods
npx agentmods add skills/christopherlouet/claude-base/dev-nextjs

Made for: Claude Code.

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 dev-nextjs

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/christopherlouet/claude-base/dev-nextjs"><img src="https://agentmods.dev/badge/skills/christopherlouet/claude-base/dev-nextjs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,527 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00050 $0.02527
Opus 5.5 $0.00020 $0.01011
Sonnet 5.5 $0.00010 $0.00505
Haiku 4.5 $0.00005 $0.00253

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

Security

Grade A, and why

dev-nextjs scanned grade A with 1 finding 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 16d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const data = await fetch(url, { cache: "force-cache" });
.claude/skills/dev-nextjs/SKILL.md · 320 lines

How it starts

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

Next.js App Router

App Router vs Pages Router

App Router (default since Next 13, stable): app/ folder, Server Components by default, Server Actions, streaming. Prefer for any new project.

Pages Router: pages/ folder, getServerSideProps/getStaticProps. Legacy, do not add new routes there.

If the project has both, coexist — both can live together, but do not duplicate a route.

Server Components by default

Any component in app/ is a Server Component by default. It runs on the server, zero client JS.

// app/posts/page.tsx — Server Component (default)
export default async function PostsPage() {
  const posts = await db.posts.findMany();  // Direct SQL OK
  return <PostList posts={posts} />;
}

Switch to Client Component with "use client"

// app/components/SearchBox.tsx
"use client";  // Directive at the top of the file

import { useState } from "react";

export function SearchBox() {
  const [query, setQuery] = useState("");
  return <input value={query} onChange={(e) => setQuery(e.target.value)} />;
}

Rule: "use client" only if you need hooks (useState, useEffect) or browser events (onClick, onChange). Otherwise, stay Server Component.

Server/Client composition

Server Components can import Client Components, but the reverse is not allowed (except via children props).

// OK: Server Component uses a Client Component
export default async function Page() {
  const data = await fetch(...);
  return <ClientChart data={data} />;  // ClientChart is "use client"
}

// OK: Client Component receives a Server Component via children
"use client";
export function Layout({ children }: { children: React.ReactNode }) {
  return <div>{children}</div>;  // children can be a RSC
}

Data Fetching

Native fetch() with Next.js cache

// Forced cache (SSG-like, manual revalidation)
const data = await fetch(url, { cache: "force-cache" });

// No cache (SSR on every request)
const data = await fetch(url, { cache: "no-store" });

// Time-based revalidation (ISR)
const data = await fetch(url, { next: { revalidate: 60 } });

// Tag-based revalidation
const data = await fetch(url, { next: { tags: ["posts"] } });
// Then in a Server Action: revalidateTag("posts")

Read the full file on GitHub · 320 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. 16d ago Changed · +8 lines 0e0da88f8d9b
  2. 23d ago Changed · -2 lines 3c3f62a216af
  3. 24d ago Changed · -6 lines 676353d23a48
  4. 24d ago Changed · -1 lines 6945823f6efd
  5. 1mo ago First seen · 321 lines · 50 tokens per session scan A 5fa99cc62922

Subscribe to this mod's changes

dev-nextjs is a skill published in the GitHub repository christopherlouet/claude-base (5 stars, last pushed 2d ago), licensed MIT. It adds 50 tokens to every session and 2,527 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). 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