--- name: ifc-model-qa description: Run a read-only health check on an IFC model before anyone uses it for quantities, 4D, clash detection, costing or handover - units, spatial structure, georeferencing, containment, types, names, duplicate GlobalIds, property/quantity/material coverage and broken geometry. Use when the user shares an .ifc file and asks "is this model OK", "check/audit/validate this IFC", "revisar el modelo", "auditoría IFC", or before any takeoff from IFC. --- # IFC model QA A model that looks fine in a viewer can still be useless for data work: no storeys, everything as a proxy, no quantity sets, millimetres declared as metres. This skill finds that out in one minute and says what the model is (and is not) fit for. ## Inputs - One .ifc file (IFC2X3, IFC4 or IFC4X3). Work on a copy; this skill never writes to it. - Optional: what the model will be used for (takeoff, 4D, coordination, handover). Ask if unknown. ## Procedure 1. Install and report versions: `pip install ifcopenshell` then `python -c "import ifcopenshell; print(ifcopenshell.version)"`. The script was tested with IfcOpenShell 0.9.0; if a call fails on another version, check docs.ifcopenshell.org instead of guessing. 2. Run: `python scripts/ifc_qa.py model.ifc --out qa_report.md --csv qa_issues.csv` (add `--geometry` to also try to build every body shape; slower on big models). 3. Read `qa_report.md`. Explain to the user, in this order: - Errors (block the intended use): duplicate GlobalIds, elements outside the spatial structure, no storeys, wrong units. - Warnings: proxies, missing geometry, failed geometry. - Info: no types, empty names, doors/windows that do not fill an opening, no georeferencing. 4. Fill the "fitness for use" table for the user's purpose, with the evidence (count and check name) for each line. 5. Hand over `qa_issues.csv` (one row per finding with GlobalId) so the modeller can fix and re-export. Offer `ifc-ids-validation` if the project has formal information requirements. ## Output - 5-line summary: schema, units, storeys, element count, the single most important problem. - Findings table (check · count · severity · what it blocks). - Fitness for use: takeoff / 4D / coordination / handover → yes, no, or "yes after fixing X". - The two files. ## Never - Never "fix" the model silently or write to the original file. - Never call a model fit for takeoff when Qto sets are missing; say quantities must be computed (see `ifc-quantity-takeoff`) and that results then depend on geometry quality. - Never treat a count of 0 as success: 0 doors in a housing model means something is wrong (filtering, export settings, classes).