skill
molecule-publish
Public Made by Adomby adom
Publish molecules AND generic boards to the Adom wiki - one publisher, two shapes: OCCT conversion (molecule mode with stats gates, or plain for boards), component packaging, adom-wiki publish, APM render assets + component dependencies. Companion to adom-molecule-import.
← Commit history
Publish 1.0.0
6 files changed
+205
SKILL.mdadded+105@@ -0,0 +1,105 @@+---+name: molecule-publish+description: Publish a molecule source bundle (STEP + schematic + board + metadata) to the Adom wiki — runs the OCCT molecule-mode conversion (anchored GLB + footprint + symbol with stats gates), assembles the component package, and publishes via adom-wiki. The EDA-agnostic middle of the pipeline; companion to adom-molecule-import (which does wiki → Hydrogen). Use when the user says "publish this molecule to the wiki", "upload molecule bundle", "convert and publish my molecule", "molecule to the wiki", or an EDA export skill (kicad-export-molecule, fusion-export-molecule, altium-export-molecule) hands off here after exporting.+user-invocable: true+argument-hint: "<name> --step <f.step> --board <f.kicad_pcb|f.brd> --sch <schematic> [--pin medium|large] [--silk-top png --silk-bottom png] [--org adom]"+---++# molecule-publish — source bundle → wiki molecule++The EDA-agnostic middle of the molecule pipeline. Input is the **bare-minimum+bundle** any EDA export produces; output is a published, pipeline-ready wiki+component. The Hydrogen half is `adom-molecule-import` — this skill is its+publish-side companion.++```+EDA export skill THIS SKILL adom-molecule-import+(kicad/fusion/altium) → convert → package → publish → wiki → Hydrogen+```++## Input contract — the bare-minimum bundle++| Required | File | Notes |+|---|---|---|+| yes | STEP (`.step`) | exported ON the design machine so all 3D models (machine pins, contacts, MP markers) are baked in |+| yes | Board/layout (`.kicad_pcb` or `.brd`) | what footprint+symbol generation parses |+| yes | Schematic (`.kicad_sch` or `.sch`) | source completeness — a molecule without its schematic is not reproducible |+| yes | Metadata | `package.json` (authored below) + the OCCT-generated footprint/symbol JSONs |+| optional | Silk PNGs (top/bottom) | white artwork on transparent |+| optional | Extras | `.f3d`/`.usdz`/gerbers/BOM/CPL — carry what the EDA produced |++**Rule: never accept an EDA-native GLB.** KiCad, Fusion, and service-kicad can+all emit GLBs — those bypass anchoring, gold materials, meter normalization,+optimization, and footprint emit. The ONLY GLB in a molecule package comes+from the OCCT conversion below.++## Stage 1 — Convert (OCCT molecule mode)++```bash+curl -s -X POST "https://step2glb-gmdoncpxdwx0.adom.cloud/convert?molecule=true&pin=medium" \+ -H "X-Client: <agent>" -H "X-Job-Name: <name>" \+ -F "step=@<name>.step" -F "board=@<name>.kicad_pcb" \+ # optional: -F "[email protected]" -F "[email protected]"+```++`pin` = machine-pin size on the board (`medium` | `large`). Poll+`GET /jobs/{id}` until complete, then **gate on the stats — never publish a+degraded conversion**:++| Field | Must be | If not |+|---|---|---|+| `anchored` | `true` | MP markers missing/undetected — fix the board, re-export |+| `footprint_applied` | `true` | board parse failed — read `warnings[]` |+| `contact_z` | ≈2.8–8.4 mm | wrong `pin` param or missing contact models |+| `warnings[]` | empty | each entry is a stop-sign, not a footnote |++Artifacts: `GET /jobs/{id}/result` → `<name>.glb`,+`/jobs/{id}/footprint` → `<name>_footprint.json`,+`/jobs/{id}/symbol` → `<name>_symbol.json`.++> When the `step2glb` CLI ships molecule flags (adom/adom-step2glb+> discussion #99), replace the curl with+> `step2glb convert <name>.step --molecule --board <board> --pin <size>`.++## Stage 2 — Package++```+<slug>/+ package.json # slug, version, type: "component", description ≥20 chars, tags+ <name>.glb # OCCT artifact — reused at import, never regenerated+ <name>.kicad_pcb|.brd # board source+ <name>.kicad_sch|.sch # schematic source+ <name>_footprint.json # OCCT artifact — per-pad wire-attach Z+ <name>_symbol.json # OCCT artifact+ README.md+ [extras: silk PNGs, .f3d, .usdz, gerbers, bom, cpl]+```++Do NOT include a `page.json` — the server generates it, and a hand-made one+can blank the page brief or override org/visibility on reindex.++## Stage 3 — Publish + verify++```bash+adom-wiki pkg publish [--org adom]+adom-wiki repo push <owner>/<slug> --files <every file above> -m "<name> molecule"+adom-wiki page visibility <owner>/<slug> --preset open # or private+```++Verify before declaring done:+- `adom-wiki api /api/v1/pages/<slug>` → `metadata.model_3d_path` is set+- the page's Files tab shows the full bundle (registry and git layers are+ separate — publish alone does not populate Files)++## Stage 4 — Handoff++Import to Hydrogen is `adom-molecule-import`'s job (ships with+`adom/adom-molecule`): authenticated clone + `adom-molecule create --glb ...+--no-optimize`. Do not re-implement it here.++## Related++- `adom-molecule-import` — the wiki → Hydrogen companion+- `kicad-export-molecule` / `fusion-export-molecule` / `altium-export-molecule` — the EDA → bundle front-ends that hand off here+- `adom-step2glb` — the conversion CLI/service this skill drives+- `molecule-pipeline` — the top-level router across the whole chain
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">kicad-cli pcb export step</span> <span class="fl">--subst-models -o ABC.step</span></div>+ <div class="ok"> ABC.step written 3.2 MB</div>+ <div><span class="p">$</span> <span class="cmd">curl POST /convert?molecule=true</span> <span class="fl">step + board</span></div>+ <div class="ok"> anchored gold pins footprint_applied contact_z 5.35mm</div>+ <div><span class="p">$</span> <span class="cmd">adom-wiki pkg publish</span></div>+ <div class="ok"> component published — GLB + footprint + symbol + schematic</div>+ <div><span class="p">$</span> <span class="cmd">adom-wiki repo push adom/abc</span> <span class="fl">--files ...</span></div>+ <div class="ok"> source on the Files tab</div>+ <div><span class="p">$</span> <span class="cmd">adom-molecule create</span> <span class="fl">--glb ABC.glb --no-optimize</span></div>+ <div class="ok"> registered under caleb — no re-optimization</div>+ <div><span class="p">$</span> <span class="cmd">adom-molecule list</span></div>+ <div class="ok"> hydrogen.adom.inc/caleb/molecules/ABC — wires attach clean</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/molecule-publish"+rm -rf "$SKILLS_DIR/molecule-publish"+mkdir -p "$SKILLS_DIR/molecule-publish"+cp "$PKG_DIR/SKILL.md" "$SKILLS_DIR/molecule-publish/SKILL.md"+echo "Installed skill → $SKILLS_DIR/molecule-publish/SKILL.md"
package.jsonadded+43@@ -0,0 +1,43 @@+{+ "slug": "molecule-publish",+ "version": "1.0.0",+ "type": "skill",+ "description": "Publish a molecule source bundle (STEP + schematic + board + metadata) to the Adom wiki: OCCT molecule-mode conversion with stats gates, component packaging, adom-wiki publish. EDA-agnostic middle of the pipeline; companion to adom-molecule-import.",+ "tags": [+ "molecule",+ "pipeline",+ "wiki",+ "hydrogen",+ "skill"+ ],+ "dependencies": {+ "adom/adom-molecule": "^1.1.3"+ },+ "scripts": {+ "install": "./install.sh",+ "uninstall": "./uninstall.sh"+ },+ "hero": {+ "headline": "Molecule bundle to wiki page",+ "subhead": "OCCT convert, stats gates, package, publish - EDA-agnostic",+ "screenshot": "docs/shot.png"+ },+ "discovery_triggers": [+ "publish this molecule to the wiki",+ "upload molecule bundle",+ "convert and publish my molecule",+ "molecule to the wiki",+ "publish molecule package"+ ],+ "discovery_pitch": "Publish a molecule source bundle (STEP + schematic + board + metadata) to the Adom wiki: OCCT molecule-mode conversion with stats gates, component packaging, adom-wiki publish. EDA-agnostic middle of the pipeline; companion to adom-molecule-import.",+ "sample_prompts": [+ {+ "label": "Publish a bundle",+ "prompt": "I have ABC.step, ABC.kicad_pcb and ABC.kicad_sch - publish this molecule to the wiki"+ },+ {+ "label": "Convert and publish",+ "prompt": "Convert my molecule through OCCT and publish it"+ }+ ]+}
uninstall.shadded+3@@ -0,0 +1,3 @@+#!/bin/bash+rm -rf "$HOME/.claude/skills/molecule-publish"+echo "Removed molecule-publish skill"