← 返回
未分类

Seo Audit

Audit and optimize any website's SEO + GEO (AI/LLM visibility), then fix what's broken. Runs a portable, zero-dependency hard-gate audit over a build output...
Audit and optimize any website's SEO + GEO (AI/LLM visibility) + Core Web Vitals, then fix what's broken. Runs a portable, zero-dependency hard-gate audit ov...
cosmofang cosmofang 来源
未分类 clawhub v1.1.0 2 版本 96551.7 Key: 无需
★ 1
Stars
📥 8
下载
💾 0
安装
2
版本
#latest

概述

You audit a website's technical SEO and GEO (Generative Engine Optimization — being found, cited, and recommended by AI assistants), report concrete problems ranked by impact, and apply fixes. This is an actionable harness, not just advice: two zero-dependency Node scripts do the measuring, the reference files tell you exactly what to fix and why.

The rules here are distilled from a production site whose build fails if any gate is violated — that discipline is why it scores high. Treat the gates as hard constraints, not suggestions.

When to use

  • "Check/improve my site's SEO", "raise my PageSpeed/Lighthouse SEO score", "review before launch"
  • "Make my site visible to AI / ChatGPT / Claude / Perplexity", "add llms.txt", "fix robots for AI crawlers"
  • "Add structured data / JSON-LD / schema", "set up sitemap / canonical / Open Graph"
  • "My LCP is slow / fix Core Web Vitals / PageSpeed says my site takes 7 s to load"

What you have

  • scripts/audit-seo.mjson-disk auditor. Runs the 12 hard-gate checks over a directory of built HTML + its local CSS/JS/images. Framework-agnostic. Node ≥18, no install.
  • scripts/audit-live.mjslive-URL auditor. Checks the things only visible on a deployed origin: robots.txt policy (incl. per-AI-bot allow/deny), sitemap.xml, llms.txt, homepage JSON-LD (@graph-aware), canonical, HSTS / Vary / Cache-Control.
  • references/hard-gates.md — the 12 gates: exact thresholds, the general rule, and the Astro+Cloudflare reference implementation.
  • references/structured-data.md — copy-paste JSON-LD recipes (Organization, WebSite, Breadcrumb, Article, Product, FAQ) using the nested @graph pattern.
  • references/geo-ai-visibility.md — the GEO layer: robots AI-crawler allowlist (exact user-agents), llms.txt format, AI-oriented schema, IndexNow.
  • references/lcp-playbook.mdCore Web Vitals deep-dive: the measured levers that took the reference site from 7.5 s → ~1.5 s mobile LCP (render-blocking CSS, critical-CSS split, font discipline, deferring non-LCP DOM, third-party JS, CLS guardrails, CI lock-in). Use when the problem is speed, not markup.

Workflow

1. Locate the build output (don't audit source — audit the shipped HTML)

SEO lives in the rendered HTML. Find the build dir: Astro dist/, Next out/ (or .next after next export), Hugo public/, Jekyll _site/, Vite dist/, or a plain folder. If it doesn't exist yet, run the project's build first. Confirm with the user if ambiguous.

2. Run the on-disk audit

node scripts/audit-seo.mjs --dir <build-dir>
# options: --strict (warns→errors, CI mode) · --json · --max-page-kb 500 · --max-img-kb 500

Read the output: = ERROR (genuinely hurts ranking / breaks crawlers / Core Web Vitals — fix these first), = WARN (best-practice miss). The heuristic score is a rough dial, not a Lighthouse number.

3. Run the live audit (if deployed)

node scripts/audit-live.mjs https://www.example.com

This is where GEO shows up: which AI crawlers are allowed/blocked, whether llms.txt exists, what JSON-LD @types the homepage actually ships.

4. Report and fix

  • Group findings by severity; fix ERRORs first, then high-value WARNs.
  • For each fix, open references/ for the exact target value and the reference implementation, then edit the source (templates/layout/config) — not the built HTML (it's regenerated).
  • Re-run the audit to confirm green. For CI, wire audit-seo.mjs --strict into the build so regressions fail the pipeline.

The 12 hard gates (cheat-sheet — full detail in references/hard-gates.md)

  1. Exactly one

    per page.

  2. Viewport meta width=device-width, initial-scale=1.
  3. Semantic landmarks
    +
  4. </code></strong> present (≈10–60 chars) + <strong>meta description</strong> present (≈50–160 chars). <em>Length is a soft warn — longer is a valid deliberate GEO choice.</em></li><li><strong>Canonical</strong> — absolute-URL <code><link rel="canonical"></code>, host matches the deploy origin (build-time, never runtime).</li><li><strong>Open Graph</strong> — <code>og:title</code> + <code>og:image</code>.</li><li><strong>Images</strong> — every <code><img></code> has <code>width</code>+<code>height</code>+<code>alt</code>; non-hero <code>loading="lazy"</code>; hero <code>fetchpriority="high"</code>; each file ≤500 KB (WebP/AVIF).</li><li><strong>No inline executable <code><script></code></strong> (allow only <code>application/ld+json</code>/<code>json</code>/<code>importmap</code>) and <strong>no <code>on*=</code> handlers</strong> → strict CSP <code>script-src 'self'</code>.</li><li><strong>No external resource refs</strong> (fonts/img/css/js) — self-host for CSP + speed.</li><li><strong>Page weight</strong> — HTML + same-page CSS + JS ≤500 KB (images budgeted separately).</li><li><strong>Structured data</strong> — JSON-LD present; site-wide Organization + WebSite.</li><li><strong>URL hygiene</strong> — lowercase, trailing slash, ≤3 path depth, one route source of truth.</li></ol><p>GEO layer (references/geo-ai-visibility.md): robots.txt explicitly <strong>allows</strong> the major AI crawlers, ship <strong><code>llms.txt</code></strong>, enrich Organization schema with <code>knowsAbout</code>, ping <strong>IndexNow</strong> on deploy.</p><p><strong>If the complaint is LCP / PageSpeed performance</strong> (gates pass but the site is slow): open <code>references/lcp-playbook.md</code>. Diagnose first — find the <em>actual</em> LCP element (often text, not an image) and measure with DevTools applied throttling, <strong>not</strong> Lantern/simulated. Then work the levers in impact order: render-blocking CSS → critical-CSS split → font preload discipline → defer non-LCP viewport DOM → eager hero image → third-party JS on idle/interaction → IntersectionObserver-deferred init. Keep CLS at 0 by reserving space for everything you defer, and lock wins in with a Lighthouse CI gate + per-page JS byte budget.</p><h2>Notes</h2><ul><li>404/50x pages are exempt from canonical/description/OG/JSON-LD (they're noindex by design) — the auditor already skips them.</li><li>The auditor uses conservative regex extraction, not a full DOM — it's for audit <em>signals</em>. A clean run is strong evidence, not a formal guarantee.</li><li>Don't relax a threshold to make the audit pass. Fix the page.</li></ul><hr><h2>Purpose & Capability</h2><p>seo-audit is an <strong>actionable SEO + GEO auditing harness</strong>. Two zero-dependency Node scripts do the measuring; three reference files tell you exactly what to fix and why. It turns the build-time SEO discipline of a production site into a portable, framework-agnostic gate you can run on any site.</p><table><thead><tr><th>Capability</th><th>Description</th></tr></thead><tbody><tr><td>------------</td><td>-------------</td></tr><tr><td>On-disk hard-gate audit</td><td><code>audit-seo.mjs</code> runs 12 hard gates (h1, viewport, landmarks, title/desc, canonical, OG, images, CSP-safe scripts, no external refs, page weight, JSON-LD, URL hygiene) over any built static dir</td></tr><tr><td>Live-URL GEO audit</td><td><code>audit-live.mjs</code> checks robots.txt AI-crawler policy, sitemap.xml, llms.txt, homepage JSON-LD (<code>@graph</code>-aware), canonical, HSTS/Vary/Cache-Control</td></tr><tr><td>Fix references</td><td><code>references/</code> gives exact thresholds, copy-paste JSON-LD recipes, and the AI-crawler allowlist + llms.txt format</td></tr><tr><td>LCP playbook</td><td><code>references/lcp-playbook.md</code> — measured Core Web Vitals levers (7.5 s → 1.5 s mobile LCP on the reference site) with diagnosis method, impact ranking, CLS guardrails, and CI lock-in</td></tr><tr><td>CI integration</td><td><code>audit-seo.mjs --strict</code> turns warnings into errors so regressions fail the build</td></tr></tbody></table><p><strong>Does NOT:</strong></p><ul><li>Audit source files — it audits <em>rendered/built</em> HTML (run your build first)</li><li>Modify your site — it reports; you (or the agent) apply fixes to source templates</li><li>Replace Lighthouse — its score is a heuristic dial for audit signals, not an official number</li><li>Send your URL or content anywhere except the live origin you explicitly pass to <code>audit-live.mjs</code></li></ul><h2>Instruction Scope</h2><p><strong>In scope (will handle):</strong></p><ul><li>"Check / improve my site's SEO", "raise my Lighthouse/PageSpeed SEO score", "review before launch"</li><li>"Make my site visible to AI / ChatGPT / Claude / Perplexity", "add llms.txt", "fix robots for AI crawlers"</li><li>"Add structured data / JSON-LD / schema", "set up sitemap / canonical / Open Graph"</li><li>Running either auditor and reporting findings ranked by severity, then applying fixes via <code>references/</code></li></ul><p><strong>Out of scope (won't handle):</strong></p><ul><li>Off-page SEO, backlinks, keyword-ranking tracking, or paid-search work</li><li>Content writing / copywriting beyond meta title & description guidance</li><li>Auditing a directory that hasn't been built yet (build first, then point the auditor at the output)</li></ul><p><strong>Behavior on missing input:</strong></p><ul><li><code>audit-seo.mjs</code> with no <code>--dir</code> defaults to <code>dist</code>; if the directory has no HTML it reports zero pages (no crash)</li><li><code>audit-live.mjs</code> with no URL prints usage and exits with code 2</li></ul><h2>Credentials</h2><p><strong>No credentials required.</strong> This skill uses no API keys, tokens, or accounts.</p><table><thead><tr><th>Action</th><th>Credential</th><th>Network</th></tr></thead><tbody><tr><td>--------</td><td>-----------</td><td>---------</td></tr><tr><td><code>audit-seo.mjs --dir <dir></code></td><td>None</td><td>None — local filesystem read only</td></tr><tr><td><code>audit-live.mjs <url></code></td><td>None</td><td>Outbound HTTPS to the URL you pass (and its robots.txt/sitemap/llms.txt)</td></tr></tbody></table><p>No hardcoded secrets exist anywhere in the scripts.</p><h2>Persistence & Privilege</h2><p><strong>Writes:</strong> nothing by default. Both scripts print reports to stdout; <code>--json</code> still prints to stdout. Output is persisted only where you redirect it (e.g. <code>> report.json</code>).</p><p><strong>Does NOT write:</strong></p><ul><li>No files inside your project, the skill directory, or your home directory</li><li>No shell-config or credential files</li><li>No cron jobs or background processes</li></ul><p><strong>Privilege:</strong> runs as the current user, no sudo or elevated permission. Requires only Node ≥18 (global <code>fetch</code>).</p><p><strong>Uninstall:</strong> delete the skill directory — there is no other state to clean up.</p><h2>Install Mechanism</h2><h3>Standard install (clawHub)</h3><pre><code>clawhub install seo-audit </code></pre><h3>Manual install</h3><pre><code>cp -r /path/to/seo-audit ~/.claude/skills/seo-audit/ </code></pre><h3>Verify install</h3><pre><code>node scripts/audit-seo.mjs --help 2>/dev/null || node scripts/audit-seo.mjs --dir . --json | head node scripts/audit-live.mjs # should print usage and exit 2 </code></pre><p>Both scripts are zero-dependency (Node ≥18). No <code>npm install</code> step is needed.</p><hr><p><em>Version: 1.1.0 · Created: 2026-06-09 · Updated: 2026-06-10 · Changes: see <a href="CHANGELOG.md" target="_blank" rel="noopener">CHANGELOG.md</a></em></p></div> </div> </div> <div id="tab-versions" class="detail-content"> <div class="detail-section"> <h2>版本历史</h2> <p style="margin-bottom:12px;font-size:14px;color:#94a3b8;">共 2 个版本</p> <ul class="version-list"> <li> <div> <span class="version-tag">v1.1.0</span> <span style="font-size:11px;color:#5b6abf;margin-left:8px;background:#eef0ff;padding:1px 8px;border-radius:10px;">当前</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-06-11 18:52 </div> </li> <li> <div> <span class="version-tag">v1.0.0</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-06-09 19:56 </div> </li> </ul> </div> </div> <div id="tab-security" class="detail-content"> <div class="detail-section"> <h2>安全检测</h2> <div class="sec-grid"> <div class="sec-card"> <h4>腾讯云安全 (Keen)</h4> <div class="sec-status sec-queued"> 队列中 </div> </div> <div class="sec-card"> <h4>腾讯云安全 (Sanbu)</h4> <div class="sec-status sec-queued"> 队列中 </div> </div> </div> </div> </div> <!-- Recommended Skills --> <div style="margin-top:24px;"> <h2 style="font-size:18px;font-weight:600;margin-bottom:16px;">🔗 相关推荐</h2> <div class="rec-grid"> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;"></span> <h3><a href="/s/daily-brain">Daily Brain</a></h3> <div class="rec-owner">cosmofang</div> <div class="rec-desc">每日脑力训练:逻辑推理、数学速算、记忆挑战、文字谜题,游戏化精美卡片呈现,难度自适应分级,连续打卡追踪。每天一道精选题目锻炼大脑,保持思维敏捷。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 0</span> <span style="color:#5b6abf;">📥 421</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;"></span> <h3><a href="/s/feishu-cli-setup">Feishu Cli Setup</a></h3> <div class="rec-owner">cosmofang</div> <div class="rec-desc">分步AI代理指南,用于安装和配置lark-cli(飞书/Lark CLI)。为Claude、Manus和OpenClaw设计,主动引导用户...</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 0</span> <span style="color:#5b6abf;">📥 397</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;"></span> <h3><a href="/s/automatic-skill">Automatic Skill</a></h3> <div class="rec-owner">cosmofang</div> <div class="rec-desc">每日技能自动工厂——让OpenClaw和Claude完全自主地完成调研、设计、生成、测试并发布全新技能,全程无需人工介入。内置十阶段流水线(Research → Design → SEO → Create → Review → Self‑R</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 0</span> <span style="color:#5b6abf;">📥 440</span> </div> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded',function(){ document.querySelectorAll('.detail-tab').forEach(function(btn){ btn.addEventListener('click',function(e){ var tab = this.getAttribute('data-tab'); document.querySelectorAll('.detail-tab').forEach(function(b){b.classList.remove('active')}); document.querySelectorAll('.detail-content').forEach(function(c){c.classList.remove('active')}); this.classList.add('active'); var el = document.getElementById('tab-'+tab); if(el) el.classList.add('active'); }); }); }); </script> <div class="footer"> <p>Skill工具集 © 2026</p> </div></body> </html>