npx skills add https://github.com/aklofas/kicad-happy --skill kicad| 技能 | 用途 |
|---|---|
bom | BOM 提取、丰富、订购和导出工作流 |
digikey | 在 DigiKey 上搜索元器件(原型采购) |
mouser | 在 Mouser 上搜索元器件(次要原型来源) |
lcsc | 在 LCSC 上搜索元器件(生产采购,JLCPCB) |
jlcpcb | PCB 制造与组装订购 |
pcbway |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 替代的 PCB 制造与组装 |
交接指导: 使用此技能解析原理图/PCB 并提取结构化数据。将任务交接给 bom 进行 BOM 丰富、定价和订购。交接给 digikey/mouser/lcsc 进行元器件搜索和数据手册获取。交接给 jlcpcb/pcbway 进行制造订购和 DFM 规则验证。
此技能也处理 PDF 原理图 — 参考设计、开发板原理图、评估板文档、应用笔记和数据手册中的典型应用电路。常见用例:
工作流: 视觉读取 PDF 页面 → 识别元件和连接 → 提取结构化数据 → 转换为 KiCad 符号和网络 → 根据数据手册进行验证。
关于完整的方法论 — 元件提取、符号约定、网络映射、子电路提取、KiCad 转换和验证 — 请阅读 references/pdf-schematic-extraction.md。
关于根据数据手册对提取的电路进行深度验证(验证值、检查模式、检测错误),请使用 references/schematic-analysis.md 中的方法。
此技能包含 Python 脚本,可一次性从 KiCad 文件中提取全面的结构化 JSON。首先运行这些脚本,然后对输出进行推理。
请直接使用 Read 工具读取分析器 JSON 输出,而不是编写临时提取脚本。JSON 模式有特定的字段名称(如下所述),在自定义代码中很容易出错。要提取特定部分:python3 -c "import json; d=json.load(open('file.json')); print(json.dumps(d['key'], indent=2))"。
在以下所有命令中,<skill-path> 指此技能的基础目录(加载此文件时显示在顶部)。
python3 <skill-path>/scripts/analyze_schematic.py <file.kicad_sch>
输出结构化 JSON(约 60-220KB,取决于板卡复杂度),包含:
vref_source 和 vout_net_mismatch 字段支持现代的 .kicad_sch(KiCad 6+)和旧版的 .sch(KiCad 4/5)。分层设计会递归解析。
旧版格式限制: 对于 KiCad 5 旧版 .sch 文件,分析器仅提供元件和网络提取 — 没有引脚到网络映射、没有信号分析、没有子电路检测。当输出中缺少信号分析时,请使用补充数据源来填补空白 — 请参阅下面的部分。
当 analyze_schematic.py 返回不完整的数据时(通常是旧版 .sch 格式 — 缺少引脚到网络映射、信号分析和子电路检测),请使用其他项目文件来恢复完整的分析能力。最有价值的来源是 .net 网络表文件,它提供了明确的引脚到网络映射,可以完全弥补信号分析的空白。
关于详细的解析说明、数据恢复工作流以及补充源(网络表、缓存库、PCB 交叉引用、PDF 导出)的优先级矩阵,请阅读 references/supplementary-data-sources.md。
根据实际情况验证分析器输出。 分析器可能会悄无声息地产生看似合理但错误的结果 — 错误的电压估算、缺失的 MPN、错误的引脚到网络映射。这些不会导致脚本错误;它们只是产生流入您报告的错误数据。在测试多个板卡时,每个项目至少有一个误导性的分析器输出。请对照原始的 .kicad_sch 文件进行交叉验证:
(symbol (lib_id 块,减去电源符号。必须与分析器计数完全匹配。Q_NPN_BEC = 引脚 1=B,2=E,3=C),但该假设与实际部件不匹配。所有一致性检查都通过,但板卡是错误的。要发现这种情况:
lib_id 后缀编码了一个引脚顺序假设。SOT-23 BJT 至少存在 6 种引脚排列变体(BEC、BCE、EBC、ECB、CBE、CEB);SOT-23 MOSFET 有 GDS、GSD、SGD、DSG。如果未指定 MPN,则无法验证该假设 — 将此标记为关键歧义。vref_source 字段。"lookup" 表示经过数据手册验证(约 60 个系列);"heuristic" 表示这是一个需要手动验证的猜测。vout_net_mismatch 字段标记估算的 Vout 与输出网络名称电压相差 >15% 的情况。完整的验证清单请参见 references/schematic-analysis.md 第 2 步。如果脚本失败或返回意外结果,请参阅 references/manual-schematic-parsing.md 了解完整的回退方法。
python3 <skill-path>/scripts/analyze_pcb.py <file.kicad_pcb>
python3 <skill-path>/scripts/analyze_pcb.py <file.kicad_pcb> --proximity # 添加串扰分析
输出结构化 JSON(约 50-300KB,取决于板卡复杂度),包含:
--proximity)添加 --full 以包含单个走线/过孔的坐标。支持 KiCad 5 旧版格式。
每次运行后验证: 根据原始的 .kicad_pcb 文件确认封装数量和板框尺寸。针对 IC 封装,根据原理图的引脚到网络映射验证焊盘到网络的分配 — 这可以捕获库封装错误,即焊盘编号与符号引脚排列不匹配。如果脚本失败,请参阅 references/manual-pcb-parsing.md 了解回退方法。
python3 <skill-path>/scripts/analyze_gerbers.py <gerber_directory/>
输出:层识别(X2 属性)、元件/网络/引脚映射(KiCad 6+ TO 属性)、光圈功能分类、走线宽度分布、板卡尺寸、钻孔分类(过孔/元件/安装孔)、层完整性、对齐验证、焊盘类型摘要(SMD/THT 比率)。添加 --full 以获取完整的引脚到网络连接性转储。约 10KB JSON。
如果脚本失败或返回意外结果,请参阅 references/manual-gerber-parsing.md 了解直接解析原始 Gerber/Excellon 文件的完整回退方法。
所有脚本都将 JSON 输出到 stdout。使用 --output file.json 写入文件,使用 --compact 获取单行 JSON。
原理图分析器顶层键:
file, kicad_version, file_version, title_block, statistics, bom, components,
nets, subcircuits, ic_pin_analysis, signal_analysis, design_analysis,
connectivity_issues, labels, no_connects, power_symbols, annotation_issues,
label_shape_warnings, pwr_flag_warnings, footprint_filter_warnings,
sourcing_audit, ground_domains, bus_topology, wire_geometry,
simulation_readiness, property_issues, placement_analysis, hierarchical_labels
可选(非空时出现):text_annotations, alternate_pin_summary, pin_coverage_warnings, instance_consistency_warnings, pdn_impedance, sleep_current_audit, voltage_derating, power_budget, power_sequencing, bom_optimization, test_coverage, assembly_complexity, usb_compliance, inrush_analysis, sheets
关键嵌套结构:
statistics: {total_components, unique_parts, dnp_parts, total_nets, total_wires, total_no_connects, component_types, power_rails, missing_mpn, ...}bom[]: {reference, references[], value, footprint, mpn, manufacturer, datasheet, quantity, dnp, ...}components[]: {reference, value, footprint, lib_id, type, mpn, datasheet, dnp, in_bom, parsed_value, ...}nets{net_name}: {pins[], wires, labels[], ...} — 每个引脚:{component, pin_number, pin_name, pin_type, ...}(不是 ref 或 pin)signal_analysis: {power_regulators[], voltage_dividers[], rc_filters[], opamp_circuits[], transistor_circuits[], bridge_circuits[], crystal_circuits[], current_sense[], decoupling_analysis[], protection_devices[], buzzer_speaker_circuits[], design_observations[], ...}PCB 分析器顶层键:
file, kicad_version, file_version, statistics, layers, setup, nets,
board_outline, component_groups, footprints, tracks, vias, zones,
connectivity, net_lengths
可选:power_net_routing, decoupling_placement, ground_domains, current_capacity, thermal_analysis, layer_transitions, placement_analysis, silkscreen, dfm, board_metadata, tombstoning_risk, thermal_pad_vias
关键嵌套结构:
net_lengths 是一个列表(不是字典):[{net, net_number, total_length_mm, segment_count, via_count, layers{}}, ...] 按长度降序排序power_net_routing 是一个列表:[{net, track_count, total_length_mm, min_width_mm, max_width_mm, widths_used[]}, ...]footprints[]: {reference, value, footprint, layer, pads[], sch_path, sch_sheetname, sch_sheetfile, connected_nets[], ...}statistics: {copper_layers_used, total_footprints, smd_count, tht_count, ...}Gerber 分析器顶层键:
statistics, completeness, alignment, drill_classification, pad_summary,
board_dimensions, gerbers, drills
工作流: 分析 KiCad 项目时,扫描项目目录中所有可用的文件类型,并运行每个适用的分析器 — 不仅仅是用户提到的那个。完整的分析应使用所有可用的数据:
.kicad_sch、.kicad_pcb、.kicad_pro、gerber 目录以及 .net/.xml 网络表文件analyze_schematic.py。如果存在 PCB,运行 analyze_pcb.py。如果存在 gerber 文件,运行 analyze_gerbers.py。尽可能并行运行它们。.kicad_pro 项目文件(它是 JSON)以获取设计规则、网络类别和 DRC/ERC 设置references/report-generation.md。您结合的数据源越多,分析的置信度就越高。仅审查原理图会遗漏布局问题;仅审查 PCB 会遗漏设计意图。请始终使用所有可用的资源。
除非用户要求快速审查,否则默认进行彻底分析。原因是:那些能毁掉板卡的错误往往乍一看是正确的。抽查可能确认 5 个 IC 是正确的,而第 6 个的引脚 3 和 4 互换了 — 正是这个错误会毁掉板卡。彻底性原则:
数据手册是将一致性检查与正确性检查区分开来的关键。没有它们,您可以确认设计内部一致 — 但无法确认它与真实世界的部件匹配。在工作流早期获取数据手册。
自动同步(首选): 如果安装了 digikey 技能,请在工作流早期对原理图运行 sync_datasheets.py。这将为所有带有 MPN 的元件下载数据手册到 datasheets/ 目录,并生成 index.json 清单。与分析器脚本并行运行:
python3 <digikey-skill-path>/scripts/sync_datasheets.py <file.kicad_sch>
检查现有数据手册: 下载前,查找:
<project>/datasheets/ 目录及其中的 index.json(来自之前的同步)<project>/docs/ 或 <project>/documentation/Datasheet 属性 URL当自动同步不可用或遗漏部件时的回退方法:
Datasheet 属性 URL — 许多 KiCad 库包含直接的 PDF 链接digikey 技能按 MPN 搜索并下载单个数据手册从每个数据手册中提取什么(注意引用的页码/章节/图号/公式编号):
对于无源元件: 虽然很少需要单个电阻/电容的数据手册,但请根据指定它们的 IC 数据手册验证元件值。IC 的数据手册说“使用 10µF 输入电容” — 验证原理图在该处实际上有 10µF,而不是 1µF。
当两个文件都存在时,对它们进行交叉验证。这可以捕获代价最高的错误 — 互换的引脚、缺失的网络和封装不匹配可以通过 DRC/ERC,但会导致板卡无法工作。
Footprint 属性与实际 PCB 封装(例如,SOT-23 与 SOT-23-5)。PCB 分析器中每个封装的 sch_path、sch_sheetname 和 sch_sheetfile 字段支持自动交叉验证。
详细的方法论和格式文档位于参考文件中。根据需要阅读 — 它们提供了超出脚本自动输出范围的深入内容。
| 参考文件 | 行数 | 何时阅读 |
|---|---|---|
schematic-analysis.md | 1085 | 深度原理图审查:数据手册验证、设计模式、错误分类、容差叠加、GPIO 审计、电机控制、电池寿命、供应链 |
pcb-layout-analysis.md | 393 | 高级 PCB:阻抗计算、差分对、返回路径、铜平衡、板边间距、自定义分析脚本 |
file-formats.md | 361 | 手动文件检查:S 表达式结构、所有 KiCad 文件类型的逐字段文档、版本检测 |
gerber-parsing.md | 729 | Gerber/Excellon 格式详情、X2 属性、分析技术 |
pdf-schematic-extraction.md | 315 | PDF 原理图分析:提取工作流、符号约定、KiCad 转换 |
supplementary-data-sources.md | 301 | 旧版 KiCad 5 数据恢复:网络表解析、缓存库、PCB 交叉引用 |
net-tracing.md | 109 | 手动网络追踪:坐标计算、Y 轴反转、旋转变换 |
manual-schematic-parsing.md | 285 | 原理图脚本失败时的回退方案 |
manual-pcb-parsing.md | 457 | PCB 脚本失败时的回退方案 |
manual-gerber-parsing.md | 621 | Gerber 脚本失败时的回退方案 |
report-generation.md | 450 | 报告模板(关键发现置顶)、分析器输出字段参考(原理图/PCB/gerber)、严重性定义、写作原则、特定领域关注点、已知分析器限制 |
standards-compliance.md | 600 | IPC/IEC 标准表:导线间距(IPC-2221A 表 6-1)、电流容量(IPC-2221A/IPC-2152)、焊环、孔径尺寸、阻抗、过孔保护(IPC-4761)、爬电距离/电气间隙(ECMA-287/IEC 60664-1)。适用于所有板卡;对于专业/工业设计、高电压、市电输入或安全隔离设计自动触发。 |
关于脚本内部结构、数据结构、信号分析模式和批量测试套件文档,请参见 scripts/README.md。
| 扩展名 | 格式 | 用途 |
|---|---|---|
.kicad_pro | JSON | 项目设置、网络类别、DRC/ERC 严重性、BOM 字段 |
.kicad_sch | S-expr | 原理图页(符号、连线、标签、层次结构) |
.kicad_pcb | S-expr | PCB 布局(封装、走线、过孔、覆铜区、板框) |
.kicad_sym | S-expr | 符号库(带有引脚、图形的原理图符号) |
.kicad_mod | S-expr | 单个封装(位于 .pretty/ 目录中) |
.kicad_dru | 自定义 | 自定义设计规则(DRC 约束) |
fp-lib-table / sym-lib-table | S-expr | 库路径表 |
.sch / .lib / .dcm | 旧版 | KiCad 5 原理图、符号库、描述 |
.net / .xml | S-expr/XML | 网络表导出、BOM 导出 |
.gbr / .g* / .drl | Gerber/Excellon | 制造文件(铜层、阻焊、丝印、板框、钻孔) |
关于版本检测和详细的逐字段格式文档,请阅读 references/file-formats.md。
要进行彻底的数据手册驱动的原理图审查 — 识别子电路、获取数据手册、根据制造商建议验证元件值、与常见设计模式比较、检测错误并提出改进建议 — 请阅读 references/schematic-analysis.md。每当用户要求深入审查、验证或分析原理图时,请使用此参考。
获取数据手册:当分析需要数据手册数据时,请使用 DigiKey API 作为首选来源(参见 digikey 技能)— 它通过 DatasheetUrl 字段返回直接的 PDF URL,无需网络爬取。根据原理图元件属性中的 MPN 进行搜索。对于 DigiKey 上没有的部件,回退到 WebSearch。
对于 PCB 布局分析器脚本提供的高级布局分析之外的内容 — 基于叠层参数的阻抗计算、DRC 规则编写、电力电子设计审查技术、差分对验证、返回路径分析、铜平衡评估、板边间距规则和手动脚本编写模式 — 请阅读 references/pcb-layout-analysis.md。
大多数常规 PCB 分析(过孔类型、焊环、布局、连接性、散热过孔、电流容量、信号完整性、DFM 评分、立碑风险、散热焊盘过孔)由 analyze_pcb.py 自动处理。使用参考文件进行更深层次的手动调查。
原理图 — 验证:每个 IC VCC/GND 对上的去耦电容、I2C 上拉电阻、复位引脚电路、未连接引脚有未连接标记、跨页网络命名一致、外部连接器上的 ESD 保护、电源时序(EN/PG)、足够的储能电容。
PCB — 验证:电源走线宽度满足电流要求(IPC-2221)、过孔电流容量、高电压的爬电距离/电气间隙、去耦电容靠近 IC 电源引脚、连续的接地平面(信号下方无分割)、受控阻抗走线(USB/DDR)、板框闭合多边形、丝印可读性。考虑 references/standards-compliance.md 中的 IPC/IEC 标准值 — 导线间距和电流容量与大多数板卡相关;爬电距离/电气间隙和过孔保护适用于市电连接或安全隔离设计。
常见错误(按毁板可能性排序):互换的 IC 引脚(库符号与数据手册引脚排列不匹配 — DRC/ERC 无法检测)、晶体管引脚排列歧义(没有 MPN 的 SOT-23 — 符号假设的引脚顺序可能与实际部件不匹配;当无法验证时,根据常见惯例评估其合理性)、错误的封装焊盘编号、未同步的原理图→PCB 更改导致的网络缺失、错误的封装变体(SOT-23 与 SOT-23-5)、悬空的数字输入、缺少储能电容、极性反接、错误的反馈分压器值、错误的晶体负载电容、USB 阻抗不匹配、QFN 散热焊盘缺少过孔、连接器引脚排列错误、不寻常的无源元件值(技术上有效但该应用不常见的值 — 例如,非标准的上拉电阻值、不寻常的去耦电容值)。
生成设计审查报告时,请阅读 references/report-generation.md 了解标准报告模板、严重性定义、写作原则和特定领域关注点。报告格式涵盖:概述、元件摘要、电源树、分析器验证(抽查)、信号/电源/设计分析审查、质量与制造、优先级问题表、积极发现和已知分析器差距。在报告发现之前,务必根据原始原理图交叉验证分析器输出。
比较两个设计时,对比:元件数量/类型、网络类别/设计规则、走线宽度/过孔尺寸、板卡尺寸/层数、电源拓扑、KiCad 版本差异。
每周安装次数
1
代码库
GitHub 星标数
33
首次出现
1 天前
安全审计
安装于
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
| Skill | Purpose |
|---|---|
bom | BOM extraction, enrichment, ordering, and export workflows |
digikey | Search DigiKey for parts (prototype sourcing) |
mouser | Search Mouser for parts (secondary prototype source) |
lcsc | Search LCSC for parts (production sourcing, JLCPCB) |
jlcpcb | PCB fabrication & assembly ordering |
pcbway | Alternative PCB fabrication & assembly |
Handoff guidance: Use this skill to parse schematics/PCBs and extract structured data. Hand off to bom for BOM enrichment, pricing, and ordering. Hand off to digikey/mouser/lcsc for part searches and datasheet fetching. Hand off to jlcpcb/pcbway for fabrication ordering and DFM rule validation.
This skill also handles PDF schematics — reference designs, dev board schematics, eval board docs, application notes, and datasheet typical-application circuits. Common use cases:
Workflow: Read the PDF pages visually → identify components and connections → extract structured data → translate to KiCad symbols and nets → validate against datasheets.
For the full methodology — component extraction, notation conventions, net mapping, subcircuit extraction, KiCad translation, and validation — read references/pdf-schematic-extraction.md.
For deep validation of extracted circuits against datasheets (verifying values, checking patterns, detecting errors), use the methodology in references/schematic-analysis.md.
This skill includes Python scripts that extract comprehensive structured JSON from KiCad files in a single pass. Run these first, then reason about the output.
Read analyzer JSON output directly with the Read tool rather than writing ad-hoc extraction scripts. The JSON schema has specific field names (documented below) that are easy to get wrong in custom code. To extract a specific section: python3 -c "import json; d=json.load(open('file.json')); print(json.dumps(d['key'], indent=2))".
In all commands below, <skill-path> refers to this skill's base directory (shown at the top of this file when loaded).
python3 <skill-path>/scripts/analyze_schematic.py <file.kicad_sch>
Outputs structured JSON (~60-220KB depending on board complexity) with:
vref_source and vout_net_mismatch fieldsSupports modern .kicad_sch (KiCad 6+) and legacy .sch (KiCad 4/5). Hierarchical designs parsed recursively.
Legacy format limitations: For KiCad 5 legacy .sch files, the analyzer provides component and net extraction only — no pin-to-net mapping, no signal analysis, no subcircuit detection. When signal analysis is missing from the output, use supplementary data sources to fill the gaps — see the section below.
When analyze_schematic.py returns incomplete data (typically legacy .sch format — missing pin-to-net mapping, signal analysis, and subcircuit detection), use additional project files to recover full analysis capability. The most valuable source is the .net netlist file, which provides explicit pin-to-net mapping that closes the signal analysis gap entirely.
For detailed parsing instructions, data recovery workflows, and a priority matrix of supplementary sources (netlist, cache library, PCB cross-reference, PDF exports), read references/supplementary-data-sources.md.
Verify analyzer output against reality. The analyzer can silently produce plausible-looking but incorrect results — wrong voltage estimates, missing MPNs, wrong pin-to-net mappings. These don't cause script errors; they just produce bad data that flows into your report. In testing across multiple boards, every project had at least one misleading analyzer output. Cross-reference against the raw .kicad_sch file:
(symbol (lib_id blocks, subtract power symbols. Must match analyzer count exactly.Q_NPN_BEC = pin 1=B, 2=E, 3=C) that doesn't match the actual part. Everything passes consistency checks, but the board is wrong. To catch this:
lib_id suffix encodes a pin ordering assumption. SOT-23 BJTs exist in at least 6 pinout variants (BEC, BCE, EBC, ECB, CBE, CEB); SOT-23 MOSFETs in GDS, GSD, SGD, DSG. If no MPN is specified, there's no way to verify the assumption — flag this as a critical ambiguity.See references/schematic-analysis.md Step 2 for the full verification checklist. If the script fails or returns unexpected results, see references/manual-schematic-parsing.md for the complete fallback methodology.
python3 <skill-path>/scripts/analyze_pcb.py <file.kicad_pcb>
python3 <skill-path>/scripts/analyze_pcb.py <file.kicad_pcb> --proximity # add crosstalk analysis
Outputs structured JSON (~50-300KB depending on board complexity) with:
--proximity)Add --full to include individual track/via coordinates. Supports KiCad 5 legacy format.
Verify after every run: Confirm footprint count and board outline dimensions against the raw .kicad_pcb file. Verify pad-to-net assignments for IC footprints against the schematic's pin-to-net mapping — this catches library footprint errors where pad numbering doesn't match the symbol pinout. If the script fails, see references/manual-pcb-parsing.md for the fallback methodology.
python3 <skill-path>/scripts/analyze_gerbers.py <gerber_directory/>
Outputs: layer identification (X2 attributes), component/net/pin mapping (KiCad 6+ TO attributes), aperture function classification, trace width distribution, board dimensions, drill classification (via/component/mounting), layer completeness, alignment verification, pad type summary (SMD/THT ratio). Add --full for complete pin-to-net connectivity dump. ~10KB JSON.
If the script fails or returns unexpected results, see references/manual-gerber-parsing.md for the complete fallback methodology for parsing raw Gerber/Excellon files directly.
All scripts output JSON to stdout. Use --output file.json to write to a file, --compact for single-line JSON.
Schematic analyzer top-level keys:
file, kicad_version, file_version, title_block, statistics, bom, components,
nets, subcircuits, ic_pin_analysis, signal_analysis, design_analysis,
connectivity_issues, labels, no_connects, power_symbols, annotation_issues,
label_shape_warnings, pwr_flag_warnings, footprint_filter_warnings,
sourcing_audit, ground_domains, bus_topology, wire_geometry,
simulation_readiness, property_issues, placement_analysis, hierarchical_labels
Optional (present when non-empty): text_annotations, alternate_pin_summary, pin_coverage_warnings, instance_consistency_warnings, pdn_impedance, sleep_current_audit, voltage_derating, power_budget, power_sequencing, bom_optimization, test_coverage, , , ,
Key nested structures:
statistics: {total_components, unique_parts, dnp_parts, total_nets, total_wires, total_no_connects, component_types, power_rails, missing_mpn, ...}bom[]: {reference, references[], value, footprint, mpn, manufacturer, datasheet, quantity, dnp, ...}components[]: {reference, value, footprint, lib_id, type, mpn, datasheet, dnp, in_bom, parsed_value, ...}nets{net_name}: {pins[], wires, labels[], ...} — each pin: {component, pin_number, pin_name, pin_type, ...} (NOT or )PCB analyzer top-level keys:
file, kicad_version, file_version, statistics, layers, setup, nets,
board_outline, component_groups, footprints, tracks, vias, zones,
connectivity, net_lengths
Optional: power_net_routing, decoupling_placement, ground_domains, current_capacity, thermal_analysis, layer_transitions, placement_analysis, silkscreen, dfm, board_metadata, tombstoning_risk, thermal_pad_vias
Key nested structures:
net_lengths is a list (not dict): [{net, net_number, total_length_mm, segment_count, via_count, layers{}}, ...] sorted by length descendingpower_net_routing is a list : [{net, track_count, total_length_mm, min_width_mm, max_width_mm, widths_used[]}, ...]footprints[]: {reference, value, footprint, layer, pads[], sch_path, sch_sheetname, sch_sheetfile, connected_nets[], ...}statistics: {copper_layers_used, total_footprints, smd_count, tht_count, ...}Gerber analyzer top-level keys:
statistics, completeness, alignment, drill_classification, pad_summary,
board_dimensions, gerbers, drills
Workflow: When analyzing a KiCad project, scan the project directory for all available file types and run every applicable analyzer — not just the one the user mentioned. A complete analysis uses all the data available:
.kicad_sch, .kicad_pcb, .kicad_pro, gerber directories, and .net/.xml netlist filesanalyze_schematic.py. If the PCB exists, run analyze_pcb.py. If gerbers exist, run analyze_gerbers.py. Run them in parallel when possible..kicad_pro project file directly (it's JSON) for design rules, net classes, and DRC/ERC settingsThe more data sources you combine, the more confident the analysis. A schematic-only review misses layout issues; a PCB-only review misses design intent. Always use everything available.
Default to thorough analysis unless the user asks for a quick review. The reason: the bugs that kill boards are the ones that look correct at a glance. A spot-check might confirm 5 ICs are correct while the 6th has pins 3 and 4 swapped — and that's the one that kills the board. Thoroughness principles:
Datasheets are what separate a consistency check from a correctness check. Without them, you can confirm the design agrees with itself — but not that it matches the real-world parts. Obtain datasheets early in the workflow.
Automated sync (preferred): If the digikey skill is installed, run sync_datasheets.py on the schematic early in the workflow. This downloads datasheets for all components with MPNs into a datasheets/ directory with an index.json manifest. Run it in parallel with the analyzer scripts:
python3 <digikey-skill-path>/scripts/sync_datasheets.py <file.kicad_sch>
Check for existing datasheets: Before downloading, look for:
<project>/datasheets/ with index.json (from a previous sync)<project>/docs/ or <project>/documentation/Datasheet property URLs embedded in the KiCad symbolsFallback methods when automated sync isn't available or misses parts:
Datasheet property URL from the schematic symbol — many KiCad libraries include direct PDF linksdigikey skill to search by MPN and download individual datasheetsWhat to extract from each datasheet (note page/section/figure/equation numbers for citations):
For passives: While individual resistor/capacitor datasheets are rarely needed, verify the component values against the IC datasheets that specify them. The IC's datasheet says "use a 10µF input cap" — verify the schematic actually has 10µF there, not 1µF.
When both files exist, cross-reference them. This catches the most expensive bugs — swapped pins, missing nets, and footprint mismatches pass DRC/ERC but produce non-functional boards.
Footprint property vs actual PCB footprint (e.g., SOT-23 vs SOT-23-5).The PCB analyzer's sch_path, sch_sheetname, and sch_sheetfile fields in each footprint enable automated cross-referencing.
Detailed methodology and format documentation lives in reference files. Read these as needed — they provide deep-dive content beyond what the scripts output automatically.
| Reference | Lines | When to Read |
|---|---|---|
schematic-analysis.md | 1085 | Deep schematic review: datasheet validation, design patterns, error taxonomy, tolerance stacking, GPIO audit, motor control, battery life, supply chain |
pcb-layout-analysis.md | 393 | Advanced PCB: impedance calculations, differential pairs, return paths, copper balance, edge clearance, custom analysis scripts |
file-formats.md | 361 | Manual file inspection: S-expression structure, field-by-field docs for all KiCad file types, version detection |
gerber-parsing.md | 729 | Gerber/Excellon format details, X2 attributes, analysis techniques |
For script internals, data structures, signal analysis patterns, and batch test suite documentation, see scripts/README.md.
| Extension | Format | Purpose |
|---|---|---|
.kicad_pro | JSON | Project settings, net classes, DRC/ERC severity, BOM fields |
.kicad_sch | S-expr | Schematic sheet (symbols, wires, labels, hierarchy) |
.kicad_pcb | S-expr | PCB layout (footprints, tracks, vias, zones, board outline) |
.kicad_sym | S-expr | Symbol library (schematic symbols with pins, graphics) |
.kicad_mod |
For version detection and detailed field-by-field format documentation, read references/file-formats.md.
For a thorough datasheet-driven schematic review — identifying subcircuits, fetching datasheets, validating component values against manufacturer recommendations, comparing against common design patterns, detecting errors, and suggesting improvements — read references/schematic-analysis.md. Use this reference whenever the user asks to review, validate, or analyze a schematic in depth.
Fetching datasheets : When the analysis requires datasheet data, use the DigiKey API as the preferred source (see the digikey skill) — it returns direct PDF URLs via the DatasheetUrl field without web scraping. Search by MPN from the schematic's component properties. Fall back to WebSearch only for parts not on DigiKey.
For advanced layout analysis beyond what the PCB analyzer script provides — impedance calculations from stackup parameters, DRC rule authoring, power electronics design review techniques, differential pair validation, return path analysis, copper balance assessment, board edge clearance rules, and manual script-writing patterns — read references/pcb-layout-analysis.md.
Most routine PCB analysis (via types, annular ring, placement, connectivity, thermal vias, current capacity, signal integrity, DFM scoring, tombstoning risk, thermal pad vias) is handled automatically by analyze_pcb.py. Use the reference for deeper manual investigation.
Schematic — verify: decoupling caps on every IC VCC/GND pair, I2C pull-ups, reset pin circuits, unconnected pins have no-connect markers, consistent net naming across sheets, ESD protection on external connectors, power sequencing (EN/PG), adequate bulk capacitance.
PCB — verify: power trace widths for current (IPC-2221), via current capacity, creepage/clearance for high voltage, decoupling cap proximity to IC power pins, continuous ground plane (no splits under signals), controlled impedance traces (USB/DDR), board outline closed polygon, silkscreen readability. Consider references/standards-compliance.md for IPC/IEC standard values — conductor spacing and current capacity are relevant for most boards; creepage/clearance and via protection apply to mains-connected or safety-isolated designs.
Common bugs (ranked by board-killing potential) : swapped IC pins (library symbol vs datasheet pinout — invisible to DRC/ERC), transistor pinout ambiguity (SOT-23 without MPN — symbol assumes a pin ordering that may not match the real part; assess plausibility against common conventions when verification isn't possible), wrong footprint pad numbering, missing nets from un-synced schematic→PCB, wrong package variant (SOT-23 vs SOT-23-5), floating digital inputs, missing bulk caps, reversed polarity, incorrect feedback divider values, wrong crystal load caps, USB impedance mismatch, QFN thermal pad missing vias, connector pinout errors, unusual passive values (a value that's technically valid but uncommon for the application — e.g., a non-standard pull-up resistance, an unusual decoupling capacitor value).
When producing a design review report, read references/report-generation.md for the standard report template, severity definitions, writing principles, and domain-specific focus areas. The report format covers: overview, component summary, power tree, analyzer verification (spot-checks), signal/power/design analysis review, quality & manufacturing, prioritized issues table, positive findings, and known analyzer gaps. Always cross-reference analyzer output against the raw schematic before reporting findings.
When comparing two designs, diff: component counts/types, net classes/design rules, track widths/via sizes, board dimensions/layer count, power supply topology, KiCad version differences.
Weekly Installs
1
Repository
GitHub Stars
33
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
31,600 周安装
vref_source field. "lookup" means datasheet-verified (~60 families); "heuristic" means it's a guess that needs manual verification. The vout_net_mismatch field flags estimated Vout differing >15% from the output rail name voltage.assembly_complexityusb_complianceinrush_analysissheetsrefpinsignal_analysis: {power_regulators[], voltage_dividers[], rc_filters[], opamp_circuits[], transistor_circuits[], bridge_circuits[], crystal_circuits[], current_sense[], decoupling_analysis[], protection_devices[], buzzer_speaker_circuits[], design_observations[], ...}references/report-generation.md for the report template.pdf-schematic-extraction.md| 315 |
| PDF schematic analysis: extraction workflow, notation conventions, KiCad translation |
supplementary-data-sources.md | 301 | Legacy KiCad 5 data recovery: netlist parsing, cache library, PCB cross-reference |
net-tracing.md | 109 | Manual net tracing: coordinate math, Y-axis inversion, rotation transforms |
manual-schematic-parsing.md | 285 | Fallback when schematic script fails |
manual-pcb-parsing.md | 457 | Fallback when PCB script fails |
manual-gerber-parsing.md | 621 | Fallback when Gerber script fails |
report-generation.md | 450 | Report template (critical findings at top), analyzer output field reference (schematic/PCB/gerber), severity definitions, writing principles, domain-specific focus areas, known analyzer limitations |
standards-compliance.md | 600 | IPC/IEC standards tables: conductor spacing (IPC-2221A Table 6-1), current capacity (IPC-2221A/IPC-2152), annular rings, hole sizes, impedance, via protection (IPC-4761), creepage/clearance (ECMA-287/IEC 60664-1). Consider for all boards; auto-trigger for professional/industrial designs, high voltage, mains input, or safety isolation. |
| S-expr |
Single footprint (in .pretty/ directory) |
.kicad_dru | Custom | Custom design rules (DRC constraints) |
fp-lib-table / sym-lib-table | S-expr | Library path tables |
.sch / .lib / .dcm | Legacy | KiCad 5 schematic, symbol library, descriptions |
.net / .xml | S-expr/XML | Netlist export, BOM export |
.gbr / .g* / .drl | Gerber/Excellon | Manufacturing files (copper, mask, silk, outline, drill) |