seo-skills/seo-audit-skill

GitHub: seo-skills/seo-audit-skill

跨 20 个类别、251 条规则的 SEO 审计工具,提供 CLI 和 Electron 桌面应用,支持 CI/CD 集成与多页面并发爬取。

Stars: 330 | Forks: 40

# SEOmator 审计 一款全面的 SEO 审计工具,包含跨 **20 个类别** 的 **251 条审计规则**。同时提供 **命令行工具** 和 **Electron 桌面应用程序**。分析任意网站的 SEO 最佳实践、Core Web Vitals、安全标头、结构化数据、无障碍访问、JavaScript 渲染、重定向链等。 ## 功能 - **251 条 SEO 审计规则**,涵盖 20 个类别 - **桌面应用程序** - 可视化审计仪表盘,包含实时进度、交互式结果、分数历史以及浅色/深色主题 - **CLI 工具** - 支持单页面和爬取模式,提供 5 种输出格式 - **Core Web Vitals** - 通过 Playwright 测量 LCP、CLS、FCP、TTFB、INP - **JavaScript 渲染分析** - 针对 SPA/CSR 站点对比原始 DOM 与渲染后的 DOM - **5 种输出格式** - Console、JSON、HTML、Markdown 以及针对 LLM 优化的 XML - **AI/GEO 就绪** - 检查语义化 HTML、AI 机器人访问权限以及 llms.txt - **重定向链检测** - 检测循环、断裂的重定向、Meta/JS 重定向 - **HTML 验证** - Doctype、charset、head 结构、lorem ipsum 检测 - **跨页面分析** - 重复内容检测、孤立页面、分页 - **并发爬取** - 具备可配置并发性的快速多页面审计 - **SQLite 存储** - 支持压缩和审计历史的持久化爬取数据 - **CI/CD 就绪** - 提供退出码、JSON 输出、GitHub Actions 和 GitLab CI 示例 - **TOML 配置** - 支持预设和继承的项目级设置 ## 安装 ### 通过 npm 安装(推荐) ``` # 全局安装 npm install -g @seomator/seo-audit # 运行 audit seomator audit https://example.com ``` ### 从源码安装 ``` git clone https://github.com/seo-skills/seo-audit-skill.git cd seo-audit-skill npm install npm run build # 直接运行 ./dist/cli.js audit https://example.com # 或全局 link npm link seomator audit https://example.com ``` ## 桌面应用程序 桌面应用程序提供了一个可视化审计仪表盘,支持实时进度流、交互式结果、分数历史以及浅色/深色主题。 ### 运行 ``` # 从源码 git clone https://github.com/seo-skills/seo-audit-skill.git cd seo-audit-skill npm install npx electron-rebuild -f -w better-sqlite3 # Compile native module for Electron npm run electron:dev # Launch with hot reload ``` ### 构建 ``` npm run electron:build # Production build npm run electron:pack # Build + package distributable ``` ### 桌面应用功能 - **实时进度** - 审计运行时按类别显示实时进度 - **分数仪表盘** - 整体得分环、类别网格和问题汇总表 - **交互式结果** - 可展开的规则卡片,包含规则描述、受影响项目、页面 URL 徽章和内联修复建议 - **筛选与导航** - 按状态筛选(全部/失败/警告/通过),点击问题跳转至详情 - **分数历史** - 按域名追踪随时间变化的审计分数及趋势图 - **浅色/深色主题** - 跟随您的系统偏好或手动切换 ## 快速开始 (CLI) ``` # 基础 audit seomator audit https://example.com # 跳过 Core Web Vitals(更快) seomator audit https://example.com --no-cwv # audit 特定类别 seomator audit https://example.com -c core,security,perf # JSON 输出(用于 CI/CD 或解析) seomator audit https://example.com --format json # HTML 报告 seomator audit https://example.com --format html -o report.html # LLM 优化输出(pipe 到 Claude) seomator audit https://example.com --format llm --no-cwv | claude "analyze and prioritize fixes" # 爬取多个页面 seomator audit https://example.com --crawl --max-pages 20 # 完整选项 seomator audit https://example.com --crawl -m 50 --concurrency 5 --timeout 60000 --format json -o results.json ``` ## 命令 ### `seomator audit ` 对指定 URL 执行 SEO 审计。 | 选项 | 别名 | 描述 | 默认值 | |--------|-------|-------------|---------| | `--format ` | `-f` | 输出格式:console, json, html, markdown, llm | console | | `--output ` | `-o` | 输出文件路径 | - | | `--categories ` | `-c` | 以逗号分隔的待审计类别 | 所有 | | `--json` | `-j` | 以 JSON 格式输出(已废弃,请使用 --format json) | false | | `--crawl` | - | 启用多页面爬取模式 | false | | `--max-pages ` | `-m` | 最大爬取页面数 | 10 | | `--concurrency ` | - | 并发请求数 | 3 | | `--timeout ` | - | 请求超时时间(毫秒) | 30000 | | `--no-cwv` | - | 跳过 Core Web Vitals 测量 | false | | `--verbose` | `-v` | 显示进度 | false | | `--refresh` | `-r` | 忽略缓存,重新获取 | false | | `--resume` | - | 恢复中断的爬取 | false | | `--config ` | - | 配置文件路径 | - | | `--save` | - | 将报告保存至 .seomator/reports/ | false | ### `seomator init` 创建 `seomator.toml` 配置文件。 ``` seomator init # Interactive setup seomator init -y # Use defaults seomator init --preset blog # Blog preset seomator init --preset ecommerce # E-commerce preset seomator init --preset ci # Minimal CI config ``` ### `seomator crawl ` 在不运行分析的情况下爬取网站。保存数据以便后续通过 `seomator analyze` 进行分析。 ``` seomator crawl https://example.com -m 20 seomator crawl https://example.com --refresh seomator crawl https://example.com --resume ``` ### `seomator analyze [crawl-id]` 对已存储的爬取数据执行规则分析。 ``` seomator analyze # Analyze latest crawl seomator analyze --latest --save # Analyze and save seomator analyze 2026-01-23-abc123 # Specific crawl ``` ### `seomator report [query]` 查看并查询历史报告。 ``` seomator report --list # List all reports seomator report --project mysite # Filter by project ``` ### `seomator config [key] [value]` 查看或修改配置。 ``` seomator config --list # Show all config seomator config crawler.max_pages 50 # Set value seomator config validate # Validate config ``` ### `seomator db` 数据库管理。 ``` seomator db migrate # Migrate JSON to SQLite seomator db migrate --dry-run # Preview migration seomator db stats -v # Database statistics seomator db restore # Rollback migration ``` ### `seomator self doctor` 检查系统设置和依赖项。 ``` seomator self doctor -v # Verbose diagnostics ``` ## 退出码 | 代码 | 含义 | |------|---------| | 0 | 审计通过(分数 >= 70) | | 1 | 审计失败(分数 < 70) | | 2 | 发生错误 | ## 类别与规则(共 251 条) ### 核心(19 条规则) - 权重 12% | 规则 | 描述 | |------|-------------| | `core-title-present` | 存在 `` 标签 | | `core-title-length` | Title 长度应为 30-60 个字符 | | `core-description-present` | 存在 Meta description | | `core-description-length` | Description 长度应为 120-160 个字符 | | `core-canonical-present` | 存在 Canonical URL | | `core-canonical-valid` | Canonical URL 是有效的绝对 URL | | `core-viewport-present` | 存在 Viewport meta 标签 | | `core-favicon-present` | 存在 Favicon 链接 | | `core-h1-present` | 至少存在一个 H1 | | `core-h1-single` | 只存在一个 H1 | | `core-canonical-header` | HTML Canonical 与 Link 标头匹配 | | `core-nosnippet` | 检测 nosnippet/max-snippet:0 指令 | | `core-robots-meta` | 检查 noindex/nofollow 指令 | | `core-title-unique` | Title 应在全站唯一 | | `core-canonical-conflicting` | HTML 和标头 Canonical 不应冲突 | | `core-canonical-to-homepage` | Canonical 不应始终指向首页 | | `core-canonical-http-mismatch` | Canonical 协议应与页面协议匹配 | | `core-canonical-loop` | 检测循环 Canonical 链 | | `core-canonical-to-noindex` | Canonical 不应指向 noindex 页面 | ### 性能(22 条规则) - 权重 12% | 规则 | 描述 | |------|-------------| | `cwv-lcp` | Largest Contentful Paint(<2.5s 通过,>4s 失败) | | `cwv-cls` | Cumulative Layout Shift(<0.1 通过,>0.25 失败) | | `cwv-inp` | Interaction to Next Paint(<200ms 通过,>500ms 失败) | | `cwv-ttfb` | Time to First Byte(<800ms 通过,>1800ms 失败) | | `cwv-fcp` | First Contentful Paint(<1.8s 通过,>3s 失败) | | `perf-dom-size` | DOM 节点数应 <1500 | | `perf-css-file-size` | CSS 文件大小应合理 | | `perf-font-loading` | 应使用 Font-display: swap | | `perf-preconnect` | 为第三方源提供 Preconnect 提示 | | `perf-render-blocking` | 脚本应使用 async/defer | | `perf-lazy-above-fold` | 首屏图片不应使用懒加载 | | `perf-lcp-hints` | 应预加载 LCP 元素 | | `perf-text-compression` | 响应应使用 gzip/Brotli 压缩 | | `perf-brotli` | 优先使用 Brotli 而非 gzip 以获得更好的压缩率 | | `perf-cache-policy` | 静态资源应具有缓存标头 | | `perf-minify-css` | CSS 应被压缩 | | `perf-minify-js` | JavaScript 应被压缩 | | `perf-response-time` | 服务器响应时间应 <200ms | | `perf-http2` | 站点应通过 HTTP/2 提供服务 | | `perf-page-weight` | 页面总大小应 <3MB | | `perf-js-file-size` | 单个 JS 文件应 <500KB | | `perf-video-for-animations` | 使用 `<video>` 代替动态 GIF | ### 链接(19 条规则) - 权重 8% | 规则 | 描述 | |------|-------------| | `links-broken-internal` | 内部链接应返回 200 | | `links-external-valid` | 外部链接应可访问 | | `links-internal-present` | 页面应具有内部链接 | | `links-nofollow-appropriate` | 合理使用 nofollow | | `links-anchor-text` | 锚文本应具描述性 | | `links-depth` | 页面深度距首页应 ≤3 | | `links-dead-end-pages` | 页面应具有外向内部链接 | | `links-https-downgrade` | HTTPS 页面不应链接至 HTTP | | `links-external-count` | 外部链接超过 100 个时发出警告 | | `links-invalid-links` | 无空的、javascript: 或格式错误的 href | | `links-tel-mailto` | 有效的 tel: 和 mailto: 链接格式 | | `links-redirect-chains` | 链接不应经历重定向 | | `links-orphan-pages` | 页面应具有入站链接 | | `links-localhost` | 生产环境中无 localhost/127.0.0.1 URL | | `links-local-file` | 无 file:// 协议链接 | | `links-broken-fragment` | Fragment 链接应匹配元素 ID | | `links-excessive` | 限制每个页面的内部链接数 | | `links-onclick` | 不应使用基于 onclick 的导航代替 `<a>` 标签 | | `links-whitespace-href` | href 属性中无空格 | ### 图片(14 条规则) - 权重 8% | 规则 | 描述 | |------|-------------| | `images-alt-present` | 所有图片应具有 alt 属性 | | `images-alt-quality` | Alt 文本应具描述性 | | `images-dimensions` | 图片应具有 width/height | | `images-lazy-loading` | 非首屏图片应使用懒加载 | | `images-modern-format` | 使用 WebP/AVIF 格式 | | `images-size` | 图片大小应 <200KB | | `images-responsive` | 使用 srcset 提供响应式图片 | | `images-broken` | 图片不应返回 404 | | `images-figure-captions` | Figure 元素应具有 figcaption | | `images-filename-quality` | 使用具描述性的文件名 | | `images-inline-svg-size` | 内联 SVG 应 <5KB | | `images-picture-element` | Picture 元素必须具有 img 回退 | | `images-alt-length` | Alt 文本应在 125 个字符以内 | | `images-background-seo` | 内容图片应使用 `<img>`,而非 CSS 背景 | ### 安全(16 条规则) - 权重 8% | 规则 | 描述 | |------|-------------| | `security-https` | 站点应使用 HTTPS | | `security-https-redirect` | HTTP 应重定向至 HTTPS | | `security-hsts` | Strict-Transport-Security 标头 | | `security-csp` | Content-Security-Policy 标头 | | `security-x-frame` | X-Frame-Options 标头 | | `security-x-content-type` | X-Content-Type-Options: nosniff | | `security-external-links` | 外部 target="_blank" 链接包含 noopener/noreferrer | | `security-form-https` | 表单 action 使用 HTTPS | | `security-mixed-content` | HTTPS 页面上无 HTTP 资源 | | `security-permissions-policy` | 存在 Permissions-Policy 标头 | | `security-referrer-policy` | 存在 Referrer-Policy 标头 | | `security-leaked-secrets` | 无暴露的 API 密钥或凭据 | | `security-password-http` | 录表单仅通过 HTTPS 提供 | | `security-protocol-relative` | 无协议相对 URL (//example.com) | | `security-ssl-expiry` | SSL 证书未临近过期 | | `security-ssl-protocol` | 要求 TLS 1.2+;禁用 TLS 1.0/1.1 | ### 技术 SEO(13 条规则) - 权重 7% | 规则 | 描述 | |------|-------------| | `technical-robots-txt-exists` | robots.txt 应返回 200 | | `technical-robots-txt-valid` | robots.txt 应具有有效语法 | | `technical-sitemap-exists` | 应存在 sitemap.xml | | `technical-sitemap-valid` | Sitemap 应具有有效的 XML 结构 | | `technical-url-structure` | URL 应使用连字符、小写 | | `technical-trailing-slash` | 一致地使用尾部斜杠 | | `technical-www-redirect` | www/非 www 应重定向至单一版本 | | `technical-404-page` | 应存在自定义 404 页面 | | `technical-soft-404` | Soft 404 页面应返回正确的 404 状态 | | `technical-server-error` | 无 5xx 服务器错误 | | `technical-4xx-non-404` | 无 400、403、410 客户端错误 | | `technical-timeout` | 页面应在超时时间内响应 | | `technical-bad-content-type` | Content-Type 标头与实际内容匹配 | ### 可爬取性(18 条规则) - 权重 5% | 规则 | 描述 | |------|-------------| | `crawl-schema-noindex-conflict` | Schema.org 和 noindex 不应冲突 | | `crawl-pagination-canonical` | 分页页面应自引用 Canonical | | `crawl-sitemap-domain` | Sitemap URL 应匹配主域名 | | `crawl-noindex-in-sitemap` | noindex 页面不应在 Sitemap 中 | | `crawl-indexability-conflict` | robots.txt 和 noindex 不应同时阻止 | | `crawl-canonical-redirect` | Canonical 不应通过重定向指向 | | `crawl-sitemap-url-limit` | Sitemap 应包含 <50,000 个 URL | | `crawl-sitemap-size-limit` | Sitemap 应 <50MB | | `crawl-sitemap-duplicate-urls` | Sitemap 中无重复 URL | | `crawl-sitemap-orphan-urls` | Sitemap URL 应具有内部链接 | | `crawl-blocked-resources` | 关键资源未被 robots.txt 阻止 | | `crawl-crawl-delay` | 过大的 Crawl-delay 会减慢索引速度 | | `crawl-sitemap-in-robotstxt` | robots.txt 应引用 Sitemap | | `crawl-pagination-broken` | 分页链接不应失效 | | `crawl-pagination-loop` | 无循环分页链 | | `crawl-pagination-sequence` | 分页序列中无断层 | | `crawl-pagination-noindex` | 分页页面不应被 noindex | | `crawl-pagination-orphaned` | 分页页面应从内容处链接 | ### 结构化数据(13 条规则) - 权重 5% | 规则 | 描述 | |------|-------------| | `schema-present` | 应存在 JSON-LD 或微数据 | | `schema-valid` | JSON-LD 应为有效的 JSON | | `schema-type` | 应存在 @type 字段 | | `schema-required-fields` | Schema 类型必需的字段 | | `schema-article` | 验证 Article Schema 属性 | | `schema-breadcrumb` | 检查非首页上的 BreadcrumbList | | `schema-faq` | 验证 FAQPage Schema 结构 | | `schema-local-business` | 针对本地 SEO 验证 LocalBusiness | | `schema-organization` | 验证 Organization Schema | | `schema-product` | 针对电子商务验证 Product Schema | | `schema-review` | 验证 Review/AggregateRating Schema | | `schema-video` | 验证 VideoObject Schema | | `schema-website-search` | 检查 WebSite 站点链接搜索框 | ### JavaScript 渲染(13 条规则) - 权重 5% | 规则 | 描述 | |------|-------------| | `js-rendered-title` | 渲染后的 DOM 中存在 Title | | `js-rendered-description` | 渲染后的 DOM 中存在 Meta description | | `js-rendered-h1` | 渲染后的 DOM 中存在 H1 | | `js-rendered-canonical` | 渲染后的 DOM 中存在 Canonical | | `js-canonical-mismatch` | 原始和渲染后的 HTML 间 Canonical 匹配 | | `js-noindex-mismatch` | 原始和渲染后的 HTML 间 noindex 一致 | | `js-title-modified` | Title 未被 JavaScript 更改 | | `js-description-modified` | Description 未被 JavaScript 更改 | | `js-h1-modified` | H1 未被 JavaScript 更改 | | `js-rendered-content` | 无需依赖 JavaScript 即存在主要内容 | | `js-rendered-links` | 无需 JavaScript 即存在导航链接 | | `js-blocked-resources` | 关键 JS 未被 robots.txt 阻止 | | `js-ssr-check` | 检测到服务端渲染 | ### 无障碍访问(12 条规则) - 权重 4% | 规则 | 描述 | |------|-------------| | `a11y-aria-labels` | 交互元素具有可访问名称 | | `a11y-color-contrast` | 检测颜色对比度问题 | | `a11y-focus-visible` | 存在焦点指示样式 | | `a11y-form-labels` | 表单输入项具有关联的标签 | | `a11y-heading-order` | 标题层级不跳跃 | | `a11y-landmark-regions` | 正确的地标区域(main, nav, footer) | | `a11y-link-text` | 具描述性的链接文本(无“点击此处”) | | `a11y-skip-link` | 用于键盘导航的“跳至内容”链接 | | `a11y-table-headers` | 数据表格具有正确的表头 | | `a11y-touch-targets` | 至少 44x44px 的触摸目标尺寸 | | `a11y-video-captions` | 视频具有字幕或文字稿 | | `a11y-zoom-disabled` | Viewport 未禁用用户缩放 | ### 内容(17 条规则) - 权重 5% | 规则 | 描述 | |------|-------------| | `content-word-count` | 页面应包含 300+ 词 | | `content-reading-level` | Flesch-Kincaid 阅读水平检查 | | `content-keyword-stuffing` | 检测过度的关键词重复 | | `content-article-links` | 检查链接与内容的比例 | | `content-broken-html` | 检测畸形的 HTML 结构 | | `content-meta-in-body` | Meta 标签应在 head 中 | | `content-mime-type` | 验证 Content-Type 标头 | | `content-duplicate-description` | Description 应在全站唯一 | | `content-heading-hierarchy` | 正确的标题层级 (H1>H2>H3) | | `content-heading-length` | 标题应为 10-70 个字符 | | `content-heading-unique` | 标题应唯一 | | `content-text-html-ratio` | 文本与 HTML 的比率应 >10% | | `content-title-same-as-h1` | Title 和 H1 应不同 | | `content-title-pixel-width` | 用于 SERP 显示的 Title 像素宽度(<580px) | | `content-description-pixel-width` | 用于 SERP 显示的 Description 像素宽度(<920px) | | `content-duplicate-exact` | 检测跨页面的完全重复内容 | | `content-duplicate-near` | 通过 simhash 检测近似重复内容 | ### 社交(9 条规则) - 权重 3% | 规则 | 描述 | |------|-------------| | `social-og-title` | og:title meta 标签 | | `social-og-description` | og:description meta 标签 | | `social-og-image` | 具有有效 URL 的 og:image | | `social-og-image-size` | og:image 尺寸 (1200x630) | | `social-twitter-card` | twitter:card meta 标签 | | `social-og-url` | og:url meta 标签 | | `social-og-url-canonical` | og:url 匹配 Canonical | | `social-share-buttons` | 存在社交分享按钮 | | `social-social-profiles` | 存在社交资料链接 | ### E-E-A-T(14 条规则) - 权重 3% | 规则 | 描述 | |------|-------------| | `eeat-about-page` | 存在“关于”页面 | | `eeat-affiliate-disclosure` | 联盟链接具有披露声明 | | `eeat-author-byline` | 存在作者署名 | | `eeat-author-expertise` | 存在作者资历/简介 | | `eeat-citations` | 指向权威来源的链接 | | `eeat-contact-page` | 存在“联系”页面 | | `eeat-content-dates` | 存在发布/修改日期 | | `eeat-disclaimers` | YMYL 内容具有免责声明 | | `eeat-editorial-policy` | 存在编辑政策页面 | | `eeat-physical-address` | 存在商家地址 | | `eeat-privacy-policy` | 存在隐私政策链接 | | `eeat-terms-of-service` | 存在服务条款链接 | | `eeat-trust-signals` | 信任徽章、评论、认证 | | `eeat-ymyl-detection` | YMYL 内容检测 | ### URL 结构(14 条规则) - 权重 3% | 规则 | 描述 | |------|-------------| | `url-slug-keywords` | URL 别名包含关键词 | | `url-stop-words` | URL 不应包含停用词 | | `url-uppercase` | URL 应为小写 | | `url-underscores` | 使用连字符而非下划线 | | `url-double-slash` | 路径中无连续斜杠 | | `url-spaces` | URL 中无空格 | | `url-non-ascii` | URL 中无非 ASCII 字符 | | `url-length` | URL 应在 2048 个字符以内 | | `url-repetitive-path` | 无重复的路径段 | | `url-parameters` | 过多的查询参数 | | `url-session-ids` | URL 中无 Session ID | | `url-tracking-params` | 跟踪参数应使用 Canonical | | `url-internal-search` | 内部搜索 URL 应被 noindex | | `url-http-https-duplicate` | HTTP/HTTPS 版本应规范化 | ### 重定向(8 条规则) - 权重 3% | 规则 | 描述 | |------|-------------| | `redirect-meta-refresh` | 无 `<meta http-equiv="refresh">` 重定向 | | `redirect-javascript` | 无基于 JavaScript 的重定向 | | `redirect-http-refresh` | 无 HTTP Refresh 标头重定向 | | `redirect-loop` | 无循环重定向链 | | `redirect-type` | 永久迁移时优先使用 301 而非 302 | | `redirect-broken` | 重定向不应导向错误 | | `redirect-resource` | CSS/JS/图片资源上无重定向 | | `redirect-case-normalization` | 将大写 URL 重定向至小写 | ### 移动端(5 条规则) - 权重 2% | 规则 | 描述 | |------|-------------| | `mobile-font-size` | 至少 16px 的正文字体大小 | | `mobile-horizontal-scroll` | 无水平滚动 | | `mobile-interstitials` | 无侵入式插页广告 | | `mobile-viewport-width` | 无固定 Viewport 宽度 | | `mobile-multiple-viewports` | 单个 Viewport meta 标签 | ### 国际化(10 条规则) - 权重 2% | 规则 | 描述 | |------|-------------| | `i18n-lang-attribute` | 存在 HTML lang 属性 | | `i18n-hreflang` | 用于多语言站点的 Hreflang 标签 | | `i18n-hreflang-return-links` | Hreflang 目标链接回源页面 | | `i18n-hreflang-to-noindex` | Hreflang 不应指向 noindex 页面 | | `i18n-hreflang-to-non-canonical` | Hreflang 应指向 Canonical URL | | `i18n-hreflang-to-broken` | Hreflang 不应指向失效的 URL | | `i18n-hreflang-to-redirect` | Hreflang应通过重定向指向 | | `i18n-hreflang-conflicting` | 同一语言无重复的 Hreflang | | `i18n-hreflang-lang-mismatch` | 页面语言匹配 Hreflang 代码 | | `i18n-hreflang-multiple-methods` | 使用单一 Hreflang 方法 | ### HTML 验证(9 条规则) - 权重 2% | 规则 | 描述 | |------|-------------| | `htmlval-missing-doctype` | 必须存在 `<!DOCTYPE html>` | | `htmlval-missing-charset` | `<meta charset>` 必须在 head 中 | | `htmlval-invalid-head` | `<head>` 中仅能包含元数据元素 | | `htmlval-noscript-in-head` | `<noscript>` 应在 body 中 | | `htmlval-multiple-heads` | 仅能有一个 `<head>` 元素 | | `htmlval-size-limit` | HTML 应在 5MB 以内 | | `htmlval-lorem-ipsum` | 无占位符 lorem ipsum 文本 | | `htmlval-multiple-titles` | 仅能有一个 `<title>` 标签 | | `htmlval-multiple-descriptions` | 仅能有一个 Meta description | ### AI/GEO 就绪(5 条规则) - 权重 2% | 规则 | 描述 | |------|-------------| | `geo-semantic-html` | 使用语义化 HTML 元素 | | `geo-content-structure` | 正确的标题层级和列表 | | `geo-ai-bot-access` | 未阻止 AI 爬虫 (GPTBot, ClaudeBot) | | `geo-llms-txt` | 用于 AI 发现的 /llms.txt 文件 | | `geo-schema-drift` | JSON-LD 匹配可见内容 | ### 法律合规(1 条规则) - 权重 1% | 规则 | 描述 | |------|-------------| | `legal-cookie-consent` | 存在 Cookie 同意横幅 | ## 配置 使用 `seomator init` 创建 `seomator.toml` 配置文件: ``` [project] name = "my-website" domains = ["example.com", "www.example.com"] [crawler] max_pages = 100 concurrency = 3 timeout_ms = 30000 respect_robots = true delay_ms = 100 include = [] exclude = ["/admin/**", "/api/**"] drop_query_prefixes = ["utm_", "gclid", "fbclid"] [rules] enable = ["*"] disable = ["perf-inp"] # Supports wildcards: "core-*" [output] format = "console" # console, json, html, markdown, llm ``` 配置优先级(从高到低): 1. CLI 参数 2. 本地 `./seomator.toml` 3. 父目录配置 4. 全局 `~/.seomator/config.toml` 5. 内置默认配置 ## 输出格式 | 格式 | 标志 | 最适用场景 | |--------|------|----------| | Console | `--format console` | 人类终端输出(默认) | | JSON | `--format json` | CI/CD、编程式处理 | | HTML | `--format html` | 独立报告、分享 | | Markdown | `--format markdown` | 文档、GitHub | | LLM | `--format llm` | AI 代理、通过管道传递给 Claude | ### 终端输出 ``` ╔══════════════════════════════════════════════════════════════╗ ║ SEOmator Audit Report ║ ╚══════════════════════════════════════════════════════════════╝ URL: https://example.com Score: 88/100 [A] ┌──────────────────────────┬───────┬────────┬──────────┬────────┐ │ Category │ Score │ Passed │ Warnings │ Failed │ ├──────────────────────────┼───────┼────────┼──────────┼────────┤ │ Core │ 97 │ 18 │ 1 │ 0 │ │ Performance │ 85 │ 18 │ 3 │ 1 │ │ JavaScript Rendering │ 100 │ 13 │ 0 │ 0 │ │ ... │ │ │ │ │ └──────────────────────────┴───────┴────────┴──────────┴────────┘ ``` ### JSON 输出 ``` { "url": "https://example.com", "overallScore": 88, "categoryResults": [ { "categoryId": "core", "score": 97, "passCount": 18, "warnCount": 1, "failCount": 0, "results": [...] } ], "timestamp": "2026-01-23T16:00:00.000Z", "crawledPages": 1 } ``` ## CI/CD 集成 ### GitHub Actions ``` name: SEO Audit on: push: branches: [main] pull_request: branches: [main] jobs: audit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Install SEOmator run: npm install -g @seomator/seo-audit - name: Install Playwright browsers run: npx playwright install chromium - name: Run SEO Audit run: seomator audit https://your-staging-url.com --format json -o seo-report.json - name: Upload Report uses: actions/upload-artifact@v4 with: name: seo-report path: seo-report.json ``` ### GitLab CI ``` seo-audit: image: node:20 script: - npm install -g @seomator/seo-audit - npx playwright install chromium - seomator audit https://your-staging-url.com --format json -o seo-report.json artifacts: paths: - seo-report.json ``` ## 编程式使用 ``` import { Auditor, createAuditor } from '@seomator/seo-audit'; const auditor = createAuditor({ categories: ['core', 'security', 'perf'], measureCwv: true, onCategoryComplete: (categoryId, name, result) => { console.log(`${name}: ${result.score}/100`); } }); const result = await auditor.audit('https://example.com'); console.log(`Overall Score: ${result.overallScore}`); ``` ## Claude Code 技能 直接在 [Claude Code](https://claude.ai/claude-code) 中将 SEOmator 用作自动化 SEO 审计的 AI 技能。 ### 设置 ``` npx skills add seo-skills/seo-audit-skill ``` ### 用法 ``` "Run an SEO audit on https://example.com" "Audit https://mysite.com and tell me what to fix first" "Check SEO health of https://example.com with 20-page crawl" ``` ## 需求 - **Node.js 18+**(使用原生 fetch API) - **Playwright**(用于 Core Web Vitals 和 JS 渲染分析) 安装后,运行 `npx playwright install chromium` 以安装用于 CWV 测量的浏览器。 对于桌面应用,必须为 Electron 的 Node 版本编译 `better-sqlite3`: ``` npx electron-rebuild -f -w better-sqlite3 ``` ## 许可证 MIT</div><div><strong>标签:</strong>Core Web Vitals, GNU通用公共许可证, LNA, MITM代理, Node.js, Playwright, SEO工具, SQLite, Web审计, 桌面应用, 特征检测, 自动化攻击</div></article></div> <!-- 人机验证 --> <script> (function () { var base = (document.querySelector('base') && document.querySelector('base').getAttribute('href')) || ''; var path = base.replace(/\/?$/, '') + '/cap-wasm/cap_wasm.min.js'; window.CAP_CUSTOM_WASM_URL = new URL(path, window.location.href).href; })(); </script> </body> </html>