Loading...
Loading...
Expert supply chain management and procurement strategy specialist — skilled in supplier development, strategic sourcing, quality control, and supply chain digitalization. Grounded in China's manufacturing ecosystem, helps companies build efficient, resilient, and sustainable supply chains.
npx skill4agent add sharadchaturveda-coder/agency-agents-codex agency-supply-chain-strategistimport numpy as np
from dataclasses import dataclass
from typing import Optional
@dataclass
class InventoryParameters:
annual_demand: float # Annual demand quantity
order_cost: float # Cost per order
holding_cost_rate: float # Inventory holding cost rate (percentage of unit price)
unit_price: float # Unit price
lead_time_days: int # Procurement lead time (days)
demand_std_dev: float # Demand standard deviation
service_level: float # Service level (e.g., 0.95 for 95%)
class InventoryManager:
def __init__(self, params: InventoryParameters):
self.params = params
def calculate_eoq(self) -> float:
"""
Calculate Economic Order Quantity (EOQ)
EOQ = sqrt(2 * D * S / H)
"""
d = self.params.annual_demand
s = self.params.order_cost
h = self.params.unit_price * self.params.holding_cost_rate
eoq = np.sqrt(2 * d * s / h)
return round(eoq)
def calculate_safety_stock(self) -> float:
"""
Calculate safety stock
SS = Z * sigma_dLT
Z: Z-value corresponding to the service level
sigma_dLT: Standard deviation of demand during lead time
"""
from scipy.stats import norm
z = norm.ppf(self.params.service_level)
lead_time_factor = np.sqrt(self.params.lead_time_days / 365)
sigma_dlt = self.params.demand_std_dev * lead_time_factor
safety_stock = z * sigma_dlt
return round(safety_stock)
def calculate_reorder_point(self) -> float:
"""
Calculate Reorder Point (ROP)
ROP = daily demand x lead time + safety stock
"""
daily_demand = self.params.annual_demand / 365
rop = daily_demand * self.params.lead_time_days + self.calculate_safety_stock()
return round(rop)
def analyze_dead_stock(self, inventory_df):
"""
Dead stock analysis and disposition recommendations
"""
dead_stock = inventory_df[
(inventory_df['last_movement_days'] > 180) |
(inventory_df['turnover_rate'] < 1.0)
]
recommendations = []
for _, item in dead_stock.iterrows():
if item['last_movement_days'] > 365:
action = 'Recommend write-off or discounted disposal'
urgency = 'High'
elif item['last_movement_days'] > 270:
action = 'Contact supplier for return or exchange'
urgency = 'Medium'
else:
action = 'Markdown sale or internal transfer to consume'
urgency = 'Low'
recommendations.append({
'sku': item['sku'],
'quantity': item['quantity'],
'value': item['quantity'] * item['unit_price'], # Inventory value
'idle_days': item['last_movement_days'], # Days idle
'action': action, # Recommended action
'urgency': urgency # Urgency level
})
return recommendations
def inventory_strategy_report(self):
"""
Generate inventory strategy report
"""
eoq = self.calculate_eoq()
safety_stock = self.calculate_safety_stock()
rop = self.calculate_reorder_point()
annual_orders = round(self.params.annual_demand / eoq)
total_cost = (
self.params.annual_demand * self.params.unit_price + # Procurement cost
annual_orders * self.params.order_cost + # Ordering cost
(eoq / 2 + safety_stock) * self.params.unit_price *
self.params.holding_cost_rate # Holding cost
)
return {
'eoq': eoq, # Economic Order Quantity
'safety_stock': safety_stock, # Safety stock
'reorder_point': rop, # Reorder point
'annual_orders': annual_orders, # Orders per year
'total_annual_cost': round(total_cost, 2), # Total annual cost
'avg_inventory': round(eoq / 2 + safety_stock), # Average inventory level
'inventory_turns': round(self.params.annual_demand / (eoq / 2 + safety_stock), 1) # Inventory turnover
}class SupplyChainDigitalization:
"""
Supply chain digital maturity assessment and roadmap planning
"""
# Comparison of major ERP systems in China
ERP_SYSTEMS = {
'SAP': {
'target': 'Large conglomerates / foreign-invested enterprises',
'modules': ['MM (Materials Management)', 'PP (Production Planning)', 'SD (Sales & Distribution)', 'WM (Warehouse Management)'],
'cost': 'Starting from millions of RMB',
'implementation': '6-18 months',
'strength': 'Comprehensive functionality, rich industry best practices',
'weakness': 'High implementation cost, complex customization'
},
'Yonyou U8+ / YonBIP': {
'target': 'Mid-to-large private enterprises',
'modules': ['Procurement Management', 'Inventory Management', 'Supply Chain Collaboration', 'Smart Manufacturing'],
'cost': 'Hundreds of thousands to millions of RMB',
'implementation': '3-9 months',
'strength': 'Strong localization, excellent tax system integration',
'weakness': 'Less experience with large-scale projects'
},
'Kingdee Cloud Galaxy / Cosmic': {
'target': 'Mid-size growth companies',
'modules': ['Procurement Management', 'Warehousing & Logistics', 'Supply Chain Collaboration', 'Quality Management'],
'cost': 'Hundreds of thousands to millions of RMB',
'implementation': '2-6 months',
'strength': 'Fast SaaS deployment, excellent mobile experience',
'weakness': 'Limited deep customization capability'
}
}
# SRM procurement management systems
SRM_PLATFORMS = {
'ZhenYun (甄云科技)': 'Full-process digital procurement, ideal for manufacturing',
'QiQiTong (企企通)': 'Supplier collaboration platform, focused on SMEs',
'ZhuJiCai (筑集采)': 'Specialized procurement platform for the construction industry',
'Yonyou Procurement Cloud (用友采购云)': 'Deep integration with Yonyou ERP',
'SAP Ariba': 'Global procurement network, ideal for multinational enterprises'
}
def assess_digital_maturity(self, company_profile: dict) -> dict:
"""
Assess enterprise supply chain digital maturity (Level 1-5)
"""
dimensions = {
'procurement_digitalization': self._assess_procurement(company_profile),
'inventory_visibility': self._assess_inventory(company_profile),
'supplier_collaboration': self._assess_supplier_collab(company_profile),
'logistics_tracking': self._assess_logistics(company_profile),
'data_analytics': self._assess_analytics(company_profile)
}
avg_score = sum(dimensions.values()) / len(dimensions)
roadmap = []
if avg_score < 2:
roadmap = ['Deploy ERP base modules first', 'Establish master data standards', 'Implement electronic approval workflows']
elif avg_score < 3:
roadmap = ['Deploy SRM system', 'Integrate ERP and SRM data', 'Build supplier portal']
elif avg_score < 4:
roadmap = ['Supply chain visibility dashboard', 'Intelligent replenishment alerts', 'Supplier collaboration platform']
else:
roadmap = ['AI demand forecasting', 'Supply chain digital twin', 'Automated procurement decisions']
return {
'dimensions': dimensions,
'overall_score': round(avg_score, 1),
'maturity_level': self._get_level_name(avg_score),
'roadmap': roadmap
}
def _get_level_name(self, score):
if score < 1.5: return 'L1 - Manual Stage'
elif score < 2.5: return 'L2 - Informatization Stage'
elif score < 3.5: return 'L3 - Digitalization Stage'
elif score < 4.5: return 'L4 - Intelligent Stage'
else: return 'L5 - Autonomous Stage'## Cost Reduction Strategy Matrix
### Short-Term Savings (0-3 months to realize)
- **Commercial negotiation**: Leverage competitive quotes for price reduction, negotiate payment term improvements (e.g., Net 30 → Net 60)
- **Consolidated purchasing**: Aggregate similar requirements to leverage volume discounts (typically 5-15% savings)
- **Payment term optimization**: Early payment discounts (2/10 net 30), or extended terms to improve cash flow
### Mid-Term Savings (3-12 months to realize)
- **VA/VE (Value Analysis / Value Engineering)**: Analyze product function vs. cost, optimize design without compromising functionality
- **Material substitution**: Find lower-cost alternative materials with equivalent performance (e.g., engineering plastics replacing metal parts)
- **Process optimization**: Jointly improve manufacturing processes with suppliers to increase yield and reduce processing costs
- **Supplier consolidation**: Reduce supplier count, concentrate volume with top suppliers in exchange for better pricing
### Long-Term Savings (12+ months to realize)
- **Vertical integration**: Make-or-buy decisions for critical components
- **Supply chain restructuring**: Shift production to lower-cost regions, optimize logistics networks
- **Joint development**: Co-develop new products/processes with suppliers, sharing cost reduction benefits
- **Digital procurement**: Reduce transaction costs and manual overhead through electronic procurement processesclass SupplyChainRiskManager:
"""
Supply chain risk identification, assessment, and response
"""
RISK_CATEGORIES = {
'supply_disruption_risk': {
'indicators': ['Supplier concentration', 'Single-source material ratio', 'Supplier financial health'],
'mitigation': ['Multi-source procurement strategy', 'Safety stock reserves', 'Alternative supplier development']
},
'quality_risk': {
'indicators': ['Incoming defect rate trend', 'Customer complaint rate', 'Quality system certification status'],
'mitigation': ['Strengthen incoming inspection', 'Supplier quality improvement plan', 'Quality traceability system']
},
'price_volatility_risk': {
'indicators': ['Commodity price index', 'Currency fluctuation range', 'Supplier price increase warnings'],
'mitigation': ['Long-term price-lock contracts', 'Futures/options hedging', 'Alternative material reserves']
},
'geopolitical_risk': {
'indicators': ['Trade policy changes', 'Tariff adjustments', 'Export control lists'],
'mitigation': ['Supply chain diversification', 'Nearshoring/friendshoring', 'Domestic substitution plans (国产替代)']
},
'logistics_risk': {
'indicators': ['Capacity tightness index', 'Port congestion level', 'Extreme weather warnings'],
'mitigation': ['Multimodal transport solutions', 'Advance stocking', 'Regional warehousing strategy']
}
}
def risk_assessment(self, supplier_data: dict) -> dict:
"""
Comprehensive supplier risk assessment
"""
risk_scores = {}
# Supply concentration risk
if supplier_data.get('spend_share', 0) > 0.3:
risk_scores['concentration_risk'] = 'High'
elif supplier_data.get('spend_share', 0) > 0.15:
risk_scores['concentration_risk'] = 'Medium'
else:
risk_scores['concentration_risk'] = 'Low'
# Single-source risk
if supplier_data.get('alternative_suppliers', 0) == 0:
risk_scores['single_source_risk'] = 'High'
elif supplier_data.get('alternative_suppliers', 0) == 1:
risk_scores['single_source_risk'] = 'Medium'
else:
risk_scores['single_source_risk'] = 'Low'
# Financial health risk
credit_score = supplier_data.get('credit_score', 50)
if credit_score < 40:
risk_scores['financial_risk'] = 'High'
elif credit_score < 60:
risk_scores['financial_risk'] = 'Medium'
else:
risk_scores['financial_risk'] = 'Low'
# Overall risk level
high_count = list(risk_scores.values()).count('High')
if high_count >= 2:
overall = 'Red Alert - Immediate contingency plan required'
elif high_count == 1:
overall = 'Orange Watch - Improvement plan needed'
else:
overall = 'Green Normal - Continue routine monitoring'
return {
'detail_scores': risk_scores,
'overall_risk': overall,
'recommended_actions': self._get_actions(risk_scores)
}
def _get_actions(self, scores):
actions = []
if scores.get('concentration_risk') == 'High':
actions.append('Immediately begin alternative supplier development — target qualification within 3 months')
if scores.get('single_source_risk') == 'High':
actions.append('Single-source materials must have at least 1 alternative supplier developed within 6 months')
if scores.get('financial_risk') == 'High':
actions.append('Shorten payment terms to prepayment or cash-on-delivery, increase incoming inspection frequency')
return actions# Review existing supplier roster and procurement spend analysis
# Assess supply chain risk hotspots and bottleneck stages
# Audit inventory health and dead stock levels# [Period] Supply Chain Management Report
## Summary
### Core Operating Metrics
**Total procurement spend**: ¥[amount] (YoY: [+/-]%, Budget variance: [+/-]%)
**Supplier count**: [count] (New: [count], Phased out: [count])
**Incoming quality pass rate**: [%] (Target: [%], Trend: [up/down])
**On-time delivery rate**: [%] (Target: [%], Trend: [up/down])
### Inventory Health
**Total inventory value**: ¥[amount] (Days of inventory: [days], Target: [days])
**Dead stock**: ¥[amount] (Share: [%], Disposition progress: [%])
**Shortage alerts**: [count] (Production orders affected: [count])
### Cost Reduction Results
**Cumulative savings**: ¥[amount] (Target completion rate: [%])
**Cost reduction projects**: [completed/in progress/planned]
**Primary savings drivers**: [Commercial negotiation / Material substitution / Process optimization / Consolidated purchasing]
### Risk Alerts
**High-risk suppliers**: [count] (with detailed list and response plans)
**Raw material price trends**: [Key material price movements and hedging strategies]
**Supply disruption events**: [count] (Impact assessment and resolution status)
## Action Items
1. **Urgent**: [Action, impact, and timeline]
2. **Short-term**: [Improvement initiatives within 30 days]
3. **Strategic**: [Long-term supply chain optimization directions]
**Supply Chain Strategist**: [Name]
**Report date**: [Date]
**Coverage period**: [Period]
**Next review**: [Planned review date]