Skip to content
Install on Shopify

How ShopMD thinks

Five rules shape every file ShopMD writes. Knowing them helps you read the output, whether you’re checking your own store’s files or building an agent that reads them.

Each file answers one kind of question. A coding agent building a page needs design.md. A support bot answering “Can I return this?” needs policies.md. Neither needs the other’s file.

Keeping concerns apart means:

  • An agent loads only what its task needs, which keeps its context small.
  • A change to the theme refreshes design.md without touching policies.md.
  • You can review, edit or withdraw files one at a time.

Two files exist to point at the others. shop.md holds excerpts from the brand, policies and catalog files plus an index of every file, and agents.md is a short guide for AI agents. An agent that finds the store reads one of these first, then fetches the detail it needs.

ShopMD extracts facts with code first: colours from the rendered page, products from the store’s catalog, policy wording from the policy pages. An AI model then writes the readable sections around those facts.

Where a line could be wrong, it carries a confidence tag that says how strong the evidence behind it is:

Tag Meaning
[Certain] Grounded in the store’s own data or in a measurement
[Likely], [Guessing] Based on weaker evidence, such as inference from storefront pages or a lab test
[MERCHANT-FILL] The store doesn’t publish this. Only the merchant can supply it

What counts as strong evidence depends on the file. In the Store Intel brief, for example, [Certain] means the fact came from the store’s admin data, its public product catalog, something detected directly on the storefront, or real-user performance data. [Likely] and [Guessing] mark judgements in the AI-written analysis sections, from stronger or thinner evidence; a single lab performance test is also [Likely].

policies.md shows the most precise form. Every policy line carries a lowercase [certain] or [likely] tag, names the page it came from and quotes it, so an agent can check the claim against the store’s own words. This line is from allbirds.com:

- Returns can be made within 15 days [certain] (sources: /policies/refund-policy, /pages/returns-exchanges)
> "Our standard return policy is 15 days"

Policy lines can also be marked [possibly-outdated], and rules whose date window has ended are listed under an “Expired / seasonal” heading so they’re never presented as current.

When ShopMD can’t find a fact, it doesn’t invent a default. It marks the line [MERCHANT-FILL], in files generated from a URL and in files for installed stores alike. For a store that installs the app, some missing facts also become gaps: short questions for the merchant, such as the return window or handling time. An answered gap is added to the relevant files under “Merchant-Supplied Facts”. An unanswered gap adds nothing, so the file never contains an answer the merchant didn’t give.

The files describe a real business, so the merchant has the final say:

  • Review. During setup, the app lists every file with a count of how many the merchant has opened, so they can read each one before finishing.
  • Edit. The merchant can change any section. Edits are applied every time the file is served (the excerpts in shop.md and agents.md quote the stored version), so they survive later refreshes.
  • Approve. Once a file is published, a refreshed version never replaces it on its own. It waits until the merchant approves it, or discards it.
  • Withdraw. The merchant can take most files off their domain. A withdrawn file answers exactly like one that never existed, so agents stop quoting it. Currently, shop.md and agents.md can’t be withdrawn — see Withdraw or restore.

store.md, the brief on customers, competitors and strategy, is never published on the storefront, never shown in the public gallery, and not listed or served by the MCP public tools.

Agents look for a store’s information on the store’s own domain, not on a third-party site. So the files are published there, under one path:

https://your-store.com/apps/shopmd/shop.md
https://your-store.com/apps/shopmd/design.md
https://your-store.com/apps/shopmd/products/linen-shirt.md

Family files sit one level down, under products/ or collections/, named by the item’s handle. The .md ending is optional: /apps/shopmd/shop returns the same file.

The ShopMD MCP server reads from the same published files, so an assistant connected over MCP gets the same content as one that fetches the URL.

A file that was right last month can mislead an agent today. ShopMD listens for changes in the store and refreshes the file each change affects:

Change in the store File refreshed
A product is updated or deleted, or a collection is updated catalog.md
Store settings change store.md
A new theme is published design.md

A bulk change, like importing hundreds of products, triggers a handful of refreshes, not one per product: changes that arrive within a few minutes of each other share one refresh.

For design.md, ShopMD measures drift: how far the new design moved from the old one, scored from 0 to 100 across colours, typography, spacing, corner radius and shadows. A score under 5 is stable, under 30 is drift, and 30 or more is breaking. When the score is 10 or lower, ShopMD keeps the current file, so small rendering differences don’t create work for the merchant.

For a file that’s already published, every automatic refresh goes through the approval step above; a regeneration you start yourself goes live straight away. A file’s first version goes live as soon as it’s generated. When the merchant approves a new version of brand.md, policies.md, catalog.md or store.md, ShopMD rebuilds shop.md to match, and that new shop.md waits for approval too.

  • Glossary: short definitions of the terms on this page.
  • Quickstart: generate files for a store from its URL.