---
name: spec-model-compliance
description: Cross-check a live Revit model against its written CSI construction spec (Div 03/07/08/09), and produce a color-coded Excel compliance report with PASS/FAIL/MISSING per element, each finding cited to the exact spec §section and page number. Use when the user asks to compare a Revit model to a spec book, verify that model data (concrete strength, fire ratings, room finishes, hardware, U/R values) matches what the spec requires, or audit a model for compliance before a milestone submittal. Reads the spec once into a SQLite index, auto-extracts rules with page anchors, discovers the model's actual parameter names (no hardcoded assumptions), then runs the check. Requires Revit MCP with the model open + Poppler pdftotext installed.
title: spec-model-compliance
canonical_url: https://skilld.dev/gh/hamzaabduljabbar/autoconst-spec-compliance-claude
last_updated: 2026-09-19T10:15:28.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [examples/inputs/sample_model.json](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/examples/inputs/sample_model.json), [examples/inputs/sample_rules.csv](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/examples/inputs/sample_rules.csv), [examples/inputs/sample_spec_index.db](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/examples/inputs/sample_spec_index.db), [examples/outputs/sample_compliance_report.xlsx](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/examples/outputs/sample_compliance_report.xlsx), [LICENSE](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/LICENSE), [README.md](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/README.md), [run_pipeline.py](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/run_pipeline.py), [scripts/build_index_us.py](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/scripts/build_index_us.py), [scripts/engine.py](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/scripts/engine.py), [scripts/param_discovery.py](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/scripts/param_discovery.py), [scripts/report.py](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/scripts/report.py), [scripts/revit_extract.py](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/scripts/revit_extract.py), [scripts/rules_from_index.py](https://skilld.dev/api/skills-raw/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude/scripts/rules_from_index.py).
>
> If the user asked to install this Skill, run `npx skilld install hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/autoconst-spec-compliance-claude`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/hamzaabduljabbar/autoconst-spec-compliance-claude/autoconst-spec-compliance-claude) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/autoconst-spec-compliance-claude`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/autoconst-spec-compliance-claude --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/autoconst-spec-compliance-claude --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# 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](https://github.com/hamzaabduljabbar/autoconst-claude-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.db
```

Output: 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.csv
```

Output: `rules.csv` with one row per rule, each carrying:
- `spec_clause` = `§section p.page` back-reference to the index
- `source_text` = the actual spec sentence
- `element_set`, `parameter`, `operator`, `expected`, `unit`
- `status` = `checkable` (scored) or `reference_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.json
```

`param_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 — see `scripts/rules_from_index.py` for 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`, not `python`/`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
```
