AI Flow: Routing
Public Made by Adomby adom
The routing stage of AI Flow: routes a placed KiCad board connection by connection and reports what it made, what it could not and why. A guide, never a gate.
| Name | Last updated |
|---|---|
| bin | 7h ago |
| docs | 7h ago |
| flows | 7h ago |
| screenshots | 7h ago |
| skills | 7h ago |
| src | 7h ago |
| .adomignore | 7h ago |
| build.sh | 7h ago |
| Cargo.lock | 7h ago |
| Cargo.toml | 7h ago |
| install.sh | 7h ago |
| LICENSE | 7h ago |
| package.json | 7h ago |
| page.json | 7h ago |
| README.md | 7h ago |
| SKILL.md | 7h ago |
| uninstall.sh | 7h ago |
AI Flow: Routing
The routing stage of AI Flow: adom-aiflow-routing takes a placed KiCad board, routes every
connection in the designer's hierarchy, and reports what it made, what it could not and why. It is
a whole-board router written in Rust with an exact 0/45/90 degree search, not a grid. adom-route
is the same program under its older name.
AI Flow: Routing is a dynamic skill
A dynamic skill is a small Rust binary that holds the AI's hand through a long job. It says
which step comes next, does the routine parts, checks the work with deterministic linters and
answers every command with hints. This app follows the same rules as AI Flow and every
adom-aiflow-<stage> app:
- The AI does about 97 % of the work. The binary is about 3 %. The binary is the guide and the checker. Reading the plan as a designer, finding the currents, deciding what to do about a connection that would not route and looking at the board belong to the AI.
- A guide, never a gate. No step is a hard gate.
nextsuggests what to do; no command checks that an earlier step ran or decides whether the AI may continue. - Linters give feedback, gently.
checkandroutereport what they found and suggest a next action. It is a suggestion, not a verdict: the AI and the human decide what to do with it. - It never tries to do the AI's job. It encodes no rule about what may happen next.
- The only error is "I could not run" (a board that will not parse, nowhere to write), and
that answer says what to try next. A board with open connections, a board with findings and a
failed test all answer
OK:with the facts andHint:lines.
Anyone changing this app should hold it to that: a new requirement, a mandatory field or a step that refuses is a sign the binary has started doing the AI's work.
Use
adom-wiki pkg install adom/adom-aiflow-routing
adom-aiflow-routing init --board placed.kicad_pcb --spec spec.json --ai-thread "<conversation>"
adom-aiflow-routing next # the suggested step and what to do in it
adom-aiflow-routing plan # how every net was sorted, and why
adom-aiflow-routing route # writes routing-flow/routed.kicad_pcb; the input is never changed
adom-aiflow-routing check # grades the routed board against the routing standards
adom-aiflow-routing steps # every step with its state
adom-aiflow-routing ledger # one line per command: time, AI thread, what happened
Every command answers OK: or ERROR: and then Hint: lines that depend on this board and this
run. A project keeps its state in <project>/routing-flow/: state.json, run.jsonl and the file
each step leaves. The verbs also work with no project: plan <board>, route <board> -o <out>,
check <board>, draw, compare, strip.
| Step | Its file | What the AI does |
|---|---|---|
| intake | state.json |
init on the placed board, with the spec if the design has one |
| plan | plan.txt |
reads how the nets were sorted; puts currents, pairs and priorities in the spec |
| route | routed.kicad_pcb |
route; reads why each open connection failed |
| check | check.json |
check, then KiCad's DRC with zones refilled |
| review | review.md |
looks at the board; decides and writes down what was done about each open item |
| handoff | handoff.json |
what the next stage needs: the board, what is open, what a person must decide |
The steps live in flows/flow.json; the skill is SKILL.md (also skills/adom-aiflow-routing/).
Results
22 boards from public wiki pages were stripped of their tracks and vias and routed again. A board counts as clean when every connection is made, KiCad reports 0 open, and KiCad finds no copper error that the original does not also have. KiCad's DRC ran with zones refilled, under each board's own rule values with clearance and open connections forced on.
| Boards clean in KiCad | |
|---|---|
| First run | 9 of 22 |
| Current revision | 19 of 22 |

Three benchmark boards are routed from bare before every change is kept:
| Board | Parts | Connections | KiCad errors beyond the original's | KiCad open |
|---|---|---|---|---|
| PiProbe v1.3 | 60 | 96 of 96 | 0 | 0 |
| Benchmark B | 113 | 107 of 107 | 0 | 0 |
| Benchmark C | 160 | 300 of 302 | 0 | 2 |
Not good yet: a two-layer power board with many small pours stops at 207 of 239 connections; a dense microcontroller board and a large receiver board each have 4 or 5 connections open; ground pads on some boards keep a single thermal spoke where KiCad wants two; at least one board does not come out identical on every run (see Build and test).
All-board run: every board beside its original
All-board run |
Each board was routed from bare and is pictured beside its original, with the connections KiCad reports open ringed in red. The all-board run shows where the router stands board by board, including the ones it does not finish. It also holds the run ledger and the lessons, one record per finding with the fix and how it was verified. Pictures, table and data |
How the router is built
It handles one connection at a time, in this order:
- Read and bind:
board.rs,rules.rs,project.rs - Classify nets into the routing hierarchy (pairs, data, power, the rest):
classify.rs - Plan the board coarsely, group buses and plan rated supply rails:
global.rs,bus.rs,power.rs - Route each connection with an exact 0/45/90 degree search:
router.rs,search.rs - Repair connections that failed, by moving lower-priority routes:
repair.rs - Post passes on finished copper:
post.rs,spread.rs,pour.rs - Check the result against the rules:
check.rs,current.rs,mask.rs - Guide: the steps, the project folder and the ledger:
flow.rs,flows/flow.json
Rules come from the board's .kicad_pro (net classes, clearances, minimums). A board with no
project file is routed to KiCad's own defaults. A spec (JSON) adds what the board file cannot say:
each supply rail's source, voltage and loads, and routing priorities.
Build and test
./build.sh # tests, release build, bin/adom-aiflow-routing
cargo test --release # unit tests only
adom-aiflow-routing fixtures <fixtures.json> # fast tests on your own reference boards
A fixture routes a few nets of one reference board alone and judges one behaviour: joined, clean of named rules, a width near a part, the voltage drop to a load, a via count, a pair's coupling. Changes to the router are kept only when the fixtures, three whole benchmark boards with KiCad's DRC, and the all-board run agree. The reference boards and their fixture files are not on this page; some unit tests read them and are skipped in spirit without them (they fail to find the file).
Every budget runs on a work clock (src/clock.rs): a "second" is a fixed amount of search work, not
wall time, so a result does not depend on how fast the machine is. Two runs of the same board are
meant to give the same file byte for byte. That does not hold on every board yet: on one public board
with ground pours, a run gives one of two slightly different results (one via and a few tracks apart).
Supply rails
src/power.rs plans each rail that has a current in the spec as a whole before any copper is
laid: a tree from the source with loads joined heaviest first, each branch's current, and each
branch's width as the larger of the current chart and its share of a 0.25 % voltage-drop limit. A
rail gives way to signals by changing layer, never by thinning. A rail with no current in the spec
is drawn at a 0.40 mm floor and plan says so.
What is on this page
| Path | What it is |
|---|---|
src/, Cargo.toml, Cargo.lock |
the source |
flows/flow.json |
the stage's steps |
SKILL.md, skills/adom-aiflow-routing/SKILL.md |
the skill |
LICENSE |
MIT |
bin/adom-aiflow-routing |
a Linux build of the current revision |
build.sh, install.sh, uninstall.sh |
build from source; install and uninstall hooks |
docs/results/ |
pictures and data from the run on public boards |
Board files are not stored here; the pictures in docs/results/ are renders of public boards.