用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/a5c-ai/babysitter --skill oee-calculator命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Reference for querying the Atlas knowledge graph through its MCP tools — the SECONDARY enrichment/comparison layer that adds best-practice context to systems you have ALREADY scanned from your real sources (`az`, repos, dirs). Use when you need to look up nodes, edges, kinds, clusters, stats, or wiki pages in Atlas to compare against your real inventory. (atlas graph, query atlas, atlas mcp, search the graph, graph neighbors, atlas record, atlas kinds, enrichment layer)
Atlas turns your STATED NEED into a real systems atlas by SCANNING your actual sources (Azure via `az`, git repos, local dirs) and process/data mining them, THEN enriching against the Atlas knowledge graph. Use this skill when asked to inventory/map your real systems, scan your cloud + repos + directories, mine the real processes or data they contain, or collect their real constraints/gotchas. (atlas, scan my systems, inventory our azure account, map my repos, real systems atlas, process mining, data mining, collect nuances, system discovery)
This skill should be used when the user asks to "find skills in the wild", "assimilate popular workflows", "discover SKILL.md files in repos", "research external skills", "find workflow patterns", "survey the skill landscape", "what skills exist out there", or wants to investigate public repositories for extractable processes, babysitter plugins, and reusable procedural insights. Searches GitHub for SKILL.md files, classifies repos by archetype, and maintains structured research under docs/reference-repos/.
基于 SOC 职业分类
正在显示 SKILL.md
| name | oee-calculator |
| description | Overall Equipment Effectiveness calculation skill with loss categorization and improvement analysis. |
| allowed-tools | Bash(*) Read Write Edit Glob Grep WebFetch |
| metadata | {"author":"babysitter-sdk","version":"1.0.0","category":"production-planning","backlog-id":"SK-IE-031"} |
| graph | {"domains":["domain:industrial-engineering"],"skillAreas":["skill-area:statistical-analysis","skill-area:organizational-design","skill-area:data-analysis"],"roles":["role:operations-analyst","role:research-engineer"]} |
You are oee-calculator - a specialized skill for calculating Overall Equipment Effectiveness (OEE) and analyzing equipment losses.
This skill enables AI-powered OEE analysis including:
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
def calculate_oee(production_data: dict):
"""
Calculate OEE from production data
production_data:
- planned_production_time: minutes
- actual_run_time: minutes
- ideal_cycle_time: minutes per unit
- total_count: units produced
- good_count: units without defects
"""
# Availability
planned_time = production_data['planned_production_time']
run_time = production_data['actual_run_time']
downtime = planned_time - run_time
availability = (run_time / planned_time) * 100 if planned_time > 0 else 0
# Performance
ideal_cycle = production_data['ideal_cycle_time']
total_count = production_data['total_count']
ideal_run_time = total_count * ideal_cycle
performance = (ideal_run_time / run_time) * 100 if run_time > 0 else 0
# Cap performance at 100% (adjust ideal cycle if consistently over)
performance = min(performance, 100)
# Quality
good_count = production_data['good_count']
quality = (good_count / total_count) * 100 if total_count > 0 else 0
# OEE
oee = (availability / 100) * (performance / 100) * (quality / 100) * 100
return {
"oee": round(oee, 1),
"availability": round(availability, 1),
"performance": round(performance, 1),
"quality": round(quality, 1),
"breakdown": {
"planned_time_minutes": planned_time,
"run_time_minutes": run_time,
"downtime_minutes": downtime,
"total_count": total_count,
"good_count": good_count,
"defect_count": total_count - good_count
}
}
def analyze_six_big_losses(loss_data: dict):
"""
Categorize and analyze the Six Big Losses
loss_data:
- breakdowns: minutes
- setup_adjustments: minutes
- minor_stops: minutes
- reduced_speed: minutes (calculated from speed losses)
- startup_rejects: units
- production_rejects: units
- planned_time: minutes
- ideal_cycle_time: minutes/unit
"""
planned_time = loss_data['planned_time']
ideal_cycle = loss_data['ideal_cycle_time']
# Availability Losses
breakdowns = loss_data.get('breakdowns', 0)
setup_adjustments = loss_data.get('setup_adjustments', 0)
availability_losses = breakdowns + setup_adjustments
# Performance Losses
minor_stops = loss_data.get('minor_stops', 0)
reduced_speed = loss_data.get('reduced_speed', 0)
performance_losses = minor_stops + reduced_speed
# Quality Losses (convert to time equivalent)
startup_rejects = loss_data.get('startup_rejects', 0)
production_rejects = loss_data.get('production_rejects', 0)
quality_losses = (startup_rejects + production_rejects) * ideal_cycle
# Total losses
total_losses = availability_losses + performance_losses + quality_losses
losses = {
"availability_losses": {
"breakdowns": {"minutes": breakdowns, "percent": breakdowns / planned_time * 100},
"setup_adjustments": {"minutes": setup_adjustments, "percent": setup_adjustments / planned_time * 100},
"subtotal": availability_losses
},
"performance_losses": {
: {: minor_stops, : minor_stops / planned_time * },
: {: reduced_speed, : reduced_speed / planned_time * },
: performance_losses
},
: {
: {: startup_rejects, : startup_rejects * ideal_cycle},
: {: production_rejects, : production_rejects * ideal_cycle},
: quality_losses
},
: total_losses,
: planned_time - total_losses,
: total_losses / planned_time *
}
losses
def calculate_teep(production_data: dict, calendar_time_hours: float = 24):
"""
Calculate Total Effective Equipment Performance
TEEP = OEE x Loading
Loading = Planned Production Time / Calendar Time
"""
# First calculate OEE
oee_result = calculate_oee(production_data)
# Calculate Loading
planned_time_hours = production_data['planned_production_time'] / 60
loading = (planned_time_hours / calendar_time_hours) * 100
# TEEP
teep = (oee_result['oee'] / 100) * (loading / 100) * 100
return {
"teep": round(teep, 1),
"oee": oee_result['oee'],
"loading": round(loading, 1),
"calendar_time_hours": calendar_time_hours,
"planned_time_hours": planned_time_hours,
"interpretation": interpret_teep(teep)
}
def interpret_teep(teep):
if teep >= 90:
return "World-class - exceptional asset utilization"
elif teep >= 70:
return "Good - some improvement opportunity"
elif teep >= 50:
return "Average - significant improvement potential"
:
def oee_trend_analysis(historical_data: pd.DataFrame):
"""
Analyze OEE trends over time
historical_data: DataFrame with columns ['date', 'oee', 'availability', 'performance', 'quality']
"""
historical_data = historical_data.sort_values('date')
# Calculate moving averages
historical_data['oee_ma7'] = historical_data['oee'].rolling(window=7).mean()
historical_data['oee_ma30'] = historical_data['oee'].rolling(window=30).mean()
# Calculate trend
if len(historical_data) >= 7:
recent = historical_data.tail(7)['oee'].mean()
previous = historical_data.tail(14).head(7)['oee'].mean() if len(historical_data) >= 14 else recent
trend = recent - previous
else:
trend = 0
# Find best and worst days
best_day = historical_data.loc[historical_data['oee'].idxmax()]
worst_day = historical_data.loc[historical_data['oee'].idxmin()]
# Identify limiting factor
means = {
'availability': historical_data['availability'].mean(),
'performance': historical_data['performance'].mean(),
'quality': historical_data['quality'].mean()
}
limiting_factor = min(means, key=means.get)
return {
"current_oee": round(historical_data[].iloc[-], ),
: (historical_data[].mean(), ),
: (trend, ),
: trend > trend < ,
: {: (best_day[]), : best_day[]},
: {: (worst_day[]), : worst_day[]},
: limiting_factor,
: means
}
def create_loss_waterfall(planned_time: float, losses: dict):
"""
Create waterfall data showing progression from planned time to productive time
"""
waterfall = [
{"category": "Planned Time", "value": planned_time, "type": "total"},
{"category": "Breakdowns", "value": -losses['breakdowns'], "type": "loss"},
{"category": "Changeovers", "value": -losses['setup_adjustments'], "type": "loss"},
{"category": "Minor Stops", "value": -losses['minor_stops'], "type": "loss"},
{"category": "Speed Loss", "value": -losses['reduced_speed'], "type": "loss"},
{"category": "Startup Rejects", "value": -losses['startup_rejects_time'], "type": "loss"},
{"category": "Production Rejects", "value": -losses['production_rejects_time'], "type": "loss"}
]
running_total = planned_time
for item in waterfall[:]:
running_total += item[]
item[] = running_total
waterfall.append({
: ,
: running_total,
:
})
{
: waterfall,
: planned_time - running_total,
: (planned_time - running_total) / planned_time *
}
def identify_improvement_opportunities(oee_data: dict, losses: dict, benchmarks: dict = None):
"""
Identify and prioritize OEE improvement opportunities
"""
benchmarks = benchmarks or {
'world_class_oee': 85,
'world_class_availability': 90,
'world_class_performance': 95,
'world_class_quality': 99.9
}
opportunities = []
# Availability opportunities
avail_gap = benchmarks['world_class_availability'] - oee_data['availability']
if avail_gap > 0:
opportunities.append({
'component': 'Availability',
'current': oee_data['availability'],
'target': benchmarks['world_class_availability'],
'gap': avail_gap,
'primary_losses': ['breakdowns', 'setup_adjustments'],
'potential_oee_gain': calculate_oee_impact(oee_data, 'availability', avail_gap)
})
# Performance opportunities
perf_gap = benchmarks['world_class_performance'] - oee_data['performance']
if perf_gap > 0:
opportunities.append({
'component': 'Performance',
'current': oee_data['performance'],
: benchmarks[],
: perf_gap,
: [, ],
: calculate_oee_impact(oee_data, , perf_gap)
})
qual_gap = benchmarks[] - oee_data[]
qual_gap > :
opportunities.append({
: ,
: oee_data[],
: benchmarks[],
: qual_gap,
: [, ],
: calculate_oee_impact(oee_data, , qual_gap)
})
opportunities.sort(key= x: x[], reverse=)
{
: opportunities,
: benchmarks[] - oee_data[],
: opportunities[][] opportunities
}
():
a = current[] + (improvement component == )
p = current[] + (improvement component == )
q = current[] + (improvement component == )
new_oee = (a / ) * (p / ) * (q / ) *
new_oee - current[]
This skill integrates with the following processes:
equipment-effectiveness-analysis.jstpm-implementation.jscontinuous-improvement-program.js{
"oee_summary": {
"oee": 72.5,
"availability": 85.0,
"performance": 92.0,
"quality": 92.7
},
"losses": {
"availability_losses": {"breakdowns": 45, "changeovers": 30},
"performance_losses": {"minor_stops": 20, "speed_loss": 15},
"quality_losses": {"rejects": 150}
},
"improvement_opportunities":