Prompt to prove migration parity by crawling the old and new sites

Short answer

This prompt asks an AI assistant to compare two inventories of the same site, one from before the migration and one after, and write PARITY.md. It lists missing URLs, changed titles and h1 tags, large word count drops and wrong canonicals, so you fix real losses before you switch DNS.

Last reviewed

Key facts

  • Parity means every old URL still answers, either at the same path or through a redirect you chose.
  • Intended changes belong in a map file. Anything else that differs is a candidate bug.
  • The comparison runs on two inventory CSV files, so it works offline once both exist.
  • Test status: the reference script was run twice on webexport.online (30 pages each time) and compared with itself: zero differences and exit code 0. We then edited copies of the second CSV to rename one title, cut one word count in half, delete one row and point one canonical at another path, and the report listed each change. Two different sites, a real migration and the Firecrawl crawl path were not tested.

The prompt

Paste this into Claude Code, Cursor, Codex or another AI coding assistant with your project folder open, and replace everything in square brackets first. See how to run it in each tool.

Prove migration parity
You are proving that a migrated website still matches the original. The old site is [OLD_URL]. The new site is [NEW_URL].

READ
- inventory.csv, the inventory of the old site (from the crawl-inventory prompt). If it does not exist, build it from [OLD_URL] first.
- [REDIRECT_MAP_CSV: optional file with columns old_path,new_path for URLs that moved on purpose]
- The new site's sitemap and pages at [NEW_URL]. Build inventory-new.csv with the same columns.

STEP 1: COMPARE
For every old path, find the new path (use the map file, otherwise the same path). Report:
- missing: the new URL does not return 200
- status changes
- changed title or h1
- word count that moved more than 20 percent
- canonical that points to a different path or host
- text that changed, using the text hash
Also list new paths that do not exist on the old site.

STEP 2: WRITE PARITY.md
Start with one line: how many old URLs were checked and how many have at least one difference. Then one section per difference type, each with the old value and the new value.

STEP 3: RECOMMEND
For each missing URL suggest one fix: add the page, or add a redirect to a named target. Do not choose a target that is unrelated to the old page.

RULES
- Read-only. Do not edit the old or the new site.
- Do not list a difference that the map file explains as intended.
- A changed hash is a prompt to look, not proof of a problem. Say so.
- Never mark parity as passed while any missing URL remains.

How to run it

  1. Run the inventory prompt on the old site first, and keep inventory.csv.
  2. Export and deploy the new site to a preview address, not to the live domain.
  3. Send the prompt with both addresses. Add a map file for any URL you moved on purpose.
  4. Work through PARITY.md, rebuild the new inventory and run the comparison again until the missing list is empty.

Run it without a paid key

The comparison script reads two CSV files made by the inventory script. It exits with code 1 when it finds any difference, so you can also use it in a build step. The map file has a header row, old_path,new_path. Add the --hash flag to report changed text.

scripts/parity.mjs
// Usage: node parity.mjs old.csv new.csv [--map map.csv] [--hash]
// Compares two inventory.csv files. map.csv has two columns: old_path,new_path. Exit code 1 when anything differs.
import fs from 'node:fs';

const [oldFile, newFile, ...flags] = process.argv.slice(2);
const mapFile = flags.includes('--map') ? flags[flags.indexOf('--map') + 1] : null;
const useHash = flags.includes('--hash');

function parseCsv(text) {
  const rows = []; let row = [], cell = '', inQ = false;
  for (let i = 0; i < text.length; i++) {
    const c = text[i];
    if (inQ) { if (c === '"' && text[i + 1] === '"') { cell += '"'; i++; } else if (c === '"') inQ = false; else cell += c; }
    else if (c === '"') inQ = true;
    else if (c === ',') { row.push(cell); cell = ''; }
    else if (c === '\n') { row.push(cell); rows.push(row); row = []; cell = ''; }
    else if (c !== '\r') cell += c;
  }
  if (cell || row.length) { row.push(cell); rows.push(row); }
  const [head, ...body] = rows.filter((r) => r.length > 1);
  return body.map((r) => Object.fromEntries(head.map((h, i) => [h, r[i]])));
}
const load = (f) => Object.fromEntries(parseCsv(fs.readFileSync(f, 'utf8')).map((r) => [r.path, r]));
const oldPages = load(oldFile), newPages = load(newFile);
const map = mapFile ? Object.fromEntries(parseCsv(fs.readFileSync(mapFile, 'utf8')).map((r) => [r.old_path, r.new_path])) : {};

const report = { missing: [], status: [], title: [], h1: [], words: [], canonical: [], hash: [], added: [] };
for (const [p, o] of Object.entries(oldPages)) {
  const n = newPages[map[p] ?? p];
  if (!n || n.status !== '200') { report.missing.push(`${p} -> ${map[p] ?? p} (${n ? 'status ' + n.status : 'not in new inventory'})`); continue; }
  if (o.status !== n.status) report.status.push(`${p}: ${o.status} -> ${n.status}`);
  if (o.title !== n.title) report.title.push(`${p}: "${o.title}" -> "${n.title}"`);
  if (o.h1 !== n.h1) report.h1.push(`${p}: "${o.h1}" -> "${n.h1}"`);
  const ow = Number(o.words), nw = Number(n.words);
  if (ow > 0 && Math.abs(nw - ow) / ow > 0.2) report.words.push(`${p}: ${ow} -> ${nw} words`);
  if (useHash && o.text_hash !== n.text_hash) report.hash.push(`${p}: text changed`);
  const pathOf = (c) => (c ? new URL(c, 'https://x.invalid').pathname : '');
  const oldCanon = pathOf(o.canonical), newCanon = pathOf(n.canonical);
  // Only a regression counts: the old page was its own canonical and the new one points elsewhere. Paths only, hosts are not compared.
  if (newCanon && newCanon !== (map[p] ?? p) && (!oldCanon || oldCanon === p)) report.canonical.push(`${p}: canonical now points to ${n.canonical}`);
}
const mapped = new Set(Object.keys(oldPages).map((p) => map[p] ?? p));
for (const p of Object.keys(newPages)) if (!mapped.has(p)) report.added.push(p);

let total = 0;
for (const [k, list] of Object.entries(report)) {
  console.log(`\n## ${k} (${list.length})`);
  for (const line of list) console.log(`- ${line}`);
  if (k !== 'added') total += list.length;
}
console.log(`\n${Object.keys(oldPages).length} old URLs checked, ${total} differences.`);
process.exit(total ? 1 : 0);
terminal
node scripts/inventory.mjs https://old.example.com 200 > inventory.csv
node scripts/inventory.mjs https://preview.example.com 200 > inventory-new.csv
node scripts/parity.mjs inventory.csv inventory-new.csv --map redirects.csv > PARITY.md

The Firecrawl path

To crawl both sites with Firecrawl, run a crawl on each address with markdown in the scrape options and compare the results. Firecrawl also has change tracking, which keeps a snapshot per URL and reports whether a page is new, same, changed or removed. It compares a URL with its own earlier snapshot, so it suits "this site last week against this site today". For old against new, where the host differs, diff the two crawls yourself.

CheckWhere the data comes fromWhat a hit means
Missing URLStatus code in the new inventoryAdd the page or a redirect before launch
Title or h1 changedTitle and h1 columnsFine if you rewrote it, a bug if the export changed it
Word count drop over 20 percentWords columnContent was lost, often a CMS list or a tab body
Canonical now points to another pathCanonical column, paths onlySearch engines may prefer another page

Verify the result

Prove the check itself works before you trust a clean report: break something on purpose and see it flagged.

terminal
node scripts/parity.mjs inventory.csv inventory-new.csv --map redirects.csv | tail -3
echo "exit code: $?"
curl -sI https://preview.example.com/old-path | head -3
  • The last line gives the number of old URLs checked and the number of differences.
  • Every missing URL in the report has a fix you applied, and a second run no longer lists it.
  • A URL you moved on purpose returns a 301 to the new path, not a 200 duplicate.

What can go wrong

  • Comparing against a preview address that blocks crawlers gives a false list of missing pages. Check robots.txt on the preview.
  • Titles that include the site name differ when the name changes. Treat those as intended and list them in the map file.
  • A text hash changes with a cookie banner or a date in the footer. Use it as a hint only. The canonical check compares paths, so a canonical that still points at the old domain needs a manual look.

Frequently asked questions

What does parity mean for a migration?

Every URL that ranked or got links on the old site still answers, with the same title, h1 and main content, or redirects to the page that replaced it.

Can I run it against the same site twice?

Yes. That is a good first test of the script. Expect only real differences, such as pages that set a different canonical.

Does this replace a redirect map?

No. It finds URLs that are missing. The redirect map prompt turns them into rules.

How is this different from the SEO audit prompt?

The SEO audit prompt checks the new site against good practice. This one checks the new site against the old one.

Official documentation

Free tools for this job

Start with the files

Prompts work best on a WebExport download of your site. Paste your public URL into the export form and get a ZIP. The Free plan covers 1 site, 5 exports a month, 15 pages and 20 MB per export. Professional is a $9.99 one-time purchase with unlimited pages.