Skip to content

/sanity-review

Review code for Sanity best practices and common issues.

From plugin
sanity
1974 skills4 commands1 MCP
> /plugin marketplace add sanity-io/agent-toolkit
> /plugin install sanity@sanity-agent-toolkit

Command definition

sanity-review.md
name: sanity-review
description: Review code for Sanity best practices and common issues.

Sanity Code Review

I'll review your Sanity code for best practices. Here's what I check:

Schema Review

1. **Definition Syntax**

  • Using `defineType`, `defineField`, `defineArrayMember`
  • Icons assigned from `@sanity/icons`
  • Proper validation rules
  • No redundant `title` that only repeats the `name` (e.g. `name: 'author', title: 'Author'`)

2. **Data Modeling**

  • "Data > Presentation" philosophy (no `bigHero`, `redButton`)
  • Correct use of references vs nested objects
  • Proper deprecation pattern for removed fields

3. **Organization**

  • File naming conventions (kebab-case)
  • Schema directory structure

Query Review

1. **TypeGen Compatibility**

  • Queries wrapped in `defineQuery`
  • SCREAMING_SNAKE_CASE naming
  • Proper field projections (not `*`)

2. **Performance**

  • No unnecessary deep expansions
  • Using query parameters (not string interpolation)

Frontend Review

1. **Visual Editing**

  • Using `_key` for array item keys (not index)
  • `stegaClean` for logic-critical values
  • No stega in `<head>` tags

2. **Type Safety**

  • Using generated types from `sanity.types.ts`
  • No manual typing of query results

Usage

Just ask me to review specific files or your whole Sanity setup: > "Review my post schema" > "Check my GROQ queries for issues" > "Review my Sanity frontend integration"

Read more
@sanity-io
Ships withsanity

Collection of resources to help AI agents build better with Sanity.

Stars on GitHub

Momentum

stars in total
197
Star history of sanity-io/agent-toolkit on GitHub, a chart by star-history.com

Other commands on sanity.

typegen
Auto-invoked

typegen

Command

Run Sanity TypeGen and troubleshoot type generation issues.

@sanity-io@sanity-ioInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command