Spec vs Model Compliance
Contractors and BIM leads get handed a written spec and a Revit model and are supposed to prove the model matches the spec before every submittal. Nobody does it by hand — a 300-page spec × a model with 5,000 elements is thousands of manual checks. So violations ship. Then RFIs and change orders.
This skill reads the spec once, extracts every checkable requirement (with the
page number attached), scans the Revit model's actual parameters, and produces
an Excel report with PASS / FAIL / MISSING on every element × rule, each
finding citing the exact §section p.page the rule came from.
Cousin of BIM Health Scorecard: same engine shape, but rules come from an external spec PDF rather than a fixed rulebook.
The reliability rule (do not skip)
Every finding cites a spec clause and page. PASS ≠ compliant; MISSING ≠ FAIL.
| Result | Meaning | What to tell the user |
|---|---|---|
| PASS | data present in the model and satisfies the rule | Green |
| FAIL | data present in the model and violates the rule | Red — the modeler must fix |
| MISSING | rule applies but the model has no value for it | Amber — the modeler must populate |
Auto-rule extraction is pattern-based (high recall, non-zero noise). The report
always carries the raw source_text from the spec so the user can verify each
rule before acting on it.
Auto-discovery of parameters emits a confidence-banded binding map (BOUND ≥0.8 / REVIEW 0.5–0.8 / UNBOUND). The user should review the map before running scoring on a spec with unusual concept coverage.
Workflow
Scripts live in scripts/. Run with py on Windows (or python3).
Requires Poppler pdftotext (for spec ingestion) and Revit MCP + the
target model open (for model extraction).
1. Index the spec (one-time per spec)
pdftotext -layout your-spec.pdf work/spec_full.txt
py scripts/build_index_us.py work/spec_full.txt outputs/spec_index.dbOutput: SQLite database with divisions, items, requirements
(page-anchored shall/must/submit/test sentences), refs (ASTM/ACI/NFPA
citations), and FTS5 tables.
Handles both 6-digit MasterFormat (03 30 53) and legacy 5-digit CSI (03310).
2. Extract rules from the index
py scripts/rules_from_index.py outputs/spec_index.db rules.csvOutput: rules.csv with one row per rule, each carrying:
spec_clause=§section p.pageback-reference to the indexsource_text= the actual spec sentenceelement_set,parameter,operator,expected,unitstatus=checkable(scored) orreference_only(carried but not scored)
Item-level completeness rules are added automatically: if a Div 08 section body mentions fire rating anywhere, the tool adds "every door in the model shall have fire_rating populated" — cited to that section.
3. Extract the Revit model + discover parameter bindings
With the model open in Revit and Revit MCP connected:
py scripts/param_discovery.py param_inventory.json
py scripts/revit_extract.py > model.jsonparam_discovery.py scans the model's actual parameter names and fuzzy-matches
each spec concept to whatever parameter really holds it — no hardcoded param
names. Emits bindings.json with BOUND/REVIEW/UNBOUND status per concept, so
the user can confirm the map before scoring.
revit_extract.py pulls doors, rooms, and walls with the resolution chain
(instance param → type param → material structural asset → geometry material) for
concrete strength.
4. Run the engine + build the report
py -c "from scripts.engine import run; import scripts.report as R; \
rules, results = run('rules.csv', 'model.json'); \
R.build(results, rules, 'compliance-report.xlsx', project='...', model='...')"Output: compliance-report.xlsx with 5 sheets:
- Summary — grade A–F, scorecard, per-division rollup
- Failures — every FAIL with element ref, actual vs expected, spec cite
- Missing Data — every MISSING with same cite
- Passes — for completeness
- Rules Applied — every rule loaded, checkable + reference_only
Grade: A ≥95%, B ≥85%, C ≥70%, D ≥50%, else F. Compliance % = PASS / (PASS+FAIL). MISSING is reported separately — an unpopulated field is not a false pass.
What this skill covers
| Concept | Element | Operator | Coverage |
|---|---|---|---|
| Fire rating | doors | min_minutes, exists | Div 08 |
| Fire rating | walls | exists | Div 07 |
| Concrete strength (fc_psi) | walls | min | Div 03 |
| U-value | doors, walls | max | Div 07 |
| R-value | doors, walls | min | Div 07 |
| Hardware assignment | doors | exists | Div 08 |
| Frame material | doors | exists | Div 08 |
| Mark, width, height | doors | exists | Div 08 |
| Floor / wall / ceiling / base finish | rooms | exists, in_list | Div 09 |
Anything the auto-classifier can't confidently bind is carried as
reference_only and shown on the Rules Applied sheet — nothing from the
spec is silently dropped.
Proof points (measured, not claimed)
Blind test — 3H Housing Revit model × US federal VA hospital spec book, neither the tool nor the author had processed before:
| Metric | Value |
|---|---|
| VA specs indexed | 338 pages → 956 page-anchored requirements in ~2 sec |
| Auto-extracted rules | 8 checkable + 954 reference_only |
| Element-checks produced | 559 (57 doors × 3 + 52 rooms × 4 + 180 walls × 2) |
| Findings | 79 PASS · 0 FAIL · 480 MISSING |
| Every finding cites | §08 14 00 p.187 (verifiable in the PDF in 5 sec) |
Real defects surfaced on prior test runs:
- 27 walls FAIL fc ≥ 4000 psi (they're 3500 psi cores) on Baytown Div 03 spec
- 57 doors MISSING fire_rating (field exists in Revit but blank)
- 156 rooms MISSING wall/ceiling/base finish (only Floor Finish populated)
Known limitations (be honest)
- Auto-rule count is spec-dependent. Prose-heavy specs (like the VA one)
produce fewer checkable rules than tabular schedules. The 8-rule VA result
covers the structural bones; niche concepts (acoustic, flame spread,
fire-stopping) currently fall through to
reference_only. Adding them is ~5 min per concept — seescripts/rules_from_index.pyfor the pattern. - Concept vocabulary is fixed. The classifier only recognizes concepts in its dictionary. When a real client's spec surfaces a gap, add the concept there.
- Concrete cover, rebar details, and mix design live in submittals, not the
Revit model. The tool correctly reports these as
reference_only— a spec compliance tool can't check what the model doesn't carry. - Revit MCP must be connected and the target model must be open. Windows
Python launcher is
py, notpython/python3(Store aliases are broken).
File layout
spec-model-compliance/
├── SKILL.md
├── README.md
├── scripts/
│ ├── build_index_us.py # PDF → SQLite index
│ ├── rules_from_index.py # SQLite → rules.csv (with page cites)
│ ├── param_discovery.py # scan Revit params → binding map
│ ├── revit_extract.py # pull doors/rooms/walls via Revit MCP
│ ├── engine.py # deterministic PASS/FAIL/MISSING scorer
│ └── report.py # 5-sheet color-coded Excel builder
└── examples/
├── inputs/ # sample spec PDF + parameter inventory
└── outputs/ # sample compliance-report.xlsx