npx skills add https://github.com/diodeinc/pcb --skill component-search在 Zener 项目中查找并添加组件、模块和参考设计。当您需要一个工作区中尚不存在或未被标准库通用组件覆盖的部件或子电路时,请使用此工作流。
始终按此顺序搜索。仅当较高层级没有合适的部件时才向下移动。
pcb search -m registry:modules<query> -f json — 预先设计、经过验证的子电路(模块和参考设计)。最佳选择:设计工作已完成,包含无源器件、布局和验证。pcb search -m registry:components<query> -f json — 注册表中预打包的组件定义。良好选择:符号、封装和 .zen 文件已存在并准备就绪。pcb search -m web:components<MPN> -f json — Diode 的 Web 组件数据库(CSE、LCSC 来源)。备用方案:返回一个必须使用 pcb new component 导入的 component_id。如果用户要求特定的 MPN,仍应首先尝试注册表,然后再回退到 Web 搜索。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
"buck converter 3.3V"、"Texas Instruments LDO"、"USB-C connector"。"TPS54331"、"STM32F103C8T6"。查询中请勿包含描述、关键字或功能术语 — 它们将导致搜索失败或返回不相关的结果。请剥离除 MPN 之外的所有内容。-f json 输出 JSON。请以编程方式解析结果以评估选项。dependencies(它们使用什么)和 dependents(谁使用它们)以供参考。model_availability,显示 ECAD 和 STEP 模型是否可用。同一 MPN 可能来自多个来源(DigiKey、CSE、LCSC),且模型可用性不同;在断定模型不可用之前,请检查所有返回的结果。pcb doc --package <url>@<version> 检查其 io/config 接口。当有明显优胜者时进行选择。仅在真正模棱两可时,才提出权衡取舍并询问。
按优先级顺序的选择启发式方法:
availability 字段以获取库存数量和价格。dependents 意味着经过更多实战检验。注册表模块和组件(流程 1 和 2)通过 Module() 直接使用注册表 URL。Auto-dep 会自动处理 pcb.toml 更新 — 只需使用 URL 并进行构建即可。
# 来自 registry:modules 搜索的参考设计
LDO = Module("github.com/diodeinc/registry/reference/AP2112Kx/AP2112Kx.zen")
LDO(
name="LDO_3V3",
VIN=vbus_5v0,
VOUT=vdd_3v3,
GND=gnd,
)
# 来自 registry:components 搜索的组件
TPS54331 = Module("github.com/diodeinc/registry/components/TPS54331D/TPS54331D.zen")
在将模块连接到设计之前,使用 pcb doc --package <url>@<version> 检查可用的 io/config。
Web 组件结果(流程 3)在使用前需要一个导入步骤。
pcb search -m web:components <MPN> -f jsoncomponent_id、part_number 和 manufacturer。pcb new component --component-id <ID> --part-number <MPN> --manufacturer <MFR>
这将下载符号、封装和 STEP 模型,扫描数据手册,并在 components/<manufacturer>/<mpn>/ 目录下生成一个 .zen 文件。如果组件已存在于工作区中,则会跳过并报告现有路径。
Module() 使用本地工作区路径来使用导入的组件:ESP32 = Module("./components/Espressif_Systems/ESP32-S3-WROOM-1-N16R8/ESP32-S3-WROOM-1-N16R8.zen")
# 模块和参考设计(快速,本地索引)
pcb search -m registry:modules <query> -f json
# 预打包组件(快速,本地索引)
pcb search -m registry:components <query> -f json
# Web 组件数据库(网络,较慢,仅限 MPN 查询)
pcb search -m web:components <MPN> -f json
# 将 Web 组件导入工作区
pcb new component --component-id <ID> [--part-number <MPN>] [--manufacturer <MFR>]
# 读取注册表包的 io/config 接口
pcb doc --package <url>@<version>
pcb bom 验证采购将组件添加到设计后,使用 pcb bom 检查采购和可用性:
pcb bom boards/MyBoard/MyBoard.zen -f json
JSON 输出是一个 BOM 条目列表,每个条目包含:
designator、mpn、manufacturer、package、value、descriptionavailability — 每个条目的采购数据:
us / global — 区域摘要,包含 price、stock、alt_stockoffers — 各个分销商的报价,包含 region、distributor、stock、pricepart=Part(mpn=..., manufacturer=...)。stock 数量。库存为零且只有 alt_stock 的部件可能交货期较长。每周安装次数
97
代码仓库
GitHub 星标数
198
首次出现
7 天前
安全审计
安装于
claude-code97
opencode2
gemini-cli2
github-copilot2
codex2
kimi-cli2
Find and add components, modules, and reference designs to a Zener project. Use this workflow any time you need a part or subcircuit that isn't already in the workspace or covered by stdlib generics.
Always search in this order. Move down only when the higher tier doesn't have what fits.
pcb search -m registry:modules<query> -f json — Pre-designed, validated subcircuits (modules and reference designs). Best option: the design work is already done, with passives, layout, and validation included.pcb search -m registry:components<query> -f json — Pre-packaged component definitions in the registry. Good: symbol, footprint, and .zen file already exist and are ready to use.pcb search -m web:components<MPN> -f json — Diode's web component database (CSE, LCSC sources). Fallback: returns a component_id that must be imported with pcb new component.If the user asks for a specific MPN, still try registry first before falling back to web.
"buck converter 3.3V", "Texas Instruments LDO", "USB-C connector"."TPS54331", "STM32F103C8T6". Do NOT include descriptions, keywords, or functional terms in the query — they will cause the search to fail or return irrelevant results. Strip everything except the MPN.-f json. Parse results programmatically to evaluate options.dependencies (what they use) and dependents (who uses them) for context.Pick when there's a clear winner. Present tradeoffs and ask only when genuinely ambiguous.
Selection heuristics in priority order:
availability fields for stock counts and pricing.dependents in registry results means more battle-tested.Registry modules and components (Flows 1 and 2) are used directly via Module() with the registry URL. Auto-dep handles pcb.toml updates automatically — just use the URL and build.
# Reference design from registry:modules search
LDO = Module("github.com/diodeinc/registry/reference/AP2112Kx/AP2112Kx.zen")
LDO(
name="LDO_3V3",
VIN=vbus_5v0,
VOUT=vdd_3v3,
GND=gnd,
)
# Component from registry:components search
TPS54331 = Module("github.com/diodeinc/registry/components/TPS54331D/TPS54331D.zen")
Use pcb doc --package <url>@<version> to check available io/config before wiring into a design.
Web component results (Flow 3) require an import step before use.
pcb search -m web:components <MPN> -f jsoncomponent_id, part_number, and manufacturer.pcb new component --component-id <ID> --part-number <MPN> --manufacturer <MFR>
This downloads the symbol, footprint, and STEP model, scans the datasheet, and generates a .zen file into components/<manufacturer>/<mpn>/. If the component already exists in the workspace, it skips and reports the existing path.
Module() with the local workspace path:ESP32 = Module("./components/Espressif_Systems/ESP32-S3-WROOM-1-N16R8/ESP32-S3-WROOM-1-N16R8.zen")
# Modules and reference designs (fast, local index)
pcb search -m registry:modules <query> -f json
# Pre-packaged components (fast, local index)
pcb search -m registry:components <query> -f json
# Web component database (network, slower, MPN-ONLY queries)
pcb search -m web:components <MPN> -f json
# Import a web component into the workspace
pcb new component --component-id <ID> [--part-number <MPN>] [--manufacturer <MFR>]
# Read a registry package's io/config interface
pcb doc --package <url>@<version>
pcb bomAfter adding components to a design, use pcb bom to check sourcing and availability:
pcb bom boards/MyBoard/MyBoard.zen -f json
The JSON output is a list of BOM entries, each with:
designator, mpn, manufacturer, package, value, descriptionavailability — per-entry sourcing data:
us / global — regional summary with price, stock, part=Part(mpn=..., manufacturer=...) where appropriate.stock counts across regions. Parts with zero stock and only alt_stock may have long lead times.Weekly Installs
97
Repository
GitHub Stars
198
First Seen
7 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code97
opencode2
gemini-cli2
github-copilot2
codex2
kimi-cli2
Azure Pipelines 本地验证与构建管理指南 - VS Code 开发工作流优化
434 周安装
WordPress插件主题测试与质量保证指南:PHPUnit、WP_Mock、PHPCS与CI/CD实战
96 周安装
GitHub PR自动化分类工具:流式架构实现实时分析与智能处理
96 周安装
macOS Tailscale与代理/VPN冲突诊断修复工具 - Tunnel Doctor教程
96 周安装
Deno 专家技能:代码审查、调试与最佳实践指南 | Deno/Fresh 开发
96 周安装
Rust 重构助手 - 安全重构与影响分析工具 | Rust 代码优化
96 周安装
WP-CLI 运维技能:WordPress 数据库迁移、插件管理与多站点操作指南
96 周安装
model_availability showing whether ECAD and STEP models are available. The same MPN may appear from multiple sources (DigiKey, CSE, LCSC) with different model availability; check all returned results before concluding models are unavailable.pcb doc --package <url>@<version> to inspect a registry module's io/config interface before using it.alt_stockoffers — individual distributor offers with region, distributor, stock, price