create-cad-files

Installation
SKILL.md

Create 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

  1. 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.

  2. Prefer STEP for editable/manufacturing geometry and STL for a triangulated 3D-printing deliverable. Create both when requested.

  3. Read references/opencad-api.md before writing a model. At the start of every run, create a fresh project directory with scripts/create_project.py and use the returned path as PROJECT_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 inside PROJECT_DIR. Create README.md for project context, assembly.py as the master composition entry point, parameters.py when dimensions are shared, a components/ Python package for component modules, and an outputs/ directory for generated artifacts. Honor explicitly requested filenames inside PROJECT_DIR, but do not replace the shared root or generated project ID.

  4. Keep the model parametric: assign important dimensions to named constants, have component modules expose named builders or parts, and create one final Part in assembly.py. Leave that final part as the last generated shape in assembly.py (or the explicitly requested master file). Do not call Part.export() in the model; the build helper owns export and validation.

  5. Ensure opencad[occt] is installed. If importing OpenCAD fails, explain the dependency and ask before installing it into the active Python environment.

  6. 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"
    
Installs
59
GitHub Stars
66
First Seen
Aug 5, 2026