Skip to content
Back to skills

Kicad Fab Export

ASecurity

Generate a fab-ready manufacturing package from a KiCad 8/9/10 board in one command — Gerber + Excellon drill zip, BOM and pick-and-place (CPL/centroid) in JLCPCB or PCBWay format, optional STEP — and walk through the order settings. Use when the user wants to order or manufacture a PCB or PCBA, export Gerbers, make a BOM or CPL, or says ส่งโรงงาน, สั่งผลิต PCB, สั่งทำแผ่นปริ้น, ทำไฟล์ Gerber, ไฟล์ส่ง JLCPCB, ยิง SMT, ประกอบบอร์ด, ทำ BOM, ไฟล์ตำแหน่งชิ้นส่วน, even if they don't name kicad-cli.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 2, 2026
ai-agentspythongoc#bashgit

Works with

  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned October 2, 2026

npx -y skills add Boom-Vitt/kicad-thai --skill kicad-fab-export --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Kicad Fab Export?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Kicad Fab Export
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/boom-vitt-kicad-fab-export/badge)](https://www.skillsdirectory.com/skills/boom-vitt-kicad-fab-export)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: kicad-fab-export
description: Generate a fab-ready manufacturing package from a KiCad 8/9/10 board in one command — Gerber + Excellon drill zip, BOM and pick-and-place (CPL/centroid) in JLCPCB or PCBWay format, optional STEP — and walk through the order settings. Use when the user wants to order or manufacture a PCB or PCBA, export Gerbers, make a BOM or CPL, or says ส่งโรงงาน, สั่งผลิต PCB, สั่งทำแผ่นปริ้น, ทำไฟล์ Gerber, ไฟล์ส่ง JLCPCB, ยิง SMT, ประกอบบอร์ด, ทำ BOM, ไฟล์ตำแหน่งชิ้นส่วน, even if they don't name kicad-cli.
---

# KiCad fab export (Gerber, drill, BOM, CPL)

Reply in Thai when the user writes Thai. Run the checks first: exporting a
board that fails DRC just ships the mistake. If `kicad-check` hasn't passed
with the fab's preset in this session, run it before exporting.

## One command

```bash
python3 "<skill>/scripts/export_fab.py" path/to/project.kicad_pro --fab jlcpcb
python3 "<skill>/scripts/export_fab.py" path/to/project.kicad_pro --fab pcbway
python3 "<skill>/scripts/export_fab.py" path/to/project.kicad_pro --fab generic --no-assembly
```

Output goes to `fab/` next to the project (`-o DIR` to change) and a JSON
summary is printed. Source `.kicad_*` files are never modified.

| File | What it is |
|---|---|
| `<name>-gerbers.zip` | all copper layers found in the board + paste, silk, mask, Edge.Cuts, Excellon drill (mm, decimal) + drill map — upload this |
| `<name>-bom-<fab>.csv` | grouped BOM. JLCPCB: `Comment, Designator, Footprint, LCSC Part #`. PCBWay: their quote template columns |
| `<name>-cpl-<fab>.csv` | `Designator, Val, Package, Mid X, Mid Y, Rotation, Layer` in mm, rotation 0–359 |
| `<name>.step` | with `--step`, for the mechanical/enclosure designer |

Options: `--no-assembly` (bare PCB, no BOM/CPL), `--step`,
`--rot PATTERN=DEG` (see below), `--kicad-cli PATH`.

## BOM fields: set them in the schematic

The BOM comes from symbol fields, so fix data in the schematic, not in the CSV:

- **JLCPCB assembly** needs an LCSC part number (`C` + digits) per line. The script
  reads the first non-empty of these fields: `LCSC`, `LCSC Part`, `LCSC Part #`,
  `LCSC#`, `JLCPCB Part #`, `JLC`. Lines without one are listed in `warnings`.
- **PCBWay / Thai EMS** quote from `Manufacturer` + `MPN`; add both.
- Parts that must not be fitted: set **Do not populate (DNP)** in symbol
  properties. DNP parts, power symbols and "exclude from BOM" parts are left out.
- Identical parts are grouped by Value + Footprint + part number, designators
  listed in full (`R1,R2,R10`) because fabs can't parse ranges like `R1-R3`.
- Unannotated symbols (`R?`) stop the export. Parts in the BOM but not on the
  board, or with a different footprint on the board, are listed in `warnings`:
  the schematic and the board are out of sync — fix with Update PCB from Schematic (F8).

## CPL rotations (the classic JLCPCB problem)

KiCad's footprint zero orientation and the assembler's library don't always
agree (common with SOT-23, SOT-223, QFN, some diodes and connectors). Export, upload,
and check the fab's placement preview. For every part shown rotated wrong, add
a correction and export again:

```bash
python3 "<skill>/scripts/export_fab.py" board.kicad_pro --fab jlcpcb --rot "SOT-23*=180" --rot "*QFN*=90"
```

`PATTERN` is a glob on the footprint name (Package column), first match wins;
the degrees are added to KiCad's rotation for top-side parts and subtracted for
bottom-side parts (they are seen mirrored). Write down the corrections that worked
in the project README so the next order uses them. Bottom-side parts are
the other usual suspect: check them in the preview separately.

## Ordering

Order-form settings and fab-specific notes for JLCPCB, PCBWay and Thai local
fabs: [references/fab-houses.md](references/fab-houses.md). Before the user
pays, summarise: layers, size, thickness, finish, quantity, assembly side(s),
number of BOM lines without part numbers, and anything that changes price
(castellated holes, impedance control, ENIG, odd colours).

For where to manufacture in Thailand, import VAT on parcels from China and
local parts sources, use **thai-pcb-sourcing**.

## Manual commands (if the script can't be used)

```bash
kicad-cli pcb export gerbers -o fab/gerbers/ --layers F.Cu,B.Cu,F.Paste,B.Paste,F.SilkS,B.SilkS,F.Mask,B.Mask,Edge.Cuts --subtract-soldermask board.kicad_pcb
kicad-cli pcb export drill -o fab/gerbers/ --format excellon --excellon-units mm --excellon-zeros-format decimal --excellon-separate-th --generate-map --map-format gerberx2 board.kicad_pcb
kicad-cli sch export bom -o fab/bom.csv --fields "Value,Reference,Footprint,LCSC" --labels "Comment,Designator,Footprint,LCSC Part #" --group-by "Value,Footprint,LCSC" --ref-range-delimiter "" --string-delimiter '"' --exclude-dnp board.kicad_sch
kicad-cli pcb export pos -o fab/pos.csv --side both --format csv --units mm --exclude-dnp board.kicad_pcb
```

Add `In1.Cu,In2.Cu,…` to `--layers` for multilayer boards. If a copper layer
has a user name (`(0 "F.Cu" signal "top_layer")` in the board file), also list
that name — kicad-cli 8/9 silently skip it otherwise — and count the copper
Gerbers in the output before uploading. On KiCad 10 add `--check-zones` to the
Gerber command; on 8/9 refill zones (B) and save first.

Files in this skill

  • SKILL.md5.3 KB
  • references/fab-houses.md2.9 KB
  • scripts/export_fab.py16 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.