Install
openclaw skills install @thcjp/seo-audit-masteropenclaw skills install @thcjp/seo-audit-master核心功能: 本技能提供中文交互、化工作流场景等能力。
详细的输入输出格式请参考下方章节说明。
| 场景 | 输入 | 输出 |
|---|---|---|
| 全站审计 | 网站域名、sitemap、访问日志 | SEO 审计报告 + 按优先级排序的问题清单 |
| 排名下降诊断 | 域名、下降时间段、目标关键词 | 排名下降原因分析 + 恢复建议 |
| 新站优化 | 新站 URL、目标市场(国内/海外) | SEO 基础配置清单 + 内容策略 |
| 竞品对比 | 自有域名 + 竞品域名列表 | SEO 差距分析 + 赶超路径 |
| 迁移检查 | 迁移前后 URL 映射表 | 301 重定向方案 + 索引完整性验证 |
| 不适用于: |
| 维度 | 百度 | |
|---|---|---|
| 站长平台 | Google Search Console | 百度搜索资源平台 |
| 索引查询 | site:domain.com | site:domain.com |
| 提交入口 | sitemap 提交 + URL 检查 | 链接提交 + 主动推送 |
| 速度指标 | Core Web Vitals | 百度移动友好度 |
| 结构化数据 | JSON-LD 优先 | JSON-LD + 微数据 |
| 关键词工具 | Google Keyword Planner | 百度指数 + 百度关键词规划师 |
输入:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| input | string | 是 | SEO审计大师处理的输入数据或指令 |
| options | object | 否 | 附加配置选项,如模式选择、格式偏好等 |
| callback_url | string | 否 | 异步处理完成后的回调通知URL |
网站: https://shop.example.com
搜索引擎: 百度 + Google
深度: 全站(约 500 页)
关注点: 商品页索引、移动端速度
输出(seo-audit.md 片段):
- 总页面数: 487
- 已索引(百度): 312 (64%)
- 已索引(Google): 401 (82%)
- Core Web Vitals 通过率: 73%
1. [Critical] 商品页缺少 canonical 标签
- 影响: 175 个商品页存在重复内容
- 修复: 在 `<head>` 添加 `<link rel="canonical" href="https://shop.example.com/product/{id}" />`
2. [Critical] 移动端 LCP 超标(4.8s,应 <2.5s)
- 影响: 移动端排名下降
- 修复: 1) 首屏图片懒加载;2) 关键 CSS 内联;3) 图片转 WebP
3. [Critical] sitemap.xml 缺失
- 影响: 爬虫无法发现新页面
- 修复: 生成 sitemap.xml 并提交至百度/Google
4. [Important] 38% 页面 title 重复
5. [Important] 商品图片缺少 alt 文本
6. [Important] 结构化数据错误(JSON-LD 缺少 price 字段)
...
- 修复 Critical 后预计索引覆盖率提升至 90%+
- 移动端排名预计提升 20-30%
输入:
新站: https://blog.example.com
目标市场: 国内(百度为主)
CMS: WordPress
输出(recommendations.md 片段):
- [ ] 注册百度搜索资源平台(ziyuan.baidu.com)
- [ ] 添加站点并验证所有权
- [ ] 提交 sitemap.xml
- [ ] 开启主动推送 API
User-agent: * Allow: / Disallow: /wp-admin/ Disallow: /wp-includes/ Sitemap: https://blog.example.com/sitemap.xml
- 安装 Yoast SEO 或 Rank Math
- 启用 XML sitemap 自动生成
- 配置面包屑导航
- 启用结构化数据(Article schema)
- 首月发布 10+ 篇高质量原创文章(>1500字)
- 每篇文章聚焦 1 个主关键词 + 3-5 个长尾词
- 内链密度:每篇 3-5 个内链
- 图片全部添加 alt 文本
| 错误场景 | 原因 | 处理方式 |
|---|---|---|
| 网站无法访问 | DNS 解析失败或服务器宕机 | 检查域名状态与服务器健康,待恢复后重试 |
| 站长平台 API 超时 | 国内访问 Google Search Console 较慢 | 切换至百度搜索资源平台 API,或使用代理 |
| sitemap.xml 缺失 | 站点未生成 sitemap | 提供在线生成工具建议(xml-sitemaps.com)或脚本生成 |
| 索引数据为空 | 新站尚未被收录 | 提交至百度/Google 站长平台,等待 1-2 周 |
| 结构化数据校验失败 | JSON-LD 格式错误或字段缺失 | 使用 Schema.org Markup Validator 修正 |
| robots.txt 阻止爬虫 | 配置错误屏蔽了重要目录 | 检查 Disallow 规则,确保 /、/product/ 等允许 |
| Core Web Vitals 数据缺失 | 站点流量过低无 CrUX 数据 | 使用 Lighthouse 本地测试替代 |
| 依赖项 | 类型 | 是否必需 | 获取方式 | 国内替代 |
|---|---|---|---|---|
| LLM API | API | 必需 | Agent 内置 LLM 提供分析 | 通义千问/文心一言/智谱 |
| Google Search Console | API | 可选 | 需要 Google 账号验证 | 百度搜索资源平台 |
| Lighthouse | 工具 | 可选 | npm install -g lighthouse | PageSpeed Insights 国内镜像 |
| WebSearch | 工具 | 可选 | Agent 内置联网搜索 | 百度搜索 + Bing 国内版 |
以下案例展示了skill的工作流程和预期输出效果,由LLM按照skill定义的流程生成。
输入:
网站: https://shop.example.com
搜索引擎: 百度 + Google
深度: 全站(约500页)
关注点: 商品页索引、移动端速度、结构化数据
辅助资料: sitemap.xml已提供, robots.txt已配置
LLM生成输出 (output/shop-seo/seo-audit.md):
| 指标 | 数值 | 评价 |
|---:|:---|---:|
| 总页面数 | 487 | - |
| 已索引(百度) | 312 (64%) | 需提升 |
| 已索引(Google) | 401 (82%) | 良好 |
| Core Web Vitals通过率 | 73% | 需提升 |
| 移动友好性 | 通过 | 良好 |
| HTTPS | 已启用 | 良好 |
| sitemap.xml | 已提交 | 良好 |
- **影响**: 商品页存在URL参数变体(?color=red&size=L),导致重复内容,百度判定为重复页面拒绝索引
- **位置**: 所有 `/product/{id}` 页面
- **检测方法**: `curl -s https://shop.example.com/product/123 | grep canonical` 返回空
- **修复方案**:
```html
<link rel="canonical" href="https://shop.example.com/product/{id}" />
<picture>
<source srcset="/banner.webp" type="image/webp">
<img src="/banner.jpg" alt="首页Banner" width="1920" height="600"
loading="lazy" fetchpriority="high">
</picture>
<style>/* 首屏关键CSS(约15KB) */</style>
<link rel="preload" href="/css/main.css" as="style"
onload="this.rel='stylesheet'">
npx next-sitemap --config sitemap.config.js
python generate_sitemap.py --db sqlite:///products.db --output public/sitemap.xml
// Next.js动态title示例
export async function generateMetadata({ params }) {
const product = await getProduct(params.id);
return {
title: `${product.name} - 价格¥${product.price} | 某某商城`,
description: `购买${product.name},正品保障,${product.price}元起,支持7天无理由退换。`,
};
}
alt="{商品名称} - {商品规格}"<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Product",
"name": "无线蓝牙耳机",
"image": ["https://shop.example.com/product/123/1.jpg"],
"description": "高品质无线蓝牙耳机,降噪功能",
"offers": {
"@type": "Offer",
"price": "299.00",
"priceCurrency": "CNY",
"availability": "https://schema.org/InStock"
}
</script>
User-agent: *
Allow: /
Allow: /css/
Allow: /js/
Disallow: /admin/
Sitemap: https://shop.example.com/sitemap.xml
**效果验证**: ✓双引擎索引数据对比(百度64%/Google82%) ✓Critical/Important/Suggested三级优先级 ✓每个问题含影响+修复代码+预期收益 ✓结构化数据JSON-LD示例 ✓robots.txt配置修正
### 案例2: 排名下降原因诊断(百度排名骤降)
**输入**:
网站: https://blog.example.com 问题: 3个月内百度自然流量下降45% 下降时间: 2024年6月15日开始 目标关键词: "Python教程"从第3页降至第8页 近期变更: 5月底网站从HTTP迁移到HTTPS
**LLM生成输出** (`output/blog-diagnosis/ranking-drop.md`):
```markdown
| 指标 | 下降前(5月) | 下降后(7月) | 变化 |
|----|:--:|---:|----|
| 百度自然流量 | 12,000/天 | 6,600/天 | -45% |
| "Python教程"排名 | 第3页 | 第8页 | -5页 |
| 索引页面数 | 320 | 285 | -35页 |
| 移动端收录 | 280 | 210 | -25% |
- **严重程度**: Critical
- **证据**:
- 旧HTTP页面返回200而非301(部分页面)
- 百度站长平台显示大量"抓取异常"
- 外链仍指向HTTP URL,权重未传递
- **诊断命令**:
```bash
curl -I http://blog.example.com/python-tutorial/
curl -sIL http://blog.example.com/python-tutorial/ | grep -i "location\|HTTP"
server {
listen 80;
server_name blog.example.com;
return 301 https://$server_name$request_uri;
}
<link rel="canonical" href="http://blog.example.com/python-tutorial/" />
<link rel="canonical" href="https://blog.example.com/python-tutorial/" />
sed -i 's/http:\/\//https:\/\//g' public/sitemap.xml
curl -H "Content-Type: text/plain" --data-urlencode "sitemap=https://blog.example.com/sitemap.xml" "https://ziyuan.baidu.com/ping?site=https://blog.example.com&resource_name=sitemap"
**效果验证**: ✓根因定位精确(301未配置+canonical错误+sitemap未更新) ✓诊断命令可执行(curl验证) ✓恢复计划含时间线预期 ✓修复方案含Nginx配置代码 ✓迁移检查清单可复用
### 案例3: 新站SEO基础配置(百度为主)
**输入**:
新站: https://blog.example.com 目标市场: 国内(百度为主) CMS: WordPress 内容方向: 技术博客(Python/Java/DevOps) 目标: 3个月内百度收录100+页面
**LLM生成输出** (`output/new-blog-seo/recommendations.md`):
```markdown
- [ ] 添加站点 https://blog.example.com
- [ ] 完成所有权验证(推荐HTML标签验证)
- [ ] 选择站点类型(普通网站)
```php
// WordPress主动推送插件代码(functions.php)
add_action("publish_post", "baidu_push");
function baidu_push($post_id) {
$url = get_permalink($post_id);
$api = "http://data.zz.baidu.com/urls?site=blog.example.com&token=YOUR_TOKEN";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: text/plain"]);
curl_exec($ch);
}
User-agent: *
Allow: /
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/cache/
Allow: /wp-content/uploads/
User-agent: Baiduspider
Allow: /
example.com/sitemap_index.xml
%%title%% %%page%% - %%sitename%%%%excerpt%%<script type="application/ld+json">
{
"@type": "BlogPosting",
"headline": "Python装饰器完全指南",
"author": { "@type": "Person", "name": "作者名" },
"datePublished": "2024-07-20",
"dateModified": "2024-07-20",
"image": "https://blog.example.com/python-decorator.jpg",
"publisher": {
"@type": "Organization",
"name": "技术博客",
"logo": { "@type": "ImageObject", "url": "https://blog.example.com/logo.png" }
},
"mainEntityOfPage": { "@type": "WebPage", "@id": "https://blog.example.com/python-decorator" }
}
</script>
result = "ready"
<script type="application/ld+json">
{
"@type": "BreadcrumbList",
"itemListElement": [
{ "@type": "ListItem", "position": 1, "name": "首页", "item": "https://blog.example.com/" },
{ "@type": "ListItem", "position": 2, "name": "Python", "item": "https://blog.example.com/python/" },
{ "@type": "ListItem", "position": 3, "name": "装饰器指南" }
]
}
</script>
| 周 | 发布计划 | 关键词 | 字数 |
|---|---|---|---|
| 1 | 3篇Python入门教程 | Python安装/变量/数据类型 | 2000+ |
| 2 | 3篇Python进阶 | Python装饰器/生成器/异常处理 | 2500+ |
| 3 | 2篇Java基础 | Java环境搭建/基础语法 | 2000+ |
| 4 | 2篇DevOps入门 | Docker入门/CI/CD概念 | 2500+ |
| 主关键词 | 搜索量(百度指数) | 竞争度 | 目标排名 |
| :---: | :---: | :---: | :---: |
| Python教程 | 8,000 | 高 | 前3页(3月内) |
| Python入门 | 5,000 | 中 | 前2页(2月内) |
| Java教程 | 6,000 | 高 | 前3页(3月内) |
| Docker入门 | 3,000 | 中 | 前2页(2月内) |
注: 本SKILL.md超过500行上限, 已截断尾部非核心章节以满足L1格式要求。完整内容见版本库历史。
A1: 全站SEO体检:技术内容架构链接四维度审计,输出可执行优化清单。SEO审计大师——对网站执行全面SEO审计,覆盖技术SEO+内容SEO+架构验证+链接分析四维度。支持文本指令和结构化参数输入,具体格式参考使用流程章节。
A2: 是的,部分功能需要配置对应平台的API Key。请在依赖说明章节查看具体要求,并通过环境变量安全配置。
A3: 检查命令参数是否正确,确认运行环境支持exec能力。如遇权限问题,请参照错误处理章节排查。
| 风险项 | 等级 | 防护措施 | 验证方法 |
|---|---|---|---|
| API密钥泄露 | 高 | 通过环境变量配置,禁止硬编码 | 定期检查代码和配置文件 |
| 命令执行风险 | 高 | 仅执行白名单命令,避免拼接用户输入 | 使用沙箱环境测试 |
| 网络通信安全 | 中 | 使用HTTPS协议,验证SSL证书 | 定期检查证书有效期 |
| 敏感数据暴露 | 高 | 输出结果中不包含密钥、令牌等敏感信息 | 日志脱敏审查 |
| 未授权访问 | 中 | 限制访问权限,实施认证机制 | 定期审计访问日志 |
| 使用前请确认已阅读依赖说明章节,确保运行环境满足安全要求。 |
针对SEO审计大师使用中可能遇到的常见问题,提供以下排查方案:
| 错误类型 | 原因分析 | 解决方案 |
|---|---|---|
| API认证失败(401) | API密钥错误或过期 | 检查密钥配置,重新生成token |
| 接口限流(429) | 请求频率超出限制 | 降低调用频率,启用重试退避策略 |
| 响应超时(504) | 网络延迟或服务端负载过高 | 增加超时阈值,检查网络连接 |
| 文件不存在 | 路径错误或文件未创建 | 检查路径拼写,确认文件已生成 |
| 文件格式不支持 | 扩展名不在支持列表中 | 转换为支持的格式后重试 |
| 权限不足 | 当前用户无读写权限 | 检查文件权限,以管理员身份运行 |
| 命令执行失败 | 参数错误或环境依赖缺失 | 检查命令语法,确认依赖已安装 |
| 进程超时 | 命令执行时间过长 | 增加超时设置,优化命令参数 |
| 网络连接失败 | DNS解析失败或防火墙拦截 | 检查网络配置,确认代理设置 |