Safety Stock
Buffer sizing for ecommerce teams: recalculate safety stock per SKU from real demand variance and real lead time variance, not from a blanket rule.
Safety stock is usually a blanket rule: two weeks of cover on everything, or a percentage of the reorder quantity. That rule is simultaneously too much and too little, because it ignores the two things that actually determine the right buffer. A SKU with steady demand and a reliable supplier needs almost none. A SKU whose demand swings and whose supplier is unpredictable needs far more than two weeks, and running out of it is expensive. Blanket rules park cash in the wrong SKUs. This skill recalculates safety stock per SKU from real demand and lead time variance.
What It Does
- Measures demand variance per SKU rather than assuming it is uniform.
- Reads lead time variance per supplier from completed purchase orders.
- Sizes the buffer against the service level each SKU actually warrants.
- Prices the cash each buffer ties up against the stockout it prevents.
- Finds the SKUs holding buffer they have never needed.
- Recalculates safety stock per SKU, with the cash and the risk behind it.
Use Cases
- Free cash from SKUs carrying a buffer they have never used.
- Protect the volatile SKU that a blanket rule leaves exposed.
- Set service levels by SKU importance rather than uniformly.
- See the total cash sitting in safety stock right now.
Example Session
Recalculate our safety stock. We currently hold two weeks on everything.
Two weeks is wrong in both directions. This moves $50,000 out of SKUs that never needed it and $58,000 into the ones that do.
- SKU | Demand variance | Lead time variance | Current buffer | Correct buffer | Cash
- Core tee, black | Low | Low, 2 days | 14 days | 5 days | -$31,000
- Jacket, navy | High | High, 19 days | 14 days | 31 days | +$44,000
- Cap, charcoal | Low | Low, 3 days | 14 days | 6 days | -$19,000
- Hoodie, seasonal | High | Medium, 8 days | 14 days | 22 days | +$14,000
The black tee sells at a steady rate from a supplier who has never been more than two days late, so nine of its fourteen buffer days are cash doing nothing. The navy jacket is the opposite: demand swings and the supplier's lead time varies by nineteen days, so two weeks of buffer leaves your highest margin product exposed. Net across these four the buffer grows by $8,000, and the exposure on your highest margin product disappears.
Why This Beats Prompting It Yourself
A Blanket Rule vs Variance Per SKU: The Hidden Risk
A generic prompt applies a standard formula with assumed inputs, or endorses the two week rule because two weeks sounds prudent. A uniform buffer is only correct for a SKU with average variance on both dimensions, and almost none of yours is average. The rule overstocks the predictable items and leaves the volatile ones exposed.
When You Still Need Lead Time Variance Separated From Lead Time
A supplier who always takes 78 days needs no extra buffer for that; a supplier who takes between 45 and 64 does. Average lead time drives the reorder point and its variance drives the safety stock, and conflating them is the most common error in inventory planning. The navy jacket needs 31 days of buffer because of the range, not the average.
Known Limitations
Lead time variance needs several completed purchase orders per supplier to be meaningful, and a new supplier is handled conservatively with that stated. Demand variance assumes the historical pattern continues, so a SKU about to be promoted needs the promotional plan supplied or it will be under-buffered. It recalculates the levels and does not change them in your inventory system.
Install It
- Download the ZIP.
It is free and there is no account to create. - Unzip it into your agent's skills folder.
Claude Code reads ~/.claude/skills/, which is hidden by default: the command in the folder block opens it. Other agents scan their own directory, so drop the same folder there instead. - Ask your agent to use it.
Restart the agent if it was already running, then it picks the skill up with no config.
skills folder
Copy
~/.claude/skills/safety-stock/
SKILL.md
references/variance-model.md
levels/
# one file per run, with the cash effect
# macOS: create the folder and open it in Finder
mkdir -p ~/.claude/skills && open ~/.claude/skills
# Windows: paste in the Explorer address bar
%USERPROFILE%\.claude\skills\Frequently asked questions
How is this different from a standard safety stock formula?
The formula is the easy part; the inputs are where it goes wrong. This measures demand variance per SKU and lead time variance per supplier from your own history rather than assuming them, and sets the service level by how much each SKU matters.
Which agents does the skill run in?
Any agent that supports the open SKILL.md format: Claude Code, Cursor, Codex CLI, GitHub Copilot, Gemini CLI, Manus, Grok and others load it unmodified. The format is portable, the location is not. Each agent scans its own skills directory, so you drop the same folder into whichever one yours uses. There is no config file to edit and no API key to provision.
What does it need connected to work?
Sales history per SKU, completed purchase orders with real receipt dates, product cost, and current stock. Without receipt dates it cannot compute lead time variance and says so, which is the input that matters most.
Should every SKU have the same service level?
No, and that is one of the larger sources of waste. A 99% service level on a low margin accessory costs real cash for very little; the same level on your highest contribution product is worth paying for. The skill sets these by contribution and substitutability.
Why does lead time variance matter more than lead time?
Because a consistently long lead time is planned for in the reorder point. Variance is what you cannot plan for, and it is the thing safety stock exists to absorb. A supplier with a 19 day range needs more buffer than one that is slower but reliable.
What is included with the skill?
The skill itself, the variance model reference, the level format, and the service level defaults. It is free and security scanned. We re-publish the ZIP when the model changes, so download it again if your levels start shifting.
Safety stock is a cash decision dressed as an inventory one.
Polar reads real demand variance against your cash cycle on one definition, so the buffer per SKU never ties up more than it protects.
<script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"How is this different from a standard safety stock formula?","acceptedAnswer":{"@type":"Answer","text":"The formula is the easy part; the inputs are where it goes wrong. This measures demand variance per SKU and lead time variance per supplier from your own history rather than assuming them, and sets the service level by how much each SKU matters."}},{"@type":"Question","name":"Which agents does the skill run in?","acceptedAnswer":{"@type":"Answer","text":"Any agent that supports the open SKILL.md format: Claude Code, Cursor, Codex CLI, GitHub Copilot, Gemini CLI, Manus, Grok and others load it unmodified. The format is portable, the location is not. Each agent scans its own skills directory, so you drop the same folder into whichever one yours uses. There is no config file to edit and no API key to provision."}},{"@type":"Question","name":"What does it need connected to work?","acceptedAnswer":{"@type":"Answer","text":"Sales history per SKU, completed purchase orders with real receipt dates, product cost, and current stock. Without receipt dates it cannot compute lead time variance and says so, which is the input that matters most."}},{"@type":"Question","name":"Should every SKU have the same service level?","acceptedAnswer":{"@type":"Answer","text":"No, and that is one of the larger sources of waste. A 99% service level on a low margin accessory costs real cash for very little; the same level on your highest contribution product is worth paying for. The skill sets these by contribution and substitutability."}},{"@type":"Question","name":"Why does lead time variance matter more than lead time?","acceptedAnswer":{"@type":"Answer","text":"Because a consistently long lead time is planned for in the reorder point. Variance is what you cannot plan for, and it is the thing safety stock exists to absorb. A supplier with a 19 day range needs more buffer than one that is slower but reliable."}},{"@type":"Question","name":"What is included with the skill?","acceptedAnswer":{"@type":"Answer","text":"The skill itself, the variance model reference, the level format, and the service level defaults. It is free and security scanned. We re-publish the ZIP when the model changes, so download it again if your levels start shifting."}}]}</script>
