algo-sc-eoq
Skill238 starsChanged 6 months agoMITView on GitHub
Calculate Economic Order Quantity to minimize total inventory cost (ordering + holding). Use this skill when the user needs to determine optimal order size, balance ordering frequency against storage costs, or set reorder points — even if they say 'how much to order', 'optimal batch size', or 'inventory cost minimization'.
In this repository315 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- algo-ad-biddingSkill
- algo-ad-budgetSkill
- algo-ad-ctrSkill
- algo-ad-gspSkill
- algo-ad-vcgSkill
- algo-blockchain-basicsSkill
- algo-blockchain-smart-contractSkill
- algo-ecom-bm25Skill
- algo-ecom-rankingSkill
- algo-ecom-searchSkill
- algo-forecast-arimaSkill
- algo-forecast-ensembleSkill
- algo-forecast-exponentialSkill
- algo-forecast-prophetSkill
- algo-hr-compensationSkill
- algo-hr-matchingSkill
- algo-hr-turnoverSkill
- algo-mfg-cpkSkill
- algo-mfg-doeSkill
- algo-mfg-fmeaSkill
- algo-mfg-spcSkill
- algo-net-centralitySkill
- algo-net-communitySkill
- algo-net-influenceSkill
- algo-nlp-ldaSkill
- algo-nlp-nerSkill
- algo-nlp-similaritySkill
- algo-nlp-summarizationSkill
- algo-price-bundleSkill
- algo-price-conjointSkill
- algo-price-dynamicSkill
- algo-price-elasticitySkill
- algo-price-van-westendorpSkill
- algo-rank-bayesianSkill
- algo-rank-eloSkill
- algo-rank-trueskillSkill
- algo-rank-wilsonSkill
- algo-rec-cfSkill
- algo-rec-contentSkill
- algo-rec-hybridSkill
- algo-rec-mfSkill
- algo-rec-sessionSkill
- algo-risk-altman-zSkill
- algo-risk-benfordSkill
- algo-risk-creditSkill
- algo-risk-varSkill
- algo-sc-bullwhipSkill
- algo-sc-newsvendorSkill
- algo-sc-routingSkill
- algo-sc-safety-stockSkill
- algo-seo-backlinkSkill
- algo-seo-contentSkill
- algo-seo-crawlSkill
- algo-seo-pagerankSkill
- algo-seo-schemaSkill
- algo-seo-technicalSkill
- algo-seo-tfidfSkill
- algo-social-engagementSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
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
- Distinctive: line 23
When demand is highly uncertain (use newsvendor model)
- Distinctive: line 24
When products are perishable with short shelf life
- Distinctive: line 25
When quantity discounts change the cost structure significantly
- Distinctive: line 40
Gate: All costs positive, demand estimate reasonable.
- Distinctive: line 49
Check: ordering cost component ≈ holding cost component (they're equal at EOQ).
- Distinctive: line 86
Multi-item coordination: When multiple items share ordering costs (same supplier), use joint replenishment models, not individual EOQs.
- Very specific: line 94
Run python scripts/eoq.py --verify to execute built-in sanity tests.
≈ “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.
Files
Economic Order Quantity (EOQ)
Overview
EOQ determines the order quantity that minimizes total inventory cost = ordering cost + holding cost. Formula: EOQ = √(2DS/H) where D=annual demand, S=ordering cost per order, H=holding cost per unit per year. Assumes constant demand and instantaneous replenishment.
When to Use
Trigger conditions:
- Setting standard order quantities for inventory replenishment
- Balancing ordering frequency against warehousing costs
- Baseline calculation before applying safety stock adjustments
When NOT to use:
- When demand is highly uncertain (use newsvendor model)
- When products are perishable with short shelf life
- When quantity discounts change the cost structure significantly
Algorithm
IRON LAW: EOQ Assumes CONSTANT, KNOWN Demand
If demand is variable or uncertain, EOQ gives the wrong answer.
Real-world application: use EOQ as a starting point, then add
safety stock for demand variability and lead time uncertainty.
Total cost curve is flat near EOQ — ±20% from optimal Q changes
total cost by only ~2%.Phase 1: Input Validation
Determine: D (annual demand in units), S (fixed cost per order), H (holding cost per unit per year = unit cost × holding rate, typically 20-30% of unit value). Gate: All costs positive, demand estimate reasonable.
Phase 2: Core Algorithm
- EOQ = √(2 × D × S / H)
- Number of orders per year = D / EOQ
- Reorder point = d × L (daily demand × lead time in days)
- Total annual cost = (D/Q × S) + (Q/2 × H) at Q = EOQ
Phase 3: Verification
Check: ordering cost component ≈ holding cost component (they're equal at EOQ). Total cost is at minimum. Gate: Ordering cost ≈ holding cost (±5%).
Phase 4: Output
Return EOQ with cost breakdown and reorder point.
Output Format
{
"eoq": 500,
"orders_per_year": 20,
"reorder_point": 150,
"annual_cost": {"ordering": 2000, "holding": 2000, "total": 4000},
"metadata": {"demand": 10000, "order_cost": 100, "holding_cost": 4.0}
}Examples
Sample I/O
Input: D=10,000 units/year, S=$100/order, H=$4/unit/year Expected: EOQ = √(2×10000×100/4) = √500000 = 707 units
Edge Cases
| Input | Expected | Why |
| Very high S, low H | Large EOQ, few orders | Minimize expensive ordering |
| Very low S, high H | Small EOQ, frequent orders | Minimize expensive holding |
| D = 0 | EOQ = 0, no ordering | No demand, no orders needed |
Gotchas
- Holding cost underestimation: H should include: capital cost, storage, insurance, obsolescence, handling. Companies often only count warehouse rent, understating true H.
- Flat cost curve: Total cost is insensitive near EOQ. Rounding EOQ to a convenient number (full pallet, container) costs very little.
- Quantity discounts: Price breaks at certain quantities may make it cheaper to order MORE than EOQ. Compare total cost at EOQ vs discount breakpoints.
- Lead time variability: EOQ doesn't address when to order, only how much. Add safety stock: SS = z × σ_demand × √(lead time).
- Multi-item coordination: When multiple items share ordering costs (same supplier), use joint replenishment models, not individual EOQs.
Scripts
| Script | Description | Usage |
scripts/eoq.py | Compute Economic Order Quantity and cost breakdown | python scripts/eoq.py --help |
Run python scripts/eoq.py --verify to execute built-in sanity tests.
References
- For EOQ with quantity discounts, see
references/eoq-discounts.md - For safety stock calculation, see algo-sc-safety-stock
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
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.

