AgentRecipes
Recipes › Engineering & security

How to migrate a website off a headless CMS into code and Markdown with Cursor agents

Engineering & securityCursor✓ Confirmed by source

Confirmed by source: Documented production case study: the author (Cursor) migrated the live cursor.com site and publishes the agent-computed cost, token, request and commit figures plus after-effects (lower CDN cost, faster builds). Source page checked live (HTTP 200) on 2026-10-23. The post is dated December 2025 without a day, so the published date is set to the first of the month. (checked 2026-10-23)

The problem

Your marketing site or blog lives in a headless CMS. Every change now means clicking through a separate tool with its own user accounts, draft-preview setup, localisation plugins and usage-priced CDN, and a coding agent can't simply grep and edit the content because it sits behind an API. You want the content back in the repository as code and Markdown, without spending weeks on manual export work.

Tools needed

Step-by-step recipe

  1. Ask the agent for a migration plan first (plan mode), and answer its clarifying questions. A good plan uses the CMS API key you already have instead of manual downloads: scripts that export every entry, check the structure, convert it to Markdown/components in the repo, and upload assets to your own object storage.
  2. Let the agent write and run those export scripts and build the pages from the exported files. Expect the first handful of agent runs to get most of the site across; the last stretch (pages that don't quite match) takes most of the time.
  3. For every page that differs, run one focused agent task: re-export that page with all its sub-components and images, then use the browser to screenshot local vs. production and keep iterating until they match. Attach both screenshots so the agent knows which is which.
  4. Once content is in code, simplify while you are there: inline data that used to come from the CMS (navigation, footer), and use subagents to apply an agreed API shape across many call sites in parallel.
  5. Replace the CMS asset manager with a small upload/manage/delete page on top of your object storage, and remove dependencies you no longer need.
  6. Ship it through normal pull requests: every content change now gets a preview link anyone can open, and the full history is in Git for both people and agents.

Copyable prompt

Prompt template
The page [ROUTE, e.g. /pricing] in this repo does not yet match production at [PRODUCTION URL].
1. Look at how we exported CMS data for [ALREADY-MIGRATED PAGE] in [EXPORT SCRIPT PATH] and re-export the complete contents of [ROUTE], including every sub-component, image and background.
2. Store text as Markdown/JSX in [CONTENT FOLDER] and upload media with [UPLOAD SCRIPT] to [OBJECT STORAGE BUCKET]; never hotlink the CMS CDN.
3. Run the dev server, open both versions in the browser and take screenshots. The first attached image is local, the second is production.
4. Keep fixing and re-screenshotting until the local page matches; then run [BUILD/LINT COMMAND] and summarise what changed.

Original template written by our AI agent for AgentRecipes, not copied from the source. Replace the [BRACKETS] and {{variables}} with your own values and test before relying on it.

What the builder reported

Lee Robinson reports migrating cursor.com from a headless CMS to code and Markdown over a long weekend (three days) instead of his own 1-2 week estimate. By the agent-computed tally: $260.32 and 297.4M tokens (mostly cached), 344 agent requests, 66 manual Tab edits and 67 commits (+43K / -322K lines). Afterwards the team moved assets to cheaper object storage (he says this saves thousands of dollars in CDN costs; the CMS CDN had cost $56,848 since September), builds got about 2x faster, and fixes and cross-site features now ship as ordinary pull requests.

These are the source author's own claims. AgentRecipes has not run this recipe itself.

Watch out for

Source

Original write-up: leerob.com (Lee Robinson) (2025-12-01) ↗

Found via Agent Use Cases: “Migrate a website from a CMS to raw code and Markdown”. This recipe summarises the source in words written by our AI agent; read the original for the full details. Link last checked 2026-10-23.

More engineering & security recipes

Review agent-written pull requests with layered AI review and risk-based human approvalOnce coding agents open pull requests, there are far more changes than people can read line by line, but skipping review lets bugs and…Claude Code✓ Confirmed by sourceRewrite a critical production service with Claude Code behind a black-box test harnessA high-throughput background service is becoming a bottleneck and paging on-call, but rewriting it by hand is slow and risky, and…Claude Code✓ Confirmed by sourceShip vendor recipe prompts so coding agents integrate your API the way you wouldDevelopers ask coding agents to add a vendor feature from public docs alone; the agent often picks the wrong product surface, burns…Claude Code✓ Confirmed by source

New agent recipes in your inbox

A short email with the newest automation recipes, each linked to its real-world source. No spam. Every email has a one-click unsubscribe link.