agentleFS
aianime0012-coderaianime0012-coder/vitruvius-skills/skills/dxf-drawing-inspection/SKILL.md

dxf-drawing-inspection

Skill0 starsChanged 3 months agoMITView on GitHub

Audits DXF and DWG CAD drawings — extracts layers, entity types, bounding boxes, and drawing hygiene issues. Use when reviewing CAD submissions, checking drawing standards compliance, understanding an unfamiliar drawing, or finding orphaned layers and off-origin geometry.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    DWG: not text-readable. Use ezdxf.readfile with the ODA File Converter, or tell the user DWG needs AutoCAD/ODA.

    line 67
  2. Distinctive:

    Huge files (100MB+): prefer ezdxf; warn before the fallback parser on large files.

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

DXF Drawing Inspection

Analyze a CAD drawing and report what's in it: layers, entity inventory, extents, and common hygiene problems. The standard first pass before any CAD task (redlining, cleanup, conversion, quantity counting).

When to use

  • "What's in this .dxf/.dwg file?"
  • Checking a submission against the office layering standard
  • Finding problems before conversion (off-origin, exploded blocks, empty layers)
  • Estimating drawing size/complexity

Workflow

  1. Prefer ezdxf for accurate results:

    pip install ezdxf
    import ezdxf
    
    doc = ezdxf.readfile("plan.dxf")
    msp = doc.modelspace()
    
    layers = {l.dxf.name for l in doc.layers}
    entities = {}
    for e in msp:
        entities[e.dxftype()] = entities.get(e.dxftype(), 0) + 1
    print(f"Layers ({len(layers)}): {', '.join(sorted(layers))}")
    print("Entities:", ", ".join(f"{k}: {v}" for k, v in sorted(entities.items())))
  2. Fallback (stdlib only): DXF is a text format. Pair-group lines where even offsets are group codes and odd offsets are values. 0 group code = entity start. See scripts/inspect_dxf.py for a complete dependency-free parser.
  3. Report (see output format below).
  4. Hygiene checks (the valuable part):
    • Geometry outside a sane coordinate range (e.g. |x| or |y| > 1e6) — likely off-origin
    • 0 layer usage (everything on layer 0 is a red flag)
    • Empty layers (declared, never used)
    • Layers named "Layer1", "aaa", etc. — not renamed
    • Duplicate/overlapping entities (e.g. identical LINE entities)
    • Missing or non-ASCII drawing units header

Output format

DXF: plan.dxf (AC1027, 4.2 MB)
Layers: A-WALL, A-DOOR, A-GLAZ, A-ANNO, A-DIMS (5)
Entities: LINE 1,204 | TEXT 312 | INSERT 186 | LWPOLYLINE 84 | HATCH 96
Extents: (-125.00, -86.00) to (4,120.00, 3,240.00)  [units: mm]
Hygiene: 12 entities at origin (0,0); 3 empty layers (A-AREA, A-FURN); everything on layer 0

Edge cases

  • Binary DXF: starts with AutoCAD Binary DXF — requires ezdxf; the stdlib parser should report this clearly.
  • DWG: not text-readable. Use ezdxf.readfile with the ODA File Converter, or tell the user DWG needs AutoCAD/ODA; ask for a DXF export.
  • AC1009 (R12) and older: ezdxf handles them, but some entity types (HATCH/MTEXT) are newer; expect counts to differ from modern versions.
  • Huge files (100MB+): prefer ezdxf; warn before the fallback parser on large files.
  • Units: the $INSUNITS header variable is often 0 (unitless). Don't guess — report "units: unknown" and let the user confirm.

Files

  • references/dxf-quick-reference.md — entity types, group codes, and layering conventions.
  • scripts/inspect_dxf.py — dependency-free inspector producing the report above.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.