claude-hardware-in-the-loop skill
A Claude Code skill for designing PCBs, CAD and firmware as code that writes fab files only after every gate passes
- 92 ★ on the repository
- Last commit
Broad access
Why this level
- Runs tool installs and builds, long night chains, simulators and scripts, and spends a lot of tokens
- Works with git branches, snapshots uncommitted work and can prepare files for board orders
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/claude-hardware-in-the-loopDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Runs tool installs and builds, long night chains, simulators and scripts, and spends a lot of tokens
- Works with git branches, snapshots uncommitted work and can prepare files for board orders
This is third-party code. Review the repository files before installing.
What it does
A method, a skill and a tested project skeleton for letting agents do hardware engineering. A board is a Python script that declares parts, nets, outline, holes and placement. One twelve-step pipeline routes it through Freerouting and writes fab files only when ERC and DRC are clean, nothing is unconnected, and every purchased line resolves live to the manufacturer part number named in the schematic. The rest rests on parametric CAD in CadQuery with a mass and centre-of-gravity table, firmware in C tested against a digital twin and a three.js viewer. Agents work in git worktrees and on a `dev` branch, and `main` is promoted only on a green CI report. The skill states the token cost up front and describes two modes: an expensive swarm of agents and a cheaper chain.
Who it is for. Engineers and small teams building devices with a board, an enclosure and firmware who want agents to do routine work under hard gates.
Good fit when
- You need a board from a first sketch to a JLCPCB fab set with automatic part-number checks
- An enclosure and parts must be built in CadQuery with interference checks and a mass table
- Firmware must run on the host against a native digital twin before the hardware exists
- Agents run night chains and you need protection against lost work and skipped checks
Not a fit when
- You need a finished product with no changes: the authors call it a starting point for your own harness
- The machine has no KiCad, CadQuery or Python and you cannot install them
- You need an OSI license: the project uses its own HIL-ASA-1.0 with a restriction on selling the tooling
Example request
Set up a hardware project with the hardware-in-the-loop method: an RP2040 board, a printable enclosure and firmware with host testsLimitations
- It is a skeleton and a method, not a finished product: you replace the examples with your own boards, models and checks.
- The author advises opening the board and CAD yourself before ordering and running an adversarial review with a fresh agent: green gates do not replace an engineer.
- The method is expensive in tokens: on the source project one swarm day burned 4 to 5 million tokens, which is why the chain mode is the default.
- The HIL-ASA-1.0 license is not OSI: selling the tooling is restricted, everything else is allowed with credit.
How to disable. Delete the `skills/hardware-in-the-loop` folder from the project `.claude/skills` or from the user skills directory. A project skeleton already created stays in your repository and is removed like ordinary files.
FAQ
How do I install the skill?
Clone the repository and copy the `skills/hardware-in-the-loop` folder into the project `.claude/skills/` or the user skills directory. Then ask Claude Code in the project to set up a hardware project with this method.
What do the gates check before board files are written?
ERC with no errors, a final DRC with no violations, no unconnected nets or schematic-to-board parity items, and a live check of every purchased line against the manufacturer part number in the schematic.
How does chain mode differ from the swarm?
In chain mode one long lead session hands bounded cards to one or two subagents and checks each report. The swarm runs parallel lane agents and costs noticeably more.
Do I need KiCad and CadQuery?
Yes, the pipeline uses KiCad 10 and CadQuery 2.x. The skill checks for the tools and offers to install missing ones.
Which systems has it been tested on?
The author lists Windows and Linux. Simulation tiers run on Unreal Engine 5.8.4 or newer and Isaac Sim.
Discussion
No questions or reviews yet.
Related
SkillsA skill that walks an agent from a hardware idea to a PCB, verifies routing and stops before the order is paid.
Four plugins for Claude Code and Codex take a KiCad 10 board from schematic to a JLCPCB order and production-file checks.
Skills for coding agents that analyze KiCad schematics and boards, catch design mistakes and prepare boards for fabrication
A Codex skill that guides KiCad component placement, routing and copper pours and prepares the board for ordering
Eight skills for Codex and Claude Code take an electronics project from schematic to a board order, checking each stage.
A set of Claude Code utilities: background skills, expert agents, slash commands and prompt templates for development
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Repository stars | Main difference |
|---|---|---|---|
| claude-hardware-in-the-loop (this card) | no | 92 | |
| kicad-happy | no | 1,660 | reviews finished KiCad schematics and boards for errors, while this skill builds board, CAD and firmware through one gated pipeline |
| PCB skill | no | 184 | takes a device idea to a board order, while this method adds CAD, firmware, a digital twin and a cage for agents |
README in short
The README opens by saying this is a starting point and not a finished product, then explains why the pipeline refuses to write files on errors. A capabilities table follows, with boards, CAD, firmware and simulation as one source of truth, a section on the cage for agents and the two working modes. The license and links to the method documents and 40 lessons close it.
README badge
Original SKILL.md
--- name: hardware-in-the-loop description: Sets up and runs the agent-driven hardware-in-the-loop engineering method for a hardware project - generator-first KiCad boards with Freerouting and live part verification, parametric CadQuery CAD with plug-in parts and mass/CG tables, C firmware host-tested against a native C/C++ digital twin (models for rigid bodies, brushed and brushless motors, joints, thermal, batteries, sensors; scenarios over seeds; a C ABI) hosted in Unreal Engine 5.8.4+ or Isaac Sim, CUDA Monte Carlo sweeps, verified research citations, DECISIONS / QUESTIONS records, a PowerShell CI matrix with no-shortcut and portability audits, dev/main branching with merge locks, machine-safety slots, detached jobs, usage-limit handoffs and overnight sessions, in either single-session or swarm mode. Use when the user says "hardware in the loop", "digital twin", "firmware in the loop", "set up a hardware project", "PCB/CAD/firmware swarm", mentions simulating firmware in Unreal or Isaac Sim, asks to scaffold a hardware repo for agents, or wants agents to design boards, enclosures, firmware or a twin with gates. --- # Hardware in the loop You are setting up (or running) a hardware project where agents do the engineering and gates prove it. Read this whole file before acting. This is a starting point the project grows into its own harness, not a finished product: adapt every template to the project, and say so to the owner when something here does not fit. The method is described in the repository's `docs/` (METHOD, PCB, CAD, FIRMWARE, SIM, SWARM, TOOLS, LESSONS); this file is the procedure. ## 0. Say the cost first Before anything else, tell the user, plainly: > Running this method with a swarm of agents is expensive. On the project it comes from, one swarm day burned 4-5 > million tokens, mostly by waking lane agents that each carried 300-800k tokens of context. Three modes: > - **chain** (recommended): one long lead session (Fable or Opus) hands bounded cards to one or two subagents at a time > (Opus or Sonnet), takes the reports, then goes on. The logs and trial and error stay out of the lead's context. > - **single**: one session, no subagents, cheapest on small projects. > - **swarm**: a lead plus parallel lanes, fastest wall-clock, by far the most expensive. > Which mode do you want? (recommended: chain) Record the answer as `mode` (`chain`, `single` or `swarm`). A subagent or two on bounded cards is not a swarm: in `chain` mode that is the normal way to work. Do not run a lead with parallel lanes before the user chose swarm mode. ## 1. Onboarding interview Run the interview in `references/interview.md` through the question dialog: batches of at most four questions, the recommended default first in every question. When a question gets no answer, take the default and write "default taken" next to it. Cover: project goal and definition of done, goals in order, budget, quantities, default printed material (carbon-fibre nylon / PETG / PLA / machined aluminium), fastening (heat-set inserts / thread-forming / through-bolts), enclosure (sealed / vented / open), mechanical clearance, PCB fab and assembly vendor, MCU family, main supply and worst transient, board class and coating, simulation tiers (native twin / Isaac Sim / Unreal) and the GPU, machine limits (CPU cap default 90 %, RAM kept free for the system default 4 GB, free-disk floor default 50 GB), archive location, the web CAD viewer (copy it into the project, default yes), usage tripwire (default 95 %), standing decisions. Then batch 6 (the build spec: environment, temperature range, IP rating and cooling, standards such as IPC class or MIL-STD-810H / 461G, wire such as SAE AS22759 "Tefzel", EMC, vibration, derating headroom) and batch 7 (how the owner likes to work: long sims detached in the background at below-normal priority or only overnight, engines only when they say, how results reach them, what happens to questions while they are away). Also ask: - the firmware language, recommending C (say why: the same core compiles for the board and the twin; Python stays for tools, CAD and the Isaac harness);