The Problem
Most CAD systems force a choice between a visual editor and a code API. Visual editors are hard to version-control and automate; pure code APIs lack live feedback. ForgeCAD treats TypeScript as the file format, so models are plain code that runs in the browser with live parameter sliders and exact STEP/BREP export through CadQuery/OpenCascade.
What This Does
ForgeCAD is a multi-backend parametric CAD system. The public API (param(), roundedRect(), extrude(), subtract()) is kernel-agnostic; interactive geometry runs on Manifold, while exact export goes through CadQuery/OpenCascade. The examples/ directory holds 238 files: 217 code examples, benchmarks, and a compiler corpus.
The repo is the community home—active development is private. It contains the API examples (examples/api/), constraint demonstrations (examples/constraints/), and LLM benchmark harnesses (examples/bench/, examples/bench-v2/) that grade model-generated CAD scripts.
How It Is Wired
Execution starts in a .forge.js script, which runs in the browser or CLI (forgecad studio). The API is globally available—no imports required. The measured call graph shows 142 internal edges; the most-connected functions are pieceBase (6 callers), S (4), axle (4), rad (4), and ring (4)—change these and the most examples break.
The examples/ directory is a flat collection of standalone scripts. examples/robot_hand_2.forge.js defines 19 functions including rad, clamp, add3, and explodeShape. examples/chess-set.forge.js defines ring, pieceBase, and piece shapes. The benchmark harnesses (examples/bench/*/harness.forge.js) each define gate, test, bboxCenter, and bboxSize to evaluate model outputs. The module graph shows no circular dependencies; the 5 import edges are all in examples/api/ where .forge.js files import helper modules like js-module-pillars.js.
The repo writes nothing to a database or network at runtime—scripts produce geometry and exports. CI (GitHub Actions) builds and publishes.
How To Use It
Setup: npm install -g forgecad
Running: forgecad studio /path/to/your/project or forgecad studio --blank for a scratch file. A minimal script:
const width = param("Width", 120, { min: 60, max: 220, unit: "mm" });
const base = roundedRect(width, 80, 10).extrude(12).color("#5f87c6");
return base;
Configuration: No environment variables or config files are required. The .agents/ and .kiro/ directories contain agent settings, not runtime configuration.
Real-World Use
A mechanical engineer can define a parameterized bracket, share the .forge.js file, and let a colleague adjust the Width slider in the browser. The same script exports an exact STEP file for manufacturing. For AI-assisted design, the repo includes agent skills (forgecad skill install) and a benchmark suite that grades how well models like GPT-5.4-mini and Claude Sonnet 4 generate valid CAD scripts.
Code Health & Issues
Static analysis found 11 findings (1 high, 10 medium). The high-severity issue is duplicated code blocks: 234 repeated 6-line blocks across 26 files in examples/api/ and examples/constraints/. The medium findings are high branching density in three benchmark harnesses (e.g., 29 branch points over 95 lines in examples/bench/door-hinge/harness.forge.js).
The CI audit found 4 issues. High: third-party GitHub Actions are pinned to tags (dtolnay/rust-toolchain@stable, softprops/action-gh-release@v2)—pin to commit SHAs. Medium: no permissions: declaration in ci.yml and persist-credentials: false is not set on checkout. Low: no timeout-minutes on workflow jobs.
Tests exist (13 files), CI is present, and no secrets were committed. The duplicated example code is a maintenance cost, not a functional risk.
The Bottom Line
ForgeCAD is a serious code-first CAD system with a clean API and a strong example corpus. The duplicated examples and unpinned CI actions are hygiene issues, not architectural problems. Use it if you want version-controlled, AI-friendly parametric modeling with exact STEP export; the private development model means the public repo is a showcase, not the full source.