{"id":"2599b46d-eece-4d98-9028-3de521566ffc","entityType":"agent","slug":"clawhub-datadrivenconstruction-cost-estimation-resource","name":"Cost Estimation Resource","canonicalUrl":"https://www.xpersona.co/agent/clawhub-datadrivenconstruction-cost-estimation-resource","canonicalPath":"/agent/clawhub-datadrivenconstruction-cost-estimation-resource","generatedAt":"2026-10-11T20:56:42.753Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T16:44:03.022Z","emptyReason":null},"description":"Calculate construction costs using resource-based method. Estimate project costs from work items, physical resource norms, and current prices.","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s1774mv3t1cm8r1kgs9hccdnmn8852nb:cost-estimation-resource","sourceUrl":"https://clawhub.ai/datadrivenconstruction/cost-estimation-resource","homepage":"https://clawhub.ai/datadrivenconstruction/skills/cost-estimation-resource","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/datadrivenconstruction/cost-estimation-resource","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/datadrivenconstruction/skills/cost-estimation-resource","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Cost Estimation Resource technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T16:44:03.022Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T16:44:03.022Z","emptyReason":null},"stars":null,"forks":null,"downloads":1026,"packageName":null,"latestVersion":"2.1.0","tractionLabel":"1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T16:44:02.954Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T16:44:03.022Z","lastCrawledAt":"2026-10-11T16:44:02.954Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T16:44:02.954Z","lastVerifiedAt":null,"highlights":[{"version":"2.1.0","createdAt":"2026-02-13T20:57:48.147Z","changelog":"- Added homepage and metadata fields to SKILL.md for enhanced integration and discoverability. - Included Openclaw-specific metadata (emoji, supported OS, required binaries). - No changes to the skill logic or API.","fileCount":4,"zipByteSize":5151},{"version":"2.0.0","createdAt":"2026-02-13T15:12:12.802Z","changelog":"Major update: Introduces a new resource-based construction cost estimation system with extended transparency and flexibility. - Implements separation of resource consumption norms from resource prices for accurate and adjustable cost estimation. - Adds definitions for resources, resource norms, and work items, supporting all major construction cost components. - Supports input and management via pandas DataFrames for integration with existing data. - Calculates detailed cost breakdowns (labor, material, equipment, subcontractor) and generates project summaries. - Includes customizable overhead and profit rates in total cost estimation. - Enables selective resource price adjustments by type for rapid scenario analysis.","fileCount":4,"zipByteSize":5044},{"version":"1.0.0","createdAt":"2026-02-07T14:45:45.060Z","changelog":"- Initial release of the Cost Estimation Resource skill. - Supports transparent, resource-based construction cost estimation. - Calculates costs from work items, physical resource norms, and current unit prices. - Separates costing into labor, material, equipment, and subcontractor components. - Allows for customizable overhead and profit rates in total cost calculation.","fileCount":2,"zipByteSize":3685}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1774mv3t1cm8r1kgs9hccdnmn8852nb:cost-estimation-resource","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s1774mv3t1cm8r1kgs9hccdnmn8852nb:cost-estimation-resource` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/datadrivenconstruction/cost-estimation-resource before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-datadrivenconstruction-cost-estimation-resource/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-datadrivenconstruction-cost-estimation-resource/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-datadrivenconstruction-cost-estimation-resource/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-datadrivenconstruction-cost-estimation-resource/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-datadrivenconstruction-cost-estimation-resource/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-datadrivenconstruction-cost-estimation-resource/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T20:56:42.753Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-datadrivenconstruction-cost-estimation-resource/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-datadrivenconstruction-cost-estimation-resource/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-datadrivenconstruction-cost-estimation-resource/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-datadrivenconstruction-cost-estimation-resource/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T16:44:03.022Z","emptyReason":null},"readme":"Skill: Cost Estimation Resource\n\nOwner: datadrivenconstruction\n\nSummary: Calculate construction costs using resource-based method. Estimate project costs from work items, physical resource norms, and current prices.\n\nTags: latest:2.1.0\n\nVersion history:\n\nv2.1.0 | 2026-02-13T20:57:48.147Z | auto\n\n- Added homepage and metadata fields to SKILL.md for enhanced integration and discoverability.\n- Included Openclaw-specific metadata (emoji, supported OS, required binaries).\n- No changes to the skill logic or API.\n\nv2.0.0 | 2026-02-13T15:12:12.802Z | auto\n\nMajor update: Introduces a new resource-based construction cost estimation system with extended transparency and flexibility.\n\n- Implements separation of resource consumption norms from resource prices for accurate and adjustable cost estimation.\n- Adds definitions for resources, resource norms, and work items, supporting all major construction cost components.\n- Supports input and management via pandas DataFrames for integration with existing data.\n- Calculates detailed cost breakdowns (labor, material, equipment, subcontractor) and generates project summaries.\n- Includes customizable overhead and profit rates in total cost estimation.\n- Enables selective resource price adjustments by type for rapid scenario analysis.\n\nv1.0.0 | 2026-02-07T14:45:45.060Z | auto\n\n- Initial release of the Cost Estimation Resource skill.\n- Supports transparent, resource-based construction cost estimation.\n- Calculates costs from work items, physical resource norms, and current unit prices.\n- Separates costing into labor, material, equipment, and subcontractor components.\n- Allows for customizable overhead and profit rates in total cost calculation.\n\nArchive index:\n\nArchive v2.1.0: 4 files, 5151 bytes\n\nFiles: claw.json (504b), instructions.md (1786b), SKILL.md (12631b), _meta.json (143b)\n\nFile v2.1.0:SKILL.md\n\n---\r\nname: \"cost-estimation-resource\"\r\ndescription: \"Calculate construction costs using resource-based method. Estimate project costs from work items, physical resource norms, and current prices.\"\r\nhomepage: \"https://datadrivenconstruction.io\"\r\nmetadata: {\"openclaw\":{\"emoji\":\"🧮\",\"os\":[\"darwin\",\"linux\",\"win32\"],\"homepage\":\"https://datadrivenconstruction.io\",\"requires\":{\"bins\":[\"python3\"]}}}\r\n---\r\n\r\n# Cost Estimation - Resource Method\r\n\r\n## Business Case\r\n\r\n### Problem Statement\r\nTraditional costing challenges:\r\n- Fixed unit prices become outdated\r\n- No visibility into cost components\r\n- Difficult to adjust for conditions\r\n- Limited cost analysis capability\r\n\r\n### Solution\r\nResource-based costing separates physical resource consumption (norms) from prices, enabling accurate, adjustable, and transparent cost estimation.\r\n\r\n## Technical Implementation\r\n\r\n```python\r\nimport pandas as pd\r\nfrom typing import Dict, Any, List, Optional\r\nfrom dataclasses import dataclass, field\r\nfrom enum import Enum\r\n\r\n\r\nclass ResourceType(Enum):\r\n    LABOR = \"labor\"\r\n    MATERIAL = \"material\"\r\n    EQUIPMENT = \"equipment\"\r\n    SUBCONTRACTOR = \"subcontractor\"\r\n\r\n\r\n@dataclass\r\nclass Resource:\r\n    code: str\r\n    name: str\r\n    resource_type: ResourceType\r\n    unit: str\r\n    unit_price: float\r\n    currency: str = \"USD\"\r\n\r\n\r\n@dataclass\r\nclass ResourceNorm:\r\n    resource_code: str\r\n    consumption: float  # Units per work item unit\r\n    waste_factor: float = 1.0  # 1.1 = 10% waste\r\n\r\n\r\n@dataclass\r\nclass WorkItem:\r\n    code: str\r\n    name: str\r\n    unit: str\r\n    resources: List[ResourceNorm] = field(default_factory=list)\r\n\r\n\r\n@dataclass\r\nclass CostLineItem:\r\n    work_item_code: str\r\n    work_item_name: str\r\n    quantity: float\r\n    unit: str\r\n    labor_cost: float\r\n    material_cost: float\r\n    equipment_cost: float\r\n    subcontractor_cost: float\r\n    total_cost: float\r\n\r\n\r\nclass ResourceBasedEstimator:\r\n    \"\"\"Calculate costs using resource-based method.\"\"\"\r\n\r\n    def __init__(self):\r\n        self.resources: Dict[str, Resource] = {}\r\n        self.work_items: Dict[str, WorkItem] = {}\r\n        self.overhead_rate: float = 0.15\r\n        self.profit_rate: float = 0.10\r\n\r\n    def add_resource(self, resource: Resource):\r\n        \"\"\"Add resource to database.\"\"\"\r\n        self.resources[resource.code] = resource\r\n\r\n    def add_work_item(self, work_item: WorkItem):\r\n        \"\"\"Add work item with resource norms.\"\"\"\r\n        self.work_items[work_item.code] = work_item\r\n\r\n    def load_resources_from_df(self, df: pd.DataFrame):\r\n        \"\"\"Load resources from DataFrame.\"\"\"\r\n\r\n        for _, row in df.iterrows():\r\n            resource = Resource(\r\n                code=row['code'],\r\n                name=row['name'],\r\n                resource_type=ResourceType(row['type'].lower()),\r\n                unit=row['unit'],\r\n                unit_price=float(row['unit_price']),\r\n                currency=row.get('currency', 'USD')\r\n            )\r\n            self.add_resource(resource)\r\n\r\n    def load_work_items_from_df(self, items_df: pd.DataFrame, norms_df: pd.DataFrame):\r\n        \"\"\"Load work items and norms from DataFrames.\"\"\"\r\n\r\n        # Group norms by work item\r\n        norms_grouped = norms_df.groupby('work_item_code')\r\n\r\n        for _, row in items_df.iterrows():\r\n            code = row['code']\r\n            resources = []\r\n\r\n            if code in norms_grouped.groups:\r\n                item_norms = norms_grouped.get_group(code)\r\n                for _, norm_row in item_norms.iterrows():\r\n                    resources.append(ResourceNorm(\r\n                        resource_code=norm_row['resource_code'],\r\n                        consumption=float(norm_row['consumption']),\r\n                        waste_factor=float(norm_row.get('waste_factor', 1.0))\r\n                    ))\r\n\r\n            work_item = WorkItem(\r\n                code=code,\r\n                name=row['name'],\r\n                unit=row['unit'],\r\n                resources=resources\r\n            )\r\n            self.add_work_item(work_item)\r\n\r\n    def calculate_work_item_cost(self, work_item_code: str, quantity: float) -> CostLineItem:\r\n        \"\"\"Calculate cost for a work item quantity.\"\"\"\r\n\r\n        if work_item_code not in self.work_items:\r\n            raise ValueError(f\"Work item {work_item_code} not found\")\r\n\r\n        work_item = self.work_items[work_item_code]\r\n\r\n        labor_cost = 0.0\r\n        material_cost = 0.0\r\n        equipment_cost = 0.0\r\n        subcontractor_cost = 0.0\r\n\r\n        for norm in work_item.resources:\r\n            if norm.resource_code not in self.resources:\r\n                continue\r\n\r\n            resource = self.resources[norm.resource_code]\r\n            resource_qty = quantity * norm.consumption * norm.waste_factor\r\n            resource_cost = resource_qty * resource.unit_price\r\n\r\n            if resource.resource_type == ResourceType.LABOR:\r\n                labor_cost += resource_cost\r\n            elif resource.resource_type == ResourceType.MATERIAL:\r\n                material_cost += resource_cost\r\n            elif resource.resource_type == ResourceType.EQUIPMENT:\r\n                equipment_cost += resource_cost\r\n            elif resource.resource_type == ResourceType.SUBCONTRACTOR:\r\n                subcontractor_cost += resource_cost\r\n\r\n        total = labor_cost + material_cost + equipment_cost + subcontractor_cost\r\n\r\n        return CostLineItem(\r\n            work_item_code=work_item_code,\r\n            work_item_name=work_item.name,\r\n            quantity=quantity,\r\n            unit=work_item.unit,\r\n            labor_cost=round(labor_cost, 2),\r\n            material_cost=round(material_cost, 2),\r\n            equipment_cost=round(equipment_cost, 2),\r\n            subcontractor_cost=round(subcontractor_cost, 2),\r\n            total_cost=round(total, 2)\r\n        )\r\n\r\n    def calculate_estimate(self, items: List[Dict[str, Any]]) -> Dict[str, Any]:\r\n        \"\"\"Calculate full estimate from list of items.\"\"\"\r\n\r\n        line_items = []\r\n        totals = {\r\n            'labor': 0.0,\r\n            'material': 0.0,\r\n            'equipment': 0.0,\r\n            'subcontractor': 0.0,\r\n            'direct': 0.0\r\n        }\r\n\r\n        for item in items:\r\n            code = item['work_item_code']\r\n            qty = float(item['quantity'])\r\n\r\n            line = self.calculate_work_item_cost(code, qty)\r\n            line_items.append(line)\r\n\r\n            totals['labor'] += line.labor_cost\r\n            totals['material'] += line.material_cost\r\n            totals['equipment'] += line.equipment_cost\r\n            totals['subcontractor'] += line.subcontractor_cost\r\n            totals['direct'] += line.total_cost\r\n\r\n        # Calculate overhead and profit\r\n        overhead = totals['direct'] * self.overhead_rate\r\n        subtotal = totals['direct'] + overhead\r\n        profit = subtotal * self.profit_rate\r\n        grand_total = subtotal + profit\r\n\r\n        return {\r\n            'line_items': line_items,\r\n            'totals': {\r\n                'labor': round(totals['labor'], 2),\r\n                'material': round(totals['material'], 2),\r\n                'equipment': round(totals['equipment'], 2),\r\n                'subcontractor': round(totals['subcontractor'], 2),\r\n                'direct_cost': round(totals['direct'], 2),\r\n                'overhead': round(overhead, 2),\r\n                'overhead_rate': self.overhead_rate,\r\n                'subtotal': round(subtotal, 2),\r\n                'profit': round(profit, 2),\r\n                'profit_rate': self.profit_rate,\r\n                'grand_total': round(grand_total, 2)\r\n            },\r\n            'summary': {\r\n                'item_count': len(line_items),\r\n                'labor_pct': round(totals['labor'] / totals['direct'] * 100, 1) if totals['direct'] > 0 else 0,\r\n                'material_pct': round(totals['material'] / totals['direct'] * 100, 1) if totals['direct'] > 0 else 0,\r\n                'equipment_pct': round(totals['equipment'] / totals['direct'] * 100, 1) if totals['direct'] > 0 else 0\r\n            }\r\n        }\r\n\r\n    def adjust_prices(self, factor: float, resource_type: ResourceType = None):\r\n        \"\"\"Adjust resource prices by factor.\"\"\"\r\n\r\n        for code, resource in self.resources.items():\r\n            if resource_type is None or resource.resource_type == resource_type:\r\n                resource.unit_price *= factor\r\n\r\n    def apply_regional_factor(self, factor: float):\r\n        \"\"\"Apply regional cost factor to all resources.\"\"\"\r\n        self.adjust_prices(factor)\r\n\r\n    def get_resource_breakdown(self, work_item_code: str, quantity: float) -> pd.DataFrame:\r\n        \"\"\"Get detailed resource breakdown for work item.\"\"\"\r\n\r\n        if work_item_code not in self.work_items:\r\n            return pd.DataFrame()\r\n\r\n        work_item = self.work_items[work_item_code]\r\n        data = []\r\n\r\n        for norm in work_item.resources:\r\n            if norm.resource_code not in self.resources:\r\n                continue\r\n\r\n            resource = self.resources[norm.resource_code]\r\n            resource_qty = quantity * norm.consumption * norm.waste_factor\r\n            resource_cost = resource_qty * resource.unit_price\r\n\r\n            data.append({\r\n                'Resource Code': resource.code,\r\n                'Resource Name': resource.name,\r\n                'Type': resource.resource_type.value,\r\n                'Unit': resource.unit,\r\n                'Consumption': norm.consumption,\r\n                'Waste Factor': norm.waste_factor,\r\n                'Total Qty': round(resource_qty, 3),\r\n                'Unit Price': resource.unit_price,\r\n                'Total Cost': round(resource_cost, 2)\r\n            })\r\n\r\n        return pd.DataFrame(data)\r\n\r\n    def export_to_excel(self, estimate: Dict[str, Any], output_path: str) -> str:\r\n        \"\"\"Export estimate to Excel.\"\"\"\r\n\r\n        with pd.ExcelWriter(output_path, engine='openpyxl') as writer:\r\n            # Summary\r\n            summary_df = pd.DataFrame([estimate['totals']])\r\n            summary_df.to_excel(writer, sheet_name='Summary', index=False)\r\n\r\n            # Line items\r\n            items_data = [{\r\n                'Code': item.work_item_code,\r\n                'Description': item.work_item_name,\r\n                'Quantity': item.quantity,\r\n                'Unit': item.unit,\r\n                'Labor': item.labor_cost,\r\n                'Material': item.material_cost,\r\n                'Equipment': item.equipment_cost,\r\n                'Subcontractor': item.subcontractor_cost,\r\n                'Total': item.total_cost\r\n            } for item in estimate['line_items']]\r\n            items_df = pd.DataFrame(items_data)\r\n            items_df.to_excel(writer, sheet_name='Line Items', 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 estimator\r\nestimator = ResourceBasedEstimator()\r\n\r\n# Add resources\r\nestimator.add_resource(Resource(\"L001\", \"Carpenter\", ResourceType.LABOR, \"MH\", 55.00))\r\nestimator.add_resource(Resource(\"L002\", \"Laborer\", ResourceType.LABOR, \"MH\", 35.00))\r\nestimator.add_resource(Resource(\"M001\", \"Concrete C30\", ResourceType.MATERIAL, \"CY\", 150.00))\r\nestimator.add_resource(Resource(\"M002\", \"Rebar #4\", ResourceType.MATERIAL, \"TON\", 1200.00))\r\nestimator.add_resource(Resource(\"E001\", \"Concrete Pump\", ResourceType.EQUIPMENT, \"HR\", 250.00))\r\n\r\n# Add work item with resource norms\r\nestimator.add_work_item(WorkItem(\r\n    code=\"03.01.01\",\r\n    name=\"Cast-in-place Concrete Foundation\",\r\n    unit=\"CY\",\r\n    resources=[\r\n        ResourceNorm(\"L001\", 1.5),      # 1.5 carpenter hours per CY\r\n        ResourceNorm(\"L002\", 2.0),      # 2.0 laborer hours per CY\r\n        ResourceNorm(\"M001\", 1.0, 1.05),# 1.0 CY concrete with 5% waste\r\n        ResourceNorm(\"M002\", 0.08),     # 0.08 ton rebar per CY\r\n        ResourceNorm(\"E001\", 0.25)      # 0.25 pump hours per CY\r\n    ]\r\n))\r\n\r\n# Calculate estimate\r\nestimate = estimator.calculate_estimate([\r\n    {\"work_item_code\": \"03.01.01\", \"quantity\": 100}\r\n])\r\n\r\nprint(f\"Direct Cost: ${estimate['totals']['direct_cost']:,.2f}\")\r\nprint(f\"Grand Total: ${estimate['totals']['grand_total']:,.2f}\")\r\n```\r\n\r\n## Common Use Cases\r\n\r\n### 1. Resource Breakdown\r\n```python\r\nbreakdown = estimator.get_resource_breakdown(\"03.01.01\", quantity=100)\r\nprint(breakdown)\r\n```\r\n\r\n### 2. Regional Adjustment\r\n```python\r\n# Apply 15% regional factor\r\nestimator.apply_regional_factor(1.15)\r\n```\r\n\r\n### 3. Labor Only Adjustment\r\n```python\r\n# Increase labor costs by 10%\r\nestimator.adjust_prices(1.10, ResourceType.LABOR)\r\n```\r\n\r\n## Resources\r\n- **DDC Book**: Chapter 3.1 - Resource-Based Costing\r\n- **Website**: https://datadrivenconstruction.io\n\nFile v2.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn75fhjxn1jz5xbgd9ggj0nrtd80q1dz\",\n  \"slug\": \"cost-estimation-resource\",\n  \"version\": \"2.1.0\",\n  \"publishedAt\": 1771016268147\n}\n\nFile v2.1.0:instructions.md\n\nYou are a construction cost estimation assistant specializing in resource-based costing. You separate physical resource consumption (norms) from prices, enabling accurate, adjustable, and transparent cost estimation.\n\nWhen the user asks to estimate costs using resources:\n1. Gather work item descriptions and quantities\n2. Define resources: labor (man-hours), materials (units), equipment (hours)\n3. Apply consumption norms (how much of each resource per unit of work)\n4. Include waste factors where applicable (e.g., 5% concrete waste)\n5. Calculate costs: quantity x consumption norm x waste factor x unit price\n6. Apply overhead and profit markups\n7. Present detailed breakdown by resource type\n\nWhen the user asks to adjust or compare estimates:\n1. Apply regional cost factors to all or specific resource types\n2. Adjust labor, material, or equipment prices independently\n3. Show before/after comparison\n\n## Input Format\n- Work items with quantities and units\n- Resource database: code, name, type (labor/material/equipment), unit, unit price\n- Resource norms: consumption per work item unit, waste factor\n\n## Output Format\n- Cost breakdown: labor, material, equipment, subcontractor\n- Percentage split by category\n- Overhead, profit, and grand total\n- Detailed resource breakdown per work item on request\n\n## Key Classes (from SKILL.md)\n- `ResourceBasedEstimator`: Main estimator engine\n- `Resource`: Individual resource (labor, material, equipment)\n- `ResourceNorm`: Consumption rate per work item unit\n- `WorkItem`: Work activity with associated resource norms\n\n## Constraints\n- Default overhead: 15%, profit: 10%\n- Always show resource type breakdown (labor vs material vs equipment %)\n- Waste factors default to 1.0 (no waste) unless specified\n- Round costs to 2 decimal places\n\nFile v2.1.0:claw.json\n\n{\n  \"name\": \"cost-estimation-resource\",\n  \"version\": \"2.0.0\",\n  \"description\": \"Calculate construction costs using resource-based method. Estimate project costs from work items, physical resource norms, and current prices.\",\n  \"author\": \"datadrivenconstruction\",\n  \"license\": \"MIT\",\n  \"permissions\": [\"filesystem\"],\n  \"entry\": \"instructions.md\",\n  \"tags\": [\"construction\", \"estimation\", \"resource-method\", \"cost-management\", \"norms\"],\n  \"models\": [\"claude-*\", \"gpt-*\"],\n  \"minOpenClawVersion\": \"0.8.0\"\n}\n\nArchive v2.0.0: 4 files, 5044 bytes\n\nFiles: claw.json (504b), instructions.md (1786b), SKILL.md (12432b), _meta.json (143b)\n\nFile v2.0.0:SKILL.md\n\n---\r\nname: \"cost-estimation-resource\"\r\ndescription: \"Calculate construction costs using resource-based method. Estimate project costs from work items, physical resource norms, and current prices.\"\r\n---\r\n\r\n# Cost Estimation - Resource Method\r\n\r\n## Business Case\r\n\r\n### Problem Statement\r\nTraditional costing challenges:\r\n- Fixed unit prices become outdated\r\n- No visibility into cost components\r\n- Difficult to adjust for conditions\r\n- Limited cost analysis capability\r\n\r\n### Solution\r\nResource-based costing separates physical resource consumption (norms) from prices, enabling accurate, adjustable, and transparent cost estimation.\r\n\r\n## Technical Implementation\r\n\r\n```python\r\nimport pandas as pd\r\nfrom typing import Dict, Any, List, Optional\r\nfrom dataclasses import dataclass, field\r\nfrom enum import Enum\r\n\r\n\r\nclass ResourceType(Enum):\r\n    LABOR = \"labor\"\r\n    MATERIAL = \"material\"\r\n    EQUIPMENT = \"equipment\"\r\n    SUBCONTRACTOR = \"subcontractor\"\r\n\r\n\r\n@dataclass\r\nclass Resource:\r\n    code: str\r\n    name: str\r\n    resource_type: ResourceType\r\n    unit: str\r\n    unit_price: float\r\n    currency: str = \"USD\"\r\n\r\n\r\n@dataclass\r\nclass ResourceNorm:\r\n    resource_code: str\r\n    consumption: float  # Units per work item unit\r\n    waste_factor: float = 1.0  # 1.1 = 10% waste\r\n\r\n\r\n@dataclass\r\nclass WorkItem:\r\n    code: str\r\n    name: str\r\n    unit: str\r\n    resources: List[ResourceNorm] = field(default_factory=list)\r\n\r\n\r\n@dataclass\r\nclass CostLineItem:\r\n    work_item_code: str\r\n    work_item_name: str\r\n    quantity: float\r\n    unit: str\r\n    labor_cost: float\r\n    material_cost: float\r\n    equipment_cost: float\r\n    subcontractor_cost: float\r\n    total_cost: float\r\n\r\n\r\nclass ResourceBasedEstimator:\r\n    \"\"\"Calculate costs using resource-based method.\"\"\"\r\n\r\n    def __init__(self):\r\n        self.resources: Dict[str, Resource] = {}\r\n        self.work_items: Dict[str, WorkItem] = {}\r\n        self.overhead_rate: float = 0.15\r\n        self.profit_rate: float = 0.10\r\n\r\n    def add_resource(self, resource: Resource):\r\n        \"\"\"Add resource to database.\"\"\"\r\n        self.resources[resource.code] = resource\r\n\r\n    def add_work_item(self, work_item: WorkItem):\r\n        \"\"\"Add work item with resource norms.\"\"\"\r\n        self.work_items[work_item.code] = work_item\r\n\r\n    def load_resources_from_df(self, df: pd.DataFrame):\r\n        \"\"\"Load resources from DataFrame.\"\"\"\r\n\r\n        for _, row in df.iterrows():\r\n            resource = Resource(\r\n                code=row['code'],\r\n                name=row['name'],\r\n                resource_type=ResourceType(row['type'].lower()),\r\n                unit=row['unit'],\r\n                unit_price=float(row['unit_price']),\r\n                currency=row.get('currency', 'USD')\r\n            )\r\n            self.add_resource(resource)\r\n\r\n    def load_work_items_from_df(self, items_df: pd.DataFrame, norms_df: pd.DataFrame):\r\n        \"\"\"Load work items and norms from DataFrames.\"\"\"\r\n\r\n        # Group norms by work item\r\n        norms_grouped = norms_df.groupby('work_item_code')\r\n\r\n        for _, row in items_df.iterrows():\r\n            code = row['code']\r\n            resources = []\r\n\r\n            if code in norms_grouped.groups:\r\n                item_norms = norms_grouped.get_group(code)\r\n                for _, norm_row in item_norms.iterrows():\r\n                    resources.append(ResourceNorm(\r\n                        resource_code=norm_row['resource_code'],\r\n                        consumption=float(norm_row['consumption']),\r\n                        waste_factor=float(norm_row.get('waste_factor', 1.0))\r\n                    ))\r\n\r\n            work_item = WorkItem(\r\n                code=code,\r\n                name=row['name'],\r\n                unit=row['unit'],\r\n                resources=resources\r\n            )\r\n            self.add_work_item(work_item)\r\n\r\n    def calculate_work_item_cost(self, work_item_code: str, quantity: float) -> CostLineItem:\r\n        \"\"\"Calculate cost for a work item quantity.\"\"\"\r\n\r\n        if work_item_code not in self.work_items:\r\n            raise ValueError(f\"Work item {work_item_code} not found\")\r\n\r\n        work_item = self.work_items[work_item_code]\r\n\r\n        labor_cost = 0.0\r\n        material_cost = 0.0\r\n        equipment_cost = 0.0\r\n        subcontractor_cost = 0.0\r\n\r\n        for norm in work_item.resources:\r\n            if norm.resource_code not in self.resources:\r\n                continue\r\n\r\n            resource = self.resources[norm.resource_code]\r\n            resource_qty = quantity * norm.consumption * norm.waste_factor\r\n            resource_cost = resource_qty * resource.unit_price\r\n\r\n            if resource.resource_type == ResourceType.LABOR:\r\n                labor_cost += resource_cost\r\n            elif resource.resource_type == ResourceType.MATERIAL:\r\n                material_cost += resource_cost\r\n            elif resource.resource_type == ResourceType.EQUIPMENT:\r\n                equipment_cost += resource_cost\r\n            elif resource.resource_type == ResourceType.SUBCONTRACTOR:\r\n                subcontractor_cost += resource_cost\r\n\r\n        total = labor_cost + material_cost + equipment_cost + subcontractor_cost\r\n\r\n        return CostLineItem(\r\n            work_item_code=work_item_code,\r\n            work_item_name=work_item.name,\r\n            quantity=quantity,\r\n            unit=work_item.unit,\r\n            labor_cost=round(labor_cost, 2),\r\n            material_cost=round(material_cost, 2),\r\n            equipment_cost=round(equipment_cost, 2),\r\n            subcontractor_cost=round(subcontractor_cost, 2),\r\n            total_cost=round(total, 2)\r\n        )\r\n\r\n    def calculate_estimate(self, items: List[Dict[str, Any]]) -> Dict[str, Any]:\r\n        \"\"\"Calculate full estimate from list of items.\"\"\"\r\n\r\n        line_items = []\r\n        totals = {\r\n            'labor': 0.0,\r\n            'material': 0.0,\r\n            'equipment': 0.0,\r\n            'subcontractor': 0.0,\r\n            'direct': 0.0\r\n        }\r\n\r\n        for item in items:\r\n            code = item['work_item_code']\r\n            qty = float(item['quantity'])\r\n\r\n            line = self.calculate_work_item_cost(code, qty)\r\n            line_items.append(line)\r\n\r\n            totals['labor'] += line.labor_cost\r\n            totals['material'] += line.material_cost\r\n            totals['equipment'] += line.equipment_cost\r\n            totals['subcontractor'] += line.subcontractor_cost\r\n            totals['direct'] += line.total_cost\r\n\r\n        # Calculate overhead and profit\r\n        overhead = totals['direct'] * self.overhead_rate\r\n        subtotal = totals['direct'] + overhead\r\n        profit = subtotal * self.profit_rate\r\n        grand_total = subtotal + profit\r\n\r\n        return {\r\n            'line_items': line_items,\r\n            'totals': {\r\n                'labor': round(totals['labor'], 2),\r\n                'material': round(totals['material'], 2),\r\n                'equipment': round(totals['equipment'], 2),\r\n                'subcontractor': round(totals['subcontractor'], 2),\r\n                'direct_cost': round(totals['direct'], 2),\r\n                'overhead': round(overhead, 2),\r\n                'overhead_rate': self.overhead_rate,\r\n                'subtotal': round(subtotal, 2),\r\n                'profit': round(profit, 2),\r\n                'profit_rate': self.profit_rate,\r\n                'grand_total': round(grand_total, 2)\r\n            },\r\n            'summary': {\r\n                'item_count': len(line_items),\r\n                'labor_pct': round(totals['labor'] / totals['direct'] * 100, 1) if totals['direct'] > 0 else 0,\r\n                'material_pct': round(totals['material'] / totals['direct'] * 100, 1) if totals['direct'] > 0 else 0,\r\n                'equipment_pct': round(totals['equipment'] / totals['direct'] * 100, 1) if totals['direct'] > 0 else 0\r\n            }\r\n        }\r\n\r\n    def adjust_prices(self, factor: float, resource_type: ResourceType = None):\r\n        \"\"\"Adjust resource prices by factor.\"\"\"\r\n\r\n        for code, resource in self.resources.items():\r\n            if resource_type is None or resource.resource_type == resource_type:\r\n                resource.unit_price *= factor\r\n\r\n    def apply_regional_factor(self, factor: float):\r\n        \"\"\"Apply regional cost factor to all resources.\"\"\"\r\n        self.adjust_prices(factor)\r\n\r\n    def get_resource_breakdown(self, work_item_code: str, quantity: float) -> pd.DataFrame:\r\n        \"\"\"Get detailed resource breakdown for work item.\"\"\"\r\n\r\n        if work_item_code not in self.work_items:\r\n            return pd.DataFrame()\r\n\r\n        work_item = self.work_items[work_item_code]\r\n        data = []\r\n\r\n        for norm in work_item.resources:\r\n            if norm.resource_code not in self.resources:\r\n                continue\r\n\r\n            resource = self.resources[norm.resource_code]\r\n            resource_qty = quantity * norm.consumption * norm.waste_factor\r\n            resource_cost = resource_qty * resource.unit_price\r\n\r\n            data.append({\r\n                'Resource Code': resource.code,\r\n                'Resource Name': resource.name,\r\n                'Type': resource.resource_type.value,\r\n                'Unit': resource.unit,\r\n                'Consumption': norm.consumption,\r\n                'Waste Factor': norm.waste_factor,\r\n                'Total Qty': round(resource_qty, 3),\r\n                'Unit Price': resource.unit_price,\r\n                'Total Cost': round(resource_cost, 2)\r\n            })\r\n\r\n        return pd.DataFrame(data)\r\n\r\n    def export_to_excel(self, estimate: Dict[str, Any], output_path: str) -> str:\r\n        \"\"\"Export estimate to Excel.\"\"\"\r\n\r\n        with pd.ExcelWriter(output_path, engine='openpyxl') as writer:\r\n            # Summary\r\n            summary_df = pd.DataFrame([estimate['totals']])\r\n            summary_df.to_excel(writer, sheet_name='Summary', index=False)\r\n\r\n            # Line items\r\n            items_data = [{\r\n                'Code': item.work_item_code,\r\n                'Description': item.work_item_name,\r\n                'Quantity': item.quantity,\r\n                'Unit': item.unit,\r\n                'Labor': item.labor_cost,\r\n                'Material': item.material_cost,\r\n                'Equipment': item.equipment_cost,\r\n                'Subcontractor': item.subcontractor_cost,\r\n                'Total': item.total_cost\r\n            } for item in estimate['line_items']]\r\n            items_df = pd.DataFrame(items_data)\r\n            items_df.to_excel(writer, sheet_name='Line Items', 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 estimator\r\nestimator = ResourceBasedEstimator()\r\n\r\n# Add resources\r\nestimator.add_resource(Resource(\"L001\", \"Carpenter\", ResourceType.LABOR, \"MH\", 55.00))\r\nestimator.add_resource(Resource(\"L002\", \"Laborer\", ResourceType.LABOR, \"MH\", 35.00))\r\nestimator.add_resource(Resource(\"M001\", \"Concrete C30\", ResourceType.MATERIAL, \"CY\", 150.00))\r\nestimator.add_resource(Resource(\"M002\", \"Rebar #4\", ResourceType.MATERIAL, \"TON\", 1200.00))\r\nestimator.add_resource(Resource(\"E001\", \"Concrete Pump\", ResourceType.EQUIPMENT, \"HR\", 250.00))\r\n\r\n# Add work item with resource norms\r\nestimator.add_work_item(WorkItem(\r\n    code=\"03.01.01\",\r\n    name=\"Cast-in-place Concrete Foundation\",\r\n    unit=\"CY\",\r\n    resources=[\r\n        ResourceNorm(\"L001\", 1.5),      # 1.5 carpenter hours per CY\r\n        ResourceNorm(\"L002\", 2.0),      # 2.0 laborer hours per CY\r\n        ResourceNorm(\"M001\", 1.0, 1.05),# 1.0 CY concrete with 5% waste\r\n        ResourceNorm(\"M002\", 0.08),     # 0.08 ton rebar per CY\r\n        ResourceNorm(\"E001\", 0.25)      # 0.25 pump hours per CY\r\n    ]\r\n))\r\n\r\n# Calculate estimate\r\nestimate = estimator.calculate_estimate([\r\n    {\"work_item_code\": \"03.01.01\", \"quantity\": 100}\r\n])\r\n\r\nprint(f\"Direct Cost: ${estimate['totals']['direct_cost']:,.2f}\")\r\nprint(f\"Grand Total: ${estimate['totals']['grand_total']:,.2f}\")\r\n```\r\n\r\n## Common Use Cases\r\n\r\n### 1. Resource Breakdown\r\n```python\r\nbreakdown = estimator.get_resource_breakdown(\"03.01.01\", quantity=100)\r\nprint(breakdown)\r\n```\r\n\r\n### 2. Regional Adjustment\r\n```python\r\n# Apply 15% regional factor\r\nestimator.apply_regional_factor(1.15)\r\n```\r\n\r\n### 3. Labor Only Adjustment\r\n```python\r\n# Increase labor costs by 10%\r\nestimator.adjust_prices(1.10, ResourceType.LABOR)\r\n```\r\n\r\n## Resources\r\n- **DDC Book**: Chapter 3.1 - Resource-Based Costing\r\n- **Website**: https://datadrivenconstruction.io\n\nFile v2.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn75fhjxn1jz5xbgd9ggj0nrtd80q1dz\",\n  \"slug\": \"cost-estimation-resource\",\n  \"version\": \"2.0.0\",\n  \"publishedAt\": 1770995532802\n}\n\nFile v2.0.0:instructions.md\n\nYou are a construction cost estimation assistant specializing in resource-based costing. You separate physical resource consumption (norms) from prices, enabling accurate, adjustable, and transparent cost estimation.\n\nWhen the user asks to estimate costs using resources:\n1. Gather work item descriptions and quantities\n2. Define resources: labor (man-hours), materials (units), equipment (hours)\n3. Apply consumption norms (how much of each resource per unit of work)\n4. Include waste factors where applicable (e.g., 5% concrete waste)\n5. Calculate costs: quantity x consumption norm x waste factor x unit price\n6. Apply overhead and profit markups\n7. Present detailed breakdown by resource type\n\nWhen the user asks to adjust or compare estimates:\n1. Apply regional cost factors to all or specific resource types\n2. Adjust labor, material, or equipment prices independently\n3. Show before/after comparison\n\n## Input Format\n- Work items with quantities and units\n- Resource database: code, name, type (labor/material/equipment), unit, unit price\n- Resource norms: consumption per work item unit, waste factor\n\n## Output Format\n- Cost breakdown: labor, material, equipment, subcontractor\n- Percentage split by category\n- Overhead, profit, and grand total\n- Detailed resource breakdown per work item on request\n\n## Key Classes (from SKILL.md)\n- `ResourceBasedEstimator`: Main estimator engine\n- `Resource`: Individual resource (labor, material, equipment)\n- `ResourceNorm`: Consumption rate per work item unit\n- `WorkItem`: Work activity with associated resource norms\n\n## Constraints\n- Default overhead: 15%, profit: 10%\n- Always show resource type breakdown (labor vs material vs equipment %)\n- Waste factors default to 1.0 (no waste) unless specified\n- Round costs to 2 decimal places\n\nFile v2.0.0:claw.json\n\n{\n  \"name\": \"cost-estimation-resource\",\n  \"version\": \"2.0.0\",\n  \"description\": \"Calculate construction costs using resource-based method. Estimate project costs from work items, physical resource norms, and current prices.\",\n  \"author\": \"datadrivenconstruction\",\n  \"license\": \"MIT\",\n  \"permissions\": [\"filesystem\"],\n  \"entry\": \"instructions.md\",\n  \"tags\": [\"construction\", \"estimation\", \"resource-method\", \"cost-management\", \"norms\"],\n  \"models\": [\"claude-*\", \"gpt-*\"],\n  \"minOpenClawVersion\": \"0.8.0\"\n}\n\nArchive v1.0.0: 2 files, 3685 bytes\n\nFiles: SKILL.md (12474b), _meta.json (143b)\n\nFile v1.0.0:SKILL.md\n\n---\r\nslug: \"cost-estimation-resource\"\r\ndisplay_name: \"Cost Estimation Resource\"\r\ndescription: \"Calculate construction costs using resource-based method. Estimate project costs from work items, physical resource norms, and current prices.\"\r\n---\r\n\r\n# Cost Estimation - Resource Method\r\n\r\n## Business Case\r\n\r\n### Problem Statement\r\nTraditional costing challenges:\r\n- Fixed unit prices become outdated\r\n- No visibility into cost components\r\n- Difficult to adjust for conditions\r\n- Limited cost analysis capability\r\n\r\n### Solution\r\nResource-based costing separates physical resource consumption (norms) from prices, enabling accurate, adjustable, and transparent cost estimation.\r\n\r\n## Technical Implementation\r\n\r\n```python\r\nimport pandas as pd\r\nfrom typing import Dict, Any, List, Optional\r\nfrom dataclasses import dataclass, field\r\nfrom enum import Enum\r\n\r\n\r\nclass ResourceType(Enum):\r\n    LABOR = \"labor\"\r\n    MATERIAL = \"material\"\r\n    EQUIPMENT = \"equipment\"\r\n    SUBCONTRACTOR = \"subcontractor\"\r\n\r\n\r\n@dataclass\r\nclass Resource:\r\n    code: str\r\n    name: str\r\n    resource_type: ResourceType\r\n    unit: str\r\n    unit_price: float\r\n    currency: str = \"USD\"\r\n\r\n\r\n@dataclass\r\nclass ResourceNorm:\r\n    resource_code: str\r\n    consumption: float  # Units per work item unit\r\n    waste_factor: float = 1.0  # 1.1 = 10% waste\r\n\r\n\r\n@dataclass\r\nclass WorkItem:\r\n    code: str\r\n    name: str\r\n    unit: str\r\n    resources: List[ResourceNorm] = field(default_factory=list)\r\n\r\n\r\n@dataclass\r\nclass CostLineItem:\r\n    work_item_code: str\r\n    work_item_name: str\r\n    quantity: float\r\n    unit: str\r\n    labor_cost: float\r\n    material_cost: float\r\n    equipment_cost: float\r\n    subcontractor_cost: float\r\n    total_cost: float\r\n\r\n\r\nclass ResourceBasedEstimator:\r\n    \"\"\"Calculate costs using resource-based method.\"\"\"\r\n\r\n    def __init__(self):\r\n        self.resources: Dict[str, Resource] = {}\r\n        self.work_items: Dict[str, WorkItem] = {}\r\n        self.overhead_rate: float = 0.15\r\n        self.profit_rate: float = 0.10\r\n\r\n    def add_resource(self, resource: Resource):\r\n        \"\"\"Add resource to database.\"\"\"\r\n        self.resources[resource.code] = resource\r\n\r\n    def add_work_item(self, work_item: WorkItem):\r\n        \"\"\"Add work item with resource norms.\"\"\"\r\n        self.work_items[work_item.code] = work_item\r\n\r\n    def load_resources_from_df(self, df: pd.DataFrame):\r\n        \"\"\"Load resources from DataFrame.\"\"\"\r\n\r\n        for _, row in df.iterrows():\r\n            resource = Resource(\r\n                code=row['code'],\r\n                name=row['name'],\r\n                resource_type=ResourceType(row['type'].lower()),\r\n                unit=row['unit'],\r\n                unit_price=float(row['unit_price']),\r\n                currency=row.get('currency', 'USD')\r\n            )\r\n            self.add_resource(resource)\r\n\r\n    def load_work_items_from_df(self, items_df: pd.DataFrame, norms_df: pd.DataFrame):\r\n        \"\"\"Load work items and norms from DataFrames.\"\"\"\r\n\r\n        # Group norms by work item\r\n        norms_grouped = norms_df.groupby('work_item_code')\r\n\r\n        for _, row in items_df.iterrows():\r\n            code = row['code']\r\n            resources = []\r\n\r\n            if code in norms_grouped.groups:\r\n                item_norms = norms_grouped.get_group(code)\r\n                for _, norm_row in item_norms.iterrows():\r\n                    resources.append(ResourceNorm(\r\n                        resource_code=norm_row['resource_code'],\r\n                        consumption=float(norm_row['consumption']),\r\n                        waste_factor=float(norm_row.get('waste_factor', 1.0))\r\n                    ))\r\n\r\n            work_item = WorkItem(\r\n                code=code,\r\n                name=row['name'],\r\n                unit=row['unit'],\r\n                resources=resources\r\n            )\r\n            self.add_work_item(work_item)\r\n\r\n    def calculate_work_item_cost(self, work_item_code: str, quantity: float) -> CostLineItem:\r\n        \"\"\"Calculate cost for a work item quantity.\"\"\"\r\n\r\n        if work_item_code not in self.work_items:\r\n            raise ValueError(f\"Work item {work_item_code} not found\")\r\n\r\n        work_item = self.work_items[work_item_code]\r\n\r\n        labor_cost = 0.0\r\n        material_cost = 0.0\r\n        equipment_cost = 0.0\r\n        subcontractor_cost = 0.0\r\n\r\n        for norm in work_item.resources:\r\n            if norm.resource_code not in self.resources:\r\n                continue\r\n\r\n            resource = self.resources[norm.resource_code]\r\n            resource_qty = quantity * norm.consumption * norm.waste_factor\r\n            resource_cost = resource_qty * resource.unit_price\r\n\r\n            if resource.resource_type == ResourceType.LABOR:\r\n                labor_cost += resource_cost\r\n            elif resource.resource_type == ResourceType.MATERIAL:\r\n                material_cost += resource_cost\r\n            elif resource.resource_type == ResourceType.EQUIPMENT:\r\n                equipment_cost += resource_cost\r\n            elif resource.resource_type == ResourceType.SUBCONTRACTOR:\r\n                subcontractor_cost += resource_cost\r\n\r\n        total = labor_cost + material_cost + equipment_cost + subcontractor_cost\r\n\r\n        return CostLineItem(\r\n            work_item_code=work_item_code,\r\n            work_item_name=work_item.name,\r\n            quantity=quantity,\r\n            unit=work_item.unit,\r\n            labor_cost=round(labor_cost, 2),\r\n            material_cost=round(material_cost, 2),\r\n            equipment_cost=round(equipment_cost, 2),\r\n            subcontractor_cost=round(subcontractor_cost, 2),\r\n            total_cost=round(total, 2)\r\n        )\r\n\r\n    def calculate_estimate(self, items: List[Dict[str, Any]]) -> Dict[str, Any]:\r\n        \"\"\"Calculate full estimate from list of items.\"\"\"\r\n\r\n        line_items = []\r\n        totals = {\r\n            'labor': 0.0,\r\n            'material': 0.0,\r\n            'equipment': 0.0,\r\n            'subcontractor': 0.0,\r\n            'direct': 0.0\r\n        }\r\n\r\n        for item in items:\r\n            code = item['work_item_code']\r\n            qty = float(item['quantity'])\r\n\r\n            line = self.calculate_work_item_cost(code, qty)\r\n            line_items.append(line)\r\n\r\n            totals['labor'] += line.labor_cost\r\n            totals['material'] += line.material_cost\r\n            totals['equipment'] += line.equipment_cost\r\n            totals['subcontractor'] += line.subcontractor_cost\r\n            totals['direct'] += line.total_cost\r\n\r\n        # Calculate overhead and profit\r\n        overhead = totals['direct'] * self.overhead_rate\r\n        subtotal = totals['direct'] + overhead\r\n        profit = subtotal * self.profit_rate\r\n        grand_total = subtotal + profit\r\n\r\n        return {\r\n            'line_items': line_items,\r\n            'totals': {\r\n                'labor': round(totals['labor'], 2),\r\n                'material': round(totals['material'], 2),\r\n                'equipment': round(totals['equipment'], 2),\r\n                'subcontractor': round(totals['subcontractor'], 2),\r\n                'direct_cost': round(totals['direct'], 2),\r\n                'overhead': round(overhead, 2),\r\n                'overhead_rate': self.overhead_rate,\r\n                'subtotal': round(subtotal, 2),\r\n                'profit': round(profit, 2),\r\n                'profit_rate': self.profit_rate,\r\n                'grand_total': round(grand_total, 2)\r\n            },\r\n            'summary': {\r\n                'item_count': len(line_items),\r\n                'labor_pct': round(totals['labor'] / totals['direct'] * 100, 1) if totals['direct'] > 0 else 0,\r\n                'material_pct': round(totals['material'] / totals['direct'] * 100, 1) if totals['direct'] > 0 else 0,\r\n                'equipment_pct': round(totals['equipment'] / totals['direct'] * 100, 1) if totals['direct'] > 0 else 0\r\n            }\r\n        }\r\n\r\n    def adjust_prices(self, factor: float, resource_type: ResourceType = None):\r\n        \"\"\"Adjust resource prices by factor.\"\"\"\r\n\r\n        for code, resource in self.resources.items():\r\n            if resource_type is None or resource.resource_type == resource_type:\r\n                resource.unit_price *= factor\r\n\r\n    def apply_regional_factor(self, factor: float):\r\n        \"\"\"Apply regional cost factor to all resources.\"\"\"\r\n        self.adjust_prices(factor)\r\n\r\n    def get_resource_breakdown(self, work_item_code: str, quantity: float) -> pd.DataFrame:\r\n        \"\"\"Get detailed resource breakdown for work item.\"\"\"\r\n\r\n        if work_item_code not in self.work_items:\r\n            return pd.DataFrame()\r\n\r\n        work_item = self.work_items[work_item_code]\r\n        data = []\r\n\r\n        for norm in work_item.resources:\r\n            if norm.resource_code not in self.resources:\r\n                continue\r\n\r\n            resource = self.resources[norm.resource_code]\r\n            resource_qty = quantity * norm.consumption * norm.waste_factor\r\n            resource_cost = resource_qty * resource.unit_price\r\n\r\n            data.append({\r\n                'Resource Code': resource.code,\r\n                'Resource Name': resource.name,\r\n                'Type': resource.resource_type.value,\r\n                'Unit': resource.unit,\r\n                'Consumption': norm.consumption,\r\n                'Waste Factor': norm.waste_factor,\r\n                'Total Qty': round(resource_qty, 3),\r\n                'Unit Price': resource.unit_price,\r\n                'Total Cost': round(resource_cost, 2)\r\n            })\r\n\r\n        return pd.DataFrame(data)\r\n\r\n    def export_to_excel(self, estimate: Dict[str, Any], output_path: str) -> str:\r\n        \"\"\"Export estimate to Excel.\"\"\"\r\n\r\n        with pd.ExcelWriter(output_path, engine='openpyxl') as writer:\r\n            # Summary\r\n            summary_df = pd.DataFrame([estimate['totals']])\r\n            summary_df.to_excel(writer, sheet_name='Summary', index=False)\r\n\r\n            # Line items\r\n            items_data = [{\r\n                'Code': item.work_item_code,\r\n                'Description': item.work_item_name,\r\n                'Quantity': item.quantity,\r\n                'Unit': item.unit,\r\n                'Labor': item.labor_cost,\r\n                'Material': item.material_cost,\r\n                'Equipment': item.equipment_cost,\r\n                'Subcontractor': item.subcontractor_cost,\r\n                'Total': item.total_cost\r\n            } for item in estimate['line_items']]\r\n            items_df = pd.DataFrame(items_data)\r\n            items_df.to_excel(writer, sheet_name='Line Items', 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 estimator\r\nestimator = ResourceBasedEstimator()\r\n\r\n# Add resources\r\nestimator.add_resource(Resource(\"L001\", \"Carpenter\", ResourceType.LABOR, \"MH\", 55.00))\r\nestimator.add_resource(Resource(\"L002\", \"Laborer\", ResourceType.LABOR, \"MH\", 35.00))\r\nestimator.add_resource(Resource(\"M001\", \"Concrete C30\", ResourceType.MATERIAL, \"CY\", 150.00))\r\nestimator.add_resource(Resource(\"M002\", \"Rebar #4\", ResourceType.MATERIAL, \"TON\", 1200.00))\r\nestimator.add_resource(Resource(\"E001\", \"Concrete Pump\", ResourceType.EQUIPMENT, \"HR\", 250.00))\r\n\r\n# Add work item with resource norms\r\nestimator.add_work_item(WorkItem(\r\n    code=\"03.01.01\",\r\n    name=\"Cast-in-place Concrete Foundation\",\r\n    unit=\"CY\",\r\n    resources=[\r\n        ResourceNorm(\"L001\", 1.5),      # 1.5 carpenter hours per CY\r\n        ResourceNorm(\"L002\", 2.0),      # 2.0 laborer hours per CY\r\n        ResourceNorm(\"M001\", 1.0, 1.05),# 1.0 CY concrete with 5% waste\r\n        ResourceNorm(\"M002\", 0.08),     # 0.08 ton rebar per CY\r\n        ResourceNorm(\"E001\", 0.25)      # 0.25 pump hours per CY\r\n    ]\r\n))\r\n\r\n# Calculate estimate\r\nestimate = estimator.calculate_estimate([\r\n    {\"work_item_code\": \"03.01.01\", \"quantity\": 100}\r\n])\r\n\r\nprint(f\"Direct Cost: ${estimate['totals']['direct_cost']:,.2f}\")\r\nprint(f\"Grand Total: ${estimate['totals']['grand_total']:,.2f}\")\r\n```\r\n\r\n## Common Use Cases\r\n\r\n### 1. Resource Breakdown\r\n```python\r\nbreakdown = estimator.get_resource_breakdown(\"03.01.01\", quantity=100)\r\nprint(breakdown)\r\n```\r\n\r\n### 2. Regional Adjustment\r\n```python\r\n# Apply 15% regional factor\r\nestimator.apply_regional_factor(1.15)\r\n```\r\n\r\n### 3. Labor Only Adjustment\r\n```python\r\n# Increase labor costs by 10%\r\nestimator.adjust_prices(1.10, ResourceType.LABOR)\r\n```\r\n\r\n## Resources\r\n- **DDC Book**: Chapter 3.1 - Resource-Based Costing\r\n- **Website**: https://datadrivenconstruction.io\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn75fhjxn1jz5xbgd9ggj0nrtd80q1dz\",\n  \"slug\": \"cost-estimation-resource\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1770475545060\n}","readmeExcerpt":"Skill: Cost Estimation Resource Owner: datadrivenconstruction Summary: Calculate construction costs using resource-based method. Estimate project costs from work items, physical resource norms, and current prices. Tags: latest:2.1.0 Version history: v2.1.0 | 2026-02-13T20:57:48.147Z | auto - Added homepage and metadata fields to SKILL.md for enhanced integration and discoverability. - Included Openclaw-specific metad","codeSnippets":[],"executableExamples":[],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\r\nname: \"cost-estimation-resource\"\r\ndescription: \"Calculate construction costs using resource-based method. Estimate project costs from work items, physical resource norms, and current prices.\"\r\nhomepage: \"https://datadrivenconstruction.io\"\r\nmetadata: {\"openclaw\":{\"emoji\":\"🧮\",\"os\":[\"darwin\",\"linux\",\"win32\"],\"homepage\":\"https://datadrivenconstruction.io\",\"requires\":{\"bins\":[\"python3\"]}}}\r\n---\r\n\r\n# Cost Estimation - Resource Method\r\n\r\n## Business Case\r\n\r\n### Problem Statement\r\nTraditional costing challenges:\r\n- Fixed unit prices become outdated\r\n- No visibility into cost components\r\n- Difficult to adjust for conditions\r\n- Limited cost analysis capability\r\n\r\n### Solution\r\nResource-based costing separates physical resource consumption (norms) from prices, enabling accurate, adjustable, and transparent cost estimation.\r\n\r\n## Technical Implementation\r\n\r\n```python\r\nimport pandas as pd\r\nfrom typing import Dict, Any, List, Optional\r\nfrom dataclasses import dataclass, field\r\nfrom enum import Enum\r\n\r\n\r\nclass ResourceType(Enum):\r\n    LABOR = \"labor\"\r\n    MATERIAL = \"material\"\r\n    EQUIPMENT = \"equipment\"\r\n    SUBCONTRACTOR = \"subcontractor\"\r\n\r\n\r\n@dataclass\r\nclass Resource:\r\n    code: str\r\n    name: str\r\n    resource_type: ResourceType\r\n    unit: str\r\n    unit_price: float\r\n    currency: str = \"USD\"\r\n\r\n\r\n@dataclass\r\nclass ResourceNorm:\r\n    resource_code: str\r\n    consumption: float  # Units per work item unit\r\n    waste_factor: float = 1.0  # 1.1 = 10% waste\r\n\r\n\r\n@dataclass\r\nclass WorkItem:\r\n    code: str\r\n    name: str\r\n    unit: str\r\n    resources: List[ResourceNorm] = field(default_factory=list)\r\n\r\n\r\n@dataclass\r\nclass CostLineItem:\r\n    work_item_code: str\r\n    work_item_name: str\r\n    quantity: float\r\n    unit: str\r\n    labor_cost: float\r\n    material_cost: float\r\n    equipment_cost: float\r\n    subcontractor_cost: float\r\n    total_cost: float\r\n\r\n\r\nclass ResourceBasedEstimator:\r\n    \"\"\"Calculate costs using resource-based method.\"\"\"\r\n\r\n    def __init__(self):\r\n        self.resources: Dict[str, Resource] = {}\r\n        self.work_items: Dict[str, WorkItem] = {}\r\n        self.overhead_rate: float = 0.15\r\n        self.profit_rate: float = 0.10\r\n\r\n    def add_resource(self, resource: Resource):\r\n        \"\"\"Add resource to database.\"\"\"\r\n        self.resources[resource.code] = resource\r\n\r\n    def add_work_item(self, work_item: WorkItem):\r\n        \"\"\"Add work item with resource norms.\"\"\"\r\n        self.work_items[work_item.code] = work_item\r\n\r\n    def load_resources_from_df(self, df: pd.DataFrame):\r\n        \"\"\"Load resources from DataFrame.\"\"\"\r\n\r\n        for _, row in df.iterrows():\r\n            resource = Resource(\r\n                code=row['code'],\r\n                name=row['name'],\r\n                resource_type=ResourceType(row['type'].lower()),\r\n                unit=row['unit'],\r\n                unit_price=float(row['unit_price']),\r\n                currency=row.get('currency', 'USD')\r\n            )\r\n            self.add_resource(resource)\r\n\r\n    def load_w"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn75fhjxn1jz5xbgd9ggj0nrtd80q1dz\",\n  \"slug\": \"cost-estimation-resource\",\n  \"version\": \"2.1.0\",\n  \"publishedAt\": 1771016268147\n}"},{"path":"instructions.md","content":"You are a construction cost estimation assistant specializing in resource-based costing. You separate physical resource consumption (norms) from prices, enabling accurate, adjustable, and transparent cost estimation.\n\nWhen the user asks to estimate costs using resources:\n1. Gather work item descriptions and quantities\n2. Define resources: labor (man-hours), materials (units), equipment (hours)\n3. Apply consumption norms (how much of each resource per unit of work)\n4. Include waste factors where applicable (e.g., 5% concrete waste)\n5. Calculate costs: quantity x consumption norm x waste factor x unit price\n6. Apply overhead and profit markups\n7. Present detailed breakdown by resource type\n\nWhen the user asks to adjust or compare estimates:\n1. Apply regional cost factors to all or specific resource types\n2. Adjust labor, material, or equipment prices independently\n3. Show before/after comparison\n\n## Input Format\n- Work items with quantities and units\n- Resource database: code, name, type (labor/material/equipment), unit, unit price\n- Resource norms: consumption per work item unit, waste factor\n\n## Output Format\n- Cost breakdown: labor, material, equipment, subcontractor\n- Percentage split by category\n- Overhead, profit, and grand total\n- Detailed resource breakdown per work item on request\n\n## Key Classes (from SKILL.md)\n- `ResourceBasedEstimator`: Main estimator engine\n- `Resource`: Individual resource (labor, material, equipment)\n- `ResourceNorm`: Consumption rate per work item unit\n- `WorkItem`: Work activity with associated resource norms\n\n## Constraints\n- Default overhead: 15%, profit: 10%\n- Always show resource type breakdown (labor vs material vs equipment %)\n- Waste factors default to 1.0 (no waste) unless specified\n- Round costs to 2 decimal places"},{"path":"claw.json","content":"{\n  \"name\": \"cost-estimation-resource\",\n  \"version\": \"2.0.0\",\n  \"description\": \"Calculate construction costs using resource-based method. Estimate project costs from work items, physical resource norms, and current prices.\",\n  \"author\": \"datadrivenconstruction\",\n  \"license\": \"MIT\",\n  \"permissions\": [\"filesystem\"],\n  \"entry\": \"instructions.md\",\n  \"tags\": [\"construction\", \"estimation\", \"resource-method\", \"cost-management\", \"norms\"],\n  \"models\": [\"claude-*\", \"gpt-*\"],\n  \"minOpenClawVersion\": \"0.8.0\"\n}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1168,"uniquenessScore":44,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T16:44:03.022Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T16:44:03.022Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T20:56:42.753Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}