main
Caleb Publish 0.2.0 cbe04a0 8h ago

name: adom-aiflow-routing description: >- The routing stage of AI Flow: takes a placed KiCad board (.kicad_pcb with its .kicad_pro) and routes every connection in the designer's hierarchy (pairs, data, power, the rest), then reports what it made, what it could not and why, graded against the routing standards and ready for KiCad's DRC. A dynamic skill: it suggests the next step and never blocks. Use when asked to route a board, autoroute a PCB, finish the routing, route the remaining nets, check a routed board against the routing standards, compare a routed board with a reference, or why a connection would not route. Trigger words: route the board, autoroute, adom-route, adom-aiflow-routing, routing stage, unrouted nets, ratsnest, differential pair routing, power rail width, routing check, strip and reroute.

adom-aiflow-routing

The routing stage of AI Flow. adom-route is the same program under its older name.

What a dynamic skill is (read this first)

adom-aiflow-routing is a dynamic skill: a small Rust binary that holds your hand through the job. It tells you which step comes next, does the routine parts (the search, the bookkeeping, the checks) and answers every command with hints.

  • You are about 97 % of the flow. The binary is about 3 %. It is the guide and the checker; the thinking and the work are yours: reading the plan as a designer, finding the currents, deciding what to do about a connection that would not route, looking at the board.
  • It is never a hard gate, at any step. next names a suggested step. No command checks that an earlier one ran. Take another route when you have a better one, and say what you did and why.
  • Findings are gentle suggestions. check and route report what they saw and offer a next action. Weigh it, fix what is real, carry on. You and the human decide.
  • It does not do your job. It encodes no rule about what you may do next, so a better model loses nothing by using it.
  • Its only error is "I could not run" (a file that is missing or 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 fixture all answer OK: with the facts and hints.

When you change this app, keep it this way: add hints and checks that report, never requirements, mandatory fields or steps that refuse.

Use

Run adom-aiflow-routing next whenever you are unsure what to do. Every command answers OK: or ERROR: and then Hint: lines that depend on this board and this run. In a project, every command adds a line to <project>/routing-flow/run.jsonl.

adom-aiflow-routing init --board <placed.kicad_pcb> [--spec <spec.json>] --ai-thread <you>
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        # what was run, by whom, when

The verbs also work with no project: plan <board>, route <board> -o <out>, check <board>, draw <board> -o <svg> [--window x0,y0,x1,y1] [--highlight net,net], compare <board> <reference>, strip <board> -o <out>.

The steps

Step Its file What you do
intake state.json init on the placed board, with the spec if the design has one
plan plan.txt read how the nets were sorted; put currents, pairs and priorities in the spec
route routed.kicad_pcb route; read why each open connection failed
check check.json check, then KiCad's DRC with zones refilled
review review.md look at the board; decide and write down what you did about each open item
handoff handoff.json what the next stage needs: the board, what is open, what a person must decide

What matters

  • KiCad is the judge. Run its DRC with zones refilled (kicad-cli pcb drc --refill-zones) against the board's own project on the routed file. A project can turn clearance or open connections down to a warning or carry exclusions; judge with those checks on, and report the designer's own exceptions rather than hiding them.
  • Look at the board. draw writes a picture; put it beside the reference or the earlier revision and show the human, with the open places marked. A count is a claim, a picture is evidence.
  • Supply rails need a current. With no spec a rail is drawn at the 0.40 mm floor. A spec entry per rail (rails, by net name: sources, volts, amps and loads by part) lets the power stage plan its tree and size each branch by current and voltage drop. A rail the board makes itself is rated by its regulator. A rail the board only receives is sized by the draw of the parts that take it: look in the prompt and on those parts' wiki pages and datasheets. When nothing says, ask the human for the expected draw; do not guess it from a name or a pad.
  • A fixture mounted on the board keeps its side clear. Where screw holes take a fixture, the copper layer that touches the fixture carries no tracks under it other than ground, wherever the board allows. The router does not know a hole is for a fixture: find that in the prompt or the design notes, check the routed board for it, and say what you found in the review.
  • An open connection has a reason. route prints it: walled in by pads or fills, out of search budget, held by a protected route. Moving a part or giving a rail its current often does more than more time.
  • Local pad rules are proposals. Where no track fits a pad under its class clearance, the router writes a rule beside the output (.kicad_dru) and marks it REVIEW. It is the human's to accept.
  • The input board is never changed. Every result is a new file.

Debug switches

ADOM_ROUTE_TRACE=1 prints every search. ADOM_ROUTE_SNAP_FAIL=<file> with ADOM_ROUTE_SNAP_PAD=<U2.19> writes the board as it stood when that pad's connection first failed. ADOM_ROUTE_DEBUG_VIA=x,y prints what the checker sees round one via.