What problem does it solve? Keeping GROQ queries, generated TypeScript types, the Sanity schema, and Astro renderers consistent is error-prone: queries balloon past the 300 KB API limit, generated files get hand-edited, React leaks from the Studio into public pages, and related fields sprawl as prefix-named siblings. This Skill encodes the end-to-end conventions so every change follows the same query-to-type-to-renderer pipeline. ## Core Features & Use Cases - Query and typegen workflow: Define GROQ with defineQuery in src/sanity/queries.ts, regenerate types with npm run sanity:typegen, and fetch through loadQuery<ResultType> with draft-mode and stega handling built in. - Schema and Studio conventions: Field factories, field grouping into wrapper objects, singleton IDs from sanity/constants.ts, and React strictly confined to the root sanity/ Studio. - Custom GROQ functions: Rules for hoisting repeated projections into frag:: namespaced functions to stay under the query size limit, including typegen evaluation pitfalls. - Use Case: When adding a new page-builder section, you create the schema with field factories, write the query reusing shared fragments, run typegen, render through SanityMedia/SanityRichText, and verify with npm run check. ## Quick Start Ask the AI to add a new GROQ query for a page type following the Sanity conventions, regenerate the types, and render it with the existing Astro media components.