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 intent | Mode |
|---|---|
| "Check my sitemap", URL given | Analyze |
| "Generate a sitemap", new or planned site | Generate |
Mode 1: Analyze
- Locate the sitemap. Check
/sitemap.xml,/sitemap_index.xml, and the robots.txtSitemap:line before reporting "not found". - Validate format: well-formed XML, under 50,000 URLs per file, sitemap index used above that.
- Validate entries:
- All URLs return HTTP 200, no redirects, no 404s
- HTTPS only
- No noindexed URLs
- No non-canonical URLs
<lastmod>values vary and reflect real modification dates<priority>and<changefreq>flagged as ignorable noise (Google ignores both)- Compare crawled pages against the sitemap. Flag important pages missing from it.
- Output a validation report with the severity table from references/sitemap-rules.md.
Mode 2: Generate
- Ask for business type, or detect it from the existing site.
- Plan the URL structure with the user before writing XML.
- 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).
- 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.
- 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.