component-search
Original:🇺🇸 English
Translated
1 scriptsChecked / no sensitive code detected
Search for and add electronic components to a Zener PCB project using LCSC + easyeda2kicad. Use when designing a board, module, or subsystem and you need a part package that is not already in the workspace or covered by stdlib generics. Covers MPN → LCSC C-number lookup, `easyeda2kicad` import, and generation of a Zener component wrapper (.zen) from the imported `.kicad_sym`.
10installs
Sourcenasheed-x/pcb-skills
Added on
NPX Install
npx skill4agent add nasheed-x/pcb-skills component-searchTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Component Search (LCSC + easyeda2kicad)
Find and add component packages to a Zener project without relying on a private registry. The pipeline is:
MPN ──► LCSC C-number ──► easyeda2kicad ──► .kicad_sym + .kicad_mod + .step ──► Zener wrapper (.zen)Use this workflow any time you need a part that isn't already in the workspace tree or covered by stdlib generics (, , , , …).
components/@stdlib/generics/Resistor.zenCapacitor.zenLed.zenThermistor.zenHard Stop Before Manual Creation
If LCSC has no entry for the MPN, or fails on the resolved C-number, don't fall back to hand-drawing a symbol/footprint silently. Report what failed, offer manual creation as an option, and get explicit user confirmation.
easyeda2kicadSearch Priority
Always search in this order. Move down only when the higher tier doesn't apply.
- Workspace tree —
components/orglobfor the MPN. If the part is already imported, reuse it viafinder.Module("./components/<Mfr>/<MPN>/<MPN>.zen") - stdlib generics — for plain R, C, L, LED, diode, NPN/PNP, MOSFET, thermistor: use the generic, never import a vendor part.
- LCSC + easyeda2kicad — for ICs, modules, connectors, crystals, anything with a specific MPN.
Step 1 — MPN → LCSC C-number
LCSC parts have a numeric ID. easyeda2kicad needs that ID, not the MPN. Use the agent's web tools:
Cxxxxxxweb_search query="<MPN> site:lcsc.com"
read_web_page url=<top LCSC product page> objective="Find the LCSC C-number (e.g. C25804) and confirm package."Tips:
- LCSC product URLs look like — the trailing
https://www.lcsc.com/product-detail/.../C25804.htmlbeforeCxxxxxis the C-number..html - The product page also lists package, datasheet, stock, and price — capture these for the user.
- Some MPNs map to multiple C-numbers (different reels, suffixes, manufacturers). Pick the one that matches the requested package and shows real stock.
- If no LCSC hit, try the base MPN family (drop ,
-TR, reel/packaging suffixes).-R7
When the user supplies a C-number directly, skip this step.
Step 2 — Import via easyeda2kicad
Resolve the manufacturer and a clean MPN slug first (no spaces, replace with ). Pick a target package directory under .
/_components/<Manufacturer>/<MPN>/bash
mkdir -p components/<Manufacturer>/<MPN>
cd components/<Manufacturer>/<MPN>
easyeda2kicad --full --lcsc_id=Cxxxxx --output <MPN> --overwriteThis writes:
- — symbol library (single symbol)
<MPN>.kicad_sym - — footprint, inside a
<MPN>.pretty/<something>.kicad_modfolder.pretty - — 3D model
<MPN>.3dshapes/<something>.{wrl,step}
Flatten the footprint so the Zener wrapper can reference it as a single file next to the :
.zenbash
mv <MPN>.pretty/*.kicad_mod ./<MPN>.kicad_mod
rmdir <MPN>.pretty(Keep as a folder — references the 3D model by relative path inside it.)
<MPN>.3dshapes/.kicad_modIf the user wants to skip the 3D model for size, drop and use . Note that does not require a 3D model to build.
--full--symbol --footprintpcbStep 3 — Generate the Zener wrapper
Use the bundled generator script to turn the imported into a starter :
.kicad_sym.zenbash
python3 <SKILL_DIR>/scripts/zener-wrap.py \
--kicad-sym components/<Manufacturer>/<MPN>/<MPN>.kicad_sym \
--footprint <MPN>.kicad_mod \
--mpn <MPN> \
--manufacturer "<Manufacturer>" \
--output components/<Manufacturer>/<MPN>/<MPN>.zenThe generator parses the and emits a skeleton with:
.kicad_sym.zen- top docstring (MPN, manufacturer, package — fill in description by hand)
- /
mpnconfigsmanufacturer - one per pin, classified as
io(),Power, or genericGroundby nameNet - with the
Component(...)dict mapping the original KiCad pin names to those iospins=
After generation, read the file and clean it up by hand:
- Group related ios (split power, signal, control bundles).
- Rename ios to integrator-facing names where it improves clarity (→
+IN_A).IN_POS_A - Add to every
voltage="..."io per the datasheet.Power - Replace with
Net/Analog/ typed interfaces fromDigitalwhere appropriate.@stdlib/interfaces.zen - Remove pins from the
no_connectdict — leave them out, don't expose as ios.pins= - Drop the auto-generated docstring and replace with a short, integrator-facing one (one paragraph: what it is, where it's used, key constraint).
See for the full style rules. See if you want to grow the wrapper into a richer reusable design with surrounding circuitry.
idiomatic-zenerreference-designStep 4 — Workspace manifest
The new component package needs a so the workspace can resolve it. Create:
pcb.tomltoml
# components/<Manufacturer>/<MPN>/pcb.toml
[package]
name = "<MPN>"
description = "<one-line description>"If the workspace declares (most do), the package is auto-discovered. Verify with:
pcb.tomlmembers = [..., "components/*", ...]bash
pcb build components/<Manufacturer>/<MPN>Fix any errors before instantiating from a board.
Step 5 — Use it
python
MyPart = Module("./components/<Manufacturer>/<MPN>/<MPN>.zen")
MyPart(
name="U1",
VDD=vdd_3v3,
GND=gnd,
# ...
)Verifying Sourcing with pcb bom
pcb bomOnce the part is wired into a board, sanity-check sourcing:
bash
pcb bom boards/<Board>/<Board>.zen -f jsonFor an easyeda2kicad-imported part, the BOM will pick up the MPN you set in the wrapper ( config default). LCSC stock is the same source easyeda2kicad pulled from, so the you used is your sourcing record — capture it in the docstring or a comment for traceability.
mpn=Cxxxxx.zenGenerator Script
Path:
<SKILL_DIR>/scripts/zener-wrap.pyUsage:
bash
python3 zener-wrap.py \
--kicad-sym path/to/<MPN>.kicad_sym \
--footprint <MPN>.kicad_mod \
--mpn <MPN> \
--manufacturer "<Manufacturer>" \
--output path/to/<MPN>.zen \
[--datasheet docs/<MPN>.pdf] # optionalPin classification rules:
- ,
GND,VSS,VEE,AGND,DGND→V-Ground - ,
VCC,VDD,VPP,VBUS,VS,V+,AVDD,DVDD,VIN→VOUTPower - everything else →
Net
The script never throws on unusual pin names — it sanitizes any string into a valid Zener identifier and falls back to for unnamed pins.
PIN_<num>Common Issues
- easyeda2kicad: HTTP 404 on C-number — wrong C-number, or the part has been delisted. Re-search LCSC or pick the alternate-source listing.
- Pin names look like (with overbar markup) — KiCad wraps inverted pin names in
~{NAME}. The generator strips the markup for the io identifier but preserves the original string in the~{...}dict so the symbol still matches.pins= - Footprint references a 3D model that wasn't downloaded — happens with only. Either re-run with
--symbol --footprint, or edit the--fullto remove the.kicad_modblock.(model ...) - Symbol uses /
~/ spaces in pin names — the generator handles these. If the resulting Zener identifier is awkward, rename the io by hand and update the#mapping to keep the original KiCad name on the right.pins=