---
name: cadcraft
description: >-
  CADCraft is an open-source, clean-room AutoCAD-style 2D CAD and drafting app (pure Rust, egui) for
  macOS, Windows, Linux, FreeBSD and the web, with DXF/DWG file support and first-class agent control
  over MCP, a JSON control channel and a headless CLI. Trigger this skill whenever the user mentions
  CADCraft (or "the CAD app"), asks what it can or cannot do, which file formats it opens or writes,
  its keyboard shortcuts or commands, wants to draw, edit, dimension, hatch, block, xref, lay out,
  plot or export a drawing, convert/inspect/verify a DXF or DWG, script or automate drafting
  (AutoLISP, .scr scripts, .pgp aliases, MCP, control channel, cadcraft-cli), prepare assets for it,
  or troubleshoot it — and also when they describe the job without naming the app ("draw a floor
  plan", "edit this DXF", "convert this DWG to PDF/PNG", "put dimensions on this drawing", "check
  this drawing opens elsewhere").
---

# CADCraft

## Overview

CADCraft is a clean-room, open-source reimplementation of Autodesk AutoCAD (2D drafting first),
written from scratch in Rust (egui/eframe, wgpu) by the ArtCraft team. Source: GitHub
`storytold/cadcraft`, MIT OR Apache-2.0 (`README.md`, `LICENSE-MIT`, `LICENSE-APACHE`). Stage:
**pre-alpha** — four of AutoCAD's five core workflows still fail the project's alpha gate, chiefly
lossless DWG save (`ROADMAP.md` "Why pre-alpha", `docs/roadmap.md` "Alpha gate"). This document
describes release **v0.10.0**, commit `e86eacf094fefda1cdb6ba5137a336f29deb5d99`. Scale: ~155,000
lines of Rust in 12 library crates and 3 apps (src only, ~193k with tests), **427 registered
commands**, menu breadth 283/491 items (58%) (`docs/parity-checklist.md`, generated by
`cargo xtask parity`; `cadcraft-cli commands` is the live catalog). It runs natively on
macOS/Windows/Linux/FreeBSD and in the browser via WebAssembly (`README.md`; `apps/cadcraft-web`).
The differentiator for agents: every user-visible action is a command reachable identically from
the command line, the JSON control channel, MCP and the CLI (`crates/engine/src/cmd/mod.rs`).

## Capabilities (verified)

### Drawing and editing (the AutoCAD workflow)
- Draw: LINE, PLINE (arcs, widths), CIRCLE (center/radius/diameter, 2P, 3P), ARC, RECTANG
  (fillet/chamfer), POLYGON, ELLIPSE (+arcs), SPLINE, POINT, XLINE, RAY, DONUT, TEXT, MTEXT, plus
  MLINE, REGION and HELIX (`crates/engine/src/cmd/draw.rs`, `draw2.rs`, `crates/engine/src/cmd/draw2/mline.rs`;
  `docs/gaps.md` F21).
- Modify: ERASE, MOVE, COPY, ROTATE, SCALE, MIRROR, STRETCH (window/crossing polygons, fence),
  OFFSET, TRIM, EXTEND, FILLET, CHAMFER, BREAK, JOIN, EXPLODE, rectangular/polar ARRAY
  (+associative arrays, ARRAYEDIT), draw order, OVERKILL; Express Tools NCOPY, BREAKLINE,
  TXT2MTXT, BURST, MOCORO (`crates/engine/src/cmd/modify.rs`, `modify2.rs`, `array/`,
  `overkill.rs`, `crates/engine/src/cmd/draw2/breakline.rs`, `txt2mtxt.rs`, `crates/engine/src/cmd/blocks/burst.rs`; `docs/gaps.md` E3, F5).
- Precision: object snaps (endpoint, midpoint, center, geometric center, node, quadrant,
  intersection, apparent intersection, extension, insertion, perpendicular, parallel, tangent,
  nearest, deferred tangent/perpendicular), **object snap tracking** (`crates/engine/src/snap/tracking.rs`),
  point modifiers FROM/M2P/TK (`crates/engine/src/pointmod.rs`), typed snap overrides (`END`,
  `MID`…), polar tracking, ortho, grid snap, direct distance entry, `@dx,dy` / `@d<a` / `#x,y`
  (`crates/engine/src/snap.rs`; `docs/gaps.md` U4).
- Command line: prompts with clickable keywords, history (F2), AutoComplete, aliases (`.pgp` +
  ALIASEDIT/REINIT), right-click repeat, transparent commands, `.scr` scripts (SCRIPT command and
  headless) (`crates/engine/src/lib.rs`, `crates/engine/src/cmd/file.rs`,
  `crates/engine/src/cmd/file/pgp.rs`; `docs/customization.md`).
- Grips: hot grips (Space cycles Stretch/Move/Rotate/Scale/Mirror), grip menus, dynamic-block
  reference grips (`crates/engine/src/grips.rs`, `griphot.rs`; `docs/gaps.md` U5, F3).
- Layers/properties: Layers palette + Layer Properties Manager, layer tools, Properties palette,
  linetypes, lineweights, ACI/true colour, transparency, OPTIONS dialog with persisted profiles
  (`crates/engine/src/cmd/layer/`, `crates/ui-egui/src/options/`; `docs/gaps.md` F20).
- Annotation: all DIM* commands with DIMSTYLE variables/overrides and associative dimensions,
  MLEADER (+MLEADEREDIT/ALIGN/COLLECT), TABLE with formulas/TABLEDIT/TABLEEXPORT/CSV data links,
  TOLERANCE feature-control frames, annotative scaling, MTEXT editor with formatting toolbar,
  QuickCalc palette, COMPARE (`crates/engine/src/cmd/annotate*.rs`, `cmd/table/`,
  `crates/engine/src/cmd/tolerance.rs`, `crates/engine/src/cmd/annoscale.rs`, `crates/engine/src/cmd/file/compare.rs`; `docs/gaps.md` F7–F12, F22).
- Hatch/blocks/xrefs: pick-point hatch with islands and HATCHEDIT boundary add/remove, 23-pattern
  library, gradient/solid, BLOCK/INSERT, attributes (+BATTMAN, ATTSYNC, -ATTEDIT, DATAEXTRACTION),
  nested blocks, groups, xrefs (XATTACH/-XREF/XBIND/XOPEN), **Block Editor for static blocks
  (BEDIT/BSAVE/BCLOSE)**, **REFEDIT/REFSET/REFCLOSE in-place edit of block references**, dynamic
  blocks from other files read with editable visibility states/lookups
  (`crates/engine/src/cmd/hatch/`, `cmd/blocks/` incl. `bedit.rs`, `refedit.rs`; `docs/gaps.md` F2,
  F3, F13, F16, F17).
- Layouts/plotting: paper-space layouts, viewports (polygonal/object/clipped, VPCLIP,
  per-viewport layer freeze), MSPACE/PSPACE, page setups, PLOT dialog, Plot Preview, EXPORTPDF,
  PUBLISH (multi-sheet), PDFBOOK (sheet frames to paginated books), plot styles (CTB/STB) and
  plotter devices in CADCraft's own JSON formats (`crates/engine/src/cmd/layout.rs`,
  `plotters.rs`, `crates/engine/src/cmd/exchange.rs`; `docs/plot-styles.md`, `docs/plotters.md`).
- Parametric: geometric + dimensional constraints, AUTOCONSTRAIN, PARAMETERS with expressions,
  re-solve after edits (`crates/constraints`; `docs/geometry-parity.md`).
- AutoLISP: `.lsp` via APPLOAD, `(load)`, drag-and-drop, or the `lisp`/`appload` commands (JSON:
  `{code, inputs?}`); `(defun c:NAME)` commands; `acad.lsp`/`acaddoc.lsp`/`S::STARTUP` from the
  settings `support/` folder; `command`, `entget/entmake/entmod`, `ssget` with filters, `get…`
  input, `vl-*` list/string/catch functions, `tblsearch/tblnext`
  (`docs/autolisp.md`, `crates/engine/src/cmd/lisp.rs`, `crates/engine/src/lisp/`).

### File formats (exact, from code)
- **Open/read**: DXF ASCII R12–2018 (one reader, no version gating) and binary R13+ (R12 binary
  not read); pre-2007 files decode from `$DWGCODEPAGE` (`crates/io/src/lib.rs` `read()`,
  `crates/io/src/dxf_read.rs`, `docs/file-format-parity.md`). DWG R13+ by content magic `AC10xx`
  through the acadrust 0.6.4 bridge (R13/R14 untested; 2000–2018 tested synthetically;
  pre-R13 not read) (`crates/dwg/src/lib.rs` `is_dwg`, `VERSIONS`). SVG and gzipped SVGZ
  (shapes, paths, groups, Inkscape layers; no CSS, `use`, fills, text, images; omissions named in
  a note on open) (`crates/io/src/svg_read.rs`; `docs/gaps.md` FF14).
- **Save/native**: DXF is the native path — ASCII or binary, versions 2000–2018 (default: the
  file's own `$ACADVER`, 2018 for new drawings; binary DXF stays binary on QSAVE). DWG write
  2000+ (floor 2004 unless 2000 is asked for). `.dwt` templates save via SAVEAS; NEW/QNEW accept
  `.dwt`/`.dxf` templates (`crates/io/src/lib.rs` `write_with()`; `docs/file-format-parity.md` FF3).
- **Unmodelled content**: DXF writes back unknown entities/objects, foreign xdata, extension
  dictionaries, reactors, layer states and colour books (#528) — a DXF round trip keeps them.
  **DWG still drops** custom-class entities/objects, xdata on table records and blocks, entity
  colour books and reactors. SAVE/SAVEAS report what the target cannot hold (`notSaved` in the
  result plus a command-line message) (`crates/engine/src/cmd/file.rs` `not_saved_as()`,
  `report_not_saved()`; `docs/gaps.md` top-10 rows 1–2, FF1).
- **Export**: SVG; PNG (2400×1600 via CLI; framed window or extents); vector PDF with embedded
  TrueType text subsets, OCG layers, multi-sheet, hyperlinks and plotted transparency. EXPORT,
  EXPORTPDF, PUBLISH, PDFBOOK commands and `cadcraft-cli convert`
  (`crates/io/src/lib.rs` `write_framed()`, `crates/io/src/pdf.rs`, `crates/engine/src/cmd/exchange.rs`).
- **Import**: another DXF/DWG's objects via `import` (path or base64); user `.lin`/`.pat`/`.pgp`
  files (`crates/engine/src/cmd/exchange.rs`, `crates/engine/src/cmd/file/pgp.rs`; `docs/file-format-parity.md`).

### Automation surfaces (all over the same command registry)
- **MCP server** over stdio: `cadcraft-cli mcp` (headless session) or
  `cadcraft-cli mcp --connect 127.0.0.1:PORT [--lazy] [--launch]` (bridged to the running app;
  `--launch` opens CADCraft on macOS). With `--connect` but no reachable app the CLI exits with an
  error — it never falls back to a separate headless drawing. Tools: `command_line`, `script`,
  `execute`, `list_commands {filter?}`, `inspect_drawing`, `query_entities {selected?, …}`,
  `render {window?}`, `find_text`, `new_drawing`, `open`, `save` (a `.svg`/`.png`/`.pdf` path
  exports), `cancel`, plus `screenshot`/`ui_inspect`/`ui_click` when connected; closed-shape
  facts (area, centroid, self-intersection) via `execute {"command":"shapes"}`; resources
  `cadcraft://drawing`, `cadcraft://commands` (`docs/mcp.md`, `crates/mcp/src/tools.rs`).
- **JSON control channel**: desktop app with `--control PORT` (or `CADCRAFT_CONTROL_PORT`), one
  JSON line per request over `127.0.0.1` (16 connections, 256 MiB per line, 60 s timeout with
  `state: not-run|may-have-run`). 27 top-level methods: `cmdline.input/script/key/state`,
  `engine.execute` (alias `command`), `engine.commands`, `drawing.inspect`, `ui.inspect`,
  `ui.elements`, `ui.menu.list`/`ui.menu.invoke`, `ui.pointer`, `ui.click`, `ui.move`, `ui.drag`,
  `ui.key`, `ui.text`, `ui.set` (palettes, theme, animations, system cursor, default save
  format/version, interface language), `ui.resize`, `ui.focus`, `ui.screenshot`, `ui.render`,
  `app.open`, `app.save`, `app.quit`, `control.methods`, `ping`. Panel docking (`ui.dock`,
  `ui.dock.reset`, panel ids `toolSets`/`layers`/`properties`/`externalReferences`) and
  `entities {selected:true}` run as commands through `engine.execute`
  (`docs/control-protocol.md`, `crates/ui-egui/src/control.rs` METHODS table).
- **CLI** `cadcraft-cli`: `info`, `convert`, `run` (`--script`/`--script-file`/`--cmd`,
  `--save`, `--export`, `--sample`, `--metric`), `commands [FILTER]`, `sample (bracket|floorplan)`,
  `mcp`, `perf [N|FILE]`, `--version` (`apps/cadcraft-cli/src/main.rs` usage string).

### Platform notes
- Native macOS universal app (signed, notarized DMG; CLI in a separate zip); Windows
  x64/arm64/x86 MSI (DirectX 12 default; `WGPU_BACKEND` to override); Linux
  AppImage/Flatpak/deb/rpm/tar (x86_64, aarch64, riscv64); FreeBSD tar (`README.md` Downloads).
- WebAssembly web build runs the same UI (WebGPU, `?webgl` WebGL2 fallback, `?cpu` canvas mode):
  **no DWG**, no autosave, browser downloads instead of files, `?sample`, and a `?host=parent`
  iframe postMessage bridge (`apps/cadcraft-web/src/main.rs`, `host.rs`).
- Interface languages: 16 — English, Ukrainian, Brazilian Portuguese, German, Spanish, Czech,
  Russian, French, Simplified Chinese, Italian, Korean, Swedish, Arabic, Hungarian, Turkish,
  Greek; live switching via `ui.language` (values `auto,en,uk,pt-BR,de,es,cs,ru,fr,zh,it,ko,sv,
  ar,hu,tr,el`). CJK/Arabic/Hangul need an installed matching font. Engine messages and CLI/MCP
  replies stay English (`crates/ui-egui/src/i18n/`, `docs/localization.md`; `docs/gaps.md` L1).
- 3Dconnexion SpaceMouse navigation is built for Windows/Linux; macOS has status/buttons only
  (`apps/cadcraft/src/spacemouse.rs`; `docs/gaps.md` H1).

## Known limitations and not-implemented

Read `docs/gaps.md` (the maintained work list, last updated 2026-10-16) before promising anything.
The high-impact ones for an agent:

- **Saving DWG is lossy.** The acadrust bridge drops custom-class entities/objects, xdata on
  table records and blocks, entity colour books and reactors; DXF keeps them raw. Always check the
  `notSaved` report (`docs/gaps.md` row 1, FF1; `docs/file-format-parity.md`).
- **No real-file corpus and no AutoCAD verification.** All 36 file tests use synthetic input; no
  CADCraft output has been checked in AutoCAD black-box; a 10 MB DWG took ~2 min to fail (#57),
  limits stop runaway conversions but throughput remains (`docs/file-format-parity.md` Tests;
  `docs/gaps.md` FF5/FF6).
- **No 3D at all** — no UCS, 3D views, orbit, solids, surfaces, meshes, sections, visual styles,
  materials, lights, rendering (~150 menu items; 3D parity ≈ 2%). `3DORBIT`/`ATTACH`/`SHARE` are
  registered only to return "not available yet" (`docs/gaps.md` F24;
  `crates/engine/src/cmd/exchange.rs`).
- **Curve geometry is tessellated**: ellipse/spline intersections, offsets, trims and snaps are
  approximations; polyline offsets ignore bulges; tolerances are absolute
  (`docs/geometry-parity.md`; `docs/gaps.md` row 3).
- **XCLIP is missing and xrefs cannot be edited in place** (XOPEN opens the source; REFEDIT works
  on block references only) (`docs/gaps.md` F2).
- **No dynamic-block authoring** (parameters/actions in the Block Editor); references from other
  files can change visibility states/lookups only (`docs/gaps.md` F3).
- **SHX fonts are not parsed** — SHX-style text draws with CADCraft's stroke font or `FONTALT`,
  so metrics differ from AutoCAD; SHX shapes in linetypes are skipped (`README.md` Fonts;
  `docs/gaps.md` FF8/FF9).
- **No PDF import/underlays, no raster image attach/display** (IMAGE entities and definitions
  round-trip but pixels never load), no DWF/DGN/WMF/EPS/ACIS/STL exchange, no DWS standards
  (`docs/gaps.md` FF10/FF11; `docs/file-format-parity.md`).
- **Binary plot files unread**: `.ctb`/`.stb`/`.pc3`/`.pmp` must be recreated in CADCraft's JSON
  formats (`docs/gaps.md` F14, FF9).
- **No autosave and no DWG in the web build**; desktop autosave files are DXF (`.sv$`) plus
  AUDITCTL `.adt` logs (`docs/gaps.md` F4; `crates/engine/src/autosave.rs`,
  `crates/engine/src/cmd/audit.rs`).
- **MTEXT**: existing MTEXT still cannot be re-edited (no DDEDIT/MTEDIT); no fields (FIELD), no
  spell check; stacked fractions show as placeholders (`docs/gaps.md` F9).
- **SETVAR covers ~150 of ~1,000 system variables**; no Sheet Set Manager, eTransmit, Traces,
  CUI(x)/workspaces (`docs/gaps.md` F23, U10, U12).
- **macOS Finder file-association for `.dxf` is broken** (#158); open files positionally or via
  File > Open (`docs/gaps.md` P3/U13).
- **No CI runs the test suite on PRs** (`docs/gaps.md` S1) — treat green CI as packaging lints.
- **Claimed but unverified (static reading only — no runtime check was possible):** README's
  interactive-feel claims (AutoComplete, right-click-repeat behaviour), "every arrowhead" and
  associative dimensions, MTEXT bidi/OpenType shaping for Arabic-script text (code paths and
  catalogs exist; exact behaviour needs a run), and per-language font availability. Uncertain:
  web plot-raw-PDF-bytes bug (#134, `docs/gaps.md` S4/P1), Windows/Linux runtime robustness
  (P2). Anything absent from both code and `docs/gaps.md` should also be treated as
  claimed-but-unverified.

## How to operate

**Launch (macOS).** The bundle's GUI binary is `/Applications/CADCraft.app/Contents/MacOS/CADCraft`;
launch with `open -a "CADCraft"`. Start flags (`apps/cadcraft/src/main.rs`): `--control <port>`,
`--sample`, `--version`/`-V`, and positional drawing paths (each opens; prefer this over Finder
drag, see P3). CADCraft's own MCP `--launch` uses `open -a CADCraft --args --control PORT`
(`crates/mcp/src/backend.rs`). The bundle contains **no CLI binary** — get `cadcraft-cli` from the
release zip `cadcraft-cli-<ver>-macos-universal.zip` (`packaging/macos/package.sh`).

Environment variables that matter: `CADCRAFT_CONTROL_PORT`, `CADCRAFT_CONFIG_DIR` (isolated
profile; an explicitly empty value disables workspace persistence), `RUST_LOG` (e.g.
`cadcraft_engine=debug` logs every command-line message), `CADCRAFT_LOCALE`,
`CADCRAFT_SYSTEM_CURSOR=1`, `CADCRAFT_FONTALT`/`CADCRAFT_FONTFALLBACK`, `CADCRAFT_VSYNC`,
`CADCRAFT_NO_NATIVE_MENU` (macOS), `WGPU_BACKEND` (Windows troubleshooting) (`apps/cadcraft/src/
main.rs`, `README.md`).

**Settings/state (macOS).** `~/Library/Application Support/CADCraft/` holds `logs/cadcraft.log`
(rotates two deep, 16 MiB cap), `autosave/` (`.sv$` DXF drawings), `support/` (AutoLISP startup
files), and `workspace.json` (panel docking); the profile lives in eframe storage
(`apps/cadcraft/src/main.rs` `config_dir`, `apps/cadcraft/src/workspace.rs`,
`docs/control-protocol.md`).

**Document model.** One window, many drawings: each open drawing is a document with its own file
tab and model/paper spaces; `document.switch {index}` switches, `close {index}`/`closeall` close
with the unsaved-changes prompt; the canvas is protected from docking; panels (Tool Sets, Layers,
Properties, External References, QuickCalc) dock, float and persist
(`crates/engine/src/cmd/file.rs`, `crates/ui-egui/src/menus.rs`, `docs/control-protocol.md`
"Panel docking").

**Keyboard shortcuts (from source — do not invent others).** Engine
(`crates/engine/src/cmd/*.rs` `.key()`): Cmd+N new, Cmd+O open, Cmd+S save, Cmd+Shift+S save as,
Cmd+W close, Cmd+P plot, Cmd+Z/Cmd+Shift+Z undo/redo, Cmd+C/V/X clipboard, Cmd+Shift+C copy with
base point, Cmd+Shift+V paste as block, Cmd+A select all, Cmd+Shift+A PICKSTYLE, Delete clear
selection, F3 osnap, F5 isoplane, F7 grid, F8 ortho, F9 snap, F10 polar, F11 object snap
tracking, F12 dynamic input. UI-only (`crates/ui-egui/src/menus.rs` UI_COMMANDS): Cmd+1
Properties, Cmd+3 Tool Sets, Cmd+8 QuickCalc, Cmd+9 command line, F1 command reference, F2
command history, Cmd+Q quit.

**Open/save/export flow.** The Open dialog filters DWG/DXF/DWT and SVG/SVGZ (`services()`,
`apps/cadcraft/src/main.rs`); the Save dialog offers DXF, DWG, DWT, SVG, PNG, PDF with the
suggested name's type first (`filters_for_save`). QSAVE/SAVE (Cmd+S) writes the drawing's own
format/version; SAVEAS `{path, version?: 2000|2004|2007|2010|2013|2018, binary?: bool}`; File >
Default Save Format/Version sets the default for new drawings; `document.bytes {format, version,
binary}` returns base64 bytes without touching a file. EXPORT writes dxf|dwg|svg|png|pdf;
PLOT/EXPORTPDF write PDF through the plotter; PUBLISH one PDF per sheet; PDFBOOK builds ISO
A-series books from frame polylines. In the web build, saves are downloads; there is no file
system and no DWG (`apps/cadcraft-web/src/main.rs`).

**Headless CLI (what an agent will use most).**
```sh
cadcraft-cli info drawing.dxf                       # JSON summary: counts, extents, layers, styles…
cadcraft-cli convert drawing.dxf out.svg            # dxf|dwg|svg|png|pdf; PNG is 2400×1600
cadcraft-cli convert drawing.dwg detail.png --window 0,0,20000,15000   # frame a rectangle
cadcraft-cli run --sample --script 'CIRCLE 22,3 1\n' --save out.dxf --export out.png
cadcraft-cli run drawing.dxf --script-file setup.scr --save out.dxf
cadcraft-cli run drawing.dxf --cmd 'zoom {"mode":"object"}' --export sel.png
cadcraft-cli commands dim                           # command catalog (JSON), filtered
cadcraft-cli sample floorplan out.dxf               # built-in sample drawings
cadcraft-cli mcp --connect 127.0.0.1:7979           # bridge MCP to the running app
```
Framing rules: `convert` fits model-space extents; `run --export` uses the current view only if a
command changed it (`zoom`, `pan`, `view.set`), else extents; `--window x0,y0,x1,y1` shows exactly
that rectangle; `--view extents|current` forces one. CLI PNG/SVG/PDF always render **model space**
(`apps/cadcraft-cli/src/main.rs`, `crates/io/src/lib.rs`).

**Command-first workflow.** Anything the UI can do is a command: `engine.execute {command, params}`
runs the JSON form with no dialogs; typing (`cmdline.input`) drives the interactive prompt
machines exactly like a user (spaces act as Enter; empty text is Enter). A refused command-line
line still replies `ok: true` — check the `error` field. Errors inside a command never take the
app down (panic guard in `crates/engine/src/guard.rs`; `Session::execute` restores the drawing).

## Working with an AI agent

Legitimate and reliable:

- **Prefer the headless surfaces**: `cadcraft-cli` for one-shot work and verification, MCP
  (headless or bridged) for interactive sessions, the control channel when a human is watching
  the same window. Do not drive the GUI blindly; `ui.screenshot` needs a presented frame, so on a
  locked screen use `ui.render` or the CLI (`docs/control-protocol.md`).
- **Author drawings programmatically**: `engine.execute` per entity, or a `.scr` script /
  `cadcraft-cli run --script-file`, is far more reliable than pointer simulation. Read back with
  `drawing.inspect`/`query_entities` (handles + geometry; `selected:true` reads the current
  selection), `texts` for room labels/titles, `shapes` for areas/centroids, and eyeball with
  `render`.
- **Prepare/convert inputs**: `convert` turns DXF↔DWG↔SVG/PNG/PDF; SVG from design tools imports
  as paths/groups; generate drawings with `run --save`. Check `info`'s JSON before assuming
  contents.
- **Interpret and repair project files**: DXF is a documented text format mapped by
  `crates/io/src/dxf_read.rs`/`dxf_write.rs`; CADCraft-specific data (constraints, associativity,
  table flags) travels in xdata under CADCraft's app name (`crates/io/src/dxf_ext.rs`). For
  damaged drawings use AUDIT/RECOVER; crash autosaves are `.sv$` DXF files listed by
  DRAWINGRECOVERY (`crates/engine/src/cmd/audit.rs`, `crates/engine/src/autosave.rs`).
- **Verify exports before reporting success**: re-open the saved file (`cadcraft-cli info`, or
  `open` + `drawing.inspect`), compare entity counts/extents, and check the `notSaved` report on
  every DWG save. `render`/`convert` to PNG lets you look at the result.
- **Report commands with their exact ids** from `engine.commands`/`cadcraft-cli commands` — ids
  are AutoCAD command names lower-cased (`crates/engine/src/cmd/mod.rs`).

What an agent must NOT do:

- Assume DWG saves round-trip losslessly, or that AutoCAD will open CADCraft output cleanly —
  nobody has verified that (see gaps). Keep an untouched copy of every received file; prefer DXF
  when the user's tooling allows it.
- Assume 3D, UCS, PDF underlays, raster image display, SHX metrics, dynamic-block authoring,
  xref clipping, Visual LISP/DCL/reactors, fields or CUI exist. Check `docs/gaps.md` first.
- Invent shortcuts, menu paths, flags or format names: only what is in `CommandSpec`
  (`crates/engine/src/cmd/`), `UI_COMMANDS` (`crates/ui-egui/src/menus.rs`) and the CLI usage
  string exists.
- Edit `.dwg` bytes or expect a CADCraft-proprietary project format — there is none; the drawing
  *is* the DXF/DWG.
- Trust it for production/concurrent work: pre-alpha, no PR CI, known correctness issues
  (`docs/gaps.md` Stability).

## Verification protocol

1. Work throwaway-first: `cadcraft-cli sample bracket scratch/t.dxf` (or `run --metric`), draw, save
   to a scratch path, re-open, inspect, delete. Never test on the only copy of a real drawing.
2. After every save, assert on the result: the `notSaved` field / command-line warning must be
   absent (it appears when the target format drops content), and `drawing.inspect`'s `skipped`
   count must be 0 after reading (records the reader could not place; `cadcraft-cli convert`
   prints the same as "records could not be read"). A silent export is not a verified export —
   `crates/engine/src/cmd/file.rs`, `crates/engine/src/cmd/inquiry.rs`, `apps/cadcraft-cli/src/main.rs`.
3. Round-trip discipline: new → edit → save → close → reopen → compare counts/extents/layers;
   then export to PNG/SVG and look at it. For CAD-interchange files, when the user has AutoCAD or
   another viewer, open the file there too — CADCraft cannot yet promise interoperability.
4. Version and back up: keep each session's output under a new name or in version control; the
   desktop app has SAVETIME autosave, Drawing Recovery, AUDIT and RECOVER, but the web build has
   none, and DWG saves can drop unmodelled content.
5. Update CADCraft only between projects (launcher auto-updates), and re-check this skill's
   claims when the version moves — this skill describes v0.10.0.

## Sources & evidence

- Repo: https://github.com/storytold/cadcraft (clean-room, MIT OR Apache-2.0).
- Inspected at tag `v0.10.0`, commit `e86eacf094fefda1cdb6ba5137a336f29deb5d99` ("Release
  0.10.0"), on 2026-10-22. The released CLI reports `cadcraft 0.10.0 (e86eacf…)`. The launcher
  auto-updates, so **verify against your installed version**.
- Key files read: `README.md`, `ROADMAP.md`, `Cargo.toml`, `AGENTS.md`; `docs/gaps.md`,
  `docs/file-format-parity.md`, `docs/control-protocol.md`, `docs/mcp.md`, `docs/autolisp.md`,
  `docs/customization.md`, `docs/architecture.md`, `docs/parity-checklist.md`,
  `docs/localization.md`, `docs/roadmap.md`, `docs/geometry-parity.md`; `apps/cadcraft-cli/src/main.rs`,
  `apps/cadcraft/src/main.rs`, `apps/cadcraft-web/src/main.rs`; `crates/io/src/lib.rs`,
  `crates/dwg/src/lib.rs`, `crates/engine/src/cmd/{mod,file,exchange,layout,lisp,audit,settings,
  edit,inquiry}.rs`, `crates/engine/src/cmd/file/pgp.rs`, `crates/engine/src/cmd/blocks/{bedit,
  refedit}.rs`, `crates/engine/src/snap/tracking.rs`, `crates/ui-egui/src/menus.rs`,
  `crates/ui-egui/src/control.rs`, `crates/ui-egui/src/i18n/mod.rs`, `crates/mcp/src/tools.rs`,
  `crates/engine/src/autosave.rs`, `packaging/macos/package.sh`.
- Shared libraries consulted: `storytold/craft-libs` (`craft-ui` docking/buttons,
  `craft-docpath` path policy for xrefs/data links — pinned git deps in `Cargo.toml`).
- No build or run was performed for this document (read-only inspection). Cross-check
  `evidence.md` for the claim-by-claim tiering (implemented / partial / claimed).
