nextjs-framework

nextjs-framework is a skill for Claude Code, Codex from monkilabs/opencastle. It costs 47 tokens per session (765 once invoked), scanned A, original, MIT.

A guide for building web applications with Next.js, a JavaScript framework for websites and web services. It covers the App Router, server and browser-based components, data fetching, and route protection.

In plain words
What is it for?
Use it to add protected routes, migrate to the App Router, improve data loading, and fix browser/server rendering problems.
Why use it?
It helps prevent common Next.js build, rendering, loading, and authentication mistakes. It also explains which patterns belong to the newer App Router instead of the older Pages Router.

Skill for Claude CodeCodex

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

Good fit Use it to add protected routes, migrate to the App Router, improve data loading, and fix browser/server rendering problems.

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/monkilabs/opencastle/nextjs-framework"><img src="https://agentmods.dev/badge/skills/monkilabs/opencastle/nextjs-framework.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 765 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.00047 $0.00765
Opus 5.5 $0.00019 $0.00306
Sonnet 5.5 $0.00009 $0.00153
Haiku 4.5 $0.00005 $0.00076

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

Security

Grade A, and why

nextjs-framework 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 23d 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.

Tag with `fetch(url, { next: { tags: ['posts'] } })` (or `cacheTag`), invalidate from a Server Action with `revalidateTag` / `revalidatePath('/posts')`.
src/orchestrator/plugins/nextjs/skills/nextjs-framework/SKILL.md · 43 lines

How it starts

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

Next.js Framework

Check the next version in package.json first: caching and the request-interception file changed in 15 and 16.

The integration configures next-devtools-mcp (MCP server next-devtools). With the dev server running it reports build and runtime errors, logs, and route and page metadata — read those before guessing at a failure.

Critical rule

Never use next/dynamic with { ssr: false } inside a Server Component — it crashes at build/runtime. Extract it into a 'use client' wrapper and import that from the server normally.

// components/MapClient.tsx
'use client';
import dynamic from 'next/dynamic';
const Map = dynamic(() => import('./Map'), { ssr: false });
export function MapClient(props: MapProps) { return <Map {...props} />; }

Gotchas

  • error.tsx must be a Client Component, and needs to exist per segment — otherwise an unhandled error takes down the page. template.tsx re-mounts on navigation where layout.tsx persists. default.tsx is the parallel-route fallback.
  • Independent fetches awaited in sequence become a waterfall — use Promise.all(). Fetching in useEffect where a Server Component could fetch costs an extra roundtrip plus a loading flash.
  • getServerSideProps / getStaticProps are Pages Router only; App Router uses async Server Components.
  • 15+: params, searchParams, cookies() and headers() are async — await them.
  • Auth: check the session at the top of an async Server Component and redirect('/login') before returning any UI. Request interception with matcher: ['/dashboard/:path*'] covers whole subtrees: middleware.ts up to 15, proxy.ts (exporting proxy) from 16.
  • Dynamic segments: [slug], catch-all [...slug], optional catch-all [[...slug]].
  • Put providers in a Providers Client Component rather than growing layout.tsx; 'use client' on everything defeats RSC.

Caching, by version

  • 14 and earlier: fetch is cached by default (opt out with cache: 'no-store'), GET Route Handlers are static by default.
  • 15: nothing is cached unless you ask. fetch, GET Route Handlers and client navigations are uncached by default; opt in with cache: 'force-cache', export const dynamic = 'force-static', or staleTimes.
  • 16: the 15 defaults, plus Cache Components (cacheComponents: true): opt in with "use cache" on a function or component, cacheLife() for lifetime and cacheTag() for tags. revalidateTag(tag, profile) takes a cacheLife profile (e.g. 'max') and serves stale while it refreshes; updateTag(tag), Server Actions only, expires the tag so the user reads their own write.

Read the full file on GitHub · 43 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. 23d ago Changed · +7 lines · -10 tokens per session d2020e8da95e
  2. 24d ago First seen · 36 lines · 57 tokens per session scan A c3b4832002cf

Subscribe to this mod's changes

nextjs-framework is a skill published in the GitHub repository monkilabs/opencastle (80 stars, last pushed 7d ago), licensed MIT. It adds 47 tokens to every session and 765 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-10-04.

Related

Other skills, from other repositories

product-architect

Complete product development system with 80 agents and 36 frameworks. Use when the user wants to build a product, write a PRD, plan an MVP or roadmap, design an app, research a market or check whether a feature already exists or is novel, do competitive analysis, run a security audit, build a financial model, plan…

ankitjha67/product-architect · 253 tokens

cursor-prompting

Internal guidance for composing cursor-agent prompts and picking models for coding, review, diagnosis, and research tasks inside the Cursor Claude Code plugin.

zebbern/agent-collab · 31 tokens

goal-runner

Use when the user asks to advance, continue, or work on the project's long-horizon goal (or to set one up) — the policy for goal-driven increments driven through the goal companion, one increment at a time, delegated via the codex/cursor delegation skills, honestly recorded.

zebbern/agent-collab · 62 tokens

cursor-result-handling

Internal guidance for presenting Cursor helper output back to the user.

zebbern/agent-collab · 16 tokens

jira-ticket-builder

Turns rough input into structured Jira work. Two modes — single-ticket mode turns a bug description, meeting notes, Slack thread, incident writeup, or a few sentences into one fully-structured Jira ticket; decomposition mode turns a rough requirements doc or product brief with multiple asks and open questions into…

kirti/jira-ticket-builder-skill · 213 tokens

agentflow

Expert guidance for building, debugging, and extending applications with AgentFlow (10xscale-agentflow). Use when code imports from agentflow (e.g. from agentflow import, StateGraph, Agent, ToolNode, AgentState); when the user references agentflow.json or CLI commands (agentflow init, agentflow api, agentflow play…

10xHub/agentflow-cli · 149 tokens