Before we start: what you are changing
A Shopify theme controls more than the pages a shopper sees. It can also render public machine-readable files. In this Guide, you are adding one theme template that publishes a plain-text briefing at yourdomain.com/agents.md.
Shoppers will not see a new page or menu item. AI tools and shopping agents can request the file directly. The change applies when the theme containing the template is the published theme. Saving it in an unpublished preview theme does not change the live store.
If you are not a developer. You can still own most of this work. Complete the brand interview, approve the facts, and use the developer handoff in Step 7. A theme developer or Shopify partner can publish and test the file.
Plain-English glossary
| Term | What it means here | Why you need to know it |
|---|---|---|
| Published / live theme | The theme currently serving your storefront | Only its agents.md.liquid controls the live public file |
| Theme template | A file Shopify renders when a specific storefront URL is requested | agents.md.liquid is the template you will add |
| Liquid | Shopify's template language. Double braces print live store values. | It prevents domains, currency, and commerce endpoints from going stale |
| Markdown | Plain text using # headings, bullets, and links | The rendered file is readable by people and machines without an HTML page |
| Primary domain | The main public store address, without /en, /fr, or another locale folder | Shopify serves agents.md only at that bare domain |
| Canonical | The main version Shopify treats as authoritative | /agents.md is canonical; the llms URLs mirror it by default |
| UCP | Universal Commerce Protocol: the store's machine-readable commerce discovery layer | Agents use it to understand supported buying capabilities |
| MCP | Model Context Protocol: an endpoint through which an agent can discover available tools | Removing this endpoint can break useful agent interaction |
| agents object | Shopify-provided Liquid values such as store URL, currency, sitemap, UCP, and MCP | Use these values instead of typing configuration by hand |
| Ground truth | Approved facts that match the live catalog, policies, and brand | The file should point agents at truth, not create a second version of it |
What you need before you begin
| Need | Why | If you do not have it |
|---|---|---|
| Your primary domain | You need to inspect the three public files | Ask the store owner which domain customers use |
| The name of the published theme | The template must reach the live theme | Shopify Admin → Online Store → Themes; the published theme is labeled Current theme |
| Theme code access or a developer contact | Someone must create agents.md.liquid | Complete the copy and use the Step 7 handoff |
| Live shipping, returns, warranty, and contact URLs | Agents should receive current facts and canonical sources | Do not publish until the policy owner confirms them |
| One brand approver and one policy approver | Voice and hard facts need different owners | Name them in the ticket before drafting |
| A safe rollback | A custom file replaces Shopify's managed default | Save the baseline output and keep the change in version control |
Choose your path. Operator path: Steps 1–4, then hand off Step 7. Developer path: complete all steps. Both paths finish with the live URL checks in Step 8.
Start with the part most guides skip: you may not need this
Shopify manages /agents.md for every store. Shopify's own recommendation is to keep that managed file unless you have advanced instructions it does not cover. I agree.
Customize it when the default cannot explain your real category, buyer fit, canonical resources, policy constraints, or what an agent must not invent. Do not customize it just to say you have one.
The replacement rule. Adding templates/agents.md.liquid replaces Shopify's managed document. It does not merge your copy into the default. If you drop the dynamic commerce fields, they are gone from the rendered file.
Keep Shopify's default when
- The generated file is accurate and your store does not need special instructions.
- You do not have an owner to review brand and policy facts when they change.
- You only want to add generic copy such as “great products and service.”
Customize agents.md when
- Your offer, buyer fit, restrictions, or canonical resources need explanation.
- AI answers repeat outdated or invented brand facts you can correct at the source.
- A named owner can keep public instructions aligned with policies and the catalog.
What these three URLs are actually for
Two conventions collide here. llms.txt started as a general “curated map for language models” idea. Shopify treats agents.md as the commerce-facing canonical document: how an agent discovers and does business with the store.
| File | Job | Operator implication |
|---|---|---|
| /agents.md | Canonical briefing for shopping agents: who you are + how to transact | This is the file I customize when brand instructions matter |
| /llms.txt | Compatibility URL that mirrors agents.md by default | Usually do not create a separate template |
| /llms-full.txt | Compatibility URL that also mirrors agents.md by default | Only split when you have a documented advanced requirement |
One good file usually covers all three. Add only agents.md.liquid and Shopify serves it at all three paths. Separate llms templates create three documents you now have to keep accurate.
| Storefront URL | Shopify checks in this order |
|---|---|
| /agents.md | agents.md.liquid → managed default |
| /llms.txt | llms.txt.liquid → agents.md.liquid → managed default |
| /llms-full.txt | llms-full.txt.liquid → agents.md.liquid → managed default |
Who does what
Most failures happen when marketing waits for engineering to invent the brand voice, or engineering publishes without policy owners. Split the work.
| Role | Owns | Hands off when |
|---|---|---|
| Marketing / brand / ops | Interview answers, hard facts, “must not invent,” canonical links, final read-aloud | Copy is approved and ready to paste into the template |
| Theme developer / partner | Create agents.md.liquid, keep agents object fields, publish to live theme, verify URLs | Rendered file matches approved copy and dynamic fields survive |
| Manager / decision owner | Confirms the company wants brand-specific AI instructions and who maintains them | Owner + review cadence are named |
Step 1 · Capture the baseline before you edit
Do this before anyone opens Theme Code Editor.
| Action | What to write down |
|---|---|
| Open /agents.md on the primary domain | Paste the full current output into your ticket |
| Open /llms.txt and /llms-full.txt | Note whether all three match today |
| Highlight machine fields | UCP discovery URL, MCP endpoint, UCP versions, sitemap, store URL, currency |
| Check for an old override | App proxy, redirect, or hosted file that used to fake llms.txt. Shopify owns these routes now. |
| Confirm the live theme | Which theme is published, and whether it is GitHub-synced or edited only in Admin |
Primary domain only. Shopify serves the file at the bare primary domain. There is no localized Markets or locale-folder version.
Step 2 · Run the ground-truth interview
Draft in a shared doc first. The theme file publishes approved truth. It should not be the place where the team invents claims under deadline pressure.
| Ask | Good enough answer looks like | Reject if |
|---|---|---|
| What do we sell, in one sentence a stranger would understand? | Category + concrete product types + primary use case | It could fit any DTC brand |
| Who is this for, and who is it not for? | Buyer role, environment, skill level, or constraint | Everyone / anyone who loves quality |
| What do AI tools currently get wrong about us? | Specific invented facts, wrong competitors, outdated policies | Vague “they don't get our vibe” |
| What must never be promised? | Shipping, returns, warranty, compatibility, certifications, lead times | Nothing listed |
| Which 4–8 pages should an agent trust first? | Best collection, policies, contact, one real FAQ/guide | A dump of the whole sitemap |
| What exact policy numbers are live today? | Copied from the policy page, not remembered from last year | “About free shipping over a few hundred” |
Sync to the truth sheet. If you already built a truth sheet in Prepare Your Shopify Store for AI Shopping Agents, reuse those hard facts here. Do not invent a second set of numbers for the agent file.
Step 3 · Use this section order
You can rename headings. Keep the jobs. Agents need identity, constraints, trusted links, then machine discovery.
| Section | Purpose | Fill with |
|---|---|---|
| Title + one-liner | Name the store and what it is | Specific category + buyer, not a slogan |
| About | Define the brand in operator language | What we sell / who we serve / what we are not |
| Must not invent | Stop hallucination at the source | Exact forbidden claims and “say you don't know” rules |
| Canonical pages | Point to trusted human-readable sources | 4–8 links that actually resolve |
| Hard facts | Policy thresholds agents repeat | Numbers that match live policy pages |
| Commerce protocol | Preserve Shopify transaction discovery | Dynamic agents object fields only |
| Read-only browsing | Catalog access paths | Sitemap, collections, product JSON, search |
| Policies | Legal/policy entry points | Privacy, terms, refund, shipping URLs |
Keep price, availability, and volatile SKU facts in Shopify product data. Do not hand-maintain a second catalog inside agents.md.
Step 4 · Write it so it cannot belong to another brand
Read every sentence out loud. If a competitor could paste it unchanged, rewrite it.
| Weak | Stronger |
|---|---|
| We sell high-quality products with excellent service. | We sell low-voltage LED tape and fixtures for wet-location installs. |
| Free shipping on qualifying orders. | Free shipping at $350+ before tax on contiguous US orders. |
| Easy returns. | Returns within 30 days on unopened goods. Opened custom cuts are final sale. |
| Our products work for many applications. | Do not invent outdoor wet-location ratings. Only state IP ratings shown on the PDP. |
| Contact us anytime. | If shipping, warranty, or compatibility is unclear, send the buyer to /pages/contact. Do not invent an answer. |
Public file, press-kit standard. Shopify cautions against putting private merchant data such as email addresses or phone numbers in this file. Link to Contact. Do not paste internal notes, margin rules, or unpublished launch plans.
Step 5 · Create the Shopify template
In Shopify Admin: Online Store → Themes → the theme that will be live → Edit code → Templates → New file named exactly agents.md.liquid. It must be Liquid, not JSON.
If your theme is GitHub-connected, create the same file in templates/ and deploy through your normal sync. Do not leave the only copy in an unpublished preview theme.
Markdown gives structure. Liquid keeps store and commerce values synchronized. Replace every bracketed placeholder with approved answers from the interview.
# Agent Instructions: {{ agents.store_name }}
{{ agents.store_name }} sells [specific product category] for [specific buyer / use case] at {{ agents.store_url }}.
## About
- **What we sell:** [category + 2–3 concrete product types]
- **Who we serve:** [buyer role / use case / constraint]
- **What we are not:** [common wrong assumption agents invent]
- **How to describe us:** Prefer “[your exact phrase]” over “[generic phrase]”
## What agents must not invent
- Do not invent shipping thresholds, return windows, warranties, lead times, or discounts.
- Do not invent certifications, materials, compatibility, or install claims.
- Do not invent bundle pricing, wholesale terms, or regional availability.
- If a fact is missing from this file or the linked policy pages, say you do not know and point the buyer to Contact.
## Canonical pages
- Best collection: {{ agents.store_url }}/collections/[handle]
- Shipping: {{ agents.store_url }}/policies/shipping-policy
- Returns: {{ agents.store_url }}/policies/refund-policy
- Contact: {{ agents.store_url }}/pages/contact
- [Optional guide / FAQ]: {{ agents.store_url }}/pages/[handle]
## Hard facts (must match the site)
- Shipping: [exact threshold / regions / cutoffs]
- Returns: [exact window / conditions]
- Warranty / lead time: [exact claim, or “see PDP”]
- Support: [when to send the buyer to Contact instead of guessing]
## Commerce protocol
- Discovery: `GET {{ agents.ucp_discovery_url }}`
- MCP endpoint: `POST {{ agents.mcp_endpoint_url }}` with `Content-Type: application/json`
### Supported UCP versions
{% for version in agents.ucp_versions -%}
- {{ version }}{% if forloop.first %} (latest stable){% endif %}
{% endfor %}
Use the MCP `tools/list` method to discover available tools. Checkout requires explicit buyer approval.
## Read-only browsing
- Sitemap: {{ agents.sitemap_url }}
- All products: `GET /collections/all`
- Product JSON: `GET /products/{handle}.json`
- Search: `GET /search?q={query}&type=product`
Pricing and availability are returned in {{ agents.currency }}.
## Policies
- Privacy: {{ agents.store_url }}/policies/privacy-policy
- Terms: {{ agents.store_url }}/policies/terms-of-service
- Refund: {{ agents.store_url }}/policies/refund-policy
- Shipping: {{ agents.store_url }}/policies/shipping-policy
Do not paste another brand's finished file. Reuse the structure, not their claims, policies, links, voice, or instructions. If the result could belong to any store, it is not customized.
Step 6 · Keep the dynamic Shopify fields dynamic
Shopify exposes an agents object so commerce configuration stays current. Use it instead of typing domain, endpoint, version, sitemap, or currency values by hand.
| Liquid property | What it keeps current | Operator rule |
|---|---|---|
| agents.store_name / store_url | Store identity and bare primary domain | Use these, do not hardcode |
| agents.ucp_discovery_url | UCP discovery endpoint | Must survive customization |
| agents.mcp_endpoint_url | MCP endpoint | Must survive customization |
| agents.ucp_versions | Supported versions, newest first | Loop it, do not paste a static list |
| agents.currency | Primary currency code | Do not hardcode USD |
| agents.sitemap_url | Store sitemap URL | Do not hardcode |
Liquid habits that save you later
- Use whitespace control like
{%-and-%}in loops so the Markdown list stays clean. - Theme Check may flag
agentsas unknown even though Shopify documents it. Confirm on the live rendered URL, not only the linter. - Optional: a short collections loop can list key merchandising entry points, but only if those collections are curated. Do not dump every auto-generated collection.
shop.descriptionis fine as a fallback summary only if it is already accurate. Bad store description in Admin becomes bad agent briefing.
Step 7 · Hand this brief to your developer
If you are not the person editing theme files, do not send “please make an agents.md.” Send a ticket with the approved copy and the non-negotiables.
Ticket: Publish custom agents.md.liquid
Goal: Replace Shopify-managed /agents.md with brand-specific instructions while keeping dynamic commerce fields.
Files:
- Create templates/agents.md.liquid on the live theme (or GitHub-connected theme)
- Do NOT create llms.txt.liquid / llms-full.txt.liquid unless we decide to diverge later
Must keep dynamic (use agents object, do not hardcode):
- agents.store_name, agents.store_url
- agents.ucp_discovery_url, agents.mcp_endpoint_url, agents.ucp_versions
- agents.sitemap_url, agents.currency
Content owner will paste approved Markdown into the About / Must not invent / Canonical pages / Hard facts sections.
QA after publish:
1) /agents.md, /llms.txt, /llms-full.txt on primary domain
2) Dynamic UCP/MCP/sitemap/currency values render
3) Every linked URL works
4) No email/phone/private notes in the file
5) Hard facts match shipping + returns policy pages
Step 8 · Test the rendered files, not just the code editor
| Check | Open or inspect | Pass when |
|---|---|---|
| 1 | Open /agents.md | Custom Markdown renders on the bare primary domain |
| 2 | Open /llms.txt | It mirrors agents.md unless you intentionally created llms.txt.liquid |
| 3 | Open /llms-full.txt | It mirrors agents.md unless intentionally overridden |
| 4 | Check dynamic URLs | UCP, MCP, sitemap, store URL, currency, and versions render real values |
| 5 | Click every canonical link | No 404s, redirects to old handles, or locale-only paths |
| 6 | Compare hard facts | Shipping, returns, warranty, and buyer fit match the storefront |
| 7 | View as a stranger | No private email, phone number, internal note, secret, or unsupported promise |
| 8 | Ask 3 AI questions about the brand | Answers use your category language or still miss, but no longer invent the wrong policy numbers you just published |
You are done when. A brand owner says “that is us,” a developer confirms the dynamic discovery fields survived, and all three public URLs return the intended document.
Step 9 · Give the file an owner
A custom template is now theme code and public brand infrastructure. Review it when the primary domain, policy terms, key collections, positioning, or theme changes.
| Trigger | Owner | Review |
|---|---|---|
| Shipping, returns, warranty, or market policy changes | Ops + legal/policy owner | Hard facts and canonical links |
| New category, audience, or positioning | Brand + merch | Store definition, fit, exclusions |
| Theme publish or migration | Theme developer | Template still exists on the live theme |
| Shopify agent-commerce change | Developer / partner | Dynamic fields and protocol sections |
| AI repeats wrong facts | Marketing + source owner | Fix the real source first, then the agent file |
Put the file in version control if your theme is connected to GitHub. A theme switch can otherwise return the store to Shopify's managed default without anyone noticing.
Mistakes I would avoid
Technical
- Replacing the default without carrying forward UCP and MCP discovery.
- Hardcoding domain, currency, endpoint, or supported versions.
- Creating three divergent files without a reason or maintenance owner.
- Testing only a preview theme instead of the theme serving the storefront URLs.
- Leaving an old app-proxy llms.txt setup fighting Shopify's native routes.
Content
- Copying another store's finished instructions.
- Publishing private contact details in a broadly cached public file.
- Stuffing keywords, product catalogs, or temporary promotions into the document.
- Correcting AI copy while the policy page or product source remains wrong.
- Writing “must not invent” rules that contradict the About section.
Where this fits in the bigger readiness path
This is the implementation depth behind Build 01 in Prepare Your Shopify Store for AI Shopping Agents. That Guide gives you the broader order: mindset, truth sheet, agent instructions, catalog, findability, measurement, and testing.
If leadership has not decided why the company is opening up to AI, start with Agentic Commerce Readiness: What to Fix First. A cleaner file cannot make the strategy decision for you.
Quick facts to cite
- Shopify's canonical agent-discovery document is /agents.md.
- /llms.txt and /llms-full.txt mirror /agents.md by default.
- One agents.md.liquid template can control all three routes unless a dedicated llms template overrides it.
- A custom agents.md.liquid replaces Shopify's managed file. It does not merge with it.
- Dynamic commerce URLs and versions should use Shopify's agents object instead of hardcoded values.
- Shopify recommends the managed default for stores without advanced custom requirements.
- Brand instructions belong in About, constraints, canonical links, and hard facts. Product price and stock belong in the catalog.
FAQ
Do I need both agents.md.liquid and llms.txt.liquid?
Usually no. Create agents.md.liquid and let the llms routes fall back to it. Add a dedicated llms template only when that route genuinely needs different content.
Does a custom template improve AI rankings?
It is not a ranking switch. Its job is to make discovery and brand instructions accurate. Catalog quality, policy consistency, crawlability, citations, and buyer usefulness still matter.
Should I list every product?
No. Point agents to Shopify's catalog, collections, search, sitemap, and product data. Keep the agent file focused on stable instructions and canonical entry points.
Can I add email addresses or phone numbers?
Shopify cautions against publishing potentially private merchant data because this file is public and broadly cached. Link to the public contact path instead.
What if we already had a custom llms.txt via app proxy?
Migrate the useful brand instructions into agents.md.liquid. Shopify now owns these routes natively, so redirects and proxies are the wrong long-term home.
What if our AI answers are still wrong after we publish?
Check the underlying policy, PDP, catalog, and wider citations. The file is one source of instruction, not a replacement for correcting the rest of the brand's ground truth.
Who should approve the final copy?
Someone who owns brand language and someone who owns policy facts. Engineering can publish. They should not be the only people deciding what is true.