Skip to main content
ClaudeWave
Skill173 estrellas del repoactualizado 3mo ago

safety-inspection

Digital safety inspection system for construction sites. Checklists, hazard tracking, incident reporting, and compliance documentation.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction /tmp/safety-inspection && cp -r /tmp/safety-inspection/1_DDC_Toolkit/Field-Operations/safety-inspection ~/.claude/skills/safety-inspection
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Safety Inspection System for Construction

Comprehensive digital safety management system for construction sites with inspection checklists, hazard tracking, and incident reporting.

## Business Case

**Problem**: Paper-based safety management leads to:
- Incomplete inspections (20-30% of items skipped)
- Lost documentation
- Delayed incident reporting
- Difficulty tracking corrective actions
- Compliance audit failures

**Solution**: Digital system that:
- Enforces complete checklist completion
- Photos attached to each finding
- Instant notifications for hazards
- Tracks corrective actions to closure
- Generates compliance reports

**ROI**: 40% reduction in recordable incidents, 100% audit compliance

## Safety Inspection Types

```
┌──────────────────────────────────────────────────────────────────────┐
│                    SAFETY INSPECTION TYPES                            │
├──────────────────────────────────────────────────────────────────────┤
│                                                                       │
│  DAILY                    WEEKLY                   SPECIAL           │
│  ┌─────────────┐          ┌─────────────┐         ┌─────────────┐   │
│  │ Pre-Work    │          │ Area Walk   │         │ Pre-Pour    │   │
│  │ • Housekeeping│        │ • Fire ext. │         │ • Formwork  │   │
│  │ • PPE       │          │ • First aid │         │ • Shoring   │   │
│  │ • Equipment │          │ • Scaffolds │         │ └─────────────┘   │
│  └─────────────┘          │ • Trenches  │         ┌─────────────┐   │
│  ┌─────────────┐          └─────────────┘         │ Crane Setup │   │
│  │ Toolbox Talk│          ┌─────────────┐         │ • Ground    │   │
│  │ • Topic     │          │ Equipment   │         │ • Load chart│   │
│  │ • Attendees │          │ • Cranes    │         │ • Rigging   │   │
│  │ • Sign-off  │          │ • Lifts     │         └─────────────┘   │
│  └─────────────┘          │ • Vehicles  │         ┌─────────────┐   │
│  ┌─────────────┐          └─────────────┘         │ Hot Work    │   │
│  │ End of Day  │                                  │ • Permit    │   │
│  │ • Secured   │                                  │ • Fire watch│   │
│  │ • Barricades│                                  └─────────────┘   │
│  └─────────────┘                                                     │
│                                                                       │
└──────────────────────────────────────────────────────────────────────┘
```

## Data Structure

```python
from dataclasses import dataclass, field
from datetime import datetime, date
from enum import Enum
from typing import List, Optional
import uuid

class HazardSeverity(Enum):
    CRITICAL = "Critical"      # Immediate danger to life
    HIGH = "High"              # Serious injury potential
    MEDIUM = "Medium"          # Injury potential
    LOW = "Low"                # Minor hazard
    OBSERVATION = "Observation"  # Best practice

class HazardStatus(Enum):
    OPEN = "Open"
    IN_PROGRESS = "In Progress"
    CORRECTED = "Corrected"
    VERIFIED = "Verified Closed"

class InspectionType(Enum):
    DAILY_PREWORK = "Daily Pre-Work"
    TOOLBOX_TALK = "Toolbox Talk"
    AREA_INSPECTION = "Area Inspection"
    EQUIPMENT_INSPECTION = "Equipment Inspection"
    HOT_WORK_PERMIT = "Hot Work Permit"
    CONFINED_SPACE = "Confined Space Entry"
    CRANE_LIFT = "Crane/Lift Inspection"
    SCAFFOLD = "Scaffold Inspection"
    EXCAVATION = "Excavation Inspection"
    INCIDENT = "Incident Report"

@dataclass
class Hazard:
    hazard_id: str
    inspection_id: str
    description: str
    severity: HazardSeverity
    location: str
    photo_urls: List[str] = field(default_factory=list)
    assigned_to: str = ""
    due_date: date = None
    status: HazardStatus = HazardStatus.OPEN
    corrective_action: str = ""
    corrected_date: date = None
    corrected_by: str = ""
    verification_date: date = None
    verified_by: str = ""

@dataclass
class Inspection:
    inspection_id: str
    inspection_type: InspectionType
    project_id: str
    date: date
    inspector: str
    location: str
    checklist_items: List[dict] = field(default_factory=list)
    hazards_found: List[Hazard] = field(default_factory=list)
    overall_rating: str = ""  # Pass/Fail/Conditional
    notes: str = ""
    photos: List[str] = field(default_factory=list)
    signatures: List[dict] = field(default_factory=list)
    weather: str = ""
    created_at: datetime = field(default_factory=datetime.now)

@dataclass
class Incident:
    incident_id: str
    project_id: str
    date: datetime
    type: str  # Near Miss, First Aid, Recordable, Lost Time
    description: str
    location: str
    injured_party: str = ""
    witness_names: List[str] = field(default_factory=list)
    immediate_actions: str = ""
    root_cause: str = ""
    corrective_actions: str = ""
    reported_by: str = ""
    photos: List[str] = field(default_factory=list)
    osha_recordable: bool = False
    days_away: int = 0
    days_restricted: int = 0
```

## Python Implementation

```python
import pandas as pd
from datetime import datetime, date, timedelta
from typing import List, Dict, Optional
import json
import os

class SafetyManager:
    """Construction site safety management system"""

    def __init__(self, project_id: str, storage_path: str = None):
        self.project_id = project_id
        self.storage_path = storage_path or f"safety_{project_id}"
        self.inspections: Dict[str, Inspection] = {}
        self.hazards: Dict[str, Hazard] = {}
        self.incidents: Dict[str, Incident] = {}

        # Load checklists
        self.checklists = self._load_checklists()

    def _load_checklists(self) -> Dict[str, List[dict]]:
        """Load inspection checklists"""
        return {
            InspectionType.DAILY_PREWORK.value: [
                {"id": "DP01", "item": "Work area clean and organized", "category": "Housekeeping"},
                {"id": "DP02", "item": "Walking