sanity-rules

sanity-rules is a cursor rule for Cursor from robotostudio/turbo-start-sanity. It costs 0 tokens per session (2,545 once invoked), scanned A, original, MIT.

Rules for creating Sanity schemas, which define the fields and content types used by a Sanity content system. They cover named exports, TypeScript definitions, field helpers, and choosing icons for schemas.

In plain words
What is it for?
Use them when creating or changing Sanity schemas, including TypeScript schemas, arrays of objects, nested fields, and schema icons.
Why use it?
They keep schema code consistent and make its types and editor presentation clearer. They also reduce the chance of missing required structure when adding fields or nested objects.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them when creating or changing Sanity schemas, including TypeScript schemas, arrays of objects, nested fields, and schema icons.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/robotostudio/turbo-start-sanity/sanity-rules
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/robotostudio/turbo-start-sanity

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sanity-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/robotostudio/turbo-start-sanity/sanity-rules/github.svg)](https://agentmods.dev/rules/robotostudio/turbo-start-sanity/sanity-rules)
Your own site
<a href="https://agentmods.dev/rules/robotostudio/turbo-start-sanity/sanity-rules"><img src="https://agentmods.dev/badge/rules/robotostudio/turbo-start-sanity/sanity-rules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sanity-rules

Your own site · 80×15
<a href="https://agentmods.dev/rules/robotostudio/turbo-start-sanity/sanity-rules"><img src="https://agentmods.dev/badge/rules/robotostudio/turbo-start-sanity/sanity-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,545 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.02545
Opus 5 $0.00000 $0.01273
Sonnet 5 $0.00000 $0.00509
Haiku 4.5 $0.00000 $0.00254

Measured 9d ago against content hash 560b1179d5e0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

sanity-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/sanity-rules.mdc · 317 lines

How it starts

The opening of the file, as written. The whole thing — 317 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sanity Development Guidelines

Sanity Schema Rules

When creating sanity schema make sure to include an appropriate icon for the schema using lucide-react or sanity icons as a fallback. Make sure it's always a named export, make sure you're always using the Sanity typescript definitions if it's a ts file.

Basic Schema Structure

For TypeScript files, always import the necessary Sanity types:

import {defineField, defineType, defineArrayMember} from 'sanity'

Always use defineField on every field and defineType throughout the whole type. Only import defineArrayMember if needed:

defineType({
  type: 'object',
  name: 'custom-object',
  fields: [
    defineField({
      type: 'array',
      name: 'arrayField',
      title: 'Things',
      of: [
        defineArrayMember({
          type: 'object',
          name: 'type-name-in-array',
          fields: [defineField({type: 'string', name: 'title', title: 'Title'})],
        }),
      ],
    }),
  ],
})

Adding icons

When adding icons to a schema, make sure you use the default sanity/icons first, and then if no icon is relevant, refer to any other iconset the user has installed - e.g lucide-react.

Structuring files and folders

This is a rough idea of how to structure folders and files, ensuring you always have an index within the folder to create an array of documents/blocks. Do not use these as exact names, it's used purely for layout purposes.

│   ├── studio/
│   │   ├── README.md
│   │   ├── eslint.config.mjs
│   │   ├── location.ts
│   │   ├── package.json
│   │   ├── prettier.config.mjs
│   │   ├── sanity-typegen.json
│   │   ├── sanity.cli.ts
│   │   ├── sanity.config.ts
│   │   ├── schema.json
│   │   ├── structure.ts
│   │   ├── tsconfig.json
│   │   ├── .env.example
│   │   ├── .gitignore
│   │   ├── components/
│   │   │   ├── logo.tsx
│   │   │   └── slug-field-component.tsx
│   │   ├── plugins/
│   │   │   └── presentation-url.ts
│   │   ├── schemaTypes/
│   │   │   ├── common.ts
│   │   │   ├── index.ts
│   │   │   ├── blocks/
│   │   │   │   ├── cta.ts
│   │   │   │   ├── faq-accordion.ts
│   │   │   │   ├── feature-cards-icon.ts
│   │   │   │   ├── hero.ts
│   │   │   │   ├── image-link-cards.ts
│   │   │   │   ├── index.ts
│   │   │   │   └── subscribe-newsletter.ts
│   │   │   ├── definitions/
│   │   │   │   ├── button.ts
│   │   │   │   ├── custom-url.ts
│   │   │   │   ├── index.ts
│   │   │   │   ├── pagebuilder.ts
│   │   │   │   └── rich-text.ts
│   │   │   └── documents/
│   │   │       ├── author.ts
│   │   │       ├── blog.ts
│   │   │       ├── faq.ts
│   │   │       └── page.ts
│   │   └── utils/
│   │       ├── const-mock-data.ts
│   │       ├── constant.ts
│   │       ├── helper.ts
│   │       ├── mock-data.ts
│   │       ├── og-fields.ts
│   │       ├── parse-body.ts
│   │       ├── seo-fields.ts
│   │       ├── slug.ts
│   │       └── types.ts

Read the full file on GitHub · 317 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 317 lines · 0 tokens per session scan A 560b1179d5e0

Subscribe to this mod's changes

sanity-rules is a cursor rule published in the GitHub repository robotostudio/turbo-start-sanity (176 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,545 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.