sanity-live-cache-components
Skill by sanity-io
Integrates Sanity Live with Next.js Cache Components in next-sanity v13+ apps. Covers sanityFetch, SanityLive, Visual Editing, draft mode and the three-layer component pattern for Next.js 16.2+ projects.
Install sanity-live-cache-components
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sanity-io/sanity-template-nextjs-clean /tmp/sanity-template-nextjs-clean && mkdir -p ~/.claude/skills && cp -r /tmp/sanity-template-nextjs-clean/.agents/skills/sanity-live-cache-components ~/.claude/skills/sanity-live-cache-componentsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install sanity-live-cache-components in Claude Code
git clone --depth 1 https://github.com/sanity-io/sanity-template-nextjs-clean /tmp/sanity-template-nextjs-clean && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/sanity-template-nextjs-clean/.agents/skills/sanity-live-cache-components ~/.gemini/antigravity-cli/skills/sanity-live-cache-componentsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install sanity-live-cache-components in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill wires next-sanity into a Next.js 16.2 or later app that has cacheComponents enabled. It covers sanityFetch, the SanityLive component in the root layout, and Visual Editing and Presentation Tool when draft mode is on. It also covers draft mode handling and the three-layer Page, Dynamic and Cached component pattern with explicit perspective and stega props.
Data is fetched with sanityFetch, which calls cacheTag and cacheLife internally. SanityLive revalidates cached content over an EventSource connection to the Sanity Content Lake. The skill also explains how to migrate an existing defineLive setup and lists search patterns for auditing anti-patterns. It is aimed at developers configuring or migrating a Next.js app to cacheComponents with Sanity. It assumes familiarity with the next-cache-components skill.
Written from the project's SKILL.md and checked against it.
What it can do
- sanityFetch setupSets up sanityFetch with defineLive in live.ts and client.ts.
- SanityLive in root layoutRenders SanityLive once in a root layout with includeDrafts set to draft mode.
- Visual EditingWires VisualEditing into the root layout when draft mode is enabled.
- Presentation Tool supportCovers Presentation Tool when draft mode is enabled.
- Draft mode handlingHandles draft mode, including await draftMode() inside use cache.
- Three-layer patternApplies the Page, Dynamic and Cached component pattern to pages and layouts.
- Dynamic segment guidanceCovers loading.tsx and partial generateStaticParams for dynamic routes.
- Migration from defineLiveRefactors hardcoded perspective and stega settings in an existing setup.
What you need
- Next.js 16.2 or later
- next-sanity v13 or later
- NEXT_PUBLIC_SANITY_PROJECT_ID environment variable
- NEXT_PUBLIC_SANITY_DATASET environment variable
- SANITY_API_READ_TOKEN environment variable
Try asking
- Set up sanityFetch and SanityLive in my Next.js app with cacheComponents
- Refactor my sanityFetch calls to use the three-layer pattern
- Audit my codebase for hardcoded perspective and stega settings
Good to know
- Assumes familiarity with the next-cache-components skill
- Only the Cached layer carries use cache, not the top-level page or layout
- Rendering SanityLive or VisualEditing more than once is undefined behavior
- Covers only the Next.js app, not embedded Sanity Studio configuration
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/sanity-live-cache-components/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to sanity-live-cache-components
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
sanity-live-cache-components: common questions
Does this work with Next.js versions before 16.2?
The source says the project should have Next.js 16.2 or later installed. It also says the skill targets Next.js 16+ apps with cacheComponents enabled.
Do I need to change my Sanity Studio configuration?
No. The source says embedded Sanity Studio configuration needs no changes, since the skill only touches the Next.js app surface.
Where does SanityLive go in the app?
The source says SanityLive and VisualEditing belong in a layout.tsx, never a page.tsx. If an embedded studio is present, it should sit in a layout the studio does not share, using route groups.
How do I install sanity-live-cache-components?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is sanity-live-cache-components free?
The code is public, but no licence file was found, so check the repository before commercial use.
Is sanity-live-cache-components safe to use?
It scores 78 of 100. Grades: maintenance A, licence F, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to sanity-live-cache-components?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
