If you've written ShopifyQL queries more than a handful of times, you know the drill — open the docs, check the keyword order, remember whether HAVING comes before or after ORDER BY, double-check the segment function syntax, close the tab, repeat.
I got tired of it and built a Claude Code skill that bakes all of that knowledge directly into Claude.
What it does
The skill auto-triggers whenever you ask Claude to:
- Write a ShopifyQL analytics query
- Build a customer segment filter
- Debug a ShopifyQL error
- Translate a business question into a query ("show me top products by revenue last month")
No slash commands, no setup per-session. It just kicks in.
What's covered
ShopifyQL (analytics queries)
Full syntax support including the strict keyword ordering that trips everyone up:
FROM → SHOW → WHERE → GROUP BY → SINCE/UNTIL → HAVING → ORDER BY → LIMIT → VISUALIZE
Plus: TIMESERIES, COMPARE TO, WITH modifiers (PERCENT_CHANGE, CUMULATIVE_VALUES, etc.), VISUALIZE, semi-joins, math on metrics, and TOP N.
Segment Query Language (customer segments)
All attribute types, operators, and functions:
products_purchased MATCHES (tag = 'sale', date > -90d)
storefront_event.product_viewed MATCHES (product_id = 1234567890, date > -7d)
shopify_email.opened MATCHES (activity_id = 5240029206, date > -30d)
anniversary() MATCHES (date = today, attribute = 'birthdate')
customer_within_distance() MATCHES (lat = 40.7128, lng = -74.0060, distance = 50, unit = 'km')
Common patterns built in
Things like top revenue products, channel attribution, high-value customer segments, re-engagement filters — ready to use or adapt.
Debugging checklist
The most common ShopifyQL mistakes in one place:
- Keyword order wrong?
- String values in double quotes instead of single?
- Filtering on a metric in
WHEREinstead ofHAVING? - Missing
GROUP BYwhen showing a dimension? - Rate limit hit (429 → wait 60 seconds)?
Install
/plugin marketplace add devkindhq/shopifyql-skill
/plugin install shopifyql@shopifyql-skill
That's it. Restart Claude Code and it's active.
Example
Ask Claude something like:
"Show me revenue by channel for the last 30 days with a comparison to the previous period"
And it'll produce:
FROM sessions
SHOW referrer_source, sum(converted_sessions) AS conversions, sum(net_sales) AS revenue
GROUP BY referrer_source
SINCE -30d UNTIL today
COMPARE TO previous_period
ORDER BY revenue DESC
Or for a segment:
"Customers who bought in the last 90 days, spent over $500, and are subscribed to email"
amount_spent > 500 AND number_of_orders >= 1 AND last_order_date > -90d AND email_subscription_status = 'SUBSCRIBED'
GitHub
The skill is open source. PRs welcome — especially if you have common query patterns worth adding.
Top comments (0)