Skip to content
Agentmart
Submit a tool

storefront-conventions

What storefront's measures actually count, and the four places a reasonable reading of them is wrong.

Skill by malloydata

IndexedMIT★ 118
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/malloydata-storefront-conventions

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

What storefront's measures actually count, and the four places a reasonable reading of them is wrong. Read before answering any revenue, order, margin, or region question against this package.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/storefront-conventions

What's inside

Skill name
storefront-conventions
Description
What storefront's measures actually count, and the four places a reasonable reading of them is wrong. Read before answering any revenue, order, margin, or region question against this package.
License
MIT
Instructions
72 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Storefront conventions

Everything here is a property of this package's model, not of Malloy. The
numbers quoted were measured against the bundled data on 2026-09-04 and are
there to show the size of each effect, not to be reused as answers.

## The grain is a line item

`order_items` has one row per product sold on an order. 25,356 rows, 11,000
orders.

So `order_item_count` (`count()`) counts lines and `order_count`
(`count(order_id)`) counts orders. A question about orders that reaches for the
row count is wrong by a factor of about 2.3 here.

## total_sales includes cancelled and returned lines

This is the one that bites. `total_sales` is `sale_price.sum()` over every row,
with no status filter:

| Scope | Revenue |
| --- | --- |
| Everything (`total_sales` as defined) | 2,098,177.97 |
| Excluding `Cancelled` and `Returned` | 1,905,657.16 |

9.2% of what the model calls revenue is a line that was cancelled or sent back.
Nothing in the field name or its `#(doc)` says so.

Decide which one the question wants, and say which you used. If it wants
realised revenue, filter it yourself:

```malloy
run: order_items -> {
  where: status != 'Cancelled' and status != 'Returned'
  aggregate: total_sales
}
```

`status` takes five values: `Complete`, `Shipped`, `Processing`, `Returned`,
`Cancelled`. Every line on an order shares that order's status, so filtering
lines by status does not split an order across groups.

## return_rate is a share of lines

`return_rate` is returned line items over all line items. It is not the share of
orders that had a return. If the question is about orders, aggregate
`order_count` with a `Returned` filter against total `order_count` instead.

## region is where the customer lives

`regions` joins through `customers.state`, so `region` is the customer's home
region. It is not a shipping destination or a sales territory. A question about
where goods went cannot be answered from this model.

## margin is gross, and per line

`gross_margin` is `sale_price - products.cost` on a single line, and
`margin_rate` is `total_margin / total_sales`. Cost of goods only: no
discounts, no shipping, no returns netted out, no operating cost. Call it gross
margin in the answer, never "profit".

## What this package cannot answer

Say so plainly rather than substituting a proxy:

- Net revenue, discounts, tax, shipping. Not modelled.
- Customer churn or retention cohorts. There is a `signup_date` on `customers`
  but no subscription or activity table.
- Inventory, stock levels, fulfilment times. Not modelled.
- Anything about where an order shipped. See region, above.

From malloydata/publisher, MIT.

More from malloydata/publisher

Compare and alternatives

    Featured in

    Signals

    Stars
    118
    Forks
    31
    Open issues
    106
    Last commit (this folder)
    Oct 12, 2026 (15 days ago)
    Last release
    Oct 18, 2026 (9 days ago)

    From GitHub (fetched Oct 24, 2026).

    Details

    License
    MIT
    First seen
    Oct 24, 2026
    Last checked
    Oct 24, 2026

    More from malloydata

    Cite this page

    storefront-conventions skill. Agent Mart. https://agentmart.dev/skills/malloydata-storefront-conventions (last updated 2026-10-24)