Agent skill

Structured Data

by huifer in huifer/claude-code-seo

生成和验证 JSON-LD 结构化数据,支持 Article、BlogPosting、Organization、WebPage、Product、LocalBusiness 等 Schema.org 类型。自动检测页面类型,验证语法,检查必需字段,提供 Google Rich Results 测试工具链接和 Next.js 组件代码示例。

MITAuto-check passedMarketing & SEO

Install Structured Data

skills CLI
$ npx skills add huifer/claude-code-seo --skill structured-data -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install huifer/claude-code-seo structured-data --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/huifer/claude-code-seo.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/structured-data .claude/skills/structured-data && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
structured-data
GitHub stars
110
Token cost
~1.4k tokens
SKILL.md length
350 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

生成和验证 JSON-LD 结构化数据,支持 Article、BlogPosting、Organization、WebPage、Product、LocalBusiness 等 Schema.org 类型。自动检测页面类型,验证语法,检查必需字段,提供 Google Rich Results 测试工具链接和 Next.js 组件代码示例。

  • Works in 5 steps: 自动检测页面类型 → 检查现有实现 → 生成优化的结构化数据 → …
  • Tasks that involve Schema markup
  • SKILL.md covers 核心职责, 工作流程, 支持的 Schema 类型 and 输出格式, plus 6 more sections
  • Reaches schema.org

What it does

Structured Data is an agent skill from huifer/claude-code-seo. 生成和验证 JSON-LD 结构化数据,支持 Article、BlogPosting、Organization、WebPage、Product、LocalBusiness 等 Schema.org 类型。自动检测页面类型,验证语法,检查必需字段,提供 Google Rich Results 测试工具链接和 Next.js 组件代码示例。

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Marketing & SEO, covering Schema markup. It works with Next.js. The repository describes itself as: Next.js SEO assistant plugin for Claude Code CLI. Automated SEO audits with 100-point scoring across 6 dimensions. Covers metadata, structured data, E-E-A-T, content strategy… The licence is MIT.

When your agent uses it

  • Tasks that involve Schema markup

Example prompts

  • “/structured-data”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 自动检测页面类型
  2. 检查现有实现
  3. 生成优化的结构化数据
  4. 验证和测试
  5. Next.js 集成

What it can do on your machine

Read from SKILL.md and the folder at commit 8b723e4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json, typescript and markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • schema.org

    Also links to:

    • search.google.com
    • validator.schema.org
    • developers.google.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Structured Data loads about 1.4k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 350 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from huifer/claude-code-seo at commit 8b723e4, republished under its MIT licence (© huifer). 350 words, ~1,426 tokens.

Download SKILL.mdSave it as .claude/skills/structured-data/SKILL.md (or your agent's skills folder).
name
structured-data
description
生成和验证 JSON-LD 结构化数据,支持 Article、BlogPosting、Organization、WebPage、Product、LocalBusiness 等 Schema.org 类型。自动检测页面类型,验证语法,检查必需字段,提供 Google Rich Results 测试工具链接和 Next.js 组件代码示例。

你是结构化数据专家,精通 Schema.org 标准和 JSON-LD 实现。

核心职责

当用户需要结构化数据时,你会:

  1. 自动检测页面类型

    • 分析页面内容和结构
    • 识别最合适的 Schema.org 类型
    • 考虑多种类型的组合(如 Article + Organization)
  2. 检查现有实现

    • 扫描项目中的 JSON-LD 代码
    • 验证 JSON-LD 语法正确性
    • 检查必需字段完整性
  3. 生成优化的结构化数据

    • 根据页面内容生成合适的 JSON-LD
    • 确保包含所有必需字段
    • 添加推荐字段以增强 Rich Snippets
    • 遵循 Schema.org 最新标准
  4. 验证和测试

    • 提供 JSON-LD 语法验证
    • 生成 Google Rich Results 测试链接
    • 标记可能的警告和错误
  5. Next.js 集成

    • 生成 App Router 兼容代码
    • 生成 Pages Router 兼容代码
    • 提供脚本标签插入方法

工作流程

步骤 1:检测和分析

分析页面内容:

- 读取页面文件
- 识别页面类型(博客文章、产品页面、关于页面等)
- 提取关键信息(标题、作者、日期、价格等)
- 检测语言(中文/英文)

确定 Schema 类型:

常见映射:
- 博客文章 → BlogPosting 或 Article
- 新闻文章 → NewsArticle
- 产品页面 → Product
- 关于页面 → Organization
- 本地商家 → LocalBusiness 或子类型
- 普通页面 → WebPage
- FAQ 页面 → FAQPage
- 评论 → Review 或 AggregateRating
步骤 2:检查现有实现

使用 Grep 搜索现有的 JSON-LD:

搜索模式:
- "@context": "https://schema.org"
- application/ld+json
- itemScope
步骤 3:生成 JSON-LD

基础结构模板:

json
{
  "@context": "https://schema.org",
  "@type": "[Type]",
  "[requiredField1]": "[value1]",
  "[requiredField2]": "[value2]",
  "[recommendedField1]": "[value1]",
  "[recommendedField2]": "[value2]"
}
步骤 4:验证必需字段

Article/BlogPosting 必需字段:

  • @context ✓
  • @type ✓
  • headline ✓
  • image ✓
  • datePublished ✓
  • author (Person or Organization) ✓

Product 必需字段:

  • @context ✓
  • @type ✓
  • name ✓
  • image ✓
  • offers (Offer) ✓

Organization 必需字段:

  • @context ✓
  • @type ✓
  • name ✓
  • url ✓
步骤 5:生成 Next.js 代码

App Router 方法:

typescript
// app/[page]/page.tsx
const jsonLd = {
  '@context': 'https://schema.org',
  '@type': 'Article',
  // ... 其他字段
}

export default function Page() {
  return (
    <>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
      />
      {/* 页面内容 */}
    </>
  )
}

Pages Router 方法:

typescript
// pages/[page].tsx
import Head from 'next/head'

export default function Page() {
  const jsonLd = {
    '@context': 'https://schema.org',
    '@type': 'Article',
    // ... 其他字段
  }

  return (
    <>
      <Head>
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
        />
      </Head>
      {/* 页面内容 */}
    </>
  )
}

支持的 Schema 类型

内容类型
  1. Article - 文章
  2. BlogPosting - 博客文章
  3. NewsArticle - 新闻文章
  4. TechArticle - 技术文章
商业类型
  1. Product - 产品
  2. Offer - 优惠/报价
  3. Organization - 组织/公司
  4. LocalBusiness - 本地商家
    • Restaurant
    • Dentist
    • Lawyer
    • Plumber
    • Store
页面类型
  1. WebPage - 网页
  2. AboutPage - 关于页面
  3. ContactPage - 联系页面
  4. FAQPage - FAQ 页面
互动类型
  1. Review - 评论
  2. AggregateRating - 聚合评分
  3. Comment - 评论
事件类型
  1. Event - 活动
人物类型
  1. Person - 人物
  2. Author - 作者

输出格式

格式 1:分析报告
markdown
# 结构化数据分析报告

## 当前状态
✓ 检测到现有 JSON-LD 实现
✓ Schema 类型:Article
⚠️ 缺少推荐字段:dateModified, publisher

## 问题诊断
❌ 缺少 image 字段
❌ author 信息不完整
⚠️ image 尺寸不符合推荐值

## 优化建议
1. 添加高质量图片(1200x630px 推荐)
2. 完善 author 信息(包含 @type 和 name)
3. 添加 publisher 信息
4. 添加 dateModified 字段
格式 2:完整代码

生成可直接使用的 Next.js 组件代码,包括:

  • JSON-LD 对象
  • Script 标签插入
  • TypeScript 类型定义(可选)
格式 3:验证链接

提供测试工具链接:

  • Google Rich Results Test
  • Schema Markup Validator

验证清单

Show full SKILL.md (143 more words)Show less
语法验证
  • JSON 格式正确
  • 所有引号和括号匹配
  • 无尾随逗号
  • 字段名正确(注意大小写)
内容验证
  • @context 正确设置为 "https://schema.org"
  • @type 值有效
  • 所有必需字段存在
  • 字段值符合预期类型
  • URL 格式正确
  • 日期格式符合 ISO 8601
SEO 验证
  • 图片 URL 可访问
  • 图片尺寸符合建议(1200x630px)
  • 作者信息完整
  • 发布日期准确
  • 描述长度适当

特殊场景处理

多语言支持
json
{
  "@context": "https://schema.org",
  "@type": "Article",
  "inLanguage": "zh-CN",
  "name": "文章标题",
  "description": "文章描述"
}
多个 Schema 组合
json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Article",
      "headline": "文章标题"
    },
    {
      "@type": "Organization",
      "name": "公司名称"
    }
  ]
}
动态生成
typescript
// 动态生成 JSON-LD
const jsonLd = {
  '@context': 'https://schema.org',
  '@type': 'BlogPosting',
  'headline': post.title,
  'datePublished': post.publishedAt,
  'author': {
    '@type': 'Person',
    'name': post.author.name
  }
}

最佳实践

  1. 保持准确

    • 所有数据必须真实准确
    • 不要提供误导性信息
    • 定期更新数据
  2. 完整字段

    • 包含所有必需字段
    • 添加推荐字段增强 Rich Snippets
    • 确保字段值质量高
  3. 测试验证

    • 使用官方工具测试
    • 修复所有警告和错误
    • 定期重新验证
  4. 性能优化

    • 使用内联脚本
    • 避免 async/defer(除非必要)
    • 确保脚本在 <head> 中
  5. 语言支持

    • 设置正确的 inLanguage
    • 提供多语言替代
    • 使用正确的字符编码

相关资源

双语支持

中文内容:

  • 搜索引擎:百度、搜狗、Google
  • Schema.org 仍适用
  • 额外考虑:Baidu specific schema

英文内容:

  • 搜索引擎:Google、Bing
  • 完整 Schema.org 支持
  • Rich Snippets 效果更好

何时主动触发

当检测到以下情况时,主动提供结构化数据建议:

  1. 用户创建新的博客文章或产品页面
  2. 用户提到 "rich snippets" 或 "search appearance"
  3. 用户询问 Google 搜索结果展示
  4. 检测到缺少结构化数据的重要页面
  5. 用户运行 /seo-audit 且结构化数据得分较低

集成命令

  • /structured-data - 快速生成指定页面的结构化数据
  • /seo-audit - 检查结构化数据完整性
  • /seo-check - 验证 JSON-LD 实现

输出优先级

  1. 安全性 - 确保不生成有误导性的结构化数据
  2. 准确性 - 所有字段值必须准确
  3. 完整性 - 包含所有必需和推荐字段
  4. 可用性 - 提供可直接使用的代码
  5. 教育性 - 解释为什么选择特定字段和类型

© huifer, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/structured-data of huifer/claude-code-seo.

Open the folder on GitHubat commit 8b723e4

Compare with similar skills

Structured Data next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Structured Data compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Structured Data this skillhuifer/claude-code-seo110—~1.4kAutomated safety check: PassMIT
SEO Setupalisamadiii/Portfolio180—~1.7kAutomated safety check: PassNone
Persian SEOTronIsHere/vibefarsiui210—~1.7kAutomated safety check: WarnNone
SEOgridaco/grida2.7k—~2.1kAutomated safety check: PassApache-2.0
Nextjs SEO Boosterkennyzir/7deer_skills322—~229Automated safety check: PassMIT
SEO Geoericrisco/rsc-harness174—~2.8kAutomated safety check: PassMIT

Similar skills

  • SEO Setup

    alisamadiii/Portfolio

    Full SEO/metadata setup and audit for client websites (Astro, Next.js, any static site).

    180 GitHub stars~1.7k tokensUpdated yesterday
    Marketing & SEOAuto-check passed
  • Persian SEO

    TronIsHere/vibefarsiui

    Technical and on-page SEO for Persian (Farsi) websites: lang and hreflang for fa-IR, RTL-safe metadata, Persian titles and descriptions, slug and URL strategy for Persian content, ZWNJ and keyword…

    210 GitHub stars~1.7k tokensUpdated today
    Marketing & SEOAuto-check: warnings
  • SEO

    gridaco/grida

    SEO best practices for the Grida project across Next.js pages, blog posts, and documentation.

    2.7k GitHub stars~2.1k tokensUpdated today
    Marketing & SEOAuto-check passed
  • Nextjs SEO Booster

    kennyzir/7deer_skills

    A complete SEO toolkit for Next.js applications, including structured data (Schema.org), dynamic sitemap generation, and meta tags.

    322 GitHub stars~229 tokensUpdated 9 days ago
    Marketing & SEOAuto-check passed
  • SEO Geo

    ericrisco/rsc-harness

    A skill your agent uses when one existing page needs to rank in Google AND get cited by AI answer engines — auditing a URL for on-page SEO, structured-data JSON-LD, GEO citation levers, Core Web…

    174 GitHub stars~2.8k tokensUpdated yesterday
    Marketing & SEOAuto-check passed
  • Content Freshness Signals

    thedaviddias/Front-End-Checklist

    Audits article pages for freshness signals, covering the Last-Modified header, Article JSON-LD dateModified and a visible last-updated date, and fixes mismatches.

    74k GitHub stars~741 tokensUpdated 2 days ago
    Marketing & SEOAuto-check passed

More from huifer/claude-code-seo

All 12 skills in this repo
  • AI Content Creator

    huifer/claude-code-seo

    AI 内容创作专家,生成高质量的 SEO 和 GEO 优化内容,支持多种内容类型和风格. An agent skill from huifer/claude-code-seo.

    110 GitHub stars~1.7k tokensUpdated 9 mo ago
    Auto-check: notes
  • Content Optimizer

    huifer/claude-code-seo

    分析博客文章和页面内容的质量,包括标题结构、关键词密度、可读性、内链机会、图片 alt 文本等。提供 E-E-A-T 权威性建设(Experience, Expertise, Authoritativeness, Trustworthiness)和内容策略建议,包括支柱页面、集群内容、作者权威性、关键词蚕食检测、Featured Snippets 优化、多媒体内容优化。

    110 GitHub stars~4k tokensUpdated 9 mo ago
    Auto-check passed
  • Geo Optimizer

    huifer/claude-code-seo

    生成式引擎优化专家,分析和优化内容在 AI 搜索引擎(ChatGPT、Claude、Perplexity、Google SGE)中的可见性和引用率。

    110 GitHub stars~650 tokensUpdated 9 mo ago
    Auto-check: notes
  • Guest Blogger

    huifer/claude-code-seo

    基于项目内容分析主题和关键词,生成客座博客搜索策略。提供 Google 高级搜索语法、客座博客资源列表(从 resources/guest-blog-sources.md 读取)和投稿邮件模板(从 templates/guest-blog-pitch.md 读取)。自动评估客座博客质量(DA、相关性、流量),提供个性化的投稿建议和优先级排序。

    110 GitHub stars~2.8k tokensUpdated 9 mo ago
    Auto-check passed
  • Local SEO

    huifer/claude-code-seo

    本地 SEO 分析和优化专家。自动检测项目是否需要本地 SEO,分析 NAP(Name, Address, Phone)一致性、本地关键词优化、Google Business Profile (GBP) 优化和本地结构化数据生成。提供本地商家搜索引擎排名优化建议,包括 NAP 标准化、本地关键词策略、GBP 完整性检查、评论策略、地图嵌入和本地 SEO 审计。

    110 GitHub stars~2.6k tokensUpdated 9 mo ago
    Auto-check passed
  • Metadata Optimizer

    huifer/claude-code-seo

    分析和优化 Next.js 项目的元数据,包括 title、description、Open Graph、Twitter Cards。自动检测 App Router 或 Pages Router,提供长度建议、关键词优化和最佳实践指导。支持中英文双语 SEO 分析。

    110 GitHub stars~1.1k tokensUpdated 9 mo ago
    Auto-check passed

Works with

Categories

Questions about Structured Data

What does Structured Data do?

生成和验证 JSON-LD 结构化数据,支持 Article、BlogPosting、Organization、WebPage、Product、LocalBusiness 等 Schema.org 类型。自动检测页面类型,验证语法,检查必需字段,提供 Google Rich Results 测试工具链接和 Next.js 组件代码示例。. Structured Data is an agent skill from huifer/claude-code-seo.

When should I use Structured Data?

Structured Data fits situations like: tasks that involve Schema markup.

How do I install Structured Data in Claude Code?

Run `npx skills add huifer/claude-code-seo --skill structured-data -a claude-code`. Or copy the skill folder (skills/structured-data in huifer/claude-code-seo) into .claude/skills/structured-data in your project. Claude Code loads it when a task matches its description.

How do I install Structured Data in Codex?

Run `npx skills add huifer/claude-code-seo --skill structured-data -a codex`. Or copy the skill folder (skills/structured-data in huifer/claude-code-seo) into .agents/skills/structured-data in your project. Codex loads it when a task matches its description.

Can I use Structured Data in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add huifer/claude-code-seo --skill structured-data -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/structured-data, .gemini/skills/structured-data, .github/skills/structured-data and .opencode/skills/structured-data in your project.

What does Structured Data need to run?

SKILL.md names no scripts, command-line tools or credentials: Structured Data is instructions for the agent only.

Does Structured Data access the network?

SKILL.md names 4 domains. In commands or code: schema.org; the agent is likely to contact it when it follows the instructions. As links in the text: search.google.com, validator.schema.org and developers.google.com. This is read from the text; nothing was executed.

Is Structured Data safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Structured Data use?

Structured Data is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Structured Data use?

About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Structured Data?

Skills that share tags, products or a category with Structured Data: SEO Setup (alisamadiii/Portfolio, 180 stars), Persian SEO (TronIsHere/vibefarsiui, 210 stars), SEO (gridaco/grida, 2.7k stars) and Nextjs SEO Booster (kennyzir/7deer_skills, 322 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Structured Data?

huifer (a GitHub user) maintains it in huifer/claude-code-seo, which has 110 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on January 4, 2026.

Source: huifer/claude-code-seo on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.