structured-data

A page tool that creates JSON-LD, a machine-readable description of a web page for search engines, using Schema.org types such as Article, Product, or FAQPage. It can provide code for Next.js App Router and Pages Router projects.

In plain words
What is it for?
Use it to generate structured data for a specified page path or file, such as a blog post, product page, company page, FAQ, review, or event.
Why use it?
It removes the need to choose the schema type and required fields by hand. It also gives links to validation tools so you can check the generated data.

Command

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 commands/huifer/claude-code-seo/structured-data
Clone the repo
git clone --depth 1 https://github.com/huifer/claude-code-seo
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,871 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.00010 $0.03871
Opus 5 $0.00005 $0.01936
Sonnet 5 $0.00002 $0.00774
Haiku 4.5 $0.00001 $0.00387

Measured 2d ago against content hash 9a388e790a3c, 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 2d 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.

commands/structured-data.md · 597 lines

How it starts

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

为指定页面生成合适的 JSON-LD 结构化数据。支持多种 Schema.org 类型,自动检测页面内容,提供 Next.js App Router 和 Pages Router 的实现代码。

功能

  • ✅ 自动检测页面类型和内容
  • ✅ 生成优化的 JSON-LD 结构化数据
  • ✅ 支持 Next.js App Router 和 Pages Router
  • ✅ 提供验证工具链接
  • ✅ 包含必需和推荐字段
  • ✅ 支持多种 Schema.org 类型

参数

  • $1$ARGUMENTS: 页面路径(必需)

    • 文件路径或路由路径
    • 示例:app/blog/post-1/page.tsx/blog/post-1blog/post-1
  • $2: Schema.org 类型(可选)

    • 如果不提供,自动检测
    • 支持类型:Article, BlogPosting, NewsArticle, Product, Organization, LocalBusiness, WebPage, FAQPage, Review, Event, Person

支持的 Schema 类型

内容类型

Article / BlogPosting

  • 博客文章和新闻
  • 包含:headline, image, datePublished, author, publisher

NewsArticle

  • 新闻文章
  • 额外字段:dateModified, headline, articleSection

TechArticle

  • 技术教程
  • 额外字段:dependencies, proficiencyLevel

商业类型

Product

  • 产品页面
  • 包含:name, image, description, offers (price, availability)

Organization

  • 组织/公司
  • 包含:name, url, logo, address, contactPoint

LocalBusiness

  • 本地商家
  • 包含:address, telephone, openingHours, priceRange

页面类型

WebPage

  • 普通网页
  • 包含:name, description, url

FAQPage

  • FAQ 页面
  • 包含:Question 和 Answer 列表

互动类型

Review

  • 评论
  • 包含:itemReviewed, reviewRating, author

AggregateRating

  • 聚合评分
  • 包含:ratingValue, reviewCount, bestRating

使用示例

示例 1:博客文章(自动检测)

/structured-data app/blog/nextjs-seo-guide/page.tsx

输出:

# 结构化数据生成报告

## 页面分析
- 页面类型:博客文章
- 检测语言:中文
- 推荐类型:BlogPosting
- 标题:Next.js SEO 完全指南
- 作者:检测到或需要提供

## 生成的 JSON-LD

```json
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Next.js SEO 完全指南:从入门到精通",
  "image": [
    "https://yourdomain.com/images/blog/nextjs-seo-cover.jpg"
  ],
  "datePublished": "2024-01-15T08:00:00+08:00",
  "dateModified": "2024-01-15T08:00:00+08:00",
  "author": {
    "@type": "Person",
    "name": "张三"
  },
  "publisher": {
    "@type": "Organization",
    "name": "YourBrand",
    "logo": {
      "@type": "ImageObject",
      "url": "https://yourdomain.com/logo.png"
    }
  },
  "description": "深入了解如何在 Next.js 项目中实现 SEO 优化。涵盖元数据、结构化数据、性能优化和最佳实践。",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://yourdomain.com/blog/nextjs-seo-guide"
  }
}

Next.js App Router 实现

将以下代码添加到 app/blog/nextjs-seo-guide/page.tsx

const jsonLd = {
  '@context': 'https://schema.org',
  '@type': 'BlogPosting',
  'headline': 'Next.js SEO 完全指南:从入门到精通',
  'image': [
    'https://yourdomain.com/images/blog/nextjs-seo-cover.jpg'
  ],
  'datePublished': '2024-01-15T08:00:00+08:00',
  'dateModified': '2024-01-15T08:00:00+08:00',
  'author': {
    '@type': 'Person',
    'name': '张三'
  },
  'publisher': {
    '@type': 'Organization',
    'name': 'YourBrand',
    'logo': {
      '@type': 'ImageObject',
      'url': 'https://yourdomain.com/logo.png'
    }
  },
  'description': '深入了解如何在 Next.js 项目中实现 SEO 优化。涵盖元数据、结构化数据、性能优化和最佳实践。',
  'mainEntityOfPage': {
    '@type': 'WebPage',
    '@id': 'https://yourdomain.com/blog/nextjs-seo-guide'
  }
}

Read the full file on GitHub · 597 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. 2d ago First seen · 597 lines · 0 tokens per session scan A 9a388e790a3c

Subscribe to this mod's changes

structured-data is a command published in the GitHub repository huifer/claude-code-seo (110 stars, last pushed 8mo ago), licensed MIT. It adds 10 tokens to every session and 3,871 once invoked, about $0.0001 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.