code/sitemap-audit/SKILL.md
Audits a website's SEO discoverability by cross-referencing the codebase with live production. Catches sitemap, robots.txt, and canonical inconsistencies, framework-specific anti-patterns (Next.js App Router metadata cascade, Astro/Nuxt equivalents), redirect-chain issues, and Google Search Console stuck states. Produces a prioritized, evidence-backed report with suggested fixes. Use when Search Console shows "Couldn't fetch", pages aren't being indexed, or you want an SEO health check before a launch or after a routing refactor.
npx skillsauth add mostafa-drz/claude-skills sitemap-auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Diagnostic SEO audit. Report only — never modifies code or Search Console state. Cross-references the codebase with live production to catch issues that live-only tools miss (like framework metadata cascade bugs).
Read ~/.claude/skills/sitemap-audit/preferences.md using the Read tool. If not found, proceed with onboarding.
On startup, use Bash to detect (skip any that fail):
pwdpackage.json (Next.js / Astro / Nuxt / SvelteKit / generic), astro.config.*, nuxt.config.*src/app/ (App Router) or pages/ (Pages Router)git status, git log -1 --format=%hCheck $ARGUMENTS for subcommands:
helpDisplay:
sitemap-audit — SEO health check across codebase + live production
Usage:
/sitemap-audit Audit site from preferences
/sitemap-audit <url> Audit a specific URL (one-off)
/sitemap-audit config Set preferences
/sitemap-audit reset Clear preferences
/sitemap-audit help This help
What it checks:
1. Sitemap fetchability + XML validity + URL count
2. robots.txt content + sitemap pointer consistency
3. Every URL in sitemap: 200 status, self-canonical match
4. Response headers: Content-Type, X-Robots-Tag, HSTS
5. Apex ↔ www redirect chain depth + consistency
6. Codebase anti-patterns (framework-specific)
7. SSR vs JS-only rendering (Googlebot compatibility)
8. DNS: site verification TXT records for GSC
9. (Optional, with permission) Live GSC check via Chrome extension
Output: prioritized report (P0 blocks indexing / P1 hurts rankings / P2 nice-to-have).
Current preferences: [read from preferences.md or "none — will onboard"]
Then stop.
configUse AskUserQuestion to collect:
Q1 — "Production URL to audit? (e.g. https://www.example.com)"
Q2 — "Repo path for codebase-aware checks?"
pwd)", "Specify path", "Skip codebase checks"Q3 — "Do you have a Google Search Console property you want the skill to explore? (optional, requires Claude for Chrome extension)"
Q4 — "Save report to a file after each run?"
.sitemap-audit/report-<date>.md in repo", "Yes — custom path"Save to ~/.claude/skills/sitemap-audit/preferences.md. Summary. Stop.
resetDelete ~/.claude/skills/sitemap-audit/preferences.md. Confirm: Preferences cleared. Stop.
Show one-line invitation (don't block):
First time running /sitemap-audit? Run `/sitemap-audit config` for persistent setup,
or answer a couple of one-off questions to continue.
Then ask (via AskUserQuestion or inline) ONLY: production URL (required), codebase path (default: cwd). Skip GSC on first run.
Continue to Audit steps below.
Execute these in order. Run independent curls in parallel. Every finding must cite evidence (exact curl output, file:line, or DNS record).
Record HTTP status + final URL + Content-Type + first hop for each:
curl -sI <url>/
curl -sI <url>/sitemap.xml
curl -sI <url>/robots.txt
curl -sI <url-apex>/ # if www is canonical, or vice versa
curl -sIL <url-apex>/sitemap.xml # follow to detect redirect chain depth
Flag P0 if:
application/xml or text/xmlcurl -s <sitemap-url> | xmllint --noout - # VALID or error
curl -s <sitemap-url> | grep -c "<loc>" # URL count
Flag P0 if XML invalid. Flag P1 if URL count is 0 or exceeds 50,000 (sitemap split needed).
For each <loc>:
<link rel="canonical">Count: correct canonical (matches own URL), no canonical (Google self-canonicals by default, acceptable), WRONG canonical (points elsewhere — P0).
Classify wrong canonicals by where they point:
alternates.canonical leaking)On homepage + sitemap + a sample article:
X-Robots-Tag — any noindex here silently de-indexes the URL. P0 if found unexpectedly.Strict-Transport-Security — presence is good.Content-Type — text/html; charset=utf-8 expected for pages.If site has both apex and www:
<link rel="canonical"> on homepage)Sitemap: pointer use the canonical host?Common P0 pattern: sitemap + robots canonicalize one host, but page-level <link rel="canonical"> points to the other. Seen in Next.js sites that fix sitemap/robots but forget metadataBase or hardcoded URLs in layouts.
Only if codebase path is set. Detect framework from package.json, run framework-specific checks.
Read these files:
next.config.*, next.config.tssrc/app/layout.tsx (root) — scan for metadata.alternates.canonicalsrc/app/sitemap.ts — check baseUrl consistency with production canonical hostsrc/app/robots.ts — check sitemap: pointer matchessrc/lib/metadata.ts or similar — grep for hardcoded URLs: grep -rn "https?://<apex-domain>" src/Anti-patterns to flag:
alternates.canonical set in src/app/layout.tsx cascades to every child route that doesn't override. Result: every page claims to be the homepage. Fix: remove root canonical; let pages self-canonical or add explicit per-route.siteUrl in src/lib/metadata.ts is apex but sitemap/robots/redirect canonicalize to www (or vice versa). Grep: grep -rn "https://<apex>" src/ --include="*.ts" --include="*.tsx".metadataBase: root layout has no metadataBase, so relative URLs in metadata won't resolve.readdirSync(join(process.cwd(),...)) in sitemap.ts can fail in serverless if files not bundled. Prefer compile-time aggregation.lastModified omitted: sitemap entries without lastModified give Google no crawl-priority signal.pages/sitemap.xml.ts or similar; flag if missing.<Head> in _document.js / _app.js for canonical setup._document (applies site-wide, same cascade trap).astro.config.mjs for site (required for canonical URLs).@astrojs/sitemap integration — flag P1 if site has >20 pages and no sitemap integration.<BaseHead> or layout for canonical.nuxt.config.ts → site or @nuxtjs/sitemap module.useHead canonical usage.svelte.config.js → kit.prerender.+layout.svelte <svelte:head> for canonical.<link rel="canonical" patterns in source.curl -s <url>/ | grep -oE "<h1|<article|<main" | head -5
curl -s <url>/ | grep -c "<meta\|<link"
Flag P0 if the HTML response is essentially empty (client-rendered SPA). Googlebot renders JS but delays indexing.
dig +short <apex-domain> A
dig +short <apex-domain> TXT
dig +short www.<apex-domain> CNAME
Flag:
google-site-verification=... TXT. If present, Domain property is set up in GSC (ideal).Only if user granted permission in preferences or this run.
Using the Claude for Chrome extension (mcp__claude-in-chrome__*):
https://search.google.com/search-console/sitemaps?resource_id=sc-domain%3A<domain> (or ?resource_id=<encoded-url> for URL-prefix properties)get_page_text to read the sitemaps tableDo NOT modify GSC state (no remove/resubmit). Read-only.
If any sitemap shows "Couldn't fetch" and production verifies healthy → flag as P1 with explicit user action: "remove + resubmit sitemap in GSC (use trailing slash trick to cache-bust if removal alone doesn't clear it)."
Format:
╔═══════════════════════════════════════════════════════════════╗
║ sitemap-audit — <domain> ║
║ <date> · <framework> · <N urls> in sitemap ║
╚═══════════════════════════════════════════════════════════════╝
SUMMARY
P0 (blocks indexing): <n>
P1 (hurts rankings): <n>
P2 (nice-to-have): <n>
P0 — Blocks indexing
• <finding>
Evidence: <file:line or curl output>
Fix: <specific action>
P1 — Hurts rankings
• ...
P2 — Nice-to-have
• ...
CLEAN PASSES
✓ Sitemap XML valid
✓ All <N> URLs return 200
✓ robots.txt consistent
...
NEXT ACTIONS (prioritized)
1. [P0] <most important fix>
2. [P0] <next>
3. [P1] <next>
GSC ACTIONS (manual — skill does not modify GSC)
• <specific click path if applicable>
After displaying the report, ask:
Want me to open a fix PR for P0/P1 findings? This would modify code only — never GSC. You'll review the PR before merge.
If yes:
fix/seo-sitemap-audit-<date>If no: done.
If preferences.md has saveReport: true: write the report to the configured path.
Save to ~/.claude/skills/sitemap-audit/preferences.md:
# /sitemap-audit preferences
Updated: <date>
## Defaults
- url: https://www.example.com
- repoPath: /Users/x/Dev/myproject
- gscMode: ask-per-run | always-skip | always-run
- saveReport: false | path
- framework: nextjs-app | nextjs-pages | astro | nuxt | sveltekit | generic
Learn silently:
always-skip.development
--- name: triage-board description: >- Generates a structured triage artifact from the current conversation's findings — a self-contained Desktop folder with a JSON Schema, schema-conformant report.json, prose markdown, and a single-file HTML viewer. Viewer ships with MD / CSV / JSON download buttons in the header and a per-finding "Copy as Markdown" action that produces a GitHub/Linear/Notion-ready ticket block. Stateless — triage state lives in the user's ticket system, not in the
development
Runs a beginner-mind end-to-end UI audit of any running app — local dev server, staging, production, or a specific URL. Drives Chrome through every interactive element on the target surface, collects structured findings (severity, category, where, symptom, impact, repro, triage), and hands the result off to `/triage-board` which produces the Desktop folder (schema + JSON + Markdown + single-file HTML viewer with MD/CSV/JSON exports and a per-finding Copy as Markdown button). Use when you want fresh-eyes verification of a feature, page, modal, flow, branch, or whole app — before shipping, before review, before a demo, or any time the UI deserves a careful poke.
development
Reviews the user's past Claude Code conversations from a wellbeing perspective — sentiment, tone, emotional arc, recurring patterns — and generates a supportive, science-grounded report in both Markdown and HTML. Default lookback is 48 hours across all projects. Uses recognised emotion frameworks (Plutchik, Ekman, Russell's circumplex, Pennebaker linguistic markers) and cites the science behind every observation. Learns the user's baseline tone over time so future reports flag genuine shifts, not noise. Use when the user asks for an emotional/wellbeing recap, mood check, sentiment review, or wants to understand their own ups and downs across recent work sessions.
development
--- name: workflow-advisor description: >- Analyzes recent Claude Code conversations and local Claude state (skills, settings, memory files, CLAUDE.md), researches the latest Claude Code features and best practices online, and suggests one workflow improvement at a time with reasoning and a concrete action item. Can save accepted suggestions to memory for tracking. Use when you want to discover underused Claude Code features, improve your development workflow, stay current with the lat