$npx -y skills add 40RTY-ai/shopify-admin-skills --skill shopify-admin-agentic-organization-schemaInject an Organization JSON-LD block (name, logo, sameAs social links, contactPoint) into the theme so AI agents can verify the store is a real, trusted brand and link it to its public identity.
| 1 | ## Purpose |
| 2 | AI assistants check a site's `schema.org/Organization` JSON-LD to confirm it's the real brand (not a counterfeit or reseller) and to connect it to its public identity via `sameAs` (official socials, Wikipedia/Wikidata) and a machine-readable `contactPoint`. Without it, agents hesitate to recommend the store or send buyers to it. This skill builds an Organization JSON-LD block from the shop's data + supplied social links and injects it into the theme layout via a managed snippet. Fixes `org-schema`, `machine-contact`, and supports `wikidata-qid` (through `sameAs`). |
| 3 | |
| 4 | ## Prerequisites |
| 5 | - Authenticated Shopify CLI session (`shopify auth login --store <domain>`) |
| 6 | - Required API scopes: `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 snippet + injection 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 | | logo_url | string | no | — | Absolute logo URL (else inferred from theme settings if available) | |
| 23 | | same_as | string | no | — | Comma list of official profile URLs (Instagram, TikTok, LinkedIn, Wikipedia, Wikidata) | |
| 24 | | contact_email | string | no | — | Customer-support email for `contactPoint` (else shop contactEmail) | |
| 25 | | contact_phone | string | no | — | Optional support phone for `contactPoint` | |
| 26 | |
| 27 | ## Safety |
| 28 | |
| 29 | > ⚠️ Step 3 (`themeFilesUpsert`) writes a snippet and edits `layout/theme.liquid` in the LIVE theme. The change is additive (a `{% render %}` in `<head>`), but it publishes immediately and a malformed edit to `theme.liquid` can break rendering. The skill writes the JSON-LD into its own snippet file and inserts a single managed `{% render 'agentic-organization-schema' %}` line inside a `# BEGIN/END` marker block. Defaults `dry_run: true`; duplicate the theme first. |
| 30 | |
| 31 | ## Workflow Steps |
| 32 | |
| 33 | 1. **OPERATION:** `shop` — query |
| 34 | **Inputs:** none |
| 35 | **Expected output:** Shop name, primary domain, contact email — the core Organization fields. |
| 36 | |
| 37 | 2. **OPERATION:** `themes` — query |
| 38 | **Inputs:** `roles: [MAIN]`, `theme.files(filenames: ["layout/theme.liquid", "snippets/agentic-organization-schema.liquid"])` |
| 39 | **Expected output:** Current layout (to inject the render tag) + whether the snippet already exists. |
| 40 | |
| 41 | 3. **OPERATION:** `themeFilesUpsert` — mutation |
| 42 | **Inputs:** write `snippets/agentic-organization-schema.liquid` (the JSON-LD `<script type="application/ld+json">`), and upsert `layout/theme.liquid` with the managed `{% render %}` block added in `<head>` if absent. Skipped on `dry_run`. |
| 43 | **Expected output:** Upserted files; collect `userErrors`. |
| 44 | |
| 45 | ## GraphQL Operations |
| 46 | |
| 47 | ```graphql |
| 48 | # shop:query — validated against api_version 2025-01 |
| 49 | query OrgSchemaShop { |
| 50 | shop { |
| 51 | name |
| 52 | primaryDomain { url } |
| 53 | contactEmail |
| 54 | } |
| 55 | } |
| 56 | ``` |
| 57 | |
| 58 | ```graphql |
| 59 | # themes:query — validated against api_version 2025-01 |
| 60 | query OrgSchemaTheme { |
| 61 | themes(first: 1, roles: [MAIN]) { |
| 62 | nodes { |
| 63 | id |
| 64 | files(filenames: ["layout/theme.liquid", "snippets/agentic-organization-schema.liquid"]) { |
| 65 | nodes { |
| 66 | filename |
| 67 | body { ... on OnlineStoreThemeFileBodyText { content } } |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | ``` |
| 74 | |
| 75 | ```graphql |
| 76 | # themeFilesUpsert:mutation — validated against api_version 2025-01 |
| 77 | mutation OrgSchemaUpsert($themeId: ID!, $files: [OnlineStoreThemeFilesUpsertFileInput!]!) { |
| 78 | themeFilesUpsert(themeId: $themeId, files: $files) { |
| 79 | upsertedThemeFiles { filename } |
| 80 | userErrors { filename code message } |
| 81 | } |
| 82 | } |
| 83 | ``` |
| 84 | |
| 85 | Snippet body (`snippets/agentic-organization-schema.liquid`): |
| 86 | |
| 87 | ```liquid |
| 88 | {%- comment -%} managed by shopify-admin-agentic-organization-schema {%- endcomment -%} |
| 89 | <script type="application/ld+json"> |
| 90 | { |
| 91 | "@context": "https://schema.org", |
| 92 | "@type": "Organization", |
| 93 | "name": "<shop name>", |
| 94 | "url": "<primary domain>", |
| 95 | "logo": "<logo_url>", |
| 96 | "sameAs": [ "<same_as[0]>", "..." ], |
| 97 | "contactPoint": { |
| 98 | "@type": "ContactPoint", |
| 99 | "contactTy |