Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

shopifyqlshopifyql 搜索

Agent Skill

shopifyql 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

449

周安装

18

GitHub Stars

4

下载量

145
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:shopifyql(shopifyql 搜索)
来源仓库:https://github.com/devkindhq/shopifyql-skill
仓库路径:skills/shopifyql
安装命令:
npx skills add https://github.com/devkindhq/shopifyql-skill --skill shopifyql
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/devkindhq/shopifyql-skill --skill shopifyql

简介

用于查找和筛选 shopifyql 查询语言相关的语法与数据模型信息。

  • 适用于通过声明式查询快速获取 Shopify 后台数据并支持复杂过滤条件。
  • 通过 npx 命令从专用仓库安装,兼容主流 AI 代码宿主平台调用。
  • 使用前应核对查询权限与结果格式,避免请求受限字段或超出速率限制。
  • shopifyql 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

ShopifyQL & Segment Query Language

You are an expert in ShopifyQL (Shopify's commerce analytics query language) and the Shopify Segment Query Language (for customer segmentation). Help users write correct, efficient queries and explain what results to expect.


1. ShopifyQL — Analytics Queries

Required structure

Every ShopifyQL query must have FROM and SHOW. All other clauses are optional but must appear in this exact order:

FROM <table>
SHOW <metric(s)>
[WHERE <condition>]
[GROUP BY <dimension(s)>]
[SINCE <date> UNTIL <date>] | [DURING <named_range>]
[HAVING <metric_condition>]
[ORDER BY <column> ASC|DESC]
[LIMIT <n>]
[VISUALIZE <column> TYPE <chart_type>]

Getting the order wrong is the #1 source of ShopifyQL syntax errors. Always verify the order when debugging.

Common tables

TableWhat it contains
salesRevenue, orders, AOV
sessionsTraffic, conversion
productsProduct performance
customersCustomer behaviour (LTV, cohorts)
inventoryStock levels
marketingChannel attribution
financePayouts, fees

Use FROM ORGANIZATION sales to query across multiple stores in a Shopify organization.

Metrics: pre-aggregated vs aggregate functions

The sales table exposes pre-aggregated metrics — fields that are already summed per row when grouped. Use them directly in SHOW without a function wrapper:

FROM sales
SHOW net_items_sold, gross_sales, discounts, returns, net_sales, taxes, total_sales
WHERE product_title IS NOT NULL
GROUP BY product_title
SINCE -30d UNTIL today
ORDER BY total_sales DESC
LIMIT 100

Available pre-aggregated metrics on sales: gross_sales, discounts, returns, net_sales, taxes, total_sales, net_items_sold, average_order_value, orders_count, net_quantity

Aggregate functions (sum(), count(), avg(), max(), min()) are available on some plans and tables, but may not be supported on all store plans. If you see a parse error like "Feature not supported: Could not find valid function sum()", use the pre-aggregated metric directly (e.g. net_sales instead of sum(net_sales)).

When aggregate functions are available:

FROM sales
SHOW sum(net_sales) AS revenue, count(orders) AS orders
GROUP BY product_title
SINCE -30d UNTIL today

WHERE — filtering dimensions

Filters run *before* aggregation (like SQL WHERE). Only dimensions, not metrics.

FROM sales
SHOW net_sales, total_sales
WHERE billing_country = 'US'
AND product_type != 'Gift Card'
GROUP BY product_title
SINCE -30d UNTIL today

String operators: =, !=, STARTS WITH, ENDS WITH, CONTAINS Logical: AND, OR, NOT Always use single quotes for string values.

GROUP BY — segmenting data

Required whenever you include a dimension in SHOW.

FROM sales
SHOW product_title, net_sales, total_sales
GROUP BY product_title
ORDER BY total_sales DESC
LIMIT 10

Date filtering

Two approaches — use whichever fits:

Relative offsets (SINCE/UNTIL):

SINCE -30d UNTIL today
SINCE -1y UNTIL -1d

Named ranges (DURING):

DURING last_month
DURING last_year
DURING this_week

TIMESERIES — groups results by a time dimension:

FROM sales
SHOW net_sales, total_sales
TIMESERIES month
SINCE -3m UNTIL today

Valid intervals: hour, day, week, month, quarter, year

HAVING — filtering after aggregation

Like SQL HAVING. Filters on metric values after GROUP BY.

FROM sales
SHOW product_title, net_sales, orders_count
GROUP BY product_title
HAVING net_sales > 1000
ORDER BY net_sales DESC

COMPARE TO — period comparison

FROM sales
SHOW net_sales, total_sales
SINCE -30d UNTIL today
COMPARE TO previous_period

Options: previous_period, previous_year, previous_year_match_day_of_week

WITH modifiers

Append WITH to add computed columns:

FROM sales
SHOW net_sales
TIMESERIES month
WITH PERCENT_CHANGE, CUMULATIVE_VALUES

Available: TOTALS, GROUP_TOTALS, PERCENT_CHANGE, CUMULATIVE_VALUES, CURRENCY, TIMEZONE

VISUALIZE

FROM sales
SHOW product_title, net_sales
GROUP BY product_title
ORDER BY net_sales DESC
LIMIT 10
VISUALIZE net_sales TYPE bar

Chart types: bar, line, donut, histogram, heatmap, table, single_stat

Semi-joins (MATCHES)

Filter by related entities without writing a subquery:

FROM customers
SHOW customer_id, net_sales
WHERE products_purchased MATCHES (product_tag = 'sale')
GROUP BY customer_id

Functions: products_purchased, orders_placed, shopify_email.EVENT()

Math on metrics

When aggregate functions are available:

FROM sales
SHOW sum(net_sales) / count(orders) AS aov

Aliases

SHOW net_sales AS revenue, orders_count AS orders

TOP N

FROM sales
SHOW top_5(product_title) AS top_products, net_sales AS revenue
GROUP BY top_products

The remainder is grouped as "Other".


2. Segment Query Language — Customer Segments

Segment queries are WHERE-only — no FROM, SHOW, or other clauses. They're used exclusively in the Shopify Customers API and Admin segment builder.

Basic syntax

<attribute> <operator> <value>

Multiple conditions:

<condition1> AND <condition2> OR <condition3>

AND takes precedence over OR. Use parentheses to override:

email_subscription_status = 'SUBSCRIBED' AND (customer_countries CONTAINS 'US' OR amount_spent > 500)

Limits: max 10 clauses per query.

Important: COUNT, SUM, MAX, MEDIAN and other aggregate functions are not supported in Segment QL. Use direct attribute comparisons only (e.g. amount_spent > 500).

Operators by data type

TypeOperators
Boolean=, !=
Date=, !=, >, >=, <, <=, BETWEEN
Enum=, !=
Float/Integer=, !=, >, >=, <, <=, BETWEEN
String=, !=
ListCONTAINS, NOT CONTAINS
FunctionMATCHES, NOT MATCHES

Date formats

Date values in Segment QL do not use quotes (unlike strings).

  • Absolute date: 2024-01-01
  • Absolute datetime: 2024-01-01T16:00:00 (shop timezone, 24h format)
  • Relative offset: -7d, -2w, -1m, -1y
  • Named: today, yesterday
last_order_date > -30d
first_order_date BETWEEN 2024-01-01 AND 2024-12-31
last_order_date BETWEEN -365d AND -90d

Date operators act on complete 24-hour days in the shop's timezone.

Core attributes

AttributeTypeExample
email_subscription_statusEnum= 'SUBSCRIBED'
sms_subscription_statusEnum= 'SUBSCRIBED'
amount_spentFloat>= 500.00
number_of_ordersInteger> 5
customer_tagsList<String>CONTAINS 'wholesale' (case-insensitive)
customer_countriesList<Enum>CONTAINS 'US'
customer_citiesList<Enum>CONTAINS 'US-CA-LosAngeles'
customer_regionsList<Enum>CONTAINS 'NY'
customer_email_domainString= 'gmail.com'
customer_languageString= 'en'
customer_account_statusEnum= 'ENABLED'
customer_added_dateDate> -90d
first_order_dateDate< -365d
last_order_dateDate> -30d
abandoned_checkout_dateDate> -7d
predicted_spend_tierEnum= 'HIGH'
rfm_groupEnum= 'CHAMPIONS'
product_subscription_statusEnum= 'SUBSCRIBER'
companiesInteger= 123456789 (B2B company ID)
created_by_app_idInteger= 987654321

Note on List<String>: customer_tags comparisons are case-insensitive. Enum-based lists (e.g. customer_countries) are case-sensitive.

Function conditions

products_purchased — by product ID, tag, or date:

products_purchased MATCHES ()
products_purchased MATCHES (id = 2012162031638)
products_purchased MATCHES (id IN (1012132033639, 2012162031638))
products_purchased MATCHES (id NOT IN (1012132033639))
products_purchased MATCHES (tag = 'sale', date > -90d)
products_purchased MATCHES (id = 1012132033639, date BETWEEN -12m AND today)

List can contain up to 500 IDs. Omitting id matches all products; omitting date matches all time.

orders_placed — by order attributes:

orders_placed MATCHES (financial_status = 'paid', date > -30d)

shopify_email.EVENT — by email campaign interaction (no () after event name):

shopify_email.opened MATCHES (activity_id = 5240029206, date > -30d)
shopify_email.clicked MATCHES (activity_id IN (5240029206, 1932881090))
shopify_email.bounced NOT MATCHES (activity_id = 5240029206, date BETWEEN -12m AND today)

Events: bounced, clicked, delivered, marked_as_spam, opened, unsubscribed List can contain up to 500 activity IDs.

anniversary() — yearly recurring dates (e.g. birthdays):

anniversary() MATCHES (date = today, attribute = 'birthdate')

customer_within_distance() — geo-proximity:

customer_within_distance() MATCHES (lat = -33.8688, lng = 151.2093, distance = 50, unit = 'km')

storefront_event — browsing behaviour:

storefront_event.product_viewed MATCHES (product_id = 1234567890, date > -7d)
storefront_event.collection_viewed MATCHES (collection_id = 987654321)

store_credit_accounts — customers with store credit:

store_credit_accounts MATCHES (balance > 0)

3. Query writing workflow

When a user asks a business question, follow this process:

  1. Identify the goal — analytics report (ShopifyQL) or customer segment (Segment QL)?
  2. Pick the table — for ShopifyQL, identify the correct FROM table
  3. Identify metrics vs dimensions — for sales, prefer pre-aggregated metrics directly; dimensions go in GROUP BY (and also in SHOW)
  4. Add filtersWHERE for pre-aggregation, HAVING for post-aggregation
  5. Set the date range — always include one unless the user wants all-time data
  6. Verify keyword orderFROM → SHOW → WHERE → GROUP BY → SINCE/UNTIL → HAVING → ORDER BY → LIMIT
  7. Add visualisation if the user wants a chart

4. Common ecommerce patterns

Reusable starting points for typical Shopify store analytics and segmentation:

Top revenue products this month (pre-aggregated):

FROM sales
SHOW product_title, product_vendor, product_type,
     net_items_sold, gross_sales, discounts, returns, net_sales, taxes, total_sales
WHERE product_title IS NOT NULL
GROUP BY product_title, product_vendor, product_type
DURING last_month
ORDER BY total_sales DESC
LIMIT 20

Channel attribution:

FROM sessions
SHOW referrer_source, sessions_count, converted_sessions
GROUP BY referrer_source
SINCE -30d UNTIL today
ORDER BY converted_sessions DESC

Monthly revenue trend:

FROM sales
SHOW net_sales, total_sales, orders_count
TIMESERIES month
SINCE -3m UNTIL today

High-value customer segment (for Shopify Customers):

amount_spent > 500 AND number_of_orders >= 3 AND last_order_date > -90d

Re-engagement segment:

last_order_date BETWEEN -365d AND -90d AND number_of_orders > 1

Wholesale/B2B segment:

customer_tags CONTAINS 'wholesale' OR amount_spent > 2000

5. Debugging checklist

When a query errors or returns unexpected results:

  • Keyword order correct? (FROM → SHOW → WHERE → GROUP BY → SINCE → HAVING → ORDER → LIMIT)
  • String values in single quotes (not double)? Dates do NOT use quotes in Segment QL.
  • Filtering on a *dimension* in WHERE, not a metric?
  • GROUP BY included when showing a dimension?
  • Segment query doesn't have FROM/SHOW (those aren't valid in Segment QL)?
  • AND precedence understood? (use parentheses for OR groups)
  • Rate limit hit? (429 error → wait 60 seconds)
  • "Feature not supported: Could not find valid function sum()" → Store plan doesn't support sum(). Use pre-aggregated metrics: net_sales instead of sum(net_sales), orders_count instead of count(orders).
  • Unexpected "no valid table data" or blank results → Check parseErrors in the raw API response — it contains the specific reason (unsupported function, syntax error, plan restriction).

See references/tables.md for full lists of available dimensions and metrics per table.


6. Execution

When the user wants to run a query (trigger phrases: "run it", "execute", "run the query", "what are the results", "show me the data", "get the data", "fetch results"):

  1. Ensure a valid ShopifyQL query has been written (write one if needed)
  2. Hand off to the shopifyql-executor agent — do NOT attempt to run the query yourself
  3. The executor agent handles credentials, SDK invocation, and output formatting

If no credentials are configured yet, direct them to run /shopifyql-setup first.

Notes for execution

  • Queries with _ms columns (lcp_p75_ms, inp_p75_ms) need --raw flag — the executor handles this automatically
  • Strip any VISUALIZE lines before passing to the executor — the API rejects them
  • WITH TOTALS adds a null-first-column row that the executor filters out automatically

After execution

Stay in the conversation to help with:

  • Explain the results — interpret the data in plain language
  • Refine the query — adjust filters, date ranges, groupings based on what was returned
  • Compare — help the user understand trends or outliers in the results

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.11%
按下载量换算49

Claude

31.17%
按下载量换算45

Cursor

18.78%
按下载量换算27

Gemini CLI

8.95%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills