Shopifyストアの agents.md.liquid でAI向け情報をカスタマイズ
2026年5月29日、Shopify は /agents.md、/llms.txt、/llms-full.txt のカスタマイズ機能をリリースしました。これらは AI エージェント(ChatGPT、Claude、Copilot 等)がストア情報を取得するための「指示書」です。
何もしなくても Shopify が自動生成してくれますが、テーマの Liquid テンプレートで完全にカスタマイズできるようになりました。
テンプレートの読み込み順序
3つのファイルはそれぞれ専用テンプレートを持てますが、なければ agents.md.liquid にフォールバックします。
/agents.md → agents.md.liquid → Shopify自動生成 /llms.txt → llms.txt.liquid → agents.md.liquid → Shopify自動生成 /llms-full.txt → llms-full.txt.liquid → agents.md.liquid → Shopify自動生成
つまり agents.md.liquid を1つ作れば、3ファイル全てに反映されます。個別に内容を分けたいときだけ専用テンプレートを追加します。
デフォルトで何が配信されるか
何もカスタマイズしなくても、Shopify は以下のような情報を自動生成します。
# Agent Instructions — HOGEHOGE This document describes how AI agents can interact with the online store at https://hogehoge.jp. ## Commerce Protocol (UCP) For AI agents that support commerce protocols, this store uses Unified Commerce Protocol (UCP). - Discovery: GET https://hogehoge.jp/.well-known/ucp - MCP endpoint: POST https://hogehoge.jp/api/ucp/mcp ## Agent Flow 1. Discover → 2. Search → 3. Cart → 4. Checkout → 5. Complete ## Read-Only Browsing - /collections/all — 全商品 - /products/{handle}.json — 商品詳細 - /policies/shipping-policy — 配送ポリシー ...
Shop スキル(shop.app/SKILL.md)への誘導、UCP エンドポイント、典型的なエージェントフロー、読み取り専用のブラウジング情報が含まれます。何もしなくてもこれだけ出るのがポイントです。
カスタマイズが必要なケース
ほとんどのストアはカスタマイズ不要です。Shopify のデフォルト出力で十分機能します。
カスタマイズするのは以下のようなケースです。
- 独自の営業情報(営業時間、サポート言語、特記事項)を追加したい
- 特定のコレクションや商品を AI に優先的に推薦させたい
- 短縮版と詳細版を明確に分けたい
カスタマイズ方法
Step 1: テンプレートを作成
テーマ編集画面で templates/agents.md.liquid を新規作成します。
Step 2: agents オブジェクトを使う
Liquid の agents オブジェクトで動的に情報を出力できます。
| プロパティ | 内容 |
|---|---|
agents.store_name |
ストア名 |
agents.store_url |
ベアドメインの完全URL |
agents.ucp_discovery_url |
/.well-known/ucp |
agents.mcp_endpoint_url |
/api/ucp/mcp |
agents.ucp_versions |
サポート中のUCPバージョン(配列) |
agents.currency |
主要通貨コード |
agents.sitemap_url |
サイトマップURL |
具体的なコード例
基本的なカスタマイズ(agents.md.liquid)
# Agent Instructions — {{ agents.store_name }} This document describes how AI agents can interact with the online store at {{ agents.store_url }}. ## Commerce Protocol (UCP) - Discovery: `GET {{ agents.ucp_discovery_url }}` - MCP endpoint: `POST {{ agents.mcp_endpoint_url }}` ### Supported UCP versions {% for version in agents.ucp_versions %} - {{ version }}{% if forloop.first %} (latest stable){% endif %} {% endfor %} ## 当店独自の情報 - 営業時間: 10:00-18:00(土日祝休み) - サポート言語: 日本語、英語 - 特記事項: ギフトラッピング対応、法人割引あり
短縮版を分ける(llms.txt.liquid)
# {{ agents.store_name }}
> エージェント向けサマリー。詳細は {{ agents.store_url }}/agents.md を参照。
- UCP discovery: {{ agents.ucp_discovery_url }}
- MCP endpoint: {{ agents.mcp_endpoint_url }}
- サイトマップ: {{ agents.sitemap_url }}
詳細版を分ける(llms-full.txt.liquid)
# {{ agents.store_name }} — Full Agent Reference {{ agents.store_url }}/agents.md の内容に加えて、 以下の補足情報を提供します。 ## Commerce Protocol (UCP) - Discovery: {{ agents.ucp_discovery_url }} - MCP endpoint: {{ agents.mcp_endpoint_url }} ## 人気カテゴリー {% for collection in collections limit:5 %} - [{{ collection.title }}]({{ shop.url }}{{ collection.url }}) {% endfor %} ## 最近のブログ記事 {% for article in blogs.news.articles limit:3 %} - [{{ article.title }}]({{ shop.url }}{{ article.url }}) {% endfor %}
注意点
- 連絡先メールや電話番号など、スクレイピングされたくない情報は出力しない
- URL はハードコーディングせず
agentsオブジェクトで動的生成(将来の変更に対応) - テスト時は curl で直接確認:
curl https://your-store.com/agents.md
まとめ
- 99% のストアは何もしなくて OK(Shopify のデフォルトが優秀)
- カスタマイズしたい場合は
agents.md.liquidだけ編集すれば 3 ファイル全てに反映 - 短縮版・詳細版を分けたい場合のみ
llms.txt.liquid/llms-full.txt.liquidを追加