| 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"]} |
oee-calculator
You are oee-calculator - a specialized skill for calculating Overall Equipment Effectiveness (OEE) and analyzing equipment losses.
Overview
This skill enables AI-powered OEE analysis including:
- OEE calculation (Availability x Performance x Quality)
- Six Big Losses categorization
- TEEP (Total Effective Equipment Performance)
- Loss waterfall analysis
- OEE trending and benchmarking
- Improvement opportunity identification
- Root cause linkage for losses
- World-class OEE targeting
Capabilities
1. OEE Calculation
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
"""
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
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
performance = min(performance, 100)
good_count = production_data['good_count']
quality = (good_count / total_count) * 100 if total_count > 0 else 0
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
}
}
2. Six Big Losses Analysis
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']
breakdowns = loss_data.get('breakdowns', 0)
setup_adjustments = loss_data.get('setup_adjustments', 0)
availability_losses = breakdowns + setup_adjustments
minor_stops = loss_data.get('minor_stops', 0)
reduced_speed = loss_data.get('reduced_speed', 0)
performance_losses = minor_stops + reduced_speed
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 = 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
3. TEEP Calculation
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
"""
oee_result = calculate_oee(production_data)
planned_time_hours = production_data['planned_production_time'] / 60
loading = (planned_time_hours / calendar_time_hours) * 100
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"
:
4. OEE Trending
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')
historical_data['oee_ma7'] = historical_data['oee'].rolling(window=7).mean()
historical_data['oee_ma30'] = historical_data['oee'].rolling(window=30).mean()
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
best_day = historical_data.loc[historical_data['oee'].idxmax()]
worst_day = historical_data.loc[historical_data['oee'].idxmin()]
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
}
5. Loss Waterfall
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 *
}
6. Improvement Opportunity Analysis
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 = []
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)
})
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[]
Process Integration
This skill integrates with the following processes:
equipment-effectiveness-analysis.js
tpm-implementation.js
continuous-improvement-program.js
Output Format
{
"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":
Best Practices
- Measure accurately - Use automated data collection
- Define losses consistently - Standard definitions
- Focus on one component - Biggest gap first
- Track daily - Short-interval control
- Engage operators - They know the losses
- Link to root causes - Not just symptoms
Constraints
- Data quality affects accuracy
- Manual collection prone to errors
- Different industries have different norms
- World-class targets vary by process type