{"skills":[{"name":"Check an XML sitemap inventory","description":"Review listed URLs for scope errors and misleading modification dates using an offline sitemap and content-change records.","content":"# Check an XML sitemap inventory\n\nReview listed URLs for scope errors and misleading modification dates using an offline sitemap and content-change records.\n\n## When to use this skill\n\n- Someone has a sitemap.xml or sitemap index and wants to know which entries are wrong before submitting it to Google Search Console or Bing Webmaster Tools.\n- A CMS rewrites lastmod on every build and the team wants to know which dates are misleading.\n- After a migration, someone wants the new sitemaps checked against the pages that should be listed.\n\n## When not to use it\n\n- Predicting whether or when pages will be indexed or ranked. A valid sitemap is a hint; search engines decide what to crawl and index.\n- Choosing which URL of a duplicate group should be listed. Use the canonical signals or redirect map skills first, then list only the chosen URLs.\n- Image, video or news sitemap extensions, which have their own tags and rules beyond this check.\n\n## What you need\n\n- Sitemap location and XML, or extracted loc and lastmod rows.\n- Confirmed modification dates for the listed pages and any verified cross-host submission arrangement.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- What is the exact URL of the sitemap file? Its scheme, host and directory decide which URLs it may list.\n- Is it a sitemap index? If so, can you supply every child sitemap, decompressed if gzipped? Missing children leave coverage unknown.\n- Do you have records of when each page's content last changed in a meaningful way? Without them, lastmod can be checked only for format, not accuracy.\n- Is the sitemap submitted through Search Console, or referenced from robots.txt on another host? Either can widen the URLs it may cover.\n\n## Method\n\n1. Identify the file type from its root element. In a sitemapindex, each loc names a child sitemap and its lastmod dates that file, not any page. Build the page inventory only from urlset files you actually have, in index order, decompressing .gz files. List any child you could not read as unavailable and say coverage is incomplete.\n2. Check the protocol limits: no more than 50,000 URLs and 50MB (52,428,800 bytes) uncompressed per file, UTF-8 encoding, and each loc under 2,048 characters.\n3. Decode XML entities once (&amp; becomes &) and take each loc as written. Flag a loc without a scheme and host as relative-url.\n4. Check the scope of each absolute URL: same scheme and host as the sitemap file, and a path inside the sitemap's directory. A sitemap at \/catalog\/sitemap.xml may list \/catalog\/ pages but not \/help\/ pages. Accept a URL outside that scope only with a verified arrangement, such as Search Console verification of both properties or a robots.txt Sitemap line on the other host.\n5. Group entries by exact decoded URL and flag the second and later copies as duplicate. Keep differences in path case, trailing slash and query string as distinct URLs unless the site confirms they are the same page.\n6. Compare each supplied lastmod with the date the page's content last changed meaningfully. Flag a date that contradicts the record, such as a build timestamp later than the last real change. An omitted lastmod is valid; an unknown change date leaves accuracy unchecked.\n7. Report issues by entry number in source order, numbering entries across child sitemaps in index order, and list codes for the same entry in the order relative-url, outside-scope, duplicate, wrong-lastmod. Keep protocol problems separate from views about which pages should be indexed.\n\n## Checks before you deliver\n\n- An escaped ampersand is normal XML and should become a single ampersand in the URL.\n- Cross-host hosting and ownership need specific arrangements. Do not treat an arbitrary second hostname as in scope.\n- A lastmod set to the generation time on every entry is wrong for every page that did not change. Google says it uses lastmod only when it is consistently and verifiably accurate.\n- Reading a sitemap index's lastmod values as page dates confuses file dates with page dates.\n- Collapsing URLs that differ only by case or query string can hide genuinely different pages. Report them as listed and ask.\n- Google ignores priority and changefreq. Do not spend the review tuning them.\n\n## How to present the result\n\nStart with the totals: entries read, child sitemaps unavailable and issues by type. Then list each issue with its entry number, URL and fix: make it absolute, move it to a sitemap whose directory covers it, remove the duplicate, or correct or drop the lastmod. If asked, give the corrected entries ready to paste, and state what coverage is still unknown.\n\n## Worked example\n\n**Request:** Review https:\/\/shop.example\/catalog\/sitemap.xml. No cross-site arrangement. Treat the following rows as decoded loc|lastmod|actual page change.\n\n**Supplied material:**\n\n```text\nhttps:\/\/shop.example\/catalog\/coat|2026-11-20|2026-10-12\nhttps:\/\/shop.example\/help\/returns|-|unknown\nhttps:\/\/shop.example\/catalog\/coat|-|2026-10-12\n```\n\n**Answer:** Keep one entry for \/catalog\/coat and change its lastmod to 2026-10-12, the recorded page change, or omit the date. Remove the repeated coat entry. List \/help\/returns in a sitemap whose directory covers \/help\/.\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 issues as objects with row (one-based URL entry) and code, in source order. Codes in priority order per row are relative-url, outside-scope, duplicate and wrong-lastmod. Apply scope checks only to absolute URLs. Flag duplicates from the second occurrence onward. For multiple child sitemaps, number URL entries consecutively in index order. Include unavailable_sitemaps as an array of absolute child URLs only when child content is missing.\n\n## Sources\n\n- [Sitemaps XML protocol](https:\/\/www.sitemaps.org\/protocol.html): Defines urlset and sitemapindex files, the 50,000 URL and 50MB uncompressed limits, UTF-8 and entity escaping, a loc under 2,048 characters, lastmod as the page's modification date rather than the generation date, and the rule that a sitemap may list only URLs on its own host and under its own directory.\n- [Google Search Central: build and submit a sitemap](https:\/\/developers.google.com\/search\/docs\/crawling-indexing\/sitemaps\/build-sitemap): Google says it ignores priority and changefreq, uses lastmod only when it is consistently and verifiably accurate, and that a sitemap affects only descendants of its directory unless submitted through Search Console, where sitemaps can cover several verified sites.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/check-a-sitemap-inventory\n","scope":"contextual","trigger_keywords":["Check an XML sitemap inventory","check-a-sitemap-inventory","check a sitemap inventory","Are there any wrong entries in our sitemap before we submit it to Google?","Are there any wrong entries in our sitemap before we submit it to Google","sitemap inventory","compare this sitemap","audit this sitemap"],"is_private":true,"is_active":true,"scripts":[{"name":"check-a-sitemap-inventory-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":"check-a-sitemap-inventory-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: check-a-sitemap-inventory\ndescription: \"Audit an XML sitemap or sitemap index entry by entry for relative URLs, URLs outside the sitemap's scope, duplicates and lastmod dates that do not match real page changes. Use when someone asks to check, audit or clean up a sitemap.xml before submitting it to search engines.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/check-a-sitemap-inventory\n---\n\n# Check an XML sitemap inventory\n\nReview listed URLs for scope errors and misleading modification dates using an offline sitemap and content-change records.\n\n## When to use this skill\n\n- Someone has a sitemap.xml or sitemap index and wants to know which entries are wrong before submitting it to Google Search Console or Bing Webmaster Tools.\n- A CMS rewrites lastmod on every build and the team wants to know which dates are misleading.\n- After a migration, someone wants the new sitemaps checked against the pages that should be listed.\n\n## When not to use it\n\n- Predicting whether or when pages will be indexed or ranked. A valid sitemap is a hint; search engines decide what to crawl and index.\n- Choosing which URL of a duplicate group should be listed. Use the canonical signals or redirect map skills first, then list only the chosen URLs.\n- Image, video or news sitemap extensions, which have their own tags and rules beyond this check.\n\n## What you need\n\n- Sitemap location and XML, or extracted loc and lastmod rows.\n- Confirmed modification dates for the listed pages and any verified cross-host submission arrangement.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- What is the exact URL of the sitemap file? Its scheme, host and directory decide which URLs it may list.\n- Is it a sitemap index? If so, can you supply every child sitemap, decompressed if gzipped? Missing children leave coverage unknown.\n- Do you have records of when each page's content last changed in a meaningful way? Without them, lastmod can be checked only for format, not accuracy.\n- Is the sitemap submitted through Search Console, or referenced from robots.txt on another host? Either can widen the URLs it may cover.\n\n## Method\n\n1. Identify the file type from its root element. In a sitemapindex, each loc names a child sitemap and its lastmod dates that file, not any page. Build the page inventory only from urlset files you actually have, in index order, decompressing .gz files. List any child you could not read as unavailable and say coverage is incomplete.\n2. Check the protocol limits: no more than 50,000 URLs and 50MB (52,428,800 bytes) uncompressed per file, UTF-8 encoding, and each loc under 2,048 characters.\n3. Decode XML entities once (&amp; becomes &) and take each loc as written. Flag a loc without a scheme and host as relative-url.\n4. Check the scope of each absolute URL: same scheme and host as the sitemap file, and a path inside the sitemap's directory. A sitemap at \/catalog\/sitemap.xml may list \/catalog\/ pages but not \/help\/ pages. Accept a URL outside that scope only with a verified arrangement, such as Search Console verification of both properties or a robots.txt Sitemap line on the other host.\n5. Group entries by exact decoded URL and flag the second and later copies as duplicate. Keep differences in path case, trailing slash and query string as distinct URLs unless the site confirms they are the same page.\n6. Compare each supplied lastmod with the date the page's content last changed meaningfully. Flag a date that contradicts the record, such as a build timestamp later than the last real change. An omitted lastmod is valid; an unknown change date leaves accuracy unchecked.\n7. Report issues by entry number in source order, numbering entries across child sitemaps in index order, and list codes for the same entry in the order relative-url, outside-scope, duplicate, wrong-lastmod. Keep protocol problems separate from views about which pages should be indexed.\n\n## Checks before you deliver\n\n- An escaped ampersand is normal XML and should become a single ampersand in the URL.\n- Cross-host hosting and ownership need specific arrangements. Do not treat an arbitrary second hostname as in scope.\n- A lastmod set to the generation time on every entry is wrong for every page that did not change. Google says it uses lastmod only when it is consistently and verifiably accurate.\n- Reading a sitemap index's lastmod values as page dates confuses file dates with page dates.\n- Collapsing URLs that differ only by case or query string can hide genuinely different pages. Report them as listed and ask.\n- Google ignores priority and changefreq. Do not spend the review tuning them.\n\n## How to present the result\n\nStart with the totals: entries read, child sitemaps unavailable and issues by type. Then list each issue with its entry number, URL and fix: make it absolute, move it to a sitemap whose directory covers it, remove the duplicate, or correct or drop the lastmod. If asked, give the corrected entries ready to paste, and state what coverage is still unknown.\n\n## Worked example\n\n**Request:** Review https:\/\/shop.example\/catalog\/sitemap.xml. No cross-site arrangement. Treat the following rows as decoded loc|lastmod|actual page change.\n\n**Supplied material:**\n\n```text\nhttps:\/\/shop.example\/catalog\/coat|2026-11-20|2026-10-12\nhttps:\/\/shop.example\/help\/returns|-|unknown\nhttps:\/\/shop.example\/catalog\/coat|-|2026-10-12\n```\n\n**Answer:** Keep one entry for \/catalog\/coat and change its lastmod to 2026-10-12, the recorded page change, or omit the date. Remove the repeated coat entry. List \/help\/returns in a sitemap whose directory covers \/help\/.\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 issues as objects with row (one-based URL entry) and code, in source order. Codes in priority order per row are relative-url, outside-scope, duplicate and wrong-lastmod. Apply scope checks only to absolute URLs. Flag duplicates from the second occurrence onward. For multiple child sitemaps, number URL entries consecutively in index order. Include unavailable_sitemaps as an array of absolute child URLs only when child content is missing.\n\n## Sources\n\n- [Sitemaps XML protocol](https:\/\/www.sitemaps.org\/protocol.html): Defines urlset and sitemapindex files, the 50,000 URL and 50MB uncompressed limits, UTF-8 and entity escaping, a loc under 2,048 characters, lastmod as the page's modification date rather than the generation date, and the rule that a sitemap may list only URLs on its own host and under its own directory.\n- [Google Search Central: build and submit a sitemap](https:\/\/developers.google.com\/search\/docs\/crawling-indexing\/sitemaps\/build-sitemap): Google says it ignores priority and changefreq, uses lastmod only when it is consistently and verifiably accurate, and that a sitemap affects only descendants of its directory unless submitted through Search Console, where sitemaps can cover several verified sites.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/check-a-sitemap-inventory\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\/check-a-sitemap-inventory\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# A catalogue sitemap\n\nReview https:\/\/shop.example\/catalog\/sitemap.xml. No cross-site arrangement. Treat the following rows as decoded loc|lastmod|actual page change.\n\n## Supplied material\n\nhttps:\/\/shop.example\/catalog\/coat|2026-11-20|2026-10-12\nhttps:\/\/shop.example\/help\/returns|-|unknown\nhttps:\/\/shop.example\/catalog\/coat|-|2026-10-12\n\n## Worked answer\n\nKeep one entry for \/catalog\/coat and change its lastmod to 2026-10-12, the recorded page change, or omit the date. Remove the repeated coat entry. List \/help\/returns in a sitemap whose directory covers \/help\/.\n\n## Reasoning\n\nA catalogue sitemap cannot claim a sibling path by default. An omitted lastmod is valid.\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 https:\/\/shop.example\/catalog\/sitemap.xml. No cross-site arrangement. Treat the following rows as decoded loc|lastmod|actual page change.\nReturn only the JSON specified in SKILL.md for this test.\n\nhttps:\/\/shop.example\/catalog\/coat|2026-11-20|2026-10-12\nhttps:\/\/shop.example\/help\/returns|-|unknown\nhttps:\/\/shop.example\/catalog\/coat|-|2026-10-12\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"issues\": [\n        {\n            \"row\": 1,\n            \"code\": \"wrong-lastmod\"\n        },\n        {\n            \"row\": 2,\n            \"code\": \"outside-scope\"\n        },\n        {\n            \"row\": 3,\n            \"code\": \"duplicate\"\n        }\n    ]\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"A catalogue sitemap cannot claim a sibling path by default. An omitted lastmod is valid.\n"},{"path":"tests\/case-2\/request.txt","content":"Review https:\/\/shop.example\/sitemap.xml. No cross-site arrangement. Rows use loc|lastmod|actual.\nReturn only the JSON specified in SKILL.md for this test.\n\n\/help|-|unknown\nhttps:\/\/shop.example\/?edition=uk|-|unknown\nhttps:\/\/shop.example\/?edition=ie|-|unknown\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"issues\": [\n        {\n            \"row\": 1,\n            \"code\": \"relative-url\"\n        }\n    ]\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"The two absolute URLs carry different query values and are distinct entries.\n"},{"path":"tests\/case-3\/request.txt","content":"Audit the page inventory under https:\/\/museum.example\/sitemap.xml. Child maps are at the site root and listed in this order.\nReturn only the JSON specified in SKILL.md for this test.\n\nsitemapindex: catalog.xml, offers.xml.gz, loans.xml (absolute child URLs on museum.example)\ncatalog.xml urlset: https:\/\/museum.example\/summer, https:\/\/museum.example\/winter\noffers.xml.gz decompressed urlset: https:\/\/museum.example\/summer, https:\/\/museum.example\/old\nloans.xml: no contents supplied; no page modification dates supplied.\n"},{"path":"tests\/case-3\/expected.json","content":"{\n    \"issues\": [\n        {\n            \"row\": 3,\n            \"code\": \"duplicate\"\n        }\n    ],\n    \"unavailable_sitemaps\": [\n        \"https:\/\/museum.example\/loans.xml\"\n    ]\n}\n"},{"path":"tests\/case-3\/explanation.txt","content":"The known children list four page entries and three distinct pages. The index lists child files. The missing child leaves total site coverage unknown.\n"}],"is_active":true,"is_approved":false}]}]}