clash-detection-analysis

clash-detection-analysis is a skill for Claude Code, Codex from datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction. It costs 33 tokens per session (3,656 once invoked), scanned A, original, MIT.

A BIM model checker that finds conflicts between building elements before construction. BIM, or Building Information Modeling, is a digital 3D model containing information about a building's parts and systems.

In plain words
What is it for?
Use it to check structural elements against pipes and ducts, identify hard and clearance clashes, and flag workflow conflicts in an IFC model.
Why use it?
It catches physical intersections, missing clearances, and sequencing conflicts while changes are still cheaper to make. This helps reduce rework and delays on site.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it to check structural elements against pipes and ducts, identify hard and clearance clashes, and flag workflow conflicts in an IFC model.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/clash-detection-analysis
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill clash-detection-analysis
Clone the repo
git clone --depth 1 https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for clash-detection-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/clash-detection-analysis/github.svg)](https://agentmods.dev/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/clash-detection-analysis)
Your own site
<a href="https://agentmods.dev/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/clash-detection-analysis"><img src="https://agentmods.dev/badge/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/clash-detection-analysis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for clash-detection-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/clash-detection-analysis"><img src="https://agentmods.dev/badge/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/clash-detection-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,656 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.03656
Opus 5 $0.00016 $0.01828
Sonnet 5 $0.00007 $0.00731
Haiku 4.5 $0.00003 $0.00366

Measured 9d ago against content hash 6071a070fb8b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

clash-detection-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

5_DDC_Innovative/clash-detection-analysis/SKILL.md · 473 lines

How it starts

The opening of the file, as written. The whole thing — 473 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Clash Detection Analysis

Overview

This skill implements automated clash detection for BIM models. Identify conflicts between building elements before construction to prevent costly rework and delays.

Types of Clashes:

  • Hard Clash: Physical intersection of elements
  • Soft Clash: Clearance/tolerance violations
  • Workflow Clash: Scheduling/sequencing conflicts

"Обнаружение коллизий на этапе проектирования может сократить затраты на исправление ошибок до 10 раз по сравнению с исправлением на стройплощадке."

Quick Start

import ifcopenshell
import ifcopenshell.geom
import numpy as np
from itertools import combinations

# Open model
ifc = ifcopenshell.open("model.ifc")

# Get structural and MEP elements
structural = ifc.by_type("IfcColumn") + ifc.by_type("IfcBeam")
mep = ifc.by_type("IfcPipeSegment") + ifc.by_type("IfcDuctSegment")

# Simple bounding box clash check
settings = ifcopenshell.geom.settings()

def get_bbox(element):
    try:
        shape = ifcopenshell.geom.create_shape(settings, element)
        verts = np.array(shape.geometry.verts).reshape(-1, 3)
        return verts.min(axis=0), verts.max(axis=0)
    except:
        return None, None

def check_bbox_clash(bbox1, bbox2):
    min1, max1 = bbox1
    min2, max2 = bbox2
    if min1 is None or min2 is None:
        return False
    return np.all(max1 >= min2) and np.all(max2 >= min1)

# Find clashes
clashes = []
for s_elem in structural:
    for m_elem in mep:
        bbox1 = get_bbox(s_elem)
        bbox2 = get_bbox(m_elem)
        if check_bbox_clash(bbox1, bbox2):
            clashes.append({
                'element1': s_elem.GlobalId,
                'element2': m_elem.GlobalId,
                'type': 'Structure-MEP'
            })

print(f"Found {len(clashes)} potential clashes")

Clash Detection Engine

Core Detector Class

import ifcopenshell
import ifcopenshell.geom
import numpy as np
import pandas as pd
from dataclasses import dataclass
from typing import List, Dict, Optional, Tuple
from itertools import combinations
from scipy.spatial import cKDTree

@dataclass
class Clash:
    element1_id: str
    element1_type: str
    element1_name: str
    element2_id: str
    element2_type: str
    element2_name: str
    clash_type: str
    distance: float
    location: Tuple[float, float, float]
    severity: str

class ClashDetector:
    """Detect clashes between BIM elements"""

    def __init__(self, ifc_path: str):
        self.model = ifcopenshell.open(ifc_path)
        self.settings = ifcopenshell.geom.settings()
        self.settings.set(self.settings.USE_WORLD_COORDS, True)

        self._geometry_cache = {}
        self.clashes: List[Clash] = []

    def _get_geometry(self, element):
        """Get or compute element geometry"""
        if element.GlobalId in self._geometry_cache:
            return self._geometry_cache[element.GlobalId]

        try:
            shape = ifcopenshell.geom.create_shape(self.settings, element)
            verts = np.array(shape.geometry.verts).reshape(-1, 3)
            faces = np.array(shape.geometry.faces).reshape(-1, 3)

            geom = {
                'vertices': verts,
                'faces': faces,
                'min': verts.min(axis=0),
                'max': verts.max(axis=0),
                'center': verts.mean(axis=0)
            }
            self._geometry_cache[element.GlobalId] = geom
            return geom
        except:
            return None

    def detect_hard_clashes(self, group1_types: List[str],
                            group2_types: List[str]) -> List[Clash]:
        """Detect hard clashes (physical intersections) between two groups"""
        group1 = []
        for ifc_type in group1_types:
            group1.extend(self.model.by_type(ifc_type))

        group2 = []
        for ifc_type in group2_types:
            group2.extend(self.model.by_type(ifc_type))

        clashes = []

        for elem1 in group1:
            geom1 = self._get_geometry(elem1)
            if geom1 is None:
                continue

            for elem2 in group2:
                if elem1.GlobalId == elem2.GlobalId:
                    continue

                geom2 = self._get_geometry(elem2)
                if geom2 is None:
                    continue

                # Bounding box check (fast filter)
                if not self._bbox_intersect(geom1, geom2):
                    continue

                # Detailed check
                intersection = self._check_intersection(geom1, geom2)
                if intersection['intersects']:
                    clash = Clash(
                        element1_id=elem1.GlobalId,
                        element1_type=elem1.is_a(),
                        element1_name=elem1.Name or '',
                        element2_id=elem2.GlobalId,
                        element2_type=elem2.is_a(),
                        element2_name=elem2.Name or '',
                        clash_type='Hard',
                        distance=intersection['distance'],
                        location=tuple(intersection['point']),
                        severity=self._classify_severity(intersection['distance'])
                    )
                    clashes.append(clash)

        self.clashes.extend(clashes)
        return clashes

    def detect_soft_clashes(self, group1_types: List[str],
                            group2_types: List[str],
                            clearance: float = 0.1) -> List[Clash]:
        """Detect soft clashes (clearance violations)"""
        group1 = []
        for ifc_type in group1_types:
            group1.extend(self.model.by_type(ifc_type))

        group2 = []
        for ifc_type in group2_types:
            group2.extend(self.model.by_type(ifc_type))

        clashes = []

        for elem1 in group1:
            geom1 = self._get_geometry(elem1)
            if geom1 is None:
                continue

            for elem2 in group2:
                if elem1.GlobalId == elem2.GlobalId:
                    continue

                geom2 = self._get_geometry(elem2)
                if geom2 is None:
                    continue

                # Check if within clearance distance
                distance = self._min_distance(geom1, geom2)

                if distance < clearance and distance > 0:
                    clash = Clash(
                        element1_id=elem1.GlobalId,
                        element1_type=elem1.is_a(),
                        element1_name=elem1.Name or '',
                        element2_id=elem2.GlobalId,
                        element2_type=elem2.is_a(),
                        element2_name=elem2.Name or '',
                        clash_type='Soft',
                        distance=distance,
                        location=tuple((geom1['center'] + geom2['center']) / 2),
                        severity='Medium' if distance < clearance/2 else 'Low'
                    )
                    clashes.append(clash)

        self.clashes.extend(clashes)
        return clashes

    def _bbox_intersect(self, geom1: Dict, geom2: Dict) -> bool:
        """Check if bounding boxes intersect"""
        return (np.all(geom1['max'] >= geom2['min']) and
                np.all(geom2['max'] >= geom1['min']))

    def _check_intersection(self, geom1: Dict, geom2: Dict) -> Dict:
        """Check for actual geometry intersection"""
        # Simplified check using closest points
        tree1 = cKDTree(geom1['vertices'])
        distances, _ = tree1.query(geom2['vertices'], k=1)

        min_dist = distances.min()

        if min_dist < 0.001:  # Intersection threshold
            intersection_idx = np.argmin(distances)
            return {
                'intersects': True,
                'distance': min_dist,
                'point': geom2['vertices'][intersection_idx]
            }

        return {'intersects': False, 'distance': min_dist, 'point': None}

    def _min_distance(self, geom1: Dict, geom2: Dict) -> float:
        """Calculate minimum distance between geometries"""
        tree1 = cKDTree(geom1['vertices'])
        distances, _ = tree1.query(geom2['vertices'], k=1)
        return distances.min()

    def _classify_severity(self, distance: float) -> str:
        """Classify clash severity"""
        if distance < 0.01:
            return 'Critical'
        elif distance < 0.05:
            return 'High'
        elif distance < 0.1:
            return 'Medium'
        else:
            return 'Low'

    def get_clash_report(self) -> pd.DataFrame:
        """Generate clash report as DataFrame"""
        if not self.clashes:
            return pd.DataFrame()

        return pd.DataFrame([
            {
                'Element1_ID': c.element1_id,
                'Element1_Type': c.element1_type,
                'Element1_Name': c.element1_name,
                'Element2_ID': c.element2_id,
                'Element2_Type': c.element2_type,
                'Element2_Name': c.element2_name,
                'Clash_Type': c.clash_type,
                'Distance_m': c.distance,
                'Location_X': c.location[0],
                'Location_Y': c.location[1],
                'Location_Z': c.location[2],
                'Severity': c.severity
            }
            for c in self.clashes
        ])

    def get_summary(self) -> Dict:
        """Get clash detection summary"""
        df = self.get_clash_report()
        if df.empty:
            return {'total': 0}

        return {
            'total': len(self.clashes),
            'by_type': df['Clash_Type'].value_counts().to_dict(),
            'by_severity': df['Severity'].value_counts().to_dict(),
            'critical_count': len(df[df['Severity'] == 'Critical']),
            'element_types_involved': df['Element1_Type'].unique().tolist() +
                                     df['Element2_Type'].unique().tolist()
        }

Read the full file on GitHub · 473 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 473 lines · 33 tokens per session scan A 6071a070fb8b

Subscribe to this mod's changes

clash-detection-analysis is a skill published in the GitHub repository datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction (312 stars, last pushed 21d ago), licensed MIT. It adds 33 tokens to every session and 3,656 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.