Create a KiCad schematic with components placed and nets labelled, starting from a high-level spec (MCU + peripherals list). Resolves symbols from the user's configured library paths (see `kstack_config`) — typically a personal symbol folder, KiCad 9 stock libraries, or a downloaded-parts staging area. Consults a knowledge graph of past designs for pin conventions and footprint history. Generates a ready-to-open KiCad 9.0 project. Invoke for: "create a schematic for STM32 + RS485", "generate a KiCad project with ESP32 and optocoupler", "new board for this MCU and these parts", "assemble a schematic with these components".
You are creating a KiCad schematic project. Follow these steps exactly.
Check Kstack config. Run:
python3 ~/.claude/skills/common/kstack_config.py show
If any path marked ✗ is needed for this request (e.g. prasad_dir missing
but user asked for a part that's only there), tell the user and offer:
python3 ~/.claude/skills/common/kstack_config.py init
If the user has never run init, always offer it first. Paths resolved there become defaults for every subsequent command.
Ask where the project goes. Unless the user already named a folder, ask: "Is this a new project or should I extend an one? Which directory?"
<kicad_projects_dir>/<project_name>/.kicad_pro already there
and they didn't mean to overwrite, stop and confirm.Pass the answer via --out <DIR> and --mode {new|existing|auto}.
auto (default) decides based on whether the target .kicad_pro exists
and prints which mode it chose.
| Key | Default | Purpose |
|---|---|---|
kicad_projects_dir | ~/Documents/kicad | parent of each project folder |
prasad_dir | ~/Documents/PRASAD/05326/Footprint | personal sym/fp folder |
stock_symbols_dir | /usr/share/kicad/symbols | KiCad 9 stock syms |
stock_footprints_dir | /usr/share/kicad/footprints | KiCad 9 stock .pretty |
knowledge_dir | ~/kc/kicad-knowledge | mined knowledge graph |
edgecut_lib | ~/kc/kicad-edgecuts/lib | board-outline library |
fp_index_path | ~/kc/kicad-footprints/index.yaml | footprint history |
download_dir | ~/Documents/footprints | freshly downloaded parts |
If knowledge_dir is empty (no past projects mined), the generator still
works — it just can't suggest historical pin conventions; footprints
then resolve via (a) the symbol's Footprint property, (b) the stock .pretty
libs via ki_fp_filters.
Parse the user's request into:
STM32F103C8T6, ESP32-WROOM-32)If the request is vague ("STM32 with RS485"), infer the most common variant
from the knowledge graph (rs485/sn65hvd → SN65HVD3082EDR).
For each peripheral, read its block YAML from
<knowledge_dir>/blocks/<role>.yaml (e.g. rs485_sn65hvd.yaml).
Resolve <knowledge_dir> with
python3 ~/.claude/skills/common/kstack_config.py path knowledge_dir.
Look at mcu_connections[].per_project to find which MCU pins were
historically used with this peripheral. Use the per_project entry that
matches the closest MCU or project. This tells you which MCU pins to wire.
Also print the peripheral's pin names to plan the connection mapping:
python3 ~/.claude/skills/kicad-assemble/kicad_sch_gen.py \
--list-pins SN65HVD3082EDR
Match MCU pins to peripheral pins using UART/SPI conventions:
ls "$(python3 ~/.claude/skills/common/kstack_config.py path prasad_dir)/<PartName>/"
If the directory (or a .kicad_sym file) exists → symbol is available.
If not → mark it as MISSING, handle in Step 4.
For any part not found in PRASAD, use the browse skill to find the KiCad symbol file:
.kicad_sym (and .kicad_mod if footprint also needed).<download_dir>/<PartName>/ (resolve with
kstack_config.py path download_dir).DL="$(python3 ~/.claude/skills/common/kstack_config.py path download_dir)"
python3 ~/.claude/skills/kicad-lib-add/kicad_lib_add.py \
"$DL/<PartName>" --kicad-version 9.0
Write a design.yaml to /tmp/<project_name>_design.yaml: