← All skills
sanity-best-practices
82 / 100 · Low risk
Fine to try.
By sanity-io/agent-toolkit (GitHub) · coding · 197 stars · scanned at commit 3ed3a14
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, P…
Works with any agent that supports SKILL.md skills.
What this skill can do
Sends data to these websites: ${context.clientoptions.projectid}.api.sanity.io
This is disclosed by the author in the skill's SKILL.md or README.
Found in 32 places.
Show 17 more
- skills/sanity-best-practices/references/angular.md, line 210
posts = toSignal(from(this.sanity.fetch(POSTS_QUERY)), { initialValue: [] }) - skills/sanity-best-practices/references/angular.md, line 473
const result = await this.client.fetch(query, params) - skills/sanity-best-practices/references/angular.md, line 542
return client.fetch(query, params) - skills/sanity-best-practices/references/astro.md, line 81
const posts = await sanityClient.fetch(POSTS_QUERY); - skills/sanity-best-practices/references/astro.md, line 98
return await sanityClient.fetch(POSTS_QUERY); - skills/sanity-best-practices/references/astro.md, line 120
return await sanityClient.fetch(SLUGS_QUERY); - skills/sanity-best-practices/references/astro.md, line 124
const post = await sanityClient.fetch(POST_QUERY, { slug }); - skills/sanity-best-practices/references/functions.md, line 296
await fetch(process.env.CACHE_PURGE_URL!, { - skills/sanity-best-practices/references/functions.md, line 371
const stale = await client.fetch( - skills/sanity-best-practices/references/functions.md, line 419
await fetch(process.env.SLACK_WEBHOOK_URL, { - skills/sanity-best-practices/references/functions.md, line 462
const resized = await client.fetch(`*[_id == $id][0].resizedUrl`, { id: event.data._id }) - skills/sanity-best-practices/references/functions.md, line 638
await fetch(URL) - skills/sanity-best-practices/references/functions.md, line 735
await fetch(WEBHOOK_URL, { - skills/sanity-best-practices/references/functions.md, line 854
await fetch(`https://${context.clientOptions.projectId}.api.sanity.io/v2025-05-08/data/mutate/${context.clientOptions.dataset}`, { - skills/sanity-best-practices/references/hydrogen.md, line 148
| `sanity.fetch()` | No preview needed, lightweight | - skills/sanity-best-practices/references/localization.md, line 96
client.fetch(`*[_type == "locale"]{ "id": tag, "title": name }`), - skills/sanity-best-practices/references/localization.md, line 342
client.fetch(`*[_type == "locale"]{ "id": tag, "title": name }`),
and 12 more places
Downloads and installs other software
The author does not mention this.
Found in 67 places.
Show 17 more
- skills/sanity-best-practices/references/app-sdk.md, line 477
| Auth errors | `npx sanity@latest logout && npx sanity@latest login` | - skills/sanity-best-practices/references/astro.md, line 24
npx astro add @sanity/astro - skills/sanity-best-practices/references/blueprints.md, line 10
The CLI is built for unattended use: every command accepts `--json`, all IDs can be supplied via flags or environment variables, and `--help` on any command is - skills/sanity-best-practices/references/blueprints.md, line 159
npx sanity@latest blueprints <command> - skills/sanity-best-practices/references/blueprints.md, line 176
Running `npx sanity@latest blueprints --help` will show the latest available commands. - skills/sanity-best-practices/references/blueprints.md, line 177
Use `npx sanity@latest blueprints <command> --help` to see options and examples for a specific command. - skills/sanity-best-practices/references/blueprints.md, line 179
Function scaffolding, local testing, secrets, and function logs live under `npx sanity@latest functions <command>` (`add`, `dev`, `test`, `env add|list|remove`, - skills/sanity-best-practices/references/blueprints.md, line 184
npx sanity@latest blueprints init . # once: create file + Stack - skills/sanity-best-practices/references/blueprints.md, line 186
npx sanity@latest blueprints plan # preview the diff, catch validation errors safely - skills/sanity-best-practices/references/blueprints.md, line 187
npx sanity@latest blueprints deploy # apply - skills/sanity-best-practices/references/blueprints.md, line 188
npx sanity@latest blueprints info # verify deployed state - skills/sanity-best-practices/references/blueprints.md, line 199
npx sanity@latest blueprints deploy || status=$? - skills/sanity-best-practices/references/blueprints.md, line 201
npx sanity@latest blueprints info --json # confirm actual Stack state - skills/sanity-best-practices/references/blueprints.md, line 248
npx sanity@latest blueprints mint-deploy-token --label "ci-deploy" --print - skills/sanity-best-practices/references/blueprints.md, line 257
npx sanity@latest blueprints deploy --json --message "CI deploy" - skills/sanity-best-practices/references/blueprints.md, line 262
npx sanity@latest functions env add my-function API_KEY sk-... - skills/sanity-best-practices/references/dashboard.md, line 33
`sanity init --dashboard` scaffolds a Studio or app with `defineApplication`. The flag is beta; if `npx sanity@latest init --help` does not list it, the install
and 47 more places
Install
Paste this into your terminal. It downloads exactly the version we scanned, not whatever is newest.
if [ -e ~/.agents/skills/'sanity-best-practices' ] || [ -L ~/.agents/skills/'sanity-best-practices' ]; then echo 'A skill folder named sanity-best-practices already exists — not replacing it' >&2; false; else d=$(mktemp -d) && git clone --quiet --filter=blob:none --no-checkout 'https://github.com/sanity-io/agent-toolkit' "$d" && git -C "$d" checkout --quiet '3ed3a143f8d3413faa7790ac0b2274fd3a8a6320' -- 'skills/sanity-best-practices' && mkdir -p ~/.agents/skills && cp -R "$d"/'skills/sanity-best-practices' ~/.agents/skills/'sanity-best-practices' && rm -rf "$d"; fi
Codex reads ~/.agents/skills directly. For Claude Code, Cursor, Copilot, Gemini CLI, Antigravity or OpenCode, also link it. For Claude Code: ln -s ~/.agents/skills/'sanity-best-practices' ~/.claude/skills/'sanity-best-practices' (other agents: ~/.cursor/skills, ~/.copilot/skills, ~/.gemini/skills, ~/.gemini/config/skills, ~/.config/opencode/skills). Or install through the finder skill, which does both.
Badge for your README
The badge for sanity-io/agent-toolkit shows the score of its lowest-scoring skill.

[](https://zalavijaysinh.github.io/skilltrust/repos/sanity-io/agent-toolkit/)
Score history
| Date | Version | Score |
|---|
| 2026-11-07 | 3ed3a14 | 82 |