/databrill-core:dbl-metrics-shopify-inventoryfrom databrill-core
Report Shopify stock — available, on hand, committed, incoming — by SKU, variant, location, or shop. Use when the user asks what stock the Shopify store holds, what is available on the website, stock at a Shopify location or warehouse, or which Shopify products are low. Do not use for Amazon FBA stock or The Fulfillment Lab stock.
Ships in databrill-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
On a user- or organization-scoped connector, call listWorkspaces, select the
workspace, and pass its wsid explicitly to every data tool. A workspace-scoped
connector URL supplies that wsid. Never infer it from stores or from a
listWorkspaces result with one entry.
Cross-cutting shape and traps for every shopify_* table:
${CLAUDE_PLUGIN_ROOT}/docs/shopify-data-shape.md. For the declared columns and
types of any shopify_* table, read
${CLAUDE_PLUGIN_ROOT}/docs/schema/shopify/index.tsv and then that table's
.yaml beside it.
There is no dedicated MCP tool for Shopify. Answer with the core MCP server's
executeSql against shopify_inventory_v1__InventoryLevel, one row per
(shopId, locationId, inventoryItemId).
tracked says whether a quantity means anything. Shopify keeps returning levels
for untracked items, and their numbers do not move with sales. Including them
changes any total, and can move the available figure in the opposite direction
from what you would guess, because untracked rows can carry large negative
values.
Put WHERE "tracked" on every stock total, and say so when you report the
figure. If the user genuinely wants the untracked rows, report the two groups
separately rather than in one sum.
available and onHand are stored as they
arrive and go negative on oversold items. Do not clamp them to zero, and do not
treat a negative total as a data error.fetchedAt, never shopifyUpdatedAt. Shopify's own
updatedAt does not always move when a quantity does. fetchedAt carries the
run instant on every row of a successful refresh, changed or not; rows older
than it are deleted for that shop. Report MAX("fetchedAt"). Never filter on
shopifyUpdatedAt.available, onHand, committed and incoming are
always present. reserved, safetyStock, damaged and qualityControl are
nullable because they depend on what the merchant's plan enables — a NULL means
the state was absent from the response, not that it was empty.incoming is untested here, so anything keyed on it is unproven. Say so
if you use it.levelGid is provenance, not a key or a join. Shopify returns a GID with a
query string whose numeric part is shared by every level at a location. Key on
(shopId, locationId, inventoryItemId).shopify_locations_v1__Location on
("shopId", "id") = ("shopId", "locationId"). hasActiveInventory is the
cheap answer to "why does this location have no stock rows" — a location with
it false returns no levels at all. Pass through inactive locations too; a
deactivated location can still hold stock.shopify_products_v1__ProductVariant on
("shopId", "id") = ("shopId", "variantId"), then
shopify_products_v1__Product. variantId is nullable on the schema's
authority — an inventory item need not belong to a variant — so use a LEFT
JOIN.sku is denormalised onto the level itself, so a plain stock report needs no
join at all.shopId is part of the key and a workspace can hold several shops, each with
several locations of its own. Group by shopId, or
state which shop a figure covers. Do not present a multi-shop total as one
store's stock. Join shopify_shop_v1__Shop for the name.
Tracked stock for the whole workspace, with freshness:
SELECT "shopId",
SUM("available") AS "available",
SUM("onHand") AS "onHand",
SUM("committed") AS "committed",
COUNT(*) AS "trackedLevels",
MAX("fetchedAt") AS "asOf"
FROM "shopify_inventory_v1__InventoryLevel"
WHERE "tracked"
GROUP BY "shopId";
By SKU, worst first:
SELECT "sku",
SUM("available") AS "available",
SUM("onHand") AS "onHand"
FROM "shopify_inventory_v1__InventoryLevel"
WHERE "tracked" AND "sku" IS NOT NULL
GROUP BY "sku"
ORDER BY "available" ASC
LIMIT 50;
By location:
SELECT l."name" AS "location", l."hasActiveInventory",
SUM(v."available") AS "available",
MAX(v."fetchedAt") AS "asOf"
FROM "shopify_inventory_v1__InventoryLevel" AS v
JOIN "shopify_locations_v1__Location" AS l
ON l."shopId" = v."shopId" AND l."id" = v."locationId"
WHERE v."tracked"
GROUP BY l."name", l."hasActiveInventory"
ORDER BY "available" DESC;
dbl-metrics-shopify-sales for store performance,
dbl-metrics-shopify-orders for what sold, dbl-metrics-shopify-catalog for the
catalogue and prices.
Shopify, Amazon FBA (dbl-metrics-amazon-inventory) and The Fulfillment Lab
(dbl-metrics-tfl-inventory) are three separate fulfilment networks with three
separate stock pools, three grains and three freshness clocks. Report them as
three labelled figures. Only add them together if the user explicitly asks for a
combined position, and then say which part came from where and as of when —
units can also be physically the same stock seen twice where TFL fulfils Shopify
orders, so a combined total is an estimate, not a measurement.
A workspace can have every Shopify location mapped to a TFL warehouse, so the Shopify levels describe TFL's stock rather than a separate pool — and the two sources still disagree, because they are read on different clocks. Do not reconcile them by arithmetic and do not present one as a check on the other. Report each with its source and its timestamp, and say the gap is unexplained if the user needs one number.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub databrill/databrill-core-agent-plugin --plugin databrill-core19 skills in this plugin
/dbl-ask-inventory-pacingRecommend how advertising should respond to inventory — pause, throttle, hold, or ramp spend based on each product's runway. Use when the user asks "should we pause ads before the stockout", "we're low on stock, what about ads", "should we cut spend to stretch inventory", "we restocked — ramp back up?", "how do we sell down overstock", "long-term storage fee risk", or wants an inventory-driven ad pacing decision./dbl-ask-sales-dropDiagnose why a store's sales dropped — decompose the change into traffic, conversion, and price, and flag ad-channel and ad-efficiency causes. Use when the user asks "why did sales drop / fall / decline", "sales are down", "revenue dropped", "why did orders fall", "what happened to sales (week-over-week)", or wants a sales-decrease diagnosis for a marketplace./dbl-Other plugins' skills for the same job