Michael Thomson
Browser-native AI CAD + multi-agent design system

Proto

A CAD environment that runs entirely in the browser, with Claude as a co-designer. OpenSCAD is compiled to WebAssembly and run in a Web Worker, so an edit becomes geometry in milliseconds without a server round-trip.

Overview

Proto's first AI pipeline was one model, one shot, a whole-file rewrite — the model never found out when its own code failed to compile, because OpenSCAD runs client-side and the error surfaced in the browser after the change had already been applied. Proto-Agents replaces that with a router and six specialists that can compile their own output, resolve what the user selected in the 3D viewer, and improve their own reference material in the background.

What it does
  • 01OpenSCAD compiled to WASM in a Web Worker
  • 02Live edit to mesh in under a second
  • 03Claude co-designer with accept/reject diffs
  • 04Router plus six specialist agents
  • 05Agents compile and verify their own output
  • 06Standing rules the model can't forget

The live loop

OpenSCAD is compiled to WebAssembly and runs in a Web Worker. Edits in the Monaco editor recompile after 500 ms of idle and swap the resulting mesh into a Three.js viewer, with a status pill reporting triangle count and compile time. Break the syntax and the pill turns red and opens the real compiler log.

Everything that changes the file writes a version tagged user, ai, or revert, so any prior state is one click away. STL export happens client-side from whatever is currently rendered.

Chat turn
  1. Instruction + current file→
  2. Cached SCAD reference→
  3. Claude proposes→
  4. Server diffs→
  5. Unified diff in-panel→
  6. Accept / Reject→
  7. Version written→
  8. Viewer recompiles

The agent layer

Express stays the trust boundary. The agent server never sees a token, a user, or the database — it receives a file, an instruction, and workspace context, and returns a proposal. Model tier is chosen by what a mistake costs: the agents that emit or judge geometry run on the larger model, because a wrong answer there is a wrong object on the user's screen. Dispatch and advice run smaller.

Writing
  • router — dispatch, returns the author's block intact
  • author — the only agent that emits a file
  • spatial — 'this face' to an axis, coordinate, module
Judging
  • verifier — compiles, measures, prompted adversarially
  • dfm — walls, tolerance, orientation. Advises, never overrides
Learning
  • librarian — distills one conversation into the reference
  • improver — reads many turns at once, background only

What the agents can actually do

The interesting part isn't that a model writes OpenSCAD. It's that the model gets to find out whether what it wrote works before the user sees it.

Capabilities
  • render_scad — a real compiler, so a failure is diagnosed from the actual error rather than by reading
  • compare_geometry — catches code that compiles but leaked changes outside what was asked
  • Viewer face selection converted from the viewer's Y-up frame to the file's Z-up frame
  • A standing rules list the user maintains once and every turn honours
  • A background improver that reads the whole request journal and proposes changes to the knowledge base
Built with
React 19TypeScriptThree.js / R3FWebAssemblyWeb WorkersMonacoExpress 5MongoDBFastAPILangChain / deepagentsAnthropic SDKWeb Speech API