Skip to main content

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
Init agentcad init [--model <name>] Initialize workspace scaffold (optionally create first model)
Scaffold agentcad new <model> Create model folder inside an existing 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 prints JSON by default for stable machine-readable output; add --text for human-readable output. Failures include stage, error.type, and 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

Create a workspace and start modeling:

mkdir my-agentcad-project
cd my-agentcad-project
agentcad init --model demo

Then open this directory in Claude Code / Cursor and continue from models/demo/part.py.

For local development:

uv sync
uv run agentcad --help

Quick example

agentcad init --model bracket
cd /tmp/my-cad-project

# 1. Design-time: solve the contract before writing geometry
agentcad precheck bracket

# 2. Implement part.py, then run the post-build pipeline
agentcad validate bracket

# 3. Pre-delivery review (relations matrix + must-view SVGs)
agentcad review bracket

# 4. Deliver
agentcad deliver bracket

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
uv run agentcad review fan_duct_adapter_8025

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentcad_cli-0.1.3.tar.gz (78.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentcad_cli-0.1.3-py3-none-any.whl (76.5 kB view details)

Uploaded Python 3

File details

Details for the file agentcad_cli-0.1.3.tar.gz.

File metadata

  • Download URL: agentcad_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 78.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentcad_cli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b621e9233b413138dab12e97a224ef66efdc3eae18090b32dc0c92910b433efb
MD5 db8cc4a1dda7bfe6b63f2ede086787e0
BLAKE2b-256 b98fa9b7c6eaa548305e4dd60ac50038804c1d27ae26f373dfd0720223be3e24

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentcad_cli-0.1.3.tar.gz:

Publisher: publish.yml on kuaner/agentcad

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentcad_cli-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: agentcad_cli-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 76.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentcad_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 003889ab1c077f9d42ed0bdc2d98275d96ad227124ecf8c53f7544271a172b68
MD5 64e0c77ac0e99b3402bfa72552c483b3
BLAKE2b-256 75291d93bb1b1e71dd4d796343581911a7370ac05722b9ba499d5b616947433d

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentcad_cli-0.1.3-py3-none-any.whl:

Publisher: publish.yml on kuaner/agentcad

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page