shopify-admin-agentic-…
Edit the theme's robots.txt.liquid to explicitly allow AI crawlers (GPTBot, ClaudeBot,…
Compare redemption rates and revenue performance across two or more discount codes over a specified date range.
$ npx -y skills add 40rty-ai/shopify-admin-skills --skill shopify-admin-discount-ab-analysis --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/shopify-admin-discount-ab-analysisContext preview
The summary Claude sees to decide when to auto-load this skill.
Compare redemption rates and revenue performance across two or more discount codes over a specified date range.
name: shopify-admin-discount-ab-analysis role: conversion-optimization description: "Compare redemption rates and revenue performance across two or more discount codes over a specified date range." toolkit: shopify-admin, shopify-admin-execution api_version: "2025-01" graphql_operations: - discountNodes:query - orders:query status: stable compatibility: Claude Code, Cursor, Codex, Gemini CLI
Compares how different discount codes perform against each other by redemption count and revenue generated. Useful for A/B testing promotional offers without a dedicated analytics app — provide two or more codes and a date range, and the skill queries Shopify for discount metadata and order revenue, then produces a side-by-side comparison table. Read-only: no mutations are executed.
| 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 | | discount_codes | array | yes | — | Array of 2 or more discount code strings to compare (e.g., `["SAVE10", "WELCOME15"]`) | | date_range_start | string | yes | — | Start date in ISO 8601 (e.g., `2025-01-01`) | | date_range_end | string | yes | — | End date in ISO 8601 (e.g., `2025-01-31`) |
1. **OPERATION:** `discountNodes` — query **Inputs:** `first: 50`, `query: "code:<code>"` (one query per code in `discount_codes`) **Expected output:** Discount metadata: title, code strings, `asyncUsageCount`, status, `startsAt`, `endsAt` per code
2. **OPERATION:** `orders` — query (one paginated query per discount code) **Inputs:** `first: 250`, `query: "discount_code:<code> created_at:>='<date_range_start>' created_at:<='<date_range_end>'"`, pagination cursor **Expected output:** Orders containing the discount code with `totalPriceSet`; paginate until `hasNextPage: false`; aggregate: count, sum revenue, compute avg order value
# discountNodes:query — validated against api_version 2025-01
query DiscountNodes($first: Int!, $query: String) {
discountNodes(first: $first, query: $query) {
edges {
node {
id
discount {
... on DiscountCodeBasic {
title
codes(first: 10) {
edges {
node {
code
asyncUsageCount
}
}
}
usageLimit
status
startsAt
endsAt
}
... on DiscountCodeBxgy {
title
codes(first: 10) {
edges {
node {
code
asyncUsageCount
}
}
}
status
}
... on DiscountCodeFreeShipping {
title
codes(first: 10) {
edges {
node {
code
asyncUsageCount
}
}
}
status
}
}
}
}
}
}# orders:query (by discount code) — validated against api_version 2025-01
query OrdersByDiscountCode($first: Int!, $after: String, $query: String) {
orders(first: $first, after: $after, query: $query) {
edges {
node {
id
createdAt
totalPriceSet {
shopMoney { amount currencyCode }
}
discountCodes
}
}
pageInfo {
hasNextPage
endCursor
}
}
}**Claude MUST emit the following output at each stage. This is mandatory.**
**On start**, emit:
╔══════════════════════════════════════════════╗ ║ SKILL: discount-ab-analysis ║ ║ 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>**On completion**, emit:
For `format: human` (default):
══════════════════════════════════════════════ OUTCOME SUMMARY Codes analyzed: <n> Date range: <start> to <end> Errors: 0 Output: none ══════════════════════════════════════════════
For `format: json`, emit:
{
"skill": "discount-ab-analysis",
"store": "<domain>",
"started_at": "<ISO8601>",
"completed_at": "<ISO8601>",
"dry_run": false,
"steps": [
{ "step": 1, "operation": "DiscountNodes", "type": "query", "params_summary": "<n> codes queried", "result_summary": "<n> discount nodes found", "skipped": false },
{ "step": 2, "operation": "OrdersByDiscountCode", "type": "query", "params_summary": "date range <start> to <end>", "result_summary": "<n> orders aggregated", "skipped": false }
],
"outcome": {
"codes_analyzed": 0,
"date_range_start": "<start>",
"date_range_end": "<end>",
"results": [
{
"code": "SAVE10",
"async_usage_count": 0,
"orders_in_range": 0,
"total_revenue": "0.00",
"avg_order_value": "0.00",
"revenue_per_use": "0.00"
}
],
"errors": 0,
"output_file": null
}
}A comparison table per code (displayed inline):
| Code | Uses (asyncUsageCount) | Orders in Range | Total Revenue | Avg Order Value | Revenue per Use | |------|------------------------|-----------------|---------------|-----------------|-----------------| | SAVE10 | ... | ... | ... | ... | ... | | WELCOME15 | ... | ... | ... | ... | ... |
For `format: json
Community-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…