cwicr-takeoff-helper
Assist with quantity takeoff using CWICR data. Calculate quantities from dimensions, apply waste factors, and suggest related work items.
What this skill does
# CWICR Takeoff Helper
## Business Case
### Problem Statement
Quantity takeoff requires:
- Accurate calculations from dimensions
- Correct unit conversions
- Waste factor application
- Complete scope coverage
### Solution
Assist takeoff process with CWICR-based calculations, automatic waste factors, unit conversions, and related item suggestions.
### Business Value
- **Accuracy** - Validated calculations
- **Completeness** - Related items suggested
- **Speed** - Quick quantity calculations
- **Consistency** - Standard approaches
## Technical Implementation
```python
import pandas as pd
import numpy as np
from typing import Dict, Any, List, Optional, Tuple
from dataclasses import dataclass
from enum import Enum
import math
class TakeoffType(Enum):
"""Types of takeoff calculations."""
LINEAR = "linear" # Length
AREA = "area" # Square measure
VOLUME = "volume" # Cubic measure
COUNT = "count" # Each/number
WEIGHT = "weight" # By weight
class UnitSystem(Enum):
"""Unit systems."""
METRIC = "metric"
IMPERIAL = "imperial"
@dataclass
class TakeoffItem:
"""Single takeoff item."""
work_item_code: str
description: str
takeoff_type: TakeoffType
gross_quantity: float
waste_factor: float
net_quantity: float
unit: str
dimensions: Dict[str, float]
calculation: str
@dataclass
class TakeoffResult:
"""Complete takeoff result."""
items: List[TakeoffItem]
total_items: int
related_suggestions: List[str]
# Unit conversion factors
CONVERSIONS = {
# Length
('m', 'ft'): 3.28084,
('ft', 'm'): 0.3048,
('m', 'in'): 39.3701,
('in', 'm'): 0.0254,
# Area
('m2', 'sf'): 10.7639,
('sf', 'm2'): 0.0929,
# Volume
('m3', 'cf'): 35.3147,
('cf', 'm3'): 0.0283,
('m3', 'cy'): 1.30795,
('cy', 'm3'): 0.7646,
# Weight
('kg', 'lb'): 2.20462,
('lb', 'kg'): 0.453592,
('ton', 'kg'): 1000,
('kg', 'ton'): 0.001
}
# Standard waste factors
WASTE_FACTORS = {
'concrete': 0.05,
'rebar': 0.08,
'formwork': 0.10,
'brick': 0.10,
'block': 0.08,
'drywall': 0.12,
'tile': 0.15,
'lumber': 0.12,
'roofing': 0.10,
'paint': 0.10,
'pipe': 0.05,
'wire': 0.05,
'duct': 0.08,
'default': 0.05
}
# Related work items by category
RELATED_ITEMS = {
'concrete': ['formwork', 'rebar', 'curing', 'finishing'],
'masonry': ['mortar', 'reinforcement', 'ties', 'lintels'],
'drywall': ['framing', 'insulation', 'taping', 'painting'],
'roofing': ['underlayment', 'flashing', 'ventilation', 'insulation'],
'flooring': ['underlayment', 'adhesive', 'trim', 'transitions']
}
class CWICRTakeoffHelper:
"""Assist with quantity takeoff using CWICR data."""
def __init__(self, cwicr_data: pd.DataFrame = None):
self.cwicr = cwicr_data
if cwicr_data is not None:
self._index_cwicr()
def _index_cwicr(self):
"""Index CWICR data."""
if 'work_item_code' in self.cwicr.columns:
self._cwicr_index = self.cwicr.set_index('work_item_code')
else:
self._cwicr_index = None
def convert_unit(self, value: float, from_unit: str, to_unit: str) -> float:
"""Convert between units."""
if from_unit == to_unit:
return value
key = (from_unit.lower(), to_unit.lower())
if key in CONVERSIONS:
return value * CONVERSIONS[key]
# Try reverse
reverse_key = (to_unit.lower(), from_unit.lower())
if reverse_key in CONVERSIONS:
return value / CONVERSIONS[reverse_key]
return value
def get_waste_factor(self, work_item_code: str) -> float:
"""Get waste factor for work item."""
code_lower = work_item_code.lower()
for material, factor in WASTE_FACTORS.items():
if material in code_lower:
return factor
return WASTE_FACTORS['default']
def calculate_area(self,
length: float,
width: float,
deductions: List[Tuple[float, float]] = None) -> Dict[str, float]:
"""Calculate area with deductions."""
gross_area = length * width
deduction_area = 0
if deductions:
for d_length, d_width in deductions:
deduction_area += d_length * d_width
net_area = gross_area - deduction_area
return {
'gross_area': round(gross_area, 2),
'deductions': round(deduction_area, 2),
'net_area': round(net_area, 2),
'calculation': f"{length} x {width} = {gross_area}, minus {deduction_area} deductions"
}
def calculate_volume(self,
length: float,
width: float,
depth: float) -> Dict[str, float]:
"""Calculate volume."""
volume = length * width * depth
return {
'volume': round(volume, 3),
'calculation': f"{length} x {width} x {depth} = {volume}"
}
def calculate_perimeter(self,
length: float,
width: float) -> Dict[str, float]:
"""Calculate perimeter."""
perimeter = 2 * (length + width)
return {
'perimeter': round(perimeter, 2),
'calculation': f"2 x ({length} + {width}) = {perimeter}"
}
def calculate_concrete(self,
length: float,
width: float,
thickness: float,
work_item_code: str = "CONC-001") -> TakeoffItem:
"""Calculate concrete quantity with related items."""
volume = length * width * thickness
waste = self.get_waste_factor(work_item_code)
net_qty = volume * (1 + waste)
return TakeoffItem(
work_item_code=work_item_code,
description="Concrete",
takeoff_type=TakeoffType.VOLUME,
gross_quantity=round(volume, 3),
waste_factor=waste,
net_quantity=round(net_qty, 3),
unit="m3",
dimensions={'length': length, 'width': width, 'thickness': thickness},
calculation=f"{length}m x {width}m x {thickness}m = {volume:.3f} m3 + {waste:.0%} waste"
)
def calculate_wall_area(self,
perimeter: float,
height: float,
openings: List[Tuple[float, float]] = None,
work_item_code: str = "WALL-001") -> TakeoffItem:
"""Calculate wall area with openings deducted."""
gross_area = perimeter * height
opening_area = 0
if openings:
for w, h in openings:
opening_area += w * h
net_area = gross_area - opening_area
waste = self.get_waste_factor(work_item_code)
order_qty = net_area * (1 + waste)
return TakeoffItem(
work_item_code=work_item_code,
description="Wall finish",
takeoff_type=TakeoffType.AREA,
gross_quantity=round(gross_area, 2),
waste_factor=waste,
net_quantity=round(order_qty, 2),
unit="m2",
dimensions={'perimeter': perimeter, 'height': height, 'openings': len(openings or [])},
calculation=f"{perimeter}m x {height}m = {gross_area:.2f} m2 - {opening_area:.2f} openings + {waste:.0%} waste"
)
def calculate_flooring(self,
length: float,
width: float,
work_item_code: str = "FLOOR-001") -> TakeoffItem:
"""Calculate flooring quantity."""
area = length * width
waste = self.get_waste_factor(work_item_code)
order_qty = area * (1 + waste)
retuRelated 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.