Token导航 LogoToken导航

Agent Skill · 研究检索

inventory-optimization(库存优化)

inventory-optimization 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

inventory-optimization 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为权限未标注;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 48,934。

总安装 672周安装 28GitHub Stars 13下载 224核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:inventory-optimization(库存优化)
来源仓库:https://github.com/kishorkukreja/awesome-supply-chain
仓库路径:skills/inventory-optimization
安装命令:
npx skills add https://github.com/kishorkukreja/awesome-supply-chain --skill inventory-optimization
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/kishorkukreja/awesome-supply-chain --skill inventory-optimization

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息。inventory-optimization 属于研究检索类 Skill,可作为该场景下的辅助能力补充。适合根据关键词或任务场景快速定位候选结果。可在 Codex、Claude、Cursor 等宿主环境中使用。通过 GitHub 安装,具体用法请参考原始 README。

安装前建议确认权限范围和维护状态,避免触发联网或文件操作。

来源仓库内路径:skills/inventory-optimization

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/kishorkukreja/awesome-supply-chain --skill inv…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    权限没有明确标注,第一次使用时只给一个无关紧要的任务,观察它到底读了哪些文件和网络。

常见问题

6 条

inventory-optimization 怎么安装?

在终端执行 npx skills add https://github.com/kishorkukreja/awesome-supply-chain --skill inventory-opt…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

inventory-optimization 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

inventory-optimization 需要什么权限?

权限级别没有明确标注。第一次使用时建议只给无关紧要的任务,观察它实际读写了哪些内容。

inventory-optimization 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

inventory-optimization 用的人多吗?

公开数据是累计安装 672 次,近一周安装 28 次,下载 224 次,GitHub 13 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

inventory-optimization 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
inventory-optimization

库存优化 · 本页

67213权限未标注未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Inventory Optimization

You are an expert in inventory optimization and management. Your goal is to help balance inventory costs with service levels, determining optimal stock levels, reorder points, and inventory policies that minimize total costs while meeting customer demand.

Initial Assessment

Before optimizing inventory, understand:

  1. Business Context

- What products/SKUs need inventory optimization? - Current inventory investment and turns? - Target service levels (fill rate, stockout rate)? - Current pain points? (excess, shortages, cash tied up)

  1. Demand Characteristics

- Demand patterns? (stable, variable, seasonal, intermittent) - Demand variability (coefficient of variation)? - Historical sales data available? (12-24 months ideal) - Forecast accuracy (MAPE)?

  1. Supply Parameters

- Lead times from suppliers? - Lead time variability? - Minimum order quantities (MOQs)? - Order costs and constraints?

  1. Cost Structure

- Unit product cost? - Ordering/setup costs per order? - Inventory carrying cost rate (% per year)? - Stockout/backorder costs?


Inventory Optimization Framework

Key Inventory Decisions

1. How Much to Order? (Order Quantity)

  • Economic Order Quantity (EOQ)
  • Fixed order quantity
  • Lot-for-lot ordering
  • Volume discounts consideration

2. When to Order? (Reorder Point)

  • Continuous review (s, Q) policy
  • Periodic review (s, S) policy
  • Time-phased ordering
  • Dynamic safety stock

3. How Much Safety Stock?

  • Service level targets
  • Demand variability
  • Lead time variability
  • Cost-service trade-offs

Fundamental Models

Economic Order Quantity (EOQ)

Classic EOQ Formula:

EOQ = sqrt((2 * D * S) / H)

Where:
  D = Annual demand (units)
  S = Ordering cost per order ($)
  H = Holding cost per unit per year ($)

Total Cost:

TC = (D/Q) * S + (Q/2) * H + D * C

Where:
  Q = Order quantity
  C = Unit cost

Python Implementation:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

def eoq(annual_demand, order_cost, holding_cost_rate, unit_cost):
    """
    Calculate Economic Order Quantity

    Parameters:
    - annual_demand: Annual demand in units
    - order_cost: Cost per order ($)
    - holding_cost_rate: Holding cost as % of unit cost (e.g., 0.25 for 25%)
    - unit_cost: Cost per unit ($)

    Returns:
    - Dictionary with EOQ, total cost, orders per year, etc.
    """

    # Holding cost per unit per year
    holding_cost = unit_cost * holding_cost_rate

    # EOQ formula
    eoq_qty = np.sqrt((2 * annual_demand * order_cost) / holding_cost)

    # Number of orders per year
    orders_per_year = annual_demand / eoq_qty

    # Total annual cost
    ordering_cost_total = (annual_demand / eoq_qty) * order_cost
    holding_cost_total = (eoq_qty / 2) * holding_cost
    purchase_cost = annual_demand * unit_cost
    total_cost = ordering_cost_total + holding_cost_total + purchase_cost

    # Order interval (days)
    order_interval = 365 / orders_per_year

    return {
        'EOQ': round(eoq_qty, 0),
        'Orders_Per_Year': round(orders_per_year, 1),
        'Order_Interval_Days': round(order_interval, 1),
        'Total_Annual_Cost': round(total_cost, 2),
        'Ordering_Cost': round(ordering_cost_total, 2),
        'Holding_Cost': round(holding_cost_total, 2),
        'Purchase_Cost': round(purchase_cost, 2)
    }

# Example usage
result = eoq(
    annual_demand=10000,
    order_cost=100,
    holding_cost_rate=0.25,
    unit_cost=50
)

print(f"Optimal Order Quantity: {result['EOQ']} units")
print(f"Order {result['Orders_Per_Year']} times per year")
print(f"Order every {result['Order_Interval_Days']} days")
print(f"Total Annual Cost: ${result['Total_Annual_Cost']:,.2f}")

EOQ with Quantity Discounts:

def eoq_with_discounts(annual_demand, order_cost, holding_cost_rate, price_breaks):
    """
    EOQ with all-units quantity discount

    price_breaks: list of tuples [(qty, price), ...]
    Example: [(0, 50), (500, 48), (1000, 45)]
    """

    results = []

    for qty_break, unit_price in price_breaks:
        holding_cost = unit_price * holding_cost_rate

        # Calculate EOQ at this price
        eoq_qty = np.sqrt((2 * annual_demand * order_cost) / holding_cost)

        # If EOQ < qty_break, use qty_break as order quantity
        order_qty = max(eoq_qty, qty_break)

        # Total cost at this quantity
        ordering_cost = (annual_demand / order_qty) * order_cost
        holding_cost_total = (order_qty / 2) * holding_cost
        purchase_cost = annual_demand * unit_price
        total_cost = ordering_cost + holding_cost_total + purchase_cost

        results.append({
            'Quantity_Break': qty_break,
            'Unit_Price': unit_price,
            'EOQ_at_Price': round(eoq_qty, 0),
            'Order_Quantity': round(order_qty, 0),
            'Total_Cost': round(total_cost, 2)
        })

    # Find minimum cost option
    results_df = pd.DataFrame(results)
    optimal = results_df.loc[results_df['Total_Cost'].idxmin()]

    return results_df, optimal

# Example with quantity discounts
price_breaks = [
    (0, 50),      # 0-499: $50/unit
    (500, 48),    # 500-999: $48/unit
    (1000, 45)    # 1000+: $45/unit
]

results_df, optimal = eoq_with_discounts(
    annual_demand=10000,
    order_cost=100,
    holding_cost_rate=0.25,
    price_breaks=price_breaks
)

print(results_df)
print(f"\nOptimal: Order {optimal['Order_Quantity']} units at ${optimal['Unit_Price']}/unit")

Safety Stock & Reorder Point

Safety Stock Calculation

Service Level Approach:

from scipy import stats
import numpy as np

def safety_stock(demand_std, lead_time_days, service_level=0.95):
    """
    Calculate safety stock based on service level

    Parameters:
    - demand_std: Standard deviation of daily demand
    - lead_time_days: Lead time in days
    - service_level: Target service level (e.g., 0.95 for 95%)

    Returns:
    - Safety stock quantity
    """

    # Z-score for desired service level
    z = stats.norm.ppf(service_level)

    # Safety stock = Z * std_dev during lead time
    # Assuming demand is independent across days
    std_during_lt = demand_std * np.sqrt(lead_time_days)

    ss = z * std_during_lt

    return round(ss, 0)

def safety_stock_variable_lt(demand_avg, demand_std, lead_time_avg,
                              lead_time_std, service_level=0.95):
    """
    Safety stock with variable demand AND lead time

    More comprehensive formula accounting for both sources of variability
    """

    z = stats.norm.ppf(service_level)

    # Combined variance formula
    variance = (lead_time_avg * demand_std**2 +
                demand_avg**2 * lead_time_std**2)

    std_during_lt = np.sqrt(variance)

    ss = z * std_during_lt

    return round(ss, 0)

# Example: Basic safety stock
ss = safety_stock(
    demand_std=50,        # Daily demand std dev
    lead_time_days=14,    # 2 week lead time
    service_level=0.95    # 95% service level
)
print(f"Safety Stock: {ss} units")

# Example: Variable lead time
ss_var = safety_stock_variable_lt(
    demand_avg=100,       # Avg daily demand
    demand_std=50,        # Std dev of daily demand
    lead_time_avg=14,     # Avg lead time (days)
    lead_time_std=3,      # Std dev of lead time (days)
    service_level=0.95
)
print(f"Safety Stock (variable LT): {ss_var} units")

Reorder Point (ROP)

Formula:

ROP = (Average Daily Demand × Lead Time) + Safety Stock

Python Implementation:

def reorder_point(demand_avg_daily, lead_time_days, safety_stock):
    """
    Calculate reorder point

    ROP = Expected demand during lead time + Safety stock
    """

    expected_demand_lt = demand_avg_daily * lead_time_days
    rop = expected_demand_lt + safety_stock

    return round(rop, 0)

def rop_with_review_period(demand_avg_daily, lead_time_days,
                           review_period_days, safety_stock):
    """
    Reorder point with periodic review

    Must cover lead time + review period
    """

    total_period = lead_time_days + review_period_days
    expected_demand = demand_avg_daily * total_period
    rop = expected_demand + safety_stock

    return round(rop, 0)

# Example
rop = reorder_point(
    demand_avg_daily=100,
    lead_time_days=14,
    safety_stock=200
)
print(f"Reorder Point: {rop} units")
print(f"When inventory hits {rop}, place an order")

Inventory Policy Models

(s, Q) Continuous Review Policy

Description:

  • Monitor inventory continuously
  • When inventory position ≤ s (reorder point), order Q units
  • Q typically set to EOQ
class ContinuousReviewPolicy:
    """(s, Q) continuous review inventory policy"""

    def __init__(self, reorder_point, order_quantity):
        self.s = reorder_point
        self.Q = order_quantity
        self.inventory_position = 0
        self.on_hand = 0
        self.on_order = 0
        self.orders_placed = []

    def check_and_order(self, current_on_hand, current_on_order):
        """Check if order should be placed"""

        self.on_hand = current_on_hand
        self.on_order = current_on_order
        self.inventory_position = current_on_hand + current_on_order

        if self.inventory_position <= self.s:
            # Place order
            order = {
                'quantity': self.Q,
                'inventory_position': self.inventory_position,
                'on_hand': self.on_hand,
                'on_order': self.on_order
            }
            self.orders_placed.append(order)
            return True, self.Q

        return False, 0

    def simulate(self, demand_series, lead_time=14):
        """Simulate inventory policy over time"""

        inventory = []
        current_inv = self.Q  # Start with one order quantity
        on_order_queue = []

        for day, demand in enumerate(demand_series):
            # Receive orders (if any arrive today)
            arrivals = [o for o in on_order_queue if o['arrival_day'] == day]
            for arrival in arrivals:
                current_inv += arrival['quantity']
                on_order_queue.remove(arrival)

            # Satisfy demand
            current_inv = max(0, current_inv - demand)

            # Check if order needed
            current_on_order = sum(o['quantity'] for o in on_order_queue)
            should_order, order_qty = self.check_and_order(current_inv, current_on_order)

            if should_order:
                on_order_queue.append({
                    'quantity': order_qty,
                    'order_day': day,
                    'arrival_day': day + lead_time
                })

            inventory.append({
                'day': day,
                'on_hand': current_inv,
                'demand': demand,
                'on_order': current_on_order,
                'order_placed': should_order
            })

        return pd.DataFrame(inventory)

# Example simulation
np.random.seed(42)
demand_series = np.random.poisson(100, 365)  # 365 days of demand

policy = ContinuousReviewPolicy(
    reorder_point=1600,
    order_quantity=1000
)

results = policy.simulate(demand_series, lead_time=14)
print(f"Average inventory: {results['on_hand'].mean():.0f} units")
print(f"Stockouts: {(results['on_hand'] == 0).sum()} days")
print(f"Orders placed: {results['order_placed'].sum()}")

(R, S) Periodic Review Policy

Description:

  • Review inventory every R periods (e.g., weekly)
  • Order up to S (order-up-to level)
  • Order quantity varies based on current position
class PeriodicReviewPolicy:
    """(R, S) periodic review inventory policy"""

    def __init__(self, review_period, order_up_to_level):
        self.R = review_period
        self.S = order_up_to_level

    def calculate_order_qty(self, current_position):
        """Calculate order quantity to reach S"""
        return max(0, self.S - current_position)

    def simulate(self, demand_series, lead_time=14):
        """Simulate periodic review policy"""

        inventory = []
        current_inv = self.S  # Start at order-up-to level
        on_order_queue = []

        for day, demand in enumerate(demand_series):
            # Receive orders
            arrivals = [o for o in on_order_queue if o['arrival_day'] == day]
            for arrival in arrivals:
                current_inv += arrival['quantity']
                on_order_queue.remove(arrival)

            # Satisfy demand
            current_inv = max(0, current_inv - demand)

            # Check if it's a review day
            should_order = (day % self.R == 0)
            order_qty = 0

            if should_order:
                current_on_order = sum(o['quantity'] for o in on_order_queue)
                current_position = current_inv + current_on_order
                order_qty = self.calculate_order_qty(current_position)

                if order_qty > 0:
                    on_order_queue.append({
                        'quantity': order_qty,
                        'order_day': day,
                        'arrival_day': day + lead_time
                    })

            inventory.append({
                'day': day,
                'on_hand': current_inv,
                'demand': demand,
                'order_qty': order_qty,
                'review_day': should_order
            })

        return pd.DataFrame(inventory)

# Example
policy = PeriodicReviewPolicy(
    review_period=7,      # Weekly review
    order_up_to_level=2100
)

results = policy.simulate(demand_series, lead_time=14)
print(f"Average inventory: {results['on_hand'].mean():.0f} units")
print(f"Total orders: {(results['order_qty'] > 0).sum()}")

ABC Analysis & Segmentation

ABC Classification

Methodology:

  • A items: Top 20% of SKUs by value, ~80% of revenue
  • B items: Next 30% of SKUs, ~15% of revenue
  • C items: Bottom 50% of SKUs, ~5% of revenue
def abc_analysis(df, sku_col='sku', demand_col='annual_demand',
                 price_col='unit_price'):
    """
    Perform ABC analysis on inventory

    Parameters:
    - df: DataFrame with SKU, demand, and price
    - Returns: DataFrame with ABC classification
    """

    # Calculate annual value
    df = df.copy()
    df['annual_value'] = df[demand_col] * df[price_col]

    # Sort by value descending
    df = df.sort_values('annual_value', ascending=False)

    # Calculate cumulative percentage
    total_value = df['annual_value'].sum()
    df['cumulative_value'] = df['annual_value'].cumsum()
    df['cumulative_pct'] = df['cumulative_value'] / total_value * 100

    # Classify
    def classify(pct):
        if pct <= 80:
            return 'A'
        elif pct <= 95:
            return 'B'
        else:
            return 'C'

    df['abc_class'] = df['cumulative_pct'].apply(classify)

    # Add ranking
    df['rank'] = range(1, len(df) + 1)

    return df

# Example usage
inventory_data = pd.DataFrame({
    'sku': [f'SKU_{i}' for i in range(1, 101)],
    'annual_demand': np.random.randint(100, 10000, 100),
    'unit_price': np.random.uniform(10, 500, 100)
})

abc_result = abc_analysis(inventory_data)

# Summary by class
summary = abc_result.groupby('abc_class').agg({
    'sku': 'count',
    'annual_value': 'sum'
}).round(0)

summary['pct_skus'] = summary['sku'] / summary['sku'].sum() * 100
summary['pct_value'] = summary['annual_value'] / summary['annual_value'].sum() * 100

print(summary)

XYZ Analysis (Demand Variability)

Classification:

  • X: Low variability (CV < 0.5) - Predictable
  • Y: Medium variability (0.5 ≤ CV < 1.0) - Moderate
  • Z: High variability (CV ≥ 1.0) - Unpredictable
def xyz_analysis(df, demand_history_col='demand_history'):
    """
    Classify items by demand variability

    demand_history_col should contain list/array of historical demand
    """

    def classify_variability(demands):
        if len(demands) < 2:
            return 'Z'  # Insufficient data

        mean_demand = np.mean(demands)
        std_demand = np.std(demands)

        if mean_demand == 0:
            return 'Z'

        cv = std_demand / mean_demand  # Coefficient of variation

        if cv < 0.5:
            return 'X'
        elif cv < 1.0:
            return 'Y'
        else:
            return 'Z'

    df = df.copy()
    df['xyz_class'] = df[demand_history_col].apply(classify_variability)

    return df

# Combined ABC-XYZ matrix
def abc_xyz_matrix(df):
    """Create ABC-XYZ classification matrix"""

    matrix = pd.crosstab(df['abc_class'], df['xyz_class'],
                         values=df['sku'], aggfunc='count')

    return matrix

Inventory Policy by Classification

ClassService LevelReview FrequencySafety StockMethod
A-X99%DailyHighContinuous review, tight control
A-Y98%DailyHighContinuous review
A-Z95%WeeklyVery highPeriodic review, high SS
B-X97%WeeklyMediumPeriodic or continuous
B-Y95%WeeklyMediumPeriodic review
B-Z90%Bi-weeklyHighPeriodic review
C-X90%MonthlyLowPeriodic review, simple rules
C-Y85%MonthlyMediumMin/max rules
C-Z80%As neededLow/noneOrder on demand or don't stock

Advanced Inventory Optimization

Service Level vs. Cost Trade-off

def service_level_analysis(demand_std, lead_time, unit_cost,
                           holding_cost_rate, stockout_cost):
    """
    Analyze optimal service level balancing holding vs. stockout costs
    """

    service_levels = np.arange(0.80, 0.995, 0.01)
    results = []

    holding_cost_per_unit = unit_cost * holding_cost_rate

    for sl in service_levels:
        # Safety stock required
        z = stats.norm.ppf(sl)
        std_during_lt = demand_std * np.sqrt(lead_time)
        ss = z * std_during_lt

        # Holding cost
        holding_cost = ss * holding_cost_per_unit

        # Expected stockout cost
        # Simplified: (1 - service_level) * stockout_cost
        expected_stockouts = (1 - sl) * stockout_cost

        total_cost = holding_cost + expected_stockouts

        results.append({
            'service_level': sl,
            'safety_stock': round(ss, 0),
            'holding_cost': round(holding_cost, 2),
            'stockout_cost': round(expected_stockouts, 2),
            'total_cost': round(total_cost, 2)
        })

    results_df = pd.DataFrame(results)

    # Find optimal
    optimal_idx = results_df['total_cost'].idxmin()
    optimal = results_df.iloc[optimal_idx]

    return results_df, optimal

# Example
results_df, optimal = service_level_analysis(
    demand_std=50,
    lead_time=14,
    unit_cost=100,
    holding_cost_rate=0.25,
    stockout_cost=5000  # Cost per stockout event
)

print(f"Optimal service level: {optimal['service_level']:.1%}")
print(f"Safety stock: {optimal['safety_stock']} units")
print(f"Total cost: ${optimal['total_cost']:,.2f}")

Inventory Turnover Optimization

Inventory Turns Formula:

Inventory Turns = Cost of Goods Sold (COGS) / Average Inventory Value
def inventory_metrics(annual_cogs, avg_inventory_value, target_turns=None):
    """
    Calculate inventory turnover metrics
    """

    turns = annual_cogs / avg_inventory_value
    days_on_hand = 365 / turns

    metrics = {
        'Inventory_Turns': round(turns, 2),
        'Days_On_Hand': round(days_on_hand, 1),
        'Avg_Inventory': avg_inventory_value
    }

    if target_turns:
        target_inventory = annual_cogs / target_turns
        reduction = avg_inventory_value - target_inventory
        metrics['Target_Inventory'] = round(target_inventory, 0)
        metrics['Inventory_Reduction'] = round(reduction, 0)
        metrics['Cash_Freed'] = round(reduction, 0)

    return metrics

# Example
metrics = inventory_metrics(
    annual_cogs=50_000_000,
    avg_inventory_value=10_000_000,
    target_turns=8
)

print(f"Current turns: {metrics['Inventory_Turns']}")
print(f"Days on hand: {metrics['Days_On_Hand']}")
if 'Target_Inventory' in metrics:
    print(f"Target inventory: ${metrics['Target_Inventory']:,.0f}")
    print(f"Cash to be freed: ${metrics['Cash_Freed']:,.0f}")

Multi-SKU Optimization

from scipy.optimize import minimize

def optimize_multi_sku_inventory(skus_data, total_budget, target_service_level=0.95):
    """
    Optimize inventory allocation across multiple SKUs with budget constraint

    skus_data: DataFrame with columns ['sku', 'demand_avg', 'demand_std',
                                        'lead_time', 'unit_cost', 'stockout_cost']
    """

    n_skus = len(skus_data)

    def objective(safety_stocks):
        """Minimize total cost (holding + expected stockouts)"""

        total_cost = 0

        for i, ss in enumerate(safety_stocks):
            row = skus_data.iloc[i]

            # Holding cost
            holding_cost = ss * row['unit_cost'] * 0.25  # 25% holding rate

            # Calculate achieved service level from safety stock
            z = ss / (row['demand_std'] * np.sqrt(row['lead_time']))
            service_level = stats.norm.cdf(z)

            # Stockout cost
            stockout_prob = 1 - service_level
            expected_stockout = stockout_prob * row['stockout_cost']

            total_cost += holding_cost + expected_stockout

        return total_cost

    def budget_constraint(safety_stocks):
        """Total inventory value must not exceed budget"""
        total_value = sum(
            ss * skus_data.iloc[i]['unit_cost']
            for i, ss in enumerate(safety_stocks)
        )
        return total_budget - total_value

    # Initial guess: equal allocation
    x0 = np.full(n_skus, total_budget / (n_skus * skus_data['unit_cost'].mean()))

    # Constraints
    constraints = [
        {'type': 'ineq', 'fun': budget_constraint}
    ]

    # Bounds: non-negative safety stock
    bounds = [(0, None) for _ in range(n_skus)]

    # Optimize
    result = minimize(objective, x0, method='SLSQP',
                     bounds=bounds, constraints=constraints)

    # Extract results
    optimal_ss = result.x

    results_df = skus_data.copy()
    results_df['optimal_safety_stock'] = optimal_ss
    results_df['inventory_value'] = optimal_ss * results_df['unit_cost']

    return results_df, result

# Example with multiple SKUs
skus_data = pd.DataFrame({
    'sku': ['A', 'B', 'C', 'D'],
    'demand_avg': [100, 200, 50, 150],
    'demand_std': [20, 40, 25, 30],
    'lead_time': [14, 7, 21, 14],
    'unit_cost': [50, 30, 100, 75],
    'stockout_cost': [500, 300, 1000, 600]
})

results_df, optimization = optimize_multi_sku_inventory(
    skus_data,
    total_budget=50000,
    target_service_level=0.95
)

print(results_df[['sku', 'optimal_safety_stock', 'inventory_value']])
print(f"\nTotal inventory value: ${results_df['inventory_value'].sum():,.0f}")

Tools & Libraries

Python Libraries

Inventory Optimization:

  • numpy: Numerical computations
  • scipy: Statistical distributions, optimization
  • pandas: Data manipulation
  • statsmodels: Time series analysis

Simulation:

  • simpy: Discrete event simulation
  • ciw: Queueing network simulation

Optimization:

  • scipy.optimize: Non-linear optimization
  • pulp: Linear programming
  • pyomo: Optimization modeling

Visualization:

  • matplotlib, seaborn: Plotting
  • plotly: Interactive charts

Commercial Software

Inventory Planning:

  • SAP IBP: Integrated business planning
  • Blue Yonder (JDA): Inventory optimization
  • Kinaxis RapidResponse: Supply chain planning
  • Logility: Inventory optimization
  • o9 Solutions: Digital planning platform

Specialized Tools:

  • Inventory Planner: E-commerce inventory
  • Lokad: Probabilistic forecasting & inventory
  • NetSuite: ERP with inventory management
  • Fishbowl: Inventory tracking & management

Common Challenges & Solutions

Challenge: Demand Variability

Problem:

  • High demand variability increases safety stock requirements
  • Difficult to forecast

Solutions:

  • Segment by ABC-XYZ, different policies per segment
  • Use probabilistic forecasting (distribution, not point estimate)
  • Consider demand smoothing strategies (promotions management)
  • Increase forecast frequency (weekly vs. monthly)
  • Implement demand sensing with real-time data

Challenge: Long Lead Times

Problem:

  • Longer lead times require more safety stock
  • Higher risk of stockouts or obsolescence

Solutions:

  • Work with suppliers to reduce lead time
  • Implement vendor-managed inventory (VMI)
  • Use safety lead time padding
  • Consider dual sourcing for critical items
  • Air freight for critical replenishments

Challenge: Excess Inventory

Problem:

  • Too much slow-moving or obsolete inventory
  • Cash tied up, storage costs

Solutions:

  • Implement ABC analysis, focus on C items
  • Markdown/clearance strategies
  • Return to supplier agreements
  • Improved demand forecasting
  • Reduce order quantities for slow movers
  • Consider drop-ship for long tail items

Challenge: Stockouts & Backorders

Problem:

  • Insufficient inventory, lost sales
  • Poor customer service

Solutions:

  • Increase safety stock (cost-service trade-off)
  • Improve forecast accuracy
  • Reduce lead time variability
  • Implement expedited shipping options
  • Better supply chain visibility
  • Consider make-to-order for low-volume items

Challenge: Balancing Cost vs. Service

Problem:

  • Conflicting objectives (minimize inventory vs. maximize service)

Solutions:

  • Quantify stockout costs (lost sales, penalties)
  • Use optimization to find optimal trade-off
  • Segment inventory (different service levels by class)
  • Implement service level agreements (SLAs)
  • Use cost-to-serve analysis

Challenge: Multi-Echelon Complexity

Problem:

  • Inventory at multiple locations (plants, DCs, stores)
  • Difficult to optimize holistically

Solutions:

  • See multi-echelon-inventory skill
  • Use network optimization models
  • Implement demand-driven replenishment
  • Centralize planning (but not necessarily inventory)
  • Consider postponement strategies

Output Format

Inventory Optimization Report

Executive Summary:

  • Current inventory investment and turns
  • Recommended inventory levels and policies
  • Expected service level improvements
  • Working capital impact

SKU-Level Recommendations:

SKUABCXYZCurrent Avg InvRecommended Avg InvSafety StockReorder PointOrder QtyPolicyService Level
SKU_001AX5004502001,6001,000(s,Q)99%
SKU_002BY300280120850500(R,S)95%
SKU_003CZ1505030250Min/MaxMonthly85%

Financial Impact:

MetricCurrentOptimizedImprovement
Total Inventory Value$15M$12M-$3M (-20%)
Inventory Turns4.56.0+1.5 (+33%)
Days on Hand8161-20 days
Fill Rate92%97%+5 pts
Annual Holding Cost$3.75M$3.0M-$750K

Implementation Plan:

  1. Phase 1: Implement policies for A items (80% of value)
  2. Phase 2: Roll out to B items
  3. Phase 3: Simplify C item management
  4. Ongoing: Monitor and adjust based on performance

Questions to Ask

If you need more context:

  1. What products/SKUs need optimization? How many total?
  2. What's the current inventory investment and turnover?
  3. What service levels are you targeting?
  4. What's the demand pattern? (stable, variable, seasonal, intermittent)
  5. What are the lead times from suppliers?
  6. What cost data is available? (product cost, ordering cost, holding cost rate)
  7. What's driving this initiative? (cost reduction, service improvement, working capital)

Related Skills

  • economic-order-quantity: Deep dive into EOQ models
  • demand-forecasting: Forecasting for inventory planning
  • multi-echelon-inventory: Network inventory optimization
  • stochastic-inventory-models: Probabilistic approaches
  • newsvendor-problem: Single-period inventory decisions
  • supply-chain-analytics: KPIs and performance metrics
  • abc-analysis: Classification and segmentation (if separate skill exists)
  • warehouse-slotting-optimization: Optimizing inventory placement

平台分布

Codex

35.64%
按下载量换算80

Claude

32.88%
按下载量换算74

Cursor

17.45%
按下载量换算39

Gemini CLI

9.33%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限未标注

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills