dxf
Skill17k starsChanged 58 days agoMITView on GitHub
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.
2 other projects use a version of this, 2 of them edited.
Trending
More talk lately.about the whole repository
Most recently taken up by
- saint0x/my-skillsedited, first seen Aug 29, 2026
- tlinedeep/claude-skillsedited, first seen Jun 3, 2026
Who's talking about earthtojake/text-to-cad
- A Hacker News story“Text-to-CAD”Hacker News · May 1, 2026 · 186 points
- @camilleroux.com“Text-to-CAD open source : décrivez une pièce ou un mécanisme en langage naturel, laissez un agent (Codex, …”Bluesky · May 18, 2026 · 14 likes
- @davepentecost.bsky.social“github.com/earthtojake/...”Bluesky · Jul 28, 2026 · 2 likes
- A Hacker News story“Text-to-CAD: Generate 3D models with coding agents (open source)”Hacker News · Apr 29, 2026 · 2 points
- @agentpalisade.bsky.social“text-to-cad is a library of eleven agent skills that turn a coding agent into a CAD engineer, carrying a …”Bluesky · Jul 31, 2026 · 1 likes
The biggest 5 of 61 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 61
Talked about on GitHub, Bluesky and Hacker News (61 times).
On GitHub · 50
- Nov 2, 2026vendor: pull text-to-cad 5efa85a9 — gurul/gencad0 reactions
- Nov 2, 2026agent-skills.github.earthtojake.text-to-cad: 0.8.4 → 0.10.0 — sudosubin/agents.nix0 reactions
- Nov 2, 2026claude-code-marketplaces.github.earthtojake.text-to-cad: 0.8.4 → 0.10.0 — sudosubin/agents.nix0 reactions
- Nov 2, 2026codex-plugins.github.earthtojake.text-to-cad: 0.8.4 → 0.10.0 — sudosubin/agents.nix0 reactions
- Nov 2, 2026agent-plugins.github.earthtojake.text-to-cad: 0.8.4 → 0.10.0 — sudosubin/agents.nix0 reactions
45 more on GitHub
- Nov 2, 2026claude-code-plugins.github.earthtojake.text-to-cad: 0.8.4 → 0.10.0 — sudosubin/agents.nix0 reactions
- Nov 1, 2026Upstream updates to review — MoradDev/skills-unified0 reactions
- Oct 31, 2026PEP 541 Request: cad — pypi/support0 reactions · 1 comment
- Oct 30, 2026agent-plugins.github.earthtojake.text-to-cad: 0.8.3 → 0.8.4 — sudosubin/agents.nix0 reactions
- Oct 30, 2026claude-code-plugins.github.earthtojake.text-to-cad: 0.8.3 → 0.8.4 — sudosubin/agents.nix0 reactions
- Oct 30, 2026agent-skills.github.earthtojake.text-to-cad: 0.8.3 → 0.8.4 — sudosubin/agents.nix0 reactions
- Oct 30, 2026claude-code-marketplaces.github.earthtojake.text-to-cad: 0.8.3 → 0.8.4 — sudosubin/agents.nix0 reactions
- Oct 30, 2026codex-plugins.github.earthtojake.text-to-cad: 0.8.3 → 0.8.4 — sudosubin/agents.nix0 reactions
- Oct 30, 2026Roadmap: Shaderera inside Claude and ChatGPT (not now) — shaderera/shaderera0 reactions
- Oct 30, 2026agent-plugins.github.earthtojake.text-to-cad: 0.8.2 → 0.8.3 — sudosubin/agents.nix0 reactions
- Oct 30, 2026claude-code-plugins.github.earthtojake.text-to-cad: 0.8.2 → 0.8.3 — sudosubin/agents.nix0 reactions
- Oct 30, 2026agent-skills.github.earthtojake.text-to-cad: 0.8.2 → 0.8.3 — sudosubin/agents.nix0 reactions
- Oct 30, 2026claude-code-marketplaces.github.earthtojake.text-to-cad: 0.8.2 → 0.8.3 — sudosubin/agents.nix0 reactions
- Oct 30, 2026codex-plugins.github.earthtojake.text-to-cad: 0.8.2 → 0.8.3 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-plugins.github.earthtojake.text-to-cad: init at 0.8.2 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-marketplaces.github.earthtojake.text-to-cad: 0.8.1 → 0.8.2 — sudosubin/agents.nix0 reactions
- Oct 28, 2026agent-skills.github.earthtojake.text-to-cad: 0.8.1 → 0.8.2 — sudosubin/agents.nix0 reactions
- Oct 28, 2026codex-plugins.github.earthtojake.text-to-cad: 0.8.1 → 0.8.2 — sudosubin/agents.nix0 reactions
- Oct 28, 2026agent-plugins.github.earthtojake.text-to-cad: 0.8.1 → 0.8.2 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-marketplaces.github.earthtojake.text-to-cad: init at 0.8.1 — sudosubin/agents.nix0 reactions
- Oct 27, 2026agent-skills.github.earthtojake.text-to-cad: 0.8.0 → 0.8.1 — sudosubin/agents.nix0 reactions
- Oct 27, 2026codex-plugins.github.earthtojake.text-to-cad: 0.8.0 → 0.8.1 — sudosubin/agents.nix0 reactions
- Oct 27, 2026agent-plugins.github.earthtojake.text-to-cad: 0.8.0 → 0.8.1 — sudosubin/agents.nix0 reactions
- Oct 27, 2026codex-plugins.github.earthtojake.text-to-cad: 0.7.26 → 0.8.0 — sudosubin/agents.nix0 reactions
- Oct 27, 2026agent-plugins.github.earthtojake.text-to-cad: 0.7.26 → 0.8.0 — sudosubin/agents.nix0 reactions
- Oct 27, 2026agent-skills.github.earthtojake.text-to-cad: 0.7.26 → 0.8.0 — sudosubin/agents.nix0 reactions
- Oct 26, 2026vendor: pull text-to-cad 2f793659 — gurul/gencad0 reactions
- Oct 23, 2026Epic: Scan a broken part, get replacement CAD — zeketx/sidekick-mechanic0 reactions
- Oct 23, 2026Epic: Photo part ID with a 3D view and the manual page — zeketx/sidekick-mechanic0 reactions
- Oct 23, 2026Epic: "Make me this part" chat tool (text to CAD: STEP, STL, drawing) — zeketx/sidekick-mechanic0 reactions
- Oct 20, 2026codex-plugins.github.earthtojake.text-to-cad: 0.7.25 → 0.7.26 — sudosubin/agents.nix0 reactions
- Oct 20, 2026agent-plugins.github.earthtojake.text-to-cad: 0.7.25 → 0.7.26 — sudosubin/agents.nix0 reactions
- Oct 20, 2026agent-skills.github.earthtojake.text-to-cad: 0.7.25 → 0.7.26 — sudosubin/agents.nix0 reactions
- Oct 20, 2026agent-plugins.github.earthtojake.text-to-cad: 0.7.24 → 0.7.25 — sudosubin/agents.nix0 reactions
- Oct 20, 2026agent-skills.github.earthtojake.text-to-cad: 0.7.24 → 0.7.25 — sudosubin/agents.nix0 reactions
- Oct 20, 2026codex-plugins.github.earthtojake.text-to-cad: 0.7.24 → 0.7.25 — sudosubin/agents.nix0 reactions
- Oct 19, 2026vendor: pull text-to-cad b316da8f — gurul/gencad0 reactions
- Oct 18, 2026codex-plugins.github.earthtojake.text-to-cad: 0.7.22 → 0.7.24 — sudosubin/agents.nix0 reactions
- Oct 18, 2026agent-plugins.github.earthtojake.text-to-cad: 0.7.22 → 0.7.24 — sudosubin/agents.nix0 reactions
- Oct 18, 2026agent-skills.github.earthtojake.text-to-cad: 0.7.22 → 0.7.24 — sudosubin/agents.nix0 reactions
- Oct 18, 2026agent-plugins.github.earthtojake.text-to-cad: 0.7.21 → 0.7.22 — sudosubin/agents.nix0 reactions
- Oct 18, 2026agent-skills.github.earthtojake.text-to-cad: 0.7.21 → 0.7.22 — sudosubin/agents.nix0 reactions
- Oct 18, 2026codex-plugins.github.earthtojake.text-to-cad: 0.7.21 → 0.7.22 — sudosubin/agents.nix0 reactions
- Oct 13, 2026codex-plugins.github.earthtojake.text-to-cad: 0.7.15 → 0.7.21 — sudosubin/agents.nix0 reactions
- Oct 13, 2026agent-plugins.github.earthtojake.text-to-cad: init at 0.7.21 — sudosubin/agents.nix0 reactions
On Bluesky · 9
- May 18, 2026Text-to-CAD open source : décrivez une pièce ou un mécanisme en langage naturel, laissez un agent (Codex, Claude Code) générer les fichiers… — @camilleroux.com14 likes and reposts · 1 reply
- Jul 28, 2026github.com/earthtojake/... — @davepentecost.bsky.social2 likes and reposts · 2 replies
- Jul 31, 2026text-to-cad is a library of eleven agent skills that turn a coding agent into a CAD engineer, carrying a plain-language request from STEP… — @agentpalisade.bsky.social1 likes and repost
- Jul 30, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earthtojake / text-to-cad ⭐ 11,679 (+477) 🗒 JavaScript A collection of agent skills for CAD,… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Jul 25, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 earthtojake / text-to-cad ⭐ 10,288 (+555) 🗒 JavaScript A collection of agent skills for CAD,… — @github-trending-js.bsky.social1 likes and repost · 1 reply
4 more on Bluesky
- Jul 22, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earthtojake / text-to-cad ⭐ 8,784 (+297) 🗒 JavaScript A collection of agent skills for CAD,… — @github-trending.bsky.social1 likes and repost · 1 reply
- Jul 21, 2026今日のGitHubトレンド earthtojake/text-to-cad CAD、ロボティクス、およびハードウェア設計を行うAIエージェント向けのスキルライブラリです。 CADデータの生成、検査、調達、スライス、受け渡しなどの機能をエージェントに提供することを目的としています。 — @dailygithubtrends.bsky.social1 likes and repost
- Aug 8, 2026公式GitHubを確認。これはかなり堅い。CADを会話だけで終わらせず、ソース管理されたファイルとして編集し、STEP/STL/URDF/SRDF/SDFやG-codeまで明示的に出力・閲覧する技能群。… — @nemu-echosphere.bsky.social0 likes and reposts · 1 reply
- May 25, 2026CAD SKILLS: Generate CAD in AI agents like Codex and Claude Code. 100% open source, runs locally, free forever. 开源生成 CAD 文件的代理模型 - 支持导出… — @maoguofang.bsky.socialsays it tested it0 likes and reposts · 2 replies
On Hacker News · 2
- May 1, 2026Text-to-CAD186 points · 48 comments
- Apr 29, 2026Text-to-CAD: Generate 3D models with coding agents (open source)2 points
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- saint0x/my-skills★ 125% same
- tlinedeep/claude-skills★ 090% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bambu-labsSkill
- cadSkill
- dfam-checkSkill
- dfmSkill
- engineering-drawingSkill
- gcodeSkill
- sdfSkill
- sendcutsendSkill
- srdfSkill
- step-partsSkill
- urdfSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use the installed local skill files as the runtime source of truth.
- Distinctive: line 15
Run cadgen through uv, so this skill's commands share one installation, and its warm build daemon, with the CAD app's server:
- Distinctive: line 35
Create or modify 2D DXF drawings from natural-language requirements or from CAD geometry, generate validated drawing artifacts, and return …
- Distinctive: line 176
Use this skill when the user asks for DXF files, 2D drawings, profiles, outlines, templates, gaskets, panels, flat patterns, or cut layouts …
- Very specific: line 180
Use $cad for the 3D part or assembly a DXF derives from.
- Distinctive: line 185
Use these defaults unless the user specifies otherwise:
- Very specific: line 228
Use the active project Python interpreter.
- Very specific: line 284
No CLI inspects an existing .dxf.
- Very specific: line 292
Write or edit the <name>.py source with meaningful dimensions as named constants, reusing the model's geometry helpers instead of …
- Very specific: line 293
Run each drawing script directly (python <drawing>.py).
- Very specific: line 307
If your tools include cad_show (your host may prefix it), use it with the file's absolute path, and follow its description for when to call …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.
Files
DXF generation and validation
Provenance: maintained in 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, so this skill's commands share one installation, and its warm build daemon, with the CAD app's server:
cadgenbelow meansuvx --no-config --managed-python --python 3.13 --from cadgen==0.7.14 cadgenpythonbelow meansuvx --no-config --managed-python --python 3.13 --from cadgen==0.7.14 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.
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
CUTlayer. 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). ACompoundwhose 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 DXFTEXTentity: 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), orbd.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.
- Drafted from scratch (gaskets, panels, templates, cut layouts with no 3D
model behind them): a
<name>.pythat builds sketches and returns them. 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.pybesidebracket.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).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.Flat pattern of an imported STEP (a
.step/.stpwith no Python source): read it withcadgen.read_step(warm from the store, the same geometry asbuild123d.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.from pathlib import Path from cadgen import dxf, flatten, read_step _HERE = Path(__file__).resolve().parent KERF = 0.15 @dxf def panel_flat(): panel = read_step(_HERE / "imported" / "vendor_panel.step") # recorded input return flatten.flat_pattern(panel, coordinate=3.0, kerf=KERF) if __name__ == "__main__": panel_flat()Never read a STEP this project generates. Reading the
.stepa@stepmodel writes is not a loop, it is a drawing whose input changes on every run of the model: the freshness gate can never say "current", every build is a full rebuild, and the flat pattern depends on what the last run left on disk. Keep source STEPs in animported/directory beside the drawing, committed like any other input — input path and output path being different files is the whole rule. For a STEP this project DOES generate, use workflow 2 instead: import the model script and call it, which is tracked by result and never touches an artifact.
One model per file is the recommendation, and a drawing gets its own script:
a file MAY declare several models — two @dxf drawings, or a @dxf beside a
@step — and each is its own record, output and job (a sole model writes
<file>.dxf; models sharing a file write <function>.dxf), but they share the
file's closure, so editing one rebuilds them all. A drawing composes models,
never the reverse: calling a @dxf function from a @step body is just its 2D
geometry and links nothing. The viewer catalog is artifacts-only: scripts never
list; the .dxf the run writes is the entry the viewer renders.
Use this skill when
Use this skill when the user asks for DXF files, 2D drawings, profiles, outlines, templates, gaskets, panels, flat patterns, or cut layouts for laser, plasma, waterjet, or CNC routing.
Use $cad for the 3D part or assembly a DXF derives from. Use $sendcutsend for
SendCutSend-specific upload preflight.
Defaults
Use these defaults unless the user specifies otherwise:
- Units: millimeters. The engine sets them; a drawing never declares units.
- Geometry lives at 1:1 scale in the XY plane.
- Cut profiles close. Open contours belong on bend/engrave/reference layers — generation validation enforces this (see Validation).
- For CAD-backed parts, derive contours from the real topology with
cadgen.flattenrather than redrawing them:planar_facesselects,flatten_facelays a face into XY exactly,union_facesfuses, andflat_patterndoes all of it in one call. Hand-drawn parametric outlines only when there is no reliable 3D topology. - Kerf / tool-radius compensation is
flatten.offset_profile(shape, amount)orflat_pattern(..., kerf=...); never hand-offset coordinates. - Curves stay curves. The union and the offset are exact OCC operations, so a
filleted corner exports as an
ARCand a hole as aCIRCLE, kerf included. A profile that comes out as hundreds of shortLINEs means something fell back to the sampled path — investigate rather than accept it. - Layers carry intent: keep cut geometry and bend/fold lines on separate layers, and include "bend" in bend-layer names so downstream tools classify them as bends rather than cuts.
- DXF layers are drawing structure, not STEP part/assembly structure.
Tool
python <drawing>.py [flags] # its __main__ calls the @dxf model, which writes the .dxf
cadgen dxf snapshot <drawing.dxf> <file.png> # render it
cadgen store why <drawing>.py # why the drawing is stale or currentRunning the script (its __main__ call) is the only door. There is no
cadgen dxf build: a .dxf has no derived state a command must materialize —
the file IS the product, and both the CAD Viewer and dxf snapshot draw it
straight from its own bytes. The drawing's gate makes a rebuild cheap: an unchanged
source whose .dxf still verifies and whose part children are unchanged is a
no-op, and --force rebuilds anyway. The bytes are a function of the
drawing's GEOMETRY, so a cold run and a warm daemon worker write the same
file. Builds never wait on or cancel one another; a drawing that calls parts
builds them in parallel like any parent.
An imported .dxf needs nothing at all — hand it straight to snapshot or the
Viewer.
Use the active project Python interpreter; treat python as an interpreter
placeholder, and use --help for the full interface. Target paths resolve from
the command's current working directory; run from the workspace that owns the
artifacts with cwd-relative target paths. Keep a drawing script in the same
directory as the geometry it derives from, named <name>.py.
Flags (a model script runs itself; there is no generation CLI):
--force— regenerate even when the recorded output is current.--verbose,--json.
A run answers on stdout exactly as a STEP model's does — built DXF/plate_drawing.dxf
or current DXF/plate_drawing.dxf — with progress on stderr; --json makes the
result one JSON line (outcome, document, and tree, which is null for a
drawing) and the progress one JSON line per transition.
One script, one drawing: run each script you want built. Do not put output paths
in the @dxf function's return value; out= on the decorator is the only
place a drawing names its destination (relative to the script).
cadgen dxf snapshot draws a drawing flat, to a PNG still — the same picture
the CAD Viewer shows, from the same flattening, through the same drawing code:
cadgen dxf snapshot path/to/imported.dxf review.png
cadgen dxf snapshot path/to/drawing.dxf review.png --appearance darkIt takes the .dxf document only — a model script is refused by name (run
python <drawing>.py, then snapshot the drawing it wrote). The whole drawing is
fitted to the image and painted head on, in the pens the file declares; an
entity with no pen of its own (ACI 7) takes the appearance's foreground on its
background. The command flattens the drawing with ezdxf and renders it through
the shared snapshot CLI (cadgen.snapshot_cli) and the same headless browser
runtime every rendering skill uses.
OUT — the second positional — is written exactly as given, with a relative path resolved against the
current working directory. The target is deleted before the render starts and the
finished image is written atomically, so: reuse one name while iterating (every read
is provably the render you just ran), name the iterations when you genuinely need to
compare two. Invalid request combinations fail before touching OUT; after a request is
accepted, OUT is cleared first so a later failure leaves a missing file instead of
a stale image. A directory (tmp/ as OUT) is the
don't-care case and gets a generated timestamped name inside it, printed on the
saved snapshot: line.
Grammar: cadgen dxf snapshot TARGET [OUT] [flags]. Flags: --appearance
light|dark, --size-profile, --width/--height, --job, --debug,
--json. That is the whole surface: a drawing is not a scene, so there is no
camera to pose, no display settings to configure, no render mode, no parts to
list, no section to cut and no view to label — --camera, --display,
--mode and --view-labels are not flags this command has. A --job file that
carries any of them (or scale, an output label/viewLabel, or
output.padding/viewLabels/tightFrame) is refused by name before anything
is rendered; a job's output.renderScale and output.transparent still apply.
No CLI inspects an existing .dxf. For entity/layer checks read it with ezdxf
directly (it arrives with build123d), and validate_dxf_file for the drawing checks;
review geometry visually (see Show the model).
Workflow
- Convert the request into a short brief: outline dimensions, holes and slots, layers, units, output path, and validation targets.
- Pick the workflow: drafted from scratch, flat pattern of a generated model (create and validate the 3D geometry with
$cadfirst), or flat pattern of an imported STEP. - Write or edit the
<name>.pysource with meaningful dimensions as named constants, reusing the model's geometry helpers instead of duplicating formulas. - Run each drawing script directly (
python <drawing>.py); do not sweep directories.
python path/to/source.py
python path/to/source.py --force- Validate the generated DXF deterministically, then hand off and report.
Show the model
Show the user each file you create or change, and any they ask to see. Snapshots and validation don't replace this.
- If your tools include
cad_show(your host may prefix it), use it with the file's absolute path, and follow its description for when to call it again.cad_viewreads what the user selected;cad_screenshotshows you what they see. Neither is a review of your own work. Otherwise run the CAD Viewer, from any folder:
cadgen viewer --host 127.0.0.1 --json --detach--detachreturns once the viewer answers requests and leaves it running in the background: always pass it, since a foreground viewer never exits (and piping its output throughtailcan hide the URL for good). It starts this machine's one viewer, or reuses it. Readurlfrom its one JSON line (never guess the port), and for each file returnurl?file=<its URL-encoded absolute path>. If it fails to launch, say so.
The viewer renders saved DXF files as read-only 2D drawings; it never runs generation scripts. Drag to pan, wheel/pinch to zoom, double-click to fit.
Validation
Validation happens IN generation, not after: every @dxf build runs the drawing
checks on the document the engine just serialized, before anything is written, and
a build with error findings fails. The checks: cut-layer profiles must close
(polylines, circles, or chained line/arc loops), zero-length/degenerate entities are
rejected, exact duplicate geometry (double-cut risk) is rejected, explicitly unitless
documents are rejected, and an empty modelspace is rejected. Open geometry is allowed
only on bend/engrave/reference-intent layers (matched by name).
The same checks run post-hoc on any existing .dxf file — including one that
never came from a generator — through cadgen.drawing_checks:
from cadgen.drawing_checks import validate_dxf_file
for finding in validate_dxf_file("path/to/file.dxf"):
print(finding.render())Beyond the built-in checks, verify requested dimensions with targeted ezdxf reads
(entity counts by layer, drawing extents, every dimension the user specified) against
the generated sibling .dxf (or the out= path when one is declared), and
review geometry visually in the CAD Viewer:
import ezdxf
doc = ezdxf.readfile("path/to/source.dxf")
msp = doc.modelspace()
cut = msp.query('*[layer=="CUT"]')
holes = msp.query('CIRCLE[layer=="CUT"]')Report only checks that actually ran.
Handoff
Show every drawing you created or changed (Show the model). Report any failure explicitly.
Final responses should include generated files, returned viewer links, validation actually run, and assumptions.
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
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.

