4.6 KiB
name, description
| name | description |
|---|---|
| cad-router | Route natural-language CAD, mechanical-part, assembly, 3D-printing, and robot-description requests across text-to-cad, SimpleCADAPI, CADAM, and the CADDesigner workflow, then enforce shared generation, validation, and CAD Viewer handoff. Use for new or modified STEP/STP, SCAD, STL, 3MF, DXF, URDF, SRDF, SDF, or G-code work when the agent must choose the best modeling backend and preserve editable sources. |
CAD Router
Choose a backend before modeling, keep its source as the editable authority, and normalize every result into one handoff contract. Use all four projects by role: text-to-cad owns orchestration, general CAD, validation, and viewing; SimpleCADAPI owns specialized mechanical families; CADAM owns SCAD execution; CADDesigner supplies the ECIP refinement and repair workflow without starting its separate LLM service.
Required workflow
-
Convert the request into a brief: part type, dimensions, units, manufacturing intent, required outputs, assembly relationships, editability, and validation targets.
-
Run the deterministic router from this skill directory:
python3 scripts/route.py "<request>" --explainAdd explicit signals when known:
--output step,--output stl,--manufacturing machining|printing|laser-cutting,--existing-model,--assembly, or--browser-controls. -
Follow the selected route unless a hard environmental constraint makes it unavailable. If overriding it, record the reason in the task manifest.
-
Load only the selected backend reference from
references/capabilities.mdand the matching installed Skill:build123d: use$cad; this is the default for general STEP-first mechanical parts, assemblies, and existing STEP modification.simplecadapi: use an installed SimpleCADAPI Skill/runtime; prefer it for gears, racks, ring gears, bearings, cycloidal parts, reducers, replayable graphs, semantic tags, and FreeCAD interchange.cadam: generate editable.scad, then executenode scripts/cadam_compile.mjs <source.scad> <output.stl|output.dxf>. SetCADAM_ROOTor pass--cadam-rootwhen the CADAM checkout is not beside text-to-cad. Prefer it for fast parametric printable models, repeated patterns, decorative CSG, and parameter controls.
-
Always apply CADDesigner's
caddesigner_ecipprofile. When the route also reportsrequirement_refinementorvisual_repair, refine the brief, generate, execute, inspect multiple views, and repair no more than three visual mismatch rounds before asking the user. -
Generate into a task-owned directory and start CAD Viewer with that task directory as
--dir; do not expose the repository-wide fixture library for a task review. Never change backend during an edit unless conversion is explicitly requested; modify the recorded source of truth. -
Validate against the brief. STEP-first routes must run geometry inspection and snapshot review. Mesh routes must check compilation, bounds, solidity/manifold facts when available, and snapshot review.
-
Write a
cad-task.jsonmanifest using the contract inreferences/backend-contract.md. Hand supported artifacts to$cad-viewerand return its live links.
Routing rules
- Prefer an explicit user backend when it can produce the required primary format.
- Prefer SimpleCADAPI when a supported standard mechanical factory or replay/semantic requirement materially reduces custom modeling.
- Prefer build123d for general machined parts such as brackets, connecting rods, housings, shafts, flanges, fixtures, and source-driven assemblies.
- Prefer CADAM for SCAD-native, fast printable, pattern-heavy, or interactive-parameter models. Do not choose it when editable STEP is mandatory.
- Route DXF, URDF, SRDF, SDF, G-code, printer, or fabrication handoffs to their focused installed Skills after primary geometry generation.
- Prefer source quality and future modification over the shortest first generation.
V1 boundaries
- Do not promise lossless conversion of feature history between backends.
- Do not treat STL as an editable CAD source when a parametric source or STEP exists.
- Do not claim engineering certification, tolerance analysis, FEA, CAM toolpaths, or manufacturability without separate checks.
- Keep GPL/AGPL backends independently installed and invoked; do not copy their implementation into an MIT-distributed Skill.
References
- Read
references/capabilities.mdwhen comparing or invoking backends. - Read
references/backend-contract.mdbefore writing a task manifest or adding another backend. scripts/capabilities.jsonis the machine-readable V1 registry used byscripts/route.py.