hardrev

Use hardware-studio

How Claude Code designs a project, with agents, interfaces.yaml and the checks.

A hardware-studio project is a hardrev repository plus a handful of files that tell Claude Code which tools it has, how the parts fit together and how to check its own work. You say what you want built. Claude Code designs it in KiCad and SolidCraft, runs the solvers, and commits the results with hr.

Start a project

Create the repository on the Repositories page first. Then clone it with hstudio clone, which runs hr clone and then hstudio init:

hstudio clone https://api.hardrev.dev/<owner>/<repo>
cd <repo>
claude

The first time you start claude in the project, it asks whether to trust the project's MCP servers. Say yes. Already have a project? Run hstudio init inside it. A folder that isn't a hardrev repository yet needs hr init first.

init leaves your own files alone. It adds whatever is missing and rewrites only its own section of CLAUDE.md, so running it again after an update is safe.

What init adds

.mcp.jsonthe MCP servers kicad, solidcraft, solidcraft-1 to solidcraft-4 and hardrev. It has no absolute paths in it, so it works on everyone's machine.
CLAUDE.mda section on how to use the tools, with the rules below
interfaces.yamlthe contract between the board, the mechanics and the firmware
.claude/agents/agents for parallel work: pcb, mechanical-1 to mechanical-4, firmware, simulation and integrator
.revignorebuild output, KiCad backups and caches, and local Claude settings

Commit these, and everyone who clones the project gets the same setup.

hr commit -m "Set up hardware-studio"
hr push

interfaces.yaml

Fill this in first. Before anyone works on parts in parallel, it pins down what those parts have to agree on: board outlines, connector positions, the pin map, power budgets and mass. Lengths are in mm, currents in mA and masses in grams. Delete the sections you don't need.

boards:
  - pcb: electronics/board.kicad_pcb
    width: 60
    height: 40
    tolerance: 0.1
power:
  - rail: 3V3
    supply_ma: 600
    margin: 0.2
    loads:
      - {name: MCU, ma: 240}
pins:
  - {device: U1, pin: 21, signal: I2C_SDA}
assembly:
  - {name: case, step: mechanical/case.step, density_g_cm3: 1.27}
  - {name: board, step: electronics/board.step, at: [3, 3, 5], mass_g: 18}
mass: {max_g: 250, extra_g: 40}

Agents read this file and leave it as it is. When a dimension in it can't work, they stop and explain why. Only you or the integrator agent should edit it.

Working with Claude Code

Tell it what you want in plain language. Something like this:

Design a 60 x 40 mm board with an ESP32-S3, USB-C power and a 3.3 V regulator,
and a printed case for it with a slot for the USB-C connector.
Fill in interfaces.yaml first, then use the pcb and mechanical-1 agents in parallel,
and finish with the integrator.

Each agent in .claude/agents owns a set of files. pcb handles the schematic and layout of one board. mechanical-1 through mechanical-4 each model a part in SolidCraft on a server of their own, so four parts can be in progress at once. firmware works in PlatformIO, and simulation runs the solvers without editing the design. Once the pieces are in, integrator runs the checks and hands each failure back to whichever agent owns the file.

  • Run one pcb agent at a time. They'd all be sharing the single KiCad server.
  • Don't start two copies of the same mechanical-N, or they'll both edit one open design.
  • Give every file one writer. hardrev won't merge KiCad or CAD files for you.

Editing the board live

With no KiCad window open, the KiCad tools still cover schematics, libraries, ERC, DRC and exports. Placing parts and routing need KiCad's PCB editor running. Open it with:

hstudio kicad

After that the live editing tools show up for Claude Code. The very first time, KiCad shows a welcome dialog, and its API won't answer until you close it. Keep your own hands off the board in KiCad while an agent is changing it on disk. On a machine without a display, agents write pcbnew scripts and run them with hstudio pcb.

Checking the work

hstudio check

This is the gate. It holds the design up against interfaces.yaml, runs ERC and DRC, measures board outlines, adds up the power budget and the mass, checks the pin map, looks for interference between the parts in assembly, builds the firmware, and runs any MuJoCo models or solver checks you've listed. You get one line per check, with the same results in build/check.json.

PASS  ERC electronics/board: no errors
PASS  DRC electronics/board: no errors
PASS  outline electronics/board.kicad_pcb: 60 x 40 mm, expected 60 x 40
PASS  interference: 1 pairs clear
FAIL  mass budget: 268.0 of 250 g
N/A   firmware: no platformio.ini

A check that has something to look at and can't run counts as a failure. Nothing gets skipped quietly. Work is finished when hstudio check passes, and nobody edits a check to get there.

A person reviews the design before anything goes to fabrication. ERC and DRC can pass on a circuit that doesn't work, and a simulation is only as good as the boundary conditions someone chose for it.

Commands

hstudio doctorruns each tool and starts each MCP server
hstudio checkruns every check, with --json for scripts
hstudio init [dir]sets up a project
hstudio clone <url> [dir]hr clone, then init
hstudio kicad [board]opens the board in KiCad for live editing
hstudio run ngspice -b sim.cirruns a solver in a container with no network that sees only this project. The solvers are ngspice, gmsh, ccx, OpenFOAM, openEMS (through python3), renode and freerouting.
hstudio pcb script.pyruns a Python script with KiCad's pcbnew module
hstudio python script.pyPython with build123d, trimesh, CoACD and MuJoCo
hstudio pio runPlatformIO

Saving and sharing

Claude Code commits through the hardrev MCP server, and you can commit with hr yourself. Pushing, pull requests and releases work as described in Use hr. Pushed SolidCraft designs show up in 3D on the repository page. Anyone who clones with hstudio clone gets the same tools, agents and checks you have.

Limits

  • Live board editing needs a desktop with KiCad open.
  • hstudio check runs whatever the project tells it to, firmware build included. Read a stranger's platformio.ini and solver checks before you run it on their project.
  • Isaac Sim and Isaac Lab aren't installed. They need an RTX GPU with 16 GB of memory.
  • OpenFOAM is 1912 and openEMS is 0.0.35, the versions Debian 12 ships.