Skip to main content
AC
SEO & AEO3.8 KBMIT licensed

claude-seo-sitemap

Rewritten from patterns in AgriciDaniel/claude-seo (MIT)

Analyze existing XML sitemaps or generate new ones, validating format, URLs, and structure. Use when the user says "sitemap", "generate sitemap", "sitemap issues", or "XML sitemap". Not for full crawl or indexability audits: use claude-seo-technical. Not for structured data: use claude-seo-schema.

  • claude
  • seo
  • sitemap

SKILL.md

Sitemap Analysis and Generation

A sitemap is a promise to crawlers: every URL in it is live, canonical, and indexable. Break that promise and you waste crawl budget and trust.

Mode routing

User intentMode
"Check my sitemap", URL givenAnalyze
"Generate a sitemap", new or planned siteGenerate

Mode 1: Analyze

  1. Locate the sitemap. Check /sitemap.xml, /sitemap_index.xml, and the robots.txt Sitemap: line before reporting "not found".
  2. Validate format: well-formed XML, under 50,000 URLs per file, sitemap index used above that.
  3. Validate entries:
  4. All URLs return HTTP 200, no redirects, no 404s
  5. HTTPS only
  6. No noindexed URLs
  7. No non-canonical URLs
  8. <lastmod> values vary and reflect real modification dates
  9. <priority> and <changefreq> flagged as ignorable noise (Google ignores both)
  10. Compare crawled pages against the sitemap. Flag important pages missing from it.
  11. Output a validation report with the severity table from references/sitemap-rules.md.

Mode 2: Generate

  1. Ask for business type, or detect it from the existing site.
  2. Plan the URL structure with the user before writing XML.
  3. Apply the programmatic-page quality gates in references/sitemap-rules.md. Hard rules: WARNING at 30+ location pages (require 60%+ unique content each), HARD STOP at 50+ location pages (require written justification from the user).
  4. Generate valid XML using the templates in references/sitemap-rules.md. Split at 50k URLs with a sitemap index. Split by content type (pages, posts, images, videos) when the site is large enough to benefit.
  5. Deliver sitemap.xml (or split files plus index) and a short structure summary with URL counts.

Verification

Run curl -s <sitemap-url> | python3 -c "import sys,xml.etree.ElementTree as ET; ET.parse(sys.stdin); print('valid XML')". Expect valid XML. If it throws, report the parse error with line number and fix before delivering.

Then spot-check 5 URLs from the sitemap with curl -s -o /dev/null -w "%{http_code}" <url>. Expect 200 for each. Any 3xx or 4xx: remove or fix that entry, then re-check.

Good vs Bad

Bad: User wants 120 city landing pages that differ only by the city name in the H1. You generate the sitemap as asked. Those pages are doorway-page bait and a penalty risk.

Good: Same request. You stop at the 50+ hard gate, explain the doorway-page risk, and require either 60%+ unique content per page or a cut-down list of cities with real presence before generating anything.

Footguns

  • Redirected URLs in the sitemap. Crawlers waste budget resolving them. Fix: list only final destination URLs.
  • Identical `<lastmod>` on every entry. Signals auto-generated garbage, dates get ignored. Fix: use real modification dates or omit the tag.
  • Noindexed URLs included. You are telling crawlers "index this" and "do not index this" at once. Fix: remove them from the sitemap.
  • Sitemap not referenced in robots.txt. Discovery depends on manual submission. Fix: add a Sitemap: line to robots.txt.

Completion checklist

  • [ ] Sitemap located or generated, format validated
  • [ ] URL spot-checks return 200
  • [ ] No noindexed, redirected, or non-canonical entries
  • [ ] Quality gates applied to any programmatic page plan
  • [ ] Report or files delivered with issue severities

Any box unchecked: not done. Fix or say so.

Reference files

More in SEO & AEO

All skills