charlieviettq/awesome-agent-skill / .claude/skills/algo-sc-bullwhip
"algo-sc-bullwhip"
Verified"Analyze and mitigate the bullwhip effect where demand variability amplifies upstream in supply chains. Use this skill when the user needs to diagnose order variability amplification, quantify the bullwhip ratio, or implement dampening strategies — even if they say 'why are our orders so volatile', 'supply chain variability', or 'demand amplification problem'.".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.4 KB |
| examples/sample_scenario.md | markdown | 5.6 KB |
| references/bullwhip-model.md | markdown | 7.7 KB |
| references/information-sharing.md | markdown | 11.6 KB |
examples/sample_scenario.md
View on GitHub# Example: 台灣消費電子供應鏈的牛鞭效應診斷
## Scenario
**公司背景:** BrightTech Electronics,台灣中型消費電子品牌,主要產品為藍牙耳機與行動電源。供應鏈共三層:零售商(含實體通路與電商)→ 區域經銷商 → BrightTech(製造商)→ 零件供應商。
**用戶問題:**
> 「我們的生產線每季都要應對劇烈的訂單波動。零售端的銷售其實很穩定,Q4 耶誕旺季也頂多比平均高 20%,但我們收到的經銷商訂單有時會暴衝 80%。我們懷疑是牛鞭效應,但不知道問題到底出在哪一層、是哪個原因造成的。」
**可用資料:**
- 52 週的各層訂單資料(2024-Q1 至 2024-Q4)
- 零售端 POS 消費需求資料
- 促銷日曆(年中慶 6 月、雙 11 11 月、耶誕 12 月)
- 各層補貨週期:零售商每週下單,經銷商每兩週批次下單
---
## Analysis
### Phase 1 — 資料驗證
| 層級 | 資料型別 | 週數 | 備註 |
|------|---------|------|------|
| 終端消費需求 | 零售 POS | 52 週 | ✅ 基準線 |
| 零售商訂單 | 對經銷商 | 52 週 | ✅ |
| 經銷商訂單 | 對 BrightTech | 52 週 | ✅ |
| BrightTech 採購 | 對零件供應商 | 52 週 | ✅ |
✅ Gate 通過:4 層資料,52 期(>26 期門檻)。
---
### Phase 2 — 計算牛鞭比率
**原始統計:**
| 層級 | 週均值(件) | 標準差(σ) | CV(σ/μ) |
|------|------------|------------|---------|
| 終端消費需求 | 2,400 | 240 | **0.10** |
| 零售商訂單 | 2,420 | 484 | **0.20** |
| 經銷商訂單 | 2,450 | 931 | **0.38** |
| BrightTech 採購 | 2,480 | 1,686 | **0.68** |
**牛鞭比率(BWR = Var_upstream / Var_downstream):**
```
BWR(零售→經銷) = (0.20)² / (0.10)² = 0.0400 / 0.0100 = 4.00
BWR(經銷→製造) = (0.38)² / (0.20)² = 0.1444 / 0.0400 = 3.61
BWR(製造→供應) = (0.68)² / (0.38)² = 0.4624 / 0.1444 = 3.20
```
三層全部 BWR >> 1 → **牛鞭效應確認,且在零售→經銷層最嚴重。**
---
### Phase 3 — 根本原因識別
**原因 1:訂單批次(Order Batching)— 貢獻度 45%**
經銷商採每兩週批次下單,將 14 天的需求累積後一次送出。這導致:
- 偶數週出現巨大訂單,奇數週近乎零訂單
- BrightTech 看到的「需求」是人工製造的雙週脈衝,不是真實銷售
驗證:移除批次效應後(將兩週訂單攤平為均值),經銷商 CV 從 0.38 降至 0.22,BWR 從 3.61 降至 1.21。
**原因 2:需求訊號處理(Demand Signal Processing)— 貢獻度 35%**
零售商使用 4 週移動平均預測下季訂單,並加上 30% 安全係數。移動平均放大了短期波動,安全係數在旺季前進一步墊高訂單。
計算:4 週 MA 的訂單方差放大因子 ≈ 1 + 2L/T(L=前置時間 2 週,T=4 週)= **2.0x**,與觀察值吻合。
**原因 3:促銷期間的前置囤貨(Price Fluctuations / Forward Buying)— 貢獻度 20%**
年中慶(6 月第 3 週)與雙 11(11 月第 2 週)前三週,經銷商訂單平均比基線高出 **2.3x**,但同期 POS 銷售僅高 1.4x。差值即為前置囤貨量,確認促銷週期驅動投機性下單。
---
### Phase 4 — 驗證
- ✅ 三層 BWR 均 > 1,確認牛鞭效應
- ✅ 訂單峰值與可識別事件(促銷、批次週期)高度相關(r = 0.82)
- ✅ 根本原因三項加總貢獻度 = 100%,無殘差異常
---
## Result
### 輸出 JSON
```json
{
"bullwhip_ratios": [
{"tier": "retailer→distributor", "ratio": 4.00},
{"tier": "distributor→manufacturer", "ratio": 3.61},
{"tier": "manufacturer→supplier", "ratio": 3.20}
],
"root_causes": [
{"cause": "order_batching", "contribution_pct": 45, "detail": "經銷商兩週批次下單,製造端視為雙週脈衝訊號"},
{"cause": "demand_signal_processing", "contribution_pct": 35, "detail": "零售商 4 週 MA + 30% 安全係數,前置時間 2 週,放大因子 2.0x"},
{"cause": "price_fluctuations", "contribution_pct": 20, "detail": "年中慶、雙 11 促銷前 3 週前置囤貨,訂單/銷售比達 2.3x vs 1.4x"}
],
"mitigations": [
{
"action": "經銷商改為每週下單(縮短批次週期)",
"expected_bwr_reduction": "4.00 → ~1.5",
"effort": "low",
"dependency": "ERP 訂單系統調整"
},
{
"action": "零售商共享 POS 即時資料給 BrightTech(CPFR)",
"expected_bwr_reduction": "整體鏈 CV 降低 ~40%",
"effort": "medium",
"dependency": "資料介接與商業合約"
},
{
"action": "促銷期間採用 Committed-Quantity 分配,防止超量下單",
"expected_bwr_reduction": "消除促銷前囤貨峰值 ~60%",
"effort": "medium",
"dependency": "業務政策調整"
}
],
"metadata": {
"periods": 52,
"tiers_analyzed": 4,
"analysis_date": "2025-01-15",
"data_granularity": "weekly"
}
}
```
### 優先行動建議
1. **立即(本季):** 要求所有經銷商改為每週下單。這是成本最低、效果最大的單一改變,預計將零售→經銷 BWR 從 4.0 壓低至 1.5 以下。
2. **短期(Q2):** 與前三大零售商建立 POS 資料共享,取代 MA 預測作為補貨訊號。
3. **中期(Q3):** 在促銷合約中加入 Committed Quantity 條款,超出配額需提前 6 週確認,消除囤貨誘因。
> **注意:** 即使導入 POS 共享,批次下單和前置時間限制仍會保留部分放大效應(BWR 無法降至 1.0)。目標是將整體鏈 CV 從 0.68 壓低至 0.25 以下,讓 BrightTech 產能規劃誤差從目前的 ±40% 縮小至 ±15%。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |