{"skills":[{"name":"Review a website migration redirect map","description":"Check proposed URL moves against matching content, observed redirects and withdrawn pages before a site migration.","content":"# Review a website migration redirect map\n\nCheck proposed URL moves against matching content, observed redirects and withdrawn pages before a site migration.\n\n## When to use this skill\n\n- Someone has a spreadsheet of old URLs and proposed new URLs for a migration and wants it checked before launch.\n- After a move, crawl results show chains, loops or temporary redirects and the team wants to know which to fix.\n- Old pages are being redirected to the homepage and someone wants to know whether that is right.\n\n## When not to use it\n\n- Choosing the new site's URL structure or which content to keep. That is a content and information architecture decision for the site owner.\n- DNS, certificate or HSTS changes for a domain move. Those are infrastructure tasks with their own checks.\n- Search-engine-specific steps such as Search Console's change of address tool. Follow the search engine's own site move guide.\n\n## What you need\n\n- An inventory of old URLs with stable content IDs and a destination inventory with IDs and status codes.\n- Proposed or observed redirect paths and any explicitly retired content.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Can you supply the old URL inventory with a stable content ID or subject for each page, and the new pages with the same IDs? Matching on slugs alone is not reliable.\n- Which old pages are being retired on purpose, and do any have a genuine replacement or a consolidated page?\n- Do you have observed responses for the old URLs, with the status and Location header of every hop, or only the planned map?\n- Does the server treat paths as case-sensitive, and which query parameters change the content?\n\n## Method\n\n1. Match each old URL to its subject using a stable content ID or a confirmed editorial decision. A stated consolidation of several old pages into one counts as an equivalent destination. A similar slug or title alone is a guess and stays under review.\n2. Where responses were observed, follow every hop to the first response that is not a redirect. Resolve a relative Location against the URL of the response that sent it, keep path case and meaningful query parameters exactly, and record loops, missing hops and final pages that are not the equivalent destination. Keep 'checked and no redirect exists' apart from 'not checked'.\n3. Classify each route: direct for a single 301 or 308 to the equivalent page returning 200; fix-chain for the right page reached through extra hops; redirect where there is no redirect, a temporary one (302, 303 or 307) or one to the wrong page; gone for a confirmed retirement; review where identity or evidence is missing.\n4. For retired pages without an equivalent, plan a genuine 404 or 410, using 410 when the removal is intended to be permanent. Do not send them to the homepage or a generic category page; Google may treat many old URLs pointing at one irrelevant page as soft 404s.\n5. Use server-side permanent redirects. Prefer 308 to 301 where forms or API clients may POST to the old URL, because clients may turn a POST into a GET after a 301.\n6. Return one row per supplied old URL in the order given, using the old address exactly as supplied, including meaningful query parameters. Work from the supplied evidence rather than crawling new targets.\n7. Plan to keep the redirects for at least a year, as Google advises, and longer if users still follow old links, and update internal links and canonical tags on the new site to the new URLs.\n\n## Checks before you deliver\n\n- Sending every old article to the homepage can create soft 404s.\n- Temporary redirects, chains and genuine removals have different fixes. A final 200 alone cannot distinguish them.\n- Matching old and new pages by slug alone can redirect people to the wrong subject. Use content IDs or an editor's confirmation.\n- A relative Location resolves against the redirecting URL, not the site root: '..\/new' sent from \/docs\/a leads to \/new.\n- Testing one URL variant proves nothing about another. On a case-sensitive server \/Docs\/A and \/docs\/a are different URLs, as are different query strings.\n\n## How to present the result\n\nStart with counts by action: direct, fix-chain, redirect, gone and review. Then give the map as a table in the supplied order with the old URL, equivalent target, observed route and action. For each fix, give the exact rule to add or change (old URL, status code and Location), list retired URLs needing 404 or 410, and list rows waiting for a decision with the question to ask.\n\n## Worked example\n\n**Request:** Review the supplied migration map.\n\n**Supplied material:**\n\n```text\nold \/old-care id=G1; equivalent \/care 200; observed \/old-care 301 -> \/interim 301 -> \/care 200\nold \/spring-sale id=S2; confirmed retired without equivalent; observed 301 -> \/ 200\n```\n\n**Answer:** Send \/old-care directly to \/care with a permanent redirect and remove the \/interim hop. Return 404 or 410 at \/spring-sale because the withdrawn sale has no equivalent. Remove its redirect to the homepage.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nReturn routes in old-page order with old, target and action. target is the supplied equivalent final URL or null. Use direct for a verified one-hop 301\/308, fix-chain for an indirect route to the right target, redirect for a missing, temporary or wrong route, gone for confirmed retirement and review for unresolved identity or insufficient route evidence.\n\n## Sources\n\n- [Google Search Central site move guidance](https:\/\/developers.google.com\/search\/docs\/crawling-indexing\/site-move-with-url-changes): Asks for a URL mapping, server-side permanent redirects such as 301 or 308, redirects straight to the final destination rather than chains, and 404 or 410 for removed content. It warns that redirecting many old URLs to one irrelevant page such as the homepage may be treated as a soft 404, and advises keeping redirects for at least a year.\n- [RFC 9110, HTTP Semantics](https:\/\/www.rfc-editor.org\/rfc\/rfc9110.html): Section 10.2.2 says a relative Location is resolved against the target URI. Section 15.4 defines 301 and 308 as permanent and notes that clients may change POST to GET after a 301, which 308 prevents. Section 15.5.11 defines 410 for likely permanent removal and 404 when the server does not know.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/review-a-redirect-map\n","scope":"contextual","trigger_keywords":["Review a website migration redirect map","review-a-redirect-map","review a redirect map","Is our redirect map ready for the site migration?","Is our redirect map ready for the site migration","redirect map","redirect mapping","redirect chain review"],"is_private":true,"is_active":true,"scripts":[{"name":"review-a-redirect-map-check","description":"Compare a saved JSON answer with a published test. Pass tests\/case-1\/expected.json (or another case) and the path to your answer.","language":"python","filename":"review-a-redirect-map-check.py","content":"from pathlib import Path\nimport runpy\n\nrunpy.run_path(str(Path(__file__).parent \/ 'tests' \/ 'check.py'), run_name='__main__')\n","supporting_files":[{"path":"SKILL.md","content":"---\nname: review-a-redirect-map\ndescription: \"Check a site migration's redirect map row by row: each old URL should reach its equivalent new page in one permanent redirect, retired pages should return 404 or 410, and unconfirmed matches stay open. Use when reviewing a redirect plan, a 301 map or redirect chains before or after a website move.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/review-a-redirect-map\n---\n\n# Review a website migration redirect map\n\nCheck proposed URL moves against matching content, observed redirects and withdrawn pages before a site migration.\n\n## When to use this skill\n\n- Someone has a spreadsheet of old URLs and proposed new URLs for a migration and wants it checked before launch.\n- After a move, crawl results show chains, loops or temporary redirects and the team wants to know which to fix.\n- Old pages are being redirected to the homepage and someone wants to know whether that is right.\n\n## When not to use it\n\n- Choosing the new site's URL structure or which content to keep. That is a content and information architecture decision for the site owner.\n- DNS, certificate or HSTS changes for a domain move. Those are infrastructure tasks with their own checks.\n- Search-engine-specific steps such as Search Console's change of address tool. Follow the search engine's own site move guide.\n\n## What you need\n\n- An inventory of old URLs with stable content IDs and a destination inventory with IDs and status codes.\n- Proposed or observed redirect paths and any explicitly retired content.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Can you supply the old URL inventory with a stable content ID or subject for each page, and the new pages with the same IDs? Matching on slugs alone is not reliable.\n- Which old pages are being retired on purpose, and do any have a genuine replacement or a consolidated page?\n- Do you have observed responses for the old URLs, with the status and Location header of every hop, or only the planned map?\n- Does the server treat paths as case-sensitive, and which query parameters change the content?\n\n## Method\n\n1. Match each old URL to its subject using a stable content ID or a confirmed editorial decision. A stated consolidation of several old pages into one counts as an equivalent destination. A similar slug or title alone is a guess and stays under review.\n2. Where responses were observed, follow every hop to the first response that is not a redirect. Resolve a relative Location against the URL of the response that sent it, keep path case and meaningful query parameters exactly, and record loops, missing hops and final pages that are not the equivalent destination. Keep 'checked and no redirect exists' apart from 'not checked'.\n3. Classify each route: direct for a single 301 or 308 to the equivalent page returning 200; fix-chain for the right page reached through extra hops; redirect where there is no redirect, a temporary one (302, 303 or 307) or one to the wrong page; gone for a confirmed retirement; review where identity or evidence is missing.\n4. For retired pages without an equivalent, plan a genuine 404 or 410, using 410 when the removal is intended to be permanent. Do not send them to the homepage or a generic category page; Google may treat many old URLs pointing at one irrelevant page as soft 404s.\n5. Use server-side permanent redirects. Prefer 308 to 301 where forms or API clients may POST to the old URL, because clients may turn a POST into a GET after a 301.\n6. Return one row per supplied old URL in the order given, using the old address exactly as supplied, including meaningful query parameters. Work from the supplied evidence rather than crawling new targets.\n7. Plan to keep the redirects for at least a year, as Google advises, and longer if users still follow old links, and update internal links and canonical tags on the new site to the new URLs.\n\n## Checks before you deliver\n\n- Sending every old article to the homepage can create soft 404s.\n- Temporary redirects, chains and genuine removals have different fixes. A final 200 alone cannot distinguish them.\n- Matching old and new pages by slug alone can redirect people to the wrong subject. Use content IDs or an editor's confirmation.\n- A relative Location resolves against the redirecting URL, not the site root: '..\/new' sent from \/docs\/a leads to \/new.\n- Testing one URL variant proves nothing about another. On a case-sensitive server \/Docs\/A and \/docs\/a are different URLs, as are different query strings.\n\n## How to present the result\n\nStart with counts by action: direct, fix-chain, redirect, gone and review. Then give the map as a table in the supplied order with the old URL, equivalent target, observed route and action. For each fix, give the exact rule to add or change (old URL, status code and Location), list retired URLs needing 404 or 410, and list rows waiting for a decision with the question to ask.\n\n## Worked example\n\n**Request:** Review the supplied migration map.\n\n**Supplied material:**\n\n```text\nold \/old-care id=G1; equivalent \/care 200; observed \/old-care 301 -> \/interim 301 -> \/care 200\nold \/spring-sale id=S2; confirmed retired without equivalent; observed 301 -> \/ 200\n```\n\n**Answer:** Send \/old-care directly to \/care with a permanent redirect and remove the \/interim hop. Return 404 or 410 at \/spring-sale because the withdrawn sale has no equivalent. Remove its redirect to the homepage.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nReturn routes in old-page order with old, target and action. target is the supplied equivalent final URL or null. Use direct for a verified one-hop 301\/308, fix-chain for an indirect route to the right target, redirect for a missing, temporary or wrong route, gone for confirmed retirement and review for unresolved identity or insufficient route evidence.\n\n## Sources\n\n- [Google Search Central site move guidance](https:\/\/developers.google.com\/search\/docs\/crawling-indexing\/site-move-with-url-changes): Asks for a URL mapping, server-side permanent redirects such as 301 or 308, redirects straight to the final destination rather than chains, and 404 or 410 for removed content. It warns that redirecting many old URLs to one irrelevant page such as the homepage may be treated as a soft 404, and advises keeping redirects for at least a year.\n- [RFC 9110, HTTP Semantics](https:\/\/www.rfc-editor.org\/rfc\/rfc9110.html): Section 10.2.2 says a relative Location is resolved against the target URI. Section 15.4 defines 301 and 308 as permanent and notes that clients may change POST to GET after a 301, which 308 prevents. Section 15.5.11 defines 410 for likely permanent removal and 404 when the server does not know.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/review-a-redirect-map\n"},{"path":"LICENSE.txt","content":"Original Raq.com instructions and synthetic examples: CC BY 4.0.\nhttps:\/\/creativecommons.org\/licenses\/by\/4.0\/\nAttribution: Raq.com, https:\/\/skills.raq.com\/skills\/review-a-redirect-map\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# A moved guide and a retired sale\n\nReview the supplied migration map.\n\n## Supplied material\n\nold \/old-care id=G1; equivalent \/care 200; observed \/old-care 301 -> \/interim 301 -> \/care 200\nold \/spring-sale id=S2; confirmed retired without equivalent; observed 301 -> \/ 200\n\n## Worked answer\n\nSend \/old-care directly to \/care with a permanent redirect and remove the \/interim hop. Return 404 or 410 at \/spring-sale because the withdrawn sale has no equivalent. Remove its redirect to the homepage.\n\n## Reasoning\n\nThe guide reaches the right subject through an unnecessary hop. The sale has no appropriate replacement.\n"},{"path":"tests\/check.py","content":"\"\"\"Check a saved agent answer locally with Python 3 (standard library only).\"\"\"\nimport json\nimport math\nimport sys\nfrom pathlib import Path\n\n\ndef compare(expected, actual, path=\"$\", accepted=None):\n    if isinstance(expected, bool) or isinstance(actual, bool):\n        if expected is not actual:\n            yield path\n    elif isinstance(expected, (int, float)) and isinstance(actual, (int, float)):\n        if not math.isclose(expected, actual, rel_tol=0, abs_tol=1e-8):\n            yield path\n    elif isinstance(expected, dict) and isinstance(actual, dict):\n        for key in sorted(set(expected) | set(actual)):\n            if key not in expected or key not in actual:\n                yield f\"{path}.{key}\"\n            elif not any(\n                not list(compare(option, actual[key]))\n                for option in (accepted or {}).get(key, [])\n            ):\n                yield from compare(expected[key], actual[key], f\"{path}.{key}\")\n    elif isinstance(expected, list) and isinstance(actual, list):\n        if len(expected) != len(actual):\n            yield f\"{path} (length)\"\n        for i, (left, right) in enumerate(zip(expected, actual)):\n            yield from compare(left, right, f\"{path}[{i}]\")\n    elif type(expected) != type(actual) or expected != actual:\n        yield path\n\n\ndef main():\n    if len(sys.argv) != 3:\n        raise SystemExit(\"Usage: python3 check.py expected.json answer.json\")\n    try:\n        expected, actual = [json.loads(Path(p).read_text(encoding=\"utf-8\")) for p in sys.argv[1:]]\n        alternatives = Path(sys.argv[1]).with_name(\"accepted.json\")\n        accepted = json.loads(alternatives.read_text(encoding=\"utf-8\")) if alternatives.is_file() else {}\n    except (ValueError, OSError) as error:\n        raise SystemExit(str(error))\n    differences = list(compare(expected, actual, accepted=accepted))\n    if differences:\n        raise SystemExit(\"Different fields: \" + \", \".join(differences))\n    print(\"Pass\")\n\n\nif __name__ == \"__main__\":\n    main()\n"},{"path":"tests\/README.md","content":"Give your agent SKILL.md and one request.txt in a fresh session. Keep the expected answer aside. Save the reply as answer.json, then run this from the tests folder:\n\n    python3 check.py case-1\/expected.json answer.json\n\nEach case also has an explanation. Where accepted.json exists, the checker accepts the alternatives listed there.\n"},{"path":"tests\/case-1\/request.txt","content":"Review the supplied migration map.\nReturn only the JSON specified in SKILL.md for this test.\n\nold \/old-care id=G1; equivalent \/care 200; observed \/old-care 301 -> \/interim 301 -> \/care 200\nold \/spring-sale id=S2; confirmed retired without equivalent; observed 301 -> \/ 200\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"routes\": [\n        {\n            \"old\": \"\/old-care\",\n            \"target\": \"\/care\",\n            \"action\": \"fix-chain\"\n        },\n        {\n            \"old\": \"\/spring-sale\",\n            \"target\": null,\n            \"action\": \"gone\"\n        }\n    ]\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"The guide reaches the right subject through an unnecessary hop. The sale has no appropriate replacement.\n"},{"path":"tests\/case-2\/request.txt","content":"Review the supplied map. A suggested slug is only a guess.\nReturn only the JSON specified in SKILL.md for this test.\n\nold \/photos id=P9; equivalent \/gallery 200; observed \/photos 308 -> \/gallery 200\nold \/team-a id=T1; only suggested \/team, no confirmed match or retirement; observed no redirect\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"routes\": [\n        {\n            \"old\": \"\/photos\",\n            \"target\": \"\/gallery\",\n            \"action\": \"direct\"\n        },\n        {\n            \"old\": \"\/team-a\",\n            \"target\": null,\n            \"action\": \"review\"\n        }\n    ]\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"Only the first old page has evidence supporting its destination.\n"},{"path":"tests\/case-3\/request.txt","content":"Review two old pages against their supplied equivalent destinations. The host serves case-sensitive paths.\nReturn only the JSON specified in SKILL.md for this test.\n\nold https:\/\/guide.example\/docs\/a, id A; equivalent https:\/\/guide.example\/new 200. Observed 308 Location: ..\/new, followed by 200 at the resolved target.\nold https:\/\/guide.example\/Docs\/A, id B; equivalent https:\/\/guide.example\/b 200. No observation of the old URL was supplied.\n"},{"path":"tests\/case-3\/expected.json","content":"{\n    \"routes\": [\n        {\n            \"old\": \"https:\/\/guide.example\/docs\/a\",\n            \"target\": \"https:\/\/guide.example\/new\",\n            \"action\": \"direct\"\n        },\n        {\n            \"old\": \"https:\/\/guide.example\/Docs\/A\",\n            \"target\": \"https:\/\/guide.example\/b\",\n            \"action\": \"review\"\n        }\n    ]\n}\n"},{"path":"tests\/case-3\/explanation.txt","content":"The relative redirect resolves to \/new. The first observation does not establish what the differently cased old URL returns.\n"}],"is_active":true,"is_approved":false}]}]}