Assists with Sanity CMS schema modeling, GROQ queries, and content platform architecture.
Install
mkdir -p .claude/skills/sanity && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16035" && unzip -o skill.zip -d .claude/skills/sanity && rm skill.zipInstalls to .claude/skills/sanity
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Assists with building content platforms using Sanity's structured content and real-time collaboration features. Use when defining schemas, writing GROQ queries, configuring Sanity Studio, or integrating with Next.js for content-driven sites. Trigger words: sanity, groq, sanity studio, structured content, portable text, content lake, sanity schema.Key capabilities
- →Define Sanity schemas using `defineType()` and `defineField()`.
- →Write GROQ queries with projections and dereference operators.
- →Configure Sanity Studio for desk structure and custom components.
- →Build rich content using Portable Text.
- →Integrate Sanity with Next.js for content-driven sites.
- →Manage environments using datasets and webhooks.
How it works
The skill guides the user through defining structured content schemas, querying data with GROQ, customizing the Sanity Studio, and integrating with frontend frameworks like Next.js.
Inputs & outputs
When to use sanity
- →Defining Sanity schemas
- →Writing GROQ queries
- →Configuring Sanity Studio
- →Integrating headless CMS
About this skill
Sanity
Overview
Sanity is a structured content platform with real-time collaboration, GROQ querying, and a customizable React-based Studio. Content is stored in the Content Lake with CDN delivery, Portable Text for structured rich content, and visual editing capabilities for live frontend previews.
Instructions
- When defining schemas, use
defineType()anddefineField()with validation rules, model content for reuse by separating pages from content blocks, and use references over inline objects for shared content. - When querying data, write GROQ queries with projections to fetch only needed fields, use the
->dereference operator for joined data, and setuseCdn: truefor production reads. - When customizing Sanity Studio, configure desk structure for sidebar navigation, add custom input components for specialized editing, and create custom publish workflows with actions.
- When building rich content, use Portable Text which is structured data (not HTML) that renders on any platform, with customizable toolbar, custom blocks, and inline objects.
- When integrating with Next.js, use
next-sanitywith ISR, preview mode, and visual editing, and@sanity/visual-editingfor click-to-edit overlays in the frontend. - When managing environments, use datasets (production, staging, development) for content isolation, GROQ-powered webhooks for filtered build triggers, and set
apiVersionto a specific date to avoid breaking changes. - When handling images, use Sanity's image with hotspot for focal point selection and
sanity-image-urlfor generating responsive image URLs with transforms.
Examples
Example 1: Build a content-driven marketing site
User request: "Set up Sanity with Next.js for a marketing site with modular page builder"
Actions:
- Define page, hero, feature, CTA, and testimonial schemas as reusable block types
- Configure Sanity Studio with desk structure and live preview
- Set up
next-sanitywith ISR and GROQ queries for each page type - Enable visual editing with
@sanity/visual-editingfor click-to-edit overlays
Output: A modular marketing site where editors build pages from reusable content blocks with live preview.
Example 2: Implement real-time content preview
User request: "Add live preview to our Sanity + Next.js site so editors see changes as they type"
Actions:
- Configure Sanity Studio's Presentation tool for side-by-side editing
- Set up
@sanity/visual-editingin the Next.js frontend for click-to-edit overlays - Use
client.listen()for real-time content updates in preview mode - Configure draft content display with
!(_id in path("drafts.**"))filtering
Output: A live editing experience where content changes appear in the frontend as editors type.
Guidelines
- Use
defineType()anddefineField()for schema definitions; they provide TypeScript types for the Studio. - Model content for reuse: separate pages from content blocks so blocks can appear on any page.
- Use references over inline objects for content that appears in multiple places.
- Query with GROQ projections to fetch only needed fields, not entire documents.
- Use the CDN API (
useCdn: true) for production reads; it is free and fast. - Set
apiVersionto a specific date to avoid breaking changes. - Use Portable Text for rich content; it is structured data that renders on any platform.
When not to use it
- →When the user needs to store content in a non-structured format like raw HTML.
- →When the user does not want real-time collaboration features.
Prerequisites
Limitations
- →Sanity Studio requires Node.js 18+.
- →It focuses on structured content, not unstructured data.
- →It requires specific API versions to avoid breaking changes.
How it compares
This skill provides specific patterns for Sanity's structured content platform, enabling real-time collaboration and flexible content modeling, which differs from traditional file-based or relational database CMS approaches.
Compared to similar skills
sanity side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| sanity (this skill) | 0 | 3mo | No flags | Intermediate |
| ai-model-web | 1 | 2mo | Review | Intermediate |
| rdc-setup | 1 | 6mo | Review | Intermediate |
| tanstack-query-expert | 0 | 3mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by TerminalSkills
View all by TerminalSkills →You might also like
ai-model-web
TencentCloudBase
Use this skill when developing browser/Web applications (React/Vue/Angular, static websites, SPAs) that need AI capabilities. Features text generation (generateText) and streaming (streamText) via @cloudbase/js-sdk. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended) and DeepSeek (deepseek-v3.2 recommended). NOT for Node.js backend (use ai-model-nodejs), WeChat Mini Program (use ai-model-wechat), or image generation (Node SDK only).
rdc-setup
reactive
Install and set up @data-client/react or @data-client/vue in a project. Detects project type (NextJS, Expo, React Native, Vue, plain React) and protocol (REST, GraphQL, custom), then hands off to protocol-specific setup skills.
tanstack-query-expert
Anhvu1107
ALWAYS use this when the request matches Tanstack Query Expert: Expert in TanStack Query (React Query) — asynchronous state management.
algolia-search
aiskillstore
Expert patterns for Algolia search implementation, indexing strategies, React InstantSearch, and relevance tuning Use when: adding search to, algolia, instantsearch, search api, search functionality.
nuqs
marlanperumal
Install: `just add-web-dep nuqs`
api-integration
anubhavnepal
Define or review how the Next.js frontend should communicate with the Django REST backend through typed, replaceable service layers.