mcpField
S
schema-markup

schema-markup

github.com/openclaudiaマーケティング・グロース722447 回インストール1 日前に更新
リポジトリ

schema-markup について

schema-markup は、Schema.org の JSON-LD を生成するスキルです。サイト運営者や開発者向けに、適切な型や必須項目を整理し、マークアップの検証とページへの実装を支援します。

主な機能

  1. 01記載された 8 種類の型に対応
  2. 02@graph で複数の型を統合
  3. 03ページに必要な情報を収集
  4. 04Google の要件に沿って確認
  5. 05Next.js と HTML の実装手順
  6. 06検証ツールとよくある誤りを紹介

活用シーン

  1. 01記事ページへの構造化データ追加
  2. 02商品や地域ビジネスページのマークアップ
  3. 03FAQ、HowTo、パンくずデータの作成
  4. 04公開前の JSON-LD の確認

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/openclaudia/openclaudia-skills --skill schema-markup

インストール後、Claude Code で/schema-markupを入力して読み込まれたか確認します。

詳細

Schema Markup Generator Skill

Schema.org の構造化データと、Google のリッチリザルト要件に精通しています。Google のリッチリザルトの対象となる可能性を最大限に高める、有効で完全な JSON-LD マークアップを生成します。

サポートする Schema タイプ

このスキルでは、以下の Schema タイプをサポートしています。ユーザーが Schema を求めた場合は、ページのコンテンツに基づいて適切なタイプを判断してください。

1. Article / BlogPosting / NewsArticle

用途: ブログ投稿、ニュース記事、編集コンテンツ
リッチリザルト: 記事カルーセル、検索結果の見出し

{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "Your Article Title (max 110 characters)",
  "description": "Brief description of the article (max 160 characters)",
  "image": [
    "https://example.com/image-16x9.jpg",
    "https://example.com/image-4x3.jpg",
    "https://example.com/image-1x1.jpg"
  ],
  "datePublished": "2025-01-15T08:00:00+00:00",
  "dateModified": "2025-01-20T10:30:00+00:00",
  "author": [{
    "@type": "Person",
    "name": "Author Name",
    "url": "https://example.com/author/name",
    "jobTitle": "Senior Editor",
    "sameAs": [
      "https://twitter.com/authorhandle",
      "https://linkedin.com/in/authorname"
    ]
  }],
  "publisher": {
    "@type": "Organization",
    "name": "Publisher Name",
    "logo": {
      "@type": "ImageObject",
      "url": "https://example.com/logo.png",
      "width": 600,
      "height": 60
    }
  },
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://example.com/article-url"
  },
  "wordCount": 2500,
  "articleSection": "Technology",
  "keywords": ["keyword1", "keyword2", "keyword3"],
  "isAccessibleForFree": true
}

Google の要件:

  • headline は必須です(最大 110 文字)
  • image は必須です(アスペクト比 16:9、4:3、1:1 の画像を 3 点指定し、それぞれ幅を 696px 超にします)
  • datePublished は必須です(ISO 8601 形式)
  • author.name は必須です
  • NewsArticle の場合、該当する場合は dateline も追加します
  • BlogPosting の場合、@type を "BlogPosting" に変更します

2. Product

用途: 商品ページ、EC 商品リスト
リッチリザルト: 価格、在庫状況、レビューを含む商品スニペット

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Product Name",
  "description": "Product description",
  "image": [
    "https://example.com/product-1.jpg",
    "https://example.com/product-2.jpg"
  ],
  "sku": "SKU-12345",
  "mpn": "MPN-67890",
  "gtin13": "0123456789012",
  "brand": {
    "@type": "Brand",
    "name": "Brand Name"
  },
  "offers": {
    "@type": "Offer",
    "url": "https://example.com/product",
    "priceCurrency": "USD",
    "price": "99.99",
    "priceValidUntil": "2025-12-31",
    "availability": "https://schema.org/InStock",
    "itemCondition": "https://schema.org/NewCondition",
    "seller": {
      "@type": "Organization",
      "name": "Seller Name"
    },
    "shippingDetails": {
      "@type": "OfferShippingDetails",
      "shippingRate": {
        "@type": "MonetaryAmount",
        "value": "0",
        "currency": "USD"
      },
      "deliveryTime": {
        "@type": "ShippingDeliveryTime",
        "handlingTime": {
          "@type": "QuantitativeValue",
          "minValue": 0,
          "maxValue": 1,
          "unitCode": "DAY"
        },
        "transitTime": {
          "@type": "QuantitativeValue",
          "minValue": 1,
          "maxValue": 5,
          "unitCode": "DAY"
        }
      },
      "shippingDestination": {
        "@type": "DefinedRegion",
        "addressCountry": "US"
      }
    },
    "hasMerchantReturnPolicy": {
      "@type": "MerchantReturnPolicy",
      "applicableCountry": "US",
      "returnPolicyCategory": "https://schema.org/MerchantReturnFiniteReturnWindow",
      "merchantReturnDays": 30,
      "returnMethod": "https://schema.org/ReturnByMail",
      "returnFees": "https://schema.org/FreeReturn"
    }
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.5",
    "bestRating": "5",
    "ratingCount": "142"
  },
  "review": [{
    "@type": "Review",
    "author": {
      "@type": "Person",
      "name": "Reviewer Name"
    },
    "datePublished": "2025-01-10",
    "reviewBody": "Review text here",
    "reviewRating": {
      "@type": "Rating",
      "ratingValue": "5",
      "bestRating": "5"
    }
  }]
}

Google の要件:

  • name は必須です
  • offers、review、aggregateRating のいずれか 1 つ以上が必須です
  • offers がある場合、offers.price と offers.priceCurrency は必須です
  • offers.availability には Schema.org の列挙値を使用する必要があります
  • 2024 年現在、販売者リスティングには shippingDetails と hasMerchantReturnPolicy の指定が推奨されています

3. FAQPage

用途: FAQ セクション、Q&A ページ
リッチリザルト: 検索結果に表示される展開可能な FAQ

{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is the first question?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "<p>The answer with <strong>HTML formatting</strong> allowed. You can include <a href=\"https://example.com\">links</a>.</p>"
      }
    },
    {
      "@type": "Question",
      "name": "What is the second question?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Plain text answers also work."
      }
    }
  ]
}

Google の要件:

  • 各 Question には、acceptedAnswer を 1 つだけ指定する必要があります
  • 回答の text には、HTML を含めることができます:<h2> から <h6>、<br>、<ol>、<ul>、<li>、<a>、<p>、<b>、<strong>、<i>、<em>
  • ページ上で表示されている必要があります(適切に実装されていないタブやアコーディオンの背後に隠してはいけません)
  • Google は 1 ページにつき最大 3 件の FAQ リッチリザルトを表示する場合があります
  • 広告目的では使用しないでください

4. HowTo

用途: チュートリアルページ、手順ガイド、DIY の手順
リッチリザルト: 検索結果に表示される手順

{
  "@context": "https://schema.org",
  "@type": "HowTo",
  "name": "How to Do Something",
  "description": "Brief description of the task",
  "image": {
    "@type": "ImageObject",
    "url": "https://example.com/howto-main.jpg",
    "height": "406",
    "width": "305"
  },
  "totalTime": "PT30M",
  "estimatedCost": {
    "@type": "MonetaryAmount",
    "currency": "USD",
    "value": "20"
  },
  "supply": [
    {
      "@type": "HowToSupply",
      "name": "Supply item 1"
    },
    {
      "@type": "HowToSupply",
      "name": "Supply item 2"
    }
  ],
  "tool": [
    {
      "@type": "HowToTool",
      "name": "Tool 1"
    }
  ],
  "step": [
    {
      "@type": "HowToStep",
      "name": "Step 1 Title",
      "text": "Detailed instructions for step 1.",
      "url": "https://example.com/howto#step1",
      "image": "https://example.com/step1.jpg"
    },
    {
      "@type": "HowToStep",
      "name": "Step 2 Title",
      "text": "Detailed instructions for step 2.",
      "url": "https://example.com/howto#step2",
      "image": "https://example.com/step2.jpg"
    }
  ]
}

Google の要件:

  • name は必須です
  • step 配列は必須で、少なくとも 1 つのステップが必要です
  • 各ステップには、text または HowToDirection/HowToTip を含む itemListElement のいずれかが必要です
  • totalTime には ISO 8601 の期間形式を使用します(PT1H30M = 1 時間 30 分)
  • レシピには HowTo を使用しないでください(代わりに Recipe Schema を使用します)

5. Organization

用途: ホームページ、会社概要ページ、企業情報
リッチリザルト: ナレッジパネル、検索結果のロゴ

{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Company Name",
  "alternateName": "Company Abbreviation",
  "url": "https://example.com",
  "logo": {
    "@type": "ImageObject",
    "url": "https://example.com/logo.png",
    "width": 512,
    "height": 512
  },
  "description": "Company description",
  "foundingDate": "2020-01-01",
  "founder": {
    "@type": "Person",
    "name": "Founder Name"
  },
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Main St",
    "addressLocality": "San Francisco",
    "addressRegion": "CA",
    "postalCode": "94102",
    "addressCountry": "US"
  },
  "contactPoint": [{
    "@type": "ContactPoint",
    "telephone": "+1-555-555-5555",
    "contactType": "customer service",
    "areaServed": "US",
    "availableLanguage": "English"
  }],
  "sameAs": [
    "https://twitter.com/company",
    "https://linkedin.com/company/company",
    "https://facebook.com/company",
    "https://github.com/company"
  ],
  "numberOfEmployees": {
    "@type": "QuantitativeValue",
    "minValue": 10,
    "maxValue": 50
  }
}

6. LocalBusiness

用途: 地域のビジネスページ、Google ビジネス プロフィールのサポート
リッチリザルト: 地域のビジネスパネル、地図検索結果

{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "@id": "https://example.com/#business",
  "name": "Business Name",
  "description": "Business description",
  "url": "https://example.com",
  "telephone": "+1-555-555-5555",
  "email": "[email protected]",
  "image": "https://example.com/storefront.jpg",
  "logo": "https://example.com/logo.png",
  "priceRange": "$$",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Main St",
    "addressLocality": "San Francisco",
    "addressRegion": "CA",
    "postalCode": "94102",
    "addressCountry": "US"
  },
  "geo": {
    "@type": "GeoCoordinates",
    "latitude": "37.7749",
    "longitude": "-122.4194"
  },
  "openingHoursSpecification": [
    {
      "@type": "OpeningHoursSpecification",
      "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
      "opens": "09:00",
      "closes": "17:00"
    },
    {
      "@type": "OpeningHoursSpecification",
      "dayOfWeek": "Saturday",
      "opens": "10:00",
      "closes": "14:00"
    }
  ],
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.7",
    "bestRating": "5",
    "ratingCount": "312"
  },
  "areaServed": {
    "@type": "City",
    "name": "San Francisco"
  },
  "hasMap": "https://maps.google.com/?cid=123456789"
}

Google の要件:

  • name と address は必須です
  • 可能な場合は、具体的なサブタイプを使用します:Restaurant、Dentist、LegalService、RealEstateAgent など
  • geo 座標は実際の事業所の場所と正確に一致している必要があります
  • openingHoursSpecification には実際の営業時間を指定する必要があります

7. BreadcrumbList

用途: パンくずナビゲーションがあるすべてのページ
リッチリザルト: 検索結果に表示されるパンくずリスト

{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://example.com"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Category",
      "item": "https://example.com/category"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "Current Page Title"
    }
  ]
}

Google の要件:

  • position は 1 から始まる連続した番号にする必要があります
  • 最後の項目には item を指定しないでください(現在のページであるため)
  • ページ上に表示されるパンくずリストと一致する必要があります

8. Review / AggregateRating

用途: レビューページ、商品レビュー、サービスレビュー
リッチリザルト: 検索結果の星評価

{
  "@context": "https://schema.org",
  "@type": "Review",
  "name": "Review Title",
  "reviewBody": "Full review text...",
  "datePublished": "2025-01-15",
  "author": {
    "@type": "Person",
    "name": "Reviewer Name"
  },
  "itemReviewed": {
    "@type": "Product",
    "name": "Product Being Reviewed",
    "image": "https://example.com/product.jpg"
  },
  "reviewRating": {
    "@type": "Rating",
    "ratingValue": "4",
    "bestRating": "5",
    "worstRating": "1"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Review Site Name"
  }
}

Google の要件:

  • author は必須です(有効な Person または Organization である必要があります)
  • itemReviewed は必須です
  • reviewRating の指定が推奨されています
  • 自社の商品をレビューするなどの自薦レビューはガイドライン違反です

複数の Schema を使うページ

ほとんどのページでは、複数の Schema タイプが必要です。@graph を使って組み合わせます:

{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://example.com/#organization",
      "name": "Company Name",
      "url": "https://example.com",
      "logo": "https://example.com/logo.png"
    },
    {
      "@type": "WebSite",
      "@id": "https://example.com/#website",
      "url": "https://example.com",
      "name": "Site Name",
      "publisher": { "@id": "https://example.com/#organization" }
    },
    {
      "@type": "WebPage",
      "@id": "https://example.com/page/#webpage",
      "url": "https://example.com/page/",
      "name": "Page Title",
      "isPartOf": { "@id": "https://example.com/#website" }
    },
    {
      "@type": "Article",
      "mainEntityOfPage": { "@id": "https://example.com/page/#webpage" },
      "headline": "Article Title",
      "author": { "@type": "Person", "name": "Author" },
      "publisher": { "@id": "https://example.com/#organization" },
      "datePublished": "2025-01-15"
    },
    {
      "@type": "BreadcrumbList",
      "itemListElement": [
        { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://example.com" },
        { "@type": "ListItem", "position": 2, "name": "Blog", "item": "https://example.com/blog" },
        { "@type": "ListItem", "position": 3, "name": "Article Title" }
      ]
    }
  ]
}

生成プロセス

ユーザーからスキーママークアップを求められた場合:

  1. ページの種類を特定する - どのようなページ向けかを尋ねます(またはコンテキストから推測します)
  2. 情報を収集する - 必要なフィールドについて尋ねるか、情報を収集します。ユーザーが URL を提供した場合は、取得してデータを抽出します。
  3. スキーマタイプを選択する - 該当するスキーマをすべて選択します(ほとんどのページでは 2〜4 種類が必要です)
  4. JSON-LD を生成する - 完全で有効なマークアップを作成します
  5. 検証する - 各タイプについて Google の要件に照らして確認します
  6. 実装手順を提示する - どこに配置すればよいかをユーザーに正確に伝えます

実装手順

Next.js App Router の場合:

// In your page component or layout
export default function Page() {
  const jsonLd = {/* generated schema */};

  return (
    <>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
      />
      {/* page content */}
    </>
  );
}

next/head を使った Next.js(Pages Router) の場合:

import Head from 'next/head';

export default function Page() {
  const jsonLd = {/* generated schema */};

  return (
    <>
      <Head>
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
        />
      </Head>
      {/* page content */}
    </>
  );
}

プレーンな HTML の場合:

<head>
  <script type="application/ld+json">
  {/* generated schema */}
  </script>
</head>

検証

マークアップを生成した後、次のツールを使って検証するようユーザーに案内します:

  1. Google Rich Results Test: https://search.google.com/test/rich-results
  2. Schema.org Validator: https://validator.schema.org/

よくある間違い

  • ページに表示されていないコンテンツにスキーマを追加しない
  • 自社のビジネスについての自己推薦レビューに Review スキーマを使用しない
  • ペイウォールの背後にあるコンテンツを isAccessibleForFree: true としてマークアップしない
  • 本番環境のスキーマに偽のデータやプレースホルダーデータを使用しない
  • 実際のユーザーレビューがない場合は AggregateRating を追加しない
  • 常に絶対 URL を使用し、相対 URL は使用しない
  • 常に ISO 8601 の日付形式を使用する
  • priceValidUntil には未来の日付を指定する
  • availability には Schema.org の完全な URL を使用する(例:https://schema.org/InStock)
  • 画像の URL はクロールおよびインデックス登録が可能でなければならない

コメント