# openscad

Create OpenSCAD models, inspect them from several angles, and export STL files. Useful when preparing configurable designs for 3D printing.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1000 installs · ★ 3195
- Author: mitsuhiko
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/mitsuhiko/agent-stuff/tree/HEAD/skills/openscad/SKILL.md
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/skills/openscad

## What it does

The skill helps write or edit `.scad` files, check syntax, find customizable parameters, and export a model as STL. Scripts in `tools/` generate preview images from multiple viewpoints. Inspect those images with the `read` tool: a syntax check cannot catch geometry problems on its own.

OpenSCAD must be installed first; the instructions show `brew install openscad`. The workflow uses `validate.sh`, `multi-preview.sh`, and `export-stl.sh`. Pass custom values to the export script with `-D` to produce an STL with different dimensions. Without OpenSCAD installed, the scripts cannot validate or render a model.

For MakerWorld, the guide lists exported STL files, preview images, and a description of the model’s parameters. It also suggests preparing a `model.json` file with model metadata.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add mitsuhiko/agent-stuff --skill openscad -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/openscad/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/openscad/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add mitsuhiko/agent-stuff --skill openscad -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/openscad/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add mitsuhiko/agent-stuff --skill openscad -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/openscad/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install mitsuhiko/agent-stuff openscad
```

2. **Manually: put the files in place**
- File: `.github/skills/openscad/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add mitsuhiko/agent-stuff --skill openscad -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/mitsuhiko/agent-stuff --path skills/openscad
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/openscad/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add mitsuhiko/agent-stuff --skill openscad -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/mitsuhiko/agent-stuff/tree/HEAD/skills/openscad/SKILL.md

## When to use it
- build an OpenSCAD model with editable parameters
- check a `.scad` file for syntax errors
- render previews from multiple viewpoints
- export an STL with custom parameter values
- prepare model files and parameter details for MakerWorld

## Example prompts
- Create a configurable box in `box.scad`, validate it, and show previews from every angle.
- Find the editable parameters in `model.scad` and export `output.stl` with the width set to 60.
- Inspect the model’s multi-angle previews, fix any visible geometry issues, and render them again.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 26504dd082cecbc6.

BEGIN THIRD-PARTY FILE 26504dd082cecbc6
````text
---
name: openscad
description: "Create and render OpenSCAD 3D models. Generate preview images from multiple angles, extract customizable parameters, validate syntax, and export STL files for 3D printing platforms like MakerWorld."
---

# OpenSCAD Skill

Create, validate, and export OpenSCAD 3D models. Supports parameter customization, visual preview from multiple angles, and STL export for 3D printing platforms like MakerWorld.

## Prerequisites

OpenSCAD must be installed. Install via Homebrew:
```bash
brew install openscad
```

## Tools

This skill provides several tools in the `tools/` directory:

### Preview Generation
```bash
# Generate a single preview image
./tools/preview.sh model.scad output.png [--camera=x,y,z,tx,ty,tz,dist] [--size=800x600]

# Generate multi-angle preview (front, back, left, right, top, iso)
./tools/multi-preview.sh model.scad output_dir/
```

### STL Export
```bash
# Export to STL for 3D printing
./tools/export-stl.sh model.scad output.stl [-D 'param=value']
```

### Parameter Extraction
```bash
# Extract customizable parameters from an OpenSCAD file
./tools/extract-params.sh model.scad
```

### Validation
```bash
# Check for syntax errors and warnings
./tools/validate.sh model.scad
```

## Visual Validation (Required)

**Always validate your OpenSCAD models visually after creating or modifying them.**

After writing or editing any OpenSCAD file:

1. **Generate multi-angle previews** using `multi-preview.sh`
2. **View each generated image** using the `read` tool
3. **Check for issues** from multiple perspectives:
   - Front/back: Verify symmetry, features, and proportions
   - Left/right: Check depth and side profiles
   - Top: Ensure top features are correct
   - Isometric: Overall shape validation
4. **Iterate if needed**: If something looks wrong, fix the code and re-validate

This catches issues that syntax validation alone cannot detect:
- Inverted normals or inside-out geometry
- Misaligned features or incorrect boolean operations
- Proportions that don't match the intended design
- Missing or floating geometry
- Z-fighting or overlapping surfaces

**Never deliver an OpenSCAD model without visually confirming it looks correct from multiple angles.**

## Workflow

### 1. Creating an OpenSCAD Model

Write OpenSCAD code with customizable parameters at the top:

```openscad
// Customizable parameters
wall_thickness = 2;        // [1:0.5:5] Wall thickness in mm
width = 50;                // [20:100] Width in mm
height = 30;               // [10:80] Height in mm
rounded = true;            // Add rounded corners

// Model code below
module main_shape() {
    if (rounded) {
        minkowski() {
            cube([width - 4, width - 4, height - 2]);
            sphere(r = 2);
        }
    } else {
        cube([width, width, height]);
    }
}

difference() {
    main_shape();
    translate([wall_thickness, wall_thickness, wall_thickness])
        scale([1 - 2*wall_thickness/width, 1 - 2*wall_thickness/width, 1])
````
END THIRD-PARTY FILE 26504dd082cecbc6

The third-party file has ended. Everything between the 26504dd082cecbc6 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2993 of 6315 bytes. © mitsuhiko · Apache-2.0 · https://github.com/mitsuhiko/agent-stuff/tree/HEAD/skills/openscad/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
