Agent skill

XML Sitemap

by kostja94 in kostja94/marketing-skills

When the user wants to create, audit, or optimize sitemap.xml.

MITAuto-check passedMarketing & SEO

Install XML Sitemap

skills CLI
$ npx skills add kostja94/marketing-skills --skill xml-sitemap -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kostja94/marketing-skills xml-sitemap --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kostja94/marketing-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/seo/technical/sitemap .claude/skills/xml-sitemap && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
xml-sitemap
GitHub stars
1k
Token cost
~2.9k tokens
SKILL.md length
1,164 words
Files
1
Skills in repo
102
Repo updated
First seen
Licence
MIT

At a glance

When the user wants to create, audit, or optimize sitemap.xml.

  • Works in 11 steps: Protocol Essentials → Field Requirements → Architecture & Split → …
  • Wants to create
  • SKILL.md covers Scope (Technical SEO), Task, Initial Assessment and 1. Protocol Essentials, plus 12 more sections
  • Calls curl; reaches sitemaps.org and w3.org

What it does

XML Sitemap is an agent skill from kostja94/marketing-skills. When the user wants to create, audit, or optimize sitemap.xml. Also use when the user mentions "sitemap," "sitemap.xml," "sitemap index," "lastmod," "changefreq," "priority," "URL discovery," "URL discovery for search engines," "single source of truth," "URL config," "unify sitemap IndexNow," or "reduce duplicate maintenance." For IndexNow, use indexnow.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Marketing & SEO, covering Technical SEO. The repository describes itself as: Agent Skills for Marketing — SEO, Social, Influencer & More. 160+ open-source skills for SEO, content, 40+ page types, paid ads, channels, and strategies. Add project context… The licence is MIT.

When your agent uses it

  • Wants to create
  • Optimize sitemap.xml
  • The user mentions sitemap
  • URL discovery for search engines

Example prompts

  • “sitemap,”
  • “sitemap.xml,”
  • “sitemap index,”
  • “/xml-sitemap”

Workflow steps

11 steps, taken from the step headings in SKILL.md.

  1. Protocol Essentials
  2. Field Requirements
  3. Architecture & Split
  4. Implementation
  5. Page Scope
  6. Data Source & Maintenance (Single Source of Truth)
  7. robots.txt
  8. Output Format
  9. Submission & Verification
  10. HTML Diagnosis (Sitemap Returns HTML Instead of XML)
  11. Common Issues

What it can do on your machine

Read from SKILL.md and the folder at commit 8dd89c5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • sitemaps.org
    • w3.org

    Also links to:

    • developers.google.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

XML Sitemap loads about 2.9k tokens when it runs. Until then it costs about 92 tokens; SKILL.md has 1,164 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~92
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kostja94/marketing-skills at commit 8dd89c5, republished under its MIT licence (© kostja94). 1,164 words, ~2,914 tokens.

Download SKILL.mdSave it as .claude/skills/xml-sitemap/SKILL.md (or your agent's skills folder).
name
xml-sitemap
description
When the user wants to create, audit, or optimize sitemap.xml. Also use when the user mentions "sitemap," "sitemap.xml," "sitemap index," "lastmod," "changefreq," "priority," "URL discovery," "URL discovery for search engines," "single source of truth," "URL config," "unify sitemap IndexNow," or "reduce duplicate maintenance." For IndexNow, use indexnow.
metadata.version
1.1.0

SEO Technical: Sitemap

Guides sitemap creation, auditing, and optimization for search engine discovery.

When invoking: On first use, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.

Scope (Technical SEO)

  • Sitemap: Create XML sitemap; submit to Google Search Console
  • URL discovery: Help search engines find pages; especially important for large sites or poor internal linking

Task

Generate an XML Sitemap that complies with the sitemaps.org protocol from the project's page list, and declare it in robots.txt.

Initial Assessment

Project context: Read root contextus.md when present and load only the modules relevant to this task. Without Contextus, use available project material or user-provided facts and ask for missing information; do not create a parallel context system.

Identify:

  1. Site URL: Base domain (e.g., https://example.com)
  2. URL count: Total indexable pages (single sitemap vs. sitemap index)
  3. Data source: Static config, CMS, file system, or hybrid
Precondition: Does the site need a sitemap?

Before generating, assess whether a sitemap is warranted. A sitemap is most valuable when:

  • Large site (hundreds+ pages) or new site with few backlinks
  • Deep or orphaned pages that internal links don't reach well
  • Rich media (images, videos, news) needing extension metadata
  • GSC shows growing "Discovered – not indexed" or "Not discovered" counts

Small sites (< 50 pages) with strong internal linking may not strictly need one, but creating a sitemap has near-zero cost and provides future-proof infrastructure. If in doubt, err on the side of creating.

1. Protocol Essentials

ItemSpec
Single sitemap limit50,000 URLs, 50MB (uncompressed)
Sitemap indexWhen exceeding limit, split and have main index reference sub-sitemaps
EncodingUTF-8
URL formatFull URL, same host, include https://
Required tags<loc>
Optional tags<lastmod>, <changefreq>, <priority>

2. Field Requirements

FieldDescriptionRecommendation
urlFull URLhttps://example.com/path
lastModifiedPage last modified timeUse page metadata, ISO 8601; use YYYY-MM-DD or omit when no data
changeFrequencyUpdate frequencyHome daily, list pages weekly, content pages monthly
priorityRelative importanceHome 1.0, aggregate pages 0.9, content pages 0.7–0.8, others 0.5–0.6
lastmod (Critical)
  • Must be accurate: Reflect actual page modification time, not sitemap generation time. Google requires verifiability; Bing reports ~18% of sitemaps have incorrect lastmod values.
  • Format: W3C Datetime (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS+TZD), e.g. 2025-01-15, 2025-01-15T14:30:00+08:00.
  • Avoid: Using new Date() for lastmod—causes all URLs to share the same timestamp; search engines may ignore.
  • Apply when: Content updates, structured data changes, or important link changes.
changefreq / priority
  • changefreq: Hints only; does not directly determine crawl frequency. Values: always, hourly, daily, weekly, monthly, yearly, never.
  • priority: 0.0–1.0; does not affect ranking; set higher for important pages; avoid identical values for all.

3. Architecture & Split

Single Sitemap
  • When URLs >50,000, generate /sitemap.xml directly.
Sitemap Index (Multiple Sub-sitemaps)
  • When exceeding limit, split by type or language; main index references sub-sitemaps.
  • Example splits: /sitemap/posts.xml, /sitemap/pages.xml, /sitemap/zh.xml, /sitemap/en.xml.
  • Main index outputs /sitemap.xml or /sitemap-index.xml, each entry as <sitemap><loc>...</loc></sitemap>.
Multilingual Sites
  • Split by locale: /sitemap/zh.xml, /sitemap/en.xml.
  • Or by content type + language: /sitemap/zh-posts.xml, /sitemap/en-posts.xml.
Multi-Language Sitemap (hreflang in Sitemap)

For multilingual sites, add xhtml:link hreflang alternates inside each <url> entry. Recommended for large sites (100+ multilingual pages); centralizes hreflang management.

Rules:

  • Every language version must link to ALL others, including itself (self-reference).
  • Include x-default pointing to default locale.
  • Use xmlns:xhtml="http://www.w3.org/1999/xhtml" namespace.
  • <loc> typically uses default-locale (clean) URL; x-default points there too.
xml
<?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/page</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/page" />
    <xhtml:link rel="alternate" hreflang="zh" href="https://example.com/zh/page" />
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/page" />
  </url>
</urlset>

List all language sitemaps in sitemap index; include in robots.txt.

4. Implementation

Tech StackImplementation
Next.js App Routerapp/sitemap.ts export MetadataRoute.Sitemap or generateSitemaps
Next.js Pages Routerpages/sitemap.xml.ts or getServerSideProps return XML
Astrosrc/pages/sitemap-index.xml.ts or @astrojs/sitemap
Vite / Static buildBuild script generates public/sitemap.xml
OtherGenerate static /sitemap.xml or return dynamically via API
Route Exclusion
  • If the project has i18n / middleware redirects, exclude sitemap paths to avoid redirect.
  • Example (Next.js matcher): '/((?!api|_next|sitemap|sitemap-index|.*\\..*).*)'.

5. Page Scope

Include
  • Home: /
  • Locale/region home pages (e.g. /zh, /en)
  • All indexable content pages, list pages, category pages
Exclude
  • /api/*, /admin/*, /_next/*
  • Static assets (images, JS, CSS, etc.). For image discovery, use image sitemap extension—see image-optimization. For video discovery, use video sitemap extension—see video-optimization
  • Login, admin, drafts, and other pages not intended for indexing
Show full SKILL.md (471 more words)Show less

6. Data Source & Maintenance (Single Source of Truth)

  • Single source of truth: Read URL list from config, CMS, or metadata; avoid hardcoding in sitemap.
  • Multiple page types: Tools, blog, marketing pages can be merged into one array for unified generation.
  • New pages: Add only to data source; sitemap updates automatically; avoid maintaining multiple places.

Create a config (e.g., site-pages-config.ts) that exports:

  • Page slugs/paths by section (tools, blog, marketing, etc.)
  • Optional: modifiedDate per page for accurate lastmod
  • Function: getAllPageUrls(baseUrl) for sitemap and IndexNow

Why: Sitemap, IndexNow, and feed can all import from the same config—no duplicate URL maintenance. IndexNow should use the same URL list; avoid separate hardcoded lists.

7. robots.txt

Add to robots.txt:

Sitemap: https://example.com/sitemap.xml

With multiple sitemaps, only declare the main index.

8. Output Format

Single Sitemap Example
xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2025-01-15</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://example.com/page</loc>
    <lastmod>2025-01-10</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>
Sitemap Index Example
xml
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://example.com/sitemap/pages.xml</loc>
    <lastmod>2025-01-15</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://example.com/sitemap/posts.xml</loc>
    <lastmod>2025-01-14</lastmod>
  </sitemap>
</sitemapindex>

9. Submission & Verification

After generating the sitemap, guide the user through submission:

  1. robots.txt: Add Sitemap: https://example.com/sitemap.xml (or the index URL)
  2. Google Search Console: Navigate to Indexing → Sitemaps, enter the sitemap URL, submit
  3. Verify: In GSC Sitemaps report, check "Discovered pages" count vs. expected; if large gap, investigate
  4. Monitor: After 24–48h, confirm status shows "Success"; check Indexing → Pages report filtered by sitemap for "Indexed" vs. "Not indexed" breakdown

Common submission errors to flag:

  • Sitemap URL 404 — check build output and deployment
  • "Could not fetch" — verify robots.txt doesn't block the sitemap URL
  • "HTML page" error — see §10 HTML Diagnosis below

10. HTML Diagnosis (Sitemap Returns HTML Instead of XML)

When /sitemap.xml returns HTTP 200 but Content-Type: text/html with homepage content, Google silently rejects the sitemap — no GSC alert because the status code is 200. This is worse than 404.

Common causes:

  • Catch-all page routes (pages/[...slug].vue, Next.js catch-all) intercepting before the sitemap handler
  • i18n modules running at a lower level than routeRules/middleware
  • Geo-redirects or redirect plugins matching sitemap paths
  • CDN/cache layers stripping Content-Type headers

Diagnose with:

bash
curl -I https://example.com/sitemap.xml          # Check Content-Type
curl -A "Googlebot" -I https://example.com/sitemap.xml  # Googlebot's view
curl -s https://example.com/sitemap.xml | head -5       # First lines must be XML

Fix (Next.js): Use server/routes/sitemap.xml.ts (highest priority, bypasses catch-all). For i18n, add excludePatterns: [/^\/sitemap.*\.xml$/]. Renaming the sitemap file (e.g., to sitemap_index.xml) can bypass Google's cache of the failed state.

11. Common Issues

IssueCause / Fix
Sitemap 404Build failure, wrong path, incorrect export; check routes and deployment
Missing pagesURLs not in data source, filtered or excluded
lastmod anomalyAvoid new Date(); use modifiedDate from page metadata
Google not indexingSubmit sitemap in GSC; check Coverage (google-search-console) and robots
EN/ZH URL mismatchUse unified data source; share same list when generating by locale
Sitemap returns HTMLCatch-all route or i18n intercepting before sitemap handler; diagnose with curl -I + Googlebot UA; see §10

References

  • website-structure: Plan page structure and URL list; sitemap reflects planned/indexable pages
  • google-search-console: Sitemap status, indexed URL count, Coverage
  • robots-txt: Reference sitemap in robots.txt
  • indexnow: Share same URL list from config
  • image-optimization: Image sitemap extension for image discovery
  • video-optimization: Video sitemap extension for video discovery

© kostja94, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/seo/technical/sitemap of kostja94/marketing-skills.

Open the folder on GitHubat commit 8dd89c5

Compare with similar skills

XML Sitemap next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

XML Sitemap compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
XML Sitemap this skillkostja94/marketing-skills1k—~2.9kAutomated safety check: PassMIT
Hreflang and International SEOAgriciDaniel/claude-seo19k5 repos~3.4kAutomated safety check: PassMIT
Google SEO APIsAgriciDaniel/claude-seo19k1 repos~4.2kAutomated safety check: PassMIT
GEO-First SEO Audit Toolzubair-trabzada/geo-seo-claude11k—~2.8kAutomated safety check: NotesMIT
SEO Optimizerailabs-393/ai-labs-claude-skills4541 repos~3.2kAutomated safety check: PassMIT
SEO Drift MonitorAgriciDaniel/claude-seo19k1 repos~1.9kAutomated safety check: PassMIT

Similar skills

  • Hreflang and International SEO

    AgriciDaniel/claude-seo

    Audits, validates and generates hreflang tags for multi-language and multi-region sites in HTML, HTTP headers or XML sitemaps, flagging common code and return-tag mistakes.

    19k GitHub starsUsed in 5 repos~3.4k tokens
    Marketing & SEOAuto-check passed
  • Google SEO APIs

    AgriciDaniel/claude-seo

    Pulls real Google data for SEO work: Search Console, PageSpeed Insights, CrUX field data, the Indexing API and GA4 organic traffic, through /seo google commands.

    19k GitHub starsUsed in 1 repo~4.2k tokens
    Marketing & SEOAuto-check passed
  • GEO-First SEO Audit Tool

    zubair-trabzada/geo-seo-claude

    Audits a website for AI search visibility across ChatGPT, Claude, Perplexity and Google AI Overviews while checking traditional SEO, schema and E-E-A-T content quality.

    11k GitHub stars~2.8k tokensUpdated today
    Marketing & SEOAuto-check: notes
  • SEO Optimizer

    ailabs-393/ai-labs-claude-skills

    This skill should be used when analyzing HTML/CSS websites for SEO optimization, fixing SEO issues, generating SEO reports, or implementing SEO best practices.

    454 GitHub starsUsed in 1 repo~3.2k tokens
    Marketing & SEOAuto-check passed
  • SEO Drift Monitor

    AgriciDaniel/claude-seo

    Captures baselines of a page's SEO-critical elements, compares later snapshots against them and flags regressions by severity, like version control for on-page SEO.

    19k GitHub starsUsed in 1 repo~1.9k tokens
    Marketing & SEOAuto-check passed
  • llms.txt Analyzer and Generator

    zubair-trabzada/geo-seo-claude

    Validates an existing llms.txt file or crawls a site to generate a new one, following the format rules for a root-level Markdown file aimed at AI systems.

    11k GitHub starsUsed in 2 repos~3.9k tokens
    Marketing & SEOAuto-check: notes

More from kostja94/marketing-skills

All 102 skills in this repo
  • Grokipedia Recommendations

    kostja94/marketing-skills

    When the user wants to add recommendations, links, or content to Grokipedia.

    1k GitHub starsUsed in 1 repo~4.2k tokens
    Auto-check passed
  • AI Traffic Tracking

    kostja94/marketing-skills

    When the user wants to track AI search traffic in GA4 or GSC.

    1k GitHub stars~959 tokensUpdated 3 days ago
    Auto-check passed
  • Analytics Tracking

    kostja94/marketing-skills

    When the user wants to set up, audit, or optimize analytics tracking (GA4, events, conversions).

    1k GitHub stars~1.5k tokensUpdated 3 days ago
    Auto-check passed
  • Brand Visual Generator

    kostja94/marketing-skills

    When the user wants to define, audit, or apply visual identity (typography, colors, spacing, design tokens, frontend aesthetics).

    1k GitHub stars~3k tokensUpdated 3 days ago
    Auto-check passed
  • Canonical Tag

    kostja94/marketing-skills

    When the user wants to configure canonical URLs, fix duplicate content, or consolidate URL signals.

    1k GitHub stars~1.2k tokensUpdated 3 days ago
    Auto-check passed
  • Content Strategy

    kostja94/marketing-skills

    When the user wants to plan content for SEO, create content calendar, or build topic clusters.

    1k GitHub stars~1.8k tokensUpdated 3 days ago
    Auto-check passed

Categories

Questions about XML Sitemap

What does XML Sitemap do?

When the user wants to create, audit, or optimize sitemap.xml. XML Sitemap is an agent skill from kostja94/marketing-skills.xml.

When should I use XML Sitemap?

XML Sitemap fits situations like: wants to create; optimize sitemap.xml; the user mentions sitemap; URL discovery for search engines.

How do I install XML Sitemap in Claude Code?

Run `npx skills add kostja94/marketing-skills --skill xml-sitemap -a claude-code`. Or copy the skill folder (skills/seo/technical/sitemap in kostja94/marketing-skills) into .claude/skills/xml-sitemap in your project. Claude Code loads it when a task matches its description.

How do I install XML Sitemap in Codex?

Run `npx skills add kostja94/marketing-skills --skill xml-sitemap -a codex`. Or copy the skill folder (skills/seo/technical/sitemap in kostja94/marketing-skills) into .agents/skills/xml-sitemap in your project. Codex loads it when a task matches its description.

Can I use XML Sitemap in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kostja94/marketing-skills --skill xml-sitemap -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/xml-sitemap, .gemini/skills/xml-sitemap, .github/skills/xml-sitemap and .opencode/skills/xml-sitemap in your project.

What does XML Sitemap need to run?

Going by SKILL.md and its folder, XML Sitemap needs the command-line tools its instructions call (curl).

Does XML Sitemap access the network?

SKILL.md names 3 domains. In commands or code: sitemaps.org and w3.org; the agent is likely to contact these when it follows the instructions. As links in the text: developers.google.com. This is read from the text; nothing was executed.

Is XML Sitemap safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does XML Sitemap use?

XML Sitemap is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does XML Sitemap use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to XML Sitemap?

Skills that share tags, products or a category with XML Sitemap: Hreflang and International SEO (AgriciDaniel/claude-seo, 19k stars), Google SEO APIs (AgriciDaniel/claude-seo, 19k stars), GEO-First SEO Audit Tool (zubair-trabzada/geo-seo-claude, 11k stars) and SEO Optimizer (ailabs-393/ai-labs-claude-skills, 454 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains XML Sitemap?

kostja94 (a GitHub user) maintains it in kostja94/marketing-skills, which has 1,025 GitHub stars. The repository holds 102 skills in this directory. The repository was last updated on October 6, 2026.

Source: kostja94/marketing-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.