margin-decomposition

Installation
SKILL.md

Margin Decomposition

When to use

Use whenever company-wide gross margin has moved and the cause isn't yet clear, especially before launching a cost investigation that might be solving the wrong problem — a margin decline is very often a mix shift (more revenue coming from a lower-margin segment) rather than any segment's margin actually deteriorating.

What it does

Decomposes the change in blended gross margin into two distinct effects via a bundled calculator: mix effect (what blended margin would be if every segment kept its prior margin, but at the current revenue mix) and rate effect (the remaining change, from segments' own margins actually moving) — the two reconcile exactly to the total blended margin change, and ranks segments by current profitability.

Method

  1. Gather revenue and margin percentage by segment for both the prior and current period — the same granularity discipline as variance-bridge-analyzer; a single blended number can't be decomposed.
  2. Run the bundled calculator (scripts/margin_decomp.py) to get the blended margin for both periods, the mix effect, and the rate effect, which sum exactly to the total blended margin change.
  3. Read mix effect and rate effect as fundamentally different problems. A mix effect means revenue moved toward a different-margin segment while each segment's own economics stayed intact, worth understanding as a go-to-market or product-mix story. A rate effect means a segment's own margin genuinely moved, worth investigating as a cost or pricing story within that segment.
  4. Check the revenue share change per segment alongside the margin numbers — a segment gaining share while carrying a different margin than the blend is exactly what drives a mix effect, and seeing both together makes the story concrete rather than abstract.
  5. Don't launch a cost-cutting investigation on the strength of a blended margin decline alone — if the decomposition shows it's primarily mix, cutting costs in a segment whose own margin never moved won't fix anything and may damage a segment that's actually healthy.
  6. Rank segments by current margin to see which are structurally most profitable — this feeds directly into resource allocation and pricing conversations, separate from the mix/rate question.
  7. Track the decomposition over multiple periods, not just once — a consistent mix effect toward a lower-margin segment over several quarters is a strategic trend worth addressing deliberately, not a one-off blip.
Installs
18
GitHub Stars
22
First Seen
Sep 3, 2026