nextjs-ssr-patterns

nextjs-ssr-patterns is a skill for Claude Code from lukasrepublic/agentic-foundry. It costs 0 tokens per session (1,866 once invoked), scanned A, original, MIT.

A set of instructions for building Next.js web applications, including how pages render, how routes are organized, and how search-engine metadata is handled.

In plain words
What is it for?
Implementing Next.js routes and pages, choosing between server-rendered, static, or periodically refreshed pages, adding metadata, and configuring sitemaps, robots.txt, or image handling.
Why use it?
It helps an agent choose an appropriate rendering method and follow the project's established Next.js structure.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the foundry plugin — 81 skills, 8 agents, 8 hooks, 1 MCP server shipped together

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/lukasrepublic/agentic-foundry/nextjs-ssr-patterns
Any agent
npx skills add lukasrepublic/agentic-foundry --skill nextjs-ssr-patterns
Clone the repo
git clone --depth 1 https://github.com/lukasrepublic/agentic-foundry

Made for: Claude Code.

Or install foundry, the plugin that ships this one along with the rest of its 81 skills, 8 agents, 8 hooks, 1 MCP server.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/nextjs-ssr-patterns.svg)](https://agentmods.dev/skills/lukasrepublic/agentic-foundry/nextjs-ssr-patterns)
Your own site
<a href="https://agentmods.dev/skills/lukasrepublic/agentic-foundry/nextjs-ssr-patterns"><img src="https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/nextjs-ssr-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,866 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.1 $0.00000 $0.01866
Opus 5 $0.00000 $0.00933
Sonnet 5 $0.00000 $0.00373
Haiku 4.5 $0.00000 $0.00187

Measured 5d ago against content hash c552543b3509, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

nextjs-ssr-patterns 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 5d 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.

- Static: `fetch(url, { cache: 'force-cache' })` or no fetch (build-time data).
packs/stack-profiles/node-web/blueprints/nextjs-ssr-patterns/SKILL.md · 87 lines

How it starts

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

When to trigger

  • Implementing a spec that names a Next.js web change.
  • Deciding between SSR, ISR, SSG, or static page for a new route and its SEO/caching implications.
  • Authoring a route handler (route.ts) or a server/client component.
  • Metadata API work (generateMetadata, metadata export) for SEO.
  • Sitemap or robots.txt authoring; next/image or image-optimization configuration.
  • Next.js version-bump impact assessment on App Router behavior.

Procedure

  1. Determine page type from the spec's requirements: static (no dynamic data at render time), ISR (revalidate on schedule), SSR (dynamic per-request), or dynamic segment (generateStaticParams + fallback). Default: ISR with revalidate set explicitly.

  2. Place the file under app/<route>/page.tsx in the web package per Next.js App Router file-system routing. Route groups use (group-name)/ prefix. Parallel routes use @slot prefix. Layout segments use layout.tsx. Follow the existing folder structure in the package's app/ directory before introducing new patterns.

  3. Decide server-component-default vs. client component: default to server component (no directive). Add 'use client' only when the component uses browser-only APIs, React state (useState, useReducer), or event listeners. Push the 'use client' boundary as low in the tree as possible — never at the page level if only a leaf needs interactivity.

  4. Data-fetching pattern:

    • Static: fetch(url, { cache: 'force-cache' }) or no fetch (build-time data).
    • ISR: fetch(url, { next: { revalidate: N } }) where N is seconds.
    • SSR (per-request dynamic): fetch(url, { cache: 'no-store' }) or noStore() import.
    • Never use getServerSideProps or getStaticProps (Pages Router idioms — App Router rejects these).
  5. Metadata API: for static routes export const metadata: Metadata = { title, description, openGraph }. For dynamic routes implement export async function generateMetadata({ params }): Promise<Metadata>. Every public-facing page MUST declare metadata; missing metadata is a build warning and an SEO failure.

Read the full file on GitHub · 87 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. 5d ago First seen · 87 lines · 0 tokens per session scan A c552543b3509

Subscribe to this mod's changes

nextjs-ssr-patterns is a skill published in the GitHub repository lukasrepublic/agentic-foundry (1 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,866 tokens. 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-08-31.