sales-analysis
Turn the RAW weekly sales rows and catalog facts from the Sales & Performance MCP into merchandising analytics by running the bundled sales_analysis.py script. Use first in an end-of-quarter markdown review, when a manager wants top sellers and slow-moving / dead stock over a period. The MCP returns raw data only, so the script derives velocity, weeks-of-cover, and margin, then prints the top sellers and slow movers as structured JSON. It renders NO charts (the merch-report-html skill owns all visuals) and does NOT decide discounts (hand the slow movers to markdown-optimizer).
- License 许可
- MIT
- 最近更新
- 2026-11-04
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- sales-analysis
- description
- Turn the RAW weekly sales rows and catalog facts from the Sales & Performance MCP into merchandising analytics by running the bundled sales_analysis.py script. Use first in an end-of-quarter markdown review, when a manager wants top sellers and slow-moving / dead stock over a period. The MCP returns raw data only, so the script derives velocity, weeks-of-cover, and margin, then prints the top sellers and slow movers as structured JSON. It renders NO charts (the merch-report-html skill owns all visuals) and does NOT decide discounts (hand the slow movers to markdown-optimizer).
02 资源文件 7
- 参考文档extraction.md12.6 KB
- 参考文档golden-rule-details.md5.6 KB
- 参考文档probe-templates.md6.4 KB
- 参考文档runtime-recipes.md8.1 KB
- 脚本sales_analysis.py4.1 KB
- 参考文档verdict-composition.md11.1 KB
- 参考文档verification.md7.2 KB
03 SKILL.md 正文
Sales Analysis (data, not charts)
This skill converts raw sales data into the analytics a markdown review needs by
running the bundled sales_analysis.py script. The Sales & Performance MCP
deliberately exposes only raw primitives (query_sales, get_catalog) - there is no
get_slow_movers or get_velocity - so the script derives the metrics itself.
It renders no charts on purpose: the interactive merch-report-html skill owns all the visuals at the end, which keeps the review fast. This skill just computes the numbers and prints the structured hand-offs.
When to use
First in an end-of-quarter markdown review, whenever a manager wants to see top sellers and slow / dead stock over a window.
Inputs (fetch from the Sales & Performance Agent, then pass as flags)
- Raw weekly rows -
query_sales(start_week, end_week)for the window (default the full 8 weeks2026-04-12...2026-05-31). Each row is{sku, name, category, week, units, revenue}. - Catalog facts -
get_catalog()->{sku, name, price, unit_cost, stock_on_hand}.
Run the bundled script
python3 sales_analysis.py \
--woc-threshold 8 \
--rows '[{"sku":"SKU-VR-GOGGLES","name":"OmegaVision VR Headset","category":"accessory","week":"2026-04-12","units":1,"revenue":199.99}]' \
--catalog '[{"sku":"SKU-VR-GOGGLES","name":"OmegaVision VR Headset","price":199.99,"unit_cost":70.00,"stock_on_hand":48}]'
It prints a compact summary, then two structured lines:
TOP_SELLERS_JSON=[{name, units, velocity, revenue}]SLOW_MOVERS_JSON=[{sku, name, price, cost, weeks_of_cover, margin, units}]
Metrics it derives (for your report, not for you to recompute)
Over a window of W weeks, per SKU: velocity = units_total / W,
weeks_of_cover = stock_on_hand / velocity, margin% = (price - cost) / price * 100.
Slow movers = weeks-of-cover above the threshold (default 8), sorted descending.
Top sellers = highest units.
Next steps
- Pass
SLOW_MOVERS_JSON(it already carriessku, name, price, cost) to the markdown-optimizer skill, together with the guardrails from the Store Policy Agent. - Keep
TOP_SELLERS_JSONandSLOW_MOVERS_JSONso the merch-report-html skill can render them into the final interactive report. - Do not recommend discounts here - that needs the Store Policy Agent's guardrails.
Notes
- The bundled script is
sales_analysis.py; it uses only the Python standard library (no matplotlib, no network). - Never invent numbers - every value derives from the MCP results you fetched. All data is mock; for demo purposes only.
04 同仓库更多 Skills
slip-pdf-generator
Generate a printable BlastBox return / RMA / exchange slip as a PDF for the associate to hand to the customer. Use at the end of a return, warranty swap, membership cancellation, or upgrade once all amounts are final. The skill runs a bundled Python script that renders the confirmed slip values into a real PDF file.
points-reconciliation
Reconcile a customer's BlastPoints loyalty balance after a complex visit (purchases, returns, promo multipliers, expiry) and convert the net balance to store credit. Use when an associate asks about a member's points, or after a return that should claw back previously earned points. The skill runs a bundled Python script that applies the base earn rate, promo multipliers, tier bonus, clawbacks, and expiry, then prints a points ledger and the redeemable store-credit value.
prorated-refund-calculator
Calculate the exact prorated refund when a customer cancels a BlastPass membership, and the net settlement when a defective unit is traded up to a pricier model. Use after the Store Policy Agent confirms the refund rule and the Membership MCP has returned the membership details. The skill runs a bundled Python script so the arithmetic is exact.
membership-card-png
Generate a digital BlastPass membership card as a PNG image by running the bundled card_png.py script. Use when a member self-serves a lost/stolen/damaged card replacement, or any time a card needs to be shown on screen (vs. printed). The skill takes the member details returned by the Membership MCP (get_membership) plus the new_card_serial returned by reissue_card and passes them as command-line flags to a bundled Python (matplotlib) script that renders a CR80-sized membership card to a real PNG. It only renders the card from already-retrieved values — it never looks anything up or invents data.
membership-card-png
Generate a digital BlastPass membership card as a PNG image by running the bundled card_png.py script. Use when a member self-serves a lost/stolen/damaged card replacement, or any time a card needs to be shown on screen (vs. printed). The skill takes the member details returned by the Membership MCP (get_membership) plus the new_card_serial returned by reissue_card and passes them as command-line flags to a bundled Python (matplotlib) script that renders a CR80-sized membership card to a real PNG. It only renders the card from already-retrieved values — it never looks anything up or invents data.
slip-pdf-generator
Generate a printable BlastBox return / RMA / exchange slip as a PDF for the associate to hand to the customer. Use at the end of a return, warranty swap, membership cancellation, or upgrade once all amounts are final. The skill runs a bundled Python script that renders the confirmed slip values into a real PDF file.