1. Habit
  2. Skills
  3. Sanity Migration skill
sanity-io · 22K installs

Sanity Migration skill
Runs by itself, Nightly during migration.

Migration reruns converge, checks pass.

Install the Sanity Migration skill and make it a habit: follow https://gethabit.dev/skills/sanity-io/sanity-migration.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

22K installs192 starsMIT licenceSource on GitHub ↗

Sanity Migration

by sanity-io · 22K installs

The skill

The sanity migration skill plans, builds and reviews moves into Sanity from AEM, Contentful, Strapi, Webflow, WordPress, Payload, Drupal or Markdown, with Portable Text conversion, asset migration, redirects and validation.

Only when you ask.

The habit

Migration reruns converge, checks pass.

↻ Runs by itselfNightly during migration

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after one full rerun per night, with 1 retry on a failed import.

  1. 01

    Read the guides

    The agent reads references/general.md and the guide for the source platform.

  2. 02

    Plan

    It keeps a short plan for access, scope, schema, extraction, transform, import, validation, redirects and cutover.

  3. 03

    Stop and ask

    It asks you before coding when access, target dataset, scope, media or schema is unclear.

  4. 04

    Snapshot

    It saves the extracted source data to disk before transforming it.

  5. 05

    Transform and import

    It converts rich text to Portable Text and imports with stable IDs via createOrReplace, createIfNotExists or sanity datasets import --replace.

  6. 06

    Validate

    It runs count, sample, reference and redirect checks and updates the validation summary.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the Sanity Migration skill helps.

Use it when

  • ✓ You move a site from another CMS to Sanity
  • ✓ You convert HTML or Markdown to Portable Text
  • ✓ You plan redirects and cutover

Skip it when

  • – You already run on Sanity with no import
  • – You only change one document

Questions

Sanity Migration skill, answered.

Why stable IDs?

IDs from source IDs, slugs, paths or hashes let reruns overwrite instead of duplicate.

Can it use MCP content tools for bulk import?

No. The skill wants NDJSON or scripts for bulk work.

Which sources are covered?

AEM, Contentful, Strapi, Webflow, WordPress, Payload, Drupal and Markdown, with general.md for the rest.

How do I install the Sanity Migration skill?

Copy the prompt at the top into your agent. It installs the skill from sanity-io/agent-toolkit and sets up the habit. Or run npx skills add sanity-io/agent-toolkit --skill sanity-migration.

Is the Sanity Migration skill free?

Yes. It is published under MIT. Habit is free too.

Sanity Migration. Now as a habit.

Install the Sanity Migration skill and make it a habit: follow https://gethabit.dev/skills/sanity-io/sanity-migration.md

  • Free
  • No account
  • Undo in one line

All sanity-io skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by sanity-io, published under MIT. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.