PCB Design Audit
Target: $ARGUMENTS
Run KiCad design rule checks and export manufacturing outputs.
References (MUST READ)
Read these before proceeding:
references/kicad-cli-reference.md— DRC/ERC commands, JSON output schema, gerber/BOM export
Workflow
Detect kicad-cli — Verify
kicad-cliis available, report versionFind project files — Glob for
*.kicad_pro,*.kicad_sch,*.kicad_pcbRun ERC on schematic:
kicad-cli sch erc --output erc-report.json --format json <schematic.kicad_sch>Run DRC on PCB:
kicad-cli pcb drc --output drc-report.json --format json <pcb.kicad_pcb>Parse JSON reports — Categorize violations by severity (error/warning/exclusion)
If clean (no errors), export manufacturing outputs:
- Gerbers:
kicad-cli pcb export gerbers --output gerbers/ <pcb.kicad_pcb> - Drill:
kicad-cli pcb export drill --output gerbers/ <pcb.kicad_pcb> - BOM:
kicad-cli sch export bom --output bom.csv <schematic.kicad_sch>
- Gerbers:
Generate findings report at
docs/pcb-audit-report.md
Output Format
# PCB Audit Report: <Project Name>
## Tool Version
kicad-cli <version>
## ERC Results
- Errors: N
- Warnings: N
- <violation description> @ <sheet:component>
## DRC Results
- Errors: N
- Warnings: N
- <violation description> @ <coordinates>
## Manufacturing Outputs
- [ ] Gerbers exported to gerbers/
- [ ] Drill files exported to gerbers/
- [ ] BOM exported to bom.csv
## Recommendations
...
Rules
- Never export gerbers if DRC has unresolved errors
- Report all warnings even if they are excluded in KiCad
- Include exact coordinates/references for every DRC/ERC finding
- Do not modify KiCad project files — this is a read-only audit