Fairshop SKU Margins

v0.1.0
io.github.fpavia111-creator/fairshop-sku-margins Checked 4 hours ago Published 3 days ago

Works out contribution margin per SKU and channel from sales, fees, shipping labels and unit costs

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

fairshop_info

Show this pack: pinned model, mode, caps, Auto opt-ins, and the allow/ask/block decision for every tool.

fairshop_inspect_input

Show how a CSV, TSV, Excel, JSON or JSONL file under the root would be read: its format, which export it looks like, which of its columns map to this pack's columns, and what each column holds. Returns column names and shapes only, never cell values. Use it before a tool when a file comes straight from another system.

ParameterTypeDescription
path *stringA CSV, TSV, Excel .xlsx, JSON or JSONL file under the root
asstringSource kind to read it as (default: every kind this agent declares, best match first)
sheetstring | integerExcel sheet name or 0-based index (default: first visible sheet)

margins_margins Work out margin per SKU and channel

[ALLOW] Income (revenue plus shipping charged) less unit cost, fees and shipping labels for every SKU on every channel, with the margin percent.

ParameterTypeDescription
costs *stringUnit costs under --root: SKU, unit cost (landed, if you have it)
sales *stringSales lines under --root: order, date, channel, SKU, quantity, revenue (after discounts, before tax), shipping charged, fees
labelsstringShipping label costs under --root (optional): order, label cost; split across the order lines by revenue
settingsstringOptional settings JSON: margin_floor_pct

margins_explain Explain one SKU

[ALLOW] Show the income, costs and margin of one SKU on every channel.

ParameterTypeDescription
costs *stringUnit costs under --root: SKU, unit cost (landed, if you have it)
sales *stringSales lines under --root: order, date, channel, SKU, quantity, revenue (after discounts, before tax), shipping charged, fees
sku *stringSKU or channel|SKU id from margins_margins
labelsstringShipping label costs under --root (optional): order, label cost; split across the order lines by revenue
settingsstringOptional settings JSON: margin_floor_pct

margins_write_report Write the sku-margins worklist

[ALLOW] Write sku-margins.csv (every SKU and channel) and .html (by channel, every pair) into out_dir (default fairshop-out/margins).

ParameterTypeDescription
costs *stringUnit costs under --root: SKU, unit cost (landed, if you have it)
sales *stringSales lines under --root: order, date, channel, SKU, quantity, revenue (after discounts, before tax), shipping charged, fees
labelsstringShipping label costs under --root (optional): order, label cost; split across the order lines by revenue
out_dirstringFolder under --root for the report files (default fairshop-out/margins)
settingsstringOptional settings JSON: margin_floor_pct

margins_draft_pricing_review Draft a pricing review

[ASK] Write drafts/pricing_review-skus.md: every SKU and channel losing money, under the floor or without a cost, with a blank option. Marked DRAFT. Approving goes through margins_request_approve (one click); a person changes prices.

ParameterTypeDescription
costs *stringUnit costs under --root: SKU, unit cost (landed, if you have it)
sales *stringSales lines under --root: order, date, channel, SKU, quantity, revenue (after discounts, before tax), shipping charged, fees
fromstringYour name
labelsstringShipping label costs under --root (optional): order, label cost; split across the order lines by revenue
out_dirstringFolder under --root for the files this writes (default fairshop-out/margins).
settingsstringOptional settings JSON: margin_floor_pct

margins_request_approve Approve the pricing review (one click)

[ASK · go_live] After one named human click (even in Auto), record that the reviewed pricing review draft is approved in pricing_review-requests.csv. Tied to draft_sha256; refuses while open markers remain unless accept_open_issues is true with a note. A person on your team acts on it; the agent never does.

ParameterTypeDescription
draft *stringDraft path returned by the draft tool
draft_sha256 *stringsha256 returned by the draft tool
accept_open_issuesbooleanSet true, together with a note, to go ahead while open markers or issues remain. Default false (refused while any remain).
notestringWhy it is fine to go ahead with open issues; required when accept_open_issues is true. Kept in the audit log.
out_dirstringFolder under --root for the files this writes (default fairshop-out/margins).
tostringWho it goes to; must match the draft when the draft names someone

price_update Price update

[BLOCK · go_live] Listed so agents can see it is refused. Fairshop SKU Margins never changes a price.

promotion_create Promotion create

[BLOCK · go_live] Listed so agents can see it is refused. Fairshop SKU Margins never creates or ends a promotion.