返回首页 / 模板中心

制造业 · 技能案例

ManufacturingQualitySkill

该技能整合 MES 批次数据、检验记录与缺陷库,自动生成质量分析报告、异常追踪与整改任务列表,帮助制造团队缩短问题响应时间。

Skill 结构概览

  • 指令层:定义批次追踪报告结构、缺陷归类标准与根因分析提示。
  • 资源层:包含检验 SOP、设备维保记录、缺陷案例库与图纸链接。
  • 工具层:Python 脚本聚合批次数据,生成异常分布与纠正措施建议。

推荐资源

  1. data/mes_batches.csv —— 每日生产批次与产线信息。
  2. data/inspection_records.csv —— 检验结果与缺陷类型。
  3. scripts/quality_tracker.py —— 生成质量报告的核心脚本。

示例 SKILL.md 片段

---
name: ManufacturingQualitySkill
description: >
  Generate batch-level quality reviews by combining MES exports, inspection logs, and corrective action templates.
version: 1.1.0
visibility: organization
tags:
  - manufacturing
  - quality
  - analytics
entrypoint:
  command: analyze_quality
  label: Produce batch quality digest
---

## When Claude should load this skill
- Use when diagnosing line-level defects, preparing weekly CAPA reviews, or briefing plant leadership on yield risk.
- Schedule nightly rollups with `cron: 0 2 * * *` when running inside Claude API automations.

## Core workflow
1. Load `instructions/quality-review.md` for investigation flow, KPI thresholds, and escalation criteria.
2. Execute `python scripts/quality_tracker.py` to emit `QUALITY_ALERTS` with top defects per batch.
3. Populate `templates/capa-plan.md` to assign owners, root-cause hypotheses, and containment steps.

## Linked resources
- `data/mes_batches.csv` — Production metadata including shift, line, and supervisor notes.
- `data/inspection_records.csv` — Visual inspection results with defect taxonomy and counts.
- `instructions/quality-review.md` — Troubleshooting questions, sampling guidance, and reporting cadence.
- `templates/capa-plan.md` — CAPA template for documenting corrective and preventive actions.
- `dashboards/quality-kpis.csv` — Optional KPI snapshot for trending scrap rate and first-pass yield.

quality_tracker.py 样例

import pandas as pd

batches = pd.read_csv("data/mes_batches.csv")
inspections = pd.read_csv("data/inspection_records.csv")

defects = inspections.groupby(["batch_id", "defect_type"]).size().reset_index(name="count")
merged = batches.merge(defects, on="batch_id", how="left").fillna({"count": 0})

top_defects = (
    merged.sort_values("count", ascending=False)
    .groupby("batch_id")
    .head(3)
    .to_dict("records")
)

print("QUALITY_ALERTS=", top_defects)
1

上线流程

面向品质、生产与工程团队。

步骤 1: 与 MES/ERP 团队确认数据字段并配置导出自动化。
步骤 2: 调整缺陷分类、产线标签与阈值,测试脚本输出准确性。
步骤 3: 联动品质与工程团队,建立 CAPA 跟进机制与周报节奏。

成功指标建议

-35%

缺陷定位时间

+20%

CAPA 按时完成率

-15%

返工返修成本