sanity-best-practices

tarafından sanity-io

Sanity CMS geliştirme için çerçeveler ve konular arasında kapsamlı en iyi uygulamalar ve entegrasyon kılavuzları. Next.js, Nuxt, Astro, Remix, SvelteKit ve Angular dahil olmak üzere 10'dan fazla çerçeve entegrasyonunu, çerçeveye özel desenler ve kurulum rehberliği ile kapsar. Şema tasarımı, GROQ sorgu optimizasyonu, Görsel Düzenleme, Portable Text, görseller, TypeGen, yerelleştirme ve içerik taşımaları için konu kılavuzları içerir. Görev türüne göre yalnızca ilgili kılavuzları yüklemek için hızlı başvuru yapısı sağlar,...

npx skills add https://github.com/sanity-io/agent-toolkit --skill sanity-best-practices

Sanity Best Practices

Comprehensive best practices and integration guides for Sanity development, maintained by Sanity. Use the quick reference below to load only the one or two topic files that match the task.

When to Apply

Reference these guidelines when:

  • Setting up a new Sanity project or onboarding
  • Integrating Sanity with a frontend framework (Next.js, Nuxt, Astro, Remix, SvelteKit, Hydrogen)
  • Writing GROQ queries or optimizing performance
  • Designing content schemas
  • Implementing Visual Editing and live preview
  • Working with images, Portable Text, or page builders
  • Configuring Sanity Studio structure
  • Setting up TypeGen for type safety
  • Implementing localization
  • Migrating content from other systems
  • Building custom apps with the Sanity App SDK
  • Managing infrastructure with Blueprints
  • Automating content workflows with Sanity Functions

Global Rules

  • Let Sanity generate _id values for ordinary documents. Do not create deterministic UUIDs, slug-derived IDs, or legacy-system IDs when creating documents.
  • Model relationships with reference fields, then resolve related documents with GROQ lookups, source-key fields, or returned _id values from created documents.
  • Use explicit document IDs mainly for singleton documents controlled by Studio Structure, including localized singletons such as homePage-en.

Quick Reference

Integration Guides

  • get-started - Interactive onboarding for new Sanity projects
  • nextjs - Next.js App Router, Live Content API, standalone Studio
  • nuxt - Nuxt integration with @nuxtjs/sanity
  • angular - Angular integration with @sanity/client, signals, resource API
  • astro - Astro integration with @sanity/astro
  • remix - React Router / Remix integration
  • svelte - SvelteKit integration with @sanity/svelte-loader
  • hydrogen - Shopify Hydrogen with Sanity
  • project-structure - Standalone Studio and monorepo patterns
  • app-sdk - Custom applications with Sanity App SDK
  • blueprints - Infrastructure as Code with Sanity Blueprints
  • functions - Automating content workflows with Sanity Functions

Topic Guides

  • groq - GROQ query patterns, type safety, performance optimization
  • schema - Schema design, field definitions, validation, deprecation patterns
  • visual-editing - Presentation Tool, Stega, overlays, live preview
  • page-builder - Page Builder arrays, block components, live editing
  • portable-text - Rich text rendering and custom components
  • image - Image schema, URL builder, hotspots, LQIP, Next.js Image
  • studio-structure - Desk structure, singletons, navigation
  • typegen - TypeGen configuration, workflow, type utilities
  • seo - Metadata, sitemaps, Open Graph, JSON-LD
  • localization - i18n patterns, document vs field-level, locale management
  • migration - Content import overview (see also migration-html-import)
  • migration-html-import - HTML to Portable Text with @portabletext/block-tools

How to Use

Start with the single framework or topic guide that best matches the request, then read additional references only when the task crosses concerns. Use these reference files for detailed explanations and code examples:

references/groq.md
references/schema.md
references/nextjs.md

Each reference file contains:

  • Comprehensive topic or integration coverage
  • Incorrect and correct code examples
  • Decision matrices and workflow guidance
  • Framework-specific patterns where applicable

sanity-io tarafından daha fazla skill

sanity-migration
sanity-io
Diğer CMS ve içerik sistemlerinden Sanity’ye geçişleri planlar, uygular ve gözden geçirir. AEM, Adobe Experience Manager, Contentful, Strapi, Webflow, WordPress, Payload, Drupal, Markdown/MDX/frontmatter dosyaları, WXR/XML dışa aktarımları, CMS API’leri, veritabanı dökümleri, statik HTML’den Sanity’ye geçiş veya platform değişikliği yaparken ya da çıkarma, dönüştürme, Portable Text çevirisi, varlık geçişi, yönlendirmeler, doğrulama ve kesinti iş akışları tasarlarken kullanın.
officialdevelopmentdatabase
create-agent-with-sanity-context
sanity-io
Sanity içeriğine Agent Context aracılığıyla yapılandırılmış erişime sahip AI ajanları oluşturun. Sanity destekli bir sohbet robotu kurarken, bir AI asistanını Sanity'ye bağlarken kullanın…
official
dial-your-context
sanity-io
Sanity Agent Context MCP için Talimatlar alanı içeriği oluşturmaya yönelik etkileşimli oturum. Kullanıcıların aracı bağlamını ayarlamaktan, iyileştirmekten bahsettiği durumlarda bu beceriyi kullanın…
official
optimize-agent-prompt
sanity-io
Sanity Agent Context ajanınızı rehberli konuşma yoluyla ayarlayın. Keşif verilerini üretime hazır talimatlara dönüştürür ve bir sistem istemi oluşturur…
official
shape-your-agent
sanity-io
Sanity Agent Context MCP tarafından desteklenen bir AI ajanı için sistem istemini oluşturmaya yönelik etkileşimli oturum. Kullanıcılar ajan kişiliğini tanımlamak istediğinde bu beceriyi kullanın,…
official
content-experimentation-best-practices
sanity-io
Dönüşüm ve etkileşimi artırmak için içerik deneyleri tasarlama, yürütme ve analiz etme konusunda yapılandırılmış rehberlik. Hipotez çerçeveleri, metrik seçimi, örneklem büyüklüğü hesaplama ve A/B ile çok değişkenli deneylerde istatistiksel anlamlılık testini kapsar. Sonuçları yorumlamak için p-değerleri, güven aralıkları, güç analizi ve Bayes yöntemleri hakkında ayrıntılı kaynaklar sunar. Varyantları alan düzeyinde yönetmek ve harici bağlantı kurmak için CMS entegrasyon modelleri sağlar...
official
content-modeling-best-practices
sanity-io
Yapılandırılmış içerik modelleme rehberliği: şema tasarımı, yeniden kullanılabilirlik ve çok kanallı dağıtım için. Temel prensipleri kapsar: içeriği sayfa yerine veri olarak ele almak, tek doğruluk kaynağını korumak, gelecekteki kanallar için tasarlamak ve editör iş akışlarını optimize etmek. Referanslar ile gömülü nesneler arasında karar çerçeveleri, endişelerin ayrıştırılması ve içerik yeniden kullanım desenleri sunar. Düz, hiyerarşik ve yönlü yaklaşımlar için taksonomi ve sınıflandırma rehberliği sağlar. Şunlar için geçerlidir...
official
portable-text-conversion
sanity-io
HTML ve Markdown içeriğini Sanity için Portable Text bloklarına dönüştürün. Eski CMS'lerden içerik taşırken, HTML veya Markdown'ı Sanity'ye aktarırken kullanın.
official