How to Write llms.txt: A Step-by-Step E-Commerce GEO Guide

A Shopify merchant we worked with last quarter dropped a 4,200-line sitemap into his llms.txt and then wondered why ChatGPT still described his store as "a general electronics retailer" instead of naming his three hero SKUs. A clean llms.txt is one of the few GEO assets you can ship in an afternoon and that AI engines actually read. Most stores either skip it or fill it with a raw sitemap dump, and both choices leave their products invisible in AI answers. This guide covers what the file is, the structure that works for cross-border stores, a full annotated example, the five mistakes we see most, and how to validate it before you publish.
What llms.txt is, and why AI engines read it
llms.txt is a plain-text file placed at your domain root that gives an AI agent a curated map of your site in human-readable Markdown. Anthropic proposed the format in 2024 as a companion to the web, not a replacement for it: rather than forcing a model to crawl and parse every page, you hand it a short directory of what matters and where the details live. Think of it as a table of contents your crawler can read in one pass.
AI engines consume it because it lowers cost and removes ambiguity. ChatGPT and Perplexity pull pages through their indexers; Claude reads linked context directly when a user points it at a domain; Doubao and DeepSeek, common in China-facing queries, behave similarly when the file is present and well structured. The file does not on its own produce a citation. For what actually drives quotes, see our complete guide to search and AI visibility and the related debate on whether AI search replaces SEO. What llms.txt does is remove a real friction point: guessing which pages carry your canonical facts.
The payoff is concrete for commerce. A model that knows your /en/products/winter-jacket page exists, and that it is the authoritative product page, is more likely to describe that specific jacket than to fall back on a generic category summary built from thin metadata.
The structure that works for a store
Skip the sitemap dump. A robots.txt or XML sitemap tells a crawler what URLs exist; llms.txt should tell a model what those URLs mean and which ones to trust. The recommended shape is a directory-style Markdown file: a top H1 with your brand name, a short prose paragraph, then # Section headers grouping links to deeper pages with one-line descriptions.
A practical skeleton:
# Brand Name
> Short paragraph: what the company sells, who it serves, and where it ships.
## Products
- [Winter Jacket](https://site.com/en/products/winter-jacket): waterproof 3-layer shell, $189, ships to 40 countries.
- [Trail Backpack](https://site.com/en/products/trail-backpack): 30L, $94, free shipping over $120.
## Policies
- [Shipping](https://site.com/en/shipping): 3-7 day delivery, duties calculated at checkout.
- [Returns](https://site.com/en/returns): 30-day window, prepaid label in the US and EU.
The key discipline is restraint. Each link earns its place by carrying a fact a model cannot infer on its own: price, availability, region, policy. A list of 200 category URLs with no descriptions is noise. A list of 12 product and policy pages with one-line context is a map. The file is read once, so density of signal matters more than completeness of coverage.
An annotated example for a cross-border store
Below is a trimmed version of a real pattern we use, with English and Chinese language variants. Note the parallel /en and /zh sections and the explicit facts in each line.
# NorthPeak Outdoor
> NorthPeak sells technical outdoor gear from Shenzhen to 40+ countries.
> English and Chinese storefronts share one catalog; prices are USD.
## Products (EN)
- [Winter Jacket Pro](https://northpeak.com/en/products/winter-jacket-pro): 3-layer waterproof, $189, in stock.
- [Trail Backpack 30](https://northpeak.com/en/products/trail-backpack-30): 30L roll-top, $94, ships in 48h.
## 产品(中文)
- [冬季夹克 Pro](https://northpeak.com/zh/products/winter-jacket-pro): 三层防水,189 美元,现货。
- [登山背包 30](https://northpeak.com/zh/products/trail-backpack-30): 30 升卷口,94 美元,48 小时发货。
## Company
- [About](https://northpeak.com/en/about): founded 2019, 60-person team, ISO-certified factory.
- [Contact](https://northpeak.com/en/contact): [email protected], +1 415 555 0142.
Two things make this file useful. First, the Chinese section exists at all. Doubao and DeepSeek answer a large share of China-facing queries, and a model with no Chinese context will describe the brand only in English. Second, every line carries a verifiable fact (price, stock, contact) rather than marketing language. That is what lets an engine quote you accurately instead of paraphrasing from a category page.
The five most common mistakes
We audit a steady flow of these files, and the same errors repeat. Avoid the following.
| Don't | Do |
|---|---|
| Paste the full 4,000-line sitemap | Link 10-20 pages with one-line descriptions |
| Write ad copy ("great gear for everyone") | State facts: price, region, availability |
| Omit price and contact details | Include price, stock, support email, phone |
| Ship only the English version | Add a parallel /zh section for Chinese engines |
| Publish and never check it | Validate with curl and the GEO checker |
Mistake one, the sitemap dump, is the most frequent. It buries the three pages that matter under thousands that do not. Mistake four, the missing Chinese version, quietly costs visibility on Doubao and DeepSeek for any brand serving China-facing buyers. Both are easy to fix and easy to overlook, which is exactly why they persist.
How to validate before publishing
Validation is two steps and takes about five minutes. First, confirm the file is reachable and well-formed:
curl -I https://yourstore.com/llms.txt
curl https://yourstore.com/llms.txt
The first command should return HTTP/2 200. The second should print your Markdown, not a redirect or an error page. If you see a 404, the file is in the wrong directory. It belongs at the domain root, not under /assets or /static. A 404 at this path is a common deployment miss that stays invisible from the storefront admin, so check it directly rather than assuming the publish succeeded.
Second, run a visibility check on the pages you linked. Our GEO checker reads the URLs in your file and reports whether AI engines can parse and cite them, including language variants. Pair that with the manual approach in our GEO readiness checklist: ask ChatGPT, Perplexity, and a Chinese engine your three money questions and log whether the brand appears with the right product facts. For a fuller method on structuring pages for retrieval, see our GEO content playbook.
Copy-paste template
Start from this and replace the bracketed values. Keep it under roughly 60 lines.
# [Brand Name]
> [One or two sentences: what you sell, where you ship, base currency.]
## Products (EN)
- [[Product A]](https://[site]/en/products/[a]): [one-line fact: material, price, stock].
- [[Product B]](https://[site]/en/products/[b]): [one-line fact].
## 产品(中文)
- [[产品甲]](https://[site]/zh/products/[a]): [一句话事实:材质、价格、库存].
- [[产品乙]](https://[site]/zh/products/[b]): [一句话事实].
## Policies
- [Shipping](https://[site]/en/shipping): [delivery window, duties note].
- [Returns](https://[site]/en/returns): [window, regions covered].
## Company
- [About](https://[site]/en/about): [founded year, team size].
- [Contact](https://[site]/en/contact): [support email, phone].
If you want the broader picture of how this file fits the AI visibility stack, our study of 50 Chinese cross-border brands found that stores with machine-readable context structured data plus a curated llms.txt were cited more often than those relying on crawl alone. And for the data behind China-facing discovery, our 2026 China AI visibility research breaks down engine behavior by query type.
FAQ
What is llms.txt and do I need one? llms.txt is a plain-text Markdown file at your domain root that gives AI agents a curated map of your site. You do not need one to be indexed, but for a store with distinct products and policies it removes ambiguity about which pages carry your canonical facts, which helps engines describe you accurately.
Which AI engines actually read llms.txt? Claude reads linked context directly when a domain is referenced, and ChatGPT and Perplexity draw from indexed pages the file points to. Doubao and DeepSeek, common for China-facing queries, respond to a well-structured file with a Chinese section. No engine treats it as the only source, so pair it with solid on-page structure.
How long should the file be? For most cross-border stores, 10 to 20 linked pages with one-line descriptions is a healthy range. A file past 60 lines starts to dilute the signal. Link products, key policies, and company facts, not every category and filter URL.
Should I include both English and Chinese versions? If you serve China-facing buyers or any Chinese-speaking audience, yes. Doubao and DeepSeek answer a meaningful share of those queries, and a model with no Chinese context will describe your brand only in English. A parallel /zh section is the usual fix.
How do I check whether it is working? Run curl https://yourstore.com/llms.txt to confirm it returns 200 and your Markdown, then use our GEO checker on the linked pages and ask three engines your money questions weekly. Citations typically appear four to twelve weeks after the file and on-page facts are in place.


