agentleFS
ThibaultbmThibaultbm/claude-seo-geo/skills/seo-sitemap/SKILL.md

seo-sitemap

Skill18 starsChanged 11 days agoMITView on GitHub

Build an XML sitemap that is clean for robots (valid, light, segmented, honest lastmod) and elegant for people who open it: pretty-printed raw XML, one element per line, two-space indentation, a fixed order inside every entry, no stylesheet, no script, no HTML. Input: a site or its sitemap URL. Output: an audit by sitemap_audit.py (pretty-print, leftover XSL or polyfill, size, segmentation, duplicates, lastmod honesty, priority and changefreq, hreflang weight, URLs per language), the build (a sitemap index split by section and language when the site is large, every file pretty-printed by the bundled formatter or xmllint --format), and a scripted acceptance test. Use when a sitemap looks messy or minified when opened, sits on one line, carries an XSL stylesheet or Chrome's XSLT removal warning, is one huge file, or when building or auditing any sitemap.

32 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use seo-agentic, seo-sxo and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AgriciDanielSkill

    seo-agentic

    Audit and fix agent readiness: the Lighthouse Agentic Browsing fraction, accessibility tree for agents, robots.txt and Content-Signal for AI agents, WAF treatment of agent traffic, llms.txt, Markdown delivery, ai-catalog.json, /.well-known discovery files, and WebMCP tools. Use when the user asks whether AI agents can use or browse the site, or about llms.txt or WebMCP. Exclude AI citability and brand signals (seo-geo) and commerce protocol depth (seo-ecommerce).

    Also in 5 projects that use this

  • timruebenachSkill

    seo-sxo

    Search Experience Optimization: reads Google SERPs backwards to detect page-type mismatches, derives user stories from search intent signals, and scores pages from multiple persona perspectives. Identifies why well-optimized pages fail to rank by analyzing what Google rewards for each keyword. Use when user says "SXO", "search experience", "page type mismatch", "SERP analysis", "user story", "persona scoring", "why isn't my page ranking", "intent mismatch", or "wireframe".

    Also in 20 projects that use this

  • timruebenachSkill

    seo-maps

    Maps intelligence for local SEO — geo-grid rank tracking, GBP profile auditing via API, review intelligence across Google/Tripadvisor/Trustpilot, cross-platform NAP verification (Google/Bing/Apple/OSM), competitor radius mapping, and LocalBusiness schema generation from API data. Three-tier capability: free (Overpass + Geoapify), DataForSEO (full intelligence), DataForSEO + Google (maximum coverage). Use when user says "maps", "geo-grid", "rank tracking", "GBP audit", "review velocity", "competitor radius", "maps analysis", "local rank tracking", "Share of Local Voice", or "SoLV".

    Also in 17 projects that use this

  • indranilbanerjeeSkill

    seo-drift

    Compare two SEO exports (Search Console, two dates): gainers, losers, drift classes. \"what moved after the core update\"

    Also in 20 projects that use this

  • +6 more from timruebenach

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Clean up an existing XSL view (SMP-11): Remove the processing instruction from every file, delete sitemap.xsl and any xslt-polyfill file, …

    line 82

“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Elegant sitemaps: pretty-printed raw XML

A sitemap has two readers. Robots (Googlebot, Bingbot, the AI crawlers) need a valid, light, honest file. People open it too: the client checking that the site is complete, the developer, the agency during an audit. What they should see is the raw XML, printed elegantly: one element per line, a consistent indentation, the same order inside every entry, nothing else. No stylesheet, no CSS, no HTML layer, no script. Opened in a browser, view-source, curl or an editor, the file reads cleanly and is exactly what the robots get.

Technical crawl rules for sitemaps (robots.txt line, Search Console submission, IndexNow, the dead ping endpoint) live in seo-technical, Step 2. This skill owns the file's format and structure.

Hard rules

  1. Raw XML only. No <?xml-stylesheet?> instruction, no XSL file, no xslt-polyfill or any <script> inside the sitemap, no HTML served at the sitemap address, no response that changes by user agent. The browser's own XML view ("This XML file does not appear to have any style information" followed by the tree) is the expected and correct rendering: it is not a defect to fix.
  2. Pretty-printed, always. Every sitemap file, index and children, is formatted exactly as xmllint --format would print it: XML declaration on line 1, one element per line, two spaces per nesting level, text-only elements on one line (<loc>…</loc>), no blank lines, no trailing spaces, LF line endings, a final newline. A minified or single-line sitemap is valid for robots but fails this skill.
  3. Same order everywhere. Inside each <url>: loc, lastmod, then the xhtml:link alternates in a fixed language order with x-default last, then image:image. Across the file: home first, then sections in a stable order, each page's language versions next to each other.
  4. Remove what exists. A site that already ships an XSL view: delete the processing instruction from every file, delete the XSL and any polyfill file, and keep the pretty-printed XML. Chrome removes native XSLT on 17 November 2026 and already shows a red warning above styled sitemaps; the decoration is not worth that risk.
  5. One source of truth. The XML sitemap, the hreflang tags in the pages and any HTML sitemap page are generated from the same page inventory, so their counts match.

Phase 1: Spec

IDRequirementSource
SMP-01Served with HTTP 200 and Content-Type application/xml, UTF-8, at the address declared on the robots.txt Sitemap: lineOfficial
SMP-02Max 50,000 URLs and 50 MB uncompressed per file; above that Google rejects the whole fileOfficial
SMP-03Multilingual site, whatever its size: /sitemap.xml is a short sitemap index listing one child per language (/sitemaps/fr-1.xml, /sitemaps/en-1.xml, numbered when a language exceeds one file), the layout used on sorank.com. Each entry carries loc, lastmod and the hreflang alternates only (no image tags). Monolingual site above about 500 URLs: same index, children split by section. Search Console then reports indexation per language or template, and each file stays short enough to readField rule
SMP-04Only canonical, indexable, 200 URLs on the sitemap's own host, in https, no duplicatesOfficial
SMP-05lastmod present on every URL and equal to the date of the last real content change. A date shared by a large share of URLs (build, import or generation date) is a lie Google learns to ignoreOfficial (Google ignores inaccurate lastmod)
SMP-06No priority, no changefreq: Google ignores both. They add weight and noise to the fileOfficial
SMP-07hreflang in the sitemap or in the page head, both allowed. When both, they must match exactly. On big multilingual sites, hreflang links often make most of the file's weight: segment by languageOfficial, field rule
SMP-08Multilingual: the same number of pages in every language (seo-technical, Step 2)Field rule
SMP-09Pretty-printed: byte-identical to xmllint --format output (two-space indentation, one element per line, text-only elements inline, no blank lines, no trailing spaces, final newline)Field rule
SMP-10Fixed element order inside each entry (loc, lastmod, alternates with x-default last, images) and a stable page order across the fileField rule
SMP-11No xml-stylesheet instruction, no XSL, no script, no comment, no HTML anywhere in a sitemap fileField rule
SMP-12Optional: an HTML sitemap page (/plan-du-site, /sitemap) linked from the footer, listing every indexable page by section with its title. It is a crawl hub for orphan-prone pages (seo-internal-linking), not a replacement for the XML file and never required by this skillField rule

Phase 2: Audit

python3 skills/seo-sitemap/scripts/sitemap_audit.py https://example.com
python3 skills/seo-sitemap/scripts/sitemap_audit.py https://example.com/sitemap_index.xml --json sitemap.json

Given a domain, the script reads robots.txt to find the sitemap (fallback /sitemap.xml), follows an index into its children (--max-children, default 100) and prints, per file: URL count, size, line count, whether the file is pretty-printed (and the first offending line when it is not), leftover stylesheet or script, hreflang links and their share of the bytes, lastmod coverage and the most frequent date, priority and changefreq, URLs per language, URLs per section. Then findings ranked BLOCKER, PRIORITY, FIX, WATCH, MINOR, each mapped to a spec row. Exit code 1 on any BLOCKER or PRIORITY.

Then check by eye: open the sitemap with view-source (or curl -s URL | head -30). You should see one element per line, indented by two spaces, the same shape repeated for every entry. One long line, tabs mixed with spaces, blank lines between entries, or a stylesheet line at the top: SMP-09 or SMP-11 fails.

Field case (a 5-language agency site, November 2026): one 1.4 MB file of 1762 URLs written on a handful of lines, 10500 hreflang links making 80% of the bytes (and duplicated in the page heads), priority and changefreq on every URL, 710 generated city pages all dated on the day they were generated, 41 blog posts without lastmod. The client opened it and thought the sitemap was broken. It was valid; it was unreadable and heavier than needed.

Phase 3: Build

  1. Structure (SMP-01 to SMP-08). Multilingual: a sitemap index at /sitemap.xml and one child per language, /sitemaps/fr-1.xml, /sitemaps/en-1.xml (sorank.com layout), each entry with loc, lastmod and its hreflang alternates, no image tags. Monolingual: one file for a small site, an index with one child per section above about 500 URLs. Drop priority and changefreq. Take lastmod from the content's real update date (CMS updated_at, git commit date of the content file), never the build date. Keep hreflang in one place when possible; if both the heads and the sitemap carry it, generate both from the same table. Declare the index in robots.txt and submit it in Search Console and Bing Webmaster Tools.
  2. Order (SMP-10). Emit entries in a stable order (home, then sections, then pages; language versions of a page side by side) and the children of each entry in the fixed order. A generator that iterates over an unordered set produces a different file on every build, which makes diffs useless.
  3. Pretty-print (SMP-09, SMP-11). Format every file as the last build step, then check it:
python3 skills/seo-sitemap/scripts/sitemap_audit.py --format public/sitemap.xml      # rewrites the file in place
xmllint --format public/sitemap.xml | diff -q - public/sitemap.xml && echo "pretty"     # independent check (libxml2, built into macOS and most Linux)

The bundled formatter strips any xml-stylesheet instruction, <script> element and comment, and prints the canonical layout. Expected shape:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://example.com/fr/</loc>
    <lastmod>2026-11-08</lastmod>
    <xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/"/>
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/fr/"/>
  </url>
</urlset>

Platforms that do not let you edit the sitemap (Shopify, Wix, Squarespace) generate their own layout: record it as an exception, do not add a stylesheet to compensate.

  1. Clean up an existing XSL view (SMP-11). Remove the processing instruction from every file, delete sitemap.xsl and any xslt-polyfill file, and redeploy. Nothing changes for robots: they ignored the stylesheet.

Acceptance

  1. sitemap_audit.py exits 0: no BLOCKER, no PRIORITY; any remaining FIX is written down with its reason.
  2. xmllint --format FILE | diff -q - FILE reports no difference for the index and every child.
  3. The live file opened with view-source shows one element per line, two-space indentation, no stylesheet line.
  4. In Search Console, each submitted sitemap reads "Success" and the discovered URL count equals the generated count.
  5. URLs per language are equal, or the gaps are written down as exceptions.

Sources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.