$npx -y skills add 40RTY-ai/shopify-admin-skills --skill shopify-admin-agentic-llms-txtGenerate and publish an /llms.txt guide (brand summary, flagship products, key policies, contact) via a theme template so AI assistants get a curated, machine-readable map of the store.
| 1 | ## Purpose |
| 2 | `llms.txt` is the emerging convention for telling AI assistants, in plain text, what a site is and where the important pages live — a curated front door for models. This skill assembles an `llms.txt` from the store's own data (brand one-liner, top collections, flagship products with URLs, shipping/returns policy links, contact) and publishes it through a theme template so it's served at a stable path. Fixes `llms-txt` / `well-known-llms-txt` and the related `agents-md` discovery signals. |
| 3 | |
| 4 | ## Prerequisites |
| 5 | - Authenticated Shopify CLI session (`shopify auth login --store <domain>`) |
| 6 | - Required API scopes: `read_products`, `read_themes`, `write_themes` |
| 7 | |
| 8 | ## Parameters |
| 9 | All skills accept these universal parameters: |
| 10 | |
| 11 | | Parameter | Type | Required | Default | Description | |
| 12 | |-----------|--------|----------|---------|-------------| |
| 13 | | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | |
| 14 | | format | string | no | human | Output format: `human` (default) or `json` | |
| 15 | | dry_run | bool | no | true | Preview the generated llms.txt without writing (defaults ON — edits the live theme) | |
| 16 | |
| 17 | Skill-specific parameters: |
| 18 | |
| 19 | | Parameter | Type | Required | Default | Description | |
| 20 | |-----------|------|----------|---------|-------------| |
| 21 | | theme_id | string | no | — | Theme GID (defaults to published MAIN theme) | |
| 22 | | flagship_count | int | no | 12 | How many top products to list | |
| 23 | | flagship_collection_id | string | no | — | Collection to draw the flagship list from (else best-sellers/recent) | |
| 24 | | brand_summary | string | no | — | Override the brand one-liner (else inferred from shop + homepage) | |
| 25 | |
| 26 | ## Safety |
| 27 | |
| 28 | > ⚠️ Step 4 (`themeFilesUpsert`) writes a new template to the LIVE theme. The content is additive (a new file/route) and low-risk, but it is published immediately. Defaults `dry_run: true` so you review the generated `llms.txt` first. Duplicating the theme before writing is recommended. |
| 29 | |
| 30 | ## Workflow Steps |
| 31 | |
| 32 | 1. **OPERATION:** `shop` — query |
| 33 | **Inputs:** none |
| 34 | **Expected output:** Shop name, domain, contact email, policy URLs — the header + contact + policy section of llms.txt. |
| 35 | |
| 36 | 2. **OPERATION:** `products` — query |
| 37 | **Inputs:** `first: flagship_count`, optional `query: "collection_id:'<id>'"` (when `flagship_collection_id` is set — the curated set is your flagship list), `sortKey: UPDATED_AT, reverse: true` otherwise; fields `title`, `onlineStoreUrl`, `description`. |
| 38 | **Expected output:** Flagship product list with URLs for the "Key products" section. (Top-level `products` has no best-selling sort — use the curated collection for true bestsellers, else most-recently-updated as the proxy.) |
| 39 | |
| 40 | 3. **COMPUTE (no API):** render the `llms.txt` markdown: `# <Brand>` + one-liner, `## Key products` (title — URL — one line), `## Policies` (shipping/returns/privacy URLs), `## Contact`. Emit the full text. |
| 41 | |
| 42 | 4. **OPERATION:** `themeFilesUpsert` — mutation |
| 43 | **Inputs:** `themeId`, write `templates/page.llms.liquid` (a page template that outputs the text as `text/plain`) plus, if used, an `assets/llms.txt` copy; skipped when `dry_run`. |
| 44 | **Expected output:** Upserted theme file(s); collect `userErrors`. (Note: surface a one-line instruction to create a Page using the `llms` template, or to add a redirect from `/llms.txt`.) |
| 45 | |
| 46 | ## GraphQL Operations |
| 47 | |
| 48 | ```graphql |
| 49 | # shop:query — validated against api_version 2025-01 |
| 50 | query LlmsTxtShop { |
| 51 | shop { |
| 52 | name |
| 53 | primaryDomain { url } |
| 54 | contactEmail |
| 55 | shopPolicies { type url } |
| 56 | } |
| 57 | } |
| 58 | ``` |
| 59 | |
| 60 | ```graphql |
| 61 | # products:query — validated against api_version 2025-01 |
| 62 | # Top-level `products` has no BEST_SELLING sort key. Pass a `collection_id:'…'` |
| 63 | # query filter to use a curated flagship set, otherwise fall back to the most |
| 64 | # recently updated products. |
| 65 | query LlmsTxtFlagship($first: Int!, $query: String) { |
| 66 | products(first: $first, query: $query, sortKey: UPDATED_AT, reverse: true) { |
| 67 | edges { |
| 68 | node { id title onlineStoreUrl description } |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | ``` |
| 73 | |
| 74 | ```graphql |
| 75 | # themeFilesUpsert:mutation — validated against api_version 2025-01 |
| 76 | mutation LlmsTxtUpsert($themeId: ID!, $files: [OnlineStoreThemeFilesUpsertFileInput!]!) { |
| 77 | themeFilesUpsert(themeId: $themeId, files: $files) { |
| 78 | upsertedThemeFiles { filename } |
| 79 | userErrors { filename code message } |
| 80 | } |
| 81 | } |
| 82 | ``` |
| 83 | |
| 84 | ## Session Tracking |
| 85 | |
| 86 | **Claude MUST emit the following output at each stage. This is mandatory.** |
| 87 | |
| 88 | **On start**, emit: |
| 89 | ``` |
| 90 | ╔════════════════════════ |