{"skill":{"slug":"agentcad-skill","displayName":"Agentcad Skill","summary":"CAD tool for AI agents. Use when the user asks you to design, model, or build a 3D object. agentcad executes CadQuery Python scripts and produces STEP files,...","description":"---\nname: agentcad\ndescription: 'CAD tool for AI agents. Use when the user asks you to design, model,\n  or build a 3D object. agentcad executes CadQuery Python scripts and produces STEP\n  files, PNG renders, mesh exports (STL/GLB/OBJ), and geometric metrics.\n\n  '\ncompatibility: Requires Python 3.10-3.12 and agentcad installed (pip install agentcad).\nallowed-tools: Bash(agentcad:*)\nversion: 0.2.0\nmetadata:\n  openclaw:\n    requires:\n      bins:\n      - agentcad\n      anyBins:\n      - python3.12\n      - python3.11\n      - python3.10\n---\n\n# agentcad — CAD tool for AI agents\n\nYou have access to `agentcad`, a CLI that turns CadQuery Python scripts into\n3D geometry. All output is JSON. Every command returns `\"command\"` and `\"status\"` keys.\n\n## First-time setup\n\n```bash\nagentcad init --name <project_name>\nagentcad --help   # Read this — it is your complete operational briefing\n```\n\n## Core workflow\n\n1. **Write a script.** No imports needed — `cq`, `show_object`, and all helpers\n   are pre-injected. `show_object(result)` is required.\n\n2. **Dry-run first** to check metrics without consuming a version:\n   ```bash\n   agentcad run script.py --output test --dry-run\n   ```\n   Check `volume`, `dimensions`, `is_valid` in the response.\n\n3. **Run for real.** Visual feedback is on by default:\n   ```bash\n   agentcad run script.py --output label\n   ```\n   Every successful run produces (paths in the JSON response):\n   - `preview.png` — 4-view composite (front, right, top, iso). **Read this**\n     to confirm the part looks right before iterating. One image, all 4 angles.\n   - `diff.side_by_side` — side-by-side PNG vs the most recent successful prior\n     version. **Read this** when iterating to see what your change did.\n   - `diff.overlay` — tinted (green prev, red this) overlay for subtle shifts.\n     Read only if side-by-side didn't resolve the question.\n   - `viewer.html` — interactive 3D viewer for the user (humans only; you can't\n     render HTML). Mention it to the user so they open it.\n\n   Pass `--no-preview` only for tight parametric sweeps where latency matters.\n\n4. **Show the user.** After a successful build, open the interactive viewer:\n   ```bash\n   agentcad view v1_label/viewer.html   # or output.step / output.glb\n   ```\n   Users expect to see the result in a browser. Do this every run, unprompted.\n\n5. **Inspect if invalid.** If `is_valid: false` or geometry looks wrong:\n   ```bash\n   agentcad inspect v1_label/output.step\n   ```\n\n6. **Iterate.** Fix the script, run with a new `--output` label. Use\n   `agentcad diff 1 2` to compare versions.\n\n## Script writing rules\n\n- `show_object(result)` is required — at least one call.\n- These are pre-injected (no import needed):\n  `cq`, `show_object`, `translate`, `rotate`, `mirror_fuse`, `loft_sections`,\n  `tapered_sweep`, `naca_wire`, `bbox_point`, `place_at`, `assemble`,\n  `ellipse_wire`, `spline_wire`, `polygon_wire`, `rounded_rect_wire`,\n  `elliptical_sweep`, `involute_gear_profile`\n- Helpers operate on `TopoDS_Shape`. Bridge with `.val().wrapped`:\n  ```python\n  part = cq.Workplane('XY').box(10, 20, 5).val().wrapped\n  moved = translate(part, 50, 0, 0)\n  ```\n- To show helper output:\n  ```python\n  show_object(cq.Workplane('XY').newObject([cq.Shape.cast(topo_shape)]))\n  ```\n- For OCP internals (`gp_Pnt`, `BRepPrimAPI`, etc.), import manually.\n\n## Key commands\n\n| Command | Purpose |\n|---------|---------|\n| `agentcad init --name NAME` | Initialize project |\n| `agentcad run SCRIPT --output LABEL` | Execute script, produce STEP + metrics |\n| `agentcad run ... --dry-run` | Metrics only, no version consumed |\n| `agentcad run ... --no-preview` | Suppress preview (on by default) |\n| `agentcad run ... --render iso,front` | PNG views |\n| `agentcad run ... --export stl,glb` | Mesh export |\n| `agentcad run ... --params k=v,k=v` | Override script parameters |\n| `agentcad render STEP --view SPEC` | Post-hoc renders with camera control |\n| `agentcad export STEP --format stl,glb` | Post-hoc mesh export |\n| `agentcad inspect STEP` | Topology report (validity, free edges) |\n| `agentcad diff REF1 REF2` | Compare versions |\n| `agentcad context` | Project state |\n| `agentcad docs [SECTION]` | Deep-dive docs (16 sections) |\n| `agentcad view FILE` | **Run this after every successful build** — opens GLB/STEP in the user's browser |\n\n## Debugging playbook\n\n1. **Check metrics first** — `volume` and `dimensions` catch most issues.\n2. **Read `preview.png`** — the 4-view composite. Fastest way to spot obvious problems.\n3. **Read `diff.side_by_side`** if iterating — confirms your change did what you intended.\n4. **Negative volume?** Wire winding is backwards (CW instead of CCW).\n5. **is_valid: false?** Run `agentcad inspect` — check `free_edge_count` and shell status.\n6. **Hollow shape?** `free_edge_count > 0` means open shell.\n7. **Complex profiles (gears, splines)?** Use subtractive construction — cut from\n   a blank cylinder/box instead of building up. See `agentcad docs patterns`.\n\n## Patterns\n\n- **Build at origin, then position:** Create geometry at origin, use `translate()`\n  and `rotate()` to place it.\n- **Compound vs Union:** `makeCompound()` for assemblies (parts stay separate),\n  `.union()` for boolean fuse into one solid.\n- **Parametric scripts:** Top-level variable assignments become overridable via\n  `--params`. Use this for iteration.\n- **Named parts:** `show_object(shape, name=\"wheel\", options={\"color\": \"red\"})`\n  for per-part metrics and colored GLB export.\n","tags":{"latest":"0.2.0"},"stats":{"comments":0,"downloads":330,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1778042097673,"updatedAt":1778492854429},"latestVersion":{"version":"0.2.0","createdAt":1778042097673,"changelog":"agentcad-skill 0.2.0\n\n- Introduces a comprehensive agentcad usage guide in SKILL.md, outlining setup, workflow, script rules, and command references.\n- Documents pre-injected helper functions and best practices for writing CadQuery scripts.\n- Lists all key agentcad CLI commands, including build, view, inspect, and export options.\n- Provides debugging tips and recommended construction patterns for reliable 3D modeling.\n- Specifies compatibility requirements: Python 3.10–3.12 and agentcad installed.","license":"MIT-0"},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"jdilla1277","userId":"s17a7cme8f0cnkjade7j6fmns1858ej4","displayName":"jdilla1277","image":"https://avatars.githubusercontent.com/u/89669079?v=4"},"moderation":null}