← Commit history

Initial commit: skill/kicad-library-install

kaleymer ·204f7bc63d ·2mo ago
2 files changed +113
README.mdadded+53
@@ -0,0 +1,53 @@+# kicad-library-install++Install or register a KiCad symbol/footprint library — and hand-generate+`.kicad_sch` / `.kicad_mod` / `.kicad_sym` files — without silently corrupting+the user's setup.++Five failure modes, each of which produces no error message or a misleading one:++1. **Editing the lib tables while KiCad is running.** They are read once at+   startup and written back from memory on exit, so your entry is invisible to+   the running instance *and* may be deleted when it closes. Symptom:+   `Cannot add U1 (footprint 'Nick:Part' not found)` while the file on disk+   plainly contains the entry.+2. **A UTF-8 BOM in a lib table.** KiCad reports+   `has type UNINITIALIZED but expected SYMBOL; skipping` and skips *every*+   library in the file. PowerShell's `Set-Content -Encoding UTF8` writes one.+3. **Namespacing `lib_symbols` sub-units.** Only the top-level symbol carries+   the library nickname; prefixing `_0_1` / `_1_1` rejects the whole schematic+   with an unlocated `Failed to load schematic`.+4. **A 3D model with a non-KiCad Z datum.** KiCad expects origin at the seating+   plane; vendor STEP files are often top- or centre-referenced, so the part+   renders sunk into the board and the bad geometry bakes into downstream+   STEP/GLB exports.+5. **Footprint internal name ≠ filename.** KiCad renames on save and references+   drift.++Also documents the headless `kicad-cli` verification loop that catches all of+them (the netlist export is the check that actually proves footprints resolve),+running a control against a known-good project before blaming your own file,+bisecting unlocated parse failures, and the defects to expect in vendor- or+wiki-sourced parts.++## What a correctly installed library looks like++![Adom_Parts: the ADS1220IRVAR symbol and footprint, rendered by kicad-cli](docs/library-art.png)++Both halves render from the installed library, the netlist resolves every+`Footprint` property to a real file, all 17 pins are present (including the+exposed pad KiCad's vendor symbol omitted), and the 3D body sits **on** the+board rather than inside it. Each of those is a separate check in this skill —+and each fails silently when skipped.++### Trap 4, drawn++![Top-referenced vs seating-plane Z datum](docs/z-datum.png)++Measure the STEP's Z extent before you swap a model. `-h .. 0` means the origin+is at the top of the body and the part will sink; `0 .. +h` is what KiCad+expects.++Companion to [`kicad-export-molecule`](https://wiki.adom.inc/adom/kicad-export-molecule)+(shipping a finished board) — this one covers getting the libraries and+generated files correct in the first place.
page.jsonadded+60
@@ -0,0 +1,60 @@+{+  "slug": "kicad-library-install",+  "version": "1.0.0",+  "type": "skill",+  "description": "Install/register a KiCad symbol or footprint library, and hand-generate .kicad_sch / .kicad_mod / .kicad_sym files, without silently corrupting the user's setup. Covers the five silent failure modes (lib tables rewritten on exit, UTF-8 BOM, lib_symbols sub-unit naming, 3D model Z datum, footprint name/filename mismatch) and the headless kicad-cli verification loop.",+  "tags": [+    "kicad",+    "library",+    "footprint",+    "symbol",+    "eda",+    "skill"+  ],+  "scripts": {+    "install": "./install.sh",+    "uninstall": "./uninstall.sh"+  },+  "discovery_triggers": [+    "install kicad library",+    "register footprint library",+    "add library to kicad",+    "footprint not found",+    "Cannot add U1 footprint not found",+    "Failed to load schematic",+    "library table UNINITIALIZED",+    "fp-lib-table",+    "sym-lib-table",+    "3d model inside the board",+    "model sunk into the pcb",+    "step z offset kicad",+    "generate a kicad schematic",+    "write a kicad_mod"+  ],+  "discovery_pitch": "The five KiCad library/file traps that produce no useful error message - plus the headless kicad-cli loop that catches every one of them before the user ever sees a broken project.",+  "sample_prompts": [+    {+      "label": "Install a library",+      "prompt": "Install this symbol and footprint library into my KiCad"+    },+    {+      "label": "Footprint not found",+      "prompt": "KiCad says Cannot add U1 (footprint not found) but the file is right there"+    },+    {+      "label": "Model sunk in board",+      "prompt": "The 3D model is sitting inside the PCB instead of on top of it"+    }+  ],+  "hero": {+    "type": "image",+    "path": "screenshots/hero.png"+  },+  "dependencies": {},+  "visibility": "public",+  "org": "adom",+  "author": {+    "name": "kaleymer",+    "email": "[email protected]"+  }+}\ No newline at end of file