sanity-io avatar

Sanity Best Practices

This is the official Sanity reference covering everything from schema design and GROQ queries to framework integrations with Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, and Hydrogen. It includes practical guides on Visual Editing, Portable Text, image optimization, TypeGen, localization, migrations, and newer features like Sanity Functions and Blueprints for infrastructure as code. The structure is smart: each topic gets its own reference file with correct and incorrect examples, so you can load just what you need rather than dumping everything into context. Especially useful when you're setting up a new project, debugging GROQ performance, or implementing live preview setups.

skills.sh installs
33.7K
GitHub stars
197
last updated
Aug 21, 2026

Install

$ npx -y skills add sanity-io/agent-toolkit --skill sanity-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Files

Sanity Best Practices

Comprehensive best practices and integration guides for Sanity development, maintained by Sanity. Use the quick reference below to load only the one or two topic files that match the task.

When to Apply

Reference these guidelines when:

  • Setting up a new Sanity project or onboarding
  • Integrating Sanity with a frontend framework (Next.js, Nuxt, Astro, Remix, SvelteKit, Hydrogen)
  • Writing GROQ queries or optimizing performance
  • Designing content schemas
  • Implementing Visual Editing and live preview
  • Working with images, Portable Text, or page builders
  • Configuring Sanity Studio structure
  • Setting up TypeGen for type safety
  • Implementing localization
  • Migrating content from other systems
  • Building custom apps with the Sanity App SDK
  • Developing or deploying a Studio or app in the Sanity Dashboard
  • Managing infrastructure with Blueprints
  • Automating content workflows with Sanity Functions or webhooks

Global Rules

Sponsors

Details

Repository
github.com/sanity-io/agent-toolkit
Categories
Frontend Development, AI & Agent Building, Automation & Workflows, Design & UI/UX, Office & Documents

More from sanity-io/agent-toolkit

All 7
1clerk avatarclerkclerk/skillsClerk authentication router. Use when user asks about Clerk CLI operations, adding authentication, setting up Clerk, custom sign-in flows, Swift or native iOS a30.9Kskills.sh installs
2warpdotdev avatarbrandalfwarpdotdev/common-skillsGuides creation, revision, and review of Warp- or Oz-branded assets. Use when working on launch pages, docs, HTML/CSS components, UI mockups, prompts, social as28.3Kskills.sh installs
3vercel avatarnext-cache-components-adoptionvercel/next.jsTurn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components,25.8Kskills.sh installs
4sanity-io avatarsanity-migrationsanity-io/agent-toolkitPlans, implements, and reviews migrations from other CMSes and content systems into Sanity. Use when migrating or replatforming to Sanity from AEM, Adobe Experi23.7Kskills.sh installs
5expo avatarexpo-web-to-nativeexpo/skillsFramework (OSS). Migrate an existing web React app to a native iOS/Android app with Expo. Use when the user wants to turn a website into a mobile app, port a Ne22.5Kskills.sh installs
6antfu avatarvueuse-functionsantfu/skillsApply VueUse composables where appropriate to build concise, maintainable Vue.js / Nuxt features.21.4Kskills.sh installs