app
KiCad - the KiCad Bridge
Public Made by Adomby adom
Reference implementation of the KiCad bridge: multi-instance Python server, forward path via kicad-cli, reverse path via in-process plugin. Most complex of the three bundled bridges.
← Commit history
autorouting guide: Freerouting and Claude Fable 5.1 routing videos recorded on arav-rog, the fixture, and the Codex Astra prompt
7 files changed
+176
docs/autorouting-astra-prompt.mdadded+34@@ -0,0 +1,34 @@+# Prompt for Codex Astra: record your own routing take and send it back++Paste everything below the line into Codex (GPT-6 Astra) in Hydrogen. It produces a screen recording of Astra routing the same six-net fixture the guide uses, publishes the video, and files a wiki issue on adom/kicad-bridge so the bridge's maintainer thread sees it and can add it to the guide.++---++You are GPT-6 Astra in Codex inside Hydrogen. John wants a video of you routing a KiCad board through the Adom KiCad Bridge's AI routing verbs, as a companion to the two recordings on the bridge's autorouting guide. Do all of it yourself and finish by posting a wiki issue with the video link. Do not ask John to do any step you can do.++Read first:+- The guide: https://wiki.adom.inc/adom/kicad-bridge/files/docs/autorouting.md (the section "Live run on ConfRoomROG" and the videos).+- Install the skills so you have the verb contracts: `adom-wiki skills install adom/kicad-bridge`, then read the kicad-bridge and kicad-autorouting skills.++The board: the six-net fixture from the guide, 13 pads on three footprints, NET_6 branched (J1.6 to J2.6 with a spur to J3.1), two copper layers. Fetch it with+`curl -sLo live-routing.kicad_pcb https://wiki.adom.inc/api/pages/adom/kicad-bridge/files/docs/autorouting/live-routing.kicad_pcb`+and send it to the desktop with `adom-bridge --ai-thread "<your thread name>" --target <box> send_files {"filePaths":["<container path>"],"dest":"C:/Users/<user>/Downloads/adom-gate/astra-routing","reason":"..."}`.++Rules that are not optional:+1. Ask John which desktop to use (`adom-bridge targets` lists them) and confirm with `kicad_status` that its kicad-bridge is 1.0.2 or newer and KiCad is 10.0.1 or newer. Pass `--ai-thread` on every call.+2. Never save the fixture, never route on any other board, never install Freerouting (this take is the AI engine only), never kill KiCad. If KiCad is running, `kicad_close {}` first and stop if it reports unsaved work.+3. `kicad_ipc_api {}` must say enabled. If it does not, enable it with KiCad closed.+4. Open the board on screen: `kicad_open_board {"filePath": B, "foreground": true, "foregroundReason": "John asked for a screen recording of Astra routing; the canvas must be on screen for the recorder"}`. Maximize it with `desktop_ui_window {"hwnd": H, "action": "maximize"}`. Wait until the status bar no longer says "Loading Footprint Libraries". About 25 seconds after opening, the bridge's etiquette loop pushes a newly opened window behind the user's windows once; bring it back with `desktop_bring_to_front {"hwnd": H, "reason": "..."}` and it stays. Take `desktop_screenshot_screen {}` and look at it: the board must be visible and the canvas must not be white before you record.+5. Record the monitor, not the window: `desktop_record_start {"monitor": 0, "audio": false, "fps": 30, "reason": "Astra routing video"}`. Window-mode capture shows a white canvas for KiCad's OpenGL surface.+6. Route with the AI engine: `kicad_routing_state {"filePath": B}` for the revision, pads and nets. Plan every trace yourself from the pad positions; do not copy the waypoints in the guide. Land each net with `kicad_route_net {"filePath": B, "expectedRevision": R, "net": "NET_n", "points": [...], "width": 0.25}` (use `paths` for the branched NET_6, and change layer with a via on at least one net). Pause about 1.5 seconds between nets so a viewer sees each one land. Finish with `kicad_routing_validate {"filePath": B}`; it must report `errors: 0` and `unconnected: 0`. If a call returns `drc_rejected`, fix the plan and try again; that is part of the video.+7. `desktop_record_stop {"recordingId": ...}`, then `pull_file` the MP4 into the container. Check it: extract frames with ffmpeg at 2 s, mid-take and the end, and confirm the traces are visible. Transcode to 1920 wide H.264 (`ffmpeg -i in.mp4 -vf scale=1920:-2 -c:v libx264 -crf 22 -pix_fmt yuv420p -movflags +faststart -an out.mp4`) and make a poster frame.+8. Publish the video on the adom/codex page: `adom-wiki repo push adom/codex --files docs/videos/astra-routing-six-net.mp4 docs/videos/astra-routing-six-net-poster.jpg -m "Astra routing video: six-net fixture through kicad_route_net"`, then confirm `curl -s -o /dev/null -w "%{http_code}" https://wiki.adom.inc/api/pages/adom/codex/files/docs/videos/astra-routing-six-net.mp4` prints 200.+9. File the issue so the kicad-bridge thread gets it:+```+adom-wiki issue create adom/kicad-bridge --category show-and-tell \+ --title "Astra routing video: the six-net fixture through kicad_route_net" \+ --body "<video URL>, the poster URL, the desktop name, KiCad and bridge versions, the per-net kicad_route_net results (items, revision, drc), the kicad_routing_validate output, the exact commands you ran, and what a viewer should look for in the video. No em dashes."+```+10. Close KiCad with `kicad_close {"discardChanges": true}` (the fixture is throwaway) and tell John the issue URL and the video URL.++The kicad-bridge maintainer thread watches that issue tracker and will add your video next to the Freerouting and Claude Fable 5.1 takes on the guide.
docs/autorouting.md+22@@ -4,6 +4,28 @@ The Adom KiCad Bridge routes a board two ways, and the user picks. The AI engine The short version for the AI lives in the [kicad-autorouting skill](../skills/kicad-autorouting/SKILL.md). The nine IPC routing verbs and their regression demo are in [demo/routing/README.md](../demo/routing/README.md). +## Watch both engines on camera++Recorded on arav-rog (KiCad 10.0.3, bridge 1.0.2, 2026-09-12) from the desktop's own monitor, with the PCB editor brought to the front on the idle box. The banner across the top of the canvas is Adom Bridge's recording notice, which stays visible for the whole take so the person at the desk always knows the screen is being captured.++**Freerouting, 12 s.** One `kicad_autoroute {"engine":"freerouting"}` call: DSN written, Freerouting run headless, nine segments landed as native Undo steps, DRC clean.++<video width="100%" controls poster="/blob/app/kicad-bridge/docs/videos/routing-freerouting-poster.jpg">+ <source src="/blob/app/kicad-bridge/docs/videos/routing-freerouting.mp4" type="video/mp4"></video>++[Watch the Freerouting take](https://wiki.adom.inc/api/pages/adom/kicad-bridge/files/docs/videos/routing-freerouting.mp4)++**Claude Fable 5.1, 38 s.** Six `kicad_route_net` calls, one per net, each a native Undo step with a snapshot DRC before it lands: NET_3 changes layer through two vias, NET_6 is the branched net with the spur to J3, and the DRC's "missing connection" count walks down from six to zero as the nets land. `kicad_routing_validate` at the end: 0 errors, 0 unconnected.++<video width="100%" controls poster="/blob/app/kicad-bridge/docs/videos/routing-fable-5-1-poster.jpg">+ <source src="/blob/app/kicad-bridge/docs/videos/routing-fable-5-1.mp4" type="video/mp4"></video>++[Watch the Claude Fable 5.1 take](https://wiki.adom.inc/api/pages/adom/kicad-bridge/files/docs/videos/routing-fable-5-1.mp4)++**GPT-6 Astra in Codex.** A third take is Astra's to make: [the prompt to paste into Codex](autorouting-astra-prompt.md) has Astra route the same fixture, publish its video on the adom/codex page and file a show-and-tell issue on this page so the video gets added here.++The fixture both takes use is [live-routing.kicad_pcb](https://wiki.adom.inc/api/pages/adom/kicad-bridge/files/docs/autorouting/live-routing.kicad_pcb).+ ## What Freerouting is, and why it is optional - **Who made it.** Freerouting was written by Alfons Wirtz in 2004 as a shape-based autorouter and open-sourced in 2014. Since 2018 it has been maintained by Andras Bodor at [freerouting.org](https://www.freerouting.org/) and [github.com/freerouting/freerouting](https://github.com/freerouting/freerouting), GPL-3.0. It is not a KiCad project; KiCad removed its own autorouter years ago and points users at Freerouting through the Specctra DSN and SES files both sides understand.
docs/autorouting/live-routing.kicad_pcbadded+120@@ -0,0 +1,120 @@+(kicad_pcb+ (version 20260206)+ (generator "pcbnew")+ (generator_version "10.0")+ (general+ (thickness 1.6)+ (legacy_teardrops no)+ )+ (paper "A4")+ (layers+ (0 "F.Cu" signal)+ (2 "B.Cu" signal)+ (9 "F.Adhes" user "F.Adhesive")+ (11 "B.Adhes" user "B.Adhesive")+ (13 "F.Paste" user)+ (15 "B.Paste" user)+ (5 "F.SilkS" user "F.Silkscreen")+ (7 "B.SilkS" user "B.Silkscreen")+ (1 "F.Mask" user)+ (3 "B.Mask" user)+ (17 "Dwgs.User" user "User.Drawings")+ (19 "Cmts.User" user "User.Comments")+ (21 "Eco1.User" user "User.Eco1")+ (23 "Eco2.User" user "User.Eco2")+ (25 "Edge.Cuts" user)+ (27 "Margin" user)+ (31 "F.CrtYd" user "F.Courtyard")+ (29 "B.CrtYd" user "B.Courtyard")+ (35 "F.Fab" user)+ (33 "B.Fab" user)+ (39 "User.1" user)+ (41 "User.2" user)+ (43 "User.3" user)+ (45 "User.4" user)+ )+ (setup+ (pad_to_mask_clearance 0)+ (allow_soldermask_bridges_in_footprints no)+ (tenting+ (front yes)+ (back yes)+ )+ (covering+ (front no)+ (back no)+ )+ (plugging+ (front no)+ (back no)+ )+ (capping no)+ (filling no)+ (pcbplotparams+ (layerselection 0x00000000_00000000_55555555_5755f5ff)+ (plot_on_all_layers_selection 0x00000000_00000000_00000000_00000000)+ (disableapertmacros no)+ (usegerberextensions no)+ (usegerberattributes yes)+ (usegerberadvancedattributes yes)+ (creategerberjobfile yes)+ (dashed_line_dash_ratio 12)+ (dashed_line_gap_ratio 3)+ (svgprecision 4)+ (plotframeref no)+ (mode 1)+ (useauxorigin no)+ (pdf_front_fp_property_popups yes)+ (pdf_back_fp_property_popups yes)+ (pdf_metadata yes)+ (pdf_single_document no)+ (dxfpolygonmode yes)+ (dxfimperialunits yes)+ (dxfusepcbnewfont yes)+ (psnegative no)+ (psa4output no)+ (plot_black_and_white yes)+ (sketchpadsonfab no)+ (plotpadnumbers no)+ (hidednponfab no)+ (sketchdnponfab yes)+ (crossoutdnponfab yes)+ (subtractmaskfromsilk no)+ (outputformat 1)+ (mirror no)+ (drillshape 1)+ (scaleselection 1)+ (outputdirectory "")+ )+ )+ (embedded_fonts no)+(footprint "RoutingFixture:J1" (layer "F.Cu") (uuid "f0ee1342-6de1-49d5-9dd0-8c2e0c3a94fd") (at 105 85)+(property "Reference" "J1" (at 0 -3) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))+(property "Value" "ROUTING_TEST" (at 0 -5) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))+(attr through_hole exclude_from_pos_files exclude_from_bom)+(pad "1" thru_hole circle (at 0 0) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_1") (uuid "c4debea7-7a1c-4510-961a-75936713429a"))+(pad "2" thru_hole circle (at 0 5) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_2") (uuid "26857158-10c9-4b85-871d-1180c4f33266"))+(pad "3" thru_hole circle (at 0 10) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_3") (uuid "83d30b97-11f8-4f35-b603-ade6b2be68bb"))+(pad "4" thru_hole circle (at 0 15) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_4") (uuid "732f2dd5-26f1-43fc-97f6-46650245af65"))+(pad "5" thru_hole circle (at 0 20) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_5") (uuid "849bd0a9-da0e-419e-a651-2a4ee58174fd"))+(pad "6" thru_hole circle (at 0 25) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_6") (uuid "57d0d949-42a6-4cc3-9c86-ba3c118ed308"))+)+(footprint "RoutingFixture:J2" (layer "F.Cu") (uuid "351d7052-ef87-40dc-9c47-986b283efec4") (at 145 85)+(property "Reference" "J2" (at 0 -3) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))+(property "Value" "ROUTING_TEST" (at 0 -5) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))+(attr through_hole exclude_from_pos_files exclude_from_bom)+(pad "1" thru_hole circle (at 0 0) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_1") (uuid "deb59ad4-c04b-4042-bdfe-ca4f139081c7"))+(pad "2" thru_hole circle (at 0 5) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_2") (uuid "29eea1f9-d443-4b3e-b6fb-9e48df66afc1"))+(pad "3" thru_hole circle (at 0 10) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_3") (uuid "b8c3260e-e519-42ef-8e3a-14e5be21d8ef"))+(pad "4" thru_hole circle (at 0 15) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_4") (uuid "aafc26cd-114c-449d-ac05-b0c961457769"))+(pad "5" thru_hole circle (at 0 20) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_5") (uuid "ab15ee2f-9b91-4618-a21e-8704603a163e"))+(pad "6" thru_hole circle (at 0 25) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_6") (uuid "926dae13-ed69-4c92-9ccc-eea585d47cb5"))+)+(footprint "RoutingFixture:J3" (layer "F.Cu") (uuid "c4d44d42-fb9a-4cb4-8e8d-a29a9a0870c4") (at 125 116)+(property "Reference" "J3" (at 0 -3) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))+(property "Value" "ROUTING_TEST" (at 0 -5) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))+(attr through_hole exclude_from_pos_files exclude_from_bom)+(pad "1" thru_hole circle (at 0 0) (size 2 2) (drill 1) (layers "*.Cu" "*.Mask") (net "NET_6") (uuid "d785cc31-a493-4459-a8e3-e813e37a4e6b"))+)+(gr_rect (start 98 78) (end 152 122) (stroke (width 0.05) (type default)) (fill none) (layer "Edge.Cuts") (uuid "06adc91d-e236-43e0-94e0-934912c5cc9f"))+)
docs/videos/routing-fable-5-1-poster.jpgadded⋯ 1 unchanged line ⋯
docs/videos/routing-fable-5-1.mp4added⋯ 1 unchanged line ⋯
docs/videos/routing-freerouting-poster.jpgadded⋯ 1 unchanged line ⋯
docs/videos/routing-freerouting.mp4added⋯ 1 unchanged line ⋯