About create-cad-files
create-cad-files is a skill for creating and exporting parametric CAD models, for design and manufacturing tasks that need STEP or STL files. It combines OpenCAD Python source, native OCCT export, and file validation while retaining a reproducible project structure.
Key features
- 01Extract dimensions and geometry from requests
- 02Generate parametric OpenCAD Python models
- 03Export STEP or STL with OCCT
- 04Validate exchange files and inspect feature trees
- 05Keep source files and project documentation
Use cases
- 01Create editable STEP geometry
- 02Generate STL files for 3D printing
- 03Organize reproducible CAD components in a project
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ caid-technologies/ opencad --skill create-cad-filesAfter installing, type/create-cad-filesin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
agents/openai.yamlreferences/opencad-api.mdscripts/build_cad_file.pycreate_project.pyvalidate_cad_file.pyDetails
From the project READMECreate CAD Files
Create the model as readable OpenCAD Python, export it with the native OCCT backend, and validate the exchange file before returning it. Keep the user experience prompt-first: handle source generation, build commands, and validation without asking the user to operate Python.
Workflow
-
Extract dimensions, units, geometry, holes, clearances, and output format. Use millimeters unless specified otherwise. Ask only when a missing dimension materially changes the part; otherwise state the assumption.
-
Prefer STEP for editable/manufacturing geometry and STL for a triangulated 3D-printing deliverable. Create both when requested.
-
Read references/opencad-api.md before writing a model. At the start of every run, create a fresh project directory with
scripts/create_project.pyand use the returned path asPROJECT_DIR. The helper creates a UUID-named directory under~/forma-workspace/; never derive the project ID from the request. Keep every source file, README, component, and generated artifact insidePROJECT_DIR. CreateREADME.mdfor project context,assembly.pyas the master composition entry point,parameters.pywhen dimensions are shared, acomponents/Python package for component modules, and anoutputs/directory for generated artifacts. Honor explicitly requested filenames insidePROJECT_DIR, but do not replace the shared root or generated project ID. -
Keep the model parametric: assign important dimensions to named constants, have component modules expose named builders or parts, and create one final
Partinassembly.py. Leave that final part as the last generated shape inassembly.py(or the explicitly requested master file). Do not callPart.export()in the model; the build helper owns export and validation. -
Ensure
opencad[occt]is installed. If importing OpenCAD fails, explain the dependency and ask before installing it into the active Python environment. -
Resolve this skill's directory, create the project directory by its absolute path, stay inside the returned project directory, and run the build helper by its absolute path:
PROJECT_DIR=$(python /path/to/create-cad-files/scripts/create_project.py) python /path/to/create-cad-files/scripts/build_cad_file.py "$PROJECT_DIR/assembly.py" "$PROJECT_DIR/outputs/assembly.step" --tree-output "$PROJECT_DIR/outputs/assembly.tree.json"Use an
.stloutput name for STL. The helper refuses to replace files unless--forceis explicitly supplied. -
If exporting both formats, run the same project
assembly.pysource twice. Validate an existing artifact independently with the absolute path toscripts/validate_cad_file.py. -
Inspect failures and revise the source rather than bypassing validation. Return clickable paths for the source, CAD artifacts, and feature tree, plus units and assumptions.
Quality rules
- Preserve exact requested dimensions and name user-facing parameters.
- Use closed, ordered sketch profiles. Avoid self-intersections, zero-thickness contact, and coplanar boolean ambiguity.
- Apply fillets and chamfers after the main solid and boolean operations.
- Keep holes and clearances explicit. Do not invent manufacturing tolerances; flag them when fit matters.
- Do not claim that basic file validation proves printability, load capacity, code compliance, or manufacturability.
- Retain the project source,
README.md, and tree JSON so revisions remain reproducible. - Keep the project self-contained so
assembly.py, nested component packages, and generated artifacts can be managed together. - Use
__init__.pyfiles for component packages and subpackages. Import nested components from the project root, for examplefrom components.motor.mount.screw_pattern import make_screw_pattern. - Document the project purpose, units, assumptions, key dimensions, component/package tree, build command, artifacts, and known limitations in
README.md.
Failure handling
- If CadQuery/OCP is unavailable, use
opencad[occt]; never substitute the analytic backend for a deliverable. - If a boolean or fillet fails, simplify the feature, reduce the radius, or eliminate coincident faces.
- If requested geometry exceeds the API surface, explain the limitation and implement the closest faithful parametric model only with the user's agreement.