About this template
"47 in stock" is not a number you can act on
Is that three weeks of cover or three months? Your supplier needs two weeks' notice either way. Working it out properly means a spreadsheet per SKU — so it gets done for the top five and guessed for everything else.
Those guesses cause both the stockouts and the dead cash.
Days of cover, with the arithmetic
days_of_cover = on_hand ÷ daily_velocity, and the reorder trigger is
cover ≤ lead_time + safety. Every line prints its inputs, so you can check a
recommendation instead of trusting it.
Four verdicts per SKU: REORDER NOW, REORDER SOON, OVERSTOCKED (cash tied up, not a reorder), or a data verdict.
The trap that makes naive forecasts wrong
A stockout corrupts its own velocity. If an SKU hit zero during the window, it couldn't sell what it didn't have — so its measured velocity is suppressed, and reordering off that number under-orders your best seller. Again.
Those SKUs come back flagged STOCKOUT_SUPPRESSED, with the true velocity
declared unknown-and-higher rather than quietly used.
Same for divergence: when 28-day and 7-day velocity differ by more than 50%, you get both numbers and a flag. That gap is either seasonality or a stockout, and those demand opposite actions — so the agent won't pick one for you.
Under 14 days of history it returns INSUFFICIENT_HISTORY. It will not
extrapolate a trend from one week.
Read Flagged before the reorder list
It's the section that tells you which numbers are lying to you.
What you supply
Your own Claude Code login — and two exports. Sales-by-SKU and inventory
on-hand (Shopify: Analytics → Reports → Sales by product; Inventory → Export),
dropped into ~/inventory/exports/.
Then your supplier lead time and safety days in the rules file. Leave those blank and every SKU returns a data verdict instead of a quantity — deliberately, since cover means nothing without a threshold to compare it against.
No store API key. Exports are the input, which is exactly why nothing can place an order.
The guard is a file, not a promise
~/inventory/policy/FORECAST-RULES.md carries NEVER_AUTOORDER, the cover
formula, the stockout rule and your numbers. The skill reads it before every run.
Where this stops
It reads exports and drafts a brief. It does not place purchase orders, contact suppliers, or change stock levels.
It won't claim seasonality — it can't see last year in a 28-day export — and it won't compute margin unless your export carries cost.
Verified on build: the skill, the working tree, the NEVER_AUTOORDER guard, the
cover formula and both data traps are present on a fresh fork. Running it on your
own exports is yours to do.