# downtime > Run equipment downtime analysis on Stresscon maintenance data. Calculates Cost of Idleness metrics, generates category breakdowns, monthly trends, and top-offender rankings. Use when analyzing equipment availability, maintenance KPIs, or estimating financial impact of machine downtime. - Author: BAM - Repository: bamussel23/claude-skills - Version: 20260207211010 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-08 - Source: https://github.com/bamussel23/claude-skills - Web: https://mule.run/skillshub/@@bamussel23/claude-skills~downtime:20260207211010 --- --- name: downtime description: > Run equipment downtime analysis on Stresscon maintenance data. Calculates Cost of Idleness metrics, generates category breakdowns, monthly trends, and top-offender rankings. Use when analyzing equipment availability, maintenance KPIs, or estimating financial impact of machine downtime. --- # Downtime Analysis Dashboard You run downtime analysis for Stresscon's precast concrete manufacturing equipment using the Python analytics modules. ## Before running analysis Read `references/api.md` for the full function signatures and data formats. ## Quick analysis workflow ### Step 1: Load data ```python from stresscon.downtime_analyzer import ( load_logs, calculate_downtime_minutes, aggregate_by_category, monthly_trends, top_offenders, ) from stresscon.cost_calculator import cost_of_idleness, department_cost_report # From CSV df = load_logs("path/to/maintenance_logs.csv") # Or from test data df = load_logs("python/data/test_maintenance_data.csv") ``` ### Step 2: Calculate downtime ```python df = calculate_downtime_minutes(df) # Adds "DowntimeMinutes" column from DowntimeEnd - DowntimeStart ``` ### Step 3: Run analyses ```python # Category breakdown (Mechanical, Electrical, Hydraulic, etc.) categories = aggregate_by_category(df) # Returns: IssueCategory, TotalDowntimeMinutes, Count # Monthly trends (pivot table) trends = monthly_trends(df) # Returns: months as rows, categories as columns, minutes as values # Top offending machines worst_machines = top_offenders(df, n=5) # Returns: AssetID, Title, TotalDowntimeMinutes ``` ### Step 4: Calculate costs ```python # Single downtime event cost = cost_of_idleness( downtime_minutes=240.0, hourly_labor_rate=45.0, # default from config production_rate_per_hour=1.0, # default from config ) # Returns: {downtime_minutes, downtime_hours, labor_cost, lost_production_units, total_cost} # Department-wide cost report dept_costs = department_cost_report(df, labor_rate=45.0, production_rate=1.0) # Returns: IssueCategory, TotalDowntimeMinutes, DowntimeHours, LaborCost, LostUnits ``` ### Step 5: Summarize findings When presenting results, always include: 1. **Total downtime** — sum of all DowntimeMinutes, formatted as hours 2. **Top category** — which IssueCategory has highest downtime 3. **Top offender** — which machine (AssetID + name) has highest downtime 4. **Cost impact** — total LaborCost across all categories 5. **Trend direction** — is downtime increasing or decreasing month-over-month? ## CLI analysis runner ```bash cd /Users/blakemusselman/claude/agent python python/scripts/run_analysis.py --csv python/data/test_maintenance_data.csv ``` ## Default cost parameters From `python/stresscon/config.py`: - `DEFAULT_LABOR_RATE = $45.00/hr` - `DEFAULT_PRODUCTION_RATE = 1.0 units/hr` These can be overridden by setting environment variables: - `DEFAULT_LABOR_RATE` - `DEFAULT_PRODUCTION_RATE` ## Data format requirements The input DataFrame must have these columns: - `AssetID` — equipment identifier (e.g., "CRN-01") - `Title` — equipment name (e.g., "Overhead Crane #1") - `IssueCategory` — one of: Mechanical, Electrical, Hydraulic, Pneumatic, Software, Safety - `SeverityLevel` — one of: Critical (Line Down), High (Needs Repair), Routine (Scheduled) - `DowntimeStart` — datetime (ISO format or parseable) - `DowntimeEnd` — datetime (ISO format or parseable)