1. Habit
  2. Skills
  3. Sanity Best Practices skill
sanity-io · 31K installs

Sanity Best Practices skill
Runs by itself, PR touches Sanity code.

Sanity changes follow house rules.

Install the Sanity Best Practices skill and make it a habit: follow https://gethabit.dev/skills/sanity-io/sanity-best-practices.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

31K installs192 starsMIT licenceSource on GitHub ↗

Sanity Best Practices

by sanity-io · 31K installs

The skill

The sanity best practices skill gives Sanity developers topic guides for schemas, GROQ, TypeGen, Visual Editing, Portable Text, localization, migrations, Functions and framework integrations.

Only when you ask.

The habit

Sanity changes follow house rules.

↻ Runs by itselfPR touches Sanity code

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleOne pull request per run, at most two topic guides loaded.

  1. 01

    Read the diff

    The run starts from the changed files in the pull request.

  2. 02

    Pick the guide

    The agent picks the single framework or topic guide that fits, like groq, schema or nextjs.

  3. 03

    Add only if needed

    It opens a second reference file only when the change crosses concerns.

  4. 04

    Check global rules

    It checks IDs, reference fields and video handling against the skill's global rules.

  5. 05

    Run the build

    The project build must pass before the review is posted.

  6. 06

    Log findings

    Findings go to the run log with the guide that backs each one.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the Sanity Best Practices skill helps.

Use it when

  • ✓ You design or change Sanity schemas
  • ✓ You write or tune GROQ queries
  • ✓ You wire Sanity into a frontend framework

Skip it when

  • – Your CMS is not Sanity
  • – You only edit content in the Studio

Questions

Sanity Best Practices skill, answered.

Does it load every guide?

No. The skill asks for the one or two files that match the task, so the review stays focused.

Which frameworks does it cover?

Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen and the App SDK, plus topics like GROQ, TypeGen and localization.

How do I install the Sanity Best Practices skill?

Copy the prompt at the top into your agent. It installs the skill from sanity-io/agent-toolkit and sets up the habit. Or run npx skills add sanity-io/agent-toolkit --skill sanity-best-practices.

Is the Sanity Best Practices skill free?

Yes. It is published under MIT. Habit is free too.

Sanity Best Practices. Now as a habit.

Install the Sanity Best Practices skill and make it a habit: follow https://gethabit.dev/skills/sanity-io/sanity-best-practices.md

  • Free
  • No account
  • Undo in one line

All sanity-io skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by sanity-io, published under MIT. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.