---
name: "pcb-fab-workflow"
description: "Take a board in PCBFlux, the Cogniviz.ai EDA portal, from intake to fab files (Gerber, drill, BOM, CPL) through 18 ordered steps, and say what to re-run after a change. Use instead of design-to-fab."
---

# PCB design to fab: 18 ordered steps

This replaces the 12-gate `design-to-fab` flow. It is the 25-step PCB workflow with overlapping steps merged and reordered to fit the EDA portal's tools. Tool arguments are in the `eda-portal` skill; hand routing is in `manual-pcb-routing`; the debug/service port is in `add-diagnostic-port`.

DRC proves a board can be made. It does not prove the board works, stays cool, carries its current, can be tested or can be built. Work the steps **in order** and name the current step in every report.

The work has two phases, kept apart (see "Build, then evaluate"): the **build** makes the board (steps 1 to 13), and the **evaluation** then runs every check on the finished board and gives the verdict. A build step is *built*, never *passed*; only the evaluation says whether the board is good, and fab files (step 18) are made only after it passes.

## Which portal

The portal is `https://pcbflux.com/mcp` (Railway). The Cloudflare site `eda.cogniviz.ai` was retired on 2026-11-25: do not use it. Server names vary per machine; check the connected server's URL.

Most tools run in the web service and need nothing else. Some need a machine runner and answer 503 or "no runner" when none is online; then say which step is blocked and why, and do not mark it done:
- A runner (always on): ERC, DRC, `kicad_fab`, SPICE (`run_simulation`, `run_sweep`, `run_montecarlo`), `kicad_edit`, datasheet text.
- A Docker machine only (a desktop or VM enrolled as a runner): `kicad_review` and `kicad_build` (the kicad-mcp image: `sch_*` edits and `sch_annotate` in step 7, `lib_assign_footprint` in step 6, `run_drc` and `get_courtyard_violations` in step 15), `run_em` (step 14), and Freerouting in `kicad_autoroute` (step 12; the default engine, TraceMaker, needs a router machine with a GPU).

`check_dfm` (step 16), `check_layout`, `check_placement`, `check_zones`, `check_voltage_drop`, `run_thermal`, copper views, BOM and `run_tests` run in the web service itself.

## Build, then evaluate

**Build** (`get_build`, `set_build_step`). Thirteen build steps, in this skill's order: 1 requirements, 2 rules and stackup, 3 circuit, 4 test access, 5 sourcing and specs, 6 library, 7 schematic, 8 SPICE and thermal inputs, 9 placement, 10 3D models, 11 heatsink vias, 12 routing, 13 pours. `get_build` lists them with the portal's numbers (`0`, `6`, `3.1`, `4`, `2`, `1.1`, `1.2`, `3.2`, `5.1`, `5.2`, `7.2`, `7.1`, `7.3`), each `open`, `built` or `blocked`, and `next`.
- Make the step, use its check tools to guide the work and fix what they report, then `set_build_step {project, circuit, step, status:"built", note}` with what you made, the revision and what a check still reports.
- A finding you cannot fix does not stop the build: put it in the note and go on. The evaluation will report it.
- `status:"blocked"` (note = the question) only when the step cannot be made without the user: a number or choice only they have, or a tool with no runner online.
- Built is progress, not a verdict. Never report a built board as passing.

**Evaluation** (`run_evaluation`, `get_evaluation`). When the build is complete (or on any existing board), `run_evaluation {project, circuit}`: it returns at once with an id; poll `get_evaluation` until `status` is `done` (a minute or two). It runs twelve checks in order and edits nothing: `erc`, `library`, `nets`, `intent`, `sim`, `placement`, `routing`, `pours`, `em`, `drc`, `dfm`, `requirements`. Each is `pass`, `fail`, `unknown` (no evidence: not written, could not run) or `skipped` (its checklist item is deferred). A failing check does not stop the others.
- Verdict: `pass`; `fail` (a check failed); `incomplete` (a check has no evidence, which blocks like a fail); `waiting` (only the user's confirmation of a manual requirement is missing: show the items and record their answer with `confirm_requirement` only when they say so).
- It does not judge rules and stackup, sourcing and specs, the power budget, 3D models or heatsink vias: check those in their build steps.
- The antenna check is skipped only with a recorded reason: `set_checklist {gate: 9, status:"deferred", note}` on a board with no antenna and no impedance targets.
- Refused (409) while an agent or another evaluation works on the circuit.

**Needs a redo.** Any save after the evaluation marks the checks it reaches (`affected`, each with `dirty` = the file and revision) and the evaluation is `outdated`. After every change, read `get_evaluation`: if `outdated`, run it again before calling anything verified. Do not carry an old pass forward.

**Repair.** On `fail` or `incomplete`: fix each failing check at its cause (schematic, then placement, then routing and pours, then rules), write what an `unknown` check needs (sim.json assertions, intent.json, requirements), then `run_evaluation` again. Never hide a finding to get a pass.

**Who repairs what.** `get_evaluation` gives `repair` for every check that did not pass: `agent` (a repair run), `person` (a decision or confirmation; with `tries` above 0 it is manual repair: a run already left it unchanged), `rerun` (the tool failed: evaluate again), `build` (no parts on the board). Start a repair run only for `agent` checks. Manual repair is fixed by hand or handed to an agent with a concrete instruction; a run without a new instruction repeats the last one at the same cost. Details and call durations: the `eda-portal` skill.

**Build to the evaluation's rules.** Each build step is told the pass rule of the checks it decides (placement: 0 at the edge; routing: 0 high and 0 medium, DRC 0 errors, DFM pass; pours: `check_zones` ok). Run them before a step is marked built, and say for each finding left whether a later step clears it, more work would, or a person must decide. Name the fab in step 2 (`rules.json` `dfm.fab`, for JLCPCB the profile follows from the layer count) so every later step measures against one sheet.

**Fab files.** `kicad_fab` refuses unless the latest evaluation is `done`, `pass` and not `outdated` (`current: true` in `get_evaluation`). Its error says what is missing.

## Steps

Steps 1 to 13 are the build. Steps 14 to 17 are what the evaluation runs; do them by hand only to see a finding in full or to work on it. Step 18 needs a passed, current evaluation.


The **Portal** column is the step's place on the portal checklist: a gate number, or a step id inside a gate.

| # | Step | Do | Closed when | Portal |
|---|---|---|---|---|
| 1 | Intake & project page | `list_projects`, `get_project`, `kicad_list`. `set_design_spec`: requirements as `{id, text, check}`; context = purpose, block diagram, host board, key parts, enclosure, fab house, quantity, budget, open risks. Link associated GitE2E repos (`link_repo` for `board`, `firmware`, `docs`) and Designs enclosure (`link_design`). Ask the user for any number you cannot read from the spec | every requirement has a `check` or is `manual`; a reader learns what the board is and why from the project alone | gate 0 |
| 2 | Design rules & stackup | Fab first (PcbParts `get_design_rules`); apply the Rule standard below (`set_rules {preset}`, `kicad_edit set_stackup`). `set_rules`, `set_net_class` (power, signal, RF/impedance), `set_copper_layers`, `get_board_stackup`; impedance targets in `<circuit>.rules.json` | rules within the fab's limits; stackup defined (RF substrate and ground for antenna boards) | gate 6 |
| 3 | Circuit design | Rails, load currents, interfaces, part choices. `prepare_analysis`, then write `<circuit>.analysis.json` (rails, loads, currents); `analyze_circuit` | every rail has a source, voltage and load budget; estimated specs reported as unverified | 3.1 `circuit` |
| 4 | Test plan & debug access | Test point on every rail; SWD/JTAG or UART with boot and reset (`add-diagnostic-port`); bring-up order; which test proves which requirement. `.intent.json`, `harness.json`; `check_intent`, `check_harness`. Cross-check pin map against linked `firmware` repo when available (`link_commit` `target_kind: "pinout"`) | every requirement maps to a test; port and test points are in the design | gate 4 |
| 5 | Parts: sourcing + specs | Per part: `lookup_parts`; stock via `digikey_search` / `mouser_search` / PcbParts `jlc_search` + `jlc_stock_check` (prefer the fab's basic parts); `set_sourcing`; then `search_datasheets` + `get_datasheet_page` and `set_part_spec` with `sources`. Check with `list_part_specs` | every line has a supplier number with stock (or a recorded alternate); every chip has a library-backed spec, none UNVERIFIED ESTIMATE | gate 2 |
| 6 | Library | `kicad_footprint_audit`. Missing footprints: PcbParts `cse_get_kicad` / `jlc_get_part`, or `kicad_footprint_create` from the maker's drawing; check pad positions against it; `lib_assign_footprint` (`kicad_build`, Docker machine) | `needs_footprint` empty; every footprint checked against its drawing | 1.1 `library` |
| 7 | Schematic + ERC | `kicad_build` `sch_*`, `sch_annotate` (Docker machine), `kicad_erc`; follow the Schematic grammar below (`kicad_sch_blocks`, `check_schematic`, `kicad_sch_view`). Keep MCU pin assignments synced with any linked `firmware` repo and record `link_commit` after pin/interface changes | ERC 0 errors; every part has a footprint; `check_schematic` pass | 1.2 `schematic` |
| 8 | SPICE + thermal estimate | `suggest_tests`, accept drafts into `<circuit>.sim.json`; a rail a chip makes on its own pin (MCU core LDO on VCAP, a secure element's VOUT) is undriven unless the chip's part spec has `internal_rails {pin: volts}` (or sim.json `internal_rails {ref: {pin: volts}}`): that puts a stand-in source on the net, which checks the wiring, not the regulator; a net the simulation cannot judge goes in sim.json `not_checked {net: why}` and is reported as not checked instead of failing; `run_simulation`, `run_sweep`, `run_montecarlo`. Then `run_thermal` (parts_steady; its LED transient runs only for power LEDs, datasheet current above 30 mA, unless thermal.json says `leds: "all"`) with `<circuit>.thermal.json` for diodes, FETs, PAs, and `check_datasheet` for derating. Write down which parts need heatsink vias (exposed pad, > ~0.5 W, or thin Tj margin), with their power and theta_jb from the datasheet | sim verdict ok, every assert passes, no rail-relevant part without a model; every Tj within margin at max ambient (and altitude if specified); via list made | 3.2 `spice` |
| 9 | Outline + components + placement | `kicad_sync_pcb` (`skip_missing:true` first if needed); `kicad_footprint_audit` (`not_on_board`, `footprint_swaps`, `stale_footprints` empty). Outline with `kicad_edit set_outline`: a rectangle `{x, y, width, height, corner_radius}` (radius 1-3 mm unless the enclosure says otherwise; the reply's `rounded_corners` must equal the corner count), or a polygon traced from the enclosure drawing for a shaped board. `place_footprints` (`side:"B"` for the bottom: flipping mirrors the pads, so `dry_run` first and look for new shorts; a two-pad part is put right by turning it 180 degrees), then `move_footprint`; RF/antenna group first and rigid; connectors at edges; decoupling within 5 mm; hot parts away from crystals and sensors. If a Designs enclosure is linked, verify outline, mounting holes, and connector clearances against it, commit its revision (`cloud_commit`), and pin it (`link_design` / `verify_design_links`). `check_placement`, `check_layout {groups:["placement"]}` Then `kicad_drc` `summary_only`: settle every `inside_footprints` entry now (a stock footprint under the board's limits: rule at the fab's limit, or a corrected project-library copy named in the schematic), no later step clears them | outline final with radius; every part on the board; no overlaps; no placement finding left unjustified | 5.1 `placement` |
| 10 | 3D models *(deferrable)* | `kicad_fetch_3d_models` (LCSC STEP), `kicad_footprint_bodies` for project-library parts; `get_3d_image` to check rotation and offset (`rotate` or `kicad_set_3d_model`) | every part has a body sitting right, or is deferred with a reason | 5.2 `models_3d` |
| 11 | Heatsink vias *(conditional)* | For each part on the step 8 list, before routing so the router avoids them: `kicad_edit via_array {ref, pad, diameter, drill, pitch}` on the exposed or thermal pad (typically 0.6 / 0.3 mm at 1.0-1.2 mm pitch). If it says the via does not fit the pad margin, use a smaller via or the larger thermal pad, never a signal pad. `dry_run`, then save with `max_new_errors:0`. Check with `run_board_thermal {parts:[{ref, power_w, theta_jb, tj_max}], compare_without_vias:true}`: read `vias_lower_it_by_c` and the Tj margin, and ask for the heat map as a stack image: the hot spot should sit on the part and spread into the planes, not stop at the pad. It needs part powers: pass `parts` or list them in `<circuit>.thermal.json`, or it refuses. Skip only when the list is empty | every listed part has its vias; board thermal margin ok; DRC no worse | 7.2 `thermal_vias` |
| 12 | Routing + track current | USB, other pairs and clocks stay on one layer over ground that is not cut under them (check with `check_zones` `fast_nets` before closing). Planes first: `add_zone` for the GND/power planes the router relies on, `refill_zones`. Critical nets by hand (RF, diff pairs, clocks), then `kicad_autoroute` `require_complete:true`; leftovers via `manual-pcb-routing`. Supply pads on an inner plane get their own stub + via. Declare differential pairs in `<circuit>.rules.json` `diff_pairs [{name, p, n, max_skew_mm, ohm}]` (USB 90, Ethernet/LVDS 100) so skew (R7) and differential impedance (W2, from the routed width and gap) are checked against real limits. Then `check_layout {groups:["routing","width"]}`: W3 IPC-2221 width per rail current; R9 tracks near the edge use `rules.json layout.edge_clearance_mm` (default 5 mm, for boards in rails; set it to the fab's copper-to-edge figure on a small board without rails, and say why); fix with `set_track_width` `fit:true` or wider copper. Then look at `kicad_copper_view` one layer at a time: coloured by track width with the power nets highlighted (necked power paths), and coloured by net class with the critical nets highlighted (detours, needless layer changes) | 0 unconnected; no routing or width finding on a power net left unjustified; copper views looked at | 7.1 `routing` |
| 13 | Pours, stitching + walkthrough | Finish pours: remaining zones with `priority`, `thermal_gap`/`thermal_spoke` per R8 (solid only above 5 A). Stitching: `kicad_edit stitch_vias {where: "zones"|"edge"|"polygon", net, diameter, drill, pitch}` (edge for the board rim, zones between layers; use the board's real ground net name from `list_nets`). `refill_zones`. Walkthrough: `check_zones` with its image (floating copper, necks, single-spoke pads, fast nets over plane gaps; pass `fast_nets` when names don't show them). It sets the `pours` step on every run, so run it after the last pour change. Voltage drop: `check_voltage_drop` with its current-density image for every power net, with `sources` = a pad of a part that is on that net (the regulator output pad, or the inductor's output pin after a buck; a part not on the net is refused) and a `pad` named where the part has several, `loads` with `current_a` from analysis.json, `rail_v` and `max_drop_mv` (default 3 % of the rail); run each side of a fuse, ferrite or sense resistor separately | `check_zones` verdict ok; every power net `check_voltage_drop` pass (review items justified) | 7.3 `pours` |
| 14 | Fields *(conditional)* | Antenna: `kicad_copper_view` with the RF nets highlighted to confirm the feed is on the top layer over unbroken ground, then `prepare_em` (`ref` = antenna footprint), `run_em` (Docker machine), `get_em` at the real stackup and pitch. Impedance nets: `check_layout` W2 against `rules.json` (`impedance` for single-ended nets, `diff_pairs[].ohm` for pairs). Skip only when the board has no antenna and no impedance targets, with that reason | EM `expect` passes; impedance within tolerance | gate 9 |
| 15 | DRC | `kicad_drc`; `kicad_review run_drc` and `get_courtyard_violations` when a Docker machine is online | 0 errors, 0 unconnected, every warning read and justified | 8.1 `drc` |
| 16 | DFM | `check_dfm` against the chosen fab: put its figures in `<circuit>.rules.json` `dfm` (set_rules: `profile` standard or hdi, `fab`, `min_track_mm`, `min_clearance_mm`, `min_via_hole_mm`, `min_via_diameter_mm`, `min_annular_ring_mm` (vias), `min_pad_ring_mm` (plated holes of parts), `min_hole_mm`, `min_copper_edge_clearance_mm`, `silk_text_min_mm`, `microvia_ok`, ...) from PcbParts `get_design_rules` or the fab's capability page; the built-in profiles are generic, not a fab's sheet. It measures the board's narrowest track, closest gap, via and ring, drill, copper to edge, silk text, layer count, HDI vias and fiducials, and closes step 8.2 on a pass. `kicad_review dfm_run_manufacturer_check` adds little: headless it cannot read layer count, track or via sizes (it needs a running KiCad). Silk fixes: `set_silk_text_size`, `set_text_layer`. Then send the Gerbers to the fab's own DFM check before ordering | `check_dfm` verdict pass with the fab's limits in rules.json (`limits_from` shows no generic profile value for a limit the fab publishes); every finding fixed or justified | 8.2 `dfm` |
| 17 | Final review | `run_tests` (requirements, intent, em, erc, nets, drc, sim), `check_requirements`, `verify_design`; `check_system` for multi-board projects; `check_standards` when context names profiles; re-run `run_thermal` / `run_board_thermal` if power changed since step 8. Show every `needs_human` item to the user; record their answer with `confirm_requirement` only when they say so in the conversation | verdict pass; no `fail` or `unknown` stage; every manual item confirmed by the user | gate 10 |
| 18 | Manufacturing export | Needs `get_evaluation` `current: true` (else `run_evaluation` first). `kicad_fab`; then `kicad_fab_preview` with `view:"top"` and `view:"bottom"` (and single layers or a `box` where something looks off): look at the pictures and read its checks (outline closed, nothing outside it, no silk on pads, every copper/mask/drill file present). `make_bom` with `csv:"jlcpcb"` (or the fab's format); `board_datasheet` as the project page. Re-verify linked commits (`list_commit_links {verify_fresh: true}`) and linked CAD designs (`verify_design_links`), snapshot any enclosure STEP/render (`sync_design_asset`) or repo datasheet PDF (`add_asset`) into PCBFlux `project_assets`, and offer to snapshot the board via `create_circuit_version` after asking the user what explicit version `tag` they want | every deliverable below made; preview checks clean; links verified; assets/links listed | gate 11 |

## Rule standard

One standard for every board: fab-friendly geometry by default, the portal's checks for closure. Set it at step 2 and on any board brought in from elsewhere.

| Item | Standard | Dense (BGA, 0.4-0.5 mm pitch QFN) |
|---|---|---|
| Default class | track 0.20, clearance 0.15, via 0.6 / 0.3 | track 0.15, clearance 0.127 |
| Power class | track 0.5, clearance 0.2, via 0.8 / 0.4, on the power nets | same |
| Fanout vias | - | Dense class 0.45 / 0.25 on the named nets only (small-via surcharge: say so) |
| Drill | 0.30 minimum; house floor 0.25 is never crossed | 0.25 only in the Dense class |
| Fab profile | `rules.json dfm {fab}`, `layout.edge_clearance_mm` | same |
| Stackup | a `(stackup ...)` block from the fab's preset | same |

`set_rules {preset: "standard" | "dense"}` writes the classes, the drill minimum and the fab profile in one call (`dry_run` first; it never narrows a class that is already wider). `kicad_edit set_stackup {preset}` writes the stackup; `check_dfm` names whichever of these a board lacks.

**A board brought in from elsewhere** (KiCad files imported, another tool's design) is fixed in this order before any other work:
1. `set_rules {preset}` and `kicad_edit set_stackup`.
2. Stock footprints with drilled thermal pads under 0.25 mm (ESP32 modules, `*_ThermalVias` packages): `kicad_edit set_pad_drill {drill: 0.3}` raises them, ring kept. DRC then shows `lib_footprint_mismatch` on those parts: expected, say so.
3. Routing vias under the floor: `kicad_edit set_via_size {below_drill: 0.3, diameter: 0.6, drill: 0.3}`.
4. Fiducials (three, on the board corners) when any part has a pitch of 0.65 mm or less.
5. Then the usual checks: DRC, `check_dfm`, `check_zones`, `check_layout`, sourcing.

## Schematic grammar

A schematic is read by people. Build it as wired functional blocks, not as parts with a label on every pin. `check_schematic` measures it; `kicad_sch_view` shows it as KiCad draws it: look at it after every schematic change.

- **Blocks.** One block per function (input protection, each regulator, decoupling bank, MCU, each interface), with a heading over it that gives purpose and key numbers ("3.3 V LDO, 300 mA, from VBUS"). `kicad_sch_blocks` lays out the common ones pre-wired (decoupling, LDO, divider or pull-up, LED, RC filter, crystal).
- **Wires inside, labels between.** Inside a block, pins are joined by wires. A label only for a net that leaves the block, at the free end of a short wire stub. Global labels only across sheets.
- **Power symbols.** Every supply and ground connection is a power symbol (supply points up, GND down), never a text label: `kicad_sch_labels labels_to_power` converts. A rail that only feeds power inputs gets `power_flag`.
- **Direction.** Inputs on the left, outputs on the right. Series parts (R, L, ferrite, fuse, series diode) horizontal; shunt parts (decoupling, TVS, pull-up, divider, LED to ground) vertical.
- **Tidy.** Everything on the 1.27 mm grid; Footprint, Datasheet, MPN, LCSC and Description hidden; unused pins `no_connect`; nothing within 15 mm of the paper edge or on the title block (pick the next paper size up); sub-sheet files sit in the circuit's folder with bare names (no `..`).
- **Closed when.** `kicad_erc` 0 errors, `kicad_net_diff` match, `check_schematic` pass (no label dump: at least 1.5 wires and at most 2 labels per part), and the `kicad_sch_view` picture looked at.

## Deliverables (step 18)

- **Gerber files** with job file (`kicad_fab` zip)
- **NC drill files**: Excellon PTH and NPTH, with drill maps (`kicad_fab`)
- **BOM**: `make_bom` CSV in the fab's format, every line with a supplier part number
- **CPL** (component placement list): JLCPCB CPL / pick-and-place from `kicad_fab`, both sides, DNP excluded
- Fab preview pictures from `kicad_fab_preview` (top and bottom)

The portal never places an order; ordering is the user's.

## Tracking on the portal checklist

The checklist holds the latest result per item and is moved by the same tools the evaluation calls. It is the detail view; the build state is `get_build` and the verdict is `get_evaluation`.

`get_checklist` returns 12 gates; gates 1, 3, 5, 7 and 8 hold steps (`library`, `schematic`, `circuit`, `spice`, `placement`, `models_3d`, `routing`, `thermal_vias`, `pours`, `drc`, `dfm`), and `progress` counts all 18. A gate is done only when all its steps are.

- Start every session and every change with `get_checklist`; work stale and open steps in the order of this skill (not the portal's numbering: heatsink vias, 7.2, are done before routing, 7.1).
- Tools close their own step or gate from the result (`kicad_erc`, `check_intent`, `check_placement`, `kicad_autoroute`, `check_zones`, `kicad_drc`, `check_dfm`, `run_em`, `check_requirements`, `kicad_fab`). Mark the rest by hand with `set_checklist` on the step itself: pass `step` as its key, e.g. `"pours"`, or its number, e.g. `"7.3"`, and leave out `gate` (the tool refuses both together); steps are marked done or deferred on their own. Defer on the step, not the gate (`models_3d` without a model yet, `thermal_vias` when no part needs them), so the gate can still close when its other steps are done. Put the evidence in `note` (e.g. `"via_array U3 EP 3x3; run_board_thermal Tj 92 C / 125 C, vias -14 C, rev 42"`).
- A step whose `reason` comes from a different tool (for example `thermal_vias` or `dfm` showing an autoroute or DRC result, typical on boards checked before the steps existed) has no evidence of its own: treat it as open and run its tools.
- Never mark a step done on a guess.

## One agent per step

`get_checklist` returns `agents`: every step, and every gate without steps, in the order of this skill, each with its state, a tier and the model the portal's admin set for that tier (design: circuit, schematic, placement, routing; hard: requirements, SPICE and thermal, heatsink vias, pours, antenna; standard: rules, sourcing, library, test access, DRC, DFM, final review; light: 3D models, fab output), and `next_agent`.

- When the user asks for one step, work that step only (or give it to one sub-agent on that step's model) and stop.
- When the user asks to complete everything, and the client can start sub-agents: give `next_agent` to a sub-agent on its model with only that step's row of the table above as its task, wait for it, call `get_checklist`, and start the next one only if that item is now done or deferred. Stop at an item its agent left open and report what it said; do not retry it in a loop.
- A sub-agent closes only its own item, on a clean tool result, and never calls `confirm_requirement`.
- For a build, give each sub-agent one build step (`get_build` `next`): it makes the step and calls `set_build_step`, not `set_checklist`. When `get_build` says `complete`, call `run_evaluation` yourself.
- On the portal, the circuit's page (Projects, then the project, then the circuit) does this without the editor: Design plan (questions and part choices to answer first), Build (the steps), Evaluation (run, results, repair).
- In the designer the Checklist tab does the same: "Run its agent" on an item, "Run all open with agents" for the chain.

## Estimates

`run_thermal`, `run_board_thermal`, `check_voltage_drop`, `run_em` and part specs are estimates on models or grids. Say so in every report, compare layouts with them, and recommend measuring the first board where a margin is only a few kelvin or millivolts.

## Pictures

`kicad_copper_view` (copper per layer or as a stack, coloured by net, net class or track width, chosen nets highlighted) and the `image` argument of `check_zones`, `check_voltage_drop` and `run_board_thermal` (`true`, or an object `{view, show, box, px, scale}` for one layer, all layers or a 3D stack; a string such as `"stack"` is refused) return pictures. Look at every picture before closing its step, and say in the note what it showed (hot spot location, worst current-density spot, which pour had the finding). The same maps are in the designer's Board maps panel (**Maps** in the tools strip on the right edge of the editor), so point the user there when a finding needs their eyes. If the session's tool list lacks `kicad_copper_view` or the `image` argument (a connection opened before they were deployed sends `image` as a string and is refused), say so, close the step on the numeric result, and suggest reconnecting the EDA connector.

## What may be deferred or skipped

Deferred (added later without touching the design): a **3D model** that does not exist yet (step 10), and a **part out of stock** whose footprint and datasheet spec are done (step 5; pick an alternate later). Record `defer: "<reason>"`.

Skipped with a recorded reason: step 11 when no part needs heatsink vias; step 14 when the board has no antenna and no impedance targets.

Never defer or skip ERC, DRC, DFM, SPICE, thermal estimate, track current, zone check, voltage drop, the debug port and test points, or a missing footprint: a gap there costs a respin. List every deferred and skipped item in each report.

## When the user asks for a change

Note the current `rev` first. Find the earliest step the change touches and re-run from there through 18.

| Change | Re-run from |
|---|---|
| New or changed requirement | 1, then every step it names |
| Fab house, design rules or net classes | 2 -> 11-18 |
| Layer count or stackup | 2 -> 11-18 (substrate changes antenna resonance and impedance) |
| Rail voltage, load or regulator change | 3 -> 8, 11, 12, 13, 17, 18 |
| Debug port or test points | 4 -> 7, 9, 11-18 |
| Part swapped, same footprint | 5 -> 7, 8, 17, 18 |
| New or different footprint | 6 -> 7, 9-18 (new 3D model) |
| Net or connection change | 7 -> 8, 9, 11-18 |
| Move parts | 9 -> 11-18 (14 if an antenna or feed moved) |
| Board size or corner radius | 9 -> 11-18 (keep the antenna group at its designed pitch; never scale it) |
| Track width or clearance only | 12 -> 13, 15-18 |
| Zone, pour or stitching change | 13 -> 14-18 |
| Antenna element, pitch or feed | 14 -> 9, 12, 13, 15-18 |
| Sourcing or BOM override only | 5 -> 18 |

Anything routed is invalid after a move or a net change: remove those tracks and route again before DRC. Any outline, via or track change needs `refill_zones` before step 13. After a change, report which steps re-opened, which stayed closed, and the new `rev`.

### Keep the model files in step with the circuit

The power estimate, SPICE, the Simulate page (`simulate_board`: power, copper, heat) and the checks do not read the schematic alone. They read files and specs that name nets, refs and numbers. A circuit change that leaves them behind still gives answers, but wrong ones: a renamed net drops out of the rail checks, a new chip draws nothing, a load sits on a rail that no longer exists. Every circuit change is finished only when these agree with it.

**What models the board**

| Input | Where | What it holds |
|---|---|---|
| Part specs | database, `set_part_spec` (admin) / `list_part_specs` | per MPN: `supply` pin regex, `i_typ_ma` **and** `i_peak_ma`, `theta_ja`, `tj_max`; regulators also `eta` or `dropout_v`, `iq_ma`, `imax_ma`; `internal_rails {pin: volts}` for a rail a chip makes itself. A spec without `i_peak_ma` counts at its typical current under full load: give both |
| `<circuit>.analysis.json` | store, next to the schematic | `rails {net: volts}`, `sources [nets]` (what feeds the board), `regulators {ref: {in, out}}`, `loads [{net, ma, ma_peak, label}]` for whatever has no spec (an off-board module, a camera on a connector; start `label` with the ref that carries it, e.g. `"J2 camera module"`, so the copper solve puts the current on that part's pads), `extra_mw`, `ambient_c` |
| `<circuit>.sim.json` | store | `sources {net: volts}`, `expect {net: [min, max]}`, `sweeps`, `assert`, `internal_rails`, `not_checked {net: why}`; SPICE models of parts with `set_spice_model` |
| `<circuit>.intent.json` | store | rails, the MCU and its GPIO nets, `power_up` |
| `<circuit>.thermal.json` | store | ambient, LED drive, heatsink |
| `<circuit>.rules.json` | store, `set_rules` | net classes by net name, `diff_pairs`, `dfm` |
| `<circuit>.em.json` | store | antenna geometry, `{net}` copper |
| `<circuit>.bom.json`, sourcing | store / `set_sourcing` | overrides per ref, supplier numbers per part |

`get_configs {project, kind?}` returns these files parsed, per circuit; read each with `read_file` before you change it, and write with `write_file`. `prepare_analysis` without `dry_run: true` writes analysis.json itself and replaces hand-written loads: use `dry_run` to compare, then write the file yourself.

**Which files a change reaches**

| Circuit change | Update |
|---|---|
| Net renamed or merged | every file that names it: analysis `rails` / `sources` / `regulators` / `loads[].net`, sim `sources` / `expect` / `not_checked` / `assert` probes, intent rails and GPIO nets, rules `net_classes` and `diff_pairs`, em `{net}` |
| Ref renamed (re-annotation) | analysis `regulators` keys, `extra_mw` keys, load labels that start with a ref; sim `internal_rails` and sweep `load_ma` keys; intent `parts` and `mcu.ref`; bom `parts`; thermal entries |
| Rail voltage changed (feedback divider, fixed-voltage part) | analysis `rails`; sim `sources` / `expect` bands and asserts; intent rails; the regulator's spec if the part changed |
| Regulator added, removed or swapped | part spec (efficiency or dropout, `iq_ma`, `imax_ma`, `theta_ja`, `tj_max`); analysis `regulators {ref: {in, out}}` and its output in `rails`; sim `expect` for the new rail (`suggest_tests`) |
| Chip added or swapped | part spec with `supply`, `i_typ_ma`, `i_peak_ma`, `theta_ja`, `tj_max` (from the datasheet, cited); sourcing / bom; intent when it is the MCU or drives a GPIO; `set_spice_model` when SPICE should model it; thermal.json for a power LED |
| Off-board load or connector-fed module | analysis `loads` with `ma` and `ma_peak`, label starting with the connector's ref |
| Fuse, ferrite, shunt or load switch put in a rail | the new downstream net in analysis `rails` with its voltage; the load behind it moves to that net. A shunt counts as a copper source only at 1 ohm or less |
| Part removed (DNP) | its loads, regulators entry, intent entries and bom override; its spec stays (other boards may use it) |
| Layout only (move, route, pour) | no model file changes; re-run copper and heat |

**How to do it**

1. Before the change: note the `rev`, run `simulate_board {view: "power"}` (it returns typical and full), and keep the totals, each rail's current and its feeder, and the hottest part. If the board is routed, keep `simulate_board {view: "copper"}`: the worst drop per rail.
2. Make the circuit change.
3. Find what went stale: `prepare_analysis {project, circuit, dry_run: true}` (rails, regulators and chips without a spec as the netlist has them now) against analysis.json; `list_nets` and `get_components` against every net and ref named in each config file. Rule: every net and ref a config file names exists in the netlist, and every rail the netlist powers is in analysis `rails`.
4. Update in this order: part specs, analysis.json, sim.json (`suggest_tests` for new rails and dividers, then review), intent, then thermal, em, rules, bom as the table says. One `write_file` per file, with what changed and why in the reply.
5. Check:
   - `analyze_circuit`: no `coverage.ignored` chip, no unanalysed regulator, no new UNVERIFIED ESTIMATE spec.
   - `simulate_board {view: "power"}`: every rail with current has a `fed_by`, no rail shows no current at full load, and the totals moved the way the change should move them.
   - `run_simulation` (op): every declared rail inside its band or `not checked` with a reason.
   - Once the board is routed: `simulate_board {view: "copper", load: "full"}` (no skipped rail you cannot explain, no load with "no copper path") and `{view: "heat"}`; then `run_tests`.
6. Report the numbers before and after (input power, per-rail current, worst drop, hottest part), each file changed with its new `rev`, and anything left estimated.

## Reporting

Each report gives: the current step, closed steps with the tool result that closed them, open items, deferred and skipped items with reasons, the `rev`, and what is estimated. Say which phase the board is in: build (`get_build` progress and the next step) or evaluation (verdict, each failing or unknown check with its summary, and whether it is outdated). "Ready for fab" means `get_evaluation` `current: true`, nothing less; step 18 then makes and previews the files. When a picture backs a finding, name the tool and view so the user can open the same map in Board maps.
