对任意URL进行SEO健康检查——分析元标签、OG、JSON‑LD、sitemap、robots.txt、SERP排名并评分0‑100。用户说“检查SEO”“审计”时使用。
SEO health check for any URL or project landing page. Fetches the page, analyzes meta tags, OG, JSON-LD, sitemap, robots.txt, checks SERP positions for target keywords, and outputs a scored report.
web_search(query, engines, include_raw_content) — SERP position check, competitor analysisproject_info(name) — get project URL if auditing by project nameIf MCP tools are not available, use Claude WebSearch/WebFetch as fallback.
Parse target from $ARGUMENTS.
http): use directly.docs/prd.md.Fetch the page via WebFetch. Extract:
<title> tag (length check: 50-60 chars ideal)<meta name="description"> (length check: 150-160 chars ideal)og:title, og:description, og:image, og:url, og:typetwitter:card, twitter:title, twitter:image<script type="application/ld+json">)<link rel="canonical"> — canonical URL<html lang="..."> — language tag<link rel="alternate" hreflang="..."> — i18n tagsCheck infrastructure files:
{origin}/sitemap.xml — exists? Valid XML? Page count?{origin}/robots.txt — exists? Disallow rules? Sitemap reference?{origin}/favicon.ico — exists?Forced reasoning — assess before scoring: Write out before proceeding:
SERP position check — for 3-5 keywords:
web_search(query="{keyword}") or WebSearch.Score calculation (0-100):
CheckMax PointsCriteriaTitle tag10Exists, 50-60 chars, contains primary keywordMeta description10Exists, 150-160 chars, compellingOG tags10og:title, og:description, og:image all presentJSON-LD10Valid structured data presentCanonical5Present and correctSitemap10Exists, valid, referenced in robots.txtRobots.txt5Exists, no overly broad DisallowH1 structure5Exactly one H1, descriptiveHTTPS5Site uses HTTPSMobile meta5Viewport tag presentLanguage5lang attribute on <html>Favicon5ExistsSERP presence15Found in top 10 for target keywords
Write report to docs/seo-audit.md (in project context) or print to console:
markdown
# SEO Audit: {URL}
**Date:** {YYYY-MM-DD}
**Score:** {N}/100
## Summary
{2-3 sentence overview of SEO health}
## Checks
| Check | Status | Score | Details |
|-------|--------|-------|---------|
| Title | pass/fail | X/10 | "{actual title}" (N chars) |
| ... | ... | ... | ... |
## SERP Positions
| Keyword | Position | Top Competitors |
|---------|----------|----------------|
| {kw} | #N or N/A | competitor1, competitor2, competitor3 |
## Critical Issues
8. **Output summary** — print score and top 3 recommendations.
## Notes
- Score is relative — 80+ is good for a landing page, 90+ is excellent
- SERP checks are approximations (not real-time ranking data)
- Run periodically after content changes or before launch
## Common Issues
### Page fetch fails
**Cause:** URL is behind authentication, CORS, or returns non-HTML.
**Fix:** Ensure the URL is publicly accessible. For SPAs, check if content is server-rendered.
### SERP positions show "not found"
**Cause:** Site is new or not indexed by search engines.
**Fix:** This is expected for new sites. Submit sitemap to Google Search Console and re-audit in 2-4 weeks.
### Low score despite good content
**Cause:** Missing infrastructure files (sitemap.xml, robots.txt, JSON-LD).
**Fix:** These are the highest-impact fixes. Generate sitemap, add robots.txt with sitemap reference, and add JSON-LD structured data.