Agent skill · AI & Agents

newsvendor-problem

When the user wants to solve single-period inventory problems, optimize stocking levels for perishable goods, or make one-time purchase decisions under demand uncertainty. Also use when the user mentions "newsvendor model," "newsboy problem," "single-period inventory," "perishable inventory," "overage and underage costs," "critical fractile," "fashion goods inventory," "seasonal products," "service level optimization," or "demand distribution matching." For multi-period problems, see dynamic-lot-sizing or stochastic-inventory-models.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill newsvendor-problem --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 35 KB
Bundled scripts: none
Path: skills/analysis/newsvendor-problem/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Determines optimal order quantity for a single-period product with uncertain demand, balancing underage and overage costs using the classic newsvendor framework. It computes the critical fractile from cost parameters and applies it to the specified demand distribution to yield an optimal Q, along with related metrics like expected profit, expected sales, leftover, lost sales, and fill rate.

How it works

  • Defines costs: Cu = p - c (underage) and Co = c - v (overage); computes the critical fractile as Cu / (Cu + Co).
  • Sets up a demand distribution (normal, lognormal, uniform, or exponential) with given parameters.
  • Determines optimal_order_quantity by taking the inverse CDF (ppf) at the critical fractile: Q* = F^{-1}(critical_fractile).
  • Calculates associated metrics for Q*: expected_profit, expected_sales, expected_leftover, expected_lost_sales, and fill_rate (CDF at Q*).
  • Provides utilities: profit_curve over a Q range, plotting helpers, and sensitivity_analysis to study Q*’s responsiveness to changes in cost, price, salvage, or demand parameters.
  • Includes example usage function example_basic_newsvendor that demonstrates a typical scenario.

When to use it

Use when solving single-period inventory decisions under demand uncertainty, particularly for perishable or one-off purchase scenarios, and when the problem mentions terms like newsvendor model, single-period inventory, or critical fractile.

What it can touch

  • Tools: claude-code is declared in the skill metadata and used for coding tasks within the implementation.
  • Internal data: cost (c), price (p), salvage (v), demand_dist, demand_params, and computed statistics (Cu, Co, critical_fractile).

Caveats

  • Supports specific demand distributions as implemented: 'normal', 'lognormal', 'uniform', 'exponential'. Unknown distribution raises a ValueError.
  • Relies on numerical methods (CDF/PPF) from SciPy; performance depends on distribution type and parameter values.
  • License: MIT.
From the SKILL.md

# Newsvendor Problem You are an expert in newsvendor models and single-period inventory optimization under uncertainty. Your goal is to help determine optimal stocking quantities for products with a single ordering opportunity and uncertain demand, balancing the costs of excess inventory against the costs of stockouts. ## Initial Assessment Before solving newsvendor problems, understand: 1. **Product Characteristics** - What product type? (newspapers, fashion, seasonal, perishable) - Single selling season or truly one-time decision? - Shelf life or expiration date? - Salvage value if unsold? - Can excess inventory be returned or discounted? 2. **Demand Uncertainty** - Historical demand data available? - Demand distribution? (normal, lognormal, discrete, empirical) - Demand parameters (mean, standard deviation)? - Any demand forecasts or market intelligence? - Correlation with other products or external factors? 3. **Cost Structure** - Purchase/production cost per unit (c)? - Selling price per unit (p)? - Salvage value per unit if unsold (v)? - Shortage cost or penalty (b)? (lost profit or explicit penalty) - Are there fixed ordering costs? 4. **Business Context** - Target service l

What's inside
Steps it walks through
  1. Initial Assessment
  2. Newsvendor Model Fundamentals
  3. The Classic Newsvendor Problem
  4. Problem Formulation
  5. Critical Fractile Solution
  6. For Normal Distribution
  7. Python Implementation: Newsvendor Models
  8. Classic Newsvendor with Normal Demand
  9. Newsvendor with Discrete Demand
  10. Empirical or Discrete Distribution
  11. Extensions and Variants
  12. Newsvendor with Multiple Products
  13. Tools & Libraries
  14. Python Libraries
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the newsvendor-problem skill do?

When the user wants to solve single-period inventory problems, optimize stocking levels for perishable goods, or make one-time purchase decisions under demand uncertainty. Also use when the user mentions "newsvendor model," "newsboy problem," "single-period inventory," "perishable inventory," "overage and underage costs," "critical fractile," "fashion goods inventory," "seasonal products," "service level optimization," or "demand distribution matching." For multi-period problems, see dynamic-lot-sizing or stochastic-inventory-models.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill newsvendor-problem --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going