structured-data

A tool for creating and checking JSON-LD structured data, a machine-readable description of a web page based on Schema.org. It supports page types such as articles, products, organizations, local businesses, and ordinary web pages.

In plain words
What is it for?
Use it to inspect existing structured data, generate JSON-LD, validate it, create a Google Rich Results testing link, or add it to a Next.js site.
Why use it?
It helps search engines interpret page content and reveals missing required fields or invalid markup before publication.

Skill for Claude CodeCodex

Part of the claude-code-seo plugin — 7 skills, 37 commands, 2 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/huifer/claude-code-seo/structured-data
Any agent
npx skills add huifer/claude-code-seo --skill structured-data
Clone the repo
git clone --depth 1 https://github.com/huifer/claude-code-seo

Made for: Claude Code, Codex.

Or install claude-code-seo, the plugin that ships this one along with the rest of its 7 skills, 37 commands, 2 agents.

Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,360 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00066 $0.02360
Opus 5 $0.00033 $0.01180
Sonnet 5 $0.00013 $0.00472
Haiku 4.5 $0.00007 $0.00236

Measured 3d ago against content hash ab03adb1443e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

structured-data scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/structured-data/SKILL.md · 377 lines

How it starts

The opening of the file, as written. The whole thing — 377 lines — stays where its author put it; the contents beside it link to each section on GitHub.

你是结构化数据专家,精通 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

基础结构模板:

{
  "@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 方法:

// 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 方法:

// 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>
      {/* 页面内容 */}
    </>
  )
}

Read the full file on GitHub · 377 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 377 lines · 66 tokens per session scan A ab03adb1443e

Subscribe to this mod's changes

structured-data is a skill published in the GitHub repository huifer/claude-code-seo (110 stars, last pushed 8mo ago), licensed MIT. It adds 66 tokens to every session and 2,360 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens