From kicad-skills
Use when editing KiCad schematics or PCBs — adding/removing/modifying symbols, wires, labels, or footprints, or validating changes (ERC, netlist, DRC, baseline diff). Stage-1 functional workflow; pair with `kicad-tool` for commands. For visual/score polish use `kicad-sch-cleanup-loop` instead.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kicad-skills:kicad-workflowThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Editing **process** for KiCad files: planning, sequencing, validating. Owns the _how/when_; commands and CLI shape live in `kicad-tool` — read it first via the Skill tool. Project-specific facts (top-level path, sheet inventory, stackup, partitioning) live in the consuming repo's `hardware/` docs.
Editing process for KiCad files: planning, sequencing, validating. Owns the how/when; commands and CLI shape live in kicad-tool — read it first via the Skill tool. Project-specific facts (top-level path, sheet inventory, stackup, partitioning) live in the consuming repo's hardware/ docs.
| File | Approach |
|---|---|
.kicad_sch | kicad-tool sch query / sch edit |
.kicad_pcb | kicad-tool pcb edit when available; otherwise minimal local S-expr edits |
.kicad_pro | JSON edit only when needed; minimal |
.kicad_prl | Do not edit unless explicitly asked |
.kicad_sym | Keep in sync with the schematic's embedded lib_symbols when changing custom symbols (sch edit symbol add-pin does this automatically) |
If sch edit / pcb edit lacks a write subcommand, extend kicad-tool first. Raw Edit/Write on .kicad_sch/.kicad_pcb is the last resort and requires explicit user approval.
A wire can carry connections anywhere along its length — junctions, perpendicular wire endpoints, pin endpoints, label anchors — not only at its two endpoints. Endpoint-only stub replacement orphans mid-span taps; ERC misses it (the leftover junction keeps the count parity-clean).
Before any sch edit wire delete / replace:
sch query region).removed_nodes check is what actually catches this.This skill is stage 1: functional editing. Score / layout cleanup is stage 2 (kicad-sch-cleanup-loop).
Bird's-eye self-check, three zoom levels — one sentence each:
Then state and wait for approval:
Goal — what the design should do (design terms, not "add wires").
Problem — what's missing/wrong, citing specific symbols/nets/pins (via sch query).
Approach — proposed change + alternatives + why this one. Smallest unit that meets the goal.
Placement — for each new/moved symbol, which existing symbol or net it should sit near and why. Apply project electrical-design rules (grouping, partitioning, decoupling near supply pins).
Layout sketch (ASCII art) — required — show both the current and proposed local layout side-by-side. Coordinates are supplementary; the sketch is the primary artifact for the user to spot orientation/topology issues before any edit runs.
The sketch must show incident topology, not just symbol bodies: every wire stub off each drawn symbol, every junction in the bbox, every mid-span tap on shown wires. Distinguish real T-taps (perpendicular endpoint or co-located junction) from co-linear continuations (same-axis adjacent endpoint — not a tap). When adding to a group, copy one existing member's stubs into the proposed sketch (else the new pin↔rail stub gets forgotten and ERC fails unconnected). When deleting a wire, list every tap on it in the current sketch and how each is reconnected in the proposed.
Current: Proposed:
VCC VCC
│ │
●── U2.VCC ●── U2.VCC
│
─┴─ C99 100nF
│
●── GND
Skip only if (a) the user gave an exact single action ("move R5 to 100,50"), or (b) running under an autonomous-iteration context the user explicitly invoked. When in doubt, plan and wait.
Routine edits — one-shot validate is enough:
kicad-tool sch validate <top> --sheet <edited-child>
Non-trivial structural edits (wire delete/replace, hierarchy changes) — snapshot a baseline first to confirm connectivity, not just "ERC still passes":
kicad-tool sch validate <top> --save-baseline tmp/baseline # before
kicad-tool sch validate <top> --baseline tmp/baseline # after
Baseline diff exits non-zero on regression (new ERC errors, removed nets, removed nodes from existing nets).
Smallest change satisfying the request. Always pass --dry-run first via sch edit / pcb edit, then re-run without it.
Scope of stage 1: connectivity, nets, symbols, pins, values, hierarchy, ERC correctness. Do not chase sch inspect score, collisions, or wire-corner counts here — that is stage 2.
To spawn a new symbol instance: sch edit symbol add <sch> <lib_id> <REF> <X,Y> clones an existing same-lib_id sibling (unit 1, unmirrored) so lib_symbols stays consistent. For a lib_id that isn't yet embedded, pass --lib-file <library.kicad_sym> to import the definition and synthesize a fresh instance. For follow-up tweaks use sch edit symbol set-property (Value / Footprint / MPN) and sch edit symbol move (rotation / position).
To replace an existing symbol with a different lib_id (no direct command exists): sch edit symbol delete <REF> then sch edit symbol add <new_lib_id> <REF> <X,Y> [--lib-file ...]. Pin layout differs, so re-route the wires afterwards.
If the new edit happens to introduce obvious local mess (overlapping label, crossing wire) that blocks reading the diff, fix only that local mess. Anything broader belongs to the cleanup loop.
Re-run the validate / baseline command from step 1. When running stages individually:
git diff review: confirm Sheetfile references, net names, and that custom symbol changes appear in both embedded lib_symbols and the standalone .kicad_sym.sch inspect score is acceptable in stage 1 if connectivity is correct; do not chase it here.Stage 1 ends once ERC and netlist are correct. If the user wants score/layout tightening on the edited sheet, hand off to kicad-sch-cleanup-loop with the sheet path.
For .kicad_pcb:
layers, setup, setup.stackup, Edge.Cuts, title block — unless the task explicitly targets them.net, footprint, segment, via, zone.pcb drc after board edits; schematic/board parity is always included, and zones are always refilled + saved (kicad-cli does not refill on its own; stale fill = wrong report). Note it rewrites the .kicad_pcb. Read the resolved report path it prints (default is CWD-relative) and check the report's Created on line for freshness.Project-specific stackup and domain-separation rules live in the consuming repo's hardware/pcb/ docs.
ERC: pass (or: exit=N, same as before edit)
Netlist: intended changes only (or: identical / path-only diff)
Inspect: total=<score> collisions=<count>
PCB DRC: pass
On failure, include the failing stage, report path, and the first actionable issue:
FAIL: New ERC violation
See tmp/erc.rpt
First: ...
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub mash/kicad-skills --plugin kicad-skills