Migrating from Webflow to Sanity
AI prompt library and resources
Copy-paste AI prompts for schema generation, import scripts, CSS token extraction, and redirect maps, plus links to the docs and packages used throughout this guide.
Log in to mark your progress for each Lesson and Task
These prompts use @file syntax, which works in Cursor and Claude Code. Type @ followed by the filename to attach the file directly. No need to paste content manually.
@webflow/api/components.json @webflow/api/collections.json @webflow/export/[page-name].html Identify the distinct section patterns across these files. For each, write a Sanity schema in TypeScript using defineType and defineField. Use camelCase field names, type: 'blockContent' for rich text, type: 'reference' for links to other document types, type: 'image' for image fields. Output one schema object per section type.Read webflow/api/collections.json, the first 2–3 lines of each file in webflow/api/items/, sanity/schemaTypes/index.ts, and each schema file it references. Generate a complete scripts/import.js that: uses import { client } from '../lib/sanity-client.js'; reads NDJSON line by line with an async generator; has importPass1(collectionId, transformFn) using client.createOrReplace with a deterministic _id of ${sanityTypeName}-${item.id} where sanityTypeName is the Sanity type name (e.g. post, author) — not a generic wf- prefix; has importPass2(collectionId, refFn) patching reference fields; has one transform* function per collection for scalar fields (strings, slugs, numbers, booleans, dates, images from asset-map.json); has one *Refs function per collection returning { _type: 'reference', _ref: idMap[...] } objects; and has a run() that calls all importPass1s then all importPass2s. Use { convertRichText } from ./rich-text.js for rich text fields. Order collections so those with no incoming references run first.@webflow/export/[site-name].css Extract all design tokens: color palette, spacing scale, typography, container widths, and breakpoints. Output a tailwind.config.js theme.extend block and a tokens.css file with CSS custom properties. Skip Webflow-specific utility classes prefixed .w- or .wf-. Flag any values that look inconsistent.@webflow/api/pages.json Here is my new URL structure: [describe changes — e.g. /blog/* stays, /about-us moved to /about] Using the pages list as the source of all Webflow URLs, output a vercel.json redirects array with permanent: true for all 301 redirects. Only include URLs that have changed — unchanged slugs do not need a redirect entry.- Webflow Data API v2
- @sanity/block-tools (htmlToBlocks)
- @sanity/document-internationalization
- Sanity Presentation tool
- GROQ reference
- Next.js Draft Mode
- next-sitemap
- next/image
Mark lesson as complete
You have 1 uncompleted task in this lesson
0 of 1