Agent Native

sanity-migration

This skill plans, executes, and validates migrations from various content management systems and data sources into Sanity.

by SanityOfficial publisherNot reviewed

Identity proven by GitHub's verified organisation badge (sanity-io)

Agents
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
License
MIT (permissive)
Pin
88d6cdfpinned Oct 9, 2026
Context cost
about 1,200 tokenswhen the skill loads
GitHub stars
188on sanity-io/agent-toolkit
Scripts
None found

What it does

“Plans, implements, and reviews migrations from other CMSes and content systems into Sanity. Use when migrating or replatforming to Sanity from AEM, Adobe Experience Manager, Contentful, Strapi, Webflow, WordPress, Payload, Drupal, Markdown/MDX/frontmatter files, WXR/XML exports, CMS APIs, database dumps, static HTML, or when designing extraction, transformation, Portable Text conversion, asset migration, redirects, validation, and cutover workflows.”
The author's description, from SKILL.md

Generated summary from the skill's own text

This skill plans, executes, and validates migrations from various content management systems and data sources into Sanity. It guides extraction from AEM, Contentful, Strapi, Webflow, WordPress, Payload, Drupal, Markdown files, and other formats, then transforms and imports content while handling schema mapping, Portable Text conversion, asset migration, and redirect strategies.

When to use it

  • Migrating or replatforming existing CMS content to Sanity
  • Planning content extraction and transformation workflows
  • Designing schema mapping between source and target systems
  • Building deterministic, repeatable migration scripts

When not to

  • Migrating data between non-Sanity systems
  • One-off content operations that do not require structured validation
  • Tasks without clear source access or target schema definition

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add sanity-io/agent-toolkit --skill sanity-migration

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install sanity-io/agent-toolkit sanity-migration@88d6cdfa7cb06c99edd5f376efa4dac21ae3f877

Installs the commit we checked (88d6cdf).

Copy by hand

Download the folder at 88d6cdf and put it in .claude/skills/sanity-migration for Claude Code and in .agents/skills/sanity-migration for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at 88d6cdf

Claude Code plugin

/plugin install sanity@claude-plugins-official

The publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "sanity-migration" by Sanity.

Source, pinned to commit 88d6cdfa7cb06c99edd5f376efa4dac21ae3f877:
https://github.com/sanity-io/agent-toolkit/tree/88d6cdfa7cb06c99edd5f376efa4dac21ae3f877/skills/sanity-migration

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/sanity-migration/ for Claude Code and .agents/skills/sanity-migration/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/sanity/sanity-migration

SKILL.md at the pin

---
name: sanity-migration
description: Plans, implements, and reviews migrations from other CMSes and content systems into Sanity. Use when migrating or replatforming to Sanity from AEM, Adobe Experience Manager, Contentful, Strapi, Webflow, WordPress, Payload, Drupal, Markdown/MDX/frontmatter files, WXR/XML exports, CMS APIs, database dumps, static HTML, or when designing extraction, transformation, Portable Text conversion, asset migration, redirects, validation, and cutover workflows.
---

# Sanity Migration

Use this skill for CMS-to-Sanity migration work. Treat migration as a content strategy and ETL project, not a blind lift-and-shift.

## Required Workflow

1. Read `references/general.md` first.
2. If the source platform is known, also read its guide:
   - AEM / Adobe Experience Manager: `references/aem.md`
   - Contentful: `references/contentful.md`
   - Strapi: `references/strapi.md`
   - Webflow: `references/webflow.md`
   - WordPress / WXR / Elementor: `references/wordpress.md`
   - Payload: `references/payload.md`
   - Drupal: `references/drupal.md`
   - Markdown / MDX / frontmatter files: `references/markdown.md`
3. Before writing code, produce a short migration plan covering source access, content scope, schema decisions, extraction, transformation, import, validation, redirects, and cutover.
4. Prefer deterministic, repeatable scripts for real migrations. Write and review migration scripts, mappings, and validation checks; do not rely on one-off content operations for large content volumes.

## Deliverables to Produce

For implementation or planning tasks, produce these artifacts or explain why they are not needed:

- Content inventory: source types, counts, locales, status/draft scope, assets, and relationship types.
- Source-to-Sanity mapping: document types, object types, references, Portable Text fields, asset fields, IDs, and skipped content.
- Extraction approach: credentials/access needed, API/export commands, raw snapshot location, and known blind spots.
- Transform/import plan: deterministic IDs, write order, asset handling, rich text conversion, validation, and rerun strategy.
- Cutover plan: delta sync/content freeze, redirects, broken-link checks, SEO metadata, and manual cleanup.

## Defaults

- Use stable document IDs derived from source IDs, slugs, paths, or hashes.
- Use `createOrReplace`, `createIfNotExists`, or `sanity datasets import --replace` so reruns converge.
- Snapshot extracted source data to disk before transforming it.
- Import or create referenced documents before documents that reference them.
- Convert rich text to Portable Text instead of storing raw HTML or Markdown strings.
- Upload assets to Sanity or the Media Library; do not leave production content dependent on legacy CDN URLs.
- Track per-document quality issues and produce a validation summary before cutover.
- Preserve legacy URLs and source IDs for redirects, QA, and future debugging.

## Sanity Guardrails

- Model what content is, not how the old site rendered it.
- Use documents for reusable or independently managed entities; use objects for content owned by one document.
- Use `defineType`, `defineField`, and `defineArrayMember` if authoring Sanity schemas.
- Use image/file fields with uploaded Sanity assets or Media Library assets, not legacy CDN URLs.
- Use Portable Text arrays for rich text and custom blocks; do not store raw HTML as the canonical body.
- Run schema extraction and TypeGen after schema or GROQ query changes when the project uses TypeScript.
- Deploy or apply schema changes before using MCP/content tools against the target dataset.

For deeper Sanity implementation guidance, use `sanity-best-practices` if it is already available. If it is not installed, tell the user they can add it with:

```bash
npx skills add sanity-io/agent-toolkit --skill sanity-best-practices
```

## Stop and Ask

Stop before coding when any of these are unclear:

- Source access path, credentials, export file, or database connection.
- Target Sanity project/dataset or whether a scratch dataset should be used.
- Draft, archived, scheduled, locale, or version history scope.
- Whether media files should be migrated and whether asset URLs/files are accessible.
- Whether the destination schema exists or should be designed as part of the migration.

## Do Not Do This

- Do not create random IDs for source-backed documents.
- Do not fetch-then-create referenced documents; use deterministic IDs and `createIfNotExists`/`createOrReplace`.
- Do not run bulk migrations through MCP content tools when NDJSON or scripts are appropriate.
- Do not flatten locale fallback values into translations unless requested.
- Do not leave TODOs for required media, authors, references, or rich text conversion.
- Do not declare a migration done without count checks, sample checks, reference checks, and route/redirect checks.

## Reference Map

Use `references/general.md` for shared migration principles and the platform references for source-specific extraction routes, modeling traps, and validation checks.

For source systems not explicitly covered, apply `references/general.md` and adapt the closest platform pattern:
- API-first CMSes: start from Contentful, Strapi, or Payload.
- Monolithic/page-builder systems: start from WordPress, Drupal, Webflow, or AEM.
- HTML-heavy exports: start from the WordPress and Webflow rich-text guidance.
- Markdown-first sources: start from `references/markdown.md`.

From sanity-io/agent-toolkit at 88d6cdf, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.

View SKILL.md on GitHub at 88d6cdf

Files

10 files, 78 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at 88d6cdf
All 24 skills from Sanity

More from Sanity

  • sanity-live-cache-components

    Integrates Sanity Live with Next.js Cache Components in next-sanity v13+ apps, setting up shared cached data fetching through sanityFetch, live content…

    Claude Code, Codex, Cursor +4 · about 4K tokens · pinned 6 days ago

  • content-experimentation-best-practices

    This skill provides guidance for designing and running content experiments using A/B and multivariate testing.

    Claude Code, Codex, Cursor +4 · about 360 tokens · pinned 6 days ago

  • content-modeling-best-practices

    Guides agents through structured content modeling principles for headless CMSes like Sanity, covering schema design, content reuse strategies, and field…

    Claude Code, Codex, Cursor +4 · about 340 tokens · pinned 6 days ago

  • portable-text-conversion

    Converts HTML and Markdown content into Portable Text blocks for Sanity using markdownToPortableText, htmlToBlocks, or manual construction.

    Claude Code, Codex, Cursor +4 · about 510 tokens · pinned 6 days ago

  • portable-text-serialization

    This skill enables rendering Portable Text content across multiple frameworks and output formats using the @portabletext library family.

    Claude Code, Codex, Cursor +4 · about 940 tokens · pinned 6 days ago

  • sanity-best-practices

    This skill provides best practices for Sanity headless CMS development across schema design, GROQ queries, framework integrations (Next.js, Nuxt, Astro…

    Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago

  • data-table-manager

    This skill manages n8n Data Tables through creation, import, querying, and mutation operations.

    by n8nOfficial publisher

    Claude Code, Codex, Cursor +3 · about 2.1K tokens · pinned 6 days ago

  • algolia-automation

    This skill automates Algolia search and indexing operations through the Rube MCP interface.

    by ComposioOfficial publisher

    Claude Code, Codex, Cursor +3 · about 690 tokens · pinned 6 days ago

  • expo-sqlite

    This skill enables SQLite database operations in Expo and React Native apps for structured data storage, offline queues, and persistent caches.

    by ExpoOfficial publisher

    Claude Code, Codex, Cursor +4 · about 2.6K tokens · pinned 6 days ago

  • prisma-8

    This skill helps agents work with Prisma 8, a contract-first data layer for TypeScript projects.

    by PrismaOfficial publisher

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 3.5K tokens · pinned 6 days ago

  • analyzing-experiment-session-replays

    This skill enables agents to analyze session recordings from experiment variants to identify behavioral differences between control and test groups.

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 6 days ago

  • auditing-warehouse-view-health

    Audits materialized views in a PostHog data warehouse to identify failed views and flag unused ones that waste compute resources.

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.4K tokens · pinned 6 days ago

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use