From shopify-admin-skills
Tracks total discount dollars over configurable time buckets (week/month/quarter), broken down by discount type and code. Answers whether discount spend is trending up or down.
How this skill is triggered — by the user, by Claude, or both
Slash command
/shopify-admin-skills:shopify-admin-discount-cost-trendThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Tracks how much money the store gave away in discounts over time, bucketed by week, month, or quarter, and broken down by discount code and discount type (percentage / fixed amount / free shipping / automatic). Answers: "is our discount spend trending up or down, and which campaigns are driving it?" Read-only — no mutations. Complements `discount-roi-calculator` (per-discount return) with a lon...
Tracks how much money the store gave away in discounts over time, bucketed by week, month, or quarter, and broken down by discount code and discount type (percentage / fixed amount / free shipping / automatic). Answers: "is our discount spend trending up or down, and which campaigns are driving it?" Read-only — no mutations. Complements discount-roi-calculator (per-discount return) with a longitudinal view of total cost.
shopify store auth --store <domain> --scopes read_ordersread_orders| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| period | string | no | month | Bucket size: week, month, or quarter |
| periods_back | integer | no | 12 | Number of buckets to report |
| top_codes | integer | no | 10 | Top discount codes to break out individually; remainder grouped as other |
| include_shipping_discounts | bool | no | true | Whether to count shipping discounts in the totals |
| format | string | no | human | Output format: human or json |
ℹ️ Read-only skill — no mutations are executed. Safe to run at any time.
Compute window from period × periods_back (e.g., month × 12 → last 12 calendar months starting from the first day of the bucket 11 months ago)
OPERATION: orders — query
Inputs: query: "created_at:>='<window_start>' financial_status:paid", first: 250, select createdAt, discountCodes, currentTotalDiscountsSet, totalDiscountsSet, cartDiscountAmountSet, discountApplications { allocationMethod, targetType, value, ... on DiscountCodeApplication { code }, ... on AutomaticDiscountApplication { title }, ... on ManualDiscountApplication { title } }, shippingLines { discountAllocations { allocatedAmountSet } }, pagination cursor
Expected output: All paid orders in the window with discount data; paginate until hasNextPage: false
For each order, attribute discount cost:
cart_discount = currentTotalDiscountsSet.shopMoney.amountshipping_discount = sum of shippingLines.discountAllocations.allocatedAmountSet (only if include_shipping_discounts: true)total_discount = cart_discount + shipping_discountdiscountApplications.code for code discounts, title for automatic / manualBucket each order into its period (week-of-year, year-month, or year-quarter) and aggregate:
Identify top codes by total cost across the window; aggregate the rest as other
# orders:query — validated against api_version 2025-01
query DiscountCostTrend($query: String!, $after: String) {
orders(first: 250, after: $after, query: $query) {
edges {
node {
id
name
createdAt
discountCodes
currentTotalDiscountsSet { shopMoney { amount currencyCode } }
totalDiscountsSet { shopMoney { amount currencyCode } }
cartDiscountAmountSet { shopMoney { amount currencyCode } }
discountApplications(first: 10) {
edges {
node {
allocationMethod
targetType
targetSelection
value {
... on PricingPercentageValue { percentage }
... on MoneyV2 { amount currencyCode }
}
... on DiscountCodeApplication { code }
... on AutomaticDiscountApplication { title }
... on ManualDiscountApplication { title description }
}
}
}
shippingLines(first: 5) {
edges {
node {
title
discountAllocations {
allocatedAmountSet { shopMoney { amount currencyCode } }
}
}
}
}
}
}
pageInfo { hasNextPage endCursor }
}
}
Claude MUST emit the following output at each stage. This is mandatory.
On start, emit:
╔══════════════════════════════════════════════╗
║ SKILL: Discount Cost Trend ║
║ Store: <store domain> ║
║ Period: <period> × <periods_back> ║
║ 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):
══════════════════════════════════════════════
DISCOUNT COST TREND (last <periods_back> <period>s)
Total discount cost: $<amount>
Avg per <period>: $<amount>
Latest <period>: $<amount> (<delta_vs_prev_pct>% vs prior)
By bucket:
2025-Q1 $<n> (cart $<n> / shipping $<n>)
2025-Q2 $<n> (cart $<n> / shipping $<n>)
By discount type:
code $<n> (<pct>%)
automatic $<n> (<pct>%)
manual $<n> (<pct>%)
shipping $<n> (<pct>%)
Top codes (by total cost):
"<code>" $<n> (<pct>%)
"<code>" $<n> (<pct>%)
other $<n> (<pct>%)
Output: discount_cost_trend_<date>.csv
══════════════════════════════════════════════
For format: json, emit:
{
"skill": "discount-cost-trend",
"store": "<domain>",
"period": "month",
"periods_back": 12,
"total_discount_cost": 0,
"by_bucket": [],
"by_type": { "code": 0, "automatic": 0, "manual": 0, "shipping": 0 },
"top_codes": [],
"currency": "USD",
"output_file": "discount_cost_trend_<date>.csv"
}
CSV file discount_cost_trend_<YYYY-MM-DD>.csv with columns:
bucket, discount_code_or_title, discount_type, orders_count, cart_discount, shipping_discount, total_discount, currency
| Error | Cause | Recovery |
|---|---|---|
THROTTLED | API rate limit exceeded | Wait 2 seconds, retry up to 3 times |
| Stacked discount codes | Multiple codes on one order | Attribute proportionally to each code by their value share, or label as multi-code if equal |
| Manual discount with no title | Cashier-entered with empty title | Group as manual:untitled |
| Multi-currency orders | Presentment currency != shop currency | Sum on shopMoney.amount (shop currency) for consistency |
period: week for promotional businesses with frequent campaigns; period: month for stores with steady evergreen offers; period: quarter for board reporting.discount-roi-calculator to verify the cost increase is producing matching incremental revenue.include_shipping_discounts: false if your accounting books shipping subsidy separately from product discounts.npx claudepluginhub 40rty-ai/shopify-admin-skills --plugin shopify-admin-skillsCalculates ROI of Shopify discount codes by comparing incremental revenue against discount cost, including AOV lift/drop, new customer %, and cannibalization risk. Read-only.
Triages WooCommerce coupon performance by analyzing discount impact, revenue drivers, acquisition metrics, and effective costs using built-in analytics tools.
Manages Wix coupons and discounts via REST API: query active/expired/usage-based lists, create fixed-amount/percent-off types, detect conflicts, calculate margins.