cwicr-resource-analyzer
Analyze construction resources (labor, materials, equipment) from DDC CWICR database. Calculate resource requirements, productivity metrics, and optimization recommendations.
What this skill does
# CWICR Resource Analyzer
## Business Case
### Problem Statement
Construction projects require precise resource planning:
- How many labor hours are needed?
- What materials need to be procured?
- What equipment is required and for how long?
Traditional methods rely on experience-based estimates, leading to over/under allocation.
### Solution
Data-driven resource analysis using CWICR's 27,672 resources with detailed breakdowns of labor norms, material requirements, and equipment usage.
### Business Value
- **Accurate planning** - Based on validated resource norms
- **Cost optimization** - Identify resource inefficiencies
- **Procurement support** - Generate material lists
- **Labor planning** - Calculate crew requirements
## Technical Implementation
### Python Implementation
```python
import pandas as pd
import numpy as np
from typing import Dict, Any, List, Optional, Tuple
from dataclasses import dataclass, field
from enum import Enum
from collections import defaultdict
class ResourceType(Enum):
"""Types of construction resources."""
LABOR = "labor"
MATERIAL = "material"
EQUIPMENT = "equipment"
SUBCONTRACT = "subcontract"
class LaborCategory(Enum):
"""Labor skill categories."""
UNSKILLED = "unskilled"
SEMI_SKILLED = "semi_skilled"
SKILLED = "skilled"
FOREMAN = "foreman"
SUPERVISOR = "supervisor"
SPECIALIST = "specialist"
class EquipmentCategory(Enum):
"""Equipment categories."""
EARTHMOVING = "earthmoving"
LIFTING = "lifting"
CONCRETE = "concrete"
TRANSPORT = "transport"
COMPACTION = "compaction"
PUMPING = "pumping"
POWER_TOOLS = "power_tools"
SCAFFOLDING = "scaffolding"
@dataclass
class LaborResource:
"""Represents a labor resource."""
resource_code: str
description: str
category: LaborCategory
hourly_rate: float
skill_level: int
productivity_factor: float = 1.0
@dataclass
class MaterialResource:
"""Represents a material resource."""
resource_code: str
description: str
unit: str
unit_price: float
category: str
waste_factor: float = 0.05 # 5% default waste
@dataclass
class EquipmentResource:
"""Represents an equipment resource."""
resource_code: str
description: str
category: EquipmentCategory
hourly_rate: float
daily_rate: float
monthly_rate: float
fuel_consumption: float = 0.0 # liters per hour
operator_required: bool = True
@dataclass
class ResourceRequirement:
"""Calculated resource requirement."""
resource_code: str
description: str
resource_type: ResourceType
quantity: float
unit: str
unit_cost: float
total_cost: float
duration_hours: float = 0.0
@dataclass
class ResourceSummary:
"""Summary of all resource requirements."""
labor_hours: float
labor_cost: float
material_cost: float
equipment_cost: float
total_cost: float
labor_by_category: Dict[str, float] = field(default_factory=dict)
materials_list: List[Dict[str, Any]] = field(default_factory=list)
equipment_list: List[Dict[str, Any]] = field(default_factory=list)
class CWICRResourceAnalyzer:
"""Analyze resources from CWICR database."""
def __init__(self, cwicr_data: pd.DataFrame,
resources_data: Optional[pd.DataFrame] = None):
self.work_items = cwicr_data
self.resources = resources_data
# Create indexes
self._index_work_items()
if resources_data is not None:
self._index_resources()
def _index_work_items(self):
"""Index work items for fast lookup."""
if 'work_item_code' in self.work_items.columns:
self._work_index = self.work_items.set_index('work_item_code')
else:
self._work_index = None
def _index_resources(self):
"""Index resources for fast lookup."""
if self.resources is not None and 'resource_code' in self.resources.columns:
self._resource_index = self.resources.set_index('resource_code')
else:
self._resource_index = None
def analyze_labor_requirements(self, items: List[Dict[str, Any]]) -> Dict[str, Any]:
"""Analyze labor requirements for work items."""
total_hours = 0.0
labor_by_category = defaultdict(float)
labor_by_skill = defaultdict(float)
labor_details = []
for item in items:
code = item.get('work_item_code', item.get('code'))
qty = item.get('quantity', 0)
if self._work_index is not None and code in self._work_index.index:
work_item = self._work_index.loc[code]
labor_norm = float(work_item.get('labor_norm', 0) or 0)
hours = labor_norm * qty
total_hours += hours
# Get category if available
category = str(work_item.get('category', 'General'))
labor_by_category[category] += hours
labor_details.append({
'work_item_code': code,
'description': work_item.get('description', ''),
'quantity': qty,
'labor_norm': labor_norm,
'total_hours': hours
})
return {
'total_labor_hours': round(total_hours, 2),
'labor_by_category': dict(labor_by_category),
'crew_days_8hr': round(total_hours / 8, 1),
'crew_weeks_40hr': round(total_hours / 40, 1),
'details': labor_details
}
def analyze_material_requirements(self, items: List[Dict[str, Any]],
include_waste: bool = True) -> Dict[str, Any]:
"""Analyze material requirements."""
materials = defaultdict(lambda: {'quantity': 0, 'unit': '', 'cost': 0})
total_cost = 0.0
for item in items:
code = item.get('work_item_code', item.get('code'))
qty = item.get('quantity', 0)
if self._work_index is not None and code in self._work_index.index:
work_item = self._work_index.loc[code]
material_cost = float(work_item.get('material_cost', 0) or 0) * qty
if include_waste:
material_cost *= 1.05 # 5% waste factor
total_cost += material_cost
# Aggregate by category
category = str(work_item.get('category', 'General'))
materials[category]['cost'] += material_cost
return {
'total_material_cost': round(total_cost, 2),
'by_category': dict(materials),
'waste_included': include_waste,
'waste_factor': 0.05 if include_waste else 0
}
def analyze_equipment_requirements(self, items: List[Dict[str, Any]]) -> Dict[str, Any]:
"""Analyze equipment requirements."""
equipment_hours = defaultdict(float)
total_cost = 0.0
for item in items:
code = item.get('work_item_code', item.get('code'))
qty = item.get('quantity', 0)
if self._work_index is not None and code in self._work_index.index:
work_item = self._work_index.loc[code]
equipment_cost = float(work_item.get('equipment_cost', 0) or 0) * qty
equipment_norm = float(work_item.get('equipment_norm', 0) or 0) * qty
total_cost += equipment_cost
category = str(work_item.get('category', 'General'))
equipment_hours[category] += equipment_norm
return {
'total_equipment_cost': round(total_cost, 2),
'equipment_hours_by_category': dict(equipment_hours),
'total_equipment_hours': sum(equipment_hours.values())
}
def generate_resource_summary(self, items: List[Dict[str, Any]]) -> ResourceSummary:
"""Generate complete resource summary."""
labor = selRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.