sanity-best-practices

Provide best-practice guidance for Sanity schema design, GROQ queries, and framework integration.

1|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/sanity-labs/pup-finder-demo --skill sanity-best-practices-sanity-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sanity-best-practices
Source: https://github.com/sanity-labs/pup-finder-demo/tree/main/.agents/skills/sanity-best-practices
Command: npx skills add https://github.com/sanity-labs/pup-finder-demo --skill sanity-best-practices-sanity-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers often struggle with consistent schema design, efficient GROQ queries, and seamless integration of Sanity into various frameworks, leading to fragmented implementations and maintenance overhead.

Core Features & Use Cases

  • Schema Design: Guidelines for defining types, fields, validation, and deprecation.
  • GROQ Optimization: Patterns for performant queries and type‑safe usage.
  • Framework Integration: Tailored advice for Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen, and the Sanity App SDK.
  • Tooling: Advice on TypeGen, Visual Editing, migrations, and infrastructure Blueprints.
  • Use Cases: New project onboarding, schema refactoring, query performance tuning, and cross‑framework integration.

Quick Start

Ask the skill to provide the most relevant best‑practice guide for your current Sanity task.

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 Sanity schema design and validation?

Sanity schema design best practices include defining consistent types, fields, validation, and deprecation. This guidance helps developers avoid fragmented implementations and reduce maintenance overhead when setting up new projects or refactoring schemas.

How do I optimize GROQ queries for performance in my Sanity project?

Optimize GROQ queries by applying performant query patterns and type-safe usage. This guidance helps developers tune query performance and reduce latency when fetching data from their Sanity dataset.

Can I use Sanity best practices for Next.js, Nuxt, Astro, or SvelteKit integration?

Sanity best practices support framework integration with Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen, and the Sanity App SDK. Tailored advice ensures seamless integration across these specific frameworks.

Do I need access to my Sanity dataset to apply these best practices?

Yes, applying these best practices requires access to the Sanity dataset and the ability to read schema definitions and query results. This access ensures guidance is accurately tailored to your current project configuration.

What's the best way to handle Sanity schema migrations and TypeGen tooling?

Handle Sanity migrations and TypeGen tooling by following dedicated advice on Visual Editing, infrastructure Blueprints, and type generation. This ensures robust type safety and smooth schema evolution.

Why does my Sanity implementation suffer from fragmented schemas and maintenance overhead?

Fragmented Sanity implementations often stem from inconsistent schema design, inefficient GROQ queries, and poor framework integration. Adopting comprehensive best-practice guidelines resolves these issues and standardizes development.