install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/TerminalSkills/skills/sanity" ~/.claude/skills/comeonoliver-skillshub-sanity && rm -rf "$T"
manifest:
skills/TerminalSkills/skills/sanity/SKILL.mdsource content
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
anddefineType()
with validation rules, model content for reuse by separating pages from content blocks, and use references over inline objects for shared content.defineField() - When querying data, write GROQ queries with projections to fetch only needed fields, use the
dereference operator for joined data, and set->
for production reads.useCdn: true - 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
with ISR, preview mode, and visual editing, andnext-sanity
for click-to-edit overlays in the frontend.@sanity/visual-editing - When managing environments, use datasets (production, staging, development) for content isolation, GROQ-powered webhooks for filtered build triggers, and set
to a specific date to avoid breaking changes.apiVersion - When handling images, use Sanity's image with hotspot for focal point selection and
for generating responsive image URLs with transforms.sanity-image-url
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
with ISR and GROQ queries for each page typenext-sanity - Enable visual editing with
for click-to-edit overlays@sanity/visual-editing
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
in the Next.js frontend for click-to-edit overlays@sanity/visual-editing - Use
for real-time content updates in preview modeclient.listen() - Configure draft content display with
filtering!(_id in path("drafts.**"))
Output: A live editing experience where content changes appear in the frontend as editors type.
Guidelines
- Use
anddefineType()
for schema definitions; they provide TypeScript types for the Studio.defineField() - 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 (
) for production reads; it is free and fast.useCdn: true - Set
to a specific date to avoid breaking changes.apiVersion - Use Portable Text for rich content; it is structured data that renders on any platform.