[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-108647":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":13,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},108647,"claude-hardware-in-the-loop","Kemerd\u002Fclaude-hardware-in-the-loop","Kemerd","Agent-driven hardware-in-the-loop engineering method: Claude Code skill, swarm orchestration, generator-first KiCad PCB pipeline, CadQuery CAD, firmware-in-the-loop, web CAD\u002FPCB viewer. Source-available (HIL-ASA-1.0).",null,"Python",98,5,1,0,3,25,46.33,"Other",false,"main",true,[],"2026-11-18 20:55:59","2026-11-21 21:04:23","\u003Cp align=\"center\">\n  \u003Cimg src=\"media\u002Fout\u002Fhil.gif\" alt=\"Hardware in the loop: agents write the code, scripts generate the hardware, gates prove it, git records it\" width=\"100%\">\n\u003C\u002Fp>\n\n\u003Ch1 align=\"center\">claude-hardware-in-the-loop\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Cb>AI agents build real hardware. Gates prove it.\u003C\u002Fb>\u003Cbr>\n  A method, a Claude Code skill and a tested project skeleton for letting agents design PCBs, CAD and firmware\n  without losing work, wrecking the PC, or burning the budget silently.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#quick-start\">Quick start\u003C\u002Fa> &nbsp;·&nbsp;\n  \u003Ca href=\"#how-it-works\">How it works\u003C\u002Fa> &nbsp;·&nbsp;\n  \u003Ca href=\"#what-you-can-do-with-it\">What you can do with it\u003C\u002Fa> &nbsp;·&nbsp;\n  \u003Ca href=\"docs\u002FMETHOD.md\">The method\u003C\u002Fa> &nbsp;·&nbsp;\n  \u003Ca href=\"docs\u002FLESSONS.md\">40 lessons\u003C\u002Fa> &nbsp;·&nbsp;\n  \u003Ca href=\"#licence\">Licence\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg alt=\"KiCad 10\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FKiCad-10-0b6fa4\">\n  \u003Cimg alt=\"CadQuery\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCadQuery-2.x-2f6bff\">\n  \u003Cimg alt=\"Claude Code skill\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FClaude%20Code-skill-ff4d1f\">\n  \u003Cimg alt=\"Windows and Linux\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWindows%20%7C%20Linux-tested-15b36b\">\n  \u003Cimg alt=\"Licence HIL-ASA-1.0\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicence-HIL--ASA--1.0-0d0d0f\">\n\u003C\u002Fp>\n\n---\n\n## What this is\n\n> **A starting point, not an all-in-one product.** Pull it, run the examples, then shape it into the harness\n> YOUR project needs: your boards, your plant models, your scenarios, your gates. The templates are tested\n> skeletons and a method, distilled from a larger private workflow that cannot be published; expect to add\n> checks, models and tools of your own, and to replace the examples entirely.\n\n> **Before you order anything real:** work through the harness, open the CAD and the board yourself, ask the agent\n> *why* for every part and every number, and have it run an adversarial review pass over the schematic, the\n> layout, the BOM, the CAD and the firmware (a fresh agent with the files, not the conclusions). Green gates mean\n> the checks that exist passed; they are not a substitute for an engineer looking. Then order with confidence.\n\nHardware described by code. Boards are Python scripts that one shared pipeline turns into a KiCad schematic, a routed\nboard, a fab set and a STEP model. Enclosures and assemblies are CadQuery builders that export geometry with mass and\ncentre of gravity. Firmware keeps its control core free of vendor headers, so the same code that runs on the target\nruns on the PC against a digital twin.\n\nEvery claim is checked by a gate that runs on the machine: ERC and DRC at KiCad's default severities, a live\ndistributor check of every purchased part, a no-shortcut audit that fails on stubs and admitted guesses, a CI matrix\nwith regression compare, host test suites, twin scenarios over seed sweeps. Agents do the engineering inside that cage.\n`main` moves only when the whole matrix is green.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"media\u002Fout\u002F01-loop-dark.png\">\n  \u003Cimg alt=\"The loop: the agent writes code, scripts generate the artefacts, gates check every claim, evidence lands in git, red sends it back to the agent\" src=\"media\u002Fout\u002F01-loop-light.png\" width=\"100%\">\n\u003C\u002Fpicture>\n\nIt comes from a private multi-board hardware project where agents designed the PCBs, the CAD and the firmware under\nthese gates for weeks. Everything project-specific has been removed. What is left is the method, the scripts, and the\ntemplates, all of them run and tested on the way out.\n\n## Why it is not a gimmick\n\nAgents that \"design a PCB\" usually produce a picture of a schematic. This produces files you can order from, and it\nrefuses to produce them when anything is wrong.\n\n- **A board that passes is a board you can order.** The pipeline writes fab files only when ERC is 0 \u002F 0, the final DRC\n  is 0 violations \u002F 0 unconnected \u002F 0 parity items at KiCad's default severities, and every purchased line resolves\n  live to the MPN the schematic names. The example board runs all twelve steps in 21 seconds.\n- **The checks caught real mistakes.** A distributor code that looked right resolved to an 0603 part instead of the\n  0402 it was assumed to be; the live check failed the build and the board got the right part. Forty such\n  lessons, each one an afternoon, are in [docs\u002FLESSONS.md](docs\u002FLESSONS.md).\n- **Nothing is hand-copied.** Mass, CG, inertia and joints flow from the CAD export into the twin, the simulators and\n  the viewer. A CAD change regenerates every tier's inputs.\n- **Agents cannot lower the bar.** DRC severities are never demoted; a relaxed rule needs a cited basis; a test that\n  exits 0 without its summary line is a failure; an empty suite is a failure; the audit fails on new stubs, canned\n  success and admitted guesses.\n- **The cost is stated up front.** One swarm day burned 4-5 million tokens. The skill says so before it does anything\n  and recommends the cheaper mode. See [Two modes, one honest cost](#two-modes-one-honest-cost).\n\n## What you can do with it\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"media\u002Fout\u002F06-what-you-can-build-dark.png\">\n  \u003Cimg alt=\"What you can build: boards from 2 to 6 layers, sealed enclosures, multi-board systems, firmware with host suites and twin scenarios, digital twins, FPGA flows, bench rigs, a web CAD viewer, overnight runs; and the roadmap, stated\" src=\"media\u002Fout\u002F06-what-you-can-build-light.png\" width=\"100%\">\n\u003C\u002Fpicture>\n\nAnything you can describe in code and prove with a gate. In practice:\n\n| You want | The method gives you |\n|---|---|\n| A board, from a breakout to a dense multi-layer | a generator, the shared pipeline, Freerouting, ERC \u002F DRC gates, live part verification, a JLCPCB fab set, STEP and a fit JSON for the CAD |\n| An enclosure or an assembly | a CadQuery builder with plug-in parts, interference and keep-out checks, a mass \u002F CG table on every change, decision renders with clashes in red |\n| Firmware you can trust before the board exists | out-of-tree builds, host suites with thousands of checks, a native twin that runs the real control code through the real station protocol, seed sweeps, determinism hashes |\n| A system of several boards and parts | one pipeline for every board, one source of truth for every tier, a bench register for the constants only a bench can settle |\n| Agents working while you sleep | detached night chains with a slot and a timeout per step, watchers that wake the agent on failure, morning questions with the default already taken |\n| A way to look at the result | a three.js viewer with section planes, x-ray, live mass \u002F CG, PCB and harness overlays, and review notes the next agent reads |\n\n## How it works\n\n### Boards: a board is a Python script\n\nThe script declares data: parts with their datasheet pin tables, nets, outline, holes, placement, net classes, pours.\nOne pipeline does the rest and stops at the first thing that is wrong. Nobody edits a `.kicad_pcb` by hand; the\ngenerator is the design, and a fix to the pipeline fixes every board.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"media\u002Fout\u002F02-pcb-pipeline-dark.png\">\n  \u003Cimg alt=\"The twelve pipeline steps from design checks to the fab set, with the three gates that must be clean before a fab file is written, the numbers from the example board, the determinism rule and the distributor catch\" src=\"media\u002Fout\u002F02-pcb-pipeline-light.png\" width=\"100%\">\n\u003C\u002Fpicture>\n\nSame inputs, same files: hashed string order, uuid5 schematic UUIDs, seeded board KIIDs, and a frozen route (the\nrouter itself is not repeatable) give a byte-identical `.kicad_pcb` across runs. Details, flags and the hard lessons\nare in [docs\u002FPCB.md](docs\u002FPCB.md).\n\n### CAD, firmware and simulation: one source of truth\n\nA CadQuery builder exports STEP, STL and a `parts.json` with mass and CG per part. The native twin, the Isaac Sim and\nUnreal tiers and the web viewer all read those exports; the PCB pipeline's STEP and fit JSON flow back into the\nbuilder. Firmware's control core is compiled twice from the same sources: once for the target, once for the twin.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"media\u002Fout\u002F03-source-of-truth-dark.png\">\n  \u003Cimg alt=\"One source of truth: the CAD builder's exports feed the native twin, Isaac Sim, the Unreal twin and the viewer; the PCB pipeline feeds the builder; the firmware core is compiled for the target and for the twin\" src=\"media\u002Fout\u002F03-source-of-truth-light.png\" width=\"100%\">\n\u003C\u002Fpicture>\n\n[docs\u002FCAD.md](docs\u002FCAD.md) has the builder and plug-in contract, [docs\u002FFIRMWARE.md](docs\u002FFIRMWARE.md) the host suites\nand the twin rules, [docs\u002FSIM.md](docs\u002FSIM.md) the C twin and its Unreal and Isaac Sim hosts.\n\n### The cage: agents inside, everything else outside\n\nAgents work in git worktrees and land every lane on `dev`, red gates included, so nothing is lost and conflicts show\nup the same day. `main` is promoted only when the CI report for that exact commit is green with zero regressions.\nHeavy jobs take a slot that gates RAM and CPU; long chains run detached with a watcher that wakes the agent on success\nand on failure. Uncommitted work is snapshotted every twenty minutes. A usage tripwire makes every agent stop, push,\nand write a resume document before the limit cuts it off.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"media\u002Fout\u002F04-cage-dark.png\">\n  \u003Cimg alt=\"The cage: the work is safe (worktrees, dev, main, merge lock, WIP backups), the machine is safe (slots, detached jobs, watchers), the budget is safe (usage tripwire, handoff hook, resume documents)\" src=\"media\u002Fout\u002F04-cage-light.png\" width=\"100%\">\n\u003C\u002Fpicture>\n\nThe whole method on one page: [docs\u002FMETHOD.md](docs\u002FMETHOD.md).\n\n### Two modes, one honest cost\n\n> Running this method as a **swarm** (a lead agent plus parallel lane agents) is expensive. On the project it comes\n> from, **one swarm day burned 4-5 million tokens**, and most of that was not the work: it was waking lane agents that\n> each carried **300-800k tokens of context** to read a message or check a log. The default is now a **chain**: one long\n> lead session (Fable or Opus) hands bounded cards to one or two subagents at a time (Opus or Sonnet) and checks each report,\n> so logs and trial and error stay out of the lead's context. The skill also offers a single session with no subagents,\n> and the swarm. Choose the swarm on purpose.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"media\u002Fout\u002F05-modes-dark.png\">\n  \u003Cimg alt=\"Single session versus swarm: one agent working numbered steps with gates, or a lead with recon, plan, lanes, skeptics and integration waves; the token cost of a swarm day\" src=\"media\u002Fout\u002F05-modes-light.png\" width=\"100%\">\n\u003C\u002Fpicture>\n\nRoles, waves, briefs, skeptics and the integrator are in [docs\u002FSWARM.md](docs\u002FSWARM.md).\n\n## Quick start\n\n1. Install the skill (Claude Code reads skills from a project's `.claude\u002Fskills\u002F` or your user skills folder):\n\n   ```\n   git clone https:\u002F\u002Fgithub.com\u002FKemerd\u002Fclaude-hardware-in-the-loop\n   # per project:\n   mkdir -p \u003Cyour-repo>\u002F.claude\u002Fskills && cp -r claude-hardware-in-the-loop\u002Fskills\u002Fhardware-in-the-loop \u003Cyour-repo>\u002F.claude\u002Fskills\u002F\n   # or for every project: copy the same folder into the skills folder of your Claude Code user config\n   ```\n\n2. In your project, ask Claude Code: *\"set up a hardware project with the hardware-in-the-loop method\"*. The skill\n   states the token cost, asks which mode you want, runs the onboarding interview (goals, budget, quantities, printed\n   material, fastening, enclosure sealing, fab vendor, MCU, simulation tiers and GPU, machine limits), then writes the\n   skeleton with `scripts\u002Fscaffold.py`, sets up `main` and `dev`, and verifies or installs the tools.\n\n3. Or do it by hand:\n\n   ```\n   python -I skills\u002Fhardware-in-the-loop\u002Fscripts\u002Fscaffold.py --answers answers.json --dest \u003Cyour-repo> --with-examples\n   pwsh -File skills\u002Fhardware-in-the-loop\u002Fscripts\u002Fsetup_tools.ps1 -ToolsRoot D:\\hiltools -VerifyOnly\n   cd \u003Cyour-repo> && pwsh -File windows\u002Fci.ps1\n   ```\n\n   The answers format is in `skills\u002Fhardware-in-the-loop\u002Freferences\u002Finterview.md`. Tools, pinned versions and hashes\n   are in [docs\u002FTOOLS.md](docs\u002FTOOLS.md).\n\n4. Make it yours: swap the example board, enclosure, firmware core and twin plant for your project's, add the checks\n   your domain needs, and keep reviewing the CAD and the boards with the agent (ask why, ask for an adversarial pass)\n   before anything goes to a fab.\n\n5. Stay current without giving up your changes. The skeleton is a starting point you are meant to rewrite, so it\n   carries its own updater. See [Update checks](#update-checks-what-they-do-and-how-to-turn-them-off) below.\n\n## Update checks: what they do and how to turn them off\n\nA scaffolded project checks this repository for a newer version when a Claude Code session starts. It is there so\nthat improvements (a better board-layout prompt, a faster viewer, a fixed tool) reach projects that long ago\ncustomised every template. Leaving it on is a good idea: the tooling here is actively improved, by the maintainer and\nby community pull requests, and a check costs you nothing.\n\nWhat it does, in full:\n\n- **The check** (`tools\u002Fhil_update.py check`, run by a `SessionStart` hook) reads two small text files,\n  `VERSION` and `CHANGELOG.md`, from `raw.githubusercontent.com\u002FKemerd\u002Fclaude-hardware-in-the-loop\u002Fmain\u002F`. It sends\n  nothing about you or your project, downloads no code, runs nothing it fetched, and happens at most once a day. If\n  you are offline it says nothing.\n- **If a newer version exists,** the agent tells you what is new in plain words and asks whether to pull it in. No\n  answer, or no, means nothing changes (and `ignore` stops that version being announced again).\n- **Only after you say yes** does `plan` download the repository's `main` archive from GitHub into the project's\n  `.tmp\u002F` and compare it with your files. Nothing is installed or executed from it. `apply` copies in new template\n  files and refreshes files you never touched. A file you customised is **never overwritten**: you get a diff and the\n  agent merges it with you. The whole update lands as one git commit on its own branch, so you can read it and revert it.\n- The updater is one readable Python file with only the standard library: `tools\u002Fhil_update.py`. Read it before you trust it.\n\nTo turn it off, any one of these:\n\n- set the environment variable `HIL_NO_UPDATE_CHECK=1` (the check exits at once, no network);\n- delete the `SessionStart` block from `.claude\u002Fsettings.local.json`;\n- delete `tools\u002Fhil_update.py` and `harness\u002FTEMPLATE_VERSION.json`.\n\nYou can still update by hand at any time with `python -I tools\u002Fhil_update.py check --force`.\n\n## What is in here\n\n```\nREADME.md, LICENSE, NOTICE\ndocs\u002F\n  METHOD.md      the whole method: storage tiers, branching (dev \u002F main), gates, machine safety, handoffs, overnight\n  PCB.md         generator-first boards: the 12 pipeline steps, determinism, Freerouting, hard lessons, protection rules\n  CAD.md         CadQuery builders, the plug-in contract, mass \u002F CG tables, decision images, material decisions\n  FIRMWARE.md    out-of-tree builds, host test suites, firmware in the loop against a native twin, bench rigs\n  SIM.md         the C digital twin, its models and scenarios, the Unreal and Isaac Sim hosts, CUDA Monte Carlo\n  SWARM.md       the chain (default), lead \u002F subagent models, waves, briefs, skeptics, integrator, locks, handoffs, single-session mode\n  TOOLS.md       what to install, pinned versions and hashes, where it lives, home-directory isolation\n  LESSONS.md     40 lessons: one sentence of symptom, one of rule\nskills\u002Fhardware-in-the-loop\u002F\n  SKILL.md       the skill: cost warning, mode choice, interview, scaffold, tools, branches, harness, both modes\n  references\u002F    interview + answers.json schema, plan templates (swarm and single session), brief, structured\n                 report, resume document, overnight chain + morning questions, wave checklist, agent-rules guide,\n                 twin-setup (native \u002F Unreal \u002F Isaac \u002F CUDA), firmware-host (C first; ESP32, ESP32-P4, ARM),\n                 research-citations (how to find, verify and cite sources; a verified reading list)\n  scripts\u002F       scaffold.py (writes the skeleton), setup_tools.ps1 \u002F setup_tools.sh (pinned toolchain),\n                 check_twin_tools.ps1 (finds CMake, compilers, Unreal >= 5.8.4, Isaac Sim, CUDA)\n  templates\u002F     the project skeleton (see below)\n                 (the three.js CAD viewer is a template too: templates\u002Ftools\u002Fcad_viewer, copied by the scaffold)\nmedia\u002Fout\u002F       the README graphics and the explainer video\n```\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>The project skeleton\u003C\u002Fb> (\u003Ccode>skills\u002Fhardware-in-the-loop\u002Ftemplates\u002F\u003C\u002Fcode>), file by file\u003C\u002Fsummary>\n\u003Cbr>\n\n| Path | What it is | State |\n|---|---|---|\n| `README.md`, `README_AGENT.md`, `PROJECT_STRUCTURE.md`, `REQUIREMENTS.md`, `CODING_RULES.md` | root documents, filled from the interview | ready |\n| `DECISIONS.md`, `QUESTIONS.md`, `CITATION.md` | numbered owner decisions (never edited, superseded by new rows); open questions with the recommended default and a deadline; every model's verified source (16 rows, checked against Crossref \u002F arXiv \u002F publishers) | ready |\n| `sim\u002Ftwin\u002F` | the C digital twin: rigid body + contact, brushed DC, PMSM + FOC drive, geared joint, thermal network, battery, IMU \u002F baro \u002F range \u002F NTC \u002F ADC models; the example actuator rig running the firmware core; the `hil_twin_api` C ABI; the scenario runner; 9 scenario rows; CUDA Monte Carlo with a CPU reference; CAD-to-twin and ctypes tools | implemented, tested (165 host checks, 20 scenario runs, determinism, ABI from Python) |\n| `firmware\u002Fcore\u002F` | example portable control core in C11 (homing, cascaded joint control, winding-temperature observer, derating, faults) behind a function-pointer HAL, plus a CRC-framed link codec | implemented, tested |\n| `sim\u002Funreal\u002F` | UE 5.8 plugin (Kinematic and ChaosTorque coupling, scenario player, console commands) and a host project | built with UE 5.8.4, automation tests pass headless (trace hash equals the native runner's); ChaosTorque compiled, its acceptance run is the project's first Unreal step |\n| `sim\u002Fisaac\u002F` | fail-closed GPU gate, USD rig authored from the twin's properties, the PhysX harness | gate and USD authoring tested on CPU; the harness is written against the Isaac Sim 6.2 API and not run here |\n| `windows\u002Fci\u002Ftwin.ps1`, `tools\u002Fcheck_citations.py`, `tools\u002Farchive_tmp.py` | CI group `twin`; the citation gate (suite `citations`); the hash-checked `.tmp` to `.archive` mover | implemented, tested |\n| `gitignore.template`, `gitattributes.template` | become `.gitignore` \u002F `.gitattributes` (scratch, harness, KiCad per-user files, fab files as binary) | ready |\n| `windows\u002Fci.ps1`, `windows\u002Fci\u002Fci_common.psm1`, `windows\u002Fci\u002Faudit.ps1`, `windows\u002Fci\u002Fpcb.ps1` | CI matrix: group registry, parallel pwsh processes, `ci_report.json`, `-Compare -FailOn regressions`; groups `audit` and `pcb` | implemented, tested |\n| `tools\u002Faudit_placeholders.py` + baseline \u002F waivers JSON | no-shortcut audit: open-work markers, admitted guesses, Python stubs, hardware functions returning canned success, CAD stand-in names and bare primitives, default credentials; tracked baseline, signed waivers, `--changed-since` | implemented, tested |\n| `tools\u002Fcheck_portability.py` | interpreter line, UTF-8 console, path anchoring, no user-profile paths | implemented, tested |\n| `pcb\u002Ftools\u002Fkicad_env.py`, `board_pipeline.py`, `distributor_verify.py` | generator-first KiCad 10 pipeline: schematic from data, own footprint library, ERC, placement DRC, Freerouting, clean-up, pours, final DRC with parity, JLCPCB fab set, live LCSC verification, STEP, fit JSON, results JSON with SHA-256s | implemented, tested end to end |\n| `pcb\u002Ftools\u002Froute_board.py`, `pf_route.py`, `astar.c` | negotiated-congestion router for the dense boards Freerouting leaves open: reads pads, nets, rules, zones and keep-outs from the board, routes around copper already there, reports what stays open | implemented, tested on real boards stripped of their copper |\n| `pcb\u002Fexample_board\u002Fgen_example_board.py` | a real 2-layer 3.3 V LDO breakout (TVS, PTC with sense line, redundant power \u002F ground pins, every part behind the TVS rated above its clamp) | runs green in about 15 s |\n| `pcb\u002FDESIGN_STANDARDS.md` | rule book skeleton with rule ids and a project decision table | ready (a machine checker for the rule ids is roadmap) |\n| `cad\u002Fcad_plugins.py`, `cad\u002Frender.py`, `cad\u002Fmass_cg_table.py` | plug-in loader, decision renders (clash in red, dimensions), weight-and-balance table | implemented, tested |\n| `cad\u002Fexamples\u002Fenclosure\u002F` | sealed enclosure builder + gasket and gland-access plug-ins | runs, checks pass |\n| `firmware\u002Fhost_tests\u002Fhil_check.h` | header-only check library with a parseable summary line, plus its self-test | implemented, tested (C99 and C++11) |\n| `harness\u002Fswarm\u002Flocks\u002Fslot.sh` | machine gate: RAM reserve, CPU cap, start gap, fairness queue, starvation guard, per-kind capacity, stale reclaim | implemented, tested |\n| `harness\u002Fswarm\u002Fdetach.sh`, `watch.sh` | detached chains with done \u002F FAILED markers; watcher for success, failure, hang, crash | implemented, tested |\n| `harness\u002Fswarm\u002Fmerge_lock.sh`, `merge_to_dev.sh`, `promote_dev.sh`, `wip_backup.sh` | dev \u002F main model: every lane lands on dev, promotion only when green with 0 regressions; WIP snapshots without force-push | implemented, tested on a local remote |\n| `harness\u002Fswarm\u002Fusage_statusline.py`, `handoff_hook.sh`, `handoff_hook.json` | usage tripwire and the stop-and-write-a-resume-document hook | implemented, tested |\n| `harness\u002Fswarm\u002FAGENT_RULES.md`, `claude\u002Fsettings.local.json.example` | binding rules for agents; hook and status-line wiring | ready |\n| `docs\u002Fbench\u002FBENCH_REGISTER.md`, `docs\u002Fdata\u002FREADME.md` | bench parameter register, tracked results index | ready |\n\n\u003C\u002Fdetails>\n\n### The viewer (`tools\u002Fcad_viewer\u002F` in a scaffolded project)\n\nThe scaffold copies it from `templates\u002Ftools\u002Fcad_viewer\u002F` with `windows\u002Fcad_viewer.ps1`; the interview offers it. `pack_mesh.py` packs a builder export into a compact payload, `serve.py` serves it locally with a review-notes API\n(notes pinned on parts land in a JSONL file the next agent reads), `index.html` is a single-page three.js viewer:\nsection planes with a stepper (0.1 mm, Shift 1 mm, Alt 0.01 mm), x-ray, PCB X-ray (boards solid with their KiCad render), Wire X-ray, parts list by mass, a live mass \u002F CG panel of the visible parts with a CG marker, a materials\npanel, a PCB overlay from `pcb_to_json.py` (outline, courtyards per side, mounting holes), and a harness overlay (wire\nruns as tubes with zip-tie points and run lengths). Project facts live in one `viewer.config.json`; KiCad and Pillow are optional, a mesh-only build comes up without them. See the [viewer README](skills\u002Fhardware-in-the-loop\u002Ftemplates\u002Ftools\u002Fcad_viewer\u002FREADME.md).\n\n## Implemented vs roadmap\n\nNothing here is sold as done that is not. The right column is designed and written up, not built.\n\n| Area | Implemented | Roadmap |\n|---|---|---|\n| Gates | CI matrix, audit, portability, ERC \u002F DRC re-check, regression compare | a standards checker that implements the DESIGN_STANDARDS rule ids |\n| PCB | full generator pipeline with Freerouting or the negotiated router, live part verification, fab set, STEP | BGA fan-out helpers, length matching, panelization |\n| CAD | plug-in contract, renders, mass \u002F CG tables, example builder | interference check with exact contact areas, STEP-based catalogue part import |\n| Firmware | host check library, a C firmware core behind a HAL, the twin pattern, ESP32 \u002F ESP32-P4 \u002F ARM guidance | register-level device models and a lockstep RTOS shim for unmodified `main.c` (described in firmware-host.md) |\n| Simulation | native C twin with models, scenarios, seeds, determinism, Monte Carlo (CPU + CUDA); Unreal plugin with hash parity; Isaac Sim harness | ChaosTorque and Isaac runs validated on a project's own rig; rendered sensor models (cameras, depth); bench-versus-twin comparison tooling |\n| Viewer | parts, sections, notes, mass \u002F CG, materials, PCB and harness overlays | copper layers, harness clearance and bend-radius checks, measurements, exploded view, build-to-build diff |\n| Orchestration | slots, detached jobs, watchers, merge lock, dev \u002F main, WIP backup, usage tripwire, templates for plans, briefs, reports, resume documents, overnight chains | |\n\n## Licence\n\nSource-available under the Hardware-in-the-Loop Attribution and Share-Alike Tooling License 1.0 (HIL-ASA-1.0), see\n[LICENSE](LICENSE). It is **not** an OSI-approved open-source licence: it adds a restriction on selling the tooling\nitself. Use it, commercially too, to design, build and sell your own boards, firmware and products on any terms you\nlike; all you owe is credit. Fork it, change it and share it for free, as long as the notice and the licence stay\nintact. Selling the tooling itself, bundling it into a paid product, or running it as a paid service is allowed only if\nthat product's full source is published under HIL-ASA-1.0. The credit line to use (also in [NOTICE](NOTICE)):\n\n```\nBased on claude-hardware-in-the-loop by Kemerd (https:\u002F\u002Fgithub.com\u002FKemerd\u002Fclaude-hardware-in-the-loop)\n```\n","这是一个面向硬件在环（HIL）开发的开源方法框架，支持AI代理协同完成PCB设计（KiCad）、机械结构建模（CadQuery）、固件开发与数字孪生验证。核心特点是生成式硬件流水线（generator-first）、多代理协同编排（swarm orchestration）、全链路自动化门控检查（ERC\u002FDRC\u002F物料校验\u002F回归测试），以及固件与仿真环境共用控制逻辑。项目提供可扩展的脚手架模板和经过验证的工程方法，适用于嵌入式系统原型开发、教育实验平台构建及需要严格可追溯性与自动验证的硬件研发流程。",2,"2026-11-24 04:34:51","CREATED_QUERY"]