sanity-best-practices

sanity-best-practices is a skill for Claude Code from sanity-io/agent-toolkit. It costs 164 tokens per session (1,156 once invoked), scanned A, original, MIT.

A reference guide for building Sanity projects, where Sanity is a content-management system for storing and editing structured website content.

In plain words
What is it for?
Use it when setting up Sanity, building its Studio, querying content, adding previews or localization, migrating data, or connecting frameworks such as Next.js, Nuxt, Astro, or Remix.
Why use it?
It helps prevent common mistakes when designing content schemas, writing GROQ queries, connecting front-end frameworks, or managing content changes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the sanity plugin — 7 skills, 4 commands, 1 MCP server shipped together

not rated 182repo +2 4d ago A scan Socket: passSnyk: warnSkillSpector: pass 164 tokens original MIT

Good fit Use it when setting up Sanity, building its Studio, querying content, adding previews or localization, migrating data, or connecting frameworks such as Next.js, Nuxt, Astro, or Remix.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sanity-io/agent-toolkit/sanity-best-practices
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add sanity-io/agent-toolkit --skill sanity-best-practices
Clone the repo
git clone --depth 1 https://github.com/sanity-io/agent-toolkit

Made for: Claude Code.

Or install sanity, the plugin that ships this one along with the rest of its 7 skills, 4 commands, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sanity-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/sanity-io/agent-toolkit/sanity-best-practices/github.svg)](https://agentmods.dev/skills/sanity-io/agent-toolkit/sanity-best-practices)
Your own site
<a href="https://agentmods.dev/skills/sanity-io/agent-toolkit/sanity-best-practices"><img src="https://agentmods.dev/badge/skills/sanity-io/agent-toolkit/sanity-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sanity-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/sanity-io/agent-toolkit/sanity-best-practices"><img src="https://agentmods.dev/badge/skills/sanity-io/agent-toolkit/sanity-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 164 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,156 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 13 Apr 2026
  • Snyk warn 13 Apr 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00164 $0.01156
Opus 5 $0.00082 $0.00578
Sonnet 5 $0.00033 $0.00231
Haiku 4.5 $0.00016 $0.00116

Measured 9d ago against content hash 39c6413b567b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

sanity-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

4 near-identical copies found in the catalogue:

skills/sanity-best-practices/SKILL.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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
  • Managing infrastructure with Blueprints
  • Automating content workflows with Sanity Functions or webhooks

Global Rules

  • Let Sanity generate _id values for ordinary documents. Do not create deterministic UUIDs, slug-derived IDs, or legacy-system IDs when creating documents.
  • Model relationships with reference fields, then resolve related documents with GROQ lookups, source-key fields, or returned _id values from created documents.
  • Use explicit document IDs mainly for singleton documents controlled by Studio Structure, including localized singletons such as homePage-en.

Video

  • Do not store or serve video from Sanity 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.
  • On Enterprise plans with the video add-on, use Sanity Media Library for video: uploads are transcoded and streamed adaptively via Mux. Model video fields with defineVideoField() from sanity/media-library and play them with @mux/mux-player-react using the asset's playback ID.
  • On other plans, use a dedicated video service: install 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.
  • Small clips and short previews in a file field are acceptable, but any user-facing video at scale must go through Media Library or a streaming service.

Read the full file on GitHub · 87 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 87 lines · 164 tokens per session scan A 39c6413b567b

Subscribe to this mod's changes

sanity-best-practices is a skill published in the GitHub repository sanity-io/agent-toolkit (182 stars, last pushed 4d ago), licensed MIT. It adds 164 tokens to every session and 1,156 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

api-lifecycle

Provides API design and lifecycle management guidance including versioning, deprecation, rate limiting, and documentation standards. Triggers on api design, rest api, graphql, api versioning, deprecation, breaking changes, rate limiting, api lifecycle, api documentation, openapi.

doancan/mags · 58 tokens

webhooks

Webhook subscriptions for the Ayrshare MCP server: register, unregister, and list HTTPS push notifications so an agent or app is notified on events instead of polling. Use whenever someone wants event push: "notify me when a post publishes", "let me know when a scheduled post goes out", "set up a webhook for new…

ayrshare/ayrshare-social-media-api-claude-plugin · 205 tokens

n8n-subworkflows

Build reusable, composable n8n sub-workflows. Use when extracting shared logic, building anything multi-step or reused across workflows, or any workflow over 10 nodes — and whenever the user mentions sub-workflows, Execute Workflow, reuse, shared/common logic, modular workflows, "Define Below" inputs…

czlonkowski/n8n-mcp · 121 tokens

add-cloud-flow

Integrates Power Automate cloud flows into a Power Pages site. Lists available flows, suggests relevant ones based on intent, identifies scenarios and web roles, creates metadata files, and generates client-side code to call flows. Handles both new flow registration and adding already-registered flows to additional…

microsoft/power-platform-skills · 91 tokens

tidewave-integration

Tidewave MCP runtime tools — debugging, smoke testing, live state inspection, SQL queries, hex docs. Use when evaluating code in a running Phoenix app.

oliver-kriska/claude-elixir-phoenix · 38 tokens

api-testing

HTTP API testing for TypeScript (Supertest) and Python (httpx, pytest). Test REST APIs, GraphQL, request/response validation, authentication, and error handling.

secondsky/claude-skills · 39 tokens