CommunityCoding & Developmentgithub.com

leewsimpson/claudesk

Build or rebuild the enclosure in Fusion 360 from the repo's Python scripts via the Fusion MCP. Use when changing enclosure geometry or parameters, adding a feature, or when Fusion's model is missing or stale.

What is claudesk?

claudesk is a Claude Code agent skill that build or rebuild the enclosure in Fusion 360 from the repo's Python scripts via the Fusion MCP. Use when changing enclosure geometry or parameters, adding a feature, or when Fusion's model is missing or stale.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/leewsimpson/claudesk/tree/HEAD/3d-model/.claude/skills/fusion-build

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Building the enclosure in Fusion

The scripts in scripts/ are the source of truth. The Fusion document is a disposable render of them. Change the script and rebuild. Hand edits in the Fusion GUI are lost on the next build.

Steps

  1. Fusion ready. Run the runner below with an empty body. If there's no active design, create one and import boardmodel/ESP32-S3-Touch-AMOLED-1_75.stp into the root at identity (importManager.createSTEPImportOptions + importToTarget). Done when the root has occurrence ESP32-S3-TOUCH-AMOLED-1_75_ASM:1.
  2. Edit. Parameters live in the P dict at the top of scripts/enclosure.py. Values derived from them go in derived(). Geometry goes in build_shell / build_cap / build_refs. Helpers go in scripts/wslib.py.
  3. Rebuild with the runner. build(overrides) accepts a dict for quick experiments, e.g. {'lattice': False} (a rebuild without the lattice takes about 1 s; with the v2 fine knit about 12 s). Done when it prints built in … with no traceback.
  4. Verify using the fusion-inspect skill. A build is only done when the checks print PASS and you've looked at a screenshot.

Runner (paste as the MCP script)

import sys, importlib
REPO = r'C:\Github\claudesk\3d-model\scripts'  # absolute path to 3d-model/scripts in your clone
if REPO not in sys.path: sys.path.insert(0, REPO)
import wslib, enclosure, checks
for m in (wslib, enclosure, checks): importlib.reload(m)

def run(_context: str):
    enclosure.build()          # or enclosure.build({'sphere_d': 90})

Fusion's Python caches modules between runs. Always keep the reload line, or edits won't take effect.

If the mcp__fusion__* tools are missing

When the MCP server failed to connect at session start (e.g. Fusion wasn't running yet), check that Fusion is up (netstat -ano | grep 27182 shows LISTENING). Then either ask the user to reconnect with /mcp, or call the endpoint directly: save the runner to a file and run python scripts/fmcp.py script runner.py. For a screenshot, run python scripts/fmcp.py shot out.png [direction].

Conventions

  • Work in mm through wslib (P(), box(), cyl_y(), …). Only raw API calls see Fusion's cm, via wslib.MM.
  • Model with temporary B-Rep (wslib.tbm() and the union/cut/intersect helpers), then commit with add_bodies. This is fast, needs no timeline, and works in both parametric and direct designs.
  • Each build deletes and recreates the top-level components Enclosure (Shell, Cap) and Refs. Refs holds ghost bodies (PlugGhost, SpeakerGhost) for parts we don't have CAD for. They only exist for clash checks and are never exported. When a new bought part matters for fit, add a ghost for it.
  • Frame: the board STEP as imported. +Y is the viewing direction, the glass front is at y=2.78, the USB-C mouth faces -X, and the desk sits below -Z, tilted back by base_tilt (30°) so the screen faces up at the user (derived()['down']).
  • Board facts come from measuring the STEP. Measure with a script and record them in CLAUDE.md rather than guessing from the PDF.
  • Let exceptions propagate. The traceback is the only failure signal the MCP returns.

Individual skills in this repo

This repo contains 2 individual skills — each has its own dedicated page.

Related Skills