sanity-best-practices
Skill by sanity-io
Sanity Best Practices is an agent skill from sanity-io that guides an AI assistant through Sanity development. It is for developers who design schemas, write GROQ queries, or build and review Sanity-powered frontends and automations.
Install sanity-best-practices
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sanity-io/agent-toolkit /tmp/agent-toolkit && mkdir -p ~/.claude/skills && cp -r /tmp/agent-toolkit/skills/sanity-best-practices ~/.claude/skills/sanity-best-practicesRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sanity-io/agent-toolkit /tmp/agent-toolkit && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agent-toolkit/skills/sanity-best-practices ~/.gemini/antigravity-cli/skills/sanity-best-practicesAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install sanity-best-practices in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
Sanity Best Practices is an agent skill published by sanity-io. It gives an AI assistant guidance for Sanity development, including schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization and migrations. It also covers framework integrations such as Next.js, Nuxt, Astro, Remix, SvelteKit, Angular and Hydrogen, along with Sanity Functions, webhooks and Blueprints.
The skill is organized as a quick reference of integration and topic guides, so the assistant loads only the one or two files that match a task. Its reference files include incorrect and correct code examples and decision guidance. It also sets global rules, such as letting Sanity generate _id values for ordinary documents. It is aimed at developers who build, review or fix Sanity projects.
Written from the project's SKILL.md and checked against it.
What it can do
- Schema designGuidance on defineType and defineField, field validation and deprecation patterns.
- GROQ queriesQuery patterns, type safety and performance optimization, including defineQuery.
- TypeGenTypeGen configuration, workflow and type utilities for type safety.
- Visual EditingPresentation Tool, Stega, overlays and live preview setups.
- Framework integrationsIntegration guides for Next.js, Nuxt, Astro, Remix, SvelteKit, Angular and Hydrogen.
- Sanity FunctionsEvent-driven content automation with documentEventHandler and webhooks.
- BlueprintsInfrastructure as code with sanity.blueprint.ts and a plan and deploy workflow.
- Localization and migrationi18n patterns and HTML to Portable Text import with block-tools.
- Dashboard appsGuidance on defineApplication for Studios and apps in the Sanity Dashboard.
Try asking
- Review my Sanity schema and suggest fixes using defineField best practices
- Write a GROQ query with defineQuery for a blog post list with images
- Set up TypeGen for my Sanity Studio and Next.js project
Good to know
- Video stored as Sanity file assets is not suitable for production playback, according to the source.
- Media Library video requires an Enterprise plan with the video add-on.
- On other plans, the source points to a dedicated video service such as Mux, YouTube or Vimeo.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/sanity-best-practices/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md5 KB -
references/angular.md19 KB -
references/app-sdk.md12 KB -
references/astro.md5 KB -
references/blueprints.md14 KB
Show all 26 files
-
references/dashboard.md7 KB -
references/functions.md30 KB -
references/get-started.md21 KB -
references/groq.md14 KB -
references/hydrogen.md7 KB -
references/image.md3 KB -
references/localization.md12 KB -
references/migration-html-import.md5 KB -
references/migration.md3 KB -
references/nextjs.md16 KB -
references/nuxt.md6 KB -
references/page-builder.md8 KB -
references/portable-text.md10 KB -
references/project-structure.md4 KB -
references/remix.md9 KB -
references/schema.md12 KB -
references/seo.md8 KB -
references/studio-structure.md4 KB -
references/svelte.md10 KB -
references/typegen.md6 KB -
references/visual-editing.md8 KB
Alternatives to sanity-best-practices
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
sanity-best-practices: common questions
Does this skill cover video in Sanity?
Yes. It advises against serving production video from file assets and recommends Sanity Media Library on Enterprise plans with the video add-on, or a dedicated video service on other plans.
Which frameworks does it support?
The source lists Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen and the App SDK, plus Studios and apps in the Sanity Dashboard.
Does it say how document IDs should be handled?
Yes. Its global rules say to let Sanity generate _id values for ordinary documents, and to use explicit IDs mainly for singleton documents controlled by Studio Structure.
How do I install sanity-best-practices?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is sanity-best-practices free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is sanity-best-practices safe to use?
It scores 81 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to sanity-best-practices?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
