用途
扫描店铺所有页面和博客文章,检查是否存在缺失或单薄的内容(正文过短、缺少 SEO 标题/描述、正文为空)。单薄内容页面会被搜索引擎降权,也会影响客户体验。该技能为只读操作,不执行任何变更。它与 seo-metadata-audit 互补,后者覆盖产品和集合。
主要能力
- 查询所有页面(pages),获取标题、正文、正文摘要、SEO 字段、发布时间及分页游标。
- 查询所有博客文章(articles),获取标题、正文、摘要、SEO 字段、发布时间、所属博客及分页游标。
- 标记以下问题:正文为空、正文长度小于 min_body_length、缺少 SEO 标题、缺少 SEO 描述。
- 输出 CSV 文件 content_audit_<YYYY-MM-DD>.csv,包含列:type, id, title, handle, published_at, body_length, has_seo_title, has_seo_description, issue。
- 支持 human 或 json 输出格式。
使用方式
前置条件
- 已认证的 Shopify CLI 会话:shopify store auth --store <domain> --scopes read_content
- API 权限范围:read_content
参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| store | string | 是 | — | 店铺域名(例如 mystore.myshopify.com) |
| min_body_length | integer | 否 | 100 | 标记正文内容短于此字符数的页面 |
| include_unpublished | bool | 否 | false | 是否同时审计未发布的页面和文章 |
| format | string | 否 | human | 输出格式:human 或 json |
工作流程
- OPERATION: pages — query。输入:first: 250,选择 title, body, bodySummary, seo, publishedAt, 分页游标。预期输出:所有页面及其内容和 SEO 数据。
- OPERATION: articles — query。输入:first: 250,选择 title, body, seo, publishedAt, blog { title }, 分页游标。预期输出:所有博客文章及其内容数据。
- 标记:正文为空、正文 < min_body_length、缺少 SEO 标题、缺少 SEO 描述。
GraphQL 操作
pages:query — 已针对 api_version 2025-04 验证:
query PageContentAudit($after: String) {
pages(first: 250, after: $after) {
edges {
node {
id
title
handle
publishedAt
bodySummary
body
seoTitle: metafield(namespace: "global", key: "title_tag") { value }
seoDescription: metafield(namespace: "global", key: "description_tag") { value }
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
articles:query — 已针对 api_version 2025-04 验证:
query ArticleContentAudit($after: String) {
articles(first: 250, after: $after) {
edges {
node {
id
title
handle
publishedAt
body
summary
seoTitle: metafield(namespace: "global", key: "title_tag") { value }
seoDescription: metafield(namespace: "global", key: "description_tag") { value }
blog {
id
title
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
会话跟踪
Claude 必须在每个阶段输出以下内容,这是强制要求。
开始时输出:
╔══════════════════════════════════════════════╗
║ SKILL: Page Content Audit ║
║ Store: <store domain> ║
║ Started: <YYYY-MM-DD HH:MM UTC> ║
╚══════════════════════════════════════════════╝
每步之后输出:
[N/TOTAL] <QUERY|MUTATION> <OperationName>
→ Params: <brief summary of key inputs>
→ Result: <count or outcome>
完成时输出:
对于 format: human(默认):
══════════════════════════════════════════════
PAGE CONTENT AUDIT
Pages scanned: <n> | Issues: <n>
Articles scanned: <n> | Issues: <n>
Issues:
Page: "<title>" — empty body
Article: "<title>" — missing SEO description
Output: content_audit_<date>.csv
══════════════════════════════════════════════
对于 format: json,输出:
{
"skill": "page-content-audit",
"store": "<domain>",
"pages_scanned": 0,
"articles_scanned": 0,
"issues_found": 0,
"output_file": "content_audit_<date>.csv"
}
适用场景
- 在 CMS 迁移或主题更换后运行,检查可能被清空的页面内容。
- 定期审计页面和博客文章的内容质量与 SEO 字段完整性。
- 与 seo-metadata-audit 配合,在一个工作流中完成覆盖产品、集合、页面和博客文章的完整 SEO 审计。
限制
- 只读技能,不执行任何变更,可随时安全运行。
- 需要已认证的 Shopify CLI 会话及 read_content 权限范围。
- 错误处理:THROTTLED(API 速率限制超出)时等待 2 秒,最多重试 3 次;无页面或文章(极简店铺)时以 0 结果退出。
最佳实践
- 搜索引擎通常认为少于 300 字的页面为“单薄内容”——可使用 min_body_length: 1500(字符数约等于 250 字)作为起始阈值。
- About、FAQ 和 Contact 页面是高信任页面,绝不应为空,应优先处理。