SkillAtlasSkill 详情

bom

Mentioned in Awesome KiCad

审核状态:已审核Quality 72Security 52

复制安装命令

用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。

复制前请先查看来源、License 和安全提示。

项目 README

来源文件:README.md

抓取于 2026年8月13日

⚡ kicad-happy

CI Python 3.10+ License: MIT Mentioned in Awesome KiCad

AI-powered design review for KiCad. Analyzes schematics, PCB layouts, and Gerbers. Catches real bugs before you order boards.

Works with Claude Code, OpenAI Codex, GitHub Copilot CLI, Gemini CLI, and opencode, as a GitHub Action for automated PR reviews, or as standalone Python scripts you can run anywhere.

These skills turn your AI coding agent into a full-fledged electronics design assistant that understands your KiCad projects at a deep level: parses schematics and PCB layouts into structured data, cross-references component values against datasheets, detects common design errors, and walks you through the full prototype-to-production workflow.

🔬 What it looks like in practice

Point your agent at a KiCad project and it does the rest — parses every schematic and PCB file, traces every net, computes every voltage, and tells you what's wrong before you spend money on boards.

"Analyze my KiCad project at hardware/rev2/"

Here's a condensed example from an open-source robot controller board. The agent found all of this automatically:

It builds your power tree — tracing every regulator from input to load, computing output voltages from feedback dividers:

VBUS (USB-C / battery input, fused)
├── AP63357 buck (500kHz switching) → 5V
│   └── Feedback: R8/R9 ratio=0.155 → Vout=3.87V
│       Power dissipation: ~0.15W (85% efficiency assumed)
└── RT9080-3.3 LDO → 3.3V
    └── Decoupling: 16 caps, 10.8µF total

It identifies every subcircuit — not just passives, but the functional blocks and how they connect:

SubcircuitDetails
Motor drive9x P-MOSFET switches (DMG2305UX), transistor-driven H-bridges
FiltersRC signal conditioning at 16Hz, 169Hz, and 1.03kHz (input filtering and debounce)
LightingWS2812B addressable LED chain on GPIO, 60mA estimated draw
SensorsOnboard sensor interface, crystal oscillator with load cap validation
ProtectionESD clamp on USB D+/D-, dual input fuses (0.75A signal, 2.5A motor)

It audits every connector for ESD protection — and flags the ones that are exposed:

ESD coverage: 19 connectors audited

  USB-C:     ESD clamp on D+/D-  ✓ (partial — 13 signal pins per ground ⚠️)
  Fuse F1:   2.5A motor input  ✓
  Fuse F2:   0.75A signal input  ✓
  ⚠️ 6-pin header:    no protection (exposed signals)
  ⚠️ Motor outputs:   no protection (exposed to back-EMF)
  ⚠️ Servo connectors: no protection (exposed signals)
  ⚠️ Sensor port:     no protection
  ... 19 of 19 connectors have coverage gaps

It validates your passive networks — computing actual circuit behavior from component values:

DetectionComponentsComputed ValueWhat It Means
RC filterR21/C31fc = 15.9 HzLow-pass for slow analog signal
RC filterR1/C13fc = 169 HzDebounce / noise rejection
RC filterR2/C14fc = 1.03 kHzSignal conditioning
FeedbackR8/R9ratio = 0.155Buck converter output voltage set
DividerR42/R43ratio = 0.500Voltage sensing (half)
CrystalY1CL = 14.0 pFLoad cap status: ok (target: 18 pF, -22%)

It suggests applicable certifications — based on what it detects in the design:

Suggested certifications:
  FCC Part 15 Subpart B (US) — unintentional radiator compliance
  CISPR 32 / CE EMC Directive (EU) — EMC compliance for EU market

It checks production readiness — BOM lock status, connector ground distribution, decoupling adequacy:

BOM lock: 0% — no MPNs assigned (prototype stage)
Decoupling: 5 rails, 34 caps total (132µF motor, 110µF logic, 10.8µF 3.3V)
Connector ground: USB-C has 13:1 signal-to-ground ratio (recommended ≤3:1)

For complete examples with all sections, see:

For the end-to-end walkthrough from S-expression parsing through signal detection and datasheet cross-referencing, see How It Works.

🚀 Install

[!TIP] For detailed installation, upgrade, and troubleshooting guidance across all platforms, have your AI agent read install-guidance.md. It covers platform-specific quirks, known bugs, workarounds, and OS-specific issues.

Claude Code:

/plugin marketplace add aklofas/kicad-happy
/plugin install kicad-happy@kicad-happy

[!NOTE] /plugin update may not detect new versions due to a known Claude Code issue. To get the latest version, clear the cache and reinstall:

rm -rf ~/.claude/plugins/cache/kicad-happy ~/.claude/plugins/marketplaces/kicad-happy
/plugin marketplace add aklofas/kicad-happy
/plugin install kicad-happy@kicad-happy

OpenAI Codex:

Use Codex's built-in skill installer first:

"Use $skill-installer to install the kicad-happy skills from https://github.com/aklofas/kicad-happy"

If you prefer a manual install, install the skills into ~/.codex/skills/.

Google Gemini CLI:

gemini skills install <url> does not recurse into this monorepo's skills/ directory. Clone and link all 11 at once:

git clone https://github.com/aklofas/kicad-happy.git
gemini skills link ./kicad-happy/skills

Or install all 11 skills directly from the URL using --path (requires Gemini CLI ≥ Jan 13 2026):

for skill in kicad spice emc datasheets bom digikey mouser lcsc element14 jlcpcb pcbway; do
  gemini skills install https://github.com/aklofas/kicad-happy.git --path skills/$skill
done

See install-guidance.md for workspace-scope installs and upgrade notes.

opencode:

git clone https://github.com/aklofas/kicad-happy.git
cd kicad-happy
opencode

The repo ships .opencode/opencode.json, which opencode auto-discovers and uses to load all 11 skills from ./skills/. For global availability across all projects, see install-guidance.md.

Manual install & other platforms

Claude Code (macOS / Linux):

git clone https://github.com/aklofas/kicad-happy.git
cd kicad-happy
mkdir -p ~/.claude/skills
for skill in kicad spice emc datasheets bom digikey mouser lcsc element14 jlcpcb pcbway; do
  ln -sf "$(pwd)/skills/$skill" ~/.claude/skills/$skill
done

OpenAI Codex — global install (macOS / Linux):

git clone https://github.com/aklofas/kicad-happy.git
cd kicad-happy
mkdir -p ~/.codex/skills
for skill in kicad spice emc datasheets bom digikey mouser lcsc element14 jlcpcb pcbway; do
  ln -sf "$(pwd)/skills/$skill" ~/.codex/skills/$skill
done

Windows PowerShell (Codex):

git clone https://github.com/aklofas/kicad-happy.git
cd kicad-happy
New-Item -ItemType Directory -Force "$HOME\.codex\skills" | Out-Null
"kicad","spice","emc","datasheets","bom","digikey","mouser","lcsc","element14","jlcpcb","pcbway" | ForEach-Object {
  New-Item -ItemType SymbolicLink -Path "$HOME\.codex\skills\$_" -Target "$(Get-Location)\skills\$_" -Force | Out-Null
}

Note: Windows symlinks may require Developer Mode or elevated privileges.

The analysis scripts are pure Python 3.10+ with zero required dependencies. No pip install, no Docker, no KiCad installation needed.

Release candidates

The stable install commands above always resolve to the latest stable release on main (currently v2.1.0). When a release candidate is active, opt in by appending #<tag> to the marketplace ref:

Claude Code:

/plugin marketplace add aklofas/kicad-happy#vX.Y.Z-rc.N
/plugin install kicad-happy@kicad-happy

This pins to the RC tag. Stable users on the un-suffixed marketplace are unaffected. To switch back to stable, remove the marketplace and re-add it without the # suffix.

Codex / Gemini CLI / opencode: clone the repo and check out the RC tag before running the install above:

git clone https://github.com/aklofas/kicad-happy.git
cd kicad-happy
git checkout vX.Y.Z-rc.N
# then run the symlink install for your agent

[!IMPORTANT] Release candidates are pre-release builds intended for evaluation and feedback. They have passed the corpus regression gate and contract test suite but haven't completed extended manual validation. File issues on GitHub if you hit problems.

⚙️ GitHub Action

Also available as a GitHub Action for automated PR reviews. Every push and PR that touches KiCad files gets a commit status check and a structured review comment — power tree, SPICE results, EMC risk, thermal analysis, and more. Optionally chain with Claude for AI-powered natural-language reviews.

See the GitHub Action setup guide for workflow examples, diff-based PR reviews, and AI-powered review configuration.

📦 Skills

SkillWhat it does
kicad⚡ Parse and analyze KiCad schematics, PCB layouts, Gerbers, and PDF reference designs. Automated subcircuit detection, design review, DFM.
spice🔬 SPICE simulation — generates testbenches for detected subcircuits, validates filter frequencies, opamp gains, divider ratios. Monte Carlo tolerance analysis. ngspice, LTspice, Xyce.
emc📡 EMC pre-compliance — 44 rule checks for radiated emission risks, PDN impedance, diff pair skew, ESD paths. FCC/CISPR/automotive/military.
datasheets📄 Extract structured specs from datasheet PDFs — pinouts, electrical characteristics, peripherals, topology. Per-MPN caching with quality scoring. Consumed by kicad/emc/spice/thermal.
bom📋 Full BOM lifecycle — analyze, source, price, export tracking CSVs, generate per-supplier order files.
digikey🔎 Search DigiKey for components and download datasheets via API.
mouser🔎 Search Mouser for components and download datasheets.
lcsc🔎 Search LCSC for components (production sourcing, JLCPCB parts library).
element14🔎 Search Newark/Farnell/element14 (one API, three storefronts).
jlcpcb🏭 JLCPCB fabrication and assembly — design rules, BOM/CPL format, ordering workflow.
pcbway🏭 PCBWay fabrication and assembly — turnkey with MPN-based sourcing.

🖐️ Ask about specific circuits

You don't have to ask for a full design review — just point the agent at whatever you're working on:

"Check the two capacitive touch buttons on my PCB for routing or placement issues"

"Is my boost converter loop area going to cause EMI problems?"

"Trace the enable chain for my power sequencing — is the order correct?"

"Are the differential pairs on my USB routed correctly?"

The agent runs the analysis scripts, then autonomously digs deeper — tracing nets, analyzing zone fills, calculating clearances, reading datasheets.

What the analysis covers

DomainWhat it checks
PowerRegulator Vout from feedback dividers (~65 Vref families), power sequencing, enable chains, inrush, sleep current
AnalogOpamp gain/bandwidth (per-part behavioral models), voltage dividers, RC/LC filters, crystal load caps
ProtectionTVS/ESD mapping, reverse polarity FETs, fuse sizing, clamping voltage
DigitalI2C pull-up validation with rise time calculation, SPI CS counts, UART voltage domains, CAN termination
DomainRF chains, Ethernet, HDMI, memory, BMS, motor drivers, sensors, display/touch, audio, LED drivers, debug interfaces, and more (40 detectors total)
DeratingCapacitor voltage (ceramic 50%/electrolytic 80%), IC abs max, resistor power. Commercial/military/automotive profiles. Over-designed component detection.
PCBThermal via adequacy, zone stitching, trace width vs current, DFM scoring, impedance, proximity/crosstalk
ManufacturingMPN coverage audit, JLCPCB/PCBWay format export, assembly complexity scoring
LifecycleComponent EOL/NRND/obsolescence alerts, temperature grade audit, alternative part suggestions
ThermalJunction temperature estimation for LDOs, switching regulators, shunt resistors. Package Rθ_JA lookup, PCB thermal via correction, proximity warnings for caps near hotspots.
EMCGround plane voids, decoupling, I/O filtering, switching harmonics, clock routing, diff pair skew, board edge radiation, PDN impedance, ESD paths, crosstalk, thermal derating. FCC/CISPR/automotive/military.

🔬 SPICE simulation

"Sweep my LC matching network and show me where it actually resonates vs where I designed it"

"What's the actual phase margin on my opamp filter stage with this TL072?"

"Run SPICE on everything the analyzer detected and tell me what doesn't look right"

The spice skill goes beyond static analysis. It automatically generates SPICE testbenches for detected subcircuits — RC/LC filters, voltage dividers, opamp stages, feedback networks, transistor switches, crystal oscillators — runs them, and reports whether simulated behavior matches calculated values.

For recognized opamps (~100 parts), it uses per-part behavioral models with the real GBW, slew rate, and output swing from distributor APIs or a built-in lookup table. When both schematic and PCB exist, it injects PCB trace parasitics into the simulation.

Simulation: 14 pass, 1 warn, 0 fail
  RC filter R5/C3 (fc=15.9kHz): confirmed, <0.3% error
  Opamp U4A (inverting, gain=-10): 20.0dB confirmed
    Bandwidth 98.8kHz (LM324 behavioral, GBW=1.0MHz)
    Note: signal frequency should stay below 85kHz for <1dB gain error

Monte Carlo tolerance analysis — run N simulations per subcircuit with randomized component values within tolerance bands. Shows which component dominates output variation:

Monte Carlo (N=100): RC filter R5/C3
  fc: 15.9kHz ± 1.8kHz (3σ), spread 22.6%
  Sensitivity: C3 (10%) contributes 68%, R5 (5%) contributes 32%

What-if parameter sweep — instantly see the impact of component changes without editing the schematic:

> "What happens if I change R5 from 10k to 4.7k?"

  RC filter R5/C3: cutoff 1.59kHz → 3.39kHz (+112.8%)
  Voltage divider R5/R6: ratio 0.32 → 0.50 (+56.4%)

Requires ngspice, LTspice, or Xyce (auto-detected). Without one, simulation is skipped — the rest of the analysis still works. For the full methodology — see SPICE Integration Guide.

📡 EMC pre-compliance

"Will my board pass FCC Class B? Check for EMC issues."

"Analyze my switching regulator layout for EMI problems"

"Check my differential pairs for skew-induced common-mode radiation"

The emc skill predicts the most common causes of EMC test failures — ground plane voids, insufficient decoupling, unfiltered I/O cables, switching regulator harmonics, differential pair skew, and more. It operates on the schematic and PCB analyzer output using geometric rule checks and analytical emission formulas (Ott, Paul, Bogatin). When ngspice is available, PDN impedance and EMI filter checks are SPICE-verified for higher accuracy — otherwise analytical models are used as fallback.

EMC risk score: 73/100
  CRITICAL: 1 — SPI_CLK crosses ground plane void on In1.Cu
  HIGH:     2 — USB diff pair 5.2mm skew (exceeds 25ps limit),
                no ground via near TVS U5
  MEDIUM:   3 — decoupling cap 7mm from U3, clock on outer layer,
                via stitching gap near J2
  INFO:     4 — cavity resonance at 715 MHz, switching harmonics
                in 30-88 MHz band

Pre-compliance test plan:
  Focus band: 30-88 MHz (12 switching harmonics from U1, U4)
  Highest risk interface: J1 (USB-C, unfiltered, 480 Mbps)
  Probe points: L1 (45.2, 32.1)mm, Y1 (62.0, 18.5)mm

44 rule checks across power integrity, signal integrity, and radiation. Includes full-board PDN impedance with power tree analysis — traces impedance from regulator output through PCB traces to IC load points, and detects cross-rail coupling when a downstream switching regulator injects transients onto the upstream rail. Supports FCC, CISPR, automotive (CISPR 25), and military (MIL-STD-461G) standards. Generates a pre-compliance test plan with frequency band priorities, interface risk rankings, and near-field probe points. For the full methodology — see EMC Pre-Compliance Guide.

📄 Datasheets — sync and extract

"Sync datasheets for my board at hardware/rev2/"

"What's the EN-pin threshold on the LDO I'm using?"

Datasheets flow through kicad-happy in two stages:

Sync (download). Pulls PDFs for every component with an MPN from DigiKey, LCSC, element14, or Mouser into a local datasheets/ directory. 96% success rate across 240+ manufacturers. Each PDF is verified against the expected part number.

Extract (parse). The datasheets skill turns those PDFs into structured JSON — pinouts, voltage ratings, electrical characteristics, peripherals, topology, SPICE model coefficients. Extractions are cached per-MPN under <project>/datasheets/extracted/ and scored on a five-dimension quality rubric. Analyzer skills (kicad, emc, spice, thermal) consume the cache through a shared helper API with trust gates — so a schematic finding tagged confidence: datasheet-backed means a scored extraction produced the underlying fact, not a keyword match on the part number.

For the full pipeline — page selection, the quality rubric, the consumer API, and what it deliberately doesn't do — see Datasheet Extraction Guide.

📋 BOM management — from schematic to order

"Source all the parts for my board, I'm building 5 prototypes"

The BOM skill manages the full lifecycle of your bill of materials — using your KiCad schematic as the single source of truth. No separate spreadsheets to keep in sync, no copy-pasting between tabs.

The agent analyzes your schematic to detect which distributor fields are populated (and which naming convention you're using — it handles dozens of variants like Digi-Key_PN, DigiKey Part Number, DK, etc.), identifies gaps, searches distributors to fill them, validates every match, and exports per-supplier order files in the exact upload format each distributor expects.

"I need a 3.3V LDO that can do 500mA in SOT-223, under $1"

AZ1117CH-3.3TRG1 — Arizona Microdevices
  3.3V Fixed, 1A, SOT-223-3
  $0.45 @ qty 1, $0.32 @ qty 100
  In stock: 15,000+

AP2114H-3.3TRG1 — Diodes Incorporated
  3.3V Fixed, 1A, SOT-223
  $0.38 @ qty 1, $0.28 @ qty 100
  In stock: 42,000+

🏭 Manufacturing

"Is this board ready to order?"

"Generate the BOM for JLCPCB assembly"

Fab release gate — an automated pre-order checklist that cross-references your schematic, PCB, and Gerber data:

Fabrication Release Gate — 8 check categories

  Routing completeness     ✓ PASS  All 240 nets routed
  BOM readiness            ⚠ WARN  3 components missing MPN
  DFM compliance           ✓ PASS  No spacing violations, standard tier compatible
  Documentation            ✓ PASS  Title block, revision, fab notes present
  Schematic ↔ PCB match    ✓ PASS  296 components matched, 0 orphans
  Gerber verification      ✓ PASS  All layers present, drill file valid
  Thermal analysis         ⚠ WARN  U3 junction temp 92°C (margin: 18°C)
  EMC pre-compliance       ⚠ WARN  Score 73/100 — 2 HIGH findings

  Result: CONDITIONAL PASS (3 warnings to review before ordering)

BOM export — cross-references LCSC part numbers, formats to JLCPCB's exact spec, flags basic vs extended parts. Per-supplier upload files — DigiKey bulk-add CSV, Mouser cart format, LCSC BOM — with quantities already computed for your board count + spares.

🗺️ Workflow

  1. Design your schematic and lay out the PCB in KiCad
  2. Sync datasheets — the agent downloads PDFs and extracts structured specs for every MPN
  3. Design review — the agent runs schematic, PCB, cross-analysis, EMC, SPICE, and thermal analyzers, cross-references against datasheets, and writes a structured report with findings ranked by severity
  4. Iterate — fix issues, re-run the review, compare against the previous run with built-in diff analysis
  5. Source components from DigiKey/Mouser (prototype) or LCSC (production)
  6. Export BOM + per-supplier order files for your assembler
  7. Order from JLCPCB or PCBWay with generated BOM/CPL files

Or set up the GitHub Action and get automated analysis on every PR.

Optional setup

SPICE simulator (for the spice skill): apt install ngspice or LTspice or Xyce. Auto-detected.

API keys (for distributor skills — falls back to web search without them):

ServiceEnv variableNotes
DigiKeyDIGIKEY_CLIENT_ID, DIGIKEY_CLIENT_SECRETdeveloper.digikey.com
MouserMOUSER_SEARCH_API_KEYMy Mouser → APIs
element14ELEMENT14_API_KEYpartner.element14.com
LCSCnoneFree community API

Optional Python packages: requests (better HTTP), playwright (JS-heavy datasheet sites), pdftotext (PDF text extraction).

✅ KiCad version support

VersionSchematicPCBGerber
KiCad 10FullFullFull
KiCad 9FullFullFull
KiCad 8FullFullFull
KiCad 7FullFullFull
KiCad 6FullFullFull
KiCad 5Full (legacy .sch + .lib)FullFull

🎯 Release notes

Current release: v2.1.0 — correctness batch. Seventeen analyzer fixes from field reports and external reviews: inner power planes no longer fragment into false islands on 4+ layer boards (#24), via-in-pad and courtyard-overlap checks use real pad/courtyard geometry instead of bounding boxes (#28, #29), USB compliance failures surface as findings (new UC-001..UC-004), plus a dozen false-positive fixes across sleep-current, decoupling, derating, and lifecycle checks. Includes three fixes ported from Anya Sabo's fork. Upgrading from v2.0.0: expect finding churn in exactly those classes — overwhelmingly false positives disappearing; four additive JSON fields, no breaking schema changes.

Per-release stories are in release-notes.md; line-level detail in the CHANGELOG.

🧪 Test harness

Everything above was validated against a corpus of 5,800+ open-source KiCad projects — the kind of designs real engineers actually build. The corpus spans hobby boards, production hardware, motor controllers, RF frontends, battery management systems, IoT devices, audio amplifiers, and everything in between. KiCad 5 through 10. Single-sheet and multi-sheet hierarchical. 2-layer through 6-layer. For full methodology and reproducibility instructions, see VALIDATION.md.

The numbers:

MetricValue
Repos in corpus5,800+
Schematic files analyzed6,845 (100% success)
PCB files analyzed3,498 (99.9%)
Gerber directories analyzed1,050 (100% success)
EMC pre-compliance analyses6,853 (100% success, 141K+ findings)
Components parsed312,956
Nets traced531,418
SPICE subcircuit simulations30,646 across 17 types
SPICE-verified EMC findings169 (PDN impedance via ngspice)
Regression assertions808K+ at 100% pass rate
Equations tracked & verified86 with source citations
Bugfix regression guards67 (100% pass — no fixed bugs have returned)
Closed analyzer issues193

Three-layer regression testing catches drift at every level:

LayerWhat it catches
BaselinesOutput drift between analyzer versions
AssertionsHard regressions on known-good results (component counts, detected subcircuits, signal paths)
LLM reviewSemantic issues deterministic checks miss — findings get promoted to machine-checkable assertions

🎨 Why KiCad?

This project exists because KiCad is absolutely incredible. Fully open-source, cross-platform, backed by CERN, with a community that ships features faster than most commercial tools. It's used everywhere from weekend hobby projects to production hardware at real companies.

But what makes KiCad truly special for AI-assisted design — and the entire reason this project can exist — is its beautifully open file format. Every schematic, PCB layout, symbol, and footprint is stored as clean, human-readable S-expressions. No proprietary binary blobs. No vendor lock-in. No $500 "export plugin" just to read your own data.

This means your AI agent can read your KiCad files directly, understand every component, trace every net, and reason about your design at the same level a human engineer would. No KiCad export plugins, no export steps, no intermediary formats. Just your KiCad project and a terminal.

Try doing that with Altium or OrCAD. 😉

📜 License

MIT — see CHANGELOG.md for release history and CONTRIBUTING.md for development guidelines.


Built with Claude Code and OpenAI Codex. 🤖

研究与检索Agent / MCP / Skill 创作

高风险

  • 来源需自行核对维护者身份。
  • 包含脚本或命令调用,安装前请复核。
  • 可能需要外部 token、网络权限或第三方服务。
  • 存在潜在风险命令,请谨慎安装。
  • 扫描发现:4 条。

Codex — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/aklofas/kicad-happy.git
  3. 将 "skills/bom" 文件夹复制到 Codex 的 skills 目录中。
  4. 重启 Codex 让新的 skill 生效。

Codex — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Codex 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Codex 让新的 skill 生效。

Claude Code — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/aklofas/kicad-happy.git
  3. 将 "skills/bom" 文件夹复制到 Claude Code 的 skills 目录中。
  4. 重启 Claude Code 让新的 skill 生效。

Claude Code — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Claude Code 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Claude Code 让新的 skill 生效。

Cursor — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/aklofas/kicad-happy.git
  3. 将 "skills/bom" 文件夹复制到 Cursor 的 skills 目录中。
  4. 重启 Cursor 让新的 skill 生效。

Cursor — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Cursor 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Cursor 让新的 skill 生效。

GitHub Copilot — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/aklofas/kicad-happy.git
  3. 将 "skills/bom" 文件夹复制到 GitHub Copilot 的 skills 目录中。
  4. 重启 GitHub Copilot 让新的 skill 生效。

GitHub Copilot — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 GitHub Copilot 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 GitHub Copilot 让新的 skill 生效。

Windsurf — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/aklofas/kicad-happy.git
  3. 将 "skills/bom" 文件夹复制到 Windsurf 的 skills 目录中。
  4. 重启 Windsurf 让新的 skill 生效。

Windsurf — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Windsurf 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Windsurf 让新的 skill 生效。
查看 SKILL.md 原文
name: bom
description: BOM (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 KiCad symbol properties. ALWAYS trigger this skill for any task involving component sourcing, pricing, ordering, distributor searches, BOM export, or fabrication preparation — even if the user names a specific distributor or fab house (e.g. "search DigiKey for...", "generate JLCPCB BOM", "order from Mouser"). This skill analyzes the schematic for sourcing gaps, recommends which distributor/fab skills to call for each gap, and writes results back as symbol properties — the agent (or user) performs the actual searches via the called skills. Also trigger on phrases like "what parts do I need", "order components", "how much will this cost", "export for JLCPCB", "find parts for this board", "compare pricing", or "check stock".

BOM Management

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.

Related Skills

SkillPurpose
kicadRead/analyze schematics, PCB, footprints
digikeySearch DigiKey, download datasheets (primary prototype source)
mouserSearch Mouser (secondary prototype source)
lcscSearch LCSC (production/JLCPCB parts)
element14Search Newark/Farnell/element14 (international)
jlcpcbPCB fabrication & assembly ordering
pcbwayAlternative PCB fab & assembly

Scripts

Use <skill-path> to reference the BOM skill directory.

# Analyze schematic (JSON output, recursive sub-sheets)
python3 <skill-path>/scripts/bom_manager.py analyze path/to/schematic.kicad_sch --json --recursive

# Export BOM tracking CSV (creates new or merges with existing)
python3 <skill-path>/scripts/bom_manager.py export path/to/schematic.kicad_sch -o bom/bom.csv --recursive

# Generate per-distributor order files (5 boards + 2 spares/line)
python3 <skill-path>/scripts/bom_manager.py order bom/bom.csv --boards 5 --spares 2

# Quick single-distributor order (bypasses Chosen_Distributor column)
python3 <skill-path>/scripts/bom_manager.py order bom/bom.csv --distributor digikey

# Write properties to schematic (dry-run first, then apply)
echo '{"R1": {"MPN": "RC0805FR-0710KL", "Manufacturer": "Yageo"}}' \
  | python3 <skill-path>/scripts/edit_properties.py path/to/schematic.kicad_sch --dry-run

# Sync datasheet URLs from manifest.json back into schematic Datasheet properties
python3 <skill-path>/scripts/sync_datasheet_urls.py path/to/schematic.kicad_sch --recursive --dry-run

# Translate KiCad/Altium BOM and CPL files into JLCPCB upload format
# (`pnp --bom` filter drops orphan designators — see skills/jlcpcb/SKILL.md
# for the 3-step PCBA upload workflow)
python3 <skill-path>/scripts/translate_bom_pnp.py bom input_bom.csv -o jlc_bom.csv
python3 <skill-path>/scripts/translate_bom_pnp.py pnp input_cpl.csv -o jlc_cpl.csv --bom jlc_bom.csv

Workflow

Skip steps that don't apply. Common shortcuts:

  • "Add Mouser PNs" — search Mouser by MPN for each part → validate → write to schematic → update CSV
  • "Fill in the gaps" — run analyzer with --gaps-only, address each missing field
  • "Update datasheet URLs" — run sync_datasheet_urls.py to backfill empty Datasheet fields from the datasheets manifest
  • "Prepare for production" — ensure every part has an LCSC number, check stock, set Chosen_Distributor to LCSC

Step 1: Understand the Project

python3 <skill-path>/scripts/bom_manager.py analyze path/to/schematic.kicad_sch --json --recursive

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.

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.

Step 2: Sync Datasheets

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.

python3 <digikey-skill-path>/scripts/sync_datasheets_digikey.py path/to/schematic.kicad_sch --recursive
python3 <lcsc-skill-path>/scripts/sync_datasheets_lcsc.py path/to/schematic.kicad_sch --recursive
python3 <element14-skill-path>/scripts/sync_datasheets_element14.py path/to/schematic.kicad_sch --recursive

DigiKey is best (direct PDF URLs). element14 is reliable (no bot protection). LCSC works for LCSC-only parts. Mouser is a last resort (often blocks downloads).

Tell the user where datasheets are (e.g., hardware/<project>/datasheets/). They'll reference them often.

Cross-revision projects: Use a single shared datasheets directory at the project level rather than per-revision. The same MPN's datasheet doesn't change between revisions.

Re-sync after writing new MPNs (Step 5) — the scripts are idempotent. Then backfill Datasheet URLs into the schematic:

python3 <skill-path>/scripts/sync_datasheet_urls.py path/to/schematic.kicad_sch --recursive

This reads datasheets/manifest.json (legacy name index.json still supported) and writes discovered datasheet URLs into empty schematic Datasheet properties. Opportunistic — only fills blanks. If a schematic already has a different URL, it warns about the mismatch without overwriting (use --overwrite to replace). Run with --dry-run first to preview.

Step 3: Gather Part Information

Watch for comma-separated MPNs. Some symbols track multiple physical parts (e.g., battery holder + clip). Split on commas and search each MPN independently — searching the combined string matches the wrong product.

Search strategy based on what's available:

  • Has MPN → search distributors by MPN to get their PNs and stock
  • Has distributor PN but no MPN → search that distributor, get MPN, then search others
  • Has only Value + Footprint → search by description (e.g., "100nF 0402 X7R 16V")

Use the project's preferred distributor first, then alternates. Prototype: DigiKey primary, Mouser secondary. Production: LCSC.

Step 4: Validate Matches

Don't assume existing PNs are correct — distributor PNs go stale (discontinued, renumbered). Verify existing PNs resolve against the API. If a PN returns 404, flag it for replacement.

For every match, verify:

  1. Package matches the schematic footprint (see cross-reference table below)
  2. Specs match (capacitance, resistance, voltage, tolerance)
  3. Description makes sense (a resistor ref should get a resistor)
  4. Lifecycle — not obsolete or EOL
  5. Datasheet URL is a direct PDF link (not a product page)

If ambiguous, ask the user. A wrong part is worse than a missing part.

Step 5: Update the Schematic

KiCad coexistence. The script detects KiCad's lock file and warns but proceeds. KiCad doesn't auto-detect external changes — it keeps its in-memory copy. If KiCad is open, tell the user: "Close and reopen the schematic (File → Open Recent) to see the changes. Don't save from KiCad first."

If unsaved KiCad work exists, ask them to save first (Ctrl+S), then run the script, then reopen.

echo '{"R1": {"MPN": "RC0805FR-0710KL", "Manufacturer": "Yageo", "DigiKey": "311-10.0KCRCT-ND"}}' \
  | python3 <skill-path>/scripts/edit_properties.py path/to/schematic.kicad_sch

Backups: By default, no .bak file is created (git tracks changes). Pass --backup if the schematic is not in a git repo or has uncommitted changes the user wants to preserve.

Respect the project's convention. Write to "Digi-Key_PN" if that's what exists, not "DigiKey". Use canonical names only for new projects.

Always write Manufacturer alongside MPN — every API returns it, it's free data.

Step 6: Update the BOM Tracking CSV

python3 <skill-path>/scripts/bom_manager.py export path/to/schematic.kicad_sch -o bom/bom.csv --recursive

CSV columns are dynamic — only distributors the project uses get columns. Base columns: Reference, Qty, Value, Footprint, MPN, Manufacturer. Each active distributor gets a PN column + stock column. Tail columns: Chosen_Distributor, Datasheet, Validated, DNP, Notes.

The Notes column is seeded from schematic BOM Comments properties (or aliases like Notes, Remarks, Ordering Notes, etc.) on first export. On re-export, user edits in the CSV take priority — existing Notes values are preserved and schematic-sourced comments won't overwrite them.

Merge behavior: Re-exporting preserves user-managed columns (stock, Chosen_Distributor, Validated, Notes) while updating schematic-derived columns.

Step 7: Check Stock

For each part with a distributor PN, query current stock via the corresponding distributor skill. Update stock columns in the CSV. Stock data goes stale — note the date and re-check before ordering.

If the chosen distributor is out of stock, flag it and suggest the alternate.

Step 8: Set Chosen Distributor

Factors: stock availability, price at order qty, minimum order/multiples, lead time, shipping consolidation (fewer distributors = fewer shipments).

For prototypes, consolidate to 1-2 distributors (DigiKey + Mouser). For production, LCSC/JLCPCB is cheapest.

Step 9: Re-Sync Datasheets & URLs

Re-run Step 2 (download + URL backfill) to pick up parts added in Steps 3-5. Fast — already-downloaded files are skipped.

Step 10: Validate Datasheets Against Design

Read downloaded datasheets and verify parts are functionally correct for the circuit. This catches wrong-part-number errors that Step 4 might miss.

What to check by type:

  • Passives — voltage rating vs rail voltage, temperature coefficient, power dissipation
  • Regulators — Vin range, Vout, max current, quiescent current
  • MCUs/ICs — supply voltage, I/O levels, peripherals, pinout
  • Connectors — pin count, pitch, current/voltage rating
  • MOSFETs — Vds, Rds(on), gate threshold, thermal dissipation
  • Diodes — Vf, Vr, current rating, recovery time

For large BOMs (50+ parts), focus on power components, critical signal paths, and anything the user flagged. Commodity passives usually don't need deep review.

Step 11: Generate Order Files

Ask how many boards if not already known — this sets the --boards multiplier.

Pre-flight: verify no gaps, CSV is current, Chosen_Distributor is set (or use --distributor flag), stock is fresh.

# Using Chosen_Distributor column, 5 boards + 2 spares
python3 <skill-path>/scripts/bom_manager.py order bom/bom.csv -o bom/orders/ --boards 5 --spares 2

# Or quick single-distributor order
python3 <skill-path>/scripts/bom_manager.py order bom/bom.csv --distributor digikey

--boards multiplies all quantities. --spares adds a flat extra per line after multiplication. --distributor bypasses Chosen_Distributor — generates an order for all parts with that distributor's PN.

Comma-separated PNs (accessories) are auto-split into separate order lines. DNP parts excluded. The script produces one file per distributor in the correct upload format (see references/ordering-and-fabrication.md for format details).

Present the order summary and let the user review/edit before ordering.

Cost estimate: After generating order files, query pricing from distributor APIs at the order quantity and present a total per distributor. See references/ordering-and-fabrication.md for the cost summary template.

BOM Corner Cases & Per-Component Notes

Real projects have BOM quirks that don't fit neatly into standard fields. These are the things that get lost between design and ordering — a connector that's only for prototyping, a cable shared between two boards, a part that needs to be ordered from a specific vendor lot. Actively look for these during BOM analysis; don't wait for the user to mention them.

BOM Comments Field

The BOM Comments symbol property (canonical name) captures per-component freeform notes. It flows into the Notes column in the exported CSV. The script recognizes many aliases: BOM Notes, Ordering Notes, Assembly Notes, Notes, Remarks, Comment, and underscore/space variants.

When to suggest adding BOM Comments:

  • Component is prototype-only (DNP in production, or vice versa)
  • Component has ordering constraints (minimum order qty, long lead time, specific vendor lot)
  • Component is shared with another board (ribbon cables, mating connectors, shared harnesses)
  • Component has assembly notes (orientation matters, hand-solder only, apply after reflow)
  • Component has substitution rules (acceptable alternates, pin-compatible swaps)
  • Component has conditional population (different value for different product variants/SKUs)

Example values:

"Proto only — DNP in production"
"Shares ribbon cable with power board — don't double-order"
"Must be Murata GRM series, no substitution (validated for EMI)"
"Hand-solder after reflow — temperature sensitive"
"Order 10% extra — fragile QFN rework difficult"
"Use 10K for rev A, 4.7K for rev B"
"Mating connector: Molex 39-01-2040 on cable side"

Where Else to Look for BOM Quirks

The schematic symbol property is the best place for per-component notes, but projects scatter this information everywhere. Check all of these:

  1. Schematic text annotations — free text placed on the schematic sheet. The kicad skill's analyzer extracts these as text_annotations. Look for notes near components about ordering, assembly, or variants.

  2. Title block comments — the title block has numbered comment fields. Sometimes used for board-level BOM notes ("All passives 0402 unless marked", "Order from DigiKey for proto").

  3. Project README / docs — look for README.md, docs/, bom/README.md, or any text file mentioning parts, ordering, or assembly. These often contain the highest-level BOM decisions.

  4. Existing BOM CSV Notes column — if a bom.csv already exists, read the Notes column. The user may have added notes there that aren't in the schematic.

  5. Project-level config (.kicad-happy.json) — preferred_suppliers sets sourcing priority, bom section sets field naming and grouping conventions. See skills/kicad/references/config-reference.md for the full schema.

  6. Schematic symbol Description field — sometimes used for assembly notes rather than part description (e.g., "100nF bypass - place close to U3 pin 4").

  7. KiCad custom fields with non-standard names — fields like Assembly, Order, Variant, Config, SKU may contain BOM-relevant info. The analyzer flags these as unrecognized_fields.

  8. DNP with context — a DNP component may need a note about why it's DNP and when to populate it. KiCad's DNP flag is boolean — the reason belongs in BOM Comments.

Multi-Board / System-Level BOM Concerns

When a project has multiple boards (e.g., main board + daughter board, or sender + receiver):

  • Shared cables/connectors — document on both boards which connector mates with which, and note "don't double-order" on cables shared between boards
  • Shared power supplies — if boards share a PSU, document which board's BOM includes it
  • Common parts across boards — when ordering, consolidate quantities across boards. Note in each board's BOM which parts are shared
  • Board-specific variants — if the same PCB is used with different stuffing options (e.g., different resistor values for different output voltages), use BOM Comments to document the variant rules

Non-BOM Items

Some project-specific items aren't on the schematic but need ordering alongside the BOM. Commonly forgotten:

  • Mating connectors & cables — if the schematic has a connector, the other half needs ordering too (board-to-board, ribbon cables, wire harnesses)
  • Stencil — order a framed stencil with the PCBs (~$7 from JLCPCB/PCBWay)
  • Programming/debug adapter — Tag-Connect cable, SWD ribbon, specific USB cable for the board's debug connector
  • Antenna cables — U.FL to SMA pigtails if the board has an RF connector
  • Mounting hardware — standoffs, screws, nuts specific to the enclosure
  • Thermal management — heat sinks, thermal pads for specific components

Track these as rows in the BOM CSV with Reference = -- and a Note, or in a separate bom/non-bom-items.csv. Mention them separately in cost estimates.

Presenting BOM Comments

When generating reports or order summaries, always surface BOM comments prominently — they're the designer's voice about exceptions and gotchas. Don't bury them. In the order summary, list any component with a BOM comment separately after the main table so the user sees them before clicking "order."

Package/Footprint Cross-Reference

ImperialMetricKiCad Footprint
02010603R_0201_0603Metric
04021005R_0402_1005Metric
06031608R_0603_1608Metric
08052012R_0805_2012Metric
12063216R_1206_3216Metric

Replace R_ with C_ or L_ as appropriate. Prefix with Resistor_SMD:, Capacitor_SMD:, etc.

BOM Diffing

When the schematic changes between revisions, compare the old and new BOM to identify added, removed, and changed parts. Highlight which new parts need sourcing.

Interactive BOM (ibom)

Generates an HTML page showing component locations on the PCB — essential for hand-assembly.

pip install InteractiveHtmlBom
generate_interactive_bom board.kicad_pcb \
  --dest-dir bom/ --name-format "%f_ibom_%r" \
  --extra-fields "MPN,Manufacturer,DigiKey,Mouser,LCSC" \
  --group-fields "Value,Footprint,MPN" \
  --checkboxes "Sourced,Placed" --dnp-field "DNP" --no-browser

Reference Files

Read these when you need detailed lookup data:

  • references/kicad-fields.md — field definitions, aliases, S-expression format, part number patterns
  • references/ordering-and-fabrication.md — distributor paste formats, gerber export, CPL, cost templates
  • references/part-number-conventions.md — detailed analysis of naming patterns across 56+ real projects

Production Readiness Checklist

  • All parts have MPN and LCSC numbers (for JLCPCB) or MPN (for PCBWay)
  • No obsolete or EOL parts
  • Stock verified, basic vs extended parts identified
  • BOM and CPL exported in correct format
  • Gerbers exported and verified
  • Design rules meet manufacturer minimums (see jlcpcb or pcbway skill)
  • Prototype fully tested

Generated Files & Cleanup

The BOM and distributor skills create files in the project tree. Know what they are so you can clean up or .gitignore them.

Files created in the project directory

File/DirCreated ByPurposeKeep in git?
datasheets/DigiKey, LCSC, element14, Mouser sync scriptsDownloaded PDF datasheetsNo — large binaries, re-downloadable
datasheets/manifest.jsonDatasheet sync scriptsTracks download status per MPN (legacy name: index.json)No — regenerated by sync
bom/bom.csvbom_manager.py exportBOM tracking spreadsheetYes — user-curated data
bom/orders/*.csvbom_manager.py orderPer-distributor order upload filesNo — regenerated before each order
*.YYYYMMDD_HHMMSS.bakedit_properties.py --backupSchematic backup before editsNo — use git instead

The kicad skill also creates analyzer JSON and design review markdown reports with user-chosen filenames — see its "Generated Files" section for tracking and cleanup guidance.

Temporary files (outside project)

FileLocationPurpose
digikey_token_cache.jsonSystem temp dirOAuth token cache (9-min TTL, mode 0600)
manifest.tmpdatasheets/Atomic write staging — renamed to manifest.json, never persists

Cleanup commands

# Remove downloaded datasheets (re-downloadable)
rm -rf datasheets/

# Remove order files (regenerate before ordering)
rm -rf bom/orders/

# Remove schematic backups
rm -f *.bak

# Remove KiCad analyzer/report files (filenames vary — check project instructions file)

Suggested .gitignore additions

# BOM skill working files
datasheets/
bom/orders/
*.bak

Keep bom/bom.csv tracked — it contains user-curated data (Chosen_Distributor, Validated, Notes) that can't be regenerated from the schematic alone.

Tips

  • MPN is the universal key — populate it first, enables cross-referencing everything
  • Schematic is source of truth — all BOM data in symbol properties, exported as needed
  • DigiKey first, Mouser second for prototyping; LCSC for production
  • CSV round-trip — Edit Symbol Fields > Export/Import CSV for bulk updates
  • Field Name Templates (KiCad 9+) — pre-define MPN, Manufacturer, LCSC, DigiKey, Mouser
  • DigiKey token reuse — cached to temp file with 9-minute TTL; no need to re-auth per call
  • Second source — use AltMPN field for critical parts
  • Price at target qty — prototype pricing != production pricing
  • BOM Comments — use the BOM Comments symbol property for ordering/assembly quirks that don't fit in standard fields. Flows into CSV Notes column. Check schematic text annotations, README, and existing CSV notes for scattered BOM info too.

发现问题?提交给管理员复核

评分:

评论 (0)

暂无评论,成为第一个评论者吧!