/hildegard:hildegard-openscadfrom hildegard
Generates parametric 3D parts (brackets, enclosures, gears, threads) in OpenSCAD with BOSL2. Renders STL files and validates dimensions via mesh review.
Ships in hildegard. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
OpenSCAD is code-CAD: the model is a short program of solids, booleans and transforms, so every dimension is a named number and every round is a small edit you can say in a sentence. That makes it the strongest route for an agent to make a part that has to fit, and the weakest for anything organic. Sculpt figures and animals with hildegard-3d's signed-distance route or Blender; build parts here.
You render with the openscad program and measure the STL with scripts/review_mesh.py (Python with numpy and
Pillow: python3 -m pip install pillow numpy av); section 7 has the commands. Without them, read the size from
OpenSCAD's own render and look at it. If you have them, the
hildegard-3d skill covers the brief, the sheet and the checks, and hildegard-print (for a part that has to
work) the evidence for every dimension and fits from the printer's clearance.
If you read nothing else, do these steps.
No shell or tools here (a chat, or tools turned off)? Then you are writing a plan: give the user the commands in order, with their file names, and the checks to run after. Never write tool-call markup or claim a result you did not get.
openscad --version, and BOSL2 in OpenSCAD's libraries folder (section 1). In a plan,
list these checks for the user to run; you cannot run them.main.scad with every number a named parameter at the top, its unit and its source (section 2).20 + 2 * fit, with fit 0.2 mm per side unless the user measured theirs.openscad -o round-1.stl main.scad (add --backend=Manifold when it has it). Every warning is a
failure: fix it.spec.json with the size, then python3 scripts/review_mesh.py spec.json, and open the
sheet (section 7).main.scad, the STL and the sheet, with which numbers were measured and which assumed (section 9).Run openscad --version and look in OpenSCAD's libraries folder for BOSL2 (Linux
~/.local/share/OpenSCAD/libraries, macOS ~/Documents/OpenSCAD/libraries, Windows Documents\OpenSCAD\libraries).
If openscad is not found, tell your user how to install it (openscad.org), or write the .scad and say it is
unrendered. A 2025 or newer build renders with Manifold (booleans in seconds; openscad --help lists
--backend); 2021.01 has only CGAL, which can take minutes on the same model. Write for what is there:
$fn at 24 to 32 while blocking out, raise it to 64 to 96 for the final round, and avoid
minkowski()..scad marked unrendered.One file, main.scad, in this order. Every number the part is built from is a named parameter at the top, with its
unit and where it came from; the geometry holds no bare numbers but 0, 1, 2 and the small eps.
// Cable clip for a 6 mm cable, desk edge 18 mm. Millimetres, Z up, standing on z = 0.
/* [Fit] */
cable_d = 6.0; // measured, calipers
grip = 0.3; // squeeze on the cable, assumed
desk = 18.0; // user said
/* [Build] */
wall = 2.4; // six perimeters at 0.4 mm
width = 12;
$fn = $preview ? 32 : 96;
eps = 0.01; // overlap so cuts don't leave skins
slot_d = cable_d - grip;
difference() {
cube([desk + 2 * wall, width, 20]);
translate([wall, -eps, -eps]) cube([desk, width + 2 * eps, 20 - wall + eps]);
translate([-eps, width / 2, 20 + slot_d / 4]) rotate([0, 90, 0]) cylinder(d = slot_d, h = wall + 2 * eps);
}
base and
overhang checks read it that way./* [Group] */, // note) make the parameters editable in OpenSCAD's own panel, so your
user can change the part without you.eps overlaps on every cut. A cut whose face lands exactly on a face leaves a paper-thin skin or a
non-manifold edge. Make the cutter longer by eps on each open side.echo(slot = slot_d, inner = desk);. OpenSCAD prints every echo when it renders,
so you can read the numbers you built from beside the measurements.square, circle, polygon and offset, then
linear_extrude or rotate_extrude. offset(r = 2) offset(delta = -2) rounds every outside corner of a profile;
offset(r = -2) offset(delta = 2) rounds the inside ones.hull() for organic-looking hard surfaces: two cylinders hulled make a slot or a rounded bar; four spheres make a
rounded block. Cheap and exact.module screw_post(d, h) { … }. A for loop
places them; never copy and paste a feature.cylinder(d = 5.7 / cos(30), $fn = 6)). Check the insert's own sheet when your user names
one, and say which numbers are assumed.hull() of the circle and a point above it at 45°)
or a flat top, and the part needs no supports.linear_extrude(0.6) text("A1", size = 6, font = "Liberation Sans:style=Bold", halign = "center");. At least
5 mm tall and 0.6 mm deep to print legibly.minkowski() with a sphere and big $fn costs minutes (seconds with Manifold);
hull() over many children and huge for unions do too. Round with offset in 2D or BOSL2's rounding= instead.include <BOSL2/std.scad> once at the top. What it saves you:
| Need | BOSL2 |
|---|---|
| A rounded or chamfered block | cuboid([40, 30, 10], rounding = 2, edges = "Z", anchor = BOTTOM) |
| Round only some edges | cuboid(s, rounding = 2, except = BOTTOM), edges = [TOP, "Z"] |
| A rounded cylinder or tube | cyl(h = 10, d = 20, rounding2 = 1), tube(h = 10, od = 20, id = 16) |
| Put one part on another | cuboid(s) attach(TOP) cyl(h = 5, d = 8, anchor = BOTTOM); |
Cut with tags instead of difference() | diff() cuboid(s) tag("remove") attach(TOP) cyl(h = 4, d = 3.4, anchor = TOP); |
| Rows and grids | xcopies(spacing = 10, n = 4), grid_copies(spacing = 12, n = [3, 2]) |
| Threads | include <BOSL2/threading.scad> then threaded_rod(d = 10, l = 20, pitch = 1.5) |
| Screws and their holes | include <BOSL2/screws.scad> then screw("M3", length = 10), screw_hole("M3", length = 10, head = "socket") |
| Gears | include <BOSL2/gears.scad> then spur_gear(mod = 1, teeth = 20, thickness = 6) |
| Text on a face | text3d("A1", h = 0.6, size = 6, anchor = BOTTOM) |
Anchors (TOP, BOTTOM, LEFT, FRONT, CENTER) place a shape by a named point instead of by arithmetic, which is
where most hand-written OpenSCAD goes wrong. Use anchor = BOTTOM on the base so the part stands on z = 0. For a
printed thread, give it the printer's clearance: threaded_rod(…, $slop = 0.1) (BOSL2's $slop is clearance per
side; take it from your user's printer notes or fit coupon).
For a print with more than one part (a box and its lid, a pin and its sleeve), declare the parts at the top level and
draw each one when part names it, so each renders on its own with -D 'part="lid"':
parts = ["box", "lid"]; // render each with -D 'part="box"'
part = "all";
fit = 0.2; // slide clearance per side, from the printer's profile
module box() { … }
module lid() translate([0, 0, box_h]) { … } // where it sits assembled
if (part == "all" || part == "box") box();
if (part == "all" || part == "lid") lid();
Model the parts assembled, where they sit together; say how each pair mates in the review spec's fits
({"a": "lid", "b": "box", "kind": "slide"}) and how each prints in print_pose. Size every mating feature from the
printer's clearance, never a guessed number: a 20 mm boss in a slide fit gets a hole of 20 + 2 * fit.
A case around a board, a snap fit, a pipe clip or a threaded lid: read references/enclosures.md first. It has the
board drawing rule (named revision, every opening with a line, cutouts sized for the plug's body), the snap strain
formula and limits per plastic, vents, and the clash render with a control that proves the case is empty where the
board and plugs sit, with a worked case file and the commands to run it.
Each round is: edit main.scad, render it, measure it, look at the sheet, change one thing.
openscad -o round-1.stl main.scad # add --backend=Manifold when this OpenSCAD has it (much faster)
echo '{"path": "round-1.stl", "sheet": "round-1.png", "print": true, "size_mm": [60, 30, 20]}' > spec.json
python3 scripts/review_mesh.py spec.json
It prints the mesh checks as JSON (watertight, manifold, size, base, overhang and the rest) and writes the sheet, eight
views and silhouettes, to round-1.png: open that image and look at it. Add bed_mm from the printer. For a part
with several pieces, render each alone (-D 'part="lid"') and check each; the checker measures fits only between named
parts of one OBJ, GLB or ASCII STL, so otherwise check a fit by the numbers in the file. Keep one line per round in
rounds.md. Warnings OpenSCAD prints (Ignoring unknown variable) are failures: fix every one.
What fails at render, with OpenSCAD's own message:
| It says | It means |
|---|---|
Parser error … line N | A missing ;, ) or } on or just before line N |
The model is empty | A module defined and never called, or a difference() whose first child is empty |
The model is 2D | A profile never extruded |
took longer than | $fn too high, minkowski(), or a huge for union; block out lower |
And warnings are failures. Ignoring unknown variable or unknown module means a part
is missing from the model while the render looks fine: fix every one before you answer the rubric.
manifold and debris catch them). Overlap by eps, or keep a
real gap between separate parts.echo(wall = outer - inner)) and keep it above 1.2 mm for FDM.cube(s, center = true) and BOSL2's
anchors say which; pick one and keep it for the whole file.$preview geometry and % or # modifiers don't export. review_mesh.py checks the
rendered mesh, not the preview; trust the sheet.polyhedron(). Faces must list points clockwise seen from outside; a wrong one shows magenta
on the sheet. Prefer hull() or linear_extrude to hand-written polyhedra.The finished round's file and its main.scad (with the parameters your user can change and where each came from),
the sheet, and for a print the print sheet as the hildegard-print skill describes. Say which numbers were measured
and which assumed. No weapons or weapon parts, in any form.
main.scad, parameters first, no placeholders; every bare number in the geometry is a bug.size, not a summary of them.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
openscad, cad, 3d-printing, parametric-design, bracket, enclosure
Other plugins' skills for the same job
npx claudepluginhub students-of-local/hildegard --plugin hildegard17 skills in this plugin
/hildegardUse for /hildegard, /art, /vus, /mus, /suno and any request to make, edit or write creative work; routes images, video, sound, music, 3D, games, web and every kind of writing./hildegard-3dUse when making a 3D model, sculpture, figurine, game asset, relief or lithophane in Blender, OpenSCAD or code, checked each round for views, watertightness and size./hildegard-artUse when making art, an image, illustration, key art, mood board or visual style with the user's image model; posters and covers with words go to hildegard-design./hildegard-blogUse when writing a blog post, newsletter, email, about page, bio or announcement in a person's own voice, learned from their samples and edits after a short interview./hildegard-craftUse before and after generating or editing a picture, video, song, voice or caption, to write the brief, lint the prompt, review each take against the rubric and decide whether to deliver./hildegard-designUse when designing a poster, flyer, social post, album or book cover, invitation, menu, sign, banner or logo, built in HTML and SVG at its exact size and read back line by line.