cad-dxf-agent — DXF Drawing Analysis
Overview
CAD reviewers manually scan drawings for code compliance, QA defects, quantities,
and ambiguities — slow and error-prone. This skill automates that for DXF files by
driving the deterministic cad-analyze CLI (no LLM, no API key, no network) and
reporting the findings in prose.
| Capability |
What it answers |
Command |
| compliance |
Does it meet ADA / IBC / a custom code? |
cad-analyze compliance FILE [--profile ada|ibc-2021|residential] |
| health |
Is the drawing clean? (overlaps, text, orphan layers) |
cad-analyze health FILE |
| takeoff |
How much of everything? |
cad-analyze takeoff FILE |
| summary |
What is this drawing, in plain English? |
cad-analyze summary FILE |
| rfi |
What's ambiguous / needs clarification? |
cad-analyze rfi FILE |
| zones |
What rooms/areas are enclosed, and how big? |
cad-analyze zones FILE |
| compare |
What changed between two revisions? |
cad-revision diff MASTER REVISION |
Prerequisites
The CLI ships with the cad-dxf-agent Python package. Check, install only if missing:
command -v cad-analyze >/dev/null 2>&1 || \
pip install "git+https://github.com/jeremylongshore/cad-ai-agent.git"
Instructions
- Locate the DXF. If the user named a file, use it; otherwise
Glob for **/*.dxf and, if several match, ask which one with AskUserQuestion.
- Pick the capability from the trigger words. If unclear, ask.
- Run the CLI with
--json, e.g. cad-analyze health DRAWING.dxf --json.
- Parse the JSON and report in prose. For compliance, pass
--profile when the user names a code; default ada.
See references/capabilities.md for each report's JSON shape.
Output
Report in prose, not raw JSON. Lead with the headline, then cite the drawing's
own evidence—entity handles and layers—so a reviewer can act.
- compliance: profile pass/fail, violation count, then each finding.
- health: score (0–100), then issues grouped by severity.
- takeoff: quantities by category, name, quantity, and unit.
- summary: narrative and room list.
- rfi: numbered questions ready to send to a reviewer.
- zones: detected rooms or areas and computed area.
Error Handling
- Exit
0 means the command completed. Compliance may exit 1 when violations
are present; parse its JSON and report the findings rather than treating it as
a command failure.
- Exit
2 means the file is missing or unreadable. Confirm the path and that it
is a valid DXF before retrying.
- If
cad-analyze is unavailable, install the prerequisite once and rerun the
requested command.
- An empty findings or issues list is a pass; never invent findings.
Examples
Check a floor plan for ADA compliance
cad-analyze compliance ./plans/level-1.dxf --profile ada --json
Report the violation count and every finding's rule and evidence handles.
Audit drawing quality
cad-analyze health drawing.dxf --json
Report the score, then group issues by severity.
Safety
- Read-only. Analysis never modifies the DXF.
cad-revision apply/bundle writes a new file; the original is never touched.
- Offline. The analysis capabilities make no network calls and use no secrets.
Natural-language editing and agent-mode tool use require a bring-your-own LLM provider and are not exposed here.
Resources
1---2name: cad-dxf-agent3description: Analyzes DXF drawings deterministically — ADA/IBC code compliance, drawing health and QA, quantity takeoff, plain-English summaries, RFI generation, and room/zone detection — with no LLM or API key. Use when a user has a .dxf file and wants to check code compliance, audit drawing quality, pull quantities, summarize a drawing, generate RFIs, or detect rooms and areas. Trigger with "analyze this DXF", "check compliance", "drawing health", "quantity takeoff", "summarize this drawing", "generate RFIs", "detect zones", or "/cad-dxf-agent".4license: Apache-2.05---6
7# cad-dxf-agent — DXF Drawing Analysis
8
9## Overview
10
11CAD reviewers manually scan drawings for code compliance, QA defects, quantities,
12and ambiguities — slow and error-prone. This skill automates that for DXF files by
13driving the deterministic `cad-analyze` CLI (no LLM, no API key, no network) and
14reporting the findings in prose.
15
16| Capability | What it answers | Command |
17|---|---|---|
18| **compliance** | Does it meet ADA / IBC / a custom code? | `cad-analyze compliance FILE [--profile ada\|ibc-2021\|residential]` |
19| **health** | Is the drawing clean? (overlaps, text, orphan layers) | `cad-analyze health FILE` |
20| **takeoff** | How much of everything? | `cad-analyze takeoff FILE` |
21| **summary** | What is this drawing, in plain English? | `cad-analyze summary FILE` |
22| **rfi** | What's ambiguous / needs clarification? | `cad-analyze rfi FILE` |
23| **zones** | What rooms/areas are enclosed, and how big? | `cad-analyze zones FILE` |
24| **compare** | What changed between two revisions? | `cad-revision diff MASTER REVISION` |
25
26## Prerequisites
27
28The CLI ships with the `cad-dxf-agent` Python package. Check, install only if missing:
29
30```bash
31command -v cad-analyze >/dev/null 2>&1 || \
32 pip install "git+https://github.com/jeremylongshore/cad-ai-agent.git"
33```
34
35## Instructions
36
371. Locate the DXF. If the user named a file, use it; otherwise `Glob` for `**/*.dxf` and, if several match, ask which one with `AskUserQuestion`.
382. Pick the capability from the trigger words. If unclear, ask.
393. Run the CLI with `--json`, e.g. `cad-analyze health DRAWING.dxf --json`.
404. Parse the JSON and report in prose. For compliance, pass `--profile` when the user names a code; default `ada`.
41
42See `references/capabilities.md` for each report's JSON shape.
43
44## Output
45
46Report in prose, not raw JSON. Lead with the headline, then cite the drawing's
47own evidence—entity handles and layers—so a reviewer can act.
48
49- **compliance**: profile pass/fail, violation count, then each finding.
50- **health**: score (0–100), then issues grouped by severity.
51- **takeoff**: quantities by category, name, quantity, and unit.
52- **summary**: narrative and room list.
53- **rfi**: numbered questions ready to send to a reviewer.
54- **zones**: detected rooms or areas and computed area.
55
56## Error Handling
57
58- Exit `0` means the command completed. Compliance may exit `1` when violations
59 are present; parse its JSON and report the findings rather than treating it as
60 a command failure.
61- Exit `2` means the file is missing or unreadable. Confirm the path and that it
62 is a valid DXF before retrying.
63- If `cad-analyze` is unavailable, install the prerequisite once and rerun the
64 requested command.
65- An empty findings or issues list is a pass; never invent findings.
66
67## Examples
68
69**Check a floor plan for ADA compliance**
70
71```bash
72cad-analyze compliance ./plans/level-1.dxf --profile ada --json
73```
74
75Report the violation count and every finding's rule and evidence handles.
76
77**Audit drawing quality**
78
79```bash
80cad-analyze health drawing.dxf --json
81```
82
83Report the score, then group issues by severity.
84
85## Safety
86
87- **Read-only.** Analysis never modifies the DXF. `cad-revision apply`/`bundle` writes a new file; the original is never touched.
88- **Offline.** The analysis capabilities make no network calls and use no secrets.
89
90Natural-language editing and agent-mode tool use require a bring-your-own LLM provider and are not exposed here.
91
92## Resources
93
94- `references/capabilities.md` — JSON shape of each report and how to read it.
95- Source + issues: <https://github.com/jeremylongshore/cad-ai-agent>