Skill 详情
cwicr-takeoff-helper
Supports construction quantity takeoff, waste factors, and work items.
使用前先检查
自动化审核只检查相关性,不代表安全审查或推荐。使用前请阅读来源中的说明。
SKILL.md
这段内容是审核时保存的快照。外部来源才是完整且最新的版本。
---
name: "cwicr-takeoff-helper"
description: "Assist with quantity takeoff using CWICR data. Calculate quantities from dimensions, apply waste factors, and suggest related work items."
homepage: "https://datadrivenconstruction.io"
metadata: {"openclaw": {"emoji": "🗄️", "os": ["darwin", "linux", "win32"], "homepage": "https://datadrivenconstruction.io", "requires": {"bins": ["python3"]}}}
---
# 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_k在 GitHub 阅读完整来源 (打开外部页面)