Scaffolds a new parametric OpenSCAD project in this repo. Creates directory structure, generates an initial .scad design (simple + detailed versions), README, CHANGELOG, renders, and opens in OpenSCAD. Use when the user wants to start a new 3D model.
You help the user scaffold and generate a new parametric OpenSCAD model project in this repository.
The user provides a project name as an argument (e.g. /new-model hook-holder). If no name is given, ask for one. The name should be lowercase and hyphenated.
Before generating anything, conduct a thorough interactive interview to understand what the user wants to build. Ask questions adaptively — simple shapes may need fewer questions, complex mechanisms may need many. Don't rush this; the quality of the generated model depends on the quality of context gathered here.
Ask questions about (as relevant):
Ask questions in batches of 2-4 using the AskUserQuestion tool. Continue asking until you have a clear mental model of the part. It's fine to ask 10+ questions for complex designs — the user prefers thoroughness.
Before generating code, read ALL .scad files in the repository to deeply understand the user's coding style:
find . -path '*/src/*.scad' -not -name '*.v[0-9]*'
Read each file. Pay attention to:
// --- Group ---)Also reference the CLAUDE.md conventions for the canonical .scad file structure.
Create the project directory and all files:
src/{name}/
├── src/
│ ├── {name}-simple.scad # Lo-fi version: basic geometry, correct shape
│ └── {name}.scad # Hi-fi version: refined with fillets, textures, safeguards
├── README.md
└── CHANGELOG.md
Both files must follow the repository's .scad conventions exactly:
/** Header — 1-3 line description */
// --- Parameter Group ---
param = value; // [mm] Inline description
// --- Computed ---
derived = expression;
module helper() { ... }
module assembly() { ... }
assembly();
Simple version ({name}-simple.scad):
Detailed version ({name}.scad):
Both files must share the same parameter names and groups so the user can compare them directly.
Follow the pattern from existing projects:
# {Title}
{1-2 sentence description of what it does and why}
## Features
- {feature list}
## Printing
- **Orientation**: {how to place on bed}
- **Material**: {recommended material}
- **Infill**: {percentage}
- **Supports**: {yes/no and why}
## Customization
| Parameter | Default | Description |
| --- | --- | --- |
| `param_name` | `value` | What it controls |
# Changelog
## [0.1.0] - {today's date YYYY-MM-DD}
### Added
- Initial generated design with simple and detailed variants
- {list key features}
Run the render script to generate the 3x3 composite preview image for the detailed version:
cd /Users/justin/Git/cad && ./cad.ts --render {name}
This generates src/{name}/render.png with the 3x3 composite view.
Also render the simple version manually for comparison:
cd /Users/justin/Git/cad
openscad --preview --projection=ortho \
--imgsize="1024,1024" --viewall --autocenter \
--colorscheme="Starnight" \
--camera="0,0,0,54.74,0,315,0" \
-o src/{name}/render-simple.png src/{name}/src/{name}-simple.scad
Open both versions in the OpenSCAD GUI so the user can inspect them:
openscad /Users/justin/Git/cad/src/{name}/src/{name}.scad &
openscad /Users/justin/Git/cad/src/{name}/src/{name}-simple.scad &
Show the user:
$fn = 100 for curved surfaces unless the user specifies otherwise// [unit] annotationsmin()/max() to prevent self-intersection