skill
fusion-export-molecule
Public Made by Adomby adom
Ship a Fusion 360 Electronics design to the Adom wiki as a molecule: bridge-driven export (BRD/SCH/F3D/STEP/USDZ, Gerbers and drill), <slug>-fab.zip and export.json, a sources-only publish through molecule-publish (the wiki's model registry builds the GLB, footprint and symbol), and adom-wiki model import into Hydrogen.
← Commit history
Publish 1.0.0
6 files changed
+383
SKILL.mdadded+273@@ -0,0 +1,273 @@+---+name: fusion-export-molecule+description: Export a Fusion 360 Electronics design as an Adom molecule — orchestrates existing AdomBridge primitives to produce BRD, SCH, F3D, STEP, USDZ, and silkscreen PNGs (the molecule source bundle). Also covers Kitchen Sink export (adds Gerbers, BOM, CPL). Use when the user says "export molecule", "fusion export molecule", "export for hydrogen", "hydrogen export", "export kitchen sink", "fusion export", "export brd sch f3d", "export gerbers bom cpl", "fusion export all files", "export usdz", or "export step". For a KiCad design, see kicad-export-molecule.+---++# Fusion Export for Molecule++Export a Fusion 360 Electronics design as an Adom molecule — the STEP + board + silkscreen bundle the wiki/OCCT pipeline and the Hydrogen viewer consume — by orchestrating AdomBridge CLI primitives from the container.++**Prerequisite:** `adom-desktop` must be connected (`adom-desktop ping`) and Fusion must be running with the design open.++## Architecture++The export is **orchestrated from the container** using existing `adom-desktop fusion_*` primitives. No custom add-in commands or HelperJoe buttons are needed — each step calls a standard AdomBridge verb.++```+Container (skill orchestration)+ │+ ├── fusion_export_eagle_source → BRD file+ ├── fusion_export_eagle_source → SCH file (after switching to schematic)+ ├── fusion_show_3d_board → switch to 3D view+ ├── fusion_export_f3d → Fusion archive+ ├── fusion_export_step → STEP 3D model+ ├── fusion_export_usdz → AR/Hydrogen 3D model+ ├── fusion_take_silkscreen_screenshot → top silkscreen PNG+ ├── fusion_take_silkscreen_screenshot → bottom silkscreen PNG+ └── pull_file → copy all files to container+```++## Export the molecule — Step by Step++### Step 0: Open the board + verify state++**Open the `.fbrd` board file DIRECTLY — never the bare name or the `.fprj`.** A Fusion+electronics file that links to multiple designs (most "FRAME MOL" boards) pops a native+**"Select Electronics Design File" picker** when you open the project/bare name. That picker+is a **CEF/Chromium modal that cannot be driven headlessly** (keyboard doesn't reach its list;+screen-coord clicks are unreliable on multi-monitor/HiDPI). Targeting the `.fbrd` skips it+entirely and lands straight in PCB Editor (live-confirmed):++```bash+adom-desktop fusion_open_cloud_file '{"projectName":"Main","folderPath":"Molecules/COSMIIC","fileName":"PG4 FRAME MOL","fileExtension":"fbrd","recovery":"discard"}'+# → doc opens in PCB Editor, NO picker. (Omitting fileExtension may hit the multi-design picker.)+```++Then verify:+```bash+adom-desktop fusion_get_app_state '{}'+```+Ensure: Fusion running, `activeWorkspace` is `PCB Editor`, `isElectronics: true`.++If a "Select Electronics Design File" dialog DID appear (e.g. a `.fbrd` that itself links to+multiple designs), it can't be resolved headlessly today — pick on the desktop, or fall back to+CDP into the CEF dialog. `fusion_window_info` / the bridge's `blockingDialogs` will name it.++If already open but not in PCB Editor:+```bash+adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'+```++### Step 1: Export BRD++```bash+adom-desktop fusion_export_eagle_source '{"outputPath":"C:/tmp/export/<name>.brd","format":"brd"}'+```++### Step 2: Export SCH++Switch to schematic, then export:+```bash+adom-desktop fusion_electron_run '{"command":"EDIT .s1"}'+sleep 2+adom-desktop fusion_export_eagle_source '{"outputPath":"C:/tmp/export/<name>.sch","format":"sch"}'+```++Switch back to board after:+```bash+adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'+```++### Step 3: Switch to 3D view++```bash+adom-desktop fusion_show_3d_board '{}'+```++Wait for workspace to switch (5-10s). Verify:+```bash+adom-desktop fusion_get_app_state '{}'+# Expected: activeWorkspace: "Design" or "3D PCB"+```++### Step 4: Export F3D++```bash+adom-desktop fusion_export_f3d '{"outputPath":"C:/tmp/export/<name>.f3d"}'+```++### Step 5: Export STEP++```bash+adom-desktop fusion_export_step '{"outputPath":"C:/tmp/export/<name>.step"}'+```++### Step 6: Export USDZ++```bash+adom-desktop fusion_export_usdz '{"outputPath":"C:/tmp/export/<name>.usdz"}'+```++### Step 7: Capture silkscreen PNGs++```bash+adom-desktop fusion_take_silkscreen_screenshot '{"outputPath":"C:/tmp/export/<name>_silkscreen_top.png","layer":"top"}'+adom-desktop fusion_take_silkscreen_screenshot '{"outputPath":"C:/tmp/export/<name>_silkscreen_bottom.png","layer":"bottom"}'+```++These produce 2048x2048 transparent-background PNGs. Requires the 3D Design view (done in Step 3). Each capture takes ~3s (includes 1s render sleep).++### Step 8: Pull files to container++```bash+adom-desktop pull_file '{"filePaths":["C:/tmp/export/<name>.brd","C:/tmp/export/<name>.sch","C:/tmp/export/<name>.f3d","C:/tmp/export/<name>.step","C:/tmp/export/<name>.usdz","C:/tmp/export/<name>_silkscreen_top.png","C:/tmp/export/<name>_silkscreen_bottom.png"],"saveTo":"/tmp/export"}'+```++### Output files++| File | Format | Description |+|------|--------|-------------|+| `<name>.brd` | EAGLE board | PCB layout |+| `<name>.sch` | EAGLE schematic | Circuit schematic |+| `<name>.f3d` | Fusion archive | Full parametric 3D model |+| `<name>.step` | STEP | CAD interchange 3D model |+| `<name>.usdz` | USDZ | AR/Hydrogen 3D viewer |+| `<name>_silkscreen_top.png` | PNG | Top silkscreen render (transparent bg) |+| `<name>_silkscreen_bottom.png` | PNG | Bottom silkscreen render (transparent bg) |++## Kitchen Sink Export++For manufacturing files in addition to the Hydrogen export, add these steps after Step 7:++### Gerbers++Switch back to 2D board first:+```bash+adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'+sleep 3+adom-desktop fusion_export_gerbers '{"outputPath":"C:/tmp/export/gerbers.zip"}'+```++### BOM++```bash+adom-desktop fusion_export_bom '{"outputPath":"C:/tmp/export/bom.csv"}'+```++### CPL++```bash+adom-desktop fusion_export_cpl '{"outputPath":"C:/tmp/export/cpl.csv"}'+```++## Saving Designs++The cloud save command:+```bash+adom-desktop fusion_execute_text_command '{"command":"Commands.Start PLM360SaveCommand"}'+```++This opens a Save dialog. Find and confirm it:+```bash+# Wait for dialog+sleep 5+# Press Enter to confirm (finds Save dialog automatically)+adom-desktop fusion_send_key '{"key":"enter"}'+```++## Caching Bug Workaround++After saving, exports may produce stale files. Workaround:+1. Close all project tabs: `adom-desktop fusion_close_document '{"save":false}'` (repeat)+2. Reopen the **board** (`.fbrd`, NOT `.fprj` — the project file triggers the multi-design picker): `adom-desktop fusion_open_cloud_file '{"projectName":"Main","fileName":"<name>","fileExtension":"fbrd","folderPath":"<path>"}'`+3. Switch to board view if needed: `adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'`+4. Run the export steps above++## After Export — Publish++Once all files are in the user's local Downloads folder, **ask the user** whether they want to publish. Two destinations:++### Publish to the Adom Wiki — `adom-wiki pkg publish` (canonical; the wiki is wiki.adom.inc)++The wiki is the source of truth. A molecule is a **wiki `component` package**: a directory+with a `package.json` + the exported source files. `adom-wiki pkg publish` **auto-converts STEP→GLB**+(live step2glb service), runs the pre-publish lint, generates the page, and creates a release.+(The old `adom-wiki page publish` / `asset upload` CLI targeted **wiki-v1** and is retired — do+not use it for the new wiki.)++**1. Stage the package dir** — the pulled export files + a `package.json`. **Do NOT include a+`page.json`** (the server generates a correct one; a stale/foreign one silently overrides+ownership — see gotchas):++```bash+cd /tmp/export/<name> # holds <name>.step/.f3d/.fbrd/.fsch/.usdz, *_gerbers.zip, bom.csv, cpl.csv, board PNGs, README.md+cat > package.json <<'JSON'+{+ "slug": "<molecule-slug>",+ "version": "1.0.0",+ "type": "component",+ "description": "<at least 20 chars describing the molecule>",+ "tags": ["molecule", "<org-or-family>", "<function>"],+ "dependencies": {},+ "license": "MIT",+ "component": { "mpn": "<name>", "manufacturer": "", "category": "other" }+}+JSON+```++**2. Publish** (owner = your account, or an org you belong to via `--org`). This is where STEP→GLB runs:++```bash+adom-wiki pkg publish --org <org>+# → "Converting <name>.step → <name>.glb via step2glb..." then "Published <org>/<slug>@<version>"+```++**3. Set visibility explicitly** (the `--public`/`--private` flag is only honored on first publish):++```bash+adom-wiki page visibility <owner>/<slug> --preset open # or: private+```++**Gotchas (hard-won):**+- **Include a `.step`** — that's what triggers GLB generation; without it the 3D viewer is blank. (`has_3d_model` / `model_3d_path` get set automatically once the `.glb` is produced.)+- **Never push a stale/foreign `page.json`.** On the new wiki it's authoritative for `org_id`/`author`/`visibility`/`version` and **overrides `--org`/`--private` on reindex** (only `owner` is protected). Omit it. If a page's org binding drifts, repair it:+ ```bash+ curl -X POST https://wiki.adom.inc/api/v1/pages/<slug>/transfer -H "Authorization: Bearer $(cat /var/run/adom/api-key)" -H "Content-Type: application/json" -d '{"org":"<org>"}'+ ```+- **Ownership ≠ visibility.** `--org X` makes any member of org **X** an editor (regardless of public/private); `public` just means anyone can *view*. To make a molecule editable by a team, publish/transfer under their org.+- Lint warns "no `.kicad_sym`/`.kicad_mod`" for Fusion designs — expected, non-blocking.+- Manage/delete: `adom-wiki pkg info <owner>/<slug>`, `adom-wiki repo delete <owner>/<slug>` (soft, reversible via `adom-wiki repo undelete`).++### Publish to Hydrogen (live project use)++Hydrogen is where molecules are used in actual projects. Uses the `adom-molecule` CLI (published by John, v0.1.0).++```bash+# Install if not present+which adom-molecule || (gh release download --repo adom-inc/adom-molecule --pattern 'adom-molecule' --output /tmp/adom-molecule-bin && sudo mv /tmp/adom-molecule-bin /usr/local/bin/adom-molecule && sudo chmod +x /usr/local/bin/adom-molecule)++# Upload to a user's Hydrogen account+adom-molecule create --name "<molecule-name>" --owner <username> \+ --usdz <name>.usdz --f3d <name>.f3d --brd <name>.brd+```++The molecule becomes available at `https://hydrogen.adom.inc/<username>/molecules/<name>` and auto-queues 3D optimization (USDZ→GLB via Blender pipeline).++### Suggested prompt after export++After the export completes, tell the user:++> "All files exported to `<folder>`. Would you like me to:+> 1. **Publish to the Adom Wiki** — creates a molecule reference page with pin map, BOM, and assets+> 2. **Upload to Hydrogen** — makes it available in your Hydrogen projects at `hydrogen.adom.inc/<user>/molecules/<name>`+> 3. **Both**+> 4. **Skip** — just keep the files locally"++## Important Notes++- **Focus stealing:** Steps 3 and 7 switch Fusion workspaces, which steals desktop focus. Warn the user.+- **3D view required for Steps 4-7.** If `fusion_show_3d_board` fails, the user may need to run "Push to 3D PCB" manually from the Design tab.+- **Silkscreen capture** requires the 3D Design view, not PCB Editor. Always do Steps 4-7 after Step 3.+- **pull_file from Google Drive paths** may produce empty files. Use shell_execute + base64 as a workaround if the output folder is on Google Drive.+- **Shell execute needs approval** on the Adom Desktop app for each new script.+- **adom-molecule CLI** is at `adom-inc/adom-molecule` (Rust, published by John). Install via GitHub release.
docs/hero-src.htmladded+45@@ -0,0 +1,45 @@+<!doctype html>+<html><head><meta charset="utf-8"><style>+ * { margin:0; padding:0; box-sizing:border-box; }+ body { width:1600px; height:1000px; background:+ radial-gradient(1200px 700px at 75% -10%, #14324a 0%, #0b1420 55%, #070d15 100%);+ font-family: 'Segoe UI', system-ui, sans-serif; overflow:hidden; position:relative; }+ .glow { position:absolute; width:900px; height:900px; border-radius:50%;+ background: radial-gradient(circle, rgba(45,212,191,.10) 0%, rgba(59,130,246,.06) 45%, transparent 70%);+ right:-180px; top:-260px; }+ .win { position:absolute; left:170px; top:210px; width:1260px; border-radius:14px;+ background:#0d1826; border:1px solid #1e3348;+ box-shadow: 0 40px 90px rgba(0,0,0,.65), 0 0 0 1px rgba(45,212,191,.05); }+ .bar { height:46px; display:flex; align-items:center; padding:0 18px; gap:8px;+ border-bottom:1px solid #16293c; }+ .dot { width:12px; height:12px; border-radius:50%; background:#22384e; }+ .title { margin-left:12px; color:#5b7astro; color:#5b7a99; font-size:14px; letter-spacing:.4px; }+ .body { padding:26px 34px 34px; font-family:'Cascadia Mono','Consolas',monospace; font-size:17px; line-height:1.85; }+ .p { color:#7dd3c8; }+ .cmd{ color:#e6edf5; }+ .ok { color:#4ade80; }+ .fl { color:#8aa4c0; }+ .accent { position:absolute; left:0; right:0; top:0; height:3px; border-radius:14px 14px 0 0;+ background:linear-gradient(90deg,#2dd4bf,#3b82f6,#8b5cf6); }+</style></head><body>+ <div class="glow"></div>+ <div class="win">+ <div class="accent"></div>+ <div class="bar"><div class="dot"></div><div class="dot"></div><div class="dot"></div>+ <div class="title">adom-desktop · Fusion 360 Electronics · piprobe.fbrd</div></div>+ <div class="body">+ <div><span class="p">$</span> <span class="cmd">adom-desktop fusion_export_eagle_source</span> <span class="fl">--board</span></div>+ <div class="ok"> piprobe.brd written 214 KB</div>+ <div><span class="p">$</span> <span class="cmd">adom-desktop fusion_export_eagle_source</span> <span class="fl">--schematic</span></div>+ <div class="ok"> piprobe.sch written 187 KB</div>+ <div><span class="p">$</span> <span class="cmd">adom-desktop fusion_export_step</span></div>+ <div class="ok"> piprobe.step written 3.4 MB</div>+ <div><span class="p">$</span> <span class="cmd">adom-desktop fusion_export_usdz</span></div>+ <div class="ok"> piprobe.usdz written 2.1 MB</div>+ <div><span class="p">$</span> <span class="cmd">adom-desktop fusion_take_silkscreen_screenshot</span> <span class="fl">--top --bottom</span></div>+ <div class="ok"> piprobe_silk_top.png piprobe_silk_bottom.png</div>+ <div><span class="p">$</span> <span class="cmd">adom-desktop pull_file</span> <span class="fl">exports/*</span></div>+ <div class="ok"> molecule bundle ready — 7 files</div>+ </div>+ </div>+</body></html>
docs/shot.pngadded⋯ 1 unchanged line ⋯
install.shadded+9@@ -0,0 +1,9 @@+#!/bin/bash+set -e+PKG_DIR="$(cd "$(dirname "$0")" && pwd)"+SKILLS_DIR="$HOME/.claude/skills"+mkdir -p "$SKILLS_DIR/fusion-export-molecule"+rm -rf "$SKILLS_DIR/fusion-export-molecule"+mkdir -p "$SKILLS_DIR/fusion-export-molecule"+cp "$PKG_DIR/SKILL.md" "$SKILLS_DIR/fusion-export-molecule/SKILL.md"+echo "Installed skill → $SKILLS_DIR/fusion-export-molecule/SKILL.md"
package.jsonadded+53@@ -0,0 +1,53 @@+{+ "slug": "fusion-export-molecule",+ "version": "1.0.0",+ "type": "skill",+ "description": "Export a Fusion 360 Electronics design as an Adom molecule \u2014 orchestrates AdomBridge primitives to produce the BRD, SCH, F3D, STEP, USDZ, and silkscreen PNG source bundle the molecule pipeline (wiki, OCCT, Hydrogen) consumes. Successor to fusion-export-for-hydrogen.",+ "tags": [+ "molecule",+ "fusion360",+ "export",+ "hydrogen",+ "skill"+ ],+ "dependencies": {+ "adom/adom-desktop": "^1.9.0"+ },+ "scripts": {+ "install": "./install.sh",+ "uninstall": "./uninstall.sh"+ },+ "hero": {+ "headline": "Fusion design to molecule bundle",+ "subhead": "BRD, SCH, STEP, USDZ, and silkscreen in one orchestrated export",+ "screenshot": "docs/shot.png"+ },+ "discovery_triggers": [+ "export molecule",+ "fusion export molecule",+ "export for hydrogen",+ "hydrogen export",+ "export kitchen sink",+ "fusion export",+ "export brd sch f3d",+ "export gerbers bom cpl",+ "fusion export all files",+ "export usdz",+ "export step from fusion"+ ],+ "discovery_pitch": "Export a Fusion 360 Electronics design as the complete Adom molecule source bundle (BRD, SCH, F3D, STEP, USDZ, silkscreen PNGs) by driving adom-desktop bridge verbs from the container.",+ "sample_prompts": [+ {+ "label": "Export a molecule",+ "prompt": "Export the open Fusion design as a molecule"+ },+ {+ "label": "Hydrogen export",+ "prompt": "Do a fusion export for hydrogen on piprobe"+ },+ {+ "label": "Kitchen sink",+ "prompt": "Export the kitchen sink for this board - gerbers, BOM and CPL too"+ }+ ]+}
uninstall.shadded+3@@ -0,0 +1,3 @@+#!/bin/bash+rm -rf "$HOME/.claude/skills/fusion-export-molecule"+echo "Removed fusion-export-molecule skill"