next-cache-components-optimizer

next-cache-components-optimizer is a skill for Claude Code from vercel/next.js. It costs 123 tokens per session (5,322 once invoked), scanned A, original, MIT.

A workflow for making a Next.js route load and navigate instantly, using Cache Components or Partial Prerendering and an automated end-to-end test.

In plain words
What is it for?
Use it to optimize individual routes for initial page loads and client-side navigation, then keep the result checked by a shipped test.
Why use it?
It turns a speed goal into a test that shows when the route is not instant, verifies the fix, and guards against later regressions.

Skill for Claude Code ✓ vendor

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

Part of the nextjs plugin — 6 skills shipped together

Good fit Use it to optimize individual routes for initial page loads and client-side navigation, then keep the result checked by a shipped test.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vercel/next.js/next-cache-components-optimizer
About the project

Next.js is a React framework for building applications that run across the browser and Node.js, including server-rendered applications. It is used by developers building web applications with React components.

vercel/next.js · 143,039 stars · on GitHub · nextjs.org

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 vercel/next.js --skill next-cache-components-optimizer
Clone the repo
git clone --depth 1 https://github.com/vercel/next.js

Made for: Claude Code.

Or install nextjs, the plugin that ships this one along with the rest of its 6 skills.

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 next-cache-components-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/vercel/next.js/next-cache-components-optimizer/github.svg)](https://agentmods.dev/skills/vercel/next.js/next-cache-components-optimizer)
Your own site
<a href="https://agentmods.dev/skills/vercel/next.js/next-cache-components-optimizer"><img src="https://agentmods.dev/badge/skills/vercel/next.js/next-cache-components-optimizer/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 next-cache-components-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/skills/vercel/next.js/next-cache-components-optimizer"><img src="https://agentmods.dev/badge/skills/vercel/next.js/next-cache-components-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 123 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,322 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
  • Snyk pass 7 Oct 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
  • Socket pass 7 Oct 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 148
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
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.00123 $0.05322
Opus 5.5 $0.00049 $0.02129
Sonnet 5.5 $0.00025 $0.01064
Haiku 4.5 $0.00012 $0.00532

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

Security

Grade A, and why

next-cache-components-optimizer 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 10d 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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

skills/next-cache-components-optimizer/SKILL.md · 427 lines

How it starts

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

next-cache-components-optimizer

Set up an agentic optimization loop that drives a Next.js route from "not instant" to "instant" and keeps it there. The loop is test-driven: encode the goal as a failing @next/playwright instant() test, work it to green, and ship the test as the regression guard. Run it once per target route and entry point. Work the phases P → G in order; each ends in a gate.

Before changing the route, read the bundled Optimizing the static shell guide at node_modules/next/dist/docs/01-app/02-guides/optimizing-the-static-shell.md. If it is unavailable, use the online guide. The guide owns the framework behavior and implementation patterns. This skill owns the navigation contract, production rig, trustworthy RED-to-GREEN loop, parity check, differential, and report.

What is invariant, and what is yours

One thing here is fixed. The rest is yours. Read this before treating any command, platform, or env var below as a requirement.

  • Invariant: the verification loop. Maximizing the shell is worthless unless you can prove it. The proof is an automated check: under a lock that gates dynamic data, the static shell still commits. RED shows the gap, GREEN shows it closed, the test ships as the regression guard. It must run on a production-like build and must not be able to pass vacuously. Stand the loop up once; every later optimization is then verifiable by construction. The loop is the deliverable, not any one route.
  • The mechanism: @next/playwright instant(). This skill uses instant() as a ruler, not a stopwatch (phase A). It comes from @next/playwright (installed alongside @playwright/test, on the same release line as next), so it isn't tied to any host. Keep it. Timing a navigation by hand is too flaky to trust, and is the failure mode this skill exists to prevent.
  • Yours: the rig. How you build, deploy, authenticate, configure Playwright, and loop belongs to your stack, not to this skill. A local next build && next start, a CI/staging container, and a per-push preview deploy are equally valid rigs; the verdict comes from the build, never the platform. Phase 0 maps the invariant onto your repo. Read every platform name, env-var spelling, and command below as an example to translate, not a requirement.

Read the full file on GitHub · 427 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago Changed · -56 lines · -47 tokens per session 3d0e8eb9d922
  2. 1mo ago Changed · +5 lines f6e9c8deff1a
  3. 1mo ago First seen · 478 lines · 170 tokens per session scan A 9b538b7f5824

Subscribe to this mod's changes

next-cache-components-optimizer is a skill published in the GitHub repository vercel/next.js (143,039 stars, last pushed today), licensed MIT. It adds 123 tokens to every session and 5,322 once invoked, about $0.0005 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.