[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FJRMT8PP9KA5VNAXAVADNK":3,"skill-same:01M6FJRMT8PP9KA5VNAXAVADNK":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":28,"frontMatter":29,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M6FJRMT8PP9KA5VNAXAVADNK","cwicr-takeoff-helper",null,"Assist with quantity takeoff using CWICR data. Calculate quantities from dimensions, apply waste factors, and suggest related work items.","kbarbel640-del\u002Fskills","kbarbel640-del","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F255315490?v=4","01M6CJPPQGCCESXMG3K7BBGQ5J","01M6CJPPX2PB2BCZERFVM2C2B3",1,"MIT","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdatadrivenconstruction\u002Fcwicr-takeoff-helper\u002FSKILL.md",[],[18,19,20,21,22,23,24],"helper","cwicr takeoff helper","data","calculate","work","dimensions","with","2026-11-10 10:12:30",false,"---\r\nslug: \"cwicr-takeoff-helper\"\r\ndisplay_name: \"CWICR Takeoff Helper\"\r\ndescription: \"Assist with quantity takeoff using CWICR data. Calculate quantities from dimensions, apply waste factors, and suggest related work items.\"\r\n---\r\n\r\n# CWICR Takeoff Helper\r\n\r\n## Business Case\r\n\r\n### Problem Statement\r\nQuantity takeoff requires:\r\n- Accurate calculations from dimensions\r\n- Correct unit conversions\r\n- Waste factor application\r\n- Complete scope coverage\r\n\r\n### Solution\r\nAssist takeoff process with CWICR-based calculations, automatic waste factors, unit conversions, and related item suggestions.\r\n\r\n### Business Value\r\n- **Accuracy** - Validated calculations\r\n- **Completeness** - Related items suggested\r\n- **Speed** - Quick quantity calculations\r\n- **Consistency** - Standard approaches\r\n\r\n## Technical Implementation\r\n\r\n```python\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom typing import Dict, Any, List, Optional, Tuple\r\nfrom dataclasses import dataclass\r\nfrom enum import Enum\r\nimport math\r\n\r\n\r\nclass TakeoffType(Enum):\r\n    \"\"\"Types of takeoff calculations.\"\"\"\r\n    LINEAR = \"linear\"        # Length\r\n    AREA = \"area\"            # Square measure\r\n    VOLUME = \"volume\"        # Cubic measure\r\n    COUNT = \"count\"          # Each\u002Fnumber\r\n    WEIGHT = \"weight\"        # By weight\r\n\r\n\r\nclass UnitSystem(Enum):\r\n    \"\"\"Unit systems.\"\"\"\r\n    METRIC = \"metric\"\r\n    IMPERIAL = \"imperial\"\r\n\r\n\r\n@dataclass\r\nclass TakeoffItem:\r\n    \"\"\"Single takeoff item.\"\"\"\r\n    work_item_code: str\r\n    description: str\r\n    takeoff_type: TakeoffType\r\n    gross_quantity: float\r\n    waste_factor: float\r\n    net_quantity: float\r\n    unit: str\r\n    dimensions: Dict[str, float]\r\n    calculation: str\r\n\r\n\r\n@dataclass\r\nclass TakeoffResult:\r\n    \"\"\"Complete takeoff result.\"\"\"\r\n    items: List[TakeoffItem]\r\n    total_items: int\r\n    related_suggestions: List[str]\r\n\r\n\r\n# Unit conversion factors\r\nCONVERSIONS = {\r\n    # Length\r\n    ('m', 'ft'): 3.28084,\r\n    ('ft', 'm'): 0.3048,\r\n    ('m', 'in'): 39.3701,\r\n    ('in', 'm'): 0.0254,\r\n\r\n    # Area\r\n    ('m2', 'sf'): 10.7639,\r\n    ('sf', 'm2'): 0.0929,\r\n\r\n    # Volume\r\n    ('m3', 'cf'): 35.3147,\r\n    ('cf', 'm3'): 0.0283,\r\n    ('m3', 'cy'): 1.30795,\r\n    ('cy', 'm3'): 0.7646,\r\n\r\n    # Weight\r\n    ('kg', 'lb'): 2.20462,\r\n    ('lb', 'kg'): 0.453592,\r\n    ('ton', 'kg'): 1000,\r\n    ('kg', 'ton'): 0.001\r\n}\r\n\r\n# Standard waste factors\r\nWASTE_FACTORS = {\r\n    'concrete': 0.05,\r\n    'rebar': 0.08,\r\n    'formwork': 0.10,\r\n    'brick': 0.10,\r\n    'block': 0.08,\r\n    'drywall': 0.12,\r\n    'tile': 0.15,\r\n    'lumber': 0.12,\r\n    'roofing': 0.10,\r\n    'paint': 0.10,\r\n    'pipe': 0.05,\r\n    'wire': 0.05,\r\n    'duct': 0.08,\r\n    'default': 0.05\r\n}\r\n\r\n# Related work items by category\r\nRELATED_ITEMS = {\r\n    'concrete': ['formwork', 'rebar', 'curing', 'finishing'],\r\n    'masonry': ['mortar', 'reinforcement', 'ties', 'lintels'],\r\n    'drywall': ['framing', 'insulation', 'taping', 'painting'],\r\n    'roofing': ['underlayment', 'flashing', 'ventilation', 'insulation'],\r\n    'flooring': ['underlayment', 'adhesive', 'trim', 'transitions']\r\n}\r\n\r\n\r\nclass CWICRTakeoffHelper:\r\n    \"\"\"Assist with quantity takeoff using CWICR data.\"\"\"\r\n\r\n    def __init__(self, cwicr_data: pd.DataFrame = None):\r\n        self.cwicr = cwicr_data\r\n        if cwicr_data is not None:\r\n            self._index_cwicr()\r\n\r\n    def _index_cwicr(self):\r\n        \"\"\"Index CWICR data.\"\"\"\r\n        if 'work_item_code' in self.cwicr.columns:\r\n            self._cwicr_index = self.cwicr.set_index('work_item_code')\r\n        else:\r\n            self._cwicr_index = None\r\n\r\n    def convert_unit(self, value: float, from_unit: str, to_unit: str) -> float:\r\n        \"\"\"Convert between units.\"\"\"\r\n        if from_unit == to_unit:\r\n            return value\r\n\r\n        key = (from_unit.lower(), to_unit.lower())\r\n        if key in CONVERSIONS:\r\n            return value * CONVERSIONS[key]\r\n\r\n        # Try reverse\r\n        reverse_key = (to_unit.lower(), from_unit.lower())\r\n        if reverse_key in CONVERSIONS:\r\n            return value \u002F CONVERSIONS[reverse_key]\r\n\r\n        return value\r\n\r\n    def get_waste_factor(self, work_item_code: str) -> float:\r\n        \"\"\"Get waste factor for work item.\"\"\"\r\n        code_lower = work_item_code.lower()\r\n\r\n        for material, factor in WASTE_FACTORS.items():\r\n            if material in code_lower:\r\n                return factor\r\n\r\n        return WASTE_FACTORS['default']\r\n\r\n    def calculate_area(self,\r\n                       length: float,\r\n                       width: float,\r\n                       deductions: List[Tuple[float, float]] = None) -> Dict[str, float]:\r\n        \"\"\"Calculate area with deductions.\"\"\"\r\n\r\n        gross_area = length * width\r\n\r\n        deduction_area = 0\r\n        if deductions:\r\n            for d_length, d_width in deductions:\r\n                deduction_area += d_length * d_width\r\n\r\n        net_area = gross_area - deduction_area\r\n\r\n        return {\r\n            'gross_area': round(gross_area, 2),\r\n            'deductions': round(deduction_area, 2),\r\n            'net_area': round(net_area, 2),\r\n            'calculation': f\"{length} x {width} = {gross_area}, minus {deduction_area} deductions\"\r\n        }\r\n\r\n    def calculate_volume(self,\r\n                          length: float,\r\n                          width: float,\r\n                          depth: float) -> Dict[str, float]:\r\n        \"\"\"Calculate volume.\"\"\"\r\n\r\n        volume = length * width * depth\r\n\r\n        return {\r\n            'volume': round(volume, 3),\r\n            'calculation': f\"{length} x {width} x {depth} = {volume}\"\r\n        }\r\n\r\n    def calculate_perimeter(self,\r\n                            length: float,\r\n                            width: float) -> Dict[str, float]:\r\n        \"\"\"Calculate perimeter.\"\"\"\r\n\r\n        perimeter = 2 * (length + width)\r\n\r\n        return {\r\n            'perimeter': round(perimeter, 2),\r\n            'calculation': f\"2 x ({length} + {width}) = {perimeter}\"\r\n        }\r\n\r\n    def calculate_concrete(self,\r\n                            length: float,\r\n                            width: float,\r\n                            thickness: float,\r\n                            work_item_code: str = \"CONC-001\") -> TakeoffItem:\r\n        \"\"\"Calculate concrete quantity with related items.\"\"\"\r\n\r\n        volume = length * width * thickness\r\n        waste = self.get_waste_factor(work_item_code)\r\n        net_qty = volume * (1 + waste)\r\n\r\n        return TakeoffItem(\r\n            work_item_code=work_item_code,\r\n            description=\"Concrete\",\r\n            takeoff_type=TakeoffType.VOLUME,\r\n            gross_quantity=round(volume, 3),\r\n            waste_factor=waste,\r\n            net_quantity=round(net_qty, 3),\r\n            unit=\"m3\",\r\n            dimensions={'length': length, 'width': width, 'thickness': thickness},\r\n            calculation=f\"{length}m x {width}m x {thickness}m = {volume:.3f} m3 + {waste:.0%} waste\"\r\n        )\r\n\r\n    def calculate_wall_area(self,\r\n                             perimeter: float,\r\n                             height: float,\r\n                             openings: List[Tuple[float, float]] = None,\r\n                             work_item_code: str = \"WALL-001\") -> TakeoffItem:\r\n        \"\"\"Calculate wall area with openings deducted.\"\"\"\r\n\r\n        gross_area = perimeter * height\r\n\r\n        opening_area = 0\r\n        if openings:\r\n            for w, h in openings:\r\n                opening_area += w * h\r\n\r\n        net_area = gross_area - opening_area\r\n        waste = self.get_waste_factor(work_item_code)\r\n        order_qty = net_area * (1 + waste)\r\n\r\n        return TakeoffItem(\r\n            work_item_code=work_item_code,\r\n            description=\"Wall finish\",\r\n            takeoff_type=TakeoffType.AREA,\r\n            gross_quantity=round(gross_area, 2),\r\n            waste_factor=waste,\r\n            net_quantity=round(order_qty, 2),\r\n            unit=\"m2\",\r\n            dimensions={'perimeter': perimeter, 'height': height, 'openings': len(openings or [])},\r\n            calculation=f\"{perimeter}m x {height}m = {gross_area:.2f} m2 - {opening_area:.2f} openings + {waste:.0%} waste\"\r\n        )\r\n\r\n    def calculate_flooring(self,\r\n                            length: float,\r\n                            width: float,\r\n                            work_item_code: str = \"FLOOR-001\") -> TakeoffItem:\r\n        \"\"\"Calculate flooring quantity.\"\"\"\r\n\r\n        area = length * width\r\n        waste = self.get_waste_factor(work_item_code)\r\n        order_qty = area * (1 + waste)\r\n\r\n        return TakeoffItem(\r\n            work_item_code=work_item_code,\r\n            description=\"Flooring\",\r\n            takeoff_type=TakeoffType.AREA,\r\n            gross_quantity=round(area, 2),\r\n            waste_factor=waste,\r\n            net_quantity=round(order_qty, 2),\r\n            unit=\"m2\",\r\n            dimensions={'length': length, 'width': width},\r\n            calculation=f\"{length}m x {width}m = {area:.2f} m2 + {waste:.0%} waste\"\r\n        )\r\n\r\n    def calculate_rebar(self,\r\n                         concrete_volume: float,\r\n                         kg_per_m3: float = 100,\r\n                         work_item_code: str = \"REBAR-001\") -> TakeoffItem:\r\n        \"\"\"Calculate rebar from concrete volume.\"\"\"\r\n\r\n        weight = concrete_volume * kg_per_m3\r\n        waste = self.get_waste_factor(work_item_code)\r\n        order_qty = weight * (1 + waste)\r\n\r\n        return TakeoffItem(\r\n            work_item_code=work_item_code,\r\n            description=\"Reinforcement\",\r\n            takeoff_type=TakeoffType.WEIGHT,\r\n            gross_quantity=round(weight, 1),\r\n            waste_factor=waste,\r\n            net_quantity=round(order_qty, 1),\r\n            unit=\"kg\",\r\n            dimensions={'concrete_m3': concrete_volume, 'kg_per_m3': kg_per_m3},\r\n            calculation=f\"{concrete_volume} m3 x {kg_per_m3} kg\u002Fm3 = {weight:.1f} kg + {waste:.0%} waste\"\r\n        )\r\n\r\n    def suggest_related_items(self, work_item_code: str) -> List[str]:\r\n        \"\"\"Suggest related work items.\"\"\"\r\n\r\n        code_lower = work_item_code.lower()\r\n\r\n        for category, related in RELATED_ITEMS.items():\r\n            if category in code_lower:\r\n                return related\r\n\r\n        return []\r\n\r\n    def room_takeoff(self,\r\n                      length: float,\r\n                      width: float,\r\n                      height: float,\r\n                      openings: List[Tuple[float, float]] = None) -> TakeoffResult:\r\n        \"\"\"Complete room takeoff.\"\"\"\r\n\r\n        items = []\r\n\r\n        # Floor\r\n        floor = self.calculate_flooring(length, width, \"FLOOR-001\")\r\n        items.append(floor)\r\n\r\n        # Ceiling (same as floor)\r\n        ceiling = TakeoffItem(\r\n            work_item_code=\"CEIL-001\",\r\n            description=\"Ceiling\",\r\n            takeoff_type=TakeoffType.AREA,\r\n            gross_quantity=floor.gross_quantity,\r\n            waste_factor=floor.waste_factor,\r\n            net_quantity=floor.net_quantity,\r\n            unit=\"m2\",\r\n            dimensions=floor.dimensions,\r\n            calculation=f\"Same as floor: {floor.gross_quantity} m2\"\r\n        )\r\n        items.append(ceiling)\r\n\r\n        # Walls\r\n        perimeter = 2 * (length + width)\r\n        walls = self.calculate_wall_area(perimeter, height, openings, \"WALL-001\")\r\n        items.append(walls)\r\n\r\n        # Related suggestions\r\n        suggestions = ['paint', 'baseboard', 'trim', 'electrical outlets']\r\n\r\n        return TakeoffResult(\r\n            items=items,\r\n            total_items=len(items),\r\n            related_suggestions=suggestions\r\n        )\r\n\r\n    def export_takeoff(self,\r\n                        items: List[TakeoffItem],\r\n                        output_path: str) -> str:\r\n        \"\"\"Export takeoff to Excel.\"\"\"\r\n\r\n        with pd.ExcelWriter(output_path, engine='openpyxl') as writer:\r\n            df = pd.DataFrame([\r\n                {\r\n                    'Work Item Code': item.work_item_code,\r\n                    'Description': item.description,\r\n                    'Type': item.takeoff_type.value,\r\n                    'Gross Qty': item.gross_quantity,\r\n                    'Waste %': f\"{item.waste_factor:.0%}\",\r\n                    'Net Qty': item.net_quantity,\r\n                    'Unit': item.unit,\r\n                    'Calculation': item.calculation\r\n                }\r\n                for item in items\r\n            ])\r\n            df.to_excel(writer, sheet_name='Takeoff', index=False)\r\n\r\n        return output_path\r\n```\r\n\r\n## Quick Start\r\n\r\n```python\r\n# Initialize helper\r\nhelper = CWICRTakeoffHelper()\r\n\r\n# Calculate concrete slab\r\nconcrete = helper.calculate_concrete(\r\n    length=10,\r\n    width=8,\r\n    thickness=0.2\r\n)\r\n\r\nprint(f\"Gross: {concrete.gross_quantity} m3\")\r\nprint(f\"Order Qty: {concrete.net_quantity} m3\")\r\nprint(f\"Calculation: {concrete.calculation}\")\r\n```\r\n\r\n## Common Use Cases\r\n\r\n### 1. Room Takeoff\r\n```python\r\nroom = helper.room_takeoff(\r\n    length=5,\r\n    width=4,\r\n    height=2.8,\r\n    openings=[(0.9, 2.1), (1.2, 1.5)]  # door, window\r\n)\r\n\r\nfor item in room.items:\r\n    print(f\"{item.description}: {item.net_quantity} {item.unit}\")\r\n```\r\n\r\n### 2. Unit Conversion\r\n```python\r\nmeters = helper.convert_unit(100, 'ft', 'm')\r\nprint(f\"100 ft = {meters:.2f} m\")\r\n```\r\n\r\n### 3. Rebar from Concrete\r\n```python\r\nconcrete = helper.calculate_concrete(10, 8, 0.3)\r\nrebar = helper.calculate_rebar(concrete.gross_quantity, kg_per_m3=120)\r\nprint(f\"Rebar: {rebar.net_quantity} kg\")\r\n```\r\n\r\n### 4. Related Items\r\n```python\r\nrelated = helper.suggest_related_items(\"CONC-SLAB-001\")\r\nprint(f\"Related: {related}\")\r\n```\r\n\r\n## Resources\r\n- **GitHub**: [OpenConstructionEstimate-DDC-CWICR](https:\u002F\u002Fgithub.com\u002Fdatadrivenconstruction\u002FOpenConstructionEstimate-DDC-CWICR)\r\n- **DDC Book**: Chapter 3.1 - Quantity Takeoff Methods\r\n","# CWICR Takeoff Helper\r\n\r\n## Business Case\r\n\r\n### Problem Statement\r\nQuantity takeoff requires:\r\n- Accurate calculations from dimensions\r\n- Correct unit conversions\r\n- Waste factor application\r\n- Complete scope coverage\r\n\r\n### Solution\r\nAssist takeoff process with CWICR-based calculations, automatic waste factors, unit conversions, and related item suggestions.\r\n\r\n### Business Value\r\n- **Accuracy** - Validated calculations\r\n- **Completeness** - Related items suggested\r\n- **Speed** - Quick quantity calculations\r\n- **Consistency** - Standard approaches\r\n\r\n## Technical Implementation\r\n\r\n```python\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom typing import Dict, Any, List, Optional, Tuple\r\nfrom dataclasses import dataclass\r\nfrom enum import Enum\r\nimport math\r\n\r\n\r\nclass TakeoffType(Enum):\r\n    \"\"\"Types of takeoff calculations.\"\"\"\r\n    LINEAR = \"linear\"        # Length\r\n    AREA = \"area\"            # Square measure\r\n    VOLUME = \"volume\"        # Cubic measure\r\n    COUNT = \"count\"          # Each\u002Fnumber\r\n    WEIGHT = \"weight\"        # By weight\r\n\r\n\r\nclass UnitSystem(Enum):\r\n    \"\"\"Unit systems.\"\"\"\r\n    METRIC = \"metric\"\r\n    IMPERIAL = \"imperial\"\r\n\r\n\r\n@dataclass\r\nclass TakeoffItem:\r\n    \"\"\"Single takeoff item.\"\"\"\r\n    work_item_code: str\r\n    description: str\r\n    takeoff_type: TakeoffType\r\n    gross_quantity: float\r\n    waste_factor: float\r\n    net_quantity: float\r\n    unit: str\r\n    dimensions: Dict[str, float]\r\n    calculation: str\r\n\r\n\r\n@dataclass\r\nclass TakeoffResult:\r\n    \"\"\"Complete takeoff result.\"\"\"\r\n    items: List[TakeoffItem]\r\n    total_items: int\r\n    related_suggestions: List[str]\r\n\r\n\r\n# Unit conversion factors\r\nCONVERSIONS = {\r\n    # Length\r\n    ('m', 'ft'): 3.28084,\r\n    ('ft', 'm'): 0.3048,\r\n    ('m', 'in'): 39.3701,\r\n    ('in', 'm'): 0.0254,\r\n\r\n    # Area\r\n    ('m2', 'sf'): 10.7639,\r\n    ('sf', 'm2'): 0.0929,\r\n\r\n    # Volume\r\n    ('m3', 'cf'): 35.3147,\r\n    ('cf', 'm3'): 0.0283,\r\n    ('m3', 'cy'): 1.30795,\r\n    ('cy', 'm3'): 0.7646,\r\n\r\n    # Weight\r\n    ('kg', 'lb'): 2.20462,\r\n    ('lb', 'kg'): 0.453592,\r\n    ('ton', 'kg'): 1000,\r\n    ('kg', 'ton'): 0.001\r\n}\r\n\r\n# Standard waste factors\r\nWASTE_FACTORS = {\r\n    'concrete': 0.05,\r\n    'rebar': 0.08,\r\n    'formwork': 0.10,\r\n    'brick': 0.10,\r\n    'block': 0.08,\r\n    'drywall': 0.12,\r\n    'tile': 0.15,\r\n    'lumber': 0.12,\r\n    'roofing': 0.10,\r\n    'paint': 0.10,\r\n    'pipe': 0.05,\r\n    'wire': 0.05,\r\n    'duct': 0.08,\r\n    'default': 0.05\r\n}\r\n\r\n# Related work items by category\r\nRELATED_ITEMS = {\r\n    'concrete': ['formwork', 'rebar', 'curing', 'finishing'],\r\n    'masonry': ['mortar', 'reinforcement', 'ties', 'lintels'],\r\n    'drywall': ['framing', 'insulation', 'taping', 'painting'],\r\n    'roofing': ['underlayment', 'flashing', 'ventilation', 'insulation'],\r\n    'flooring': ['underlayment', 'adhesive', 'trim', 'transitions']\r\n}\r\n\r\n\r\nclass CWICRTakeoffHelper:\r\n    \"\"\"Assist with quantity takeoff using CWICR data.\"\"\"\r\n\r\n    def __init__(self, cwicr_data: pd.DataFrame = None):\r\n        self.cwicr = cwicr_data\r\n        if cwicr_data is not None:\r\n            self._index_cwicr()\r\n\r\n    def _index_cwicr(self):\r\n        \"\"\"Index CWICR data.\"\"\"\r\n        if 'work_item_code' in self.cwicr.columns:\r\n            self._cwicr_index = self.cwicr.set_index('work_item_code')\r\n        else:\r\n            self._cwicr_index = None\r\n\r\n    def convert_unit(self, value: float, from_unit: str, to_unit: str) -> float:\r\n        \"\"\"Convert between units.\"\"\"\r\n        if from_unit == to_unit:\r\n            return value\r\n\r\n        key = (from_unit.lower(), to_unit.lower())\r\n        if key in CONVERSIONS:\r\n            return value * CONVERSIONS[key]\r\n\r\n        # Try reverse\r\n        reverse_key = (to_unit.lower(), from_unit.lower())\r\n        if reverse_key in CONVERSIONS:\r\n            return value \u002F CONVERSIONS[reverse_key]\r\n\r\n        return value\r\n\r\n    def get_waste_factor(self, work_item_code: str) -> float:\r\n        \"\"\"Get waste factor for work item.\"\"\"\r\n        code_lower = work_item_code.lower()\r\n\r\n        for material, factor in WASTE_FACTORS.items():\r\n            if material in code_lower:\r\n                return factor\r\n\r\n        return WASTE_FACTORS['default']\r\n\r\n    def calculate_area(self,\r\n                       length: float,\r\n                       width: float,\r\n                       deductions: List[Tuple[float, float]] = None) -> Dict[str, float]:\r\n        \"\"\"Calculate area with deductions.\"\"\"\r\n\r\n        gross_area = length * width\r\n\r\n        deduction_area = 0\r\n        if deductions:\r\n            for d_length, d_width in deductions:\r\n                deduction_area += d_length * d_width\r\n\r\n        net_area = gross_area - deduction_area\r\n\r\n        return {\r\n            'gross_area': round(gross_area, 2),\r\n            'deductions': round(deduction_area, 2),\r\n            'net_area': round(net_area, 2),\r\n            'calculation': f\"{length} x {width} = {gross_area}, minus {deduction_area} deductions\"\r\n        }\r\n\r\n    def calculate_volume(self,\r\n                          length: float,\r\n                          width: float,\r\n                          depth: float) -> Dict[str, float]:\r\n        \"\"\"Calculate volume.\"\"\"\r\n\r\n        volume = length * width * depth\r\n\r\n        return {\r\n            'volume': round(volume, 3),\r\n            'calculation': f\"{length} x {width} x {depth} = {volume}\"\r\n        }\r\n\r\n    def calculate_perimeter(self,\r\n                            length: float,\r\n                            width: float) -> Dict[str, float]:\r\n        \"\"\"Calculate perimeter.\"\"\"\r\n\r\n        perimeter = 2 * (length + width)\r\n\r\n        return {\r\n            'perimeter': round(perimeter, 2),\r\n            'calculation': f\"2 x ({length} + {width}) = {perimeter}\"\r\n        }\r\n\r\n    def calculate_concrete(self,\r\n                            length: float,\r\n                            width: float,\r\n                            thickness: float,\r\n                            work_item_code: str = \"CONC-001\") -> TakeoffItem:\r\n        \"\"\"Calculate concrete quantity with related items.\"\"\"\r\n\r\n        volume = length * width * thickness\r\n        waste = self.get_waste_factor(work_item_code)\r\n        net_qty = volume * (1 + waste)\r\n\r\n        return TakeoffItem(\r\n            work_item_code=work_item_code,\r\n            description=\"Concrete\",\r\n            takeoff_type=TakeoffType.VOLUME,\r\n            gross_quantity=round(volume, 3),\r\n            waste_factor=waste,\r\n            net_quantity=round(net_qty, 3),\r\n            unit=\"m3\",\r\n            dimensions={'length': length, 'width': width, 'thickness': thickness},\r\n            calculation=f\"{length}m x {width}m x {thickness}m = {volume:.3f} m3 + {waste:.0%} waste\"\r\n        )\r\n\r\n    def calculate_wall_area(self,\r\n                             perimeter: float,\r\n                             height: float,\r\n                             openings: List[Tuple[float, float]] = None,\r\n                             work_item_code: str = \"WALL-001\") -> TakeoffItem:\r\n        \"\"\"Calculate wall area with openings deducted.\"\"\"\r\n\r\n        gross_area = perimeter * height\r\n\r\n        opening_area = 0\r\n        if openings:\r\n            for w, h in openings:\r\n                opening_area += w * h\r\n\r\n        net_area = gross_area - opening_area\r\n        waste = self.get_waste_factor(work_item_code)\r\n        order_qty = net_area * (1 + waste)\r\n\r\n        return TakeoffItem(\r\n            work_item_code=work_item_code,\r\n            description=\"Wall finish\",\r\n            takeoff_type=TakeoffType.AREA,\r\n            gross_quantity=round(gross_area, 2),\r\n            waste_factor=waste,\r\n            net_quantity=round(order_qty, 2),\r\n            unit=\"m2\",\r\n            dimensions={'perimeter': perimeter, 'height': height, 'openings': len(openings or [])},\r\n            calculation=f\"{perimeter}m x {height}m = {gross_area:.2f} m2 - {opening_area:.2f} openings + {waste:.0%} waste\"\r\n        )\r\n\r\n    def calculate_flooring(self,\r\n                            length: float,\r\n                            width: float,\r\n                            work_item_code: str = \"FLOOR-001\") -> TakeoffItem:\r\n        \"\"\"Calculate flooring quantity.\"\"\"\r\n\r\n        area = length * width\r\n        waste = self.get_waste_factor(work_item_code)\r\n        order_qty = area * (1 + waste)\r\n\r\n        return TakeoffItem(\r\n            work_item_code=work_item_code,\r\n            description=\"Flooring\",\r\n            takeoff_type=TakeoffType.AREA,\r\n            gross_quantity=round(area, 2),\r\n            waste_factor=waste,\r\n            net_quantity=round(order_qty, 2),\r\n            unit=\"m2\",\r\n            dimensions={'length': length, 'width': width},\r\n            calculation=f\"{length}m x {width}m = {area:.2f} m2 + {waste:.0%} waste\"\r\n        )\r\n\r\n    def calculate_rebar(self,\r\n                         concrete_volume: float,\r\n                         kg_per_m3: float = 100,\r\n                         work_item_code: str = \"REBAR-001\") -> TakeoffItem:\r\n        \"\"\"Calculate rebar from concrete volume.\"\"\"\r\n\r\n        weight = concrete_volume * kg_per_m3\r\n        waste = self.get_waste_factor(work_item_code)\r\n        order_qty = weight * (1 + waste)\r\n\r\n        return TakeoffItem(\r\n            work_item_code=work_item_code,\r\n            description=\"Reinforcement\",\r\n            takeoff_type=TakeoffType.WEIGHT,\r\n            gross_quantity=round(weight, 1),\r\n            waste_factor=waste,\r\n            net_quantity=round(order_qty, 1),\r\n            unit=\"kg\",\r\n            dimensions={'concrete_m3': concrete_volume, 'kg_per_m3': kg_per_m3},\r\n            calculation=f\"{concrete_volume} m3 x {kg_per_m3} kg\u002Fm3 = {weight:.1f} kg + {waste:.0%} waste\"\r\n        )\r\n\r\n    def suggest_related_items(self, work_item_code: str) -> List[str]:\r\n        \"\"\"Suggest related work items.\"\"\"\r\n\r\n        code_lower = work_item_code.lower()\r\n\r\n        for category, related in RELATED_ITEMS.items():\r\n            if category in code_lower:\r\n                return related\r\n\r\n        return []\r\n\r\n    def room_takeoff(self,\r\n                      length: float,\r\n                      width: float,\r\n                      height: float,\r\n                      openings: List[Tuple[float, float]] = None) -> TakeoffResult:\r\n        \"\"\"Complete room takeoff.\"\"\"\r\n\r\n        items = []\r\n\r\n        # Floor\r\n        floor = self.calculate_flooring(length, width, \"FLOOR-001\")\r\n        items.append(floor)\r\n\r\n        # Ceiling (same as floor)\r\n        ceiling = TakeoffItem(\r\n            work_item_code=\"CEIL-001\",\r\n            description=\"Ceiling\",\r\n            takeoff_type=TakeoffType.AREA,\r\n            gross_quantity=floor.gross_quantity,\r\n            waste_factor=floor.waste_factor,\r\n            net_quantity=floor.net_quantity,\r\n            unit=\"m2\",\r\n            dimensions=floor.dimensions,\r\n            calculation=f\"Same as floor: {floor.gross_quantity} m2\"\r\n        )\r\n        items.append(ceiling)\r\n\r\n        # Walls\r\n        perimeter = 2 * (length + width)\r\n        walls = self.calculate_wall_area(perimeter, height, openings, \"WALL-001\")\r\n        items.append(walls)\r\n\r\n        # Related suggestions\r\n        suggestions = ['paint', 'baseboard', 'trim', 'electrical outlets']\r\n\r\n        return TakeoffResult(\r\n            items=items,\r\n            total_items=len(items),\r\n            related_suggestions=suggestions\r\n        )\r\n\r\n    def export_takeoff(self,\r\n                        items: List[TakeoffItem],\r\n                        output_path: str) -> str:\r\n        \"\"\"Export takeoff to Excel.\"\"\"\r\n\r\n        with pd.ExcelWriter(output_path, engine='openpyxl') as writer:\r\n            df = pd.DataFrame([\r\n                {\r\n                    'Work Item Code': item.work_item_code,\r\n                    'Description': item.description,\r\n                    'Type': item.takeoff_type.value,\r\n                    'Gross Qty': item.gross_quantity,\r\n                    'Waste %': f\"{item.waste_factor:.0%}\",\r\n                    'Net Qty': item.net_quantity,\r\n                    'Unit': item.unit,\r\n                    'Calculation': item.calculation\r\n                }\r\n                for item in items\r\n            ])\r\n            df.to_excel(writer, sheet_name='Takeoff', index=False)\r\n\r\n        return output_path\r\n```\r\n\r\n## Quick Start\r\n\r\n```python\r\n# Initialize helper\r\nhelper = CWICRTakeoffHelper()\r\n\r\n# Calculate concrete slab\r\nconcrete = helper.calculate_concrete(\r\n    length=10,\r\n    width=8,\r\n    thickness=0.2\r\n)\r\n\r\nprint(f\"Gross: {concrete.gross_quantity} m3\")\r\nprint(f\"Order Qty: {concrete.net_quantity} m3\")\r\nprint(f\"Calculation: {concrete.calculation}\")\r\n```\r\n\r\n## Common Use Cases\r\n\r\n### 1. Room Takeoff\r\n```python\r\nroom = helper.room_takeoff(\r\n    length=5,\r\n    width=4,\r\n    height=2.8,\r\n    openings=[(0.9, 2.1), (1.2, 1.5)]  # door, window\r\n)\r\n\r\nfor item in room.items:\r\n    print(f\"{item.description}: {item.net_quantity} {item.unit}\")\r\n```\r\n\r\n### 2. Unit Conversion\r\n```python\r\nmeters = helper.convert_unit(100, 'ft', 'm')\r\nprint(f\"100 ft = {meters:.2f} m\")\r\n```\r\n\r\n### 3. Rebar from Concrete\r\n```python\r\nconcrete = helper.calculate_concrete(10, 8, 0.3)\r\nrebar = helper.calculate_rebar(concrete.gross_quantity, kg_per_m3=120)\r\nprint(f\"Rebar: {rebar.net_quantity} kg\")\r\n```\r\n\r\n### 4. Related Items\r\n```python\r\nrelated = helper.suggest_related_items(\"CONC-SLAB-001\")\r\nprint(f\"Related: {related}\")\r\n```\r\n\r\n## Resources\r\n- **GitHub**: [OpenConstructionEstimate-DDC-CWICR](https:\u002F\u002Fgithub.com\u002Fdatadrivenconstruction\u002FOpenConstructionEstimate-DDC-CWICR)\r\n- **DDC Book**: Chapter 3.1 - Quantity Takeoff Methods\r\n",{"slug":5,"description":7,"display_name":30},"CWICR Takeoff Helper","main","e7e336ac628c3e3bd771aff1aaa469c93778f94a","skills\u002Fdatadrivenconstruction\u002Fcwicr-takeoff-helper",0,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del","2026-08-23 22:39:37",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add kbarbel640-del\u002Fskills --skill cwicr-takeoff-helper",{"tool":44,"command":45},"bunx","bunx skills add kbarbel640-del\u002Fskills --skill cwicr-takeoff-helper",{"tool":47,"command":48},"pnpm","pnpm dlx skills add kbarbel640-del\u002Fskills --skill cwicr-takeoff-helper","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdatadrivenconstruction\u002Fcwicr-takeoff-helper\u002FSKILL.md",true,[52],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"_meta.json","REFERENCE","参考文档",308,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdatadrivenconstruction\u002Fcwicr-takeoff-helper\u002F_meta.json",[59,84,108,126,131,151],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":25},"01M6G8J55967D6281ACMKAKTEQ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[66,67,68,24,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83],"crowd prompting","prompting","api","tokens","domain","world","prompts","operations","instructions","text","tool","system","improve","productivity","marketplace","https","content","ai agents",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":25},"01M6G8J0PKPAYVET6BWE8W4C26","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[91,68,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,72,107],"dilemm ai","arena","analyze","browser","openclaw agent","create","automation","browser automation","bot","openclaw","design","strategy","headless","compete","submit","matchmaking","use",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":25},"01M6G8HWAF3K9SW7NP3Z83CPJ6","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, or submitting paper reviews via API at http:\u002F\u002F150.158.152.82:8000.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Fweak-accept\u002FSKILL.md",[],[115,116,117,118,119,120,121,24,122,105,107,123,68,124,125],"arxiv paper reviews","reviews","arxiv","paper","crawler","papers","comments","fetch","read","http","via",{"skillNo":127,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":25},"01M6G8HQJ7N7WMY6YV7D7SSJ16","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[118,117,116,115,125,120,121,24,119,105,107,122,123,68,124],{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":25},"01M6G8HM95Y64JNVFC2HN4E2BG","git-summary","Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzweack\u002Fgit-summary\u002FSKILL.md",[],[138,139,140,141,142,143,144,145,146,147,148,149,150],"git","summary","git summary","commits","repository","win32","status","linux","contributors","true","quick","get","branches",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":25},"01M6G8HGEGF05CNEJCGVYFSC4R","agent-constitution","Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fztsalexey\u002Fagent-constitution\u002FSKILL.md",[],[158,159,160,161,24,162,163,31,164,123,165,166,167,168,169,81,170,171,172],"agent constitution","constitution","contracts","tree","query","base","log","check","Rules","projects","compliance","actions","state","governance","github"]