$npx -y skills add 40RTY-ai/shopify-admin-skills --skill shopify-admin-email-deliverability-auditRead-only: scans the customer database for malformed emails, role accounts, disposable domains, and bounce-suspect patterns to protect sender reputation.
| 1 | ## Purpose |
| 2 | Scans the entire customer list and flags addresses that will hurt email deliverability if included in marketing sends: syntactically invalid addresses, role accounts (info@, admin@, sales@), known disposable / temporary domains, and suspected hard-bounce patterns. Output is a suppression list ready to import into your email platform. Read-only — no mutations. |
| 3 | |
| 4 | ## Prerequisites |
| 5 | - Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_customers` |
| 6 | - API scopes: `read_customers` |
| 7 | |
| 8 | ## Parameters |
| 9 | |
| 10 | | Parameter | Type | Required | Default | Description | |
| 11 | |-----------|------|----------|---------|-------------| |
| 12 | | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | |
| 13 | | marketing_consent_only | bool | no | true | Only scan customers who currently accept marketing — those are the ones at risk of being mailed | |
| 14 | | disposable_domains | array | no | built-in list | Override built-in disposable-domain list | |
| 15 | | role_localparts | array | no | `["info","admin","sales","support","contact","noreply","help","webmaster","postmaster"]` | Local-part prefixes to flag as role accounts | |
| 16 | | format | string | no | human | Output format: `human` or `json` | |
| 17 | |
| 18 | ## Safety |
| 19 | |
| 20 | > ℹ️ Read-only skill — no mutations are executed. Safe to run at any time. No emails are sent, no marketing consent is changed. |
| 21 | |
| 22 | ## Detection Rules |
| 23 | |
| 24 | For each customer email, run these checks in order and assign one or more flags: |
| 25 | |
| 26 | 1. **`invalid_syntax`** — fails RFC 5322 local-part / domain validation, missing `@`, contains whitespace, double dots, leading/trailing dot |
| 27 | 2. **`role_account`** — local part exactly matches a `role_localparts` entry (case-insensitive) |
| 28 | 3. **`disposable_domain`** — domain matches the disposable-domain list (mailinator, guerrillamail, tempmail-style domains, etc.) |
| 29 | 4. **`plus_alias`** — contains `+` in local part (informational; not a deliverability problem on its own, but useful for de-duplication) |
| 30 | 5. **`bounce_suspect`** — heuristics: numeric-only local part, length > 64 chars, ALL-CAPS, repeated characters (`aaaaa`), keyboard rolls (`asdfghjk`) |
| 31 | 6. **`duplicate`** — same normalized email already seen in the customer set |
| 32 | |
| 33 | A customer can carry multiple flags; the most severe (`invalid_syntax` > `bounce_suspect` > `disposable_domain` > `role_account` > `plus_alias`) drives the recommended action. |
| 34 | |
| 35 | ## Workflow Steps |
| 36 | |
| 37 | 1. **OPERATION:** `customers` — query |
| 38 | **Inputs:** `first: 250`, select `id`, `defaultEmailAddress { emailAddress, marketingState }`, `numberOfOrders`, `tags`, pagination cursor. If `marketing_consent_only: true`, filter `query: "email_marketing_state:subscribed"` |
| 39 | **Expected output:** All targeted customers with email; paginate until `hasNextPage: false` |
| 40 | |
| 41 | 2. Run detection rules over each email; collect flags |
| 42 | |
| 43 | 3. Aggregate counts per flag, build suppression list |
| 44 | |
| 45 | ## GraphQL Operations |
| 46 | |
| 47 | ```graphql |
| 48 | # customers:query — validated against api_version 2025-01 |
| 49 | query DeliverabilityAudit($query: String, $after: String) { |
| 50 | customers(first: 250, after: $after, query: $query) { |
| 51 | edges { |
| 52 | node { |
| 53 | id |
| 54 | displayName |
| 55 | defaultEmailAddress { |
| 56 | emailAddress |
| 57 | marketingState |
| 58 | } |
| 59 | numberOfOrders |
| 60 | amountSpent { |
| 61 | amount |
| 62 | currencyCode |
| 63 | } |
| 64 | tags |
| 65 | createdAt |
| 66 | } |
| 67 | } |
| 68 | pageInfo { |
| 69 | hasNextPage |
| 70 | endCursor |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | ``` |
| 75 | |
| 76 | ## Session Tracking |
| 77 | |
| 78 | **Claude MUST emit the following output at each stage. This is mandatory.** |
| 79 | |
| 80 | **On start**, emit: |
| 81 | ``` |
| 82 | ╔══════════════════════════════════════════════╗ |
| 83 | ║ SKILL: Email Deliverability Audit ║ |
| 84 | ║ Store: <store domain> ║ |
| 85 | ║ Started: <YYYY-MM-DD HH:MM UTC> ║ |
| 86 | ╚══════════════════════════════════════════════╝ |
| 87 | ``` |
| 88 | |
| 89 | **After each step**, emit: |
| 90 | ``` |
| 91 | [N/TOTAL] <QUERY|MUTATION> <OperationName> |
| 92 | → Params: <brief summary of key inputs> |
| 93 | → Result: <count or outcome> |
| 94 | ``` |
| 95 | |
| 96 | **On completion**, emit: |
| 97 | |
| 98 | For `format: human` (default): |
| 99 | ``` |
| 100 | ══════════════════════════════════════════════ |
| 101 | EMAIL DELIVERABILITY AUDIT |
| 102 | Customers scanned: <n> |
| 103 | Subscribed customers: <n> |
| 104 | ───────────────────────────── |
| 105 | Invalid syntax: <n> (<pct>%) 🔴 suppress |
| 106 | Role accounts: <n> (<pct>%) ⚠️ suppress |
| 107 | Disposable domains: <n> (<pct>%) ⚠️ suppress |
| 108 | Bounce-suspect patterns: <n> (<pct>%) ⚠️ review |
| 109 | Plus aliases: <n> (<pct>%) ℹ️ informational |
| 110 | Duplicates: <n> (<pct>%) ℹ️ informational |
| 111 | |
| 112 | Recommended suppression: <n> (<pct>% of subscribed) |
| 113 | Output: deliver |