nextjs-cache-architecture

nextjs-cache-architecture is a skill for Claude Code from mohamed-hossam1/nextjs-skills. It costs 127 tokens per session (2,954 once invoked), scanned A, original, MIT.

A design and implementation guide for caching in Next.js 16 or newer applications that use the App Router. It covers cached data, cache tags, invalidation, and loading boundaries.

In plain words
What is it for?
Use it to plan or build caching, cache invalidation, partial prerendering, or personalized content in a Next.js project.
Why use it?
It helps keep cached pages and data fast without leaving users with outdated information or mixing personal data into shared caches.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to plan or build caching, cache invalidation, partial prerendering, or personalized content in a Next.js project.

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

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 nextjs-cache-architecture

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohamed-hossam1/nextjs-skills/nextjs-cache-architecture"><img src="https://agentmods.dev/badge/skills/mohamed-hossam1/nextjs-skills/nextjs-cache-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 127 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,954 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. Third-party audits
  • Socket pass 13 Jun 2026
  • Snyk pass 13 Jun 2026
How audits are shown
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.00127 $0.02954
Opus 5 $0.00063 $0.01477
Sonnet 5 $0.00025 $0.00591
Haiku 4.5 $0.00013 $0.00295

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

Security

Grade A, and why

nextjs-cache-architecture 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 11d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (assets/revalidate.ts, assets/tags.ts, scripts/audit.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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-cache-architecture/SKILL.md · 370 lines

How it starts

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

Next.js Cache Architecture

Architect caching in a Next.js 16+ App Router project from day one — not just dropping "use cache" where it happens to fit, but structuring the tag registry, revalidation utilities, Suspense boundaries, and mutation wiring so the cache stays correct as the codebase grows.

How to use this skill

Apply every rule and template below to the user's actual project. Replace placeholders like [Entity] and [collection] with names from their codebase before writing any code.

$ARGUMENTS

Where to look next

Most implementations only need this file. Load a reference when the task calls for it.

If the user is... Read
Asking how cache keys are derived, what cacheLife profiles mean, or hitting a "use cache" limitation references/core-concepts.md
Caching anything that depends on a logged-in user references/personalized-content.md
Reporting stale data, or doing a final review pass references/debugging-and-checklist.md
Migrating an existing codebase off unstable_cache references/migration-from-unstable-cache.md

Drop-in templates in assets/ (rename placeholders to match the user's codebase):

  • assets/tags.tslib/cache/tags.ts
  • assets/revalidate.tslib/cache/revalidate.ts
  • assets/SuspenseOnSearchParams.tsxcomponents/SuspenseOnSearchParams.tsx

The architecture in one breath

A correct cache implementation has three load-bearing pieces. Build all three on day one — adding them later is much harder than getting them right up front.

Read the full file on GitHub · 370 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. 11d ago First seen · 370 lines · 127 tokens per session scan A f324b456a36c

Subscribe to this mod's changes

nextjs-cache-architecture is a skill published in the GitHub repository mohamed-hossam1/nextjs-skills (8 stars, last pushed 3mo ago), licensed MIT. It adds 127 tokens to every session and 2,954 once invoked, about $0.0006 per session on Opus 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-31.