Ira Bodnar··Updated ·12 min read

Claude Skills for Sanity: 8 SKILL.md Files You Can Copy

Quick answer: A Claude skill for Sanity is a saved SKILL.md file that tells Claude which GROQ query or mutation to run and what to hand back. The 8 below name the connector tool each step uses. Ryze AI is the best Claude connector for running Sanity skills from the same URL as its other platforms, with one caveat: it connects with an Editor token, so write and delete tools can change any document in the dataset.

Below: 8 SKILL.md files, how to install them in Claude, and how to run them on a live Sanity dataset through the Ryze AI connector.

Ryze AI · SEO Starter

Sanity skills on your dataset

  • 3-day free trial, $129 a month

Used by 2,000+ marketers

Uber Eats logoadidas logoDuolingo logoMGM Resorts logoWharton logoLendingClub logoNorton logoEventbrite logoHuel logoTogether AI logoghd logoHack The Box logo

The 8 Claude skills for Sanity at a glance

Four skills only read. Four can change the dataset, and each one waits for your yes before it does.

  1. 01Content inventoryTable of documents to update first

    Ryze AI tools used: sanity__query

    Changes data: No

  2. 02Missing fieldsFind documents with an empty field you name

    Ryze AI tools used: sanity__query

    Changes data: No

  3. 03Reference checkFind references that point at nothing

    Ryze AI tools used: sanity__query

    Changes data: No

  4. 04Slug checkCatch clashing slugs before creating content

    Ryze AI tools used: sanity__query

    Changes data: No

  5. 05Draft documentSave an entry as a draft after a dry run

    Ryze AI tools used: sanity__query, sanity__mutate

    Changes data: Yes, as a draft

  6. 06Patch fieldsChange one field on chosen documents

    Ryze AI tools used: sanity__query, sanity__mutate

    Changes data: Yes

  7. 07Draft vs publishedList what changes on publish

    Ryze AI tools used: sanity__query

    Changes data: No

  8. 08Delete cleanupRemove documents by id after a check

    Ryze AI tools used: sanity__query, sanity__delete

    Changes data: Yes

The tool names are the 3 Sanity tools on the Ryze AI connector: sanity__query, sanity__mutate and sanity__delete.

What are Claude skills for Sanity?

Per Anthropic's Agent Skills docs, a skill is a folder with a SKILL.md file that starts with a name and a description. Claude loads the name and description at startup and reads the rest of the file only when your request matches the description.

The name allows up to 64 lowercase letters, numbers and hyphens, and cannot contain the reserved words anthropic or claude. The description has a limit of 1,024 characters and has to say what the skill does and when to use it. Every skill here starts with sanity for that reason.

  1. What it is

    One-off prompt
    A question in chat
    Skill
    A saved file with fixed steps and output
    Sanity connection
    Tools Claude uses to reach the dataset
  2. Setup

    One-off prompt
    None
    Skill
    Save once per Claude app
    Sanity connection
    Project ID and an Editor token, once
  3. Same steps each run

    One-off prompt
    No
    Skill
    Yes
    Sanity connection
    Depends on the prompt or skill

A skill carries the steps and the approval rules. The connection carries the access. Without a connection, Claude can still follow a skill on content you paste in. For the connection itself, see the Sanity MCP page.

How to install the skills in Claude

Claude Code

Save each block as ~/.claude/skills/<skill-name>/SKILL.md for yourself, or .claude/skills/<skill-name>/SKILL.md in a project to share it with a team. Claude discovers them on its own (Agent Skills docs).

claude.ai

Zip each skill folder and upload it as a custom skill. Anthropic lists this on the Pro, Max, Ultra, Team and Enterprise plans with code execution enabled.

Connect Sanity

Add the Ryze AI connector in Claude under Customize > Connectors with the URL https://connector.get-ryze.ai/mcp, then connect Sanity in the Ryze AI app. The Sanity MCP page has the steps.

Anthropic says custom skills do not sync across surfaces: a skill uploaded to claude.ai is not in Claude Code or the API, so install it where you use it. Anthropic also advises using skills only from sources you trust, so read each file before you save it. The skills here are text only and run no scripts.

Read skills: audit the dataset without changing it

These four use only sanity__query. A GROQ query starts with `*` for all documents, filters with `[...]` and shapes the result with a projection in curly braces, as in Sanity's GROQ cheat sheet. The connector's query tool can read published documents, drafts or both.

The skills ask you for document types and field names instead of guessing them, because every Sanity schema is different. The query shapes inside each file are starting points for Claude to adapt.

01. Content inventory

Builds one table of documents of a type with slug, dates and published or draft state, and marks old documents as refresh candidates.

SKILL.md
--- name: sanity-content-inventory description: Lists the documents of one type in a Sanity dataset with title, slug and dates. Use when asked what content exists or what to update first. --- # Sanity content inventory Tool: sanity__query (read only). Ask me for the document type, such as post. Query shape (GROQ): *[_type == "post"] | order(_updatedAt asc) {_id, title, "slug": slug.current, _createdAt, _updatedAt} Steps: 1. Run the query on published documents, then again on drafts. 2. Build one table: id, title, slug, created, updated, published or draft. 3. Mark documents not updated in over 12 months as refresh candidates. Output: the table and the refresh list. Change nothing.

Use it when: you take over a project or plan a content refresh.

02. Missing fields

Uses GROQ's `defined()` check to list documents where a field you name is missing or empty, such as a meta description or a cover image.

SKILL.md
--- name: sanity-missing-fields description: Finds documents in Sanity where a field I name is empty or missing. Use for missing meta descriptions, images, authors or categories. --- # Sanity missing fields Tool: sanity__query (read only). Ask me for the document type and the field names to check. Do not guess field names. Query shape (GROQ): *[_type == "post" && (!defined(<field>) || <field> == "")] {_id, title, "slug": slug.current} Steps: 1. Run one query per field on published documents. 2. List each hit with its id, title and slug. 3. Count the hits per field. Output: a table of field, count and the affected documents. Change nothing.

Use it when: a template needs a field that older documents never filled in.

03. Reference check

Follows references with the `->` operator and flags documents where the target comes back empty. It also checks drafts that point at documents with no published version.

SKILL.md
--- name: sanity-reference-check description: Finds Sanity documents whose references point at a missing or unpublished document. Use before a launch or after deleting content. --- # Sanity reference check Tool: sanity__query (read only). Ask me for the document type and the reference fields, such as author or categories. Query shape (GROQ): *[_type == "post"] {_id, title, "author": author->{_id, name}} Steps: 1. Run the query on published documents. 2. Flag every document whose dereferenced field comes back null. 3. Run it again on drafts and list the drafts that reference documents with no published version. Output: a table of document, field and the broken reference. Change nothing.

Use it when: you delete content or prepare a release.

04. Slug check

Lists slugs that already exist before you create anything. Ryze AI's own publishing stops when one of your posts already uses the same slug, so this check also helps before a Content Plan run.

SKILL.md
--- name: sanity-slug-check description: Checks a Sanity dataset for duplicate or clashing slugs before new content is created. Use before any bulk create or publish. --- # Sanity slug check Tool: sanity__query (read only). Ask me for the document type and the slugs I plan to use. Query shape (GROQ): *[_type == "post" && slug.current in [<slugs>]] {_id, title, "slug": slug.current} Steps: 1. Run the query on published documents and on drafts. 2. Report every slug that already exists, with the document id. 3. Also list slugs that appear on more than one document in the type. Output: clash table and the slugs that are free. Create nothing.

Use it when: you plan a batch of new entries.

Write skills: drafts, patches, comparisons and deletes

Sanity stores a draft as a separate document with a drafts. prefix on its id. When you publish, the content moves to the id without the prefix (Sanity docs on drafts). The connector's mutate tool follows the same rule: a plain id publishes immediately, a drafts. id leaves a draft, and dryRun validates without writing.

That is why the write skills pin the id prefix and run a dry run first. Sanity's mutation reference says a dry run validates a mutation without executing it, and that mutations in one request run as one transaction.

05. Draft document

Copies the field names from your newest documents, checks the slug, validates a create mutation with a dry run and saves the result as a draft.

SKILL.md
--- name: sanity-draft-document description: Creates a Sanity document as a draft from text I give. Use when asked to save an article or entry to Sanity for review. --- # Sanity draft document Tools: sanity__query, then sanity__mutate. Inputs I will give: document type, the field values, the slug. Steps: 1. Run sanity__query to read my 2 newest documents of that type and copy their field names. Ask me if a field is unclear. 2. Run sanity__query for the slug and stop if it already exists. 3. Run sanity__mutate with dryRun and a create mutation whose _id starts with drafts. Show me the result. 4. Wait for my yes. Then run the same mutation without dryRun. 5. Read the document back with sanity__query and confirm the fields. Rules: always use an id that starts with drafts. A plain id publishes the document on the live site, so never use one in this skill. Output: document id, type, slug and the fields written.

Use it when: you write in Claude and publish from Studio.

06. Patch fields

Shows old and new values for one field, then runs the patch as a dry run before the real write. Patch order inside Sanity is fixed by the API, so the skill sets one field at a time.

SKILL.md
--- name: sanity-patch-fields description: Changes one field on documents I choose in Sanity, with a dry run first. Use for title, description or flag updates across several documents. --- # Sanity patch fields Tools: sanity__query, then sanity__mutate. Inputs I will give: document type, field name, the new value or the rule for it. Steps: 1. Read the matching documents with sanity__query and show id, current value and proposed value in a table. 2. Wait for my yes on the table. 3. Run one sanity__mutate call with a patch for each approved document and dryRun on. 4. Show me the dry run result. Wait for a second yes. 5. Run it again without dryRun, then read the documents back. Rules: patch only the field I named. Patch the draft (drafts. id) when one exists; a patch on the published id changes the live document. Output: table of id, field, old value, new value.

Use it when: several documents need the same field change.

07. Draft vs published

Reads drafts and their published versions and lists the fields that differ. It only reads, so it is safe to run before a review.

SKILL.md
--- name: sanity-draft-vs-published description: Compares drafts with their published versions in Sanity and lists what would change on publish. Use before a review or a release. --- # Sanity draft vs published Tool: sanity__query (read only). Ask me for the document type. Steps: 1. Query documents whose _id starts with drafts. and note each id. 2. Query the published version of each, using the id without the drafts. prefix. 3. For each pair, list the fields that differ with the old and new value. 4. List drafts with no published version as new documents. Output: one table of document, field, published value and draft value. Publish nothing.

Use it when: an editor asks what a publish will change.

08. Delete cleanup

Lists each document, its draft and what references it, then deletes only the ids you approve. The connector's delete tool takes ids and removes drafts only when their ids are given.

SKILL.md
--- name: sanity-delete-cleanup description: Deletes Sanity documents I name by id after listing them and their drafts. Use for removing test content or retired entries. --- # Sanity delete cleanup Tools: sanity__query, then sanity__delete. Ask me for the document ids, or for a rule I want to match. Steps: 1. Run sanity__query to read each document and any drafts. id copy. Show id, type, title and status. 2. Check for references to each document and say which documents point at it. 3. Say that a delete cannot be undone from here. Ask for my explicit yes on the exact list. 4. Run sanity__delete with the approved ids. Include the drafts. id only if I approved the draft too. 5. Query again to confirm the documents are gone. Output: ids deleted and ids kept. Delete nothing that is not on my approved list.

Use it when: you remove test content. Set the delete tool to Needs approval in Claude as well.

Run the skills on a live dataset through the connector

The Ryze AI connector gives Claude 3 Sanity tools: sanity__query runs GROQ against the connected dataset, sanity__mutate runs create, createOrReplace, createIfNotExists or patch mutations in one transaction, and sanity__delete deletes documents by id.

  1. Project ID

    What Ryze AI asks for
    Copied from sanity.io/manage
  2. Token

    What Ryze AI asks for
    A Sanity API token with Editor permissions; a Viewer token is rejected
  3. Dataset

    What Ryze AI asks for
    Optional, production by default
  4. Blog URL

    What Ryze AI asks for
    The public address your site serves posts under
  5. Document type

    What Ryze AI asks for
    Chosen after connecting

There is one Sanity connection per workspace, tied to one project and dataset. The steps are in the Ryze AI help center.

Because the token is an Editor token, the mutate and delete tools can change any document in the dataset, not only documents Ryze AI created. The promise that Ryze AI never edits posts it did not create applies to Content Plan publishing, which is a separate path.

To require approval, open Customize > Connectors > Ryze AI > Tool permissions in Claude and set the write and delete tools to Needs approval. The skills above also ask in the chat, but the setting is what Claude enforces. The Ryze AI app chat starts on Skip all approvals; switch to Approve write and delete or Manual approve in the message box.

Connecting is free, and the Sanity tools need an active Ryze AI plan or trial. Publishing pages lead with SEO Starter at $129 a month with a 3-day free trial. Prices are on the pricing page.

Other ways to give Claude Sanity access

Sanity runs its own MCP server at https://mcp.sanity.io. Its docs say it uses OAuth by default or an API token in the Authorization header, and that agents can run GROQ queries, patch documents, manage releases and work with the schema (Sanity MCP server docs). The Ryze AI connector exposes 3 tools and no schema or release tools.

Skills work with either. The tool names inside each SKILL.md change if you switch servers, so rename them to match what Claude shows under the connector. The Ryze AI connector is the one that shares a URL with its other platforms and publishes Content Plan articles to the dataset.

Troubleshooting: when a Sanity skill fails

Claude has no Sanity tools

Claude keeps the tool list from when you added the connector. Connect Sanity in Ryze AI, then remove and re-add the connector and start a new chat.

The connection is rejected

A Viewer token is rejected. Create a token with Editor permissions under API > Tokens.

A query returns nothing

Check the document type and field names against your schema, and the dataset the connection points at.

A write went live

A plain document id publishes immediately. Use an id that starts with drafts. for drafts.

Studio edits disappeared

Edits made in Studio to a Ryze AI article are replaced the next time Ryze AI republishes it.

The site does not show new content

A static front end needs its own rebuild, such as a Sanity webhook to the host.

Sources

The verdict

Save the tasks you repeat as skills, start with the inventory and slug check, and keep the writing skills behind a dry run and an approval step. One-off questions can stay prompts.

Ryze AI runs these skills in Claude on a live Sanity dataset. It has no schema tools, and a front end that builds statically needs its own rebuild after a change.

Frequently asked questions

What are Claude skills for Sanity?
SKILL.md files that tell Claude which Sanity task to run, which connector tools to use and how to present the result. Claude loads one when a request matches its description.
Do I need a Sanity connection to use these skills?
No. Each skill also works on content you paste in. A connection lets Claude run GROQ queries and make the changes itself.
Which Claude plan do I need?
Anthropic lists custom skill uploads on claude.ai for Pro, Max, Ultra, Team and Enterprise with code execution enabled. In Claude Code, skills are folders on your computer. Custom connectors using remote MCP are available on Free, Pro, Max, Ultra, Team and Enterprise, and Free is limited to one.
Which tools do the skills use?
The 3 Sanity tools on the Ryze AI connector: sanity__query to read, sanity__mutate to create or patch, and sanity__delete to remove documents by id.
Show 6 more questions
Can these skills publish to my live site?
Yes, if a mutation uses a plain document id, which publishes immediately. The draft skill pins ids to the drafts. prefix, and every writing skill runs a dry run first.
What access does the Sanity token need?
An Editor token. Ryze AI rejects a Viewer token. The same token lets the mutate and delete tools change any document in the dataset.
How do I require approval before a change?
In Claude, open Customize > Connectors > Ryze AI > Tool permissions and set the write and delete tools to Needs approval. The skills also ask in the chat.
Does Sanity have its own MCP server?
Yes. Sanity runs one at https://mcp.sanity.io with OAuth or an API token, and its docs list GROQ queries, document patches, releases and schema operations. The Ryze AI connector has 3 Sanity tools.
Can I use the skills with several Sanity projects?
Not in one workspace. There is one Sanity connection per workspace, tied to one project and dataset. To switch, disconnect in Ryze AI and connect again.
Is there a skill that deletes content?
Yes, number 08. It lists each document, its drafts and its references, then deletes only the ids you approve. Keep the delete tool on Needs approval in Claude.

Related guides

Ryze AI: Sanity skills on your dataset

3-day free trial, $129 a month

Start free trial