agentleFS
RileyCorneliusRileyCornelius/Code-Skills/kicad-library-part/SKILL.md

kicad-library-part

Skill0 starsChanged 7 months agoMITView on GitHub

KiCad project library parts. Use when adding a vendor zip (Ultra Librarian, SnapEDA, EasyEDA, Component Search Engine) or loose .kicad_mod / .kicad_sym / STEP files to a project library, fixing a broken or mislinked footprint, symbol, or 3D model, copying a part from one project library to another, filling in Manufacturer, MFR Part #, or LCSC Part # fields, or checking a symbol and footprint against the part datasheet. Also fires on: footprint, symbol, .kicad_mod, .kicad_sym, 3dshapes, .pretty, part library.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Confirm the naming and the metadata you lack: Ask in one round: MPN to use as the name, and any of Manufacturer, MFR Part #, LCSC Part # …

    line 36
  2. Distinctive:

    Link the chain: All four links above, plus the metadata properties below.

    line 38
  3. Very specific:

    Use these property names exactly, spaces and # included.

    line 66

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

A library part is a chain: symbol -> footprint -> 3D model. Every branch of this skill ends with the chain intact and the chain verified by grep, not by assumption.

Library layout

The project keeps one custom library beside the .kicad_pro file:

<project>/lib/<Lib>.kicad_sym      symbols, one file, many symbols
<project>/lib/<Lib>.pretty/        footprints, one .kicad_mod per part
<project>/lib/<Lib>.3dshapes/      STEP models

<Lib> and the library nickname come from sym-lib-table and fp-lib-table in the project root. Read both tables first. Do not assume the nickname.

STEP only. The 3D model is a .step / .stp / .STEP file. Discard any .wrl the vendor ships, and when a footprint already points at a .wrl, repoint it at the STEP of the same name.

MPN is the name. Symbol name, footprint name, footprint filename stem, and 3D filename are all the manufacturer part number. Rename vendor files to it.

The four links of the chain:

  1. Symbol property Footprint = <nickname>:<MPN>
  2. Symbol property ki_fp_filters = <MPN>
  3. Footprint first token (footprint "<MPN>" = its filename stem, and fp_text value = <MPN>
  4. Footprint (model "${KIPRJMOD}/lib/<Lib>.3dshapes/<MPN>.STEP" , with offset, scale 1 1 1, rotate

Copy the exact model path style, indentation, and line endings (often CRLF) from a part already in the library. The library file is the single source of truth for style.

Add a part

  1. Inventory. Unzip or list the input. Keep the .kicad_sym, .kicad_mod, and .step / .stp; drop the .wrl, the HTML, and the readme. Read the lib tables and one existing symbol plus one existing footprint from the target library. Done when you can state the nickname, the three target paths, the (version ...) of the target .kicad_sym, and its line endings.
  2. Confirm the naming and the metadata you lack. Ask in one round: MPN to use as the name, and any of Manufacturer, MFR Part #, LCSC Part # you cannot derive. Skip the question when running unattended and state the assumption.
  3. Place the files. Footprint to <Lib>.pretty/<MPN>.kicad_mod, model to <Lib>.3dshapes/<MPN>.STEP, symbol block appended to <Lib>.kicad_sym. Vendor symbol blocks are usually KiCad 6 era and the library file is newer: convert the header and properties, see FORMATS.md.
  4. Link the chain. All four links above, plus the metadata properties below.
  5. Validate. Parentheses balance in every edited file, grep each link, and pad count equals symbol pin count (see FORMATS.md for the checks). Done when every one of the four links is quoted back from a grep of the written file.
  6. Report the file paths, the symbol name, and anything you assumed.

Fix a part

Walk the chain in order and name the broken link before editing. Frequent breaks:

  • Footprint property has no nickname, a stale nickname, or a path such as lib/Custom:...
  • Footprint renamed on disk, symbol still points at the old name, or the internal (footprint "...") token still holds the vendor name
  • Model path uses ${KISYS3DMOD}, an absolute user path, a .wrl file, or a filename that is not in .3dshapes/
  • Missing pads, wrong pad numbers against the symbol, or a duplicated symbol in the library file
  • Footprint fixed in the library but the board still holds the old copy: the user must run Tools > Update Footprints from Library in the PCB editor. Say so.

Renaming a footprint that is already placed breaks the board link, because the board stores <nickname>:<name>. Warn the user, or keep the old name.

Metadata

Property names, added to the symbol, all hidden:

PropertyValue
Manufacturermanufacturer name
MFR Part #manufacturer part number, the same string used as the part name
LCSC Part #LCSC code, C plus digits
DatasheetURL, not the part number
Descriptionone line, manufacturer plus function plus package

Use these property names exactly, spaces and # included. Fill LCSC Part # from the pcbparts MCP jlc_search by part number when that server is present, else ask the user. Never invent a C number.

Verify against the datasheet

Optional. Run it when the user asks, when the part is new to the project, or when a fix touched pads or pins. Procedure and report format: VERIFY.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.