shopify-admin-agentic-…
Edit the theme's robots.txt.liquid to explicitly allow AI crawlers (GPTBot, ClaudeBot,…
Query checkouts abandoned in the last N days, generate unique discount codes per customer, and tag them for re-engagement.
$ npx -y skills add 40rty-ai/shopify-admin-skills --skill shopify-admin-abandoned-cart-recovery --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/shopify-admin-abandoned-cart-recoveryContext preview
The summary Claude sees to decide when to auto-load this skill.
Query checkouts abandoned in the last N days, generate unique discount codes per customer, and tag them for re-engagement.
name: shopify-admin-abandoned-cart-recovery role: marketing description: "Query checkouts abandoned in the last N days, generate unique discount codes per customer, and tag them for re-engagement." toolkit: shopify-admin, shopify-admin-execution api_version: "2025-01" graphql_operations: - abandonedCheckouts:query - discountCodeBulkCreate:mutation - tagsAdd:mutation status: stable compatibility: Claude Code, Cursor, Codex, Gemini CLI
Identifies customers who started checkout but did not complete their purchase, generates a unique discount code for each one, and tags them in Shopify so they can be targeted in follow-up campaigns. This skill handles the Shopify-native data layer (querying, discounts, tagging); sending the actual email requires an external tool.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | | format | string | no | human | Output format: `human` or `json` | | dry_run | bool | no | false | Preview operations without executing mutations | | days_back | integer | no | 7 | Lookback window for abandoned checkouts | | min_cart_value | float | no | 0 | Minimum cart total to include (USD) | | discount_pct | integer | no | 10 | Discount percentage to create per customer | | code_prefix | string | no | RECOVER | Prefix for generated discount codes | | tag | string | no | cart-recovery | Tag applied to eligible customers |
> ⚠️ Steps 2 and 3 execute mutations (discount code creation, customer tagging). Discount codes created via `discountCodeBulkCreate` cannot be bulk-deleted via the Admin API — they must be removed individually or via the price rule. Run with `dry_run: true` to verify eligible customer count before committing.
1. **OPERATION:** `abandonedCheckouts` — query **Inputs:** `first: 250`, `query: "created_at:>='<NOW - days_back days>'"`, pagination cursor **Expected output:** List of checkout objects with `email`, `totalPrice`, `createdAt`, `lineItems`; paginate until `hasNextPage: false`
2. **OPERATION:** `discountCodeBulkCreate` — mutation **Inputs:** For each eligible customer email: a unique code `{code_prefix}-{UUID[:8].toUpperCase()}`, percentage discount `discount_pct`, usage limit 1, expiry 30 days **Expected output:** Confirmation of code creation with `code` and `priceRule.id`; collect `userErrors`
3. **OPERATION:** `tagsAdd` — mutation **Inputs:** Customer `id` (from checkout `email` lookup), tag string from `tag` parameter **Expected output:** Updated customer tags; collect `userErrors`
# abandonedCheckouts:query — validated against api_version 2025-04
query AbandonedCheckouts($first: Int!, $after: String, $query: String) {
abandonedCheckouts(first: $first, after: $after, query: $query) {
edges {
node {
id
customer {
defaultEmailAddress {
emailAddress
}
}
totalPriceSet {
shopMoney {
amount
currencyCode
}
}
createdAt
lineItems {
edges {
node {
title
quantity
variant {
price
}
}
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}# discountCodeBulkCreate:mutation — validated against api_version 2025-01
mutation DiscountCodeBulkCreate($priceRuleId: ID!, $codes: [DiscountCodeInput!]!) {
discountCodeBulkCreate(priceRuleId: $priceRuleId, codes: $codes) {
bulkCreations {
id
done
}
userErrors {
field
message
}
}
}# tagsAdd:mutation — validated against api_version 2025-01
mutation TagsAdd($id: ID!, $tags: [String!]!) {
tagsAdd(id: $id, tags: $tags) {
node {
id
}
userErrors {
field
message
}
}
}**Claude MUST emit the following output at each stage. This is mandatory.**
**On start**, emit:
╔══════════════════════════════════════════════╗ ║ SKILL: Abandoned Cart Recovery ║ ║ Store: <store domain> ║ ║ Started: <YYYY-MM-DD HH:MM UTC> ║ ╚══════════════════════════════════════════════╝
**After each step**, emit:
[N/TOTAL] <QUERY|MUTATION> <OperationName>
→ Params: <brief summary of key inputs>
→ Result: <count or outcome>If `dry_run: true`, prefix every mutation step with `[DRY RUN]` and do not execute it.
**On completion**, emit:
For `format: human` (default):
══════════════════════════════════════════════ OUTCOME SUMMARY Checkouts found: <n> Eligible customers: <n> Codes created: <n> Customers tagged: <n> Errors: <n> Output: recovery_list_<date>.csv ══════════════════════════════════════════════
For `format: json`, emit:
{
"skill": "abandoned-cart-recovery",
"store": "<domain>",
"started_at": "<ISO8601>",
"completed_at": "<ISO8601>",
"dry_run": false,
"steps": [
{ "step": 1, "operation": "AbandonedCheckouts", "type": "query", "params_summary": "last 7 days, cart >= $0", "result_summary": "<n> checkouts", "skipped": false },
{ "step": 2, "operation": "DiscountCodeBulkCreate", "type": "mutation", "params_summary": "<n> codes, 10% off, prefix RECOVER", "result_summary": "<n> created", "skipped": false },
{ "step": 3, "operation": "TagsAdd", "type": "mutation", "params_summary": "tag: cart-recovery", "result_summary": "<n> customers tagged", "skipped": false }
],
"outcome": {
"checkouts_found": 0,
"eligible_cCommunity-maintained AI agent skills for operating Shopify stores — workflows, optimization, reports and more
Edit the theme's robots.txt.liquid to explicitly allow AI crawlers (GPTBot, ClaudeBot,…
Rewrite thin product descriptions into structured, fact-rich copy (materials, fit, use-cases,…
Generate and set descriptive alt text on product images so AI agents (which can't 'see'…
Generate and publish an /llms.txt guide (brand summary, flagship products, key policies,…
Define and populate agentic-commerce metafields (material, attributes, key features, specs,…
Inject an Organization JSON-LD block (name, logo, sameAs social links, contactPoint) into the…