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
SKILL.md+30−9@@ -45,12 +45,17 @@ 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]"+step2glb convert <name>.step --board <name>.kicad_pcb --pin medium \+ -o <slug>.glb # --board implies --molecule; add --silk-top/--silk-bottom PNGs ``` +Requires `step2glb` >= 0.11.0 (`adom-wiki pkg install adom/adom-step2glb`).+It posts multipart to `/convert?molecule=true&pin=...`, polls the job,+downloads the GLB **and** `<slug>_footprint.json` + `<slug>_symbol.json`+beside it, prints the full stats block, and emits gate hints on failures.+Fallback (older CLI): `curl -X POST ".../convert?molecule=true&pin=..."+-H "X-Client: <agent>" -H "X-Job-Name: <name>" -F "step=@..." -F "board=@..."`.+ `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**:@@ -66,16 +71,12 @@ 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+ <slug>.glb # OCCT artifact — MUST be named exactly <slug>.glb (see below) <name>.kicad_pcb|.brd # board source <name>.kicad_sch|.sch # schematic source <name>_footprint.json # OCCT artifact — per-pad wire-attach Z@@ -87,6 +88,13 @@ Artifacts: `GET /jobs/{id}/result` → `<name>.glb`, 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. +**Name the GLB exactly `<slug>.glb`.** At publish the wiki auto-converts the+STEP to a PLAIN `<slug>.glb` (no anchoring, no gold) and points+`model_3d_path` at it — if your anchored OCCT GLB has any other name, the+plain one shadows it and every import silently gets an unanchored model.+(This is exactly what broke the COSMIIC boards.) Matching the name ensures+your anchored GLB is the one `model_3d_path` resolves to.+ ## Stage 3 — Publish + verify ```bash@@ -97,6 +105,12 @@ 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 GLB at `model_3d_path` is YOUR anchored one** — download it and check+ for the anchor node (a plain publish-time conversion has none):+ ```bash+ curl -fsSL "https://wiki.adom.inc/blob/component/<slug>/<slug>.glb" -o /tmp/check.glb+ python3 -c "import struct,json,sys; d=open('/tmp/check.glb','rb').read(); l=struct.unpack('<I',d[12:16])[0]; j=json.loads(d[20:20+l]); ok=any(n.get('name')=='molecule_anchor' for n in j.get('nodes',[])); print('anchored GLB' if ok else 'PLAIN GLB — STOP: re-push your OCCT GLB as <slug>.glb'); sys.exit(0 if ok else 1)"+ ``` - the page's Files tab shows the full bundle (registry and git layers are separate — publish alone does not populate Files) @@ -106,6 +120,13 @@ 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. +**Attach-points caveat:** `adom-molecule import <slug>` (the one-shot verb)+currently carries ONLY the GLB — no footprint/symbol reach Hydrogen, so the+molecule has no wire attach points. Until that's fixed, register with the+board included so Hydrogen generates and attaches the footprint at create:+`adom-molecule create --owner <o> --name <n> --glb <slug>.glb --pcb <board>+--no-optimize` (use `--brd` for EAGLE/Fusion boards).+ ## Related - `adom-molecule-import` — the wiki → Hydrogen companion
package.json+1−1@@ -1,6 +1,6 @@ { "slug": "molecule-publish",- "version": "1.0.1",+ "version": "1.1.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": [
page.json+1−1@@ -1,6 +1,6 @@ { "slug": "molecule-publish",- "version": "1.0.1",+ "version": "1.1.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": [