sanity-best-practices

Scan directory roots for SKILL.md files and extract YAML frontmatter metadata.

173|27|Updated Mar 11, 2025
One-click install
npx skills add https://github.com/sanity-io/agent-toolkit --skill sanity-best-practices-sanity-io
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sanity-best-practices
Source: https://github.com/sanity-io/agent-toolkit/tree/main/skills/sanity-best-practices
Command: npx skills add https://github.com/sanity-io/agent-toolkit --skill sanity-best-practices-sanity-io

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill consolidates Sanity development best practices into a centralized guide to help teams design scalable schemas, optimize GROQ queries, configure Studio, and maintain consistent workflows across projects.

Core Features & Use Cases

  • GROQ performance guidelines, query optimization patterns, and best practices for projection and indexing.
  • Schema design guidance to promote data-first modeling, reusable content, and safe migrations.
  • Visual Editing and Studio configuration guidance to improve editor experience and maintainability.
  • Image handling, Portable Text, localization, migrations, and TypeGen considerations for end-to-end content workflows.
  • Decision guidance on when to use references vs nested objects, and how to structure content for multi-channel delivery.

Quick Start

Review the rules directory for concrete examples (groq-optimizable-filters, schema-data-over-presentation, etc.), adopt the naming prefixes, and align your Sanity schemas and queries with the guidelines. Start by auditing an existing project against the guidelines and iterating to replace anti-patterns with the recommended patterns.

Frequently Asked Questions about sanity-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the best practices for optimizing GROQ queries in Sanity?

Sanity GROQ optimization best practices include applying optimizable filters, proper projection techniques, and indexing patterns. Review the rules directory for concrete examples to reduce query latency and improve performance.

How do I design scalable Sanity schemas for multi-channel content delivery?

Design scalable Sanity schemas by prioritizing data-first modeling, reusable content structures, and safe migration patterns. Use decision guidance to choose between references and nested objects for structuring multi-channel delivery efficiently.

When should I use references vs nested objects in Sanity schema design?

Use Sanity references vs nested objects based on decision guidance for data modeling. References maintain data normalization across documents, while nested objects encapsulate isolated content structures within a single schema.

How do I configure Sanity Studio for visual editing and better editor experience?

Configure Sanity Studio for visual editing by applying best practices for maintainability and editor experience. The guidelines cover Studio configuration, image handling, Portable Text, and localization considerations.

How do I audit an existing Sanity project against development best practices?

Audit an existing Sanity project by comparing schemas and queries against the rules directory guidelines. Iterate to replace anti-patterns with recommended patterns, adopting naming prefixes and aligning with GROQ optimization standards.