科研 Skill
硬件工具链安装配置
toolchain-setup
Installs and checks the software a hardware design toolkit needs (KiCad, Blender, build123d, Java) and records tool paths for other skills. Use on first setup or a missing-tool error.
SKILL.md
Toolchain setup
Installs the toolkit's software, checks it, and writes toolchain.json with every tool path. Other skills read that file instead of guessing paths.
Talk to the user in the user's language. Commands and file names stay as they are.
Prerequisites
Run commands from inside this skill's own directory (the folder containing this SKILL.md), since script and reference paths below (such as scripts/foo.py) are written relative to it, not to the project root.
Inputs
- None required.
hw/in the current project, if it exists. Doctor then also writeshw/toolchain.json.
Outputs
~/.config/hardware-design-toolkit/toolchain.json. On Windows,%APPDATA%\hardware-design-toolkit\toolchain.json.XDG_CONFIG_HOMEis respected.hw/toolchain.jsonwhen the project has ahw/folder. This copy overrides the user-level one.
Gate
scripts/doctor.py exits with 0 and prints required: OK. Until then, no other skill runs a script that needs a missing tool.
Procedure
-
Check first. Run
python3 scripts/doctor.pyfrom inside this skill's directory. On Windows usepython. It takes about 5 s, because it starts Blender headless once to read its Python, modules and GPU. -
If
required: OK, stop. Tell the user, in one line, which optional tools are missing and what they would add. -
If something required is missing, ask before installing anything. Installing changes the user's system. Show the user:
- the list of what will be installed and why: one line per tool from the doctor table and
references/software.md; - the approximate download size: KiCad ~1.5 GB with libraries, Blender ~400 MB, JRE ~50 MB, Freerouting jar ~65 MB, scipy ~40 MB;
- that a password (sudo) may be asked;
- the dry run output of the installer (step 4).
Install only after the user says yes.
- the list of what will be installed and why: one line per tool from the doctor table and
-
Show the plan. Run the installer for the OS with
--dry-run(PowerShell:-DryRun):OS Command macOS bash scripts/install_macos.sh --dry-run(needs Homebrew; if it is missing, the script points to https://brew.sh)Linux bash scripts/install_linux.sh --dry-run(apt, dnf or pacman; add--flatpakto get the current KiCad and Blender from Flathub)Windows powershell -ExecutionPolicy Bypass -File "scripts/install_windows.ps1" -DryRun(winget) -
Install. Run the same command without the dry-run flag. Add flags only when the user wants them:
--with-optional: ffmpeg (turntable videos), ImageMagick, libheif (HEIC phone photos as references), KiKit (PCB panels, into KiCad's Python), FreeCAD (STEP viewer).--with-assets: the render wear textures (ambientCG CC0: Fingerprints009, Smear003, Scratches005, SurfaceImperfections015) and the studio HDRIstudio_small_09(Poly Haven CC0), into~/.local/share/hardware-design-toolkit/assets/(%LOCALAPPDATA%on Windows).product-renderreads them fromtc["assets"].--with-cloud: AWS CLI and Session Manager plugin, for rendering on a cloud GPU. Never install these unless the user plans to render in the cloud.--with-gpu(Linux, Windows): cupy for NVIDIA GPUs. It speeds up the free-space flood fill.
-
Verify. Run
scripts/doctor.pyagain. Report the table in a short form: ✓ for found, ✗ for required and missing, – for optional and missing. -
Fix what remains by hand. The common cases are in "Taste and pitfalls" below.
The installers are idempotent. Running them again skips what is installed and verifies the Freerouting checksum.
How other skills use toolchain.json
Read the project file first, then the user file:
import json, os, subprocess
def toolchain():
base = os.environ.get("APPDATA") if os.name == "nt" else \
os.environ.get("XDG_CONFIG_HOME", os.path.expanduser("~/.config"))
for p in ("hw/toolchain.json", os.path.join(base, "hardware-design-toolkit", "toolchain.json")):
if os.path.isfile(p):
return json.load(open(p))
raise SystemExit("toolchain.json not found: run the toolchain-setup skill (scripts/doctor.py)")
tc = toolchain()
subprocess.run(tc["cmd"]["kicad_cli"] + ["pcb", "drc", "board.kicad_pcb"]) # cmd is an argv list
- Use
tc["cmd"][id], an argv list, to run a tool. It also covers Flatpak installs, where the "path" isflatpak run …. - Use
tc["paths"][id]when a plain file path is needed, for example the Freerouting jar. - If a key is
null, the tool is missing. Tell the user to run this skill. Do not guess a path.
Schema ("schema": "hardware-design-toolkit/toolchain@1"):
{
"schema": "hardware-design-toolkit/toolchain@1",
"generated_at": "2026-01-01T12:00:00+00:00",
"os": "macos | linux | windows",
"arch": "arm64",
"ok": true,
"missing_required": [],
"paths": {"<id>": "/abs/path or null"},
"cmd": {"<id>": ["argv", "list"] },
"versions": {"<id>": "x.y.z or null"},
"blender_gpu": [{"type": "OPTIX | CUDA | METAL | HIP | ONEAPI", "devices": ["name"]}],
"assets": {"Fingerprints009": "/abs/.../textures/Fingerprints009", "studio_small_09": "/abs/.../hdri/studio_small_09_2k.exr"},
"tools": {"<id>": {"id": "", "found": true, "path": "", "cmd": [], "version": "", "required": true,
"ok": true, "note": "", "purpose": ""}}
}
Tool ids:
- Required:
kicad_cli,kicad_python(a Python that canimport pcbnew),blender,blender_python,blender_numpy,blender_scipy,java(17 or newer; the Java the Freerouting jar needs: 17 for 1.9.0, 25 for 2.5.0),freerouting_jar,python(3.10 or newer),cad_python(the build123d venv, Python 3.10–3.13),git,rsvg_convert,chrome(headless browser for the presentation layout check and PDF). - Optional:
blender_cupy,kikit,freecad,ffmpeg,imagemagick,heic_converter(sips on macOS),render_assets,gh,aws,session_manager_plugin.
Environment overrides, checked before the search: KICAD_CLI, KICAD_PYTHON, BLENDER, JAVA or JAVA_HOME, FREEROUTING_JAR, RSVG_CONVERT, CHROME, CAD_PYTHON, FREECAD.
Taste and pitfalls
- Never install without consent. Show the dry run first. Do not add
--with-cloud"just in case". - macOS
/usr/bin/javais a stub. It prints "Unable to locate a Java Runtime" even when Homebrew's OpenJDK is installed. Homebrew's OpenJDK is keg-only: it lives in/opt/homebrew/opt/openjdk/bin/javaand is not on PATH. Doctor checks that location. Scripts must usetc["cmd"]["java"], notjava. - KiCad's Python is not the system Python. On macOS and Windows,
pcbnewimports only in KiCad's bundled interpreter. On Linux it imports in the systempython3, from thekicadpackage. Run board scripts withtc["cmd"]["kicad_python"]. - Blender ignores the user's site-packages. Install modules with Blender's own Python. Use
--no-deps, so pip does not install a second numpy that shadows the bundled one and breaks the ABI. If the app bundle is read-only, the installers install into Blender's userscripts/modulesfolder, which Blender puts onsys.path. - Distribution packages lag. Ubuntu's own KiCad and Blender can be a major version behind. Use the KiCad PPA or
--flatpak. The toolkit needs KiCad 9 or newer, and Blender 4.2 LTS or newer; it is tested on KiCad 10 and Blender 5.2. - Pin Freerouting and verify it. The installers download 1.9.0 and check its SHA-256 (why 1.9.0:
references/software.md). To upgrade, changeFREEROUTING_VERSIONandFREEROUTING_SHA256together. The digest is listed on the GitHub release page. - No GPU listed in
blender_gpumeans Cycles renders on the CPU. That works, but slowly. For 4K or turntables, suggest a machine with an NVIDIA (OptiX) or Apple Silicon (Metal) GPU, or a cloud GPU (product-render). - build123d needs Python 3.10–3.13. It has no wheels for newer Pythons, so pip on the system Python 3.14+ fails to resolve it. The installers create a dedicated venv at
~/.local/share/hardware-design-toolkit/venv. They preferuv(uv venv -p 3.12 <venv> && uv pip install -p <venv>/bin/python build123d), which also downloads Python 3.12 when needed. Without uv they fall back topython3.12/python3.13 -m venv+ pip. Run CAD scripts withtc["cmd"]["cad_python"]. - Windows
rsvg-convertcomes from MSYS2 (C:\msys64\ucrt64\bin). Doctor finds it there, even when it is not on PATH.
References
references/software.md: every tool, its role in the toolkit, minimum version, license and official download page. Read it when you explain to the user what will be installed.
示例提示词
帮我把KiCad、Blender这些工具链都装好并配置路径。
所属插件
安装该插件会一并获得同领域的 63 个 Skill / MCP。
同插件的其他科研 Skill
- ANDES电力系统动态仿真Runs ANDES power-system dynamic studies via PowerMCP: power flow, eigenvalue analysis, and time-domain simulation. Use for damping, stability, or oscillation-mode questions.
- 电池选型与电源预算Builds an evidence-tagged power budget and sizes a manufacturable battery with pouch outline, seals, and derating. Use when sizing runtime, mAh, charging, or supply rails.
- FPGA比特流生成与烧录Generates a Xilinx FPGA bitstream and programs it over JTAG, or burns an MCS image into flash for power-on boot. Use when flashing a board or diagnosing boot failures.
- 硬件项目发布包组装Assembles a hardware release package (fab files, BOM/CPL, carts, assembly guide, hashed manifest) and runs a ready-to-build gate. Use before ordering prototypes.
- 时钟域交叉风险审查Audits clock-domain-crossing risk on an FPGA design and applies the smallest safe synchronizer or constraint fix. Use to resolve CDC violations before sign-off.
- 硬件产品认证合规规划Plans certifications a hardware product needs per target market (FCC, CE/RED, UKCA, battery/radio rules), with cost and lead-time estimates. Use before PCB or enclosure tooling.
- Vivado XDC时序约束编写Authors a Vivado XDC timing constraint set from scratch: clocks, I/O delays, and timing exceptions. Use first, before timing closure, on a design with no or incomplete constraints.
- N-1/N-2应急违规处置Playbook for N-1/N-2 contingency violations: ranks contingencies and proposes preventive and corrective actions. Use after a study shows voltage or thermal problems.
- 潮流计算不收敛诊断Playbook for power-flow convergence failures in PSS/E, PSLF, PowerWorld, pandapower, PyPSA, surge, or OpenDSS. Use when a case diverges or fails to solve.
- 硬件成本核算与采购Prices a hardware product at multiple volumes with one-time vs per-unit cost, landed cost per country, and sourcing leads. Use to estimate unit cost before a pitch.
- RTL仿真覆盖率收敛Measures RTL simulation code coverage and iteratively closes it toward a target by adding testbench stimulus. Use for a sign-off-grade coverage report.
- 配电网DER接纳能力治理Playbook for distribution DER hosting-capacity limits: voltage rise, reverse flow, and thermal limits from PV and storage. Use to estimate how much DER a feeder can host.
- 电子电路设计与审查Designs, audits, or corrects an electronic circuit from a brief, schematic, or netlist, checking power domains, reset sequencing, and ratings. Use for circuit review.
- 硬件可制造性红队审查Red-team audit that fix-loops a hardware project to ready-to-build, re-deriving parts, rails, battery physics, and cost. Use for a reality check before committing to a design.
- 电力系统动态稳定处置Playbook for dynamic stability problems: poor damping, angle instability, or sustained oscillations from eigenvalue or time-domain studies. Use after an unstable study result.
- Egret电力市场调度优化Runs Egret market/operations optimization (DC-OPF, AC-OPF, unit commitment) via PowerMCP. Use for cheapest dispatch, unit commitment, or congestion checks.
- 电子元器件选型核查Researches electronic components against primary sources: part numbers, datasheet limits, lifecycle, stock, and price breaks, one dossier per part. Use to verify or source a BOM.
- EMC电磁兼容预测试Plans grounding, shielding, and filtering for EMC/EMI, and runs an emissions pre-scan with a root-cause fix sequence. Use before a lab test or after a failed EMI scan.
- 产品外壳参数化建模Designs a hardware enclosure as parametric CAD with STEP/STL/GLB output, a DFM check, and Blender assembly validation. Use when designing a case or checking fit.
- 电网频率响应问题处置Playbook for frequency problems: low inertia, high RoCoF, weak primary response, or UFLS risk after loss of the largest unit. Use when a study flags frequency issues.
- FPGA RTL到比特流全流程Drives a Xilinx FPGA design end to end through RTL, simulation, synthesis, implementation, and bitstream, gated at every stage. Use to run the complete build flow in one pass.
- 硬件产品全流程总协调Leads a physical electronic product from idea to a doable design, coordinating specs, parts, battery, PCB, enclosure, render, and cost sub-skills. Use starting a hardware product.
- 硬件原理图与BOM审查Reviews hardware projects: checks schematics against datasheets, pin connections, and firmware-to-hardware alignment across KiCad/Altium files. Use for a design alignment check.
- FPGA ILA在线逻辑调试Inserts an Integrated Logic Analyzer, programs the board, arms a trigger, and reads captured waveforms on real FPGA hardware. Use when sim passes but the board fails.
常见问题
硬件工具链安装配置能做什么?
Installs and checks the software a hardware design toolkit needs (KiCad, Blender, build123d, Java) and records tool paths for other skills. Use on first setup or a missing-tool error。
如何安装硬件工具链安装配置?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「硬件工具链安装配置」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
硬件工具链安装配置需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
硬件工具链安装配置经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。