一键导入
pcb-components
Component placement operations — place, move, rotate, align, array (KiCAD MCP tools 14-23)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Component placement operations — place, move, rotate, align, array (KiCAD MCP tools 14-23)
用 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 | pcb-components |
| model | claude-opus-4-7 |
| description | Component placement operations — place, move, rotate, align, array (KiCAD MCP tools 14-23) |
| disable-model-invocation | true |
| allowed-tools | Bash, Read, Write, Edit, Grep, Glob |
| argument-hint | ["list | place <ref> | move <ref> <x> <y> | rotate <ref> <angle> | align"] |
Map KiCAD MCP component placement tools to our project's programmatic PCB generation.
Component placement is managed in scripts/generate_pcb/board.py via the _component_placeholders() function (line 251+). All components are defined with reference designator, position (x, y), rotation, layer, footprint, and value. The board uses enclosure-center coordinates converted to PCB top-left origin via enc_to_pcb(ex, ey).
Layout convention:
cd /Users/pierrejonnycau/Documents/WORKS/esp32-emu-turbo && python3 -c "
from scripts.generate_pcb.board import _component_placeholders
comp_str, placements = _component_placeholders()
for ref, (x, y, rot, layer) in sorted(placements.items()):
print(f'{ref:8s} x={x:7.2f} y={y:7.2f} rot={rot:5.1f} {layer}')
"
Depending on the argument:
list: Show all components with positions, rotations, and layers (use the command above).
place <ref>: Add a new component entry to _component_placeholders() in scripts/generate_pcb/board.py. Each entry needs:
R15)enc_to_pcb(ex, ey)F.Cu or B.Cu)scripts/generate_pcb/footprints.pymove <ref> <x> <y>: Change the enc_to_pcb(ex, ey) coordinates for the component in board.py.
rotate <ref> <angle>: Change the rotation value for the component in board.py. Note: JLCPCB CPL rotation corrections are in scripts/generate_pcb/jlcpcb_export.py.
align: Check component alignment against the grid and ensure no overlapping courtyard areas.
After changes, regenerate the PCB:
cd /Users/pierrejonnycau/Documents/WORKS/esp32-emu-turbo && python3 -m scripts.generate_pcb hardware/kicad
cd /Users/pierrejonnycau/Documents/WORKS/esp32-emu-turbo && python3 scripts/verify_dfm_v2.py
| File | Purpose |
|---|---|
scripts/generate_pcb/board.py | Component placements (_component_placeholders() at line 251), board outline, mounting holes |
scripts/generate_pcb/footprints.py | Footprint pad definitions (geometry, pin assignments) |
scripts/generate_pcb/pad_positions.py | Pad position computation (get_all_pad_positions(), get_pad()) |
scripts/generate_pcb/jlcpcb_export.py | CPL rotation corrections for JLCPCB assembly |
hardware/kicad/esp32-emu-turbo.kicad_pcb | Generated PCB output |
board.py constants (e.g., DPAD_ENC = (-62, 5)).enc_to_pcb(ex, ey).| MCP Tool | Our Implementation |
|---|---|
place_component | Add entry to _component_placeholders() in board.py |
move_component | Edit (x, y) coordinates in board.py |
rotate_component | Edit rotation value in board.py |
delete_component | Remove entry from _component_placeholders() in board.py |
edit_component | Modify ref/value/footprint in board.py |
get_component_properties | Read board.py + footprints.py for a specific reference |
get_component_list | Parse all placements from _component_placeholders() |
place_component_array | Add multiple entries with calculated positions in board.py |
align_components | Check/fix component alignment in board.py |
duplicate_component | Copy entry with new reference designator in board.py |
hardware/kicad/esp32-emu-turbo.kicad_pcb directly -- it is a generated file.MOUNT_HOLES_ENC (6x M2.5 holes).enc(47, 2) is a 3x24mm no-go zone -- do not place components there.