5.7 KiB
name, description
| name | description |
|---|---|
| cad-router | Route natural-language or image-guided CAD generation and modification, plus uploaded STEP/STP reconstruction and modification, across text-to-cad and SimpleCADAPI. Create one executable DesignIR 2.0 model per part, produce STEP geometry without teacher geometry dependencies, and enforce independent validation, visual repair, and CAD Viewer review. |
CAD Router
Choose a backend before modeling, keep its source as the editable authority, and normalize every result into one handoff contract. Use two projects by role: text-to-cad owns orchestration, general CAD, refinement, validation, repair, and viewing; SimpleCADAPI owns specialized mechanical families.
Required workflow
-
Convert the natural-language or image-guided request into a brief: part type, dimensions, units, assembly relationships, editability, and validation targets. The artifact contract is fixed to executable DesignIR 2.0 plus STEP geometry. Never treat a teacher STEP or a single-case DesignIR as experience. Batch case JSON belongs to the separate CAD Experience plugin. Generation may consume only its promoted schema
2.0generalized library. Never readcad-experience-plugin/parser/input,parser/output, or private case JSON during creation, modification, or reconstruction. -
Run the deterministic router from this skill directory:
python3 scripts/route.py "<request>" --explainAdd explicit signals when known:
--edit-source path/to/source,--existing-model, or--assembly. The router auto-discovers the workspacecad-experience-library/library.json, infers an experience family and feature roles from the request, and emits a backend-neutraldesign_plan. When promotedreconstruction_grammarrecords match, instantiate their symbolic parameter roles, datum roles, canonical stages, and validation roles in the new part's DesignIR; fill values from explicit user dimensions first and dimensionless distributions second. Use--experience-library,--experience-family, or repeated--experience-featureonly to override those defaults. -
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, and semantic tags.
-
When the route reports
requirement_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. Write one*.designir.jsonper part and treat it as the editable geometry contract; keepcad-task.jsonas the execution record. Readreferences/designir-2.0.mdbefore creating, reconstructing, or modifying a model. Never change backend during an edit unless conversion is explicitly requested; modify the recorded DesignIR source of truth. For a supplied STEP/STP, the deterministic ingestion service may extract private teacher evidence. The reconstruction agent receives that evidence, never the STEP itself, and must author complete executable DesignIR. Compile it in an isolated environment where the teacher STEP is absent. The DesignIR and generator must not import STEP, embed B-Rep or meshes, retain face references, or use the source model as a base feature. The acceptance agent alone compares the teacher and reconstructed STEP. If the request does not name the source part family, inspect the explicit source first and rerun the experience query with--experience-familyand--experience-feature; do not guess across family-scoped experience. -
Validate against the brief. Run STEP geometry inspection and snapshot review. For experience-informed generation, record which generalized methods were applied, including the reconstruction grammar ID and instantiated symbolic roles. Validate against the user's brief and held-out targets, never against parameters exposed from the same source case.
-
Write a
cad-task.jsonmanifest using the contract inreferences/backend-contract.md. Hand the STEP artifact to$cad-viewerand return its live link.
Routing rules
- Prefer an explicit user backend when it can produce the editable STEP contract.
- 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 source quality and future modification over the shortest first generation.
V1 boundaries
- Do not promise lossless conversion of feature history between backends.
- Do not claim engineering certification, tolerance analysis, FEA, CAM toolpaths, or manufacturability without separate checks.
References
- Read
references/capabilities.mdwhen comparing or invoking backends. - Read
references/backend-contract.mdbefore writing a task manifest or adding another backend. - Read
references/designir-2.0.mdwhen generating, reconstructing, or modifying a per-part executable design. scripts/capabilities.jsonis the machine-readable V1 registry used byscripts/route.py.