with one click
Analyze a DFM report and fix all issues in the PCB generation scripts
npx skills add https://github.com/pjcau/esp32-emu-turbo --skill dfm-fixCopy and paste this command into Claude Code to install the skill
Analyze a DFM report and fix all issues in the PCB generation scripts
npx skills add https://github.com/pjcau/esp32-emu-turbo --skill dfm-fixCopy and paste this command into Claude Code to install the skill
Full PCB verification loop using local kicad-cli (DRC + 3D render + gerbers)
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
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 | dfm-fix |
| model | claude-opus-4-7 |
| description | Analyze a DFM report and fix all issues in the PCB generation scripts |
| disable-model-invocation | true |
| allowed-tools | Bash, Read, Write, Edit, Grep, Glob, WebFetch, WebSearch |
| argument-hint | <path-to-dfm-report> (PDF, CSV, or text file) |
Analyze a DFM report (from JLCPCB or other manufacturer) and systematically fix all issues.
Argument: Path to the DFM report file (PDF, CSV, text, or image screenshot).
Read the file provided as argument: $ARGUMENTS
If it's a PDF, read it with the Read tool (supports PDF). If it's an image/screenshot, read it with the Read tool (supports images). If it's a CSV or text file, read it normally.
Parse and categorize all DFM issues into:
| Category | Severity | Example |
|---|---|---|
| Silkscreen-to-pad | DANGER | Text overlapping SMD pads |
| Silkscreen-to-hole | DANGER | Text overlapping drill holes |
| Soldermask bridge | DANGER | Mask gap between close pads too small |
| Trace clearance | ERROR | Traces too close together |
| Via annular ring | ERROR | Via ring too small for manufacturing |
| Component spacing | WARNING | Components too close for pick-and-place |
| Rotation mismatch | WARNING | 3D model doesn't align with pads |
Print a summary table with counts per category.
For each issue, identify which source file controls it:
| Issue Type | Source File | Function/Section |
|---|---|---|
| Silkscreen text layer | scripts/generate_pcb/board.py | _component_placeholders() |
| Silkscreen labels | scripts/generate_pcb/board.py | _silkscreen_labels() |
| Mounting hole text | scripts/generate_pcb/primitives.py | mounting_hole() |
| Component positions | scripts/generate_pcb/board.py | _component_placeholders() |
| Component spacing | scripts/generate_pcb/board.py | placement coordinates |
| Trace clearance | scripts/generate_pcb/routing.py | trace segments |
| Via sizes | scripts/generate_pcb/routing.py | _via_net() calls |
| Soldermask | scripts/generate_pcb/footprints.py | pad definitions |
| CPL rotation | scripts/generate_pcb/jlcpcb_export.py | _JLCPCB_ROT_OVERRIDES |
| CPL position | scripts/generate_pcb/jlcpcb_export.py | _JLCPCB_POS_CORRECTIONS |
For each issue, in order of severity (DANGER first):
After all fixes:
cd /Users/pierrejonnycau/Documents/WORKS/esp32-emu-turbo
python3 -m scripts.generate_pcb hardware/kicad
python3 scripts/verify_dfm_v2.py
For each fix, add a test to scripts/verify_dfm_v2.py to prevent recurrence.
See /dfm-test skill for details on adding guard tests.
Print a final report:
| # | Issue | Severity | Fix Applied | File Changed |
|---|---|---|---|---|
| 1 | ... | DANGER | Moved text to Fab | board.py |
| 2 | ... | WARNING | Increased spacing | board.py |
See dfm-reference.md in this skill directory for known issue patterns and their solutions.
scripts/generate_pcb/board.py — Component placement, silkscreen labels, text layersscripts/generate_pcb/routing.py — Trace routing, via sizesscripts/generate_pcb/footprints.py — Footprint pad/mask definitionsscripts/generate_pcb/primitives.py — Mounting holes, board elementsscripts/generate_pcb/jlcpcb_export.py — CPL rotation/position correctionsscripts/verify_dfm_v2.py — Verification tests (update after fixes)