ki-stack-orient
Preamble (run first)
Run this before choosing a KiCad workflow:
KI_STACK_DIR="${KI_STACK_DIR:-skills/ki-stack}"
"$KI_STACK_DIR/bin/ki-stack-update-check" 2>/dev/null || true
"$KI_STACK_DIR/bin/kicad-project-find" . 2>/dev/null | sed -n '1,80p' || true
"$KI_STACK_DIR/bin/kicad-version" 2>/dev/null || true
"$KI_STACK_DIR/bin/kicad-python-smoke" 2>/dev/null || true
Read these when the task touches the area:
skills/ki-stack/ETHOS.md
skills/ki-stack/references/version-matrix.md
skills/ki-stack/references/render-recipes.md
skills/ki-stack/references/ipc-recipes.md
skills/ki-stack/references/ipc-board-workflows.md
skills/ki-stack/references/file-editing-recipes.md
Stack Rules
- PCB editor interaction or current selection: use
kicad-python IPC.
- Render, import/export, DRC, ERC, fabrication, 3D outputs: use
kicad-cli.
- Schematic/library/project file edits: use
kicad-skip, kiutils-rs, or another structured parser. Do not hand-roll S-expression edits when a parser fits.
- Parts search and KiCad-ready vendor artifacts: check
https://pcbparts.dev/ early.
- File format truth: use KiCad developer file-format docs at
https://dev-docs.kicad.org/en/file-formats/.
- No success claim without evidence: artifact path, DRC/ERC output, changed file list, or script output.
Completion Status
DONE: completed and verified.
DONE_WITH_CONCERNS: completed but proof is partial, version-limited, or blocked by pre-existing issues.
BLOCKED: prerequisite unavailable or command failed after a concrete attempt.
NEEDS_CONTEXT: target file, object, board session, or intended result is unclear.
Purpose
This is the first skill for KiCad work. It makes the agent stop guessing and quickly answer:
- What KiCad files are present?
- What KiCad version and CLI are available?
- Are Python IPC bindings installed?
- Is a live KiCad board reachable?
- Which substrate should do the work?
Decision Table
| User intent |
First route |
Why |
| Current board, selected items, interactive PCB editor state |
ki-stack-live / ki-stack-pcb with kicad-python |
IPC sees the open editor and selection. |
| Move/inspect/update footprints, tracks, vias, zones, layers |
ki-stack-pcb with kicad-python |
This is PCB editor interaction. |
| Render board/schematic/symbol/footprint |
ki-stack-render with kicad-cli |
Deterministic visual artifact. |
| DRC/ERC, fabrication, 3D, BOM/netlist/export/import/upgrade |
ki-stack-verify or ki-stack-render with kicad-cli |
The CLI already owns these flows. |
| Schematic/project/library text-variable or symbol metadata edit |
ki-stack-file-surgery with kicad-skip or kiutils-rs |
Structured file edit beats raw S-expression surgery. |
| Need a new part, JLC/LCSC/CSE artifact, KiCad symbol/footprint |
Search https://pcbparts.dev/ first |
Parts search is a solved external data problem. |
| Unsure what a token means |
KiCad file-format docs |
https://dev-docs.kicad.org/en/file-formats/ is source of truth. |
CLI Surface To Remember
kicad-cli covers much more than render:
api-server: headless IPC server on newer KiCad.
fp: footprint export and upgrade.
gerber: convert, diff, inspect Gerber files.
jobset: run .kicad_jobset outputs.
pcb: DRC, import, upgrade, render, export.
sch: ERC, upgrade, BOM, netlist, PDF/SVG/PNG/DXF/HPGL/PostScript.
sym: symbol export and upgrade.
version: version info.
High-value PCB exports:
- fabrication: Gerber, drill, position, IPC-D-356, IPC-2581, ODB++, GenCAD.
- documentation: PDF, SVG, PNG, DXF, HPGL, PostScript, statistics.
- 3D/mechanical: STEP, STEPZ, STL, GLB, VRML, PLY, U3D, BREP, XAO, 3D PDF.
Orient Commands
KI_STACK_DIR="${KI_STACK_DIR:-skills/ki-stack}"
"$KI_STACK_DIR/bin/kicad-project-find" .
"$KI_STACK_DIR/bin/kicad-version"
"$KI_STACK_DIR/bin/kicad-python-smoke"
"$KI_STACK_DIR/bin/kicad-python-smoke" connect
If connect fails, do not force IPC. Use the error to decide:
- import failed: install or fix
kicad-python.
- connect failed: KiCad GUI/API server not reachable.
- board failed: KiCad reachable but no board open.
Evidence Contract
Before ending a KiCad task, produce at least one:
- rendered artifact path
- DRC/ERC JSON path and pass/fail summary
- IPC script output
- structured parser output or changed file diff
- part-search source URL or artifact path
Completion
Report:
KI-STACK ORIENT
Files: <found files or none>
KiCad: <version or unavailable>
IPC: <import/connect/board status>
Route: <live|cli|file-edit|parts-search|ask>
Next skill: <skill name>
Status: DONE|DONE_WITH_CONCERNS|BLOCKED|NEEDS_CONTEXT
1---2name: ki-stack-orient3description: First-stop KiCad orientation skill. Use when starting any KiCad task, when the right substrate is unclear, when locating project files, when checking KiCad CLI or Python IPC availability, or when deciding between live IPC, kicad-cli, structured file edits, and parts search.4license: MIT5---6<!-- AUTO-GENERATED from SKILL.md.tmpl. Regenerate with scripts/gen-skill-docs. -->78# ki-stack-orient910## Preamble (run first)1112Run this before choosing a KiCad workflow:1314```bash15KI_STACK_DIR="${KI_STACK_DIR:-skills/ki-stack}"16"$KI_STACK_DIR/bin/ki-stack-update-check" 2>/dev/null || true17"$KI_STACK_DIR/bin/kicad-project-find" . 2>/dev/null | sed -n '1,80p' || true18"$KI_STACK_DIR/bin/kicad-version" 2>/dev/null || true19"$KI_STACK_DIR/bin/kicad-python-smoke" 2>/dev/null || true20```2122Read these when the task touches the area:2324- `skills/ki-stack/ETHOS.md`25- `skills/ki-stack/references/version-matrix.md`26- `skills/ki-stack/references/render-recipes.md`27- `skills/ki-stack/references/ipc-recipes.md`28- `skills/ki-stack/references/ipc-board-workflows.md`29- `skills/ki-stack/references/file-editing-recipes.md`3031## Stack Rules3233- PCB editor interaction or current selection: use `kicad-python` IPC.34- Render, import/export, DRC, ERC, fabrication, 3D outputs: use `kicad-cli`.35- Schematic/library/project file edits: use `kicad-skip`, `kiutils-rs`, or another structured parser. Do not hand-roll S-expression edits when a parser fits.36- Parts search and KiCad-ready vendor artifacts: check `https://pcbparts.dev/` early.37- File format truth: use KiCad developer file-format docs at `https://dev-docs.kicad.org/en/file-formats/`.38- No success claim without evidence: artifact path, DRC/ERC output, changed file list, or script output.3940## Completion Status4142- `DONE`: completed and verified.43- `DONE_WITH_CONCERNS`: completed but proof is partial, version-limited, or blocked by pre-existing issues.44- `BLOCKED`: prerequisite unavailable or command failed after a concrete attempt.45- `NEEDS_CONTEXT`: target file, object, board session, or intended result is unclear.4647## Purpose4849This is the first skill for KiCad work. It makes the agent stop guessing and quickly answer:50511. What KiCad files are present?522. What KiCad version and CLI are available?533. Are Python IPC bindings installed?544. Is a live KiCad board reachable?555. Which substrate should do the work?5657## Decision Table5859| User intent | First route | Why |60| --- | --- | --- |61| Current board, selected items, interactive PCB editor state | `ki-stack-live` / `ki-stack-pcb` with `kicad-python` | IPC sees the open editor and selection. |62| Move/inspect/update footprints, tracks, vias, zones, layers | `ki-stack-pcb` with `kicad-python` | This is PCB editor interaction. |63| Render board/schematic/symbol/footprint | `ki-stack-render` with `kicad-cli` | Deterministic visual artifact. |64| DRC/ERC, fabrication, 3D, BOM/netlist/export/import/upgrade | `ki-stack-verify` or `ki-stack-render` with `kicad-cli` | The CLI already owns these flows. |65| Schematic/project/library text-variable or symbol metadata edit | `ki-stack-file-surgery` with `kicad-skip` or `kiutils-rs` | Structured file edit beats raw S-expression surgery. |66| Need a new part, JLC/LCSC/CSE artifact, KiCad symbol/footprint | Search `https://pcbparts.dev/` first | Parts search is a solved external data problem. |67| Unsure what a token means | KiCad file-format docs | `https://dev-docs.kicad.org/en/file-formats/` is source of truth. |6869## CLI Surface To Remember7071`kicad-cli` covers much more than render:7273- `api-server`: headless IPC server on newer KiCad.74- `fp`: footprint export and upgrade.75- `gerber`: convert, diff, inspect Gerber files.76- `jobset`: run `.kicad_jobset` outputs.77- `pcb`: DRC, import, upgrade, render, export.78- `sch`: ERC, upgrade, BOM, netlist, PDF/SVG/PNG/DXF/HPGL/PostScript.79- `sym`: symbol export and upgrade.80- `version`: version info.8182High-value PCB exports:8384- fabrication: Gerber, drill, position, IPC-D-356, IPC-2581, ODB++, GenCAD.85- documentation: PDF, SVG, PNG, DXF, HPGL, PostScript, statistics.86- 3D/mechanical: STEP, STEPZ, STL, GLB, VRML, PLY, U3D, BREP, XAO, 3D PDF.8788## Orient Commands8990```bash91KI_STACK_DIR="${KI_STACK_DIR:-skills/ki-stack}"92"$KI_STACK_DIR/bin/kicad-project-find" .93"$KI_STACK_DIR/bin/kicad-version"94"$KI_STACK_DIR/bin/kicad-python-smoke"95"$KI_STACK_DIR/bin/kicad-python-smoke" connect96```9798If `connect` fails, do not force IPC. Use the error to decide:99100- import failed: install or fix `kicad-python`.101- connect failed: KiCad GUI/API server not reachable.102- board failed: KiCad reachable but no board open.103104## Evidence Contract105106Before ending a KiCad task, produce at least one:107108- rendered artifact path109- DRC/ERC JSON path and pass/fail summary110- IPC script output111- structured parser output or changed file diff112- part-search source URL or artifact path113114## Completion115116Report:117118```text119KI-STACK ORIENT120Files: <found files or none>121KiCad: <version or unavailable>122IPC: <import/connect/board status>123Route: <live|cli|file-edit|parts-search|ask>124Next skill: <skill name>125Status: DONE|DONE_WITH_CONCERNS|BLOCKED|NEEDS_CONTEXT126```