/text-to-cad:cadfrom text-to-cad
Designs and edits 3D CAD models using build123d Python, with live preview in a text-to-cad viewer. Handles parametric parts, assemblies, mechanisms, 2D profiles, exports (STEP, STL, 3MF, GLB, DXF, xbf), inspections, animations, and manufacturability checks.
Ships in text-to-cad. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A model is a Python function that returns a build123d shape. Running its script builds it in text-to-cad's server, which holds the result as a document: the page the person has open follows every run, and every command (inspect, snapshot, export, check) acts on that document by its id. Files are exports, written when asked.
| Task | Start with | Reference |
|---|---|---|
| Create or edit a part or assembly | A model script (below) | Models, build123d, positioning |
| Let the person tune a number (a wall, a fit, a count) | model.param(...) at the script's top level; change a value by editing its number and running the script | Parameters |
| Organize a project | Its existing layout | Project layout |
| Export STEP, STL, 3MF, GLB or xbf | cad model export <id> <file> | Exports |
| A 2D profile, flat pattern or DXF | A model that returns 2D geometry on z=0, exported as .dxf | 2D profiles and DXF |
| Use a vendor STEP, an xbf or a scan | step.read, xbf.read or stl.read in the body | Inputs |
| Resolve a reference or a Quick Edit prompt | cad model inspect <id> '<ref>' | References |
| Measure or check geometry | A check script that calls the model | Inspection |
| See a model, a view or a pose | cad model snapshot <id> out.png | Snapshots |
| Articulate a mechanism, find joint limits | build123d joints in the body; cad model ranges <id> | Kinematics |
| Explode, reveal or showcase a model | animation() in the body | Animation |
| Can it be machined, bent, molded or printed? | cad model dfm <id> --process ... | Can it be made? |
| Open an existing CAD file | Show it | Show the model |
Whether a part holds under load is the fea skill's; a robot description, the robot-simulation skill's.
Written for cad==0.11.22. Before first use in a chat, run cad --version. If it fails, or cad is missing or older
than 0.11.12, run uv tool install --force cad. If it is older than the release this skill was written for, run
cad update.
If cad is a major or minor version newer than this skill, tell the person to update the text-to-cad plugin: https://github.com/earthtojake/text-to-cad A project written for an earlier version may need changes; the migration guides say what: https://github.com/earthtojake/text-to-cad/tree/main/docs/migrations
Every command goes through one server: start it once with cad server start (status, stop); a
command that finds none says so. cad run script.py is uv run with cad's library and the
integrations the script imports added, so a script header names only its own extra packages, never
cad (environments). A
build outlives the shell's time limit: run the same command again and it joins the build in progress.
cad <command> --help is the complete, current interface. Paths are relative to the working
directory.
src/bracket.py:
import build123d as bd
from cad import model
def bracket_body(width, thickness, bore):
body = bd.Box(width, 20, thickness) - bd.Cylinder(bore / 2, thickness)
body.label = "bracket"
body.color = "#4a6fa5"
return body
@model
def bracket():
return bracket_body(40, 6, 8)
@model
def bracket_wide():
return bracket_body(60, 6, 8)
if __name__ == "__main__":
bracket()
bracket_wide()
cad run src/bracket.py
built src/bracket.py::bracket cold in 2.61s: bodies 1 run; 6 misses, 0 hits; body 0.01s, names 0.00s, document 0.00s
parts 1 · bounds 40 × 20 × 6 mm · joints 0 · sequences 0
id: 0dc50a92-a21f-5895-a245-ebdeb5352f3b
view: http://127.0.0.1:<port>/<id>?token=<token>
Each call prints how its model built, what it holds, its document's id: and its page, view:. The
id comes from the script's path and the function's name, so it is the same on every run: use it for
every command, and give the person the page once (Show the model).
@model of its own. Calling one returns a handle: .id, .url, .shape, .export(...).@memo marks a stage of seconds of kernel work, or a body several models share
(what a run runs). Keep the calls under
if __name__ == "__main__": so other scripts can import the models.plate().shape), places and
labels it, and returns a Compound. Each part keeps its own document. After editing a part, run the
assembly's script.import build123d as bd, attribute-style. The import is lazy, so the kernel loads in the
server; from build123d import Box or a module-level bd.Color(...) loads it in the script.part.color = "#4a6fa5"); a material gives a part density and a look
(from bd_materials import metals, part.material = metals.aluminum():
colour and materials).step.read, xbf.read, stl.read and any
file it opens are tracked; the clock, environment variables and randomness are not. Compose project
models by calling them, never by reading a file the project exported.Each acts on the document as the last run left it. $ID is a model's id; a file takes the
operations its own type lists (cad step|xbf|stl|threemf|glb|dxf --help).
| Command | Gives |
|---|---|
cad model inspect "$ID" ['<ref>'] | The document's parts, bounds, volume, mass and joints; with a ref, one part, face or edge as JSON, with made_by: the function, file and line that made it |
cad model snapshot "$ID" out.png | A picture, drawn as the viewer draws it: --camera top, --display hidden-line, --pose open, --preview (lit, for a person) |
cad model export "$ID" a.step b.stl c.glb | Files, by suffix; nothing rebuilds (exports) |
cad model interference "$ID" [--pose P] | Every pair of parts that shares volume, exactly, as built and at each pose |
cad model dfm "$ID" --process ... | A manufacturing check (Can it be made?) |
cad model ranges "$ID" | Each joint's stops, swept from the parts (joint stops) |
cad step export vendor.step vendor.xbf | A vendor STEP as an xbf, which xbf.read loads many times faster |
--tolerance MM and --angle DEG mesh an STL, a 3MF or a GLB finer (a print with fits, a close
render) and apply to nothing else: an export that takes them names only mesh files, and a STEP, xbf or
DXF beside them refuses the whole export.
cad model export "$ID" STEP/bracket.step GLB/bracket.glb
cad model export "$ID" STL/bracket.stl 3MF/bracket.3mf --tolerance 0.02
A reference such as 0dc50a92-...#bracket/face 7 is what the viewer copies when the person picks
something: a document, a part by its labels, then an element. Resolve it with inspect, then edit the
code made_by names. A Quick Edit prompt carries its document under File:, its picks under
References: and a snapshot packet, inline JSON (save it to a file) or a .snapshot.json path. Where
the person drew on the view, look at what they drew before editing:
cad model snapshot "$ID" out.png --annotation packet.snapshot.json --camera authored
(annotations).
Read each run's output first: a part count, bounds or joint count that contradicts the intent is the first thing to fix. Then check the change the way it can be checked:
| The change | Check it with |
|---|---|
| A number the person gave (a size, a distance, a volume) | An assert in the model's body on what the geometry measures, or cad model inspect |
| A number the design implies (a clearance, a fit, a mass) | A check script that calls the model and measures what it returns (inspection) |
| An assembly's parts or a joint's travel | cad model interference "$ID", with a --pose for each mechanism state |
| Shape, placement, colour, a mechanism | The snapshots it takes to judge it, posed where it moves |
| A 2D profile or DXF | The export, which runs the drawing checks, then cad dxf snapshot of the file |
| A part made by a named process | Its manufacturing check (below) |
cad model dfm says whether a part can be made by a process and what to change where it cannot. Run
it when the request names or implies a process (machined, sheet metal or laser cut, injection molded,
3D printed, or a printer, resin, filament or cutting service named), or the person asks. A material
alone names no process, but a thickness with a metal ("2 mm steel") is sheet. With none, build what was asked: no check, and no draft, reliefs or tool radii
added.
| Process | Check | Reference |
|---|---|---|
| CNC milling and turning | --process cnc --material M (--axes, --turning, --tools) | CNC |
| Sheet cutting and bending | --process sheet --material M --thickness T (--bend-radius, --k-factor); a cut file, cad dxf dfm | Sheet metal |
| Injection molding | --process molding --pull z --material M (--cavities) | Injection molding |
| 3D printing | --process printing --technology T (--material, --build-volume, --layer-height) | 3D printing |
cad model dfm "$ID" --process cnc --material aluminum --tools 3,6,10
A named process is part of the design, not a review at the end:
part.material = metals.aluminum(process=machined()), with machined from
bd_materials.processes), and the shop's flags in the module docstring
(Check: cad model dfm "$ID" --tools 3,6,10).OK (0, though
warnings may remain), FAILED (1: the part cannot be made as drawn), NOT CHECKED (3: something
was not judged, never a pass) and 2 for a refused command. Fix errors from each finding's refs,
value and limit (--json); fix a warning when that leaves the request intact, else report it.A STEP or mesh file is checked by its own type (cad step dfm part.step --process ...); a mesh, for
printing only. For a review, a shop's own limits or the result in full, read
manufacturing review. A SendCutSend order is the sendcutsend
skill's; slicing a print, the print3d skill's.
Show the person each model you create or change as soon as its first run succeeds, and any model
or file they ask to see. A model's page is the view: line its run prints, and a file's is the url
that cad viewer --json FILE [FILE ...] prints for it (never guess the port). Show it with
the first of these you have:
cad_show among your tools (your host may prefix it): call it with the model's id or the file's
absolute path; its description says the rest.preview_start with the page's url, or its navigate):
open the page there yourself, and give the person the link as well.The page follows every run of the model. A file you export is a download: give its path. Showing is
for the person: to check your own work, review with cad <type> snapshot, never a screenshot
of the page. If it fails to launch, say so.
Say what was made or changed, the files written, the checks run and what they showed, what no check covered, and every assumption or departure from the request.
LICENSE (opens in a new tab)agents/openai.yaml (opens in a new tab)references/2d-profiles-and-dxf.md (opens in a new tab)references/animation.md (opens in a new tab)references/build123d-modeling.md (opens in a new tab)references/environments.md (opens in a new tab)references/exports.md (opens in a new tab)references/inspection-and-validation.md (opens in a new tab)references/kinematics.md (opens in a new tab)references/manufacturing-cnc.md (opens in a new tab)references/manufacturing-injection-molding.md (opens in a new tab)references/manufacturing-printing.md (opens in a new tab)references/manufacturing-review.md (opens in a new tab)references/manufacturing-sheet-metal.md (opens in a new tab)references/model-contract.md (opens in a new tab)references/positioning.md (opens in a new tab)references/project-layout.md (opens in a new tab)references/snapshot-review.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub earthtojake/text-to-cad --plugin text-to-cad8 skills in this plugin
/engineering-drawingMakes an engineering drawing of a part as a PDF, projected from its 3D geometry so the drawing follows the model, with dimensioned orthographic views, hole callouts, notes and a title block. Use when the person asks for a drawing, a dimensioned sheet, shop or manufacturing drawings, a blueprint, or "2D views of this part". Not for DXF cut layouts or flat patterns, which the cad skill makes./feaChecks whether a part, or an assembly of bonded parts, is strong enough under its loads, as a linear static stress study (FEA). Use when the person asks whether a part will hold, break or bend too much, where it is most stressed, how much load it takes, how to make it stronger or lighter, or for FEA, a stress analysis or a strength simulation. Reports peak stress, safety factor against yield and deflection. Static loads only, not vibration, buckling, heat, fatigue or impact./Other plugins' skills for the same job