agentleFS
MicrosoftKnown publishermicrosoft/new-copilot-studio-tech-guide/sample/archive/store-solution/skills/sales-analysis/SKILL.md

sales-analysis

Skill21 starsChanged 5 months agoMITView on GitHub

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).

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep TOP_SELLERS_JSON and SLOW_MOVERS_JSON so the merch-report-html skill can render them into the final interactive report.

    line 54
  2. Distinctive:

    Do not recommend discounts here - that needs the Store Policy Agent's guardrails.

    line 56
  3. Distinctive:

    Never invent numbers - every value derives from the MCP results you fetched.

    line 62

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
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)

  1. Raw weekly rows - query_sales(start_week, end_week) for the window (default the full 8 weeks 2026-04-12 ... 2026-05-31). Each row is {sku, name, category, week, units, revenue}.
  2. 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 carries sku, name, price, cost) to the markdown-optimizer skill, together with the guardrails from the Store Policy Agent.
  • Keep TOP_SELLERS_JSON and SLOW_MOVERS_JSON so 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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.