mirror of
https://github.com/sanity-io/agent-toolkit.git
synced 2026-09-14 18:39:20 +08:00
450394fc0f
Co-authored-by: Cursor <cursoragent@cursor.com>
1.3 KiB
1.3 KiB
name, description
| name | description |
|---|---|
| review | 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
-
Definition Syntax
- Using
defineType,defineField,defineArrayMember - Icons assigned from
@sanity/icons - Proper validation rules
- Using
-
Data Modeling
- "Data > Presentation" philosophy (no
bigHero,redButton) - Correct use of references vs nested objects
- Proper deprecation pattern for removed fields
- "Data > Presentation" philosophy (no
-
Organization
- File naming conventions (kebab-case)
- Schema directory structure
Query Review
-
TypeGen Compatibility
- Queries wrapped in
defineQuery - SCREAMING_SNAKE_CASE naming
- Proper field projections (not
*)
- Queries wrapped in
-
Performance
- No unnecessary deep expansions
- Using query parameters (not string interpolation)
Frontend Review
-
Visual Editing
- Using
_keyfor array item keys (not index) stegaCleanfor logic-critical values- No stega in
<head>tags
- Using
-
Type Safety
- Using generated types from
sanity.types.ts - No manual typing of query results
- Using generated types from
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"