charlieviettq/awesome-agent-skill / .claude/skills/algo-mfg-doe
"algo-mfg-doe"
Verified"Design and analyze factorial experiments to identify significant process factors and optimize settings. Use this skill when the user needs to systematically test factor effects, optimize a manufacturing process, or determine which variables matter most — even if they say 'which factors affect quality', 'optimize process settings', or 'design an experiment'.".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.6 KB |
| examples/sample_scenario.md | markdown | 5.3 KB |
| references/fractional-tables.md | markdown | 12.1 KB |
| references/rsm.md | markdown | 9.4 KB |
examples/sample_scenario.md
View on GitHub# Example: 注塑成型製程優化 — 找出影響不良率的關鍵因子
## Scenario
**公司:** 昱豐精密塑膠(台中工廠)
**時間:** 2026 年 3 月,品保主管 Kelly 向製造工程師 Aaron 求助
昱豐為汽車零件 Tier-2 供應商,產品為 ABS 材質車門內飾板扣件。近三個月不良率從 1.2% 攀升至 4.7%,客戶 Toyota TW 已發出 CAR(Corrective Action Request)。初步排查:原料批次、模具均無明顯異常。
Kelly 說:「我們懷疑是製程參數問題,但不知道哪個因子最關鍵。現在每週輪班三班,我能給你最多兩天的試驗時間,大概 20 個 shot 以內。」
**Response variable:** 扣件缺口寬度偏差(mm),規格 ±0.15 mm,超出即判不良。
**目標:** 找出顯著因子並找到最低不良率的製程設定。
---
## Analysis
### Phase 1: Input Validation(因子與水準定義)
Aaron 與設備工程師討論後,篩選出 3 個可操作因子:
| 因子 | 符號 | 低水準 (−1) | 高水準 (+1) | 單位 |
|------|------|------------|------------|------|
| 射出速度 | A | 45 | 75 | mm/s |
| 保壓壓力 | B | 60 | 90 | MPa |
| 料管溫度 | C | 220 | 250 | °C |
**排除因子(固定不動):** 冷卻時間(固定 18 s)、鎖模力(固定 280 T)— 設備限制無法在試驗窗口內變動。
**Gates 確認:**
- ✅ 3 個因子 × 2 水準 → 2³ = 8 runs,加 2 次完全重複 = 16 runs,在 20 shot 預算內
- ✅ 每個水準均在設備安全操作範圍內
- ✅ 使用全因子設計(不用分數因子),因子數少,可估計所有交互作用
---
### Phase 2: Core Algorithm
#### 設計矩陣(隨機化後執行順序)
Run order 由亂數表決定,避免班次效應(早班 vs. 夜班)混入結果。
| 執行序 | A(速度) | B(保壓) | C(溫度) | 偏差 Rep1 | 偏差 Rep2 |
|--------|----------|----------|----------|----------|----------|
| 1 | +1 (75) | −1 (60) | +1 (250) | 0.08 | 0.11 |
| 2 | −1 (45) | −1 (60) | −1 (220) | 0.19 | 0.21 |
| 3 | +1 (75) | +1 (90) | −1 (220) | 0.12 | 0.14 |
| 4 | −1 (45) | +1 (90) | +1 (250) | 0.07 | 0.09 |
| 5 | +1 (75) | −1 (60) | −1 (220) | 0.22 | 0.20 |
| 6 | −1 (45) | −1 (60) | +1 (250) | 0.16 | 0.18 |
| 7 | +1 (75) | +1 (90) | +1 (250) | 0.06 | 0.05 |
| 8 | −1 (45) | +1 (90) | −1 (220) | 0.13 | 0.15 |
> **注意:** 每個 run 均重新設定機台參數後再 shot(true replication),而非同一 shot 量兩次(repetition)。
#### ANOVA 結果摘要
計算各效應的主效應與交互作用(效應 = 高水準平均 − 低水準平均):
| 效應 | 估計值(mm) | p-value | 顯著? |
|------|------------|---------|--------|
| A(射出速度) | +0.031 | 0.092 | ✗(邊緣) |
| B(保壓壓力) | −0.082 | 0.001 | ✅ 顯著 |
| C(料管溫度) | −0.061 | 0.005 | ✅ 顯著 |
| A×B | −0.018 | 0.210 | ✗ |
| A×C | +0.012 | 0.380 | ✗ |
| **B×C** | **−0.049** | **0.018** | **✅ 顯著** |
| A×B×C | +0.007 | 0.640 | ✗ |
**R² = 0.91**,殘差常態性 OK(Shapiro-Wilk p = 0.43),殘差 vs. 擬合值無系統性趨勢。
#### 交互作用解讀:B×C(保壓 × 溫度)
| | C = 220°C | C = 250°C |
|---|---|---|
| B = 60 MPa | 0.195 mm | 0.132 mm |
| B = 90 MPa | 0.140 mm | **0.068 mm** |
→ 溫度 250°C 時,提高保壓壓力效果顯著(偏差降低 0.064 mm);但溫度 220°C 時,保壓效果較小(僅降 0.055 mm)。**不能只看單因子主效應 — 正是 OFAT 會遺漏的交互效應。**
---
### Phase 3: Verification
**最佳設定預測(基於迴歸模型):**
- A = 75 mm/s(射出速度高,雖不顯著但方向正確)
- B = 90 MPa(保壓高)
- C = 250°C(料管溫度高)
- **預測偏差:0.058 mm**(在規格 ±0.15 mm 內,裕度充足)
**確認實驗(3 runs at optimal settings):**
| 確認 run | 實測偏差 |
|---------|---------|
| 1 | 0.062 mm |
| 2 | 0.055 mm |
| 3 | 0.061 mm |
| **平均** | **0.059 mm** |
預測 0.058 vs. 實測 0.059 mm — 誤差 < 2%,**模型確認通過**。
---
## Result
```json
{
"significant_factors": [
{"factor": "保壓壓力 (B)", "effect": -0.082, "p_value": 0.001},
{"factor": "料管溫度 (C)", "effect": -0.061, "p_value": 0.005}
],
"interactions": [
{"factors": "保壓壓力×料管溫度 (B×C)", "effect": -0.049, "p_value": 0.018}
],
"optimal": {
"射出速度_mm_s": 75,
"保壓壓力_MPa": 90,
"料管溫度_C": 250,
"predicted_deviation_mm": 0.058
},
"metadata": {
"design": "2^3_full_factorial",
"runs": 8,
"replicates": 2,
"r_squared": 0.91,
"confirmation_runs": 3,
"confirmation_mean_mm": 0.059
}
}
```
**結論與行動:**
1. **立即調整製程參數** 至最佳設定(保壓 90 MPa、料管溫度 250°C),預計偏差降至 0.06 mm,理論不良率趨近 0%。
2. **射出速度非主要因子**(p = 0.092),可維持現行設定,不需強制提高。
3. **給客戶的 CAR 回覆:** 根因為保壓壓力偏低(長期設定 60 MPa 未隨季節料溫變化調整),導致溫度—保壓交互作用使偏差超規。已建立 SOP 將保壓設定鎖定為 90 MPa。
4. **後續監控:** 以 X̄-R 管制圖監控偏差,管制上限設 0.12 mm(留 0.03 mm 緩衝)。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |