From claude-for-hardware
Use when building or debugging a compiler backend, codegen, or assembler and you need to prove the generated machine code is correct by executing it on a real CPU or a fast emulator, not just inspecting the output
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-for-hardware:codegen-validationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A codegen backend is correct when the code it emits computes the right answer on a real machine. Reading the assembly proves nothing; a plausible-looking instruction sequence with a wrong ABI detail or a clobbered callee-saved register passes every eyeball review and fails on hardware.
A codegen backend is correct when the code it emits computes the right answer on a real machine. Reading the assembly proves nothing; a plausible-looking instruction sequence with a wrong ABI detail or a clobbered callee-saved register passes every eyeball review and fails on hardware.
Core principle: Execution-validate. Compile a known program, run the output on a real CPU or a fast emulator, and assert the observed result. If you didn't run it, you don't know it works.
known program (expected result known)
-> codegen -> machine code
-> run on real CPU / fast emulator
-> assert observed result == expected
Execution validation reliably catches the codegen bugs that look fine on paper:
select/conditional-move lowering that picks the wrong operand.These are exactly the bugs that turn into silicon respins or weeks of "intermittent" debugging if they escape. A handful of executed tests finds them in seconds.
Order tests so each new one depends only on capabilities already validated:
When a higher test fails and the lower ones pass, the bug is in the new capability. That ordering is the debugger.
| Smell | Do instead |
|---|---|
| "The disassembly looks correct" | Execute it and assert the result |
| Test asserts "no crash" | Assert the actual computed value |
| Slow full-system sim per test | Fast target emulator, run every build |
| One big program as the only test | Capability-ordered tests, smallest first |
| Skipping ABI/spill tests | Those are exactly where the bugs hide |
river-emulator. That harness caught real codegen bugs (select lowering, critical-edge splitting, return-address save) that passed inspection.vulcan-target/<arch>; validation is a first-class part of bring-up, not an afterthought.differential-verification.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub midstall/claude-for-hardware --plugin claude-for-hardware