Generation pipeline
Each ShopMD file is built by its own run of the generation pipeline. A run builds one file for one store, as a series of steps. A step that fails, such as a slow storefront or a timed-out AI call, is retried on its own without starting the whole run again.
The stages
Section titled “The stages”flowchart LR
check["1. Check the address"] --> fetch["2. Fetch the store"]
fetch --> extract["3. Extract facts"]
extract --> write["4. AI-written sections"]
write --> assemble["5. Assemble"]
assemble --> store["6. Store"]
store --> live{"First version, or<br/>you asked for it?"}
live -- yes --> published["Published"]
live -- "no (automatic refresh)" --> draft["Draft waiting<br/>for approval"]
- Check the address. The store URL must be
https://and must resolve to a public address. ShopMD also reads the store’srobots.txtbefore it starts, and stops if aDisallowrule for all agents (*) or forshopmdcovers the store’s home page. - Fetch the store. ShopMD reads the storefront like a visitor: rendered pages in a headless browser, the
public product feed, policy pages and the store’s
llms.txtif it has one. When the Shopify app is installed, it also reads the store’s own data through Shopify’s admin, with read-only access. Thebrand.md,policies.mdandstore.mdruns also confirm the site is a Shopify store, and stop if it isn’t. - Extract facts. Code pulls out the structured parts: colours and fonts, products and prices, policy rules with the exact wording they came from.
- AI-written sections. An AI model writes the prose sections from the extracted facts. It doesn’t write the structured parts, and some files use no AI at all.
- Assemble. Code puts the sections together in the file’s fixed order, adds confidence tags and
[MERCHANT-FILL]markers, and appends any gap answers the merchant has given. - Store. The finished file is saved. What happens next depends on who started the run.
Published or held for approval
Section titled “Published or held for approval”- A file’s first version goes live as soon as it’s generated.
- A run the merchant started themselves, such as pressing Regenerate, also goes live straight away.
- An automatic refresh of a file that’s already published, such as one triggered by a product update, a theme publish or the nightly schedule, is saved as a draft beside the published file. Agents keep reading the published version until the merchant approves or discards the draft.
See Keep your files fresh and Review, edit and approve your files.
Merchant section edits aren’t written into the stored file. They’re applied each time the file is served, so a refresh never overwrites them.
Per file
Section titled “Per file”| File | What it fetches | What the AI writes | Notes |
|---|---|---|---|
design.md |
The rendered storefront in a headless browser, plus a screenshot. Theme data when installed. | The prose around the design tokens. The tokens themselves come from the page. | On a theme publish, the new design is compared with the current one. If almost nothing changed, the current file is kept. |
brand.md |
Storefront pages, the public product feed and llms.txt. Store data when installed. |
The brand reading: voice, positioning and messaging. | |
policies.md |
Policy pages linked from the storefront, llms.txt, and the store’s legal policies when installed. Thin pages are re-read in a headless browser. |
Fact extraction from each policy page. | Every extracted rule is checked against the page’s own wording before it’s kept. |
catalog.md |
The public product feed and llms.txt. |
A short narrative about the range. | Counts, prices and tables are computed by code. If the AI step fails, the file is still built without the narrative. Also writes three compact data files in TOON format. |
store.md |
The storefront, the product feed, llms.txt, real-user and lab performance data, and store data when installed. |
Several analyses (customers, competition, gaps) and a final brief built from them. | Not published: never served on the storefront. |
shop.md |
Nothing from the store directly. | Nothing. | Needs the installed app. Generates any missing brand.md, policies.md, catalog.md or store.md first, then quotes excerpts from them. |
agents.md |
Nothing from the store directly. | Nothing. | Needs the installed app. Generates any missing brand.md, policies.md, design.md or store.md first, then quotes excerpts from them. |
| Product and collection files | Store data through Shopify’s admin. | Nothing. | Built from the merchant’s templates, up to 1,000 files per run. |
What starts a run
Section titled “What starts a run”| Trigger | Files |
|---|---|
| Someone generates from a URL on shopmd.ai | design.md, brand.md, policies.md, catalog.md, and store.md when signed in |
| Setup or Regenerate in the Shopify app | The file chosen |
| A change in the Shopify store | See Webhooks |
Approving a refreshed store.md, brand.md, policies.md or catalog.md |
shop.md |
| Every night | catalog.md for stores ShopMD knows about, and shop.md for installed stores |
| Write the files in the app | Product and collection files |