app
AI Flow
Public Made by Adomby adom
Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board.
← Commit history
AI Flow 0.1.58: Fusion parts for the fields view; Hydrogen layout kept (chat left, webviews right)
10 files changed
+44−31
Cargo.lock+10−10@@ -4,7 +4,7 @@ version = 4 [[package]] name = "adom-aiflow"-version = "0.1.57"+version = "0.1.58" dependencies = [ "aiflow-analyze", "aiflow-board",@@ -24,7 +24,7 @@ dependencies = [ [[package]] name = "aiflow-analyze"-version = "0.1.57"+version = "0.1.58" dependencies = [ "serde", "serde_json",@@ -33,7 +33,7 @@ dependencies = [ [[package]] name = "aiflow-board"-version = "0.1.57"+version = "0.1.58" dependencies = [ "roxmltree", "serde",@@ -42,7 +42,7 @@ dependencies = [ [[package]] name = "aiflow-bridge"-version = "0.1.57"+version = "0.1.58" dependencies = [ "aiflow-board", "serde",@@ -51,7 +51,7 @@ dependencies = [ [[package]] name = "aiflow-copper"-version = "0.1.57"+version = "0.1.58" dependencies = [ "aiflow-board", "aiflow-grid",@@ -61,7 +61,7 @@ dependencies = [ [[package]] name = "aiflow-grid"-version = "0.1.57"+version = "0.1.58" dependencies = [ "aiflow-board", "serde",@@ -70,7 +70,7 @@ dependencies = [ [[package]] name = "aiflow-place"-version = "0.1.57"+version = "0.1.58" dependencies = [ "aiflow-board", "serde",@@ -79,7 +79,7 @@ dependencies = [ [[package]] name = "aiflow-pours"-version = "0.1.57"+version = "0.1.58" dependencies = [ "aiflow-board", "aiflow-copper",@@ -89,7 +89,7 @@ dependencies = [ [[package]] name = "aiflow-router"-version = "0.1.57"+version = "0.1.58" dependencies = [ "aiflow-board", "aiflow-grid",@@ -99,7 +99,7 @@ dependencies = [ [[package]] name = "aiflow-run"-version = "0.1.57"+version = "0.1.58" dependencies = [ "serde", "serde_json",
Cargo.toml+1−1@@ -14,7 +14,7 @@ members = [ ] [workspace.package]-version = "0.1.57"+version = "0.1.58" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
SKILL.md+9−5@@ -37,7 +37,9 @@ When the human asks for a board in Fusion ("a 12 V to 5 V buck converter using t the whole flow below is yours: they should never have to spell out a step. Read `docs/fusion-lane.md` once; the Fusion bridge must be 1.11.33 or later. Hydrogen stays full screen behind Fusion; keep Fusion windowed (about 90 % of the screen), never maximized, so the human sees both and a screen recording-catches Fusion's 3D view. `step` brings the window each step works in to the front: Hydrogen for intake,+catches Fusion's 3D view. Inside Hydrogen, the VS Code tab (the chat) always stays in the left pane and+every webview (the parts pages, the SPICE dashboard, the fields app) opens in the right pane; never widen+or collapse a pane to make a webview bigger. `step` brings the window each step works in to the front: Hydrogen for intake, design, simulation, sourcing, the library, current, thermal and fields (the chat and its webviews), Fusion for the schematic, placement, routing, pours, 3D and finish; the board is framed by its outline. @@ -58,8 +60,7 @@ for the schematic, placement, routing, pours, 3D and finish; the board is framed 4. **Simulate before the board (required: `step placement` waits for a `step simulation` after the schematic).** `step simulation`, then run the circuit in the Adom SPICE dashboard (adom/adom-spice-skillpack; ngspice in the container is the default): `adom-spice start`, `adom-spice study <study.json>`,- `adom-spice run ngspice`, `adom-spice show` (it opens in a Hydrogen webview; press its fullscreen- button so the human sees it large). Check start-up, ripple and the load step against the+ `adom-spice run ngspice`, `adom-spice show` (it opens in a Hydrogen webview in the right pane). Check start-up, ripple and the load step against the requirements. When a measurement misses, change the part values in the schematic (`fusion_schematic_run` with `CHANGE VALUE`, and the netlist), run the study again, and say what you changed and why. Record it: `evidence add --kind simulation --file <result.json>`.@@ -70,8 +71,11 @@ for the schematic, placement, routing, pours, 3D and finish; the board is framed 7. **Current and heat, in Hydrogen.** `analyze current` and `analyze thermal` with adom-fields on the live board. Show it to the human in a Hydrogen webview: `adom-fields serve --fields <run>/fields &`, open `http://localhost:8874/` as a webview tab named "Adom Fields", then- `adom-fields ui view --quantity current --parts ghost --camera iso` (the parts ghosted so the fields- read first) and `adom-fields tour`. A failing screen prints `why:` lines naming the cause and the spec+ `adom-fields ui view --quantity current --parts ghost --camera iso` (every part's 3D model ghosted over+ the copper, so the fields read first and the hot part is plain) and `adom-fields tour`. The models come+ from `<run>/3d/<MPN>.step`, which `fusion library` writes (the checked Z-up STEPs); adom-fields converts+ them with `step2glb`, so `adom-wiki pkg install adom/adom-step2glb` if it says the converter is missing.+ If the solve came before the library wrote them, `adom-fields parts --board <run>/board-live.brd --fields <run>/fields`. A failing screen prints `why:` lines naming the cause and the spec change that fixes it (a via ring: `viaPower`; another net crossing a patch: `planeUnder`). Change the spec, `adom-aiflow fusion reset` (the parts stay, the copper goes), then route, gate, land, pour and analyze again. Repeat until both screens pass, then `finish`.
bin/adom-aiflow⋯ 1 unchanged line ⋯
crates/adom-aiflow/src/main.rs+4−5@@ -117,8 +117,7 @@ enum Cmd { /// The finish line; refuses until every check passes Finish, /// Declare the step you are working on (placement, routing, pours, current, thermal, capture, finish, or your own). --back marks a return to an earlier step; --why says what sent you back.- Step { name: String, #[arg(long)] back: bool, #[arg(long)] why: Option<String>, /// film this window (hwnd on the target box) for this step and the next ones, instead of the PCB editor: a pup window driving a vendor site, a datasheet, Hydrogen's Parts Search- #[arg(long)] hwnd: Option<i64> },+ Step { name: String, #[arg(long)] back: bool, #[arg(long)] why: Option<String> }, /// The end of the run as the human sees it: the moment you say "done, here is your video". Needs finish first and the video file. Deliver { #[arg(long)] video: String, #[arg(long)] message: String, /// deliver even though a clip is flagged as having filmed nothing (say why in --message) #[arg(long)] accept_suspect: bool },@@ -3636,7 +3635,7 @@ fn main() { } println!("{}", step_table(&r)); }- Cmd::Step { name, back, why, hwnd: hwnd_arg } => {+ Cmd::Step { name, back, why } => { thread(&cli); let mut r = load_run(&cli); let mut known: Vec<String> = r.data["flow"]["steps"].as_array().map(|a| a.iter().filter_map(|x| x["name"].as_str().map(str::to_string)).collect()).unwrap_or_else(|| ["intake", "placement", "routing", "pours", "current", "thermal", "capture", "finish"].iter().map(|s| s.to_string()).collect());@@ -3651,7 +3650,7 @@ fn main() { if let Some(sch) = last("schematic") { if last("simulation").map(|sim| sim < sch).unwrap_or(true) { err("simulate the schematic before the board: no simulation since the schematic was drawn", &[- "`step simulation`, then run the circuit in the Adom SPICE dashboard and show it to the human: `adom-spice start`, `adom-spice study <study.json>`, `adom-spice run ngspice`, `adom-spice show` (a Hydrogen webview; widen its pane so it fills the window).".into(),+ "`step simulation`, then run the circuit in the Adom SPICE dashboard and show it to the human: `adom-spice start`, `adom-spice study <study.json>`, `adom-spice run ngspice`, `adom-spice show` (a Hydrogen webview in the right pane, beside the chat).".into(), "Check start-up, ripple and the load step against the requirements; change values in the schematic when a measurement misses, and say what changed. Record it: `evidence add --kind simulation --file <result.json>`. Then `step placement`.".into()]); } }@@ -3697,7 +3696,7 @@ fn main() { const HYDROGEN_STEPS: [&str; 9] = ["intake", "design", "simulation", "sourcing", "library", "current", "thermal", "fields", "export"]; br.front(if HYDROGEN_STEPS.contains(&name.as_str()) { "hydrogen" } else { "fusion" }); }- let hwnd = if let Some(h) = hwnd_arg { Some(*h) } else if name == "fields" { None }+ let hwnd = if name == "fields" { None } else if fusion_project { br.fusion_hwnd() } else if fusion_run { let h = br.pcb_editor_hwnd(); br.fusion_fit_board(); h } else { r.data["captures"].as_array().and_then(|c| c.iter().rev().find_map(|e| e.get("hwnd").and_then(|h| h.as_i64()))).or_else(|| br.pcb_editor_hwnd()) };
docs/release-0.1.58.mdadded+4@@ -0,0 +1,4 @@+# AI Flow 0.1.58++- **The fields app shows the parts on a Fusion board.** `fusion library` writes every part's checked (Z-up) STEP to `<run>/3d/<MPN>.step`, where adom-fields looks for a Fusion board's models, so the fields view draws each part's 3D model ghosted over the copper. Before, a Fusion run's fields view was bare copper. (adom-fields 0.6.1 declares its `step2glb` converter as a dependency.)+- **Hydrogen's layout stays put.** The skill and the simulation hint now say: the VS Code tab (the chat) stays in the left pane and every webview opens in the right pane; never widen or collapse a pane to make a webview bigger. They used to say to fill the window with the SPICE dashboard.
package.json+1−1@@ -1,7 +1,7 @@ { "slug": "adom-aiflow", "type": "app",- "version": "0.1.57",+ "version": "0.1.58", "title": "AI Flow", "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad today; Altium, Fusion and Adom's own web apps next.", "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",
page.json+2−4@@ -1,7 +1,7 @@ { "slug": "adom-aiflow", "type": "app",- "version": "0.1.57",+ "version": "0.1.58", "title": "AI Flow", "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad today; Altium, Fusion and Adom's own web apps next.", "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",@@ -44,9 +44,7 @@ "run.jsonl", "thermal analysis" ],- "dependencies": {- "adom/adom-lbr": "*"- },+ "dependencies": {}, "scripts": { "install": "./install.sh", "uninstall": "./uninstall.sh"
skills/adom-aiflow/SKILL.md+9−5@@ -37,7 +37,9 @@ When the human asks for a board in Fusion ("a 12 V to 5 V buck converter using t the whole flow below is yours: they should never have to spell out a step. Read `docs/fusion-lane.md` once; the Fusion bridge must be 1.11.33 or later. Hydrogen stays full screen behind Fusion; keep Fusion windowed (about 90 % of the screen), never maximized, so the human sees both and a screen recording-catches Fusion's 3D view. `step` brings the window each step works in to the front: Hydrogen for intake,+catches Fusion's 3D view. Inside Hydrogen, the VS Code tab (the chat) always stays in the left pane and+every webview (the parts pages, the SPICE dashboard, the fields app) opens in the right pane; never widen+or collapse a pane to make a webview bigger. `step` brings the window each step works in to the front: Hydrogen for intake, design, simulation, sourcing, the library, current, thermal and fields (the chat and its webviews), Fusion for the schematic, placement, routing, pours, 3D and finish; the board is framed by its outline. @@ -58,8 +60,7 @@ for the schematic, placement, routing, pours, 3D and finish; the board is framed 4. **Simulate before the board (required: `step placement` waits for a `step simulation` after the schematic).** `step simulation`, then run the circuit in the Adom SPICE dashboard (adom/adom-spice-skillpack; ngspice in the container is the default): `adom-spice start`, `adom-spice study <study.json>`,- `adom-spice run ngspice`, `adom-spice show` (it opens in a Hydrogen webview; press its fullscreen- button so the human sees it large). Check start-up, ripple and the load step against the+ `adom-spice run ngspice`, `adom-spice show` (it opens in a Hydrogen webview in the right pane). Check start-up, ripple and the load step against the requirements. When a measurement misses, change the part values in the schematic (`fusion_schematic_run` with `CHANGE VALUE`, and the netlist), run the study again, and say what you changed and why. Record it: `evidence add --kind simulation --file <result.json>`.@@ -70,8 +71,11 @@ for the schematic, placement, routing, pours, 3D and finish; the board is framed 7. **Current and heat, in Hydrogen.** `analyze current` and `analyze thermal` with adom-fields on the live board. Show it to the human in a Hydrogen webview: `adom-fields serve --fields <run>/fields &`, open `http://localhost:8874/` as a webview tab named "Adom Fields", then- `adom-fields ui view --quantity current --parts ghost --camera iso` (the parts ghosted so the fields- read first) and `adom-fields tour`. A failing screen prints `why:` lines naming the cause and the spec+ `adom-fields ui view --quantity current --parts ghost --camera iso` (every part's 3D model ghosted over+ the copper, so the fields read first and the hot part is plain) and `adom-fields tour`. The models come+ from `<run>/3d/<MPN>.step`, which `fusion library` writes (the checked Z-up STEPs); adom-fields converts+ them with `step2glb`, so `adom-wiki pkg install adom/adom-step2glb` if it says the converter is missing.+ If the solve came before the library wrote them, `adom-fields parts --board <run>/board-live.brd --fields <run>/fields`. A failing screen prints `why:` lines naming the cause and the spec change that fixes it (a via ring: `viaPower`; another net crossing a patch: `planeUnder`). Change the spec, `adom-aiflow fusion reset` (the parts stay, the copper goes), then route, gate, land, pour and analyze again. Repeat until both screens pass, then `finish`.
tools/fusion-project.py+4@@ -471,6 +471,10 @@ def cmd_library(a): added.append(mpn) say('part %s: %s symbol, model %s, %s' % (mpn, choice, step.name if step else 'none', 'Adom stock' if stock else 'Mouser %s, DigiKey %s, LCSC %s' % (numbers.get('mouser', '-'), numbers.get('digikey', '-'), numbers.get('lcsc', '-')))) save_state(st)+ # every part's checked (Z-up) model where adom-fields looks for a Fusion board's parts: <run>/3d/<MPN>.step+ d3 = RUN / '3d'; d3.mkdir(parents=True, exist_ok=True)+ for m, p_ in st['parts'].items():+ if p_.get('step') and Path(p_['step']).is_file(): shutil.copy(p_['step'], d3 / (m + '.step')) # the one library: every part, user values allowed (VALUE never asks), assembled into <name>.lbr combined = lib_dir / (name + '.lbr') lbrs = sorted(str(Path(p['lbr'])) for p in st['parts'].values())