# AI prompt library and resources

https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/appendix-prompt-library-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.

---

## Navigation

**Course:** [Migrating from Webflow to Sanity](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity) · [View as markdown](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity.md)

**Previous:** [Launch checklist and DNS transfer](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/launch-checklist-dns)

---

## Course Contents

1. [Introduction](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/introduction-to-webflow-migration)
2. [Audit your Webflow content](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/audit-webflow-content)
3. [Recognize Webflow's content modeling patterns](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/recognize-content-modeling-patterns)
4. [Export from Webflow and connect the Data API](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/export-webflow-connect-api)
5. [Initialize Sanity and install the migration toolkit](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/initialize-sanity-migration-toolkit)
6. [Map collections to Sanity document types](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/map-collections-to-schemas)
7. [Build a page builder with a sections array](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/page-builder-sections-array)
8. [Model custom-template pages as singletons](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/custom-template-singletons)
9. [Model navigation in Sanity](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/model-navigation)
10. [Create a siteSettings singleton](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/site-settings-singleton)
11. [Handle internal links in Portable Text](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/internal-links-portable-text)
12. [Fetch your collection items from the API](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/fetch-collection-items-api)
13. [Run the asset pre-upload pass](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/asset-pre-upload)
14. [Resolve reference fields from API data](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/resolve-reference-fields)
15. [Convert rich text to Portable Text](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/convert-rich-text-portable-text)
16. [Extract static page content using the page DOM API](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/extract-static-page-content)
17. [Import content with the two-pass pattern](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/two-pass-import)
18. [Validate your import in Studio](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/validate-import-studio)
19. [Set up forms, redirects, and sitemap](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/forms-redirects-sitemap)
20. [Set up draft mode and visual preview](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/draft-mode-visual-preview)
21. [Validate your import without a frontend](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/validate-migration)
22. [Launch checklist and DNS transfer](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/launch-checklist-dns)
23. **AI prompt library and resources** *(current)*

---

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.



### Schema generation



```text
@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.
```

### Import script generation



```text
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.
```

### CSS token extraction



```text
@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.
```

### Redirect map generation



```text
@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.
```

### Resources



- [Webflow Data API v2](https://developers.webflow.com/data/reference/rest-introduction)

- [@sanity/block-tools (htmlToBlocks)](https://github.com/sanity-io/sanity/tree/next/packages/%40sanity/block-tools)

- [@sanity/document-internationalization](https://www.sanity.io/plugins/document-internationalization)

- [Sanity Presentation tool](https://www.sanity.io/docs/presentation)

- [GROQ reference](https://www.sanity.io/docs/groq)

- [Next.js Draft Mode](https://nextjs.org/docs/app/building-your-application/configuring/draft-mode)

- [next-sitemap](https://github.com/iamvishnusankar/next-sitemap)

- [next/image](https://nextjs.org/docs/app/api-reference/components/image)


---

## Related Resources

- [Full course as markdown](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity.md)
- [All courses and lessons](https://www.sanity.io/learn/sitemap.md)
- [Complete content for LLMs](https://www.sanity.io/learn/llms-full.txt)

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://www.sanity.io/learn/resource/feedback

```json
{
  "path": "/learn/course/migrating-content-from-webflow-to-sanity/appendix-prompt-library-resources.md",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>
