with one click
Full PCB verification loop using local kicad-cli (DRC + 3D render + gerbers)
npx skills add https://github.com/pjcau/esp32-emu-turbo --skill checkCopy and paste this command into Claude Code to install the skill
Full PCB verification loop using local kicad-cli (DRC + 3D render + gerbers)
npx skills add https://github.com/pjcau/esp32-emu-turbo --skill checkCopy and paste this command into Claude Code to install the skill
Create a new Claude Code skill for this project. Use when you need to add a new skill, improve an existing skill, or convert a workflow into a reusable skill.
Verifies that every PCB pad-to-net assignment matches the manufacturer datasheet pin specifications. Use when changing board.py/routing.py/footprints.py, after GPIO remapping, before releases, or when adding new components. Automated guard against wiring errors like unconnected VBUS, wrong pin assignments, or missing GND connections.
Design intent adversary — cross-checks GPIO, nets, power chains, signal paths across firmware/schematic/PCB/datasheet sources to find lost connections and inconsistencies
Analyze a DFM report and fix all issues in the PCB generation scripts
Run DFM guard tests and add new regression tests after fixing PCB issues
Scan all documentation against source-of-truth files (config.py, board_config.h, routing.py, BOM, PCB) and report/fix outdated values. Use after PCB changes, GPIO remapping, BOM updates, or before releases.
| name | check |
| model | claude-opus-4-7 |
| description | Full PCB verification loop using local kicad-cli (DRC + 3D render + gerbers) |
| disable-model-invocation | true |
| allowed-tools | Bash, Read, Grep, Glob, Edit, Write |
Complete modify → generate → verify → render cycle using local tools. No JLCPCB upload needed.
cd /Users/pierrejonnycau/Documents/WORKS/esp32-emu-turbo
python3 -m scripts.generate_pcb hardware/kicad
kicad-cli pcb drc \
--output /tmp/drc-report.json \
--format json \
--severity-all \
--units mm \
--all-track-errors \
hardware/kicad/esp32-emu-turbo.kicad_pcb
Parse the JSON output and summarize violations by type:
import json
from collections import Counter
with open('/tmp/drc-report.json') as f:
data = json.load(f)
types = Counter()
for v in data.get('violations', []):
types[v['type']] += 1
for v in data.get('unconnected_items', []):
types['unconnected'] += 1
for t, c in types.most_common():
print(f" {t:30s} {c:4d}")
Known acceptable violations (generated PCB has no net assignments on pads):
shorting_items ~200: traces near unnetted pads (false positive — nets not assigned in generated PCB)solder_mask_bridge ~199: fine-pitch FPC/USB-C (expected, JLCPCB handles this)hole_clearance ~178: via-in-pad for buttons (intentional)via_dangling ~50: zone-connected vias (not dangling in practice)track_dangling ~24: zone-connected tracksReal violations to fix (track these numbers — they should decrease):
clearance: trace-to-pad spacing violationscopper_edge_clearance: traces too close to board edge / FPC slotsilk_over_copper: silkscreen text overlapping exposed coppersilk_edge_clearance: silkscreen near board edgesilk_overlap: overlapping silkscreen textmkdir -p /tmp/pcb-renders
# Top view (front side — buttons, LEDs, display area)
kicad-cli pcb render \
--output /tmp/pcb-renders/top.png \
--side top --width 2400 --height 1200 --quality basic \
hardware/kicad/esp32-emu-turbo.kicad_pcb
# Bottom view (back side — ESP32, ICs, connectors)
kicad-cli pcb render \
--output /tmp/pcb-renders/bottom.png \
--side bottom --width 2400 --height 1200 --quality basic \
hardware/kicad/esp32-emu-turbo.kicad_pcb
# Isometric view
kicad-cli pcb render \
--output /tmp/pcb-renders/iso.png \
--side top --width 2400 --height 1200 --quality basic \
--perspective --rotate '-45,0,45' \
hardware/kicad/esp32-emu-turbo.kicad_pcb
Read the rendered images to visually inspect the PCB layout.
rm -rf hardware/kicad/gerbers && mkdir -p hardware/kicad/gerbers
kicad-cli pcb export gerbers \
--output hardware/kicad/gerbers/ \
--layers "F.Cu,In1.Cu,In2.Cu,B.Cu,F.Paste,B.Paste,F.SilkS,B.SilkS,F.Mask,B.Mask,Edge.Cuts" \
--subtract-soldermask --use-drill-file-origin \
hardware/kicad/esp32-emu-turbo.kicad_pcb
kicad-cli pcb export drill \
--output hardware/kicad/gerbers/ \
--format excellon --drill-origin plot \
--excellon-units mm --generate-map --map-format gerberx2 \
hardware/kicad/esp32-emu-turbo.kicad_pcb
cd hardware/kicad/gerbers && zip -j ../jlcpcb/gerbers.zip *.gtl *.g1 *.g2 *.gbl *.gto *.gbo *.gts *.gbs *.gtp *.gbp *.gm1 *.drl
python3 scripts/verify_dfm_v2.py
cp hardware/kicad/jlcpcb/bom.csv release_jlcpcb/bom.csv
cp hardware/kicad/jlcpcb/cpl.csv release_jlcpcb/cpl.csv
rm -rf release_jlcpcb/gerbers
cp -r hardware/kicad/gerbers release_jlcpcb/gerbers
cp hardware/kicad/jlcpcb/gerbers.zip release_jlcpcb/gerbers.zip
After running all steps, present results as:
| Check | Result | Count/Detail |
|---|---|---|
| PCB generation | OK/FAIL | — |
| KiCad DRC clearance | X violations | (should be 0) |
| KiCad DRC copper_edge | X violations | (should be 0) |
| KiCad DRC silk issues | X violations | (should be 0) |
| Custom DFM tests | X/21 pass | — |
| 3D render top | [image] | visual check |
| 3D render bottom | [image] | visual check |
| Command | Purpose |
|---|---|
kicad-cli pcb drc | Design Rules Check (JSON/report) |
kicad-cli pcb render | 3D render to PNG (top/bottom/iso) |
kicad-cli pcb export gerbers | Export Gerber files |
kicad-cli pcb export drill | Export drill/Excellon files |
kicad-cli pcb export pos | Export component position file |
kicad-cli pcb export svg | Export layers to SVG |
kicad-cli pcb export pdf | Export layers to PDF |
kicad-cli pcb export step | Export 3D STEP model |
kicad-cli sch erc | Schematic Electrical Rules Check |