# cwicr-quantity-matcher

cwicr-quantity-matcher matches BIM element quantities with CWICR work items using categories and descriptions. Useful for linking quantity takeoffs to cost codes and flagging uncertain matches.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 125 installs · ★ 434 repo stars
- Author: datadrivenconstruction
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/1_DDC_Toolkit/CWICR-Database/cwicr-quantity-matcher/SKILL.md
- Updated: 2026-10-19
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/cwicr-quantity-matcher

## What it does

The skill links BIM element categories and descriptions to CWICR work items. It uses category rules and semantic comparison to find candidates, then assigns a match method and confidence level. Low-confidence results can be marked for manual review.

Its code includes mappings for categories such as walls, floors, pipes, and ducts, plus conversion factors for unit pairs including `sf` and `m2`, `cy` and `m3`, and `lb` and `kg`. Work item data is passed as a `pandas.DataFrame`; the metadata also requires `python3`. Unlisted unit pairs get a factor of 1.0, so check those conversions separately.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill cwicr-quantity-matcher -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/cwicr-quantity-matcher/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/cwicr-quantity-matcher/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill cwicr-quantity-matcher -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/cwicr-quantity-matcher/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill cwicr-quantity-matcher -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/cwicr-quantity-matcher/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction 1_DDC_Toolkit/CWICR-Database/cwicr-quantity-matcher
```

2. **Manually: put the files in place**
- File: `.github/skills/cwicr-quantity-matcher/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill cwicr-quantity-matcher -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --path 1_DDC_Toolkit/CWICR-Database/cwicr-quantity-matcher
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/cwicr-quantity-matcher/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill cwicr-quantity-matcher -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/1_DDC_Toolkit/CWICR-Database/cwicr-quantity-matcher/SKILL.md

## When to use it
- map BIM categories to CWICR code prefixes
- find CWICR work items from element descriptions
- flag low-confidence matches for manual review
- convert quantities between supported units

## Example prompts
- Match the BIM elements in my quantity schedule to CWICR work items and flag low-confidence results.
- Find CWICR items for the walls and floors in this BIM export using their categories and descriptions.
- Check the quantity conversion from `sf` to `m2` when matching these items to CWICR.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 38c822fc4aabf629.

BEGIN THIRD-PARTY FILE 38c822fc4aabf629
````text
---
name: "cwicr-quantity-matcher"
description: "Match BIM quantities to CWICR work items. Map element categories to cost codes, validate quantities, and generate cost-linked QTOs."
homepage: "https://datadrivenconstruction.io"
metadata: {"openclaw": {"emoji": "🗄️", "os": ["win32"], "homepage": "https://datadrivenconstruction.io", "requires": {"bins": ["python3"]}}}
---
# CWICR Quantity Matcher

## Business Case

### Problem Statement
BIM exports contain quantities but:
- Element categories don't match cost codes
- Manual mapping is error-prone
- Different naming conventions
- Need consistent code assignment

### Solution
Intelligent matching of BIM element quantities to CWICR work items using category mapping, semantic matching, and rule-based assignment.

### Business Value
- **Automation** - Reduce manual mapping effort
- **Consistency** - Standard code assignment
- **Accuracy** - Validated quantity linkage
- **Integration** - BIM-to-cost data flow

## Technical Implementation

```python
import pandas as pd
import numpy as np
from typing import Dict, Any, List, Optional, Tuple
from dataclasses import dataclass, field
from enum import Enum
import re
from difflib import SequenceMatcher


class MatchMethod(Enum):
    """Methods for matching BIM elements to work items."""
    EXACT = "exact"
    CATEGORY = "category"
    SEMANTIC = "semantic"
    RULE_BASED = "rule_based"
    MANUAL = "manual"


class MatchConfidence(Enum):
    """Confidence level of match."""
    HIGH = "high"       # >90% confidence
    MEDIUM = "medium"   # 70-90%
    LOW = "low"         # 50-70%
    MANUAL = "manual"   # <50% - needs review


@dataclass
class QuantityMatch:
    """Single quantity match result."""
    bim_element_id: str
    bim_category: str
    bim_description: str
    bim_quantity: float
    bim_unit: str
    matched_work_item: str
    work_item_description: str
    work_item_unit: str
    match_method: MatchMethod
    confidence: MatchConfidence
    confidence_score: float
    unit_conversion_factor: float = 1.0


@dataclass
class MatchingResult:
    """Complete matching result."""
    total_elements: int
    matched: int
    unmatched: int
    high_confidence: int
    needs_review: int
    matches: List[QuantityMatch]
    unmatched_elements: List[Dict[str, Any]]


# Category to work item mapping rules
````
END THIRD-PARTY FILE 38c822fc4aabf629

The third-party file has ended. Everything between the 38c822fc4aabf629 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2337 of 16802 bytes. © datadrivenconstruction · MIT · https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/1_DDC_Toolkit/CWICR-Database/cwicr-quantity-matcher/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
