next-cache-components-adoption

next-cache-components-adoption is a skill for Claude Code, Codex from sanity-io/next-sanity. It costs 95 tokens per session (7,324 once invoked), scanned A, a copy of next-cache-components-adoption, MIT.

A guide for enabling Cache Components in a Next.js application and fixing the route errors that appear during the change.

In plain words
What is it for?
Use it to turn on Cache Components, migrate routes, apply the required caching and loading patterns, and resolve blocking prerender or validation errors.
Why use it?
It provides a path through the build and validation problems caused by adopting this caching and prerendering feature. It applies to Next.js App Router applications, not projects using only the older Pages Router.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; installed under .agents/ (shared by several agents); mentions AGENTS.md.

Good fit Use it to turn on Cache Components, migrate routes, apply the required caching and loading patterns, and resolve blocking prerender or validation errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sanity-io/next-sanity/next-cache-components-adoption
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 sanity-io/next-sanity --skill next-cache-components-adoption
Clone the repo
git clone --depth 1 https://github.com/sanity-io/next-sanity

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sanity-io/next-sanity/next-cache-components-adoption"><img src="https://agentmods.dev/badge/skills/sanity-io/next-sanity/next-cache-components-adoption.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,324 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.
Origin 92% copy Near-identical to another mod 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.00095 $0.07324
Opus 5 $0.00048 $0.03662
Sonnet 5 $0.00019 $0.01465
Haiku 4.5 $0.00010 $0.00732

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

Security

Grade A, and why

next-cache-components-adoption 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.

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

This is a copy

92% identical to next-cache-components-adoption — 60 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/next-cache-components-adoption/SKILL.md · 240 lines

How it starts

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

next-cache-components-adoption

Enable Cache Components on an app and walk it to a passing build. This skill sequences the work; per-error recipes live in the dev overlay fix cards and the build's terminal output. The migrating to Cache Components guide is the canonical reference for the concepts and per-API recipes this skill applies — consult it whenever the skill steps reference a pattern ("use cache", cacheLife, <Suspense> placement, etc.) and you want the full explanation.

requires

  • App Router project. Cache Components is an App Router feature; cacheComponents: true does nothing for pages/ routes. If the project has a pages/ or src/pages/ tree but no app/ or src/app/ tree, stop and tell the user — Pages → App migration is its own project, not part of this skill. A hybrid app (both pages/ and app/) is fine: the flag affects the app/ routes; pages/ routes are unaffected and don't need opt-outs.

  • A resolved app directory. Locate next.config.{js,ts,mjs,cjs} first: that's the project root, and an agent invoked from a subdirectory would otherwise test for app/ against the wrong cwd and find nothing. Look for app/ and src/app/ under it, and treat every command and glob in this skill as relative to whichever one exists. If both exist, Next.js builds app/ and never looks at src/app/, so its routes are shadowed and unbuilt — tell the user that and ask which tree to migrate instead of picking one.

  • A runnable app. The whole loop verifies against next dev and a browser, so the app has to boot. If it reads a database or required env at import (e.g. an env.ts that throws on a missing DATABASE_URL), confirm it actually starts — with the real environment, or local data you stand up — before step 1. Adoption can't be verified against an app that won't run.

  • Next.js 16.3 or later. That release is where the pieces this skill relies on land: top-level cacheComponents, export const instant, the dev-overlay instant-navigation validation warnings, and the cache-components-instant-false codemod. If next --version reports below 16.3, upgrade first:

    • npx @next/codemod@latest upgrade latest to apply the version-to-version codemods.
    • Read the relevant version upgrade guide (e.g. Version 16) for what the codemod doesn't cover.

Read the full file on GitHub · 240 lines

Files

What ships with it

2 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. 11d ago First seen · 240 lines · 95 tokens per session scan A e0571079c1c8

Subscribe to this mod's changes

next-cache-components-adoption is a skill published in the GitHub repository sanity-io/next-sanity (951 stars, last pushed today), licensed MIT. It adds 95 tokens to every session and 7,324 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to next-cache-components-adoption, differing in 60 lines, and is treated as a copy.

Related

Other skills, from other repositories

new-block

Scaffold a new page builder block for Turbo Start Sanity end-to-end — Sanity schema, GROQ projection, styled React component, Markdown serializer, tests, and all registrations. Use when asked to add, create, or scaffold a new page builder block, section, or content module (e.g. "add a testimonials block", "create a…

robotostudio/turbo-start-sanity · 83 tokens

next-cache-components

Next.js 16 Cache Components - PPR, use cache directive, cacheLife, cacheTag, updateTag.

robotostudio/turbo-start-sanity · 26 tokens

sanity-live-cache-components

Integrates Sanity Live with Next.js Cache Components in next-sanity v13+ apps. Sets up sanityFetch, , Visual Editing, Presentation Tool, draft mode handling, and the three-layer (Page/Dynamic/Cached) component pattern with explicit perspective/stega prop-drilling. Use when configuring or migrating a Next.js app to…

robotostudio/turbo-start-sanity · 110 tokens

create-example

Create a new Liveblocks example app for the gallery under examples/. Use when asked to build a new example, demo, or showcase app, or when restructuring an existing example. Covers scaffolding, gallery conventions (exampleId, examplePreview, database.ts, HelpButton), providers configuration, AI patterns, styling…

liveblocks/liveblocks · 77 tokens

vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

robotostudio/turbo-start-sanity · 58 tokens

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance…

robotostudio/turbo-start-sanity · 67 tokens