원클릭으로
fix-rotation
Investigate and fix JLCPCB CPL rotation for a component using mathematical pin alignment analysis
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Investigate and fix JLCPCB CPL rotation for a component using mathematical pin alignment analysis
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
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
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
| name | fix-rotation |
| model | claude-opus-4-7 |
| description | Investigate and fix JLCPCB CPL rotation for a component using mathematical pin alignment analysis |
| disable-model-invocation | true |
| allowed-tools | Bash, Read, Grep, Glob, Write, Edit |
| argument-hint | <REF> (e.g. U5) |
Mathematically analyze and fix the JLCPCB CPL rotation for a component.
Argument: Component reference designator (e.g., U5).
Read these files to collect component info:
release_jlcpcb/bom.csv — get LCSC part number and footprintrelease_jlcpcb/cpl.csv — get current position, rotation, layerscripts/generate_pcb/footprints.py — get pad positions and sizesscripts/generate_pcb/board.py — get placement (x, y, rot, layer)scripts/generate_pcb/jlcpcb_export.py — get current override/correctionFor each pad in the footprint:
footprints.pyVerify by reading actual pad positions from hardware/kicad/esp32-emu-turbo.kicad_pcb.
For common packages:
For each JLCPCB CPL rotation (0, 90, 180, 270):
JLCPCB convention (bottom-side):
x' = x*cos(a) + y*sin(a), y' = -x*sin(a) + y*cos(a)Compare transformed model positions with gerber pad positions. Compute max error.
Print an ASCII table:
Rotation | Max Error | Pin 1 Match | Status
---------|-----------|-------------|-------
0 | 9.1mm | NO | MISMATCH
90 | 0.0mm | YES | ALIGN <-- CPL
180 | 9.1mm | NO | MISMATCH
270 | 0.0mm | YES | ALIGN (mirrored)
Use SW11 (bottom, rot=90) as reference:
Create 4 test CPL files:
cd /Users/pierrejonnycau/Documents/WORKS/esp32-emu-turbo
for rot in 0 90 180 270; do
cp release_jlcpcb/cpl.csv release_jlcpcb/cpl_${REF,,}_rot${rot}.csv
# Replace the rotation value for this component
done
Update scripts/generate_pcb/jlcpcb_export.py:
_JLCPCB_ROT_OVERRIDES = {
"REF": RECOMMENDED_ROTATION,
}
Then regenerate: python3 -m scripts.generate_pcb hardware/kicad
Update scripts/verify_dfm_v2.py to expect the new rotation value.
scripts/generate_pcb/jlcpcb_export.py — _JLCPCB_ROT_OVERRIDES, _JLCPCB_POS_CORRECTIONSscripts/generate_pcb/footprints.py — get_pads(), _pre_rotate_element(), _mirror_pad_x()scripts/generate_pcb/board.py — _component_placeholders()scripts/verify_dfm_v2.py — test_u5_pin_alignment()release_jlcpcb/cpl.csv — Current CPLFor bottom-side components, JLCPCB 3D viewer applies:
Our generic formula:
rot = (rot - 180) % 360 # mirror correction for bottom
rot = (rot + correction) % 360 # per-footprint DB correction
Per-footprint corrections (JLCKicadTools DB):