All skills
sanity-io avatar

/content-modeling-best-practices

@ad50ea4 official
by Sanitysanity-io/agent-toolkit187 stars
30

Structured content modeling guidance for schema design, content architecture, content reuse, references versus embedded objects, separation of concerns, and taxonomies across Sanity and other headless CMSes. Use this skill when designing or refactoring content types, deciding field shapes, debating reusable versus nested content, planning omnichannel content models, or reviewing whether a schema is too page-shaped or presentation-driven.

Use this Skill: https://skilld.dev/gh/sanity-io/agent-toolkit/content-modeling-best-practices

This session only. Nothing lands on disk.

referencesseparation-of-concerns.md

≈537 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Separation of Content and Presentation

The most important principle in structured content: separate what content IS from how it LOOKS.

The Problem

When content is tied to presentation:

  • Redesigns require content migration
  • Content can't be reused across channels (web, mobile, voice)
  • Editors make design decisions instead of content decisions
  • A/B testing requires duplicate content

The Principle

Model content based on meaning and purpose, not visual appearance.

Bad: Presentation-Focused

BigHeroText       → What if we want small heroes?
RedButton         → What if brand colors change?
ThreeColumnLayout → What if mobile needs one column?
LeftSidebar       → Position is a frontend concern
MobileImage       → Device-specific content is fragile

Good: Meaning-Focused

Headline          → The main message (render however)
CallToAction      → An action we want users to take
Features          → A list of things (columns decided by frontend)
RelatedContent    → Content relationships (position by context)
Image             → One image with responsive crops

Testing Your Model

Ask: "If we completely redesigned the site, would these field names still make sense?"

  • threeColumnFeatures → ❌ Fails (what if 2 columns?)
  • features → ✅ Works (describes the content's purpose: a list of product features)
  • blueHighlightBox → ❌ Fails (what if we go purple?)
  • callout → ✅ Works (describes the content's role: an attention-grabbing aside)

Sanity Implementation

// ❌ Avoid presentation-focused names
defineField({ name: 'bigHeroText', type: 'string' })
defineField({ name: 'fontSize', type: 'number' })
defineField({ name: 'backgroundColor', type: 'color' })

// ✅ Use meaning-focused names
defineField({ name: 'headline', type: 'string' })
defineField({ name: 'emphasis', type: 'string', options: { list: ['standard', 'prominent'] } })
defineField({ name: 'tone', type: 'string', options: { list: ['neutral', 'warning', 'success'] } })

The frontend translates tone: 'warning' to visual styles. Content stays semantic.

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill consists of purely instructional documentation regarding content modeling and schema design best practices for Sanity and headless CMS structures. It contains no executable scripts, system commands, external network connections, or data operations, and is completely safe.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    5 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at ad50ea4. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 6 months ago
  • sanity
  • headless-cms
  • content-modeling
  • schema-design
  • content-architecture
  • references
  • taxonomies
  • structured-content

README badge

README badge for sanity-io/agent-toolkit/content-modeling-best-practices

Guides schema design for Sanity and headless CMSes through principles like content-as-data, single source of truth, and editor-centric structure. Covers references vs embedded objects, separation of concerns, content reuse patterns, and taxonomy design to avoid page-shaped or presentation-driven schemas.

Generated from the current SKILL.md.

Does this skill apply to CMSes other than Sanity?
Yes. The skill covers general content modeling principles that apply to any headless CMS, with Sanity-specific implementation notes included where relevant.
What specific decisions does this skill help with?
It guides decisions on schema design, references versus embedded objects, content reuse patterns, taxonomy structures, and whether a model is too page-shaped or presentation-driven.
Does this skill provide code examples or just principles?
The skill provides structured guidance documents covering separation of concerns, reference vs embedding, content reuse, and taxonomy classification. It is principles-focused rather than code-focused.
Can I use this when refactoring an existing content model?
Yes. The skill is designed for both new projects and refactoring existing structures to improve reusability and flexibility.

Generated from the current SKILL.md. These answers refresh after source changes.