agent-toolkit
AGENTS.md194 starsChanged 6 months agoMITView on GitHub
This is a Sanity-powered project. Use the Knowledge Router below to find Sanity guidance for your task. Available as a Claude Code plugin and Cursor plugin. If the Sanity MCP server (https://mcp.sanity.io) is available, use listsanityrules and getsanityrules to load always up-to-date rules on demand. Otherwise, use the table below to find local reference files. For the full reference index, see skills/sanity-best-practices/SKILL.md.
- Reads credentials
We split this AGENTS.md into the rules it gives an agent
12 rules. About 0 are common, 6 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
If the Sanity MCP server (https://mcp.sanity.io) is available, use list_sanity_rules and get_sanity_rules to load always up-to-date rules …
- Distinctive: line 75
Read the corresponding reference file(s) using the file path
- Distinctive: line 76
Follow the patterns and constraints defined in those references
- Distinctive: line 83
Write best-practice, type-safe code using Sanity TypeGen.
- Very specific: line 144
Critical: After schema changes, deploy with deploy_schema so content tools see the latest schema.
- Very specific: line 148
Use defineQuery for all GROQ queries.
- Distinctive: line 149
Prefer MCP tools for content operations (query, create, update, patch).
- Very specific: line 150
Run deploy_schema after schema changes so MCP content tools use the latest schema.
- Distinctive: line 151
Follow the "Deprecation Pattern" when removing fields (ReadOnly -> Hidden -> Deprecated).
- Very specific: line 152
Run npm run typegen after schema or query changes (or enable automatic generation with typegen.enabled: true in sanity.cli.ts).
- Distinctive: line 155
Before deleting any schema definition file.
- Very specific: line 158
Use loose types (any) for Sanity content.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sanity Project
This is a Sanity-powered project. Use the Knowledge Router below to find Sanity guidance for your task. Available as a Claude Code plugin and Cursor plugin.
Commands
# MCP Setup
npx sanity@latest mcp configure # Configure MCP for your AI editor
# Schema & Types
npx sanity schemas deploy # Deploy schema to Content Lake for MCP/editor access
npx sanity schemas extract # Extract schema for TypeGen
npx sanity typegen generate # Generate TypeScript types
# Development
npx sanity dev # Start Studio dev server
npx sanity build # Build Studio for production
npx sanity deploy # Deploy Studio to Sanity hosting
# Blueprints (infrastructure as code)
npx sanity blueprints init # Initialize a Blueprint and create a Stack
npx sanity blueprints plan # Preview infrastructure changes (read-only)
npx sanity blueprints deploy # Apply the Blueprint to the Stack
npx sanity blueprints info # Verify Stack status and deployed resources
npx sanity blueprints logs # View Stack deployment logs
# Help
npx sanity docs search "query" # Search Sanity documentation
npx sanity --help # List all CLI commandsKnowledge Router
If the Sanity MCP server (https://mcp.sanity.io) is available, use list_sanity_rules and get_sanity_rules to load always up-to-date rules on demand. Otherwise, use the table below to find local reference files.
For the full reference index, see
skills/sanity-best-practices/SKILL.md.
| Topic | Trigger Keywords | Reference |
| Onboarding | start, setup, init, new project | skills/sanity-best-practices/references/get-started.md |
| Project Structure | structure, monorepo, embedded studio, file naming | skills/sanity-best-practices/references/project-structure.md |
| Schema | schema, model, document, field, defineType | skills/sanity-best-practices/references/schema.md |
| Deprecation | deprecate, remove field, legacy, migration | skills/sanity-best-practices/references/schema.md |
| Migration / Replatforming | migrate, migration, replatform, AEM, Contentful, Strapi, Webflow, WordPress, Payload, Drupal, WXR, CMS export, database dump | skills/sanity-migration/SKILL.md |
| Markdown Import | markdown, mdx, frontmatter, static content, README import, markdown files | skills/sanity-migration/references/markdown.md |
| HTML / Portable Text Import | html, portable text import, block-tools, htmlToBlocks | skills/sanity-best-practices/references/migration.md |
| Next.js | next.js, app router, server component, fetch | skills/sanity-best-practices/references/nextjs.md |
| Nuxt | nuxt, vue, nuxt.js | skills/sanity-best-practices/references/nuxt.md |
| Angular | angular, signals, resource api | skills/sanity-best-practices/references/angular.md |
| Astro | astro, islands | skills/sanity-best-practices/references/astro.md |
| Remix/React Router | remix, react router, loader | skills/sanity-best-practices/references/remix.md |
| Svelte | svelte, sveltekit, kit | skills/sanity-best-practices/references/svelte.md |
| Visual Editing | stega, visual editing, clean, overlay, presentation, usePresentationQuery | skills/sanity-best-practices/references/visual-editing.md |
| Page Builder | page builder, pageBuilder, block component, alignment, switch render | skills/sanity-best-practices/references/page-builder.md |
| Rich Text | portable text, rich text, block content, serializer, PTE, marks, annotations | skills/sanity-best-practices/references/portable-text.md |
| Images | image, urlFor, crop, hotspot, lqip | skills/sanity-best-practices/references/image.md |
| Studio Structure | structure, desk, sidebar, singleton, grouping | skills/sanity-best-practices/references/studio-structure.md |
| Singletons | singleton, document.singletons, defineSingleton, settings document, sanity-plugin-singleton-management | skills/sanity-singletons/SKILL.md |
| Form Component Suspense | custom input, components.input, components.field, components.item, form.components, Suspense, suspended without a <Suspense> boundary, React.lazy, layout shift | skills/sanity-form-component-suspense/SKILL.md |
| Localization | i18n, translation, localization, language, multilingual, localized singleton | skills/sanity-best-practices/references/localization.md |
| SEO | seo, metadata, sitemap, og image, open graph, json-ld, redirect | skills/sanity-best-practices/references/seo.md |
| Shopify/Hydrogen | shopify, hydrogen, e-commerce, storefront, sanity connect | skills/sanity-best-practices/references/hydrogen.md |
| GROQ | groq, query, defineQuery, projection, filter, order | skills/sanity-best-practices/references/groq.md |
| TypeGen | typegen, typescript, types, infer, satisfies, type generation | skills/sanity-best-practices/references/typegen.md |
| App SDK | app sdk, custom app, useDocuments, useDocument, DocumentHandle, SanityApp, sdk-react | skills/sanity-best-practices/references/app-sdk.md |
| Dashboard | dashboard, defineApplication, init --dashboard, sdk-react/dashboard, deployment.appId, app visibility | skills/sanity-best-practices/references/dashboard.md |
| Blueprints | blueprints, IaC, infrastructure, stack, defineBlueprint, sanity.blueprint.ts, blueprints deploy | skills/sanity-best-practices/references/blueprints.md |
| Sanity Functions & Webhooks | functions, webhook, serverless, event handler, documentEventHandler, defineDocumentFunction, sanity.blueprint.ts | skills/sanity-best-practices/references/functions.md |
Using the Knowledge Router
Before modifying any code:
- Identify which topics from the table above apply to your task
- Read the corresponding reference file(s) using the file path
- Follow the patterns and constraints defined in those references
Example: If asked to "create a blog post schema", read skills/sanity-best-practices/references/schema.md first.
Agent Behavior
- Specialize in Structured Content, GROQ, and Sanity Studio configuration.
- Write best-practice, type-safe code using Sanity TypeGen.
- Build scalable content platforms, not just websites.
- Detect the user's framework from
package.jsonand consult the appropriate reference file.
MCP Server (Preferred for Content Operations)
Prefer MCP tools over writing scripts for content operations:
Content Operations:
| Tool | Use For |
query_documents | Run GROQ queries |
get_document | Fetch a single document by exact ID |
create_documents | Create draft documents from structured content, or version documents when a release ID is provided |
patch_documents | Apply precise modifications to document fields; published documents are edited by creating/updating a draft |
publish_documents | Publish one or more drafts |
unpublish_documents | Unpublish documents (move back to drafts) |
discard_drafts | Discard drafts while keeping published documents |
Schema & Development:
| Tool | Use For |
get_schema | Get full schema of the current workspace (MCP-managed first, then Studio-deployed, then legacy schema) |
list_workspace_schemas | List all available workspace schema names |
deploy_schema | Deploy MCP-managed schema types to the cloud |
deploy_studio | Deploy a hosted Studio bound to an MCP-managed schema |
search_docs / read_docs | Search and read Sanity documentation |
list_sanity_rules / get_sanity_rules | Load best-practice development rules |
give_feedback | Report MCP tool errors, missing capabilities, confusing output, or documentation issues |
Media & AI:
| Tool | Use For |
generate_image | AI image generation for a document field |
transform_image | AI transformation of an existing image |
Releases:
| Tool | Use For |
create_release | Create a release for coordinated content changes |
list_releases | List active, scheduled, published, or archived releases |
create_version | Create a version document for a release |
version_discard | Discard document versions from a release |
version_unpublish_document | Mark document to be unpublished when release runs |
Project Management:
| Tool | Use For |
whoami | Verify the authenticated Sanity user |
list_projects / list_organizations | List projects and organizations |
get_project_studios | List Studio applications linked to a project |
create_project | Create a new Sanity project |
list_datasets / create_dataset / update_dataset | Manage datasets |
add_cors_origin | Add CORS origins for client-side requests |
list_embeddings_indices / semantic_search | Semantic search on embeddings |
Critical: After schema changes, deploy with deploy_schema so content tools see the latest schema. If using an MCP-managed Studio, redeploy it with deploy_studio after schema changes.
Boundaries
- Always:
- Use
defineQueryfor all GROQ queries. - Prefer MCP tools for content operations (query, create, update, patch). For bulk migrations or when MCP is unavailable, NDJSON scripts are a valid alternative. Never use NDJSON scripts when MCP tools can accomplish the same task more simply.
- Run
deploy_schemaafter schema changes so MCP content tools use the latest schema. If a local Studio exists, update schema files first to keep them in sync with the deployed schema. If using an MCP-managed Studio, rundeploy_studioafterdeploy_schema. - Follow the "Deprecation Pattern" when removing fields (ReadOnly -> Hidden -> Deprecated).
- Run
npm run typegenafter schema or query changes (or enable automatic generation withtypegen.enabled: trueinsanity.cli.ts).
- Use
- Ask First:
- Before modifying
sanity.config.ts. - Before deleting any schema definition file.
- Before modifying
- Never:
- Hardcode API tokens (use
process.env). - Use loose types (
any) for Sanity content.
- Hardcode API tokens (use
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

