DxfSAFE
Give your agent CAD superpowers.
Overview
Give your agent CAD superpowers.
a4e76f7a9aeeOBSERVED · 2026-10-23What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
name: dxf
description: Generate, regenerate, and validate 2D DXF drawings from Python build123d sources. Use for DXF files, `.py` drawing scripts, @dxf models, 2D profiles, outlines, templates, gaskets, panels, flat patterns, laser/plasma/waterjet cut layouts, and 2D drawing exports of CAD geometry. Open and visually review existing DXF files in CAD Viewer.
license: MIT
---
# DXF generation and validation
Provenance: maintained in [earthtojake/text-to-cad](https://github.com/earthtojake/text-to-cad).
Use the installed local skill files as the runtime source of truth; the
repository link is only for provenance and release review.
## Setup
Run cadgen through [uv](https://docs.astral.sh/uv/), so this skill's commands share
one installation, and its warm build daemon, with the CAD app's server:
- `cadgen` below means `uvx --no-config --managed-python --python 3.13 --from cadgen==0.7.26 cadgen`
- `python` below means `uvx --no-config --managed-python --python 3.13 --from cadgen==0.7.26 python`
The first run downloads that installation and the first snapshot its headless
browser; later runs reuse both.
`cadgen doctor <skill-dir>` reports the installation in use and checks that it is
the one this skill pins, and that the CAD kernel loads; use it for installation or
kernel load errors.
Drawings are build123d geometry, so a drawing build loads the CAD kernel like a
STEP build does (~2.5s cold; the warm daemon absorbs it on re-runs).
`cadgen dxf snapshot` needs no Node at all: it flattens the drawing with `ezdxf`
(which arrives with cadgen) and paints it in the bundled headless browser.
## Purpose
Create or modify 2D DXF drawings from natural-language requirements or from CAD
geometry, generate validated drawing artifacts, and return checked outputs. A
DXF drawing's source of truth is a Python file named `<name>.py` defining one
parameterless `@dxf` model function.
**A drawing is a model.** It has the same wrapper, record, freshness gate and
build job a `@step` part has; its one output is the `.dxf` file; it has no
geometry tree (nothing links to a drawing). Every run writes the sibling
`<name>.dxf` (or the `out=` the decorator names); an unchanged source is a
no-op; a drawing that calls a part model — `bracket()` inside its body — is
stale whenever that part's GEOMETRY changes and current when it does not;
`cadgen store why <drawing>.py` explains the verdict; `--force` rebuilds it
anyway. The CAD Viewer and `dxf snapshot` read the `.dxf` file itself, so the
file you hand a cutting service, the file the viewer draws and the file a
snapshot renders are one and the same.
## The contract
**A `@dxf` function takes no parameters and returns build123d 2D geometry. The
engine writes the DXF.** You never construct a document, name a file, or place
an entity — the same division of labor `@step` has.
```python
from cadgen import build123d as bd
from cadgen import dxf
HOLE_D = 4.5
@dxf
def gasket():
with bd.BuildSketch() as cut:
bd.Rectangle(60, 40)
bd.Circle(HOLE_D / 2, mode=bd.Mode.SUBTRACT)
return cut.sketch # bare shape -> the CUT layer
if __name__ == "__main__":
gasket()
```
- **Bare shape** → one `CUT` layer. That is the whole contract for most drawings.
- **`{layer: shape}`** → named layers, when the drawing genuinely has more than
one CAM operation (`CUT` / `ENGRAVE` / `SCORE`). A `Compound` whose children
are all labelled means the same thing.
- **No parameters.** Dimensions are module constants (`HOLE_D = 4.5`) or
constants imported from the part the drawing derives from; a different
drawing is a different file.
- **Text** is `bd.Text(...)` engraved OUTLINES on a marking layer, never a DXF
`TEXT` entity: cut and marking toolchains consume geometry, and font rendering
inside CAM is unreliable.
- **Geometry must lie in the XY plane.** A face taken from a solid sits at that
solid's height; relocate it (`flatten.flatten_face(face)`, or
`bd.Location((0, 0, -z)) * face`). The engine REFUSES off-plane geometry rather
than silently writing its XY shadow.
- **Output bytes are a function of the geometry.** Layers are sorted by name and
entities by geometric content, so an unchanged drawing rebuilds to an identical
file, cold or warm, on any machine.
## The three DXF workflows
Copy the full template for the applicable workflow from
`references/generator-templates.md` when creating a new drawing.
1. **Drafted from scratch** (gaskets, panels, templates, cut layouts with no 3D
model behind them): a `<name>.py` that builds sketches and returns them.
2. **Flat pattern of a generated STEP part**: a drawing script beside the model
it derives from, with its OWN stem (one model per file — `bracket_drawing.py`
beside `bracket.py`). Import the model and call it, exactly as an assembly
composes a child: importing never builds, and inside the drawing's build the
call returns the part's geometry (building the part first if it is stale).
```python
from cadgen import dxf, flatten
from bracket import bracket # a child: tracked by its RESULT
KERF = 0.15
@dxf
def bracket_drawing():
return flatten.flat_pattern(bracket(), coordinate=3.0, kerf=KERF)
if __name__ == "__main__":
bracket_drawing()
```
The drawing's record pins the part's tree, so a part edit that changes its
geometry makes the drawing stale, and one that does not (a comment, a
refactor, a colour) leaves it current. Constants imported from the part
(`from bracket import THICKNESS`) are tracked by value the same way.
3. **Flat pattern of an imported STEP** (a `.step`/`.stp` with no Python source):
read it with `cadgen.read_step` (warm from the store, the same geometry as
`build123d.import_step`). Like every file a build reads, it is an input:
replacing the vendor STEP makes the drawing stale on its own, with no `--force`.
```python
from pathlib import Path
from cadgen import dxf, flattTrust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | NA |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (0)
No findings outside the package's declared scope.
Gates applied: no_behavioural_pass.
a4e76f7a9aeefull audit observations/trust-audit/skill/earthtojake__dxf.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-23 | a4e76f7a9aee | SAFE | B | 89 | first audit |
Questions
What does the dxf — earthtojake/text-to-cad skill do?
Give your agent CAD superpowers.
Is dxf — earthtojake/text-to-cad safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can dxf — earthtojake/text-to-cad access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
What do I need installed to use dxf — earthtojake/text-to-cad?
Its own instructions reference ezdxf. Dependencies are pinned to exact versions.
How current is this page?
The grade is for one exact copy of the source (a4e76f7a9aee), read on 2026-10-23. The repository is watched, and a new audit runs when it changes — this is the first audit.
Add this badge to your README
Shows this page's audit result and links back to it. It updates when the audit does.
[](https://modelsatlas.com/skills/earthtojake/dxf/)
Not your listing, or something out of date? Claim or update your listing.