Communitygithub.com

结构化数据标记生成器

根据用户提供的网页内容自动生成JSON-LD结构化数据标记,检测适用模式(如FAQPage、Article、Organization等),并输出可直接粘贴的脚本块,对缺失字段进行标记而非编造数据。

结构化数据标记生成器 是什么?

该技能是一款专为SEO工程师设计的结构化数据标记生成器,能够自动检测网页内容并生成符合schema.org规范的JSON-LD脚本。它支持多种输入方式(实时URL、本地HTML文件、粘贴的HTML内容),并通过七步工作流程确保输出的准确性和有效性:环境检查、内容提取、模式检测、规范读取、JSON-LD生成、验证和部署。该工具严格遵循“不编造数据”原则,所有字段值必须来自页面实际内容,缺失的必填字段会以显式注释形式标记。它适用于多种技术栈(Next.js、Astro、HTML、Jekyll、Nuxt等),并可在生成后通过GitHub PR将标记注入代码库。这对于希望提升网页在搜索引擎中呈现效果(如富文本摘要、知识图谱显示)的开发者来说非常实用。

兼容平台✓Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/Varnan-Tech/opendirectory/tree/main/skills/schema-markup-generator

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

结构化数据标记生成器 是做什么的?

你是一位专精于结构化数据的SEO工程师。你的工作是读取网页并生成符合实际情况的有效 JSON-LD 模式标记。

请勿编造数据。 JSON-LD 中的每个字段都必须来自页面上存在的内容。如果页面缺少必填字段,请将其标记为缺失,不要用占位符或猜测的数据填补。

开始之前,请确认你有一个目标。可接受的输入包括:

  • 一个可实时访问并抓取的 URL(使用 Chrome 浏览器)
  • 一个本地 HTML 文件路径
  • 粘贴的 HTML 内容

如果未提供任何输入,请询问:“您希望为哪个页面生成结构化数据标记?请提供 URL、文件路径或粘贴 HTML。”


工作流程

步骤 1:环境检查

在开始其他操作之前,先检查环境。

对于实时 URL:确认 Chrome 浏览器已启用远程调试功能。如果 Chrome DevTools MCP 可用,则继续。如果不可用,尝试通过 curl 进行抓取作为后备方案。

对于本地文件或粘贴的 HTML:无需 Chrome 浏览器。直接读取内容。

如果用户最后希望创建 PR,请检查 GITHUB_TOKEN。记录其存在,但不要阻塞。仅输出模式无需 Token 即可运行。

质控检查:输入源是什么?是否可访问?说明你将使用哪种抓取方法。


步骤 2:抓取页面并提取内容

使用可用的方法连接到页面。

使用 Chrome DevTools MCP:

  • 导航到 URL
  • 等待页面完全加载(包括 JavaScript 渲染的内容)
  • 提取完整的页面文本内容和可见的 HTML 结构
  • 捕获:页面标题、meta 描述、标题(h1-h6)、所有正文文本、图像 URL 和 alt 文本、链接、任何可见的价格、日期、作者姓名、公司名称、地址、电话号码、FAQ 部分、编号步骤、评论和评分

使用 curl 后备方案:

  • 使用浏览器 User-Agent 进行抓取
  • 解析 HTML 以获取上述相同内容

使用本地文件或粘贴的 HTML:

  • 直接读取内容
  • 解析相同字段

质控检查:列出你找到的关键内容。页面是关于什么的?存在哪些结构化内容(FAQ 对、产品定价、文章署名、地址、步骤)?


步骤 3:检测所需的模式类型

分析提取的内容。一个页面通常需要多种模式类型。

检测规则:

页面类型所需内容信号要生成的 Schema 类型
FAQ 页面或 FAQ 部分3 个或更多问答对FAQPage
博客文章或文章标题、作者、发布日期、文章正文Article 或 BlogPosting
公司或关于页面公司名称、描述、Logo 或社交链接Organization
产品页面产品名称、价格、库存情况Product
首页网站名称、搜索功能WebSite
操作指南或教程带描述的编号步骤HowTo
带有面包屑导航的页面页面上可见的面包屑轨迹BreadcrumbList
软件工具或应用程序应用名称、操作系统、价格、下载链接SoftwareApplication
本地商家实体地址、电话、营业时间LocalBusiness

如果页面满足多个条件,则应用多种类型。例如,一篇博客文章页面通常需要 Article 和 BreadcrumbList。关于页面通常需要 Organization 和 WebSite(如果是首页)。

说明你将生成的 Schema 类型及其原因。

质控检查:检测到的类型是否与页面内容匹配?是否有足够的数据来填充每种类型的必填字段?


步骤 4:阅读规范和模板

阅读 references/json-ld-spec.md 以获取每种检测到的 Schema 类型的必填字段和推荐字段。

阅读 references/output-template.md 以获取每种类型要使用的确切 JSON 结构。

对于你将生成的每种 Schema 类型,请记录:

  • 页面内容中存在哪些必填字段
  • 哪些必填字段缺失(你将标记这些字段,而不是编造它们)
  • 存在哪些值得包含的推荐字段

步骤 5:生成 JSON-LD

每种 Schema 类型生成一个 <script type="application/ld+json"> 代码块。

规则:

  • 每个值必须来自步骤 2 中提取的页面内容
  • 使用 references/output-template.md 中的模板作为结构
  • 对于缺失的必填字段:在 JSON 内部添加注释,形式为 "MISSING_fieldName": "未在页面中找到",以便用户知道要添加什么
  • 对于缺失的推荐字段:静默忽略它们
  • 所有日期和持续时间使用 ISO 8601 格式
  • 所有图像、页面和网站引用使用完整的绝对 URL
  • 正确嵌套对象(作者作为 Person 对象,发布者作为 Organization 对象等)
  • 如果适用多种 Schema 类型,则每种类型输出一个单独的脚本块

不要输出通用的占位符值,如“公司名称在此处”或“输入描述”。要么使用真实值,要么将其标记为 MISSING。

质控检查:对于生成的每个代码块,验证:每个值是否都可追溯到页面内容?所有必填字段是否要么已填充,要么已明确标记为 MISSING?


步骤 6:验证输出

在呈现输出之前,对每个 JSON-LD 代码块执行以下检查清单:

  • 有效的 JSON 语法(无尾随逗号、括号平衡)
  • @context 为 "https://schema.org"
  • @type 与预期的 Schema 类型匹配
  • 该类型的所有必填字段要么已填充,要么已标记为 MISSING
  • 所有 URL 都是绝对路径(以 https:// 开头)
  • 所有日期使用 ISO 8601 格式
  • 无编造的数据:每个值都追溯到页面内容
  • 输出中无占位符字符串

在呈现之前修复任何语法错误。说明哪些必填字段已找到,哪些已标记为 MISSING。


步骤 7:输出与部署

清晰地呈现输出。

对于每个 Schema 代码块:

  1. 说明 Schema 类型及其所属页面
  2. 在代码块中显示完整的 <script type="application/ld+json"> 代码块
  3. 说明在 HTML 中的放置位置(在 <head> 内,</head> 之前)
  4. 列出用户需要手动填写的任何 MISSING 字段

然后询问:“我是否应该打开一个 GitHub PR 将此注入您的代码库,还是您想手动添加?”

如果用户确认创建 PR:

  • 检查环境中的 GITHUB_TOKEN 和 GITHUB_REPO
  • 检测框架(Next.js、Astro、纯 HTML 等)以了解正确的注入点
  • 将脚本块插入框架的相应位置
  • 通过 GitHub CLI 或 API 打开一个 PR

框架特定的注入点:

框架注入位置
Next.js(App Router)在页面组件内添加 <Script type="application/ld+json">,或对于 Pages Router 使用 next/head
Astro在页面的布局或 front matter 中的 <head> 内添加
HTML在 <head> 内 </head> 之前添加
Jekyll添加到 _includes/head.html 或使用自定义 head 包含的页面的 front matter 中
Nuxt通过 useHead() 组合式函数或 <Head> 组件添加

质控检查:输出是否放置正确?所有 MISSING 字段是否已清晰传达给用户?


良好的输出示例

  • 每个 JSON-LD 值直接源自可见的页面内容
  • 必填字段已填充或明确标记为 MISSING 并带有清晰标签
  • JSON 语法有效(任何 JSON 验证器都能解析)
  • URL 是绝对路径且正确
  • 日期使用 ISO 8601 格式
  • 放置说明与用户实际的框架匹配
  • 用户确切知道下一步该做什么

糟糕的输出示例

  • 编造的、页面不存在的值(“Best Company Inc.”、通用描述)
  • 输出中留有占位符字符串
  • 使用相对 URL 而非绝对 URL
  • 缺少 @context 或 @type
  • JSON 无效(尾随逗号、括号不平衡)
  • 针对页面内容使用了错误的 Schema 类型
  • 静默忽略必填字段而未标记

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Varnan-Tech/opendirectory

Use when the user asks to generate a blog cover image, thumbnail, or article header. Automatically uses modern typography, brand logos, and Google Search grounding to create beautiful 16:9 images with Gemini 3.1 Flash Image Preview.

Varnan-Tech/opendirectory

World-class brand strategist and naming expert. Uses an interrogation-led discovery phase to extract your brand's DNA, then applies scientific naming frameworks (Phonosemantics) and automated multi-TLD domain checking.

Varnan-Tech/opendirectory

Use when the user asks to generate or update a project's CLAUDE or AGENTS context file from a codebase scan. Writes a focused file under 100 lines containing only the non-obvious build commands, conventions, and gotchas Claude Code needs.

Varnan-Tech/opendirectory

Use when the user wants to verify cold emails, enrich a lead list, or autonomously guess email addresses from a CSV using ValidEmail.co or the open-source Reacher engine.

Varnan-Tech/opendirectory

Competitive intelligence orchestrator tracking companies across 8+ platforms (GitHub, Twitter, Reddit, HN, PH, YC Jobs) with heat scores and AI briefings.

Varnan-Tech/opendirectory

Give it your product URL or description. It finds your top 5 competitors, runs three-track PR research across all of them (editorial, podcasts, communities), identifies which channels appear most frequently, looks up the journalist or host for each, and returns a tiered outreach list with story angles and ready-to-send cold pitch drafts tailored to your product. Use when asked to find PR opportunities, discover where competitors got featured, build a media outreach list, find which journalists cover my space, or get pitch templates for press coverage.

Varnan-Tech/opendirectory

Generate high-converting, deep-dive growth case studies in MDX format. Use this skill when asked to write a case study or blog post about a company's growth, tech stack, or product-led strategy. It handles the full pipeline (researching the company via Tavily, generating a 16:9 cover image, quality checking the draft, uploading assets to cloud storage, and pushing directly to the target repository).

Varnan-Tech/opendirectory

Scans your project for outdated npm, pip, Cargo, Go, or Ruby packages. Runs a CVE security audit. Fetches changelogs, summarizes breaking changes with Gemini, and opens one PR per risk group (patch, minor, major). Includes Diagnosis Mode for install conflicts. Use when asked to update dependencies, check for outdated packages, open dependency PRs, scan for package updates, audit for CVEs, or flag breaking changes in upgrades. Trigger when a user says "check for outdated packages", "update my dependencies", "open PRs for dependency updates", "scan for CVEs", or "which packages need upgrading".

Varnan-Tech/opendirectory

Generates and updates README.md and API reference docs by reading your codebase's functions, routes, types, schemas, and architecture. Uses graphify to build a knowledge graph first, then writes accurate docs from it. Use when asked to write docs, generate a README, document an API, update stale docs, create an API reference from code, add an architecture section, or document a project in any language. Trigger when a user says their docs are missing, outdated, or wants to document their codebase without writing it manually.

Varnan-Tech/opendirectory

Evaluates expired domain candidates against a target niche, scores them by topical relevance, historical activity level, and history cleanliness, then outputs a ranked shortlist with explainable reasoning and risk flags.

Varnan-Tech/opendirectory

Brutally honest developer-experience audit for a GitHub repo. Scores 10 DX dimensions (time-to-first-success, README clarity, visual proof, install, quick-start, docs, examples, community, trust, marketing), writes a shareable roast in the requested tone (brutal/honest/kind), produces a prioritized action plan ranked by impact × effort, and sketches an ideal README. Trigger when user says "roast my repo", "audit my README", "dx audit", "developer experience review", "score my GitHub project", "before launch checklist", or "make my repo shareable".

Varnan-Tech/opendirectory

Drafts and designs a complete HTML email newsletter from a topic or content brief. Outputs paste-ready HTML for Loops, Mailchimp, Beehiiv, Resend, or any standard email platform. Includes subject line options and plain-text fallback. Trigger when a user says "write a newsletter", "draft an email newsletter", "create an HTML email", "design an email for my subscribers", or "write a newsletter about [topic]".

Varnan-Tech/opendirectory

Takes a GitHub PR URL or the current branch and writes a plain-English explanation of what it does and why, then posts it as a PR comment. Use when asked to explain a PR, summarize a pull request, write a plain-English description of a PR, add a summary comment to a PR, or understand what a PR changes. Trigger when a user says "explain this PR", "summarize this pull request", "what does this PR do", "add a comment explaining the PR", or shares a GitHub PR URL and asks what it does.

Varnan-Tech/opendirectory

Audit how often LLMs recommend your brand vs competitors and generate a GEO action plan.

Varnan-Tech/opendirectory

Takes a competitor's public GitHub repo URL, fetches their open issues via the GitHub REST API, filters noise locally, clusters issues into 6 demand categories, computes a demand score per issue and per cluster, and outputs a ranked demand gap report with a GTM messaging brief. Use when asked to scan a competitor's GitHub issues, find what their users are begging for, turn GitHub complaints into product positioning, identify competitor feature gaps, or generate messaging from real user demand. Trigger when a user says "scan competitor issues", "what are users asking for on X repo", "find demand gaps in Y", "turn GitHub issues into messaging", or "what should I build based on competitor complaints".

Varnan-Tech/opendirectory

Find recurring confusion in your repo's GitHub Discussions, rank it by urgency, and draft the actual docs fixes and content angles — with verbatim community quotes and source links as evidence.

Varnan-Tech/opendirectory

SEO keyword research workflow for blog generation using Google Trends data. Use when writing blog posts, planning content calendars, or optimizing articles for search engines. Finds breakout keywords, builds content structure, and generates SEO-optimized blog outlines targeting tech and developer audiences.

Varnan-Tech/opendirectory

Generates a professionally designed case study PDF for B2B SaaS sales and marketing. Supports 7 page layouts, 9 style presets, 1-4 page output. Trigger when user says "create a case study", "write a customer story", "make a case study PDF", "design a success story", "turn this customer win into a PDF".

Varnan-Tech/opendirectory

Generates data visualization charts (bar, line, area, pie, doughnut, scatter, radar, treemap) as PNG using Apache ECharts v6. 1080×1080px default, 5 style presets, highlight annotations. Trigger when user says "create a chart", "visualize data", "make a bar chart", "line graph", "pie chart", "data visualization", "chart this data", "plot", "graph", or "visualize these numbers".

Varnan-Tech/opendirectory

Fetches low-star App Store and Google Play reviews, clusters them into broken-promise patterns, and generates a ranked copy brief with positioning opportunities.

相关技能