Skip to main content
BOMFreeNewv1.0.0

原理图转 BOM

解析 KiCad 原理图 S 表达式,按值/封装/型号分组生成采购 BOM(CSV),标记缺封装、缺值与 DNP,输出契约报告;可选 LCSC/DigiKey 匹配。

Claude CodeGeneric

Badges only claim the demo-run passed on that host; cross-host installation is handled by the adapter layer.

Script environment

  • node ≥ 20
  • DIGIKEY_API_KEY
  • LCSC_API_KEY

Dependencies

No dependencies
This skill works standalone.

SKILL.md

Content matches the files inside the package; extracted by the publish pipeline.

原理图转 BOM

把 .kicad_sch 变成可采购的分组 BOM。脚本离线解析 S 表达式, 不需要安装 KiCad;供应商匹配是可选的第二步。

1. 提取 BOM

node scripts/bom_extract.mjs --schematic design.kicad_sch --out-dir out

产出 out/bom/bom.csv,列:Item, References, Qty, Value, Footprint, LibId, MPN, DNP。分组键 = Value + Footprint + LibId + MPN; 电源符号(power: 库、# 前缀位号)自动跳过;DNP 元件单独成行 并标 DNP=yes,不计入采购数量。

stdout 是 pskillry.report.v1 报告:缺封装/缺值为 warning, 无位号为 error。warning 必须逐条向用户确认(测试点、裸盘等 可接受项除外)。

2. 供应商匹配(可选)

需要用户自己在环境变量中设置密钥(绝不接受聊天内粘贴):

node scripts/bom_extract.mjs --check
# 只输出 LCSC_API_KEY / DIGIKEY_API_KEY 的 set/unset,不输出值

已设置时,agent 可用对应 key 调用 LCSC / DigiKey 搜索 API, 按 Value+封装匹配候选料号,把候选(编号、库存、单价)列给用户 确认后写入 MPN 列。未设置时跳过本步并告知用户设置方法; BOM 本体不受影响。

3. 交付

  • bom.csv + 报告原文。
  • 提醒用户:电解电容耐压、电阻功率等降额信息不在原理图属性里, 采购前需人工补充(见 references/bom-workflow.md)。

Rules

  1. 第三方 key 只从环境变量读取;不打印、不存储、不写入任何产物。
  2. 缺凭证时先告知设置方法,再继续不依赖凭证的部分。
  3. BOM 行只能来自真实解析结果;禁止手填"估计数量"。
  4. DNP 与缺封装项必须显式呈现,不得静默丢弃。

Package files

references/

scripts/

  • schematic-to-bom/scripts/bom_extract.mjs4.5 KB
  • schematic-to-bom/scripts/fixtures/example-schematic.md3.6 KB

demo-run/

  • demo-run/bom/bom.csv665 B
  • demo-run/reports/bom-report.json578 B

Demo run

Passed with warnings0 errors · 1 warnings

pskillry-bom-extract 1.0.0 · 2026/11/17

  • [info] DNP (R4): do-not-populate part kept as a separate BOM row
  • [warning] MISSING_FOOTPRINT (LED1): no Footprint property; excluded from assembly matching

Ratings & reviews

Not rated0 ratings

5 star0
4 star0
3 star0
2 star0
1 star0

Sign in to rate this skill.

Sign in

Versions

  • v1.0.0Latest7.1 KB

    首发种子版本。

    License: MITSHA-256: d0cf97d3d136c7ba…

Related skills

No related skills
Skills with the same output type and use case will appear here.