$npx -y skills add aklofas/kicad-happy --skill bomBOM (Bill of Materials) management for electronics projects — the workflow skill that coordinates DigiKey, Mouser, LCSC, element14, JLCPCB, PCBWay, and KiCad skills around a unified BOM lifecycle. Create, update, and maintain BOMs with part numbers, costs, quantities stored as Ki
| 1 | # BOM Management |
| 2 | |
| 3 | BOM data lives in **KiCad schematic symbol properties** as the single source of truth. This skill orchestrates the full lifecycle: analyze the schematic, search distributors, validate parts, write properties back, export tracking CSVs, and generate order files. |
| 4 | |
| 5 | ## Related Skills |
| 6 | |
| 7 | | Skill | Purpose | |
| 8 | |-------|---------| |
| 9 | | `kicad` | Read/analyze schematics, PCB, footprints | |
| 10 | | `digikey` | Search DigiKey, download datasheets (primary prototype source) | |
| 11 | | `mouser` | Search Mouser (secondary prototype source) | |
| 12 | | `lcsc` | Search LCSC (production/JLCPCB parts) | |
| 13 | | `element14` | Search Newark/Farnell/element14 (international) | |
| 14 | | `jlcpcb` | PCB fabrication & assembly ordering | |
| 15 | | `pcbway` | Alternative PCB fab & assembly | |
| 16 | |
| 17 | ## Scripts |
| 18 | |
| 19 | Use `<skill-path>` to reference the BOM skill directory. |
| 20 | |
| 21 | ```bash |
| 22 | # Analyze schematic (JSON output, recursive sub-sheets) |
| 23 | python3 <skill-path>/scripts/bom_manager.py analyze path/to/schematic.kicad_sch --json --recursive |
| 24 | |
| 25 | # Export BOM tracking CSV (creates new or merges with existing) |
| 26 | python3 <skill-path>/scripts/bom_manager.py export path/to/schematic.kicad_sch -o bom/bom.csv --recursive |
| 27 | |
| 28 | # Generate per-distributor order files (5 boards + 2 spares/line) |
| 29 | python3 <skill-path>/scripts/bom_manager.py order bom/bom.csv --boards 5 --spares 2 |
| 30 | |
| 31 | # Quick single-distributor order (bypasses Chosen_Distributor column) |
| 32 | python3 <skill-path>/scripts/bom_manager.py order bom/bom.csv --distributor digikey |
| 33 | |
| 34 | # Write properties to schematic (dry-run first, then apply) |
| 35 | echo '{"R1": {"MPN": "RC0805FR-0710KL", "Manufacturer": "Yageo"}}' \ |
| 36 | | python3 <skill-path>/scripts/edit_properties.py path/to/schematic.kicad_sch --dry-run |
| 37 | |
| 38 | # Sync datasheet URLs from manifest.json back into schematic Datasheet properties |
| 39 | python3 <skill-path>/scripts/sync_datasheet_urls.py path/to/schematic.kicad_sch --recursive --dry-run |
| 40 | |
| 41 | # Translate KiCad/Altium BOM and CPL files into JLCPCB upload format |
| 42 | # (`pnp --bom` filter drops orphan designators — see skills/jlcpcb/SKILL.md |
| 43 | # for the 3-step PCBA upload workflow) |
| 44 | python3 <skill-path>/scripts/translate_bom_pnp.py bom input_bom.csv -o jlc_bom.csv |
| 45 | python3 <skill-path>/scripts/translate_bom_pnp.py pnp input_cpl.csv -o jlc_cpl.csv --bom jlc_bom.csv |
| 46 | ``` |
| 47 | |
| 48 | ## Workflow |
| 49 | |
| 50 | Skip steps that don't apply. Common shortcuts: |
| 51 | - **"Add Mouser PNs"** — search Mouser by MPN for each part → validate → write to schematic → update CSV |
| 52 | - **"Fill in the gaps"** — run analyzer with `--gaps-only`, address each missing field |
| 53 | - **"Update datasheet URLs"** — run `sync_datasheet_urls.py` to backfill empty Datasheet fields from the datasheets manifest |
| 54 | - **"Prepare for production"** — ensure every part has an LCSC number, check stock, set Chosen_Distributor to LCSC |
| 55 | |
| 56 | ### Step 1: Understand the Project |
| 57 | |
| 58 | ```bash |
| 59 | python3 <skill-path>/scripts/bom_manager.py analyze path/to/schematic.kicad_sch --json --recursive |
| 60 | ``` |
| 61 | |
| 62 | The output tells you the project's field naming convention, which distributors are populated, what's missing, and the preferred distributor. Also look for an existing BOM tracking CSV in the project directory or `bom/` folder. |
| 63 | |
| 64 | The script covers common patterns, but some projects use internal key systems or parametric fields. See `references/part-number-conventions.md` for the full catalog. Read the schematic if something seems off. |
| 65 | |
| 66 | ### Step 2: Sync Datasheets |
| 67 | |
| 68 | **Do this immediately.** Datasheets are essential context for validation and part selection. Run the preferred distributor's sync first; if some fail, try others — they share the same `datasheets/` directory and skip already-downloaded parts. |
| 69 | |
| 70 | ```bash |
| 71 | python3 <digikey-skill-path>/scripts/sync_datasheets_digikey.py path/to/schematic.kicad_sch --recursive |
| 72 | python3 <lcsc-skill-path>/scripts/sync_datasheets_lcsc.py path/to/schematic.kicad_sch --recursive |
| 73 | python3 <element14-skill-path>/scripts/sync_datasheets_element14.py path/to/schematic.kicad_sch --recursive |
| 74 | ``` |
| 75 | |
| 76 | DigiKey is best (direct PDF URLs). element14 is |