中级Agent Skill

Schema(原 Schema Markup)

根据页面真实展示的内容,编写或修复电商结构化数据。提供页面内容、现有 JSON-LD 和已确认的商品或商家信息后,这项 Skill 会帮助助手选择合适的类型、建立实体关联,并检查字段与页面是否一致,方便开发人员在网站中实施和验证。

浏览量
0
复制次数
0
收藏
0
编辑评分
83/100
01

这个 Skill 是做什么的

结构化数据用机器可读的格式说明页面中的信息。这项 Skill 可以检查已有实现,也可以根据真实页面内容起草 JSON-LD,结合类型示例、实体关系和验证步骤,帮助团队把信息描述得一致、完整。

适合修复商品、商家等信息缺失或字段不一致的问题。没有在页面中得到支持的价格、评价和宣传内容不能为了补字段而编造。完成代码后,还需要部署到实际页面并检查解析与展示资格;正确填写结构化数据并不保证出现搜索富结果。

02

它有什么特色

01

方法与优势

先看页面上实际有什么信息,再选择对应类型,避免为了使用某种标记而反过来编造内容。通过实体关联把商品、销售方和页面信息组织起来,并用验证步骤检查字段缺失或前后矛盾的问题。

02

适用任务

把生成代码和验证线上效果分开。输出的 JSON-LD 可以交给开发实施,但仍需检查当前适用规则与线上解析结果;代码语法有效,只说明结构可以被读取,不能直接推导出搜索引擎一定会展示额外样式。

03

安装前的特殊要求

需要准备的输入

渲染后的页面内容、现有结构化数据、实体详情和当前展示资格要求。

Agent 与运行环境

使用能发现已安装 Skill 并读取辅助文件的兼容 Agent。外部服务或创作运行环境需另行配置。

需确认的适用边界

标记不保证富媒体结果,不可编造价格、评价或展示资格;部署和线上验证需单独执行。

04

安装与开始使用

将指令复制给 Codex 或 Claude Code,让助手从原始仓库下载固定提交,安装完整文件并检查所需依赖。

  1. 打开能访问本机文件和终端的 Codex 或 Claude Code。
  2. 复制下方指令发给正在使用的应用,由助手选择该应用的安装目录。
  3. 查看返回的安装路径和文件检查结果;需要时新建会话,再要求助手使用已安装的 Skill。
请在我当前使用的应用中安装 schema,直接执行文件安装,不要只解释步骤。 原始仓库:https://github.com/coreyhaines31/marketingskills.git 固定提交:e85f3cbc2e4a79bf33b2a12e9bdd9087d414735b Skill 路径:skills/schema 1. 将这个版本下载到新目录。执行随包脚本前,先阅读 SKILL.md 和安装参考文件,不替换成其他作者的包。 2. Codex 安装到 ~/.agents/skills/schema,Claude Code 安装到 ~/.claude/skills/schema,只安装到我正在使用的应用。安装完整 Skill 文件夹,保留 scripts、references、assets 和随包声明;将仓库根目录许可证一并保留。先检查所有目标目录;已有安装时,说明差异后再决定是否替换。 3. 比较来源和安装目录的文件清单、文件哈希,检查文档要求的运行时、依赖及外部连接。只配置此 Skill 所需的本地依赖,适用时使用隔离环境;账号登录由我在本地完成,不把凭据贴进聊天。 4. 返回来源提交、实际安装路径、文件检查结果及尚未完成的运行环境配置,说明如何调用 schema。文件复制与应用发现分别检查,需要时新建会话。不要执行生产任务,也不要把安装完成说成已确认业务效果。
05

原始 Skill.md

以下为已核对版本未经改写的 SKILL.md。安装完整包才能保留引用的脚本、素材和指引。下方启动提示词为 EcomAgentTools 编写的示例。

---
name: schema
description: When the user wants to add, fix, or optimize schema markup and structured data on their site. Also use when the user mentions "schema markup," "structured data," "JSON-LD," "rich snippets," "schema.org," "FAQ schema," "product schema," "review schema," "breadcrumb schema," "Google rich results," "knowledge panel," "star ratings in search," or "add structured data." Use this whenever someone wants their pages to show enhanced results in Google. For broader SEO issues, see seo-audit. For AI search optimization, see ai-seo.
metadata:
  version: 2.0.2
---

# Schema Markup

You are an expert in structured data and schema markup. Your goal is to implement schema.org markup that helps search engines understand content and enables rich results in search.

## Initial Assessment

**Check for product marketing context first:**
If `.agents/product-marketing.md` exists (or `.claude/product-marketing.md`, or the legacy `product-marketing-context.md` filename, in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.

Before implementing schema, understand:

1. **Page Type** - What kind of page? What's the primary content? What rich results are possible?

2. **Current State** - Any existing schema? Errors in implementation? Which rich results already appearing?

3. **Goals** - Which rich results are you targeting? What's the business value?

---

## Core Principles

### 1. Accuracy First
- Schema must accurately represent page content
- Don't markup content that doesn't exist
- Keep updated when content changes

### 2. Use JSON-LD
- Google recommends JSON-LD format
- Easier to implement and maintain
- Place in `<head>` or end of `<body>`

### 3. Follow Google's Guidelines
- Only use markup Google supports
- Avoid spam tactics
- Review eligibility requirements

### 4. Validate Everything
- Test before deploying
- Monitor Search Console
- Fix errors promptly

---

## Common Schema Types

| Type | Use For | Required Properties |
|------|---------|-------------------|
| Organization | Company homepage/about | name, url |
| WebSite | Homepage/site identity | name, url |
| Article | Blog posts, news | headline, image, datePublished, author |
| Product | Product pages | name, image, offers |
| SoftwareApplication | SaaS/app pages | name, offers |
| FAQPage | FAQ content | mainEntity (Q&A array) |
| HowTo | Tutorials | name, step |
| BreadcrumbList | Any page with breadcrumbs | itemListElement |
| LocalBusiness | Local business pages | name, address |
| Event | Events, webinars | name, startDate, location |

**For complete JSON-LD examples**: See [references/schema-examples.md](references/schema-examples.md)

### Check Google Feature Support First

Schema.org vocabulary validity does not establish Google feature eligibility. Before implementing markup for a requested search appearance, check Google's current [supported structured data gallery](https://developers.google.com/search/docs/appearance/structured-data/search-gallery).

- **FAQPage:** Google stopped showing FAQ rich results on May 7, 2026, and removed the feature's documentation in June. The earlier government/health-site exception is no longer a route to FAQ rich results. See Google's [documentation updates](https://developers.google.com/search/updates).
- **HowTo:** Google retired HowTo rich results in September 2023. See the [retirement announcement](https://developers.google.com/search/blog/2023/08/howto-faq-changes).
- **WebSite / SearchAction:** Google retired the sitelinks search box in November 2024; `WebSite` still supports site names. See the [search box announcement](https://developers.google.com/search/blog/2024/10/sitelinks-search-box).

These types can still describe matching visible content in Schema.org. Explain that distinction, ask which consumer needs the markup, and do not recommend implementation to obtain a retired Google appearance. Do not treat missing retired-feature reports or Rich Results Test detection as a broken implementation, or remove unrelated supported markup.

---

## Quick Reference

### Organization (Company Page)
Required: name, url
Recommended: logo, sameAs (social profiles), contactPoint

### Article/BlogPosting
Required: headline, image, datePublished, author
Recommended: dateModified, publisher, description

### Product
Required: name, image, offers (price + availability)
Recommended: sku, brand, aggregateRating, review

### FAQPage
Required: mainEntity (array of Question/Answer pairs)
Optional semantic markup for visible FAQs; not a way to obtain Google FAQ rich results. Check the feature-support guidance above before offering code.

### BreadcrumbList
Required: itemListElement (array with position, name, item)

---

## Multiple Schema Types

You can combine multiple schema types on one page using `@graph`:

```json
{
  "@context": "https://schema.org",
  "@graph": [
    { "@type": "Organization", ... },
    { "@type": "WebSite", ... },
    { "@type": "BreadcrumbList", ... }
  ]
}
```

---

## Validation and Testing

### Tools
- **Google Rich Results Test**: https://search.google.com/test/rich-results — test Google's currently supported features, not every Schema.org type
- **Schema.org Validator**: https://validator.schema.org/
- **Search Console**: available enhancement reports for supported features; retired types need not have a report

### Common Errors

**Missing required properties** - Check Google's documentation for required fields

**Invalid values** - Dates must be ISO 8601, URLs fully qualified, enumerations exact

**Mismatch with page content** - Schema doesn't match visible content

---

## Implementation

### Static Sites
- Add JSON-LD directly in HTML template
- Use includes/partials for reusable schema

### Dynamic Sites (React, Next.js)
- Component that renders schema
- Server-side rendered for SEO
- Serialize data to JSON-LD

### CMS / WordPress
- Plugins (Yoast, Rank Math, Schema Pro)
- Theme modifications
- Custom fields to structured data

---

## Output Format

### Schema Implementation
```json
// Full JSON-LD code block
{
  "@context": "https://schema.org",
  "@type": "...",
  // Complete markup
}
```

### Testing Checklist
- [ ] Requested Google appearance is currently supported, or a separate semantic consumer is identified
- [ ] Validates in Schema.org Validator; supported Google features also pass Rich Results Test
- [ ] Required-field errors resolved; recommended-field warnings reviewed
- [ ] Matches page content
- [ ] All required properties included

---

## Task-Specific Questions

1. What type of page is this?
2. What rich results are you hoping to achieve?
3. What data is available to populate the schema?
4. Is there existing schema on the page?
5. What's your tech stack?

---

## Related Skills

- **seo-audit**: For overall SEO including schema review
- **ai-seo**: For AI search optimization (schema helps AI understand content)
- **programmatic-seo**: For templated schema at scale
- **site-architecture**: For breadcrumb structure and navigation schema planning
06

开始使用

以下是主要功能的用例提示词,可以直接复制使用。

01

根据已确认页面事实起草 Product 标记

根据已确认页面事实起草 Product 标记 适用于:根据已确认页面事实起草 Product 标记。请准备:渲染后的页面内容、现有结构化数据、实体详情和当前展示资格要求。

查看 Prompt 和变量收起 Prompt 和变量
请使用已安装的 schema Skill。任务:根据已确认页面事实起草 Product 标记。输入:[INPUT]。限制:[CONSTRAINTS]。先检查缺失信息,再输出可审查的结果、依据、假设和下一步。标记不保证富媒体结果,不可编造价格、评价或展示资格;部署和线上验证需单独执行。

需要替换的变量

[INPUT]
渲染后的页面内容、现有结构化数据、实体详情和当前展示资格要求。
[CONSTRAINTS]
任务范围、允许的操作、输出格式和审核要求。
02

修复实体冲突和面包屑标记

修复实体冲突和面包屑标记 适用于:修复实体冲突和面包屑标记。请准备:渲染后的页面内容、现有结构化数据、实体详情和当前展示资格要求。

查看 Prompt 和变量收起 Prompt 和变量
请使用已安装的 schema Skill。任务:修复实体冲突和面包屑标记。输入:[INPUT]。限制:[CONSTRAINTS]。先检查缺失信息,再输出可审查的结果、依据、假设和下一步。标记不保证富媒体结果,不可编造价格、评价或展示资格;部署和线上验证需单独执行。

需要替换的变量

[INPUT]
渲染后的页面内容、现有结构化数据、实体详情和当前展示资格要求。
[CONSTRAINTS]
任务范围、允许的操作、输出格式和审核要求。
03

为 JSON-LD 改动准备验证检查

为 JSON-LD 改动准备验证检查 适用于:为 JSON-LD 改动准备验证检查。请准备:渲染后的页面内容、现有结构化数据、实体详情和当前展示资格要求。

查看 Prompt 和变量收起 Prompt 和变量
请使用已安装的 schema Skill。任务:为 JSON-LD 改动准备验证检查。输入:[INPUT]。限制:[CONSTRAINTS]。先检查缺失信息,再输出可审查的结果、依据、假设和下一步。标记不保证富媒体结果,不可编造价格、评价或展示资格;部署和线上验证需单独执行。

需要替换的变量

[INPUT]
渲染后的页面内容、现有结构化数据、实体详情和当前展示资格要求。
[CONSTRAINTS]
任务范围、允许的操作、输出格式和审核要求。
07

实际使用案例:把商品价格与库存写进可解析的 JSON-LD

输入一份模拟商品事实,要求将 Product 与 Offer 放进可见内容一致的 HTML。商家没有提供评分、评论或 GTIN,因此不应补造这些字段。

使用步骤与 Prompt

  1. 准备下方案例输入资料,保留商品、政策和经营记录中的金额、单位及时间口径。
  2. 把 Product 与 Offer 数据写入商品页面,核对顾客可见的名称、价格、币种和库存,再检查 JSON 与实际页面。
  3. 提交下方完整 Prompt,查看右侧主要产物;需要交接给同事时,下载包含全部交付文件的压缩包。

案例输入资料:business-inputs.zip

Use the schema-markup Skill.

Prepare Product and Offer structured data for the supplied product record and embed it in a complete example product page. Ensure the visible name, price, currency and stock state agree with the JSON-LD. Return the HTML and JSON-LD, validate the JSON and inspect the rendered page. Do not add aggregate ratings or reviews we have not supplied.

The attached business materials are:
- inputs/product.json

Deliver a complete result.md report that the operations team can read, plus any finished files needed for this task. Keep supporting calculations and evidence with the deliverables. Write the report in English; use the requested target language for customer-facing copy. The business datasets are fictional examples unless the brief explicitly names a live public website.

运行结果

下方直接展示本次 Prompt 产生的主要文件,保留实际输出语言。

Product and Offer markup matched to the visible example

The completed product.html and product.jsonld use only the five supplied product fields. The page shows HarborMug Blue Insulated Stainless Steel Mug, SKU HM-BLUE-001, price 24.00 USD and In stock. JSON-LD expresses the same offer with the Schema.org InStock URL.

Implemented JSON-LD

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "HarborMug Blue Insulated Stainless Steel Mug",
  "sku": "HM-BLUE-001",
  "offers": {
    "@type": "Offer",
    "price": "24.00",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  }
}

Checks actually completed

The JSON parsed successfully. Chromium rendered the complete example page; the product name, SKU, price, currency and stock text were checked against the JSON-LD. The example has one H1 and a server-delivered JSON-LD script. No aggregate rating, customer review, image URL, GTIN, sale expiry or shipping entitlement was invented. render-validation.json contains the observed DOM and parsed data.

Before merchant publication

A product photograph was not supplied. Obtain the real image and final product URL before targeting merchant listing eligibility; do not use a placeholder image as product evidence. Google distinguishes product snippets from merchant listings and provides feature-specific requirements. See product snippets and merchant listings, inspected for this execution.

This run verifies JSON syntax and visible-data parity; it does not claim a Google Rich Results Test pass, Search Console approval or search appearance. The reserved store.example domain identifies a fictional implementation specimen. On the real store, use the approved URL, add the real image and run the appropriate external validators before release. Keep price and availability sourced from the same record as the visible page so later stock changes cannot leave stale markup.

案例中的商家经营资料为模拟数据;涉及网站检查时,报告中的页面观察来自所列公开网址。

08

风险与使用注意事项

已知限制

标记不保证富媒体结果,不可编造价格、评价或展示资格;部署和线上验证需单独执行。

证据与复核

核对源码及随包文件:GitHub e85f3cbc2e4a。 当前包标识为 schema。本次为静态审查,不代表已完成安装运行或业务效果测试。

采用结果前

使用获授权输入,不把密钥贴入提示词。采用前检查面向客户的声明、计算、代码改动及任何拟议的外部操作。

常见问题

它能做什么,有什么优势?

起草或修复与页面可见内容一致的 JSON-LD。当前 Skill 名为 schema,包含类型示例、实体关联和验证步骤。

如何安装和开始使用?

按实际 Agent 选择方式,安装完整包,不要只复制页面中的 SKILL.md。 渲染后的页面内容、现有结构化数据、实体详情和当前展示资格要求。 开启新 Agent 会话,明确要求使用 schema。先用小型样本尝试下方一个场景,并检查输出。

适合哪些使用场景?

根据已确认页面事实起草 Product 标记;修复实体冲突和面包屑标记;为 JSON-LD 改动准备验证检查

使用前需要了解哪些限制?

标记不保证富媒体结果,不可编造价格、评价或展示资格;部署和线上验证需单独执行。

本页核对了什么?

核对源码及随包文件:GitHub e85f3cbc2e4a。 当前包标识为 schema。本次为静态审查,不代表已完成安装运行或业务效果测试。

暂无评论。

发表评论

请先为每一项打分,再分享你的真实使用体验。

任务有效性
安装与使用难度
稳定性与边界
文档清晰度
首次获得有效结果
作者 / 维护者

Corey Haines

核对源码及随包文件:GitHub e85f3cbc2e4a。 当前包标识为 schema。本次为静态审查,不代表已完成安装运行或业务效果测试。