DSH HUB
首页插件商店插件包社区排行榜资源发布指南
插件源码
返回插件目录

550AW /

550AW/dsh-kicad-sch

已验证

KiCad schematic toolkit for DeepSeek Harness: components, nets, buses, design checks, SVG plots, and Altium import.

★ 0 Stars0 Forks0 IssuesN/A 社区评分0 已确认安装
查看 GitHub
README来源: main@d4f1eabd

dsh-kicad-sch

Repository: https://github.com/550AW/dsh-kicad-sch · Version: 1.3.1

A DSH plugin that parses KiCad schematics — modern .kicad_sch and legacy .sch — and turns Altium drawings into KiCad first, so an agent can answer questions about a board's netlist without opening KiCad. The package name is still kicad-sch; the public repository is dsh-kicad-sch.

Installation

The plugin is plain ESM JavaScript plus the bundled Altium Perl scripts. There is no npm install and no build step.

  1. From the GitHub repository or a release ZIP. Download dsh-kicad-sch-1.3.1.zip from the release page (or clone/download the repository) and extract it to a folder. In DSH, call plugin_manager with action: "install_bundle" and target set to the extracted folder — the directory that contains package.json and cordis.patch.yml:

    plugin_manager  action: install_bundle  target: <path-to-dsh-kicad-sch>
    
  2. From a local checkout. Use the same install_bundle action and point target at your working copy, replacing <path-to-dsh-kicad-sch> with the absolute path of the directory that contains package.json.

The bundle registers four tools once installed:

Tool What it does
kicad_sch_read Components, pins, nets, labels, sub-sheets, and a problem list. Parameters: path, view (summary, components, nets, net, component, json), net, ref, limit (1–2000), pages (design default, or root), lenient.
kicad_sch_render Writes an SVG plot of one page. Parameters: path, out, sheet (page path, page name, or leaf filename; the root page is the default), width (320–8000).
kicad_sch_export Writes a KiCad-compatible .net netlist and a CSV BOM (<name>.net, <name>_bom.csv). Parameters: path, out_dir, netlist, bom, pages.
altium_to_kicad Runs the bundled altium2kicad scripts on an Altium .SchDoc (optionally .PcbDoc), then parses the converted design. Parameters: path, out_dir, pcb, parse, lenient.

Formats

  • Modern .kicad_sch — S-expression files written by KiCad 6 and later. Symbol definitions come from the file's own lib_symbols block.
  • Legacy .sch — EESchema "Schematic File Version 2–4" text, including the files altium2kicad writes. Pin geometry comes from the .lib cache in the same folder (<name>-cache.lib preferred).

Hierarchy

Every page is loaded from the root sheet. Global labels and power nets join by name across pages; a child hierarchical_label joins the parent sheet pin with the same text; local and hierarchical labels are page-scoped and named /<sheet path>/<label>. References and multi-unit placements are resolved per sheet instance from (instances …) blocks (and root (symbol_instances …) for KiCad 6.0-era files). KiCad 7/8 local-label promotion is applied for files older than the KiCad 9 schematic version and reported as promoted-local-labels.

Buses

Bus text is expanded with KiCad's rules: A[3..0], {x y z}, top{a_xyz}, and (bus_alias …) (aliases expand only inside braces). Wire nets join a bus member by full name; bus entries are decoration. Member grouping works on one page and across pages through sheet pins: vector members pair by ascending index, group members by local name (with KiCad's flat-index fallback), a net bridging several buses takes the last bus's member name, and a global label or global power pin renames the member it lands on. node test/bus-check.mjs pins these rules against netlists exported by KiCad itself.

Behaviour notes (1.3.1)

These are the user-visible fixes made by the 1.3.1 adversarial audit; the full list is in CHANGELOG.md.

  • Netlist output is valid. kicad_sch_export writes balanced s-expressions; the extra ) that previously invalidated every netlist with connected nodes is gone, and test/regression.mjs parses the exported file.
  • Missing Perl is reported clearly. Altium conversion no longer prints a bare FAILED unpack.pl; a step that cannot start reports spawn failed: spawnSync perl ENOENT, so a missing perl on PATH is obvious.
  • Pathological input cannot hang the tools. Connectivity buckets are capped at 4096 cells per wire (larger coordinates fall back to a bounding-box filter) and a single bus vector expands at most 4096 members; a larger vector such as A[0..1000000000] is treated as plain label text. Both are safety limits, not normal-use limits.
  • Unknown pages are errors. kicad_sch_render with a sheet that does not exist throws no page "…" in this design (pages: …) and lists the available pages; an omitted or empty sheet still renders the root page.
  • Failure lines use a colon. Altium step failures read FAILED unpack.pl: <reason> instead of the old mojibake separator ??.

Testing

The repository ships its test data under test/. Directories generated by the tests (test/out/, test/fixtures/out/, and conversion work directories) are created at runtime and are not tracked in the repository.

node test/run.mjs                    # 10/10 single-file KiCad QA checks
node test/suite.mjs                  # 24/24 KiCad QA netlist cases
node test/bus-check.mjs              # 16/16 bus cases exported by KiCad
node test/export-check.mjs           # netlist/BOM export shape and netlist parsing
node test/design-check.mjs <root.kicad_sch>    # e.g. test/fixtures/qa-suite/issue16003/issue16003.kicad_sch
node test/legacy-check.mjs <legacy.sch>        # e.g. test/fixtures/altium/vias-SchDoc.sch
node test/regression.mjs             # 12/12 regression checks for the 1.3.1 fixes
node test/toolcheck.mjs              # Altium → KiCad → parse, end to end

test/toolcheck.mjs runs a real Altium conversion and therefore needs Perl; its two Altium checks fail with a clear spawn failed: spawnSync perl ENOENT when Perl is not installed, which is an environment limitation rather than a plugin defect. The other suites need no Perl.

Last full run (1.3.1): all suites above pass except the two Perl-dependent Altium checks in test/toolcheck.mjs; test/regression.mjs covers every fix below. A separate adversarial audit exercised the four tools with 61 targeted probes — 37 file/parser cases, 19 tool-level cases (parameters, output schema, concurrency, error text), and 5 DoS cases in isolated subprocesses — plus the suites listed above, all green.

Dependencies and license

  • Perl must be on PATH for altium_to_kicad (the bundled converter is a set of Perl scripts); set DSH_PERL to point at a specific interpreter. All other tools work without Perl. DSH_ALTIUM2KICAD can point at a different copy of the converter.
  • The repository as a whole is MIT (see LICENSE). The bundled tools/altium2kicad/ is upstream GPL-2.0 material, keeps its own license (tools/altium2kicad/LICENSE), and that directory is governed by GPL-2.0.
  • There are no other third-party dependencies and no packages to install.

Limits

  • Auto-generated net names keep the -PadN form; KiCad can use the pin name or unit letter instead (explicit and bus-derived names are exact).
  • altium2kicad output quality is upstream's; conversion notes are included.
  • Legacy .sch without its .lib lists components but leaves pins unknown.
  • A hierarchy is capped at 200 sheet instances and 24 levels; cycles and missing child files are reported as problems instead of aborting the load.
  • A single bus vector expands at most 4096 members, and a wire contributes at most 4096 connection buckets; pathological coordinates fall back to a bounding-box filter.

Marketplace listing

This plugin is listed in awesome-dsh-plugin under the category tools:

Read KiCad schematics, render them to SVG, and export netlists and BOM CSVs, plus an Altium-to-KiCad converter that runs the altium2kicad Perl scripts.

The entry file lives in this repository as dsh-kicad-sch.yml so the catalogue text stays reviewable next to the code; the copy submitted upstream is data/plugins/550AW__dsh-kicad-sch.yml. Description changes start in that file.

DSH HUB

社区维护的 DSH 插件索引。不是 GitHub 或 DeepSeek AI 的官方产品。

社区资源API关于
—/ 5

暂无评分

已验证 DSH bundle

Commit d4f1eabd3a35

社区评论

还没有评论,来写第一条。