claude-KiCad-pcb-designer-skill / toolkit
AGENTS.md4 starsChanged 57 days agoMITView on GitHub
Use these tools to take a KiCad design from schematic to a routed, DRC-clean, manufacturer-ready board. Work in stages, write a new file at every stage, and report each stage to the user. Never present a partial board as final. 1. Schematic. Generate it from Python (schematic/, see examples/demo_sch/make_sch.py) or take the user's. Loop kicad-cli sch erc until 0, then kicad-cli sch export netlist and python3 schematic/netcheck.py. 2. Placement with the pcbnew API: - Place outline and holes first, then…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- kicad-pcb-autorouter-workflowSkill
- kicad-schematic-generatorSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
17 rules. About 0 are common, 9 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Use these tools to take a KiCad design from schematic to a routed, DRC-clean, manufacturer-ready board.
- Very specific: line 8
Check python3 -c "import pcbnew.
- Very specific: line 9
Run pip install -r requirements.txt (add --break-system-packages on a managed Python), then make.
- Very specific: line 10
Run examples/demo/run_demo.sh and tests/smoke.sh.
- Distinctive: line 17
Place outline and holes first, then keepouts for escape corridors, then parts block by block.
- Distinctive: line 20
Check courtyards with DRC.
- Very specific: line 29
Read failed and dropped at the end of the log.
- Distinctive: line 47
Check every footprint pad has the intended net (pads with none = symbol/footprint mismatch).
- Distinctive: line 48
Check SoC power and special pins against the vendor reference schematic.
- Distinctive: line 49
Check connector orientation (look at the Fab layer and the bottom render).
- Distinctive: line 50
Check power-path widths, buck input-cap distance, exposed-pad vias, and part voltage ratings against the input range.
- Distinctive: line 52
Verify each review finding yourself before changing anything.
- Very specific: line 63
Never trust zone results in DRC without a refill.
- Very specific: line 64
Do not compare pcbnew objects with is / in.
- Very specific: line 67
Look at the board, not only at numbers: layerplot.py / netplot.py PNGs of the region you change.
- Distinctive: line 68
When a change cannot be undone or alters the architecture, ask the user first.
- Very specific: line 76
Use oracle.py / gate.py to compare connectivity between stages.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Instructions for AI agents using this toolkit
Use these tools to take a KiCad design from schematic to a routed, DRC-clean, manufacturer-ready board. Work in stages, write a new file at every stage, and report each stage to the user. Never present a partial board as final.
Setup (once)
- Check
python3 -c "import pcbnew; print(pcbnew.Version())"andkicad-cli --version. - Run
pip install -r requirements.txt(add--break-system-packageson a managed Python), thenmake. - Run
examples/demo/run_demo.shandtests/smoke.sh. Both must succeed before you touch the user's board.
Pipeline
- Schematic. Generate it from Python (
schematic/, seeexamples/demo_sch/make_sch.py) or take the user's. Loopkicad-cli sch ercuntil 0, thenkicad-cli sch export netlistandpython3 schematic/netcheck.py. - Placement with the pcbnew API:
- Place outline and holes first, then keepouts for escape corridors, then parts block by block.
- Each buck goes as a unit: input cap within 1 mm of VIN/GND, SW pin facing the inductor.
- Point edge connectors' mating side out of the board.
- Check courtyards with DRC.
- Fan-out and planes.
- BGA dog-bone vias and plane zones.
plane_via.pyfor pads of plane nets.- Lock fan-outs (
SetLocked(True)).
- Route. Copy
kat/cfg_template.pytocfg_<board>.pyand set layers, clearances (match the.kicad_dru), widths, pairs and plane nets.- Run
ncroute.py cfg IN OUT. - Route in stages with
NETRX(memory, then pairs, then the rest). - Read
failedanddroppedat the end of the log.
- Run
- Repair loop.
drc.sh OUT, then fix in this order: shorts > clearance > unconnected > items_not_allowed > dangling.- Local problem: delete that copper and re-run
ncroute.pywithNETRXon those nets. It only adds missing links. - Single connection in a dense spot: use
astar1.py. If it finds no path, open a channel withmovevia.pyor move a part withplace_free.py. - Lost BGA escape: use
restore_net.pyfrom an earlier board. - Stranded plane island: use
cluster_link.py. - Dangling copper: use
dangle2.pywith the DRC JSON, 2-3 rounds.
- Local problem: delete that copper and re-run
- Length and skew.
pair_skew.pyfor HDMI / USB / Ethernet. For DDR:ddr_rubber.py, thenddr_tune.py, thenddrsum.py, after adaptingddr_profile.py. Report residual mismatch in mm and ps (~6-7 ps/mm). - Finish.
gnd_pour.pyfor outer GND pours and stitching.silk_refs.pyfor references.copy_fields.pyafter adding MPN / LCSC fields.drc.sh OUT dir --parityuntil 0 errors, 0 unconnected, parity 0.
- Review before calling it done. Clean DRC is not enough.
- Check every footprint pad has the intended net (pads with none = symbol/footprint mismatch).
- Check SoC power and special pins against the vendor reference schematic.
- Check connector orientation (look at the Fab layer and the bottom render).
- Check power-path widths, buck input-cap distance, exposed-pad vias, and part voltage ratings against the input range.
- Verify each review finding yourself before changing anything.
- Hand-off.
make_viewer.pygives the user an interactive page per stage.- Release Gerber X2 / Excellon / positions / BOM with
kicad-cli, with the project's.kicad_pro,.kicad_druand schematic in one folder. examples/h3_sbc/release_v5.shshows a complete release script.
Rules
- Copy the board's
.kicad_proand.kicad_drunext to every intermediate.kicad_pcb(same base name) before loading, filling zones or running DRC. - Never trust zone results in DRC without a refill.
drc.shrefills a copy. - Do not compare pcbnew objects with
is/in. Collect, then remove at the end. Use separate processes for edit and analysis. - Long jobs:
setsid nohup bash job.sh &plus a.donemarker. Never killncroute.pymid-run. - Look at the board, not only at numbers:
layerplot.py/netplot.pyPNGs of the region you change. - When a change cannot be undone or alters the architecture, ask the user first.
v4.4 tools and guardrails
- Plane-layer escalation is a last resort: normal routing layers first, then only remaining open signal nets. Preserve inherited keep-outs, shield high-speed reference copper, bridge every slot crossing, refill, and inspect
esc_layer.py report. ncroute_msla.pypush-and-shove is transactional and expensive. Enable it late, bound its depth/budget, and accept only a net improvement in conflict score followed by DRC and connectivity checks.cluster_place.pymoves connected signal groups; always inspect its JSON/NETRX outputs, check decoupling and mechanical constraints, and reroute affected copper. Avoid using it around dense ICs/buses where it cannot create usable space.- Use
oracle.py/gate.pyto compare connectivity between stages. Never promote a stage that loses a net or increases open links. - For 2-layer boards, keep the v3 GND-as-tracks rule; the 4-layer plane-layer escalation workflow is not a substitute for a properly connected return path.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

