Sanity Best Practices
robotostudio/turbo-start-sanity
Sanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, Blueprints, and…
Sanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, webhooks, Blueprints…
$ npx skills add sanity-io/agent-toolkit --skill sanity-best-practices -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install sanity-io/agent-toolkit sanity-best-practices --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/sanity-io/agent-toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/sanity-best-practices .claude/skills/sanity-best-practices && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "sanity-best-practices" agent skill from https://github.com/sanity-io/agent-toolkit/tree/main/skills/sanity-best-practices into .claude/skills/sanity-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sanity-best-practices", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/sanity-io/agent-toolkit/tree/main/skills/sanity-best-practicesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add sanity-io/agent-toolkit --skill sanity-best-practices -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install sanity-io/agent-toolkit sanity-best-practices --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanity-io/agent-toolkit.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/sanity-best-practices .agents/skills/sanity-best-practices && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "sanity-best-practices" agent skill from https://github.com/sanity-io/agent-toolkit/tree/main/skills/sanity-best-practices into .agents/skills/sanity-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sanity-best-practices", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add sanity-io/agent-toolkit --skill sanity-best-practices -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install sanity-io/agent-toolkit sanity-best-practices --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanity-io/agent-toolkit.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/sanity-best-practices .cursor/skills/sanity-best-practices && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "sanity-best-practices" agent skill from https://github.com/sanity-io/agent-toolkit/tree/main/skills/sanity-best-practices into .cursor/skills/sanity-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sanity-best-practices", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/sanity-io/agent-toolkit.git --path skills/sanity-best-practices--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add sanity-io/agent-toolkit --skill sanity-best-practices -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install sanity-io/agent-toolkit sanity-best-practices --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanity-io/agent-toolkit.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/sanity-best-practices .gemini/skills/sanity-best-practices && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "sanity-best-practices" agent skill from https://github.com/sanity-io/agent-toolkit/tree/main/skills/sanity-best-practices into .gemini/skills/sanity-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sanity-best-practices", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install sanity-io/agent-toolkit sanity-best-practicesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add sanity-io/agent-toolkit --skill sanity-best-practices -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/sanity-io/agent-toolkit.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/sanity-best-practices .github/skills/sanity-best-practices && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "sanity-best-practices" agent skill from https://github.com/sanity-io/agent-toolkit/tree/main/skills/sanity-best-practices into .github/skills/sanity-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sanity-best-practices", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add sanity-io/agent-toolkit --skill sanity-best-practices -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install sanity-io/agent-toolkit sanity-best-practices --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/sanity-io/agent-toolkit.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/sanity-best-practices .opencode/skills/sanity-best-practices && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "sanity-best-practices" agent skill from https://github.com/sanity-io/agent-toolkit/tree/main/skills/sanity-best-practices into .opencode/skills/sanity-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sanity-best-practices", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
sanity-best-practicesSanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, webhooks, Blueprints…
Sanity Best Practices is an agent skill from sanity-io/agent-toolkit, published by the product's own GitHub organization. Sanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, webhooks, Blueprints, and framework integrations such as Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen, the App SDK, and Studios or apps running in the Sanity Dashboard (defineApplication). Use this skill whenever working with Sanity schemas, defineType or defineField, GROQ or defineQuery, content modeling, Presentation or…
Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 26 other files, including reference files (for example `references/angular.md`, `references/app-sdk.md` and `references/astro.md`).
It sits in Backend & APIs, covering Event-driven systems, Static sites and blogs and Internationalization. It works with Astro, Next.js, Nuxt and SvelteKit. The repository describes itself as: Collection of resources to help AI agents build better with Sanity. The licence is MIT.
Read from SKILL.md and the folder at commit 3fe6c8a. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Sanity Best Practices loads about 1.4k tokens when it runs, and up to ~66k if it reads all its reference files. Until then it costs about 211 tokens; SKILL.md has 586 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from sanity-io/agent-toolkit at commit 3fe6c8a, republished under its MIT licence (© sanity-io). 586 words, ~1,384 tokens.
.claude/skills/sanity-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 25 other files; get the full folder from GitHub.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.
Reference these guidelines when:
_id values for ordinary documents. Do not create deterministic UUIDs, slug-derived IDs, or legacy-system IDs when creating documents.reference fields, then resolve related documents with GROQ lookups, source-key fields, or returned _id values from created documents.homePage-en.file assets for production playback. File assets are delivered as raw downloads with no transcoding or adaptive streaming, and video traffic drives very high bandwidth usage and unexpectedly large bills.defineVideoField() from sanity/media-library and play them with @mux/mux-player-react using the asset's playback ID.sanity-plugin-mux-input to upload and manage videos in your Mux account from the Studio, or host video on a platform such as YouTube or Vimeo and store only the embed URL in Sanity.file field are acceptable, but any user-facing video at scale must go through Media Library or a streaming service.get-started - Interactive onboarding for new Sanity projectsnextjs - Next.js App Router, Live Content API, standalone Studionuxt - Nuxt integration with @nuxtjs/sanityangular - Angular integration with @sanity/client, signals, resource APIastro - Astro integration with @sanity/astroremix - React Router / Remix integrationsvelte - SvelteKit integration with @sanity/svelte-loaderhydrogen - Shopify Hydrogen with Sanityproject-structure - Standalone Studio and monorepo patternsapp-sdk - Custom applications with Sanity App SDKdashboard - Studios and apps in the Sanity Dashboard: defineApplication, local dev, deploys, Dashboard hooksblueprints - Infrastructure as Code: blueprint files, stacks, plan/deploy workflow, error recovery, CI deploysfunctions - Automating content workflows with Sanity Functions and webhooksgroq - GROQ query patterns, type safety, performance optimizationschema - Schema design, field definitions, validation, deprecation patternsvisual-editing - Presentation Tool, Stega, overlays, live previewpage-builder - Page Builder arrays, block components, live editingportable-text - Rich text rendering and custom componentsimage - Image schema, URL builder, hotspots, LQIP, Next.js Imagestudio-structure - Desk structure, singletons, navigationtypegen - TypeGen configuration, workflow, type utilitiesseo - Metadata, sitemaps, Open Graph, JSON-LDlocalization - i18n patterns, document vs field-level, locale managementmigration - Content import overview (see also migration-html-import)migration-html-import - HTML to Portable Text with @portabletext/block-toolsStart with the single framework or topic guide that best matches the request, then read additional references only when the task crosses concerns. Use these reference files for detailed explanations and code examples:
references/groq.md
references/schema.md
references/nextjs.mdEach reference file contains:
© sanity-io, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 25 other files (references) in skills/sanity-best-practices of sanity-io/agent-toolkit.
Open the folder on GitHubat commit 3fe6c8a
Sanity Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Sanity Best Practices this skillsanity-io/agent-toolkit | 188 | — | ~1.4k | Automated safety check: Pass | MIT | |
| Sanity Best Practicesrobotostudio/turbo-start-sanity | 183 | — | ~940 | Automated safety check: Pass | MIT | |
| Framework Adaptershashgraph-online/awesome-codex-plugins | 1.3k | — | ~2.9k | Automated safety check: Notes | Apache-2.0 | |
| Clerkgeekskai/blog | 103 | 3 repos | ~1.5k | Automated safety check: Pass | MIT | |
| Cloudflare Workers Frameworkssecondsky/claude-skills | 227 | — | ~1.4k | Automated safety check: Pass | MIT | |
| Edgeone Makers FrameworksTencentEdgeOne/edgeone-makers-tools | 1.9k | — | ~2.5k | Automated safety check: Pass | MIT |
robotostudio/turbo-start-sanity
Sanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, Blueprints, and…
hashgraph-online/awesome-codex-plugins
Official @dodopayments/ framework adapters that mount Checkout, CustomerPortal, and Webhooks route handlers.
geekskai/blog
Clerk authentication router. An agent skill from geekskai/blog.
secondsky/claude-skills
Framework integration for Cloudflare Workers. An agent skill from secondsky/claude-skills.
TencentEdgeOne/edgeone-makers-tools
Web framework support matrix for EdgeOne Makers — which platform adapter each full-stack framework needs, where it plugs in, the build output directory, the preview asset-prefix option, the 404…
Undertone0809/rudder
Create and iteratively improve local web products from natural-language requests, then prepare them to run as Rudder Apps.
sanity-io/agent-toolkit
Convert HTML and Markdown content into Portable Text blocks for Sanity.
sanity-io/agent-toolkit
Plans, implements, and reviews migrations from other CMSes and content systems into Sanity.
sanity-io/agent-toolkit
Render and serialize Portable Text to React, Svelte, Vue, Astro, HTML, Markdown, and plain text.
sanity-io/agent-toolkit
SEO and AEO best practices for metadata, Open Graph, sitemaps, robots.txt, hreflang, JSON-LD structured data, EEAT, and content optimized for search engines and AI answer surfaces.
sanity-io/agent-toolkit
Produces a tailored Sanity Studio upgrade plan by inspecting the repository's installed versions, config, and source, then reporting only the breaking changes that actually apply.
sanity-io/agent-toolkit
Content experimentation and A/B testing guidance covering experiment design, hypotheses, metrics, sample size, statistical foundations, CMS-managed variants, and common analysis pitfalls.
Categories
Sanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, webhooks, Blueprints…. Sanity Best Practices is an agent skill from sanity-io/agent-toolkit, published by the product's own GitHub organization.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen, the App SDK, and Studios or apps running in the Sanity Dashboard (defineApplication).
Sanity Best Practices fits situations like: working with Sanity schemas; content modeling; sanity-powered frontend integrations; event-driven content automation.
Run `npx skills add sanity-io/agent-toolkit --skill sanity-best-practices -a claude-code`. Or copy the skill folder (skills/sanity-best-practices in sanity-io/agent-toolkit) into .claude/skills/sanity-best-practices in your project. Claude Code loads it when a task matches its description.
Run `npx skills add sanity-io/agent-toolkit --skill sanity-best-practices -a codex`. Or copy the skill folder (skills/sanity-best-practices in sanity-io/agent-toolkit) into .agents/skills/sanity-best-practices in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sanity-io/agent-toolkit --skill sanity-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sanity-best-practices, .gemini/skills/sanity-best-practices, .github/skills/sanity-best-practices and .opencode/skills/sanity-best-practices in your project.
SKILL.md names no scripts, command-line tools or credentials: Sanity Best Practices is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Sanity Best Practices is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 64k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Sanity Best Practices: Sanity Best Practices (robotostudio/turbo-start-sanity, 183 stars), Framework Adapters (hashgraph-online/awesome-codex-plugins, 1.3k stars), Clerk (geekskai/blog, 103 stars) and Cloudflare Workers Frameworks (secondsky/claude-skills, 227 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
sanity-io (a GitHub organization, an official publisher) maintains it in sanity-io/agent-toolkit, which has 188 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 9, 2026.
Source: sanity-io/agent-toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.