kicad
Skill2 starsChanged 44 days agoMITView on GitHub
Automate KiCad 10 PCB and schematic work: run DRC/ERC with kicad-cli and summarise the violations, build a manufacturer-ready fabrication package (Gerbers, Excellon drill, pick-and-place/CPL, BOM, STEP, zipped, with a JLCPCB preset), render the board to PNG, and script footprint placement and board edits in a running PCB editor through the KiCad IPC API (kicad-python / kipy). Use for "run DRC on this board", "why does ERC fail", "summarise the DRC errors", "export Gerbers for JLCPCB / PCBWay", "make the fab zip", "generate the BOM and CPL / centroid file", "place these LEDs in a circle", "move or rotate footprints by script", "set the title block", or anything mentioning .kicad_pcb, .kicad_sch, kicad-cli or pcbnew scripting. Not for mechanical CAD, enclosures, STEP modelling or turning existing Gerbers into printable 3D parts (freecad, brl-cad), photoreal renders of a board in a 3D scene (blender), block or wiring diagrams (drawio), circuit simulation (SPICE), or flashing firmware to a board.
- Installs packages
5 other projects use a version of this.
Adopted by
Most recently taken up by
- Lukk17/agent-standardstheir own version, first seen Nov 7, 2026
- rogue-dev-studio/ai-agents-roguetheir own version, first seen Nov 1, 2026
- jewbetcha/openflighttheir own version, first seen Oct 8, 2026
- joegoldin/agent-skillstheir own version, first seen Oct 6, 2026
- aklofas/kicad-happytheir own version, first seen Apr 6, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- aklofas/kicad-happy★ 1.6ksame name
- jewbetcha/openflight★ 1.2ksame name
- rogue-dev-studio/ai-agents-rogue★ 2same name
- joegoldin/agent-skills★ 1same name
- Lukk17/agent-standards★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository43 other files it gives its agents.
- AGENTS.mdAGENTS.md
- affinitySkill
- apple-photosSkill
- apple-shortcutsSkill
- blenderSkill
- brl-cadSkill
- cavalrySkill
- code-analyzerSkill
- compressorSkill
- davinci-resolveSkill
- documentation-generatorSkill
- drawioSkill
- duvSkill
- emu-brandingSkill
- error-debuggingSkill
- final-cut-proSkill
- freecadSkill
- gimpSkill
- github-audit-to-issuesSkill
- github-commit-prSkill
- github-do-all-issuesSkill
- github-do-issueSkill
- github-fix-ci-errorSkill
- github-issuesSkill
- godotSkill
- handbrakeSkill
- inkscapeSkill
- keynoteSkill
- kritaSkill
- libreofficeSkill
- markitdownSkill
- musescoreSkill
- nukeSkill
- numbersSkill
- obsSkill
- pagesSkill
- pixelmator-proSkill
- qcadSkill
- rebelleSkill
- refactoringSkill
- scribusSkill
- sonic-piSkill
- test-generatorSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Read .kicad_pcb/.kicad_sch text (S-expressions) to inspect or verify.
- Distinctive: line 79
When explaining DRC results to a user:
- Very specific: line 88
Run --refill-zones when the board has copper pours: stale fills cause false clearance/unconnected results.
- Very specific: line 106
Run drc --parity first when a schematic exists.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
KiCad automation
KiCad 10 has three automation surfaces. Pick by task:
| Task | Surface | Tool |
| DRC / ERC, summaries | kicad-cli (headless) | scripts/kicad.py drc / erc |
| Gerbers, drill, CPL, BOM, STEP, zip | kicad-cli (headless) | scripts/kicad.py fab |
| Board picture | kicad-cli pcb render | scripts/kicad.py render |
| Move/rotate/arrange footprints, title block | IPC API in a running PCB editor | scripts/kicad_ipc.py |
| Edits with no GUI available | legacy SWIG pcbnew (deprecated, gone in KiCad 11) | references/ipc-api.md |
Read .kicad_pcb/.kicad_sch text (S-expressions) to inspect or verify. Don't
hand-edit it for placement. In the file, pad and field offsets are relative to the
footprint, but their angles are absolute, so changing a footprint's rotation in
(at X Y ROT) leaves every pad at the old angle.
Verified against KiCad 10.0.6 on macOS. kicad-cli lives in
/Applications/KiCad/KiCad.app/Contents/MacOS/ and is not on PATH. The helpers
find it (or use $KICAD_APP).
Why the helpers instead of raw kicad-cli
Raw kicad-cli has measured traps (details in references/gotchas.md):
- Output follows the KiCad UI language, JSON report descriptions included
("Szigetelési távolság megsértése…" on a Hungarian Mac).
kicad.pyruns every call against a throwaway English copy of the user's config, so reports are readable and stable. The user's settings are never touched. - Exit codes disagree:
pcb drc --exit-code-violationsgives 5,sch ercgives 0 with 50 violations.kicad.pyreads the JSON and exits 2 when errors exist. - ERC JSON positions are 1/100 of the stated unit in 10.0.6.
kicad.py ercdetects and corrects this. pcb export gerberswithout-lplots every layer (User.*, Fab, Margin…), and an invalid layer name is only a warning (exit 0).fabpasses an explicit layer list derived from the board's copper count.sch export bomwrites ranges (D1-D8); fab houses wantD1,D2,….
Commands
K=~/path/to/skills/kicad/scripts # wherever the skill is installed
python3 $K/kicad.py find # version, paths, API switch, kipy
python3 $K/kicad.py drc board.kicad_pcb # writes board-drc.json, grouped summary
python3 $K/kicad.py drc board.kicad_pcb --refill-zones --parity --top 5
python3 $K/kicad.py erc board.kicad_sch # writes board-erc.json
python3 $K/kicad.py fab board.kicad_pcb -o fab/ --preset jlcpcb --zip --step
python3 $K/kicad.py render board.kicad_pcb -o top.png [--side bottom] [--rotate -45,0,45]Exit status everywhere: 0 ok · 1 failed · 2 violations found · 3 setup
error or timeout. --json gives machine-readable output; --timeout N (default 600 s)
kills a hung call's process group.
DRC / ERC
The summary groups violations by severity and type, with a count and the first
--top examples (items, refs and mm positions). Unconnected items and schematic
parity come from separate JSON arrays and are listed separately, so don't add them into
the violation count.
When explaining DRC results to a user:
- Lead with errors, by count, before warnings.
- Name the parts or nets involved and the measured vs required value (e.g. "VCC track 0.05 mm from D5 pad 1 [GND], rule 0.2 mm").
- Say which errors are one root cause. A misplaced footprint can cause a courtyard overlap, mask bridges and silk warnings at once.
- Suggest the fix, not just the rule name.
Run --refill-zones when the board has copper pours: stale fills cause false
clearance/unconnected results. Without --save-board the file is not modified.
Fabrication package
fab writes gerbers/ (copper incl. inner layers, mask, paste, silkscreen, Edge.Cuts,
plus *-PTH.drl/*-NPTH.drl and drill maps), a CPL, a BOM from the matching
.kicad_sch, an optional STEP, and with --zip a zip of gerbers/ only (what fab
upload forms expect; BOM/CPL are uploaded separately).
--preset jlcpcb: no X2/netlist attributes, no job file. CPL isDesignator,Mid X,Mid Y,Layer,Rotation. BOM isComment,Designator,Footprint,LCSC Part #, grouped, with the LCSC field auto-detected (--lcsc-fieldto name it).--preset generic(default): KiCad's own column names, X2 Gerbers.- The CPL holds SMD parts only, without DNP parts (
--include-thtto add through-hole). - Exit 1 with a
PROBLEM:line for anything a fab would reject: missing required layer, empty outline, empty CPL, no LCSC field on a JLCPCB BOM.
Run drc --parity first when a schematic exists. A clean plain DRC only means the
copper that's there is legal. Parity also catches a board that was never updated from
its schematic or never routed. fab prints WARNING: lines for boards with pads but
no tracks/zones, or no nets at all. The files still export, but tell the user
before they order, because those boards come back as isolated pads.
Per-part rotation offsets for JLCPCB assembly are not corrected; see
references/fab-presets.md.
Live edits through the IPC API
Setup, once per machine (details in references/ipc-api.md):
python3 -m venv ~/.venvs/kicad && ~/.venvs/kicad/bin/pip install kicad-python- The user switches on KiCad › Preferences › Plugins › Enable KiCad API. It is off by default. Don't flip it by editing their config; ask.
- Open the board in the PCB editor. If the KiCad project manager is running, board calls can fail with "no handler": the project manager owns the socket. Open the board from that project window, or use the standalone PCB Editor with KiCad closed.
PY=~/.venvs/kicad/bin/python
$PY $K/kicad_ipc.py status
$PY $K/kicad_ipc.py list --glob 'D*'
$PY $K/kicad_ipc.py place-circle D1-D8 --center board --radius 20 \
--start-angle 90 --direction cw --facing tangent --save
$PY $K/kicad_ipc.py move J1 145 125 --rot 90 --save
$PY $K/kicad_ipc.py set-title --title "LED ring" --revision B --save- Coordinates are mm as shown in the editor: X right, Y down. Angles are degrees counter-clockwise as seen from the top, like KiCad's Rotation field.
statusprints the Edge.Cuts outline and its centre.--center boarduses that centre.place-circle:--start-angle 0puts the first part right of the centre,90above it.radialpoints each footprint's +X outward;tangentaligns it with the circle;--rotation-offsetcorrects footprints whose "natural" direction isn't +X.- Each footprint command is one commit: one Cmd+Z in KiCad undoes it all (verified).
set-titleedits are not on KiCad's undo stack.--dry-runprints the computed positions and changes nothing. Without--savethe edit lives only in the open editor. - For anything the helper doesn't cover, write a short kipy script following
references/ipc-api.md: positions are
Vector2in nm, wrap edits inbegin_commit()/push_commit(), thenupdate_items().
Verify
- DRC/ERC: re-run
drcafter a fix; the summary is the oracle. - Placement: run
drcafterwards (new positions often collide with existing parts), thenkicad_ipc.py list --jsonor read(footprint … (at X Y ROT))from the saved.kicad_pcb;rendergives a picture. - Fab: open the zip and check the layer list;
renderandkicad-cli pcb export svgfor visual checks.
References
- references/cli-reference.md: the kicad-cli 10 subcommands and flags used here
- references/ipc-api.md: kipy calls, units, commits, socket and SWIG fallback
- references/fab-presets.md: JLCPCB / generic layer, drill and column specs
- references/recipes.md: worked tasks end to end
- references/gotchas.md: measured traps and the security posture
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.

