tscircuit/kicadts ? reverse-engineered prompt

Reverse engineered prompt

Build me a TypeScript library for working with KiCad files, so I can create, read, and edit schematics, PCB boards, and footprints from code.

I want the main API to feel simple and natural, with classes for the common KiCad things like symbols, wires, nets, pads, footprints, sheets, and title blocks. It should be easy to load an existing KiCad file, change a few fields, and write it back out without breaking the format. It also needs to generate clean KiCad compatible text with consistent formatting every time.

Please include a few examples that show how to make a schematic, a PCB, and a standalone footprint, then save them to disk. Add tests that prove the files round trip correctly and still match KiCad style well. Use the current Bun based setup, and look up the latest KiCad file format details online if you need to.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab