
New and improved zefir btn
brunostjohn/flatmaxxing
a tiny little CLI that helps you make all the files needed to manufacture PCBs at home

a tiny little CLI that helps you make all the files needed to manufacture PCBs at home
Bad origin is an open-source printed circuit board by brunostjohn, from the brunostjohn/flatmaxxing repository on GitHub, published under the WTFPL licence. It is a 2-layer board of 42.5 × 25 mm with 19 parts on 20 nets, routed with 189 tracks and 0 vias.
It is built around the ATMEGA32U4-AU and ATMEGA32U4-MU. Its parts include 6 capacitors, 2 resistors and 2 ICs. It belongs with the AVR (ATmega, ATtiny) boards of this library.
flatmaxx takes a finished KiCad board and drives your entire home-fab bench for you: it generates Gerbers and drill files, plans isolation milling and non-copper-clearing G-code with FlatCAM, sorts every hole into the bit you actually own, prints solder-mask negatives and cuts solder-paste stencils on the xTool machines, drills plated/non-plated holes and cuts the board outline on a Makera CNC, and even works out the electroplating bath recipe. All of it runs from a single command behind a live terminal UI.
[!NOTE] This tool is built around one specific bench: a Makera Carvera (Air) CNC, xTool M1 Ultra / F1 Ultra lasers, and a DIY copper electroplating setup. It's shared as-is. Nothing stops you using it, but you'll want to retune the config to your own hardware, tools, and chemistry before trusting the output to a machine.
[!CAUTION] This project is provided strictly AS IS, with NO SUPPORT of any kind.
- No tech support. Issues opened to ask for help, setup assistance, or troubleshooting will not be answered and may be closed without comment.
- No bug guarantees. Even legitimate bug reports may never get a response or a fix. Don't assume one is coming.
- No warranty. Nothing here is promised to work, to keep working, or to be safe for your hardware, your materials, or you. You run it at your own risk.
This is a hobby project I share for free in my spare time. I have a full-time job and a life, and I'm not interested in spending my free time doing unpaid tech support; I don't want my hobby to become my job. If that's a problem for you, don't use this.
Pull requests with fixes are welcome, but I make no commitment to review, respond to, or merge them.
flatmaxx ships as a single, codesigned macOS arm64 (Apple Silicon) binary. Pick whichever install path you prefer.
brew tap brunostjohn/flatmaxxing https://github.com/brunostjohn/flatmaxxing
brew trust flatmaxx
brew install flatmaxxUpgrade later with brew upgrade flatmaxx.
Downloads the latest release into ~/.local/bin, checksum-verified, using only standard macOS tools:
curl -fsSL https://raw.githubusercontent.com/brunostjohn/flatmaxxing/main/scripts/install.sh | shIf ~/.local/bin isn't on your PATH, the script prints the exact line to add. Pin a version with FLATMAXX_VERSION=1.2.3, or change the target with FLATMAXX_INSTALL_DIR=.... Installed this way, flatmaxx update upgrades in place (see Updating).
flatmaxx builds with Bun, the only thing you need.
git clone https://github.com/brunostjohn/flatmaxxing flatmaxx
cd flatmaxx
bun install
bun run build:native # compile the native macOS accessibility moduleRun it straight from source:
bun src/index.ts <kicad-project>Or build the standalone, codesigned binary at dist/flatmaxx:
bun run build
./dist/flatmaxx <kicad-project>If you installed via the script (or any binary in a writable location), upgrade in place:
flatmaxx update # check for and install the latest release, with a progress bar
flatmaxx update --check # only report whether a newer release existsHomebrew installs are managed by brew; run brew upgrade flatmaxx instead.
flatmaxx <project> runs every stage from board validation to machine-ready files.extends inheritance, deep merge, and per-run CLI overrides.flatmaxx runs an ordered pipeline. Each stage feeds the next; you can disable the ones you don't need from config. If you don't have a Mac, or you want to know what each machine actually does to the board, HOW_THIS_WORKS.md walks the whole physical process with real parameters so you can replicate it with your own tools.
| # | Stage | Consumes | Produces | Driven via |
|---|---|---|---|---|
| 1 | Preflight | config | software & permission check | doctor checks |
| 2 | Validate board | .kicad_pcb | manufacturability report | kicadts |
| 3 | KiCad outputs | .kicad_pcb | Gerbers, drills, SVG, PNG + inline preview | kicad-cli |
| 4 | Categorize drills | Excellon | per-bit drill files | Excellon parser |
| 5 | Isolation DRC | Gerbers | clearance violations | FlatCAM (headless) |
| 6 | CNC jobs | Gerbers | isolation + NCC G-code (Carvera) | FlatCAM (headless) |
| 7 | Alignment drills | .kicad_pcb | registration holes | Excellon |
| 8 | Edge-cut DXFs | .kicad_pcb | *-PTH_EdgeCuts.dxf, *-Final_EdgeCuts.dxf | DXF generator |
| 9 | Electroplating report | board bounds + recipe | bath dimensions & timing | — |
| 10 | xTool projects | mask SVG + stencil DXF | solder mask + paste stencil jobs | xTool Studio (CDP) |
| 11 | Plated holes | PTH DXF + drills | drilling + plating outline G-code | MakeraCAM (AX) |
| 12 | Final cut | Final DXF + drills | non-plated drilling + edge contour | MakeraCAM (AX) |
[!IMPORTANT] macOS only. The laser and CNC stages rely on native macOS Accessibility automation and AppleScript, so
flatmaxxdoes not run on Linux or Windows.
External software (only the stages you enable need their tools):
| Tool | Needed for | Default location |
|---|---|---|
KiCad (with kicad-cli) | always (board parsing & exports) | /Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli |
| FlatCAM | isolation DRC + CNC G-code | flatcam (on PATH) |
| xTool Studio | solder mask + paste stencil | /Applications/xTool Studio.app |
| MakeraCAM | drilling + edge cut | /Applications/MakeraCAM.app |
The xTool and MakeraCAM stages also require macOS Accessibility permission (System Settings → Privacy & Security → Accessibility) and a Chrome DevTools port open for xTool Studio (127.0.0.1:9333 by default).
[!TIP] Run
flatmaxx doctor <project>before your first real build. It checks every required executable, app, and permission for your enabled stages and tells you exactly what's missing, without touching a machine.
Initialize a config in your KiCad project, then build:
flatmaxx init # create flatmaxxing.toml for the current project
flatmaxx ~/projects/myboard # run the full pipeline| Command | What it does |
|---|---|
flatmaxx <project> | Creates CNC files from a KiCad project (same as build). |
flatmaxx build <project> | Explicit form of the root command. |
flatmaxx init | Creates a flatmaxxing.toml config for the current project. |
flatmaxx config | Opens an interactive editor for project config overrides. |
flatmaxx config --user | Edits the shared ~/flatmaxxing.user.toml. |
flatmaxx skills install [--global] | Installs the flatmaxxing agent skill into the project (or for the current user with --global). |
flatmaxx doctor <project> | Checks required software and permissions; generates nothing. |
flatmaxx validate <project> --fix | Runs validation only, without launching FlatCAM, xTool Studio, or MakeraCAM. |
flatmaxx clean <project> [--dry-run] | Removes (or lists) generated output folders. |
flatmaxx update [--check] | Updates flatmaxx in place to the latest GitHub release (script / binary installs; use brew upgrade for Homebrew). |
# Use an explicit config file
flatmaxx build . --config flatmaxxing.toml
# Override any config value for a single run
flatmaxx build . --set cnc.isolation.feedRate=150
# Point at a custom kicad-cli executable
flatmaxx ~/projects/myboard -k /opt/kicad/kicad-cli
# Check the board and config without launching any apps
flatmaxx validate . --fix
# See what clean would delete, without deleting it
flatmaxx clean . --dry-runflatmaxx reads a flatmaxxing.toml in the project, layered over a shared ~/flatmaxxing.user.toml. Configs can pull in others via extends, are deep-merged (later wins), and any value can be overridden per run with --set path=value / --unset path.
Rather than hand-writing the whole file, run flatmaxx init to scaffold one, then flatmaxx config for an interactive editor. Every option, with its default value and allowed values, is documented in flatmaxxing.example.toml. A representative slice covering your real tooling and isolation parameters:
extends = ["~/flatmaxxing.user.toml"]
[board]
file = "myboard.kicad_pcb" # auto-detected if omitted
[cnc]
availableDrills = [
{ diameter = 0.4 }, { diameter = 0.5 }, { diameter = 0.7 },
{ diameter = 0.8 }, { diameter = 1.0 }, { diameter = 1.2 },
]
availableMills = [
{ diameter = 0.7 }, { diameter = 1.0 }, { diameter = 1.5 },
]
[cnc.isolation]
feedRate = 120
spindleSpeed = 15000
zCutDepth = 0.05
tool = { type = "vbit", diameter = 0.14, angle = 60 }
passes = 3
overlap = 60dependencies (tool paths) · paths (output folders) · board · alignmentDrills · electroplating (container + recipe) · solderMask · stencil · drills · place · cnc (isolation, nonCopperClearing, clearance, backside, drilling, availableDrills, availableMills) · xtool · makeracam · validation (ranges + feasibility gates).
A full run writes machine-ready files into your project (folders are configurable under [paths]):
myboard/
├── gerbers/ # KiCad Gerber + edge-cut DXF exports
├── drills/ # categorized Excellon drill files (one per bit)
├── gcodes/ # isolation + non-copper-clearing G-code (Carvera)
├── dxf/ # board outline DXFs
├── png/ # rendered board & mask images
├── svg/ # vector solder-mask art
├── xtool/ # xTool Studio projects (solder mask + stencil)
└── cnc/ # MakeraCAM projects + exported drilling/contour G-codeThe electroplating bath report (dimensions, current density, timing, chemistry) is generated alongside.
flatmaxx runs on an Ink UI: a live, hierarchical task list shows every stage and substep with spinners, progress bars, and inline error detail. When your terminal supports it (kitty, iTerm2, or sixel), the rendered board image is drawn directly in the scrollback so you can eyeball the layout before any machine moves.
bun run dev # build native + run against the bundled testdir/ project
bun test # run the test suite
bun run typecheck # type-check with tsgo
bun run format # format with BiomeThe codebase is built on Effect v4 and follows the conventions in CLAUDE.md; the native macOS accessibility bindings live in the Rust workspace under native/.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | 0.1uF | Capacitor_SMD:C_0805_2012Metric | C3, C4, C5, C6 |
| 3 | Fiducial | Fiducial:Fiducial_1mm_Mask2mm | FID1, FID2, FID3 |
| 2 | 10k | Resistor_SMD:R_0805_2012Metric | R1, R3 |
| 2 | 1uF | Capacitor_SMD:C_0805_2012Metric | C1, C2 |
| 1 | 3V3 | TestPoint:TestPoint_Pad_3.0x3.0mm | TP2 |
| 1 | ATmega32U4-A | Package_QFP:TQFP-44_10x10mm_P0.8mm | U1 |
| 1 | ATmega32U4-M | Package_DFN_QFN:QFN-44-1EP_7x7mm_P0.5mm_EP5.2x5.2mm | U2 |
| 1 | GND | TestPoint:TestPoint_Pad_3.0x3.0mm | TP3 |
| 1 | MISO | TestPoint:TestPoint_Pad_3.0x3.0mm | TP4 |
| 1 | MOSI | TestPoint:TestPoint_Pad_3.0x3.0mm | TP5 |
| 1 | RESET | TestPoint:TestPoint_Pad_3.0x3.0mm | TP1 |
| 1 | SCK | TestPoint:TestPoint_Pad_3.0x3.0mm | TP6 |
It measures 42.5 × 25 mm and has 2 copper layers, 1.6 mm thick.
19 parts, built around the ATMEGA32U4-AU and ATMEGA32U4-MU. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the brunostjohn/flatmaxxing repository on GitHub, at the commit this page was made from: the board is testdir/bad_origin.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the WTFPL licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

brunostjohn/flatmaxxing
a tiny little CLI that helps you make all the files needed to manufacture PCBs at home

MelindaBirkenstock/melmicro
This is a drop-in pro micro replacement for any board that accepts a pro micro. The name is a misonmer as the "melmicro" is actually usb-c. # MelMicro supports both qfn and qfp mcus, i'm not liable for anything.




FreeYourStream/freedeck-hardware
all the stuff you need to build your own FreeDeck

xyphro/UsbGpib
Versatile, cheap and portable USB to GPIB converter (USBTMC class based)


Dakkaron/Fairberry
The goal of this project is to add a BlackBerry Q10 keyboard to non-BlackBerry phones. While this can easily be adapted to suit any other phone with an USB port at the bottom, I will focus on releasing files for the…