# Kicad Layout

> >

- **Type:** Skill
- **Install:** `agentstack add skill-avatarsd-kiskill-kicad-layout`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [AvatarSD](https://agentstack.voostack.com/s/avatarsd)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [AvatarSD](https://github.com/AvatarSD)
- **Source:** https://github.com/AvatarSD/KiSkill/tree/main/skills/kicad-layout

## Install

```sh
agentstack add skill-avatarsd-kiskill-kicad-layout
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Headless layout / autorouting

Engine: `$(kx root)/kicad_lib/layout.py`
(python API: PYTHONPATH=; any freerouting-*-linux-x64 in .tools
is auto-detected, newest wins).
Worked end-to-end example: `tests/test_layout.py` (scratch board with
outline + 2 netted footprints → 9 routed segments).

## The chain

    layout.autoroute(pcb_in, pcb_out, passes=20)
      = dsn_export (pcbnew python in the KiCad flatpak:
                    pcbnew.ExportSpecctraDSN — headless, verified 10.0)
      → route      (.tools/freerouting-2.2.4-linux-x64/bin/freerouting,
                    BUNDLED JRE — no system java; classic CLI
                    -de in.dsn -do out.ses -mp N -da)
      → ses_import (pcbnew.ImportSpecctraSES + SaveBoard)

Returns segment/via counts. Bootstrap if .tools missing: download
freerouting-X-linux-x64.zip from github freerouting/freerouting
releases, unzip into .tools/ (no root needed).

## Preconditions (or DSN export is meaningless)

- Edge.Cuts outline present (closed).
- Pads carry nets. Update-PCB-from-Schematic normally fills them; when
  building boards programmatically, append `(net "NAME")` to each pad —
  pcb format 20260206 (KiCad 10) keys nets BY NAME, no numeric id (old
  `(net 1 "N1")` style is normalized on import, harmless).
- Placement matters more than the router: group by schematic function,
  decoupling caps adjacent, connectors at edges (rule canon).

## After routing — never skip

1. `kicad-cli pcb drc --severity-all` set-diff vs pre-route baseline.
2. Render F.Cu/B.Cu/Edge.Cuts → PNG → look (kicad-review pixel diff).
3. pcbnew rewrites the file wholesale on SES import — commit the
   pre-route board first, diff after.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [AvatarSD](https://github.com/AvatarSD)
- **Source:** [AvatarSD/KiSkill](https://github.com/AvatarSD/KiSkill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-avatarsd-kiskill-kicad-layout
- Seller: https://agentstack.voostack.com/s/avatarsd
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
