A Claude Code skill for writing, executing, debugging, and explaining ShopifyQL analytics queries and Shopify Segment Query Language customer filters.
Triggers automatically when you ask Claude to:
- Write a ShopifyQL report query (
FROM sales SHOW ...) - Run or execute a query against your live store
- Build a customer segment filter
- Debug a ShopifyQL syntax error
- Translate a business question into a Shopify analytics query
- Understand available tables, dimensions, or metrics
- ShopifyQL — full query structure, strict keyword ordering, all clauses (
WHERE,GROUP BY,TIMESERIES,HAVING,COMPARE TO,VISUALIZE,WITHmodifiers, semi-joins, math on metrics,TOP N) - Segment Query Language — all attribute types, operators, date formats, and functions (
products_purchased,orders_placed,shopify_email,anniversary,customer_within_distance,storefront_event) - Common ecommerce patterns — top products, channel attribution, re-engagement, high-value customers, wholesale/B2B segments
- Debugging checklist — ordered list of the most common ShopifyQL errors
This plugin can execute ShopifyQL queries directly against your Shopify store.
- Python 3.11:
brew install python@3.11 - Dependencies:
pip3.11 install 'shopifyql[all]' pandas python-dotenv certifi - A Shopify Custom App with scopes:
read_analytics,read_reports,read_customers,read_orders
Run once per project:
/shopifyql-setup
This saves your credentials to .env (gitignored). Or create .env manually:
SHOPIFY_STORE_URL=my-store.myshopify.com
SHOPIFY_ACCESS_TOKEN=shpat_xxxx
- Ask Claude to write a ShopifyQL query
- Say "run it" or "execute" — the
shopifyql-executoragent takes over - Results ≤ 20 rows appear as a table in chat; larger results are saved as CSV to
./shopifyql-results/
python3.11 scripts/execute_query.py \
--query "FROM sales SHOW net_sales SINCE 2026-01-01 UNTIL 2026-01-31"
# For _ms duration columns (LCP, INP):
python3.11 scripts/execute_query.py --raw \
--query "FROM web_performance SHOW lcp_p75_ms GROUP BY day TIMESERIES day SINCE 2026-01-01 UNTIL 2026-01-31"
# CSV output:
python3.11 scripts/execute_query.py --output csv \
--query "FROM sales SHOW net_sales GROUP BY product_title SINCE 2026-01-01 UNTIL 2026-01-31 ORDER BY net_sales DESC LIMIT 20"Columns ending in _ms (lcp_p75_ms, inp_p75_ms) trigger a type-cast bug in query_pandas(). Use --raw for these — the executor agent handles this automatically.
Register the marketplace and install:
/plugin marketplace add devkindhq/shopifyql-skill
/plugin install shopifyql@shopifyql-skillClone this repo and point Claude Code at it, or copy skills/shopifyql/SKILL.md into your own plugin.
MIT