Agent-first CAD workflow runtime
Project description
AgentCAD
AgentCAD is a CLI-first CAD workflow runtime for coding agents.
It gives a coding agent a repeatable workspace, a contract-driven modeling protocol, deterministic build/export, geometric measurement, multi-view previews, design-time and post-build validation, and a delivery manifest — so the agent can iterate on CAD models with measurable feedback instead of visual intuition.
design contract -> precheck -> params/source -> build
-> measure -> render -> validate -> review -> deliver
What's in the box
| Stage | Command | Purpose |
|---|---|---|
| Scaffold | agentcad new <model> |
Create model folder; auto-init workspace |
| Sync | agentcad sync |
Refresh workspace scaffold from latest templates |
| Precheck | agentcad precheck <model> |
Solve design.json statically (schema, feature coverage, min_clearance) before part.py is written |
| Build | agentcad build <model> |
Run part.py through build123d, export STEP + STL, hash-cache stale runs |
| Measure | agentcad measure <model> |
Mesh stats + structural facts (bbox, watertight, triangles, voids) |
| Render | agentcad render <model> |
Iso/front/top/side/back SVG previews + Z/X/Y cross-section SVGs |
| Probe | agentcad probe <model> |
Cross-section diameter / bbox / void at specified Z, X, Y; --scan to discover step changes |
| Inspect | agentcad inspect <model> |
Three-axis scan + automatic section SVGs + suggested probes |
| Validate | agentcad validate <model> |
Build + measure + render + design checks + feature coverage; auto-emits debug SVGs on failure |
| Review | agentcad review <model> |
Pre-delivery checklist with pairwise relations matrix and must-view SVG list |
| Deliver | agentcad deliver <model> |
Delivery manifest |
| Report | agentcad report <model> |
Markdown summary of validation result |
Every command supports --json for stable machine-readable output; failures
return JSON containing stage, error.type, error.message.
Validation check types
| Type | Layer | Notes |
|---|---|---|
bbox_size |
post-build | Outer envelope dimensions |
watertight |
post-build | STL is a closed manifold |
min_triangles |
post-build | Mesh density floor |
artifact_exists |
post-build | STEP / STL / SVG present |
metadata_equals |
post-build | Asserts a value emitted from part.py |
outer_diameter_at_z |
post-build | Cross-section radial size at Z |
inner_diameter_at_z |
post-build | Inner cavity diameter at Z |
section_bbox_at_z |
post-build | Cross-section AABB / void detection at Z |
diameter_decreases_along_z |
post-build | Monotonicity for tapers / lead-ins |
volume_range |
post-build | Volume sanity bounds |
min_clearance |
design-time + post-build | Pure-shape edge-to-edge clearance between two declared shapes (no STL required) |
hole_accessibility |
post-build | Annular clearance around a hole at the working plane |
min_wall_thickness |
post-build | Minimum point-pair distance inside a defined region |
feature_position |
post-build | Assert a 3D point is solid or void |
feature_coverage |
automatic | Every declared feature must reference at least one check |
The four "geometric relation" checks (last block) close the historical gap
where inner_diameter_at_z would happily report a 4.5 mm hole that was
half-covered by an adjacent wall.
Quick start
uv tool install agentcad-cli
agentcad --help
For local development:
uv sync
uv run agentcad --help
Quick example
uv run agentcad new bracket --project /tmp/my-cad-project
cd /tmp/my-cad-project
# 1. Design-time: solve the contract before writing geometry
uv run agentcad precheck bracket --json
# 2. Implement part.py, then run the post-build pipeline
uv run agentcad validate bracket --json
# 3. Pre-delivery review (relations matrix + must-view SVGs)
uv run agentcad review bracket --json
# 4. Deliver
uv run agentcad deliver bracket --json
The default generated model is a simple build123d cuboid. Agent rules and
common-error catalog live in AGENTS.md, CLAUDE.md, and references/
(always-on reference docs for build123d patterns and validation strategy).
Examples
| Path | What it shows |
|---|---|
examples/fan-adapter-8025/ |
Two validated models: a fan-to-duct adapter and a magnetic outlet plate |
examples/iphone15pro-case/ |
Real-world phone case with multi-cutouts + section validation |
examples/e2e-test/ |
Sub-agent end-to-end test: design → precheck → build → validate → review on a mounting bracket |
Re-run any example:
cd examples/fan-adapter-8025
uv run agentcad validate fan_duct_adapter_8025 --json
uv run agentcad review fan_duct_adapter_8025 --json
Tests
uv run pytest -v
125 tests at last count, covering CLI dispatch, workspace scaffolding, STL
reading and measurement, section extraction and SVG rendering, JSON IO,
post-build validation checks, weak-check warnings, stale build detection,
geometric primitives, and precheck / review integration.
Documentation
docs/DESIGN.md— architecture, first principles, and V0–V5 iteration roadmap (with delivered milestones marked).docs/STATUS.md— current implementation state, recent lessons (build123d traps, hole-wall interference), and the planned next research and engineering work.AGENTS.md/CLAUDE.md(workspace) — operating rules for the coding agent, including the mandatory TDD red/green workflow and the common design-error catalog.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentcad_cli-0.1.1.tar.gz.
File metadata
- Download URL: agentcad_cli-0.1.1.tar.gz
- Upload date:
- Size: 78.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69188d95a6830aa1d846f3e6b78d4fc308569589e0f4792b89164cac4104669a
|
|
| MD5 |
7dd78016f6b88a341cc09ed8c5445de9
|
|
| BLAKE2b-256 |
adc288a840ace826b6cccfaad15a2419cf35eecb6526729feabc99d714aaa62e
|
Provenance
The following attestation bundles were made for agentcad_cli-0.1.1.tar.gz:
Publisher:
publish.yml on kuaner/agentcad
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentcad_cli-0.1.1.tar.gz -
Subject digest:
69188d95a6830aa1d846f3e6b78d4fc308569589e0f4792b89164cac4104669a - Sigstore transparency entry: 1459778924
- Sigstore integration time:
-
Permalink:
kuaner/agentcad@4dd2b188a1e7e372c221d5a06a768dc33484e517 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/kuaner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4dd2b188a1e7e372c221d5a06a768dc33484e517 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agentcad_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agentcad_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 76.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6e208f2d322b548eb1c74cd0ebfa2a09276c61a4515ced10ab6e5f16e72c6a2
|
|
| MD5 |
c6f9d759e67d80fad6a9fa9e99b2bd07
|
|
| BLAKE2b-256 |
d224fce13a1ef91cc4928c0e3d065cbed4a5b0aaf63f0d300f98444c16a3c65a
|
Provenance
The following attestation bundles were made for agentcad_cli-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on kuaner/agentcad
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentcad_cli-0.1.1-py3-none-any.whl -
Subject digest:
b6e208f2d322b548eb1c74cd0ebfa2a09276c61a4515ced10ab6e5f16e72c6a2 - Sigstore transparency entry: 1459779542
- Sigstore integration time:
-
Permalink:
kuaner/agentcad@4dd2b188a1e7e372c221d5a06a768dc33484e517 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/kuaner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4dd2b188a1e7e372c221d5a06a768dc33484e517 -
Trigger Event:
push
-
Statement type: