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
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


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.1.tar.gz (78.1 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.1-py3-none-any.whl (76.4 kB view details)

Uploaded Python 3

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

Hashes for agentcad_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 69188d95a6830aa1d846f3e6b78d4fc308569589e0f4792b89164cac4104669a
MD5 7dd78016f6b88a341cc09ed8c5445de9
BLAKE2b-256 adc288a840ace826b6cccfaad15a2419cf35eecb6526729feabc99d714aaa62e

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentcad_cli-0.1.1.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.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

Hashes for agentcad_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6e208f2d322b548eb1c74cd0ebfa2a09276c61a4515ced10ab6e5f16e72c6a2
MD5 c6f9d759e67d80fad6a9fa9e99b2bd07
BLAKE2b-256 d224fce13a1ef91cc4928c0e3d065cbed4a5b0aaf63f0d300f98444c16a3c65a

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentcad_cli-0.1.1-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