Linen tote led the week with $8,268
The top 5 products made $19,261, 46% of the week's $41,880 in sales. Canvas apron is new to the top 5.
Mondays: last week's best-selling Shopify products by revenue and units, what moved against the week before, and which top sellers are low on stock.
Reads
You get
The card on the right is a sample. Yours shows your own numbers and updates in place every run.
What lands on your board
The top 5 products made $19,261, 46% of the week's $41,880 in sales. Canvas apron is new to the top 5.
Knowing what sold last week decides what goes in this week's email, which ad gets the budget and what to reorder. Shopify's product report answers it, once you set the date range, pick the right columns and remember what the week before looked like.
The agent ranks last week's products by revenue, puts the previous week next to each, and points out newcomers and big movers. It also checks stock on the leaders, because the product that doubled its sales is usually the next one to run out.
Query orders created from Monday 00:00 to Sunday 24:00 in the shop's timezone, with test, cancelledAt and lineItems(first: 100) { nodes { currentQuantity discountedTotalSet { shopMoney { amount } } product { id title totalInventory } } }.
Run the same query for the previous Monday to Sunday, so every product has two weeks to compare.
Skip test and canceled orders, group by product, sum currentQuantity and discountedTotalSet, and rank by revenue. Note each product's change against the week before and mark newcomers to the top five.
For each top-five product, divide totalInventory by last week's average daily units. Anything under 14 days gets a line in the report.
The top five with units, revenue and change, their share of the week's sales, the biggest riser and faller further down the list, and the stock warnings.
With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.
Pick your agent, where the data comes from and how to schedule it; the commands below follow.
One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.
shellcurl -fsSL https://briefkin.dev/skills/shopify-top-products/install | shAsk Claude Code:
promptRun the shopify-top-products skillOr paste the prompt instead of installing:
promptUsing the Shopify Admin GraphQL API (read only), rank last week's products (Monday to Sunday, shop timezone) by revenue. Leave out test and canceled orders, and use each line item's currentQuantity and discountedTotalSet so returns and discounts are taken off. Give me the top 5 with units, revenue and the change against the week before, their share of the week's total sales, any product new to the top 5, and the biggest riser and faller outside it. For each top-5 product, check totalInventory and warn me if it covers less than 14 days at last week's pace.Mondays at 8:00, from cron on any machine where Claude Code is signed in:
crontab0 8 * * 1 claude -p "Run the shopify-top-products skill"Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.
Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a report card. How setup works
SKILL.md---
name: shopify-top-products
description: "Mondays: last week's best-selling Shopify products by revenue and units, what moved against the week before, and which top sellers are low on stock. Use when the user asks for this, or when it runs on a schedule."
---
# Shopify top products this week
Mondays: last week's best-selling Shopify products by revenue and units, what moved against the week before, and which top sellers are low on stock.
Knowing what sold last week decides what goes in this week's email, which ad gets the budget and what to reorder. Shopify's product report answers it, once you set the date range, pick the right columns and remember what the week before looked like.
The agent ranks last week's products by revenue, puts the previous week next to each, and points out newcomers and big movers. It also checks stock on the leaders, because the product that doubled its sales is usually the next one to run out.
## Two ways to get the data
Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.
## Route A: API or MCP server
### What you need
- Admin API access to the store with `read_orders` and `read_products`: a Shopify connector or MCP server, or a custom app token in `SHOPIFY_ADMIN_TOKEN`.
If something is missing, say what and stop; do not invent numbers.
### Steps
1. **Pull last week's orders** (Shopify): Query `orders` created from Monday 00:00 to Sunday 24:00 in the shop's timezone, with `test`, `cancelledAt` and `lineItems(first: 100) { nodes { currentQuantity discountedTotalSet { shopMoney { amount } } product { id title totalInventory } } }`.
2. **Pull the week before** (Shopify): Run the same query for the previous Monday to Sunday, so every product has two weeks to compare.
3. **Rank the products**: Skip test and canceled orders, group by product, sum `currentQuantity` and `discountedTotalSet`, and rank by revenue. Note each product's change against the week before and mark newcomers to the top five.
4. **Check stock on the leaders**: For each top-five product, divide `totalInventory` by last week's average daily units. Anything under 14 days gets a line in the report.
5. **Write the report**: The top five with units, revenue and change, their share of the week's sales, the biggest riser and faller further down the list, and the stock warnings.
## Route B: the browser
### What you need
- Signed in to Shopify as the owner or staff with **Reports** and **Products** permissions, with the right store picked.
If something is missing, say what and stop; do not invent numbers.
### Steps
Start at https://admin.shopify.com/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.
1. **Open Sales by product for last week**: Open the store from admin.shopify.com, then **Analytics > Reports > Sales by product**. Set the date picker to **Last week** (Monday to Sunday) and **Compare to: Previous period**, and sort by **Net sales** descending.
2. **Read the top five and the movers**: For the first five rows take **Net items sold**, **Net sales** and the change column. Note any product that was not in the top five in the comparison period. Scan the rest of the list for the biggest rise and fall in net sales.
3. **Get the week's total**: Read **Net sales** in the report's summary row, or open **Sales over time** for the same range, to work out the top five's share.
4. **Check stock on the leaders**: Go to **Products**, search each top-five product and read **Inventory** on the product list (the total across variants). Divide by last week's units per day; anything under 14 days gets a warning.
Note: This is a case where the browser route is the easier one: the Sales by product report already shows the comparison. It reports products, not variants; switch to the Sales by product variant SKU report when colors or sizes matter. Returns are dated to the refund, so a week's net sales can differ slightly from the API route.
## The report
- **Top products** by revenue: units, revenue, change against the week before.
- Their share of the week's total sales.
- Newcomers to the top five, and the biggest riser and faller outside it.
- Top sellers with less than two weeks of stock.
## Post it to Briefkin
When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.
```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
-H "authorization: Bearer $BRIEFKIN_TOKEN" \
-H "content-type: application/json" \
-d @- <<'JSON'
{
"v": 1,
"event_id": "shopify-top-products/<date of this run, e.g. 2026-10-16>",
"item_key": "shopify-top-products",
"project": "Acme Store",
"source": "Shopify top products this week skill",
"kind": "update",
"title": "Linen tote led the week with $8,268",
"summary": "The top 5 products made **$19,261**, 46% of the week's **$41,880** in sales. Canvas apron is new to the top 5.",
"widget": [
{
"type": "Table",
"props": {
"columns": [
"Product",
"Units",
"Revenue",
"vs last week"
],
"align": [
"left",
"right",
"right",
"right"
],
"rows": [
[
"Linen tote",
212,
"$8,268",
"+18%"
],
[
"Ceramic mug",
154,
"$3,696",
"+6%"
],
[
"Wool throw",
31,
"$3,410",
"-12%"
],
[
"Beeswax candle",
118,
"$2,242",
"+41%"
],
[
"Canvas apron",
47,
"$1,645",
"new"
]
]
}
},
{
"type": "Callout",
"props": {
"text": "Beeswax candle is up 41% with 96 left in stock: about 6 days at this pace.",
"tone": "warn"
}
}
]
}
JSON
```
Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.
## Run it on a schedule
Suggested: Mondays at 8:00 (`0 8 * * 1`). From cron, with the agent signed in on that machine:
```bash
0 8 * * 1 claude -p "Run the shopify-top-products skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```
Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/shopify-top-products#schedule
Source: https://briefkin.dev/skills/shopify-top-products
Admin API access to the store with read_orders and read_products: a Shopify connector or MCP server, or a custom app token in SHOPIFY_ADMIN_TOKEN.
npx -y @shopify/dev-mcp@latest) covers docs and API schemas, not your store's orders; for store data, community MCP servers exist.read_orders, read_products and read_inventory, and store SHOPIFY_STORE_DOMAIN (acme.myshopify.com) and SHOPIFY_ACCESS_TOKEN. Requests go to https://acme.myshopify.com/admin/api/2026-10/graphql.json with the X-Shopify-Access-Token header. Orders older than 60 days also need read_all_orders.Request only read_ scopes when you install the app; Shopify enforces them per token, so the agent can't edit products, refund or cancel orders.
Products by default, so a tote in four colors is one line. Ask for variants when sizes or colors matter, for example to decide which colorway to reorder, and the agent groups by variant.id instead.
Returns and order edits after the fact lower currentQuantity, so a week can shrink a little as refunds come in. The skill uses current quantities on purpose: units that came back weren't really sold.
No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a report card, so you can glance at it instead of asking again.
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.
Yes. Switch the data source to "Your browser" and the steps change to the Shopify pages themselves: the agent opens admin.shopify.com in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.
Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.
Free during the open beta. No card.