xml-sitemap

kostja94/marketing-skills · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/kostja94/marketing-skills --skill xml-sitemap
0 commentsdiscussion
summary

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

skill.md

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

Check for project context first: If .claude/project-context.md or .cursor/project-context.md exists, read it for site URL and page structure.

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

1. Protocol Essentials

Item Spec
Single sitemap limit 50,000 URLs, 50MB (uncompressed)
Sitemap index When exceeding limit, split and have main index reference sub-sitemaps
Encoding UTF-8
URL format Full URL, same host, include https://
Required tags <loc>
Optional tags <lastmod>, <changefreq>, <priority>

2. Field Requirements

Field Description Recommendation
url Full URL https://example.com/path
lastModified Page last modified time Use page metadata, ISO 8601; use YYYY-MM-DD or omit when no data
changeFrequency Update frequency Home daily, list pages weekly, content pages monthly
priority Relative importance Home 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 ignored due to lastmod errors.
  • 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 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 Stack Implementation
Next.js App Router app/sitemap.ts export MetadataRoute.Sitemap or generateSitemaps
Next.js Pages Router pages/sitemap.xml.ts or getServerSideProps return XML
Astro src/pages/sitemap-index.xml.ts or @astrojs/sitemap
Vite / Static build Build script generates public/sitemap.xml
Other Generate 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

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.

Central Config (Recommended)

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 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 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. Common Issues

Issue Cause / Fix
Sitemap 404 Build failure, wrong path, incorrect export; check routes and deployment
Missing pages URLs not in data source, filtered or excluded
lastmod anomaly Avoid new Date(); use modifiedDate from page metadata
Google not indexing Submit sitemap in GSC; check Coverage (google-search-console) and robots
EN/ZH URL mismatch Use unified data source; share same list when generating by locale

References

Related Skills

  • 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
how to use xml-sitemap

How to use xml-sitemap on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add xml-sitemap
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/kostja94/marketing-skills --skill xml-sitemap

The skills CLI fetches xml-sitemap from GitHub repository kostja94/marketing-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/xml-sitemap

Reload or restart Cursor to activate xml-sitemap. Access the skill through slash commands (e.g., /xml-sitemap) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.632 reviews
  • Maya Ramirez· Dec 24, 2024

    Solid pick for teams standardizing on skills: xml-sitemap is focused, and the summary matches what you get after install.

  • Evelyn Zhang· Dec 8, 2024

    Registry listing for xml-sitemap matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Michael Diallo· Nov 27, 2024

    xml-sitemap reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Rahul Santra· Nov 23, 2024

    xml-sitemap fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Diego Khan· Nov 3, 2024

    xml-sitemap is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Mia Jain· Oct 22, 2024

    Solid pick for teams standardizing on skills: xml-sitemap is focused, and the summary matches what you get after install.

  • Evelyn Bhatia· Oct 18, 2024

    We added xml-sitemap from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Pratham Ware· Oct 14, 2024

    xml-sitemap has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Ama Gonzalez· Sep 25, 2024

    xml-sitemap fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Mei Choi· Sep 17, 2024

    xml-sitemap has been reliable in day-to-day use. Documentation quality is above average for community skills.

showing 1-10 of 32

1 / 4