← Commit history

Publish 1.0.0

barrett-land ·ab6a5fbd62 · ·parent 0e68347
5 files changed +165
SKILL.mdadded+98
@@ -0,0 +1,98 @@+---+name: adom-component-page+description: Create a wiki component page and link it into a library the RIGHT way. Wiki component pages are keyed by the manufacturer part number (MPN), never by the local KiCad symbol/value name. Use when publishing a part to the Adom wiki, adding a component to a board or circuit library, resolving an LCSC/JLC code to an MPN, deduping against an existing page, or correcting a component page that was published under the wrong name. Trigger words: make a component page, publish this part, add component to library, wiki component by MPN, link component to library, LCSC to MPN, fix component page name, component keyed by MPN.+metadata:+  type: skill+---++# Making and linking wiki component pages (keyed by MPN)++## The one rule++**A wiki component page is keyed by the part's manufacturer part number (MPN). Never by the local KiCad symbol name or value.**++A KiCad symbol called `C_100nF_0402` with LCSC `C1525` becomes the page `cl05b104ko5nnnc` (its Samsung MPN). It does NOT become `c-100nf-0402` or `c-100nf-0402-c1525`.++Why: every user names parts differently in their own library, but the MPN is the one identity everyone shares. Keying on the MPN is what lets pages dedup, and lets a board or circuit library resolve to the same component everyone else uses. Keying on a local symbol name creates a private duplicate that no one else's design will ever match.++## Step 1: resolve the MPN++- An IC's KiCad **Value** is usually already the MPN (for example `MP2393GTL-Z`). Use it directly.+- A passive is named by its value (`C_100nF_0402`, `R_40.2K_0603`) and carries an LCSC/JLC code in its `LCSC PN` or `LCSC` symbol property. Resolve the code to an MPN:++  ```+  GET https://easyeda.com/api/products/<LCSC>/components+  -> result.dataStr.head.c_para["Manufacturer Part"]+  ```++  Example: `C1525` resolves to `CL05B104KO5NNNC`, `C12447` to `0603WAF4022T5E`.++- The **slug** is the MPN lowercased with every run of non-alphanumeric characters turned into a single `-`: `cl05b104ko5nnnc`, `mp2393gtl-z`, `0603waf4022t5e`, `744314490`.++## Step 2: check for an existing page FIRST (dedup)++A page may already exist under any owner. Before you create anything:++```+curl -s -o /dev/null -w "%{http_code}" https://wiki.adom.inc/api/pages/adom/<mpn-slug>   # 200 = exists+```++Also search, in case it lives under another owner:++```+GET https://wiki.adom.inc/api/v1/pages?q=<MPN>+```++Match a result whose slug normalizes to `<mpn-slug>`, or whose title starts with the MPN. The `chip-fetcher` and `chip-fetcher-lite` tools are wiki-first and MPN-keyed, so they are the fastest way to find an existing page.++**If a page already exists, do not create a duplicate.** Link the existing page (owner-qualified) into the library, and stop.++## Step 3: create the page (only when none exists)++Build it from the KiCad source:++- **Symbol**: take the `lib_symbols` entry the placed symbol references, wrap it in `(kicad_symbol_lib (version ...) (generator "adom") <symbol> )`, and write `<MPN>.kicad_sym`.+- **Footprint**: take the placed `(footprint "Lib:Name" ...)` node from the `.kicad_pcb`, strip its top-level `(at ...)` placement and each pad's `(net ...)`, and write `<MPN>.kicad_mod`.+- **3D model** (required): the footprint references a model with `(model "...step")`, often via `${KICAD9_3DMODEL_DIR}`. Resolve the path, pull the STEP, and convert it: `step2glb convert <part>.step -o <slug>.glb`. Component pages hard-require a 3D source, enforced by the server even with `--skip-lint`.+- **package.json**: `type: "component"`, `slug: "<mpn-slug>"`, `component.mpn: "<MPN>"`, plus `component.lcsc`, `component.category` (Resistors / Capacitors / Inductors / ICs / ...), `component.parts.model_3d`, and a `hero` (a rasterized footprint SVG works as the hero image).++Publish and make it public:++```+adom-wiki pkg publish --org adom --skip-lint+adom-wiki page visibility adom/<mpn-slug> public+```++`--skip-lint` is needed for a bare component (no symbol-viewer video etc.), but the server still enforces the 3D source and a hero. The wiki rate-limits to **10 publishes per minute**, so batch in tens.++## Step 4: link the page into a library++The library is a page tagged `library` whose dependencies are the component pages, owner-qualified:++```json+"dependencies": {+  "adom/cl05b104ko5nnnc": "^1.0.0",+  "adom/mp2393gtl-z": "^1.0.0"+}+```++Republish the library. A board or circuit depends on the library, and Nucleus expands the chain board -> library -> components, so each part becomes clickable and opens its Symbol / Footprint / 3D viewer.++## Correcting a mis-keyed page++If a page was published under a local symbol/value name (for example `c-100nf-0402-c1525`):++1. Resolve its real MPN and create-or-find the MPN page (steps 1 to 3).+2. Repoint the library's dependency to the MPN slug and republish the library.+3. Delete the mis-keyed page:++   ```+   adom-wiki page delete adom/<wrong-slug>              # soft delete (reversible)+   adom-wiki page delete adom/<wrong-slug> --hard       # permanent, needs confirm+   ```++Do the relink before the delete so the library never points at a dead page.++## Tooling++`adom-design-blocks/src/make-components.mjs <sch> <pcb> <outDir> <modelsDir>` walks a KiCad circuit, finds every unique placed part, resolves LCSC to MPN, and writes one MPN-keyed component bundle per part (symbol + footprint + 3D + package.json). Publish each bundle (step 3), then wire the library (step 4). It skips a part that has no footprint placed on the board, since there is nothing to build a 3D page from.
docs/hero.pngadded
⋯ 1 unchanged line ⋯
install.shadded+7
@@ -0,0 +1,7 @@+#!/bin/bash+set -euo pipefail+DIR="$(cd "$(dirname "$0")" && pwd)"+DEST="${HOME}/.claude/skills/adom-component-page"+mkdir -p "$DEST"+install -m 0644 "$DIR/SKILL.md" "$DEST/SKILL.md"+echo "Installed adom-component-page skill"
package.jsonadded+56
@@ -0,0 +1,56 @@+{+  "slug": "adom-component-page",+  "version": "1.0.0",+  "type": "skill",+  "description": "Create a wiki component page and link it into a library the right way: pages are keyed by the manufacturer part number (MPN), never by the local KiCad symbol/value name. Resolve LCSC to MPN, dedup against existing pages, build symbol + footprint + 3D, publish, link to a library, and correct mis-keyed pages.",+  "tags": [+    "skill",+    "wiki",+    "component",+    "mpn",+    "kicad",+    "library",+    "eda"+  ],+  "discovery_triggers": [+    "make a component page",+    "publish this part to the wiki",+    "add a component to a library",+    "wiki component keyed by mpn",+    "resolve lcsc to mpn",+    "fix a component page published under the wrong name",+    "link a component to the mp2393 library"+  ],+  "dependencies": {},+  "scripts": {+    "install": "./install.sh",+    "uninstall": "./uninstall.sh"+  },+  "files": [+    "SKILL.md",+    "install.sh",+    "uninstall.sh",+    "README.md",+    "docs/**"+  ],+  "hero": {+    "headline": "Component pages, keyed by MPN",+    "subhead": "Resolve LCSC to MPN, dedup, build symbol + footprint + 3D, publish, and link into a library.",+    "screenshot": "docs/hero.png"+  },+  "discovery_pitch": "Publish a KiCad part to the Adom wiki the right way: pages are keyed by the manufacturer part number (MPN), not your local symbol name. Resolve LCSC to MPN, dedup against existing pages, build symbol + footprint + 3D, publish, and link it into a library.",+  "sample_prompts": [+    {+      "prompt": "Make a wiki component page for this part and link it to my library",+      "label": "Make a component page"+    },+    {+      "prompt": "Resolve this LCSC code to its MPN and check if a wiki page already exists",+      "label": "LCSC to MPN"+    },+    {+      "prompt": "This component page was published under the wrong name, fix it to use the MPN",+      "label": "Fix a mis-keyed page"+    }+  ]+}\ No newline at end of file
uninstall.shadded+4
@@ -0,0 +1,4 @@+#!/bin/bash+set -euo pipefail+rm -rf "${HOME}/.claude/skills/adom-component-page"+echo "Uninstalled adom-component-page skill"