cosmicstack-labs/inventory-optimizer
>- Intelligently manage stock levels, generate supplier orders, and prevent shortages or overstock. Tracks usage patterns, lead times, and par levels to keep the shop or restaurant running without waste.
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill inventory-optimizer
Inventory is cash sitting on shelves. Too much ties up capital and spoils. Too little loses sales and frustrates customers. The Inventory Optimizer skill treats stock as a dynamic system — balancing par levels, usage velocity, supplier lead times, and seasonal demand fluctuations.
Gather the current state by asking the user or pulling from their POS/ERP system. Collect:
Prompt the user for:
> "Let's start with your inventory snapshot. Do you have a stock count sheet, a POS report, or should I help you build one from scratch?"
For each item, calculate:
Reorder Point = (Average Daily Usage × Lead Time in Days) + Safety Stock
Safety Stock = Average Daily Usage × Lead Time Variance Buffer
Par Level = Reorder Point + (Average Daily Usage × Order Cycle Days)
Example calculation for a busy café:
| Class | % of Items | % of Cost | Strategy |
|-------|-----------|-----------|----------|
| A | 10-20% | 70-80% | Daily tracking, tight pars, frequent small orders |
| B | 20-30% | 15-20% | Weekly review, standard pars |
| C | 50-70% | 5-10% | Monthly review, bulk order, low scrutiny |
Action: Generate the ABC classification table and recommend ordering frequency by class.
Cross-reference usage data with expiry dates. Flag items where:
Recommend actions:
Compile all items at or below reorder point into a structured PO:
| Item | Current Stock | Par Level | Order Qty | Supplier | Unit Price | Total |
|------|-------------|-----------|-----------|----------|-----------|-------|
| Espresso Beans | 12kg | 39kg | 27kg | Bean Co. | $14/kg | $378 |
| Milk (2%) | 8 gal | 22 gal | 14 gal | Dairy Fresh | $3.50/gal | $49 |
Total order value: $427
Ask the user:
> "Here's your draft order. I've calculated quantities based on par levels and current usage. Would you like to adjust any items before I finalize?"
Set reminders based on item class:
Offer to schedule:
> "I can set up a daily stock check reminder for your A-items and a weekly full inventory review. Would you like me to schedule that?"
| Phrase | What Happens |
|--------|-------------|
| "Check my inventory levels" | Runs full inventory audit against pars |
| "What should I reorder?" | Generates purchase order for items below reorder point |
| "I'm running low on [item]" | Checks current stock vs par for that item, recommends order qty |
| "Show me slow-moving items" | Runs ABC analysis, highlights C-items and waste risks |
| "Do an inventory review" | Full workflow: audit → classify → flag risks → generate PO |
| "Set par levels for [category]" | Guides user through setting pars for a specific category |
*"Inventory is money sitting on shelves — make every dollar work."*
Take cosmicstack-labs/inventory-optimizer from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.