This skill should be used when the user needs a KiCad footprint, symbol or 3D model that KiCad does not ship, for example "make a footprint for", "footprint from the datasheet", "land pattern", "check my footprint", "pin table to symbol" or "extract the pinout from the PDF". It turns datasheet numbers into checked KiCad 10 parts with scripts that generate and check them.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Kicad Library?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gkochievi-kicad-library)
---
name: kicad-library
description: This skill should be used when the user needs a KiCad footprint, symbol or 3D model that KiCad does not ship, for example "make a footprint for", "footprint from the datasheet", "land pattern", "check my footprint", "pin table to symbol" or "extract the pinout from the PDF". It turns datasheet numbers into checked KiCad 10 parts with scripts that generate and check them.
user-invocable: false
---
# KiCad library parts from datasheets
Turn datasheet numbers into KiCad parts that solder, pass ERC and DRC, and match their symbol pin for pad: footprints from the maker's land pattern (or, when there is none, from documented rules), symbols from the pin table, a simple 3D body, and checks against the datasheet and the KiCad Library Conventions (KLC). Files are written in KiCad 10's own format (footprint version 20260206, symbol library 20251024), as KiCad 10.0 saves them; older KiCad is not used or supported for writing. Board-level rules stay in `pcb-design`, whole generated projects in `kicad-generator`, design reviews in `board-review`.
## Procedure
### 1. Decide whether a new part is needed
- Search KiCad's own library first (`pcb-design/references/part-selection.md` section 4). A library footprint is fine when its pad sizes, pitch, row span and exposed pad match the maker's land pattern; compare them with `scripts/lib_check.py --fp <library footprint> --expect <datasheet numbers>`.
- Make a new part when the package differs (exposed-pad size, terminal length, pull-back), the maker's land pattern differs materially, or the part is a connector, module or odd shape.
- Find the datasheet and the package drawing on the maker's site; record document number and revision. Never take dimensions from forum footprints or other people's libraries.
### 2. Footprint
1. Look for the recommended land pattern ("example board layout", "PCB land pattern"). Use it as given: pad size, pitch, centre-to-centre span, exposed pad, stencil apertures (`references/footprints-from-datasheets.md` sections 2–3). Check which dimension is the row span: a centre-to-centre reading must put the lead tips on copper.
2. Without a land pattern, give the package dimensions (`package` in the spec) and let `fp_gen.py` compute: TI SLUA271 for QFN / DFN / SON, NXP AN2388 for gull-wing parts (section 4). The footprint is then labelled "computed from package dimensions – check against the maker's land pattern"; say so to the user and compare with any land pattern the maker publishes for a similar package. Never invent IPC-7351 values.
3. Exposed pads: copper = nominal package pad, paste in separate apertures (copy the datasheet's stencil drawing when there is one, else 65 %), thermal vias 0.3 mm on the paste streets, at least 0.2 mm to the lead pads (section 5).
4. Through-hole: take the maker's recommended hole; otherwise finished hole = maximum lead + 0.2 mm, the diagonal for square pins (section 6).
5. Write a spec JSON with a `source` field naming the drawing, then generate:
`fp_gen.py --spec part.json --out <Project>.pretty`
The script refuses to overwrite without `--force` and refuses to write a footprint that fails its built-in check.
6. Write the datasheet numbers into an expect JSON and check: `lib_check.py --fp <file> --expect <expect.json> --kicad`.
### 3. Symbol
1. Get the pin table of the exact package. For a PDF: `pdf_pins.py --pdf ds.pdf --pages N-M --pins <count> --out pins.csv`, then review every row; the low and medium confidence rows first (`references/symbols-and-pin-tables.md` section 9). Never fill a missing pin by guessing.
2. Add the exposed pad as a pin with the footprint's pad number (often `GND`, `power_in`). Fix types: supplies `power_in`, regulator outputs `power_out`, GPIO `bidirectional`, open drain `open_collector`, NC `no_connect`. Overbars as `~{NAME}`.
3. Generate and pair-check in one step:
`sym_gen.py --pins pins.csv --name <MPN> --out <Project>.kicad_sym --footprint <Lib>:<FP> --datasheet <URL> --check-fp <Project>.pretty/<FP>.kicad_mod`
4. Add `--mpn`, `--manufacturer` and `--lcsc` once the part is chosen. Check every LCSC number on its lcsc.com product page first; leave it out when it cannot be checked.
### 4. 3D model
`model_gen.py --fp <file> --height <A max> --standoff <A1> --attach` writes a VRML body with leads and a pin-1 mark into `<Project>.3dshapes/` and links it as `${KIPRJMOD}/<Project>.3dshapes/<name>.wrl`. Height comes from the package drawing; the script never guesses it. Prefer the maker's STEP model when one exists; `--step` writes STEP only when CadQuery is installed.
### 5. Prove it in KiCad
Run these in Claude's workspace with KiCad 10 (its python module `pcbnew` or its `kicad-cli`, `kicad-generator/references/tooling-setup.md`); never with an older KiCad:
1. `lib_check.py --fp <Project>.pretty --kicad` (every footprint, KLC subset, KiCad 10 load: KiCad 10's `pcbnew` via `KICAD10_PYTHON` or the running python, else `kicad-cli` 10 via `KICAD_CLI`).
2. KiCad 10 on a copy: `kicad-cli fp upgrade <copy>.pretty`, `kicad-cli fp export svg`, `kicad-cli sym upgrade` and `kicad-cli sym export svg`; run `lib_check.py` on the upgraded copy too.
3. Place the parts on a small test board with a project `fp-lib-table`; run DRC with KiCad 10 (`kicad-cli pcb drc`); `kicad-cli pcb render` shows the 3D bodies.
4. Ask the user to print the test board 1:1 (`kicad-cli pcb export pdf --scale 1`), measure it and lay the real part on it before ordering. Claude cannot do this step.
### 6. Hand over
Give the user the `.pretty`, `.kicad_sym` and `.3dshapes` files with the spec and expect JSON next to them (they document where every number came from), the check results, and a list of what was computed rather than read from a land pattern. Add the library to the project's `fp-lib-table` / `sym-lib-table` or to `config.FOOTPRINTS` / `extra.py` for generated projects (`kicad-generator/references/project-config.md`).
## Defaults and traps
- **Datasheet first** (KLC F4.1). A maker's land pattern beats any rule, KiCad's library and this skill's computed pads.
- **Package drawing ≠ land pattern.** Pads equal to the leads are always wrong.
- **Centre-to-centre vs outer.** TI's `(5.4)` on the D0008A layout is centre-to-centre; Silicon Labs uses C1 / C2; IPC-style tables give Z and G (fp_gen takes `outer` / `inner` too).
- **Same name, different part.** "QFN-28 5 × 5" exists with exposed pads from 2.7 to 3.75 mm. Compare the exposed pad and terminal length, not the name.
- **Exposed-pad paste disagrees between makers** (KLC 50–80 %, TI 50–70 %, NXP about 20 % on HVQFN): the part's stencil drawing wins.
- **Thermal vias:** 0.3 mm drill, not 0.2 mm (JLCPCB charges more for 0.2 / 0.25 mm holes with small via diameters); same number as the exposed pad; no paste over them.
- **Silk 0.15 mm**, 0.2 mm from pads, not under SMD bodies; courtyard 0.25 mm (0.15 / 0.5 / 1.0 mm as KLC F5.3 says), 0.05 mm lines on a 0.01 mm grid.
- **Pin 1:** top left, chevron on silk, bevel on fab; THT pin 1 rectangular and at the origin.
- **Exposed pad without a symbol pin** floats: `lib_check.py --sym` fails it.
- **Hidden power pins** join global nets by name: do not use them. Connector-fed rails need PWR_FLAG.
- **Several packages, several symbols** (KLC S2.3); multi-package pin tables need `pdf_pins.py --column`.
- **KiCad 10 format only.** `fp_gen.py` and `sym_gen.py` write what KiCad 10.0 writes (checked against `kicad-cli fp upgrade` / `sym upgrade` output); empty fields are `""` (KiCad 10 no longer reads `~` as empty). `sym_gen.py` adds symbols only to a library already in KiCad 10's format: save an older library in KiCad 10 first.
- **Generator helpers are reused, not copied:** `kilib.py` imports `board-review/scripts/kisexp.py` (parser) and `kicad-generator/generator/models3d.py` (VRML shapes). `custom_fp.py`'s writers add random timestamps and `gen_kicad.py` / `kicad_items.py` need a generator project, so `fp_gen.py` and `sym_gen.py` have their own small writers.
These defaults summarise the references; where a reference gives conditions or disagreeing sources, follow the reference.
## References
| File | Use for |
|---|---|
| `references/footprints-from-datasheets.md` | reading package drawings and land patterns, nominal vs maximum material, TI D0008A and Silicon Labs CP2102N worked examples, computed pads (SLUA271 for QFN / SON, AN2388 for gull-wing, TN006 chip table), exposed pads, paste and thermal vias, THT hole and ring sizing, KLC footprint rules, names, JLCPCB limits, checking (lib_check, KiCad 10 load, DRC, 1:1 print), SOIC-8 compared with KiCad's library, troubleshooting |
| `references/symbols-and-pin-tables.md` | pin-table CSV, datasheet type letters, pin electrical types and ERC, power pins, PWR_FLAG, hidden pins, pin stacks, alternate functions, KLC symbol layout, fields incl. LCSC / MPN for the BOM tools, PDF extraction pitfalls, symbol ↔ footprint pairing, the KiCad 10 file format, LM358 worked example, review checklist, troubleshooting |
## Scripts
| Script | Does | Example |
|---|---|---|
| `scripts/fp_gen.py` | footprint from JSON or `--set` values: chip, SOT-23-3/5/6, gull-wing dual rows, QFN / DFN / SON with exposed pad, paste segmentation and thermal vias, QFP, 1- and 2-row THT headers and terminal blocks, free pad lists; KLC layers; built-in check | `fp_gen.py --spec soic8.json --out MyParts.pretty` |
| `scripts/lib_check.py` | footprint vs datasheet numbers (pitch, pads, span, exposed pad, pin count, drill) with tolerances, KLC subset, symbol ↔ footprint pairing, optional KiCad 10 load | `lib_check.py --fp MyParts.pretty/X.kicad_mod --expect x.json --sym MyParts.kicad_sym --symbol X` |
| `scripts/sym_gen.py` | symbol from a pin-table CSV: grid, pin length, body size, power top / bottom, groups, alternates, fields (Footprint, Datasheet, MPN, LCSC); appends to or replaces in a library | `sym_gen.py --pins x.csv --name X --out MyParts.kicad_sym --footprint MyParts:X` |
| `scripts/pdf_pins.py` | candidate pin table from a datasheet PDF via `pdftotext -layout`, confidence per row, multi-package and multi-table handling | `pdf_pins.py --pdf ds.pdf --pages 3-4 --pins 8 --out x.csv` |
| `scripts/model_gen.py` | VRML body with leads and pin-1 mark from the footprint; attaches it; STEP with CadQuery when installed | `model_gen.py --fp MyParts.pretty/X.kicad_mod --height 1.75 --attach` |
| `scripts/kilib.py` | shared helpers (result format, boulder.toml, pad classification); `--pads` lists a footprint's pads as the checks see them | `kilib.py --pads X.kicad_mod` |
All scripts print a readable report, or one JSON object with `--json` (`status`, `action`, `summary`, `details`, `error`); exit 0 ok or warnings, 1 a check failed, 2 usage or input error. Settings come from the command line, then the `[<script>]` section of `boulder.toml`. Part dimensions, heights and LCSC numbers are never defaulted. Example specs built from TI, Silicon Labs and Würth drawings are in `scripts/tests/fixtures/`.
## Related skills
- `kicad-generator`: puts the new parts into generated projects (`config.FOOTPRINTS`, `extra.py`, `models3d.py`) and builds the board.
- `board-review`: ERC / DRC with `kicad-cli`, exposed-pad via and LCSC checks on the finished board (`board-review/references/automated-checks.md`).
- `pcb-design`: part and package choice for JLCPCB assembly, DFM limits, thermal copper and vias (`pcb-design/references/part-selection.md`, `pcb-design/references/jlcpcb-dfm-assembly.md`, `pcb-design/references/power-and-thermal.md`).
- `electronics-fundamentals`: what the pin types mean electrically (`electronics-fundamentals/references/digital-interfaces.md`).
## Next step
When this is done, say what comes next: use the part in the board (`kicad-generator` or `kicad-projects`) and print the footprint 1:1 against the real part.
Files in this skill
SKILL.md11.6 KB
references/footprints-from-datasheets.md28.3 KB
references/symbols-and-pin-tables.md24.8 KB
scripts/fp_gen.py70 KB
scripts/kilib.py15.3 KB
scripts/lib_check.py43.6 KB
scripts/model_gen.py17.3 KB
scripts/pdf_pins.py19.9 KB
scripts/sym_gen.py27 KB
scripts/tests/conftest.py1.4 KB
scripts/tests/fixtures/conn_2x04.csv194 B
scripts/tests/fixtures/cp2102n_qfn28.csv805 B
scripts/tests/fixtures/header_2x04_wurth.json426 B
scripts/tests/fixtures/lm358_soic8.csv89 B
scripts/tests/fixtures/qfn28_computed_vias.json386 B
scripts/tests/fixtures/qfn28_silabs_land.json713 B
scripts/tests/fixtures/qfn28_silabs_land_expect.json192 B
scripts/tests/fixtures/soic8_ti_d0008a.json563 B
scripts/tests/fixtures/soic8_ti_d0008a_expect.json94 B