Public command
design
Generate a KiCad design review bundle from a KiCad project or schematic input.
Usage
kicad-cruncher design project.kicad_pro -o output/design
kicad-cruncher design-review project.kicad_pro
kicad-cruncher dr project.kicad_pro
kicad-cruncher design schematic.kicad_sch
kicad-cruncher design --no-indexes
Arguments
file accepts .kicad_pro and .kicad_sch. If no file is provided, the command auto-detects exactly one .kicad_pro in the current directory. PCB-only inputs are intentionally rejected because the review bundle is centered on the schematic-backed KiCadDesign aggregate.
-o selects the output directory. Without -o, artifacts are written under ./output/design/. --no-indexes omits optional lookup indexes from the source-design sidecar while retaining B0 connectivity and bindings. design-review and dr are aliases for the same command and output contract.
Ownership
KiCad source models, source connectivity, netlist, Plotter-IR and base SVG are owned by kicad-monkey. kicad-cruncher owns CLI orchestration, design-review summary/layout/PCB projection, review enrichment and theme, artifact layout, budgets, and transactional publication; Monkey must not depend on Cruncher or acquire higher-level report concepts.
Python command generation uses Monkey's Python implementations on every platform: physical SVG rendering, compiled schematic graphs and version-E netlists stay Python. The separate Rust CLI owns its native implementation. Geometer assembly projection remains unchanged.
Output
The command writes the following files into the selected output directory:
<input-stem>_design.json: governed Design B0 with compiled netlist and schematic realization.<input-stem>_source_design.json: KiCad-only source evidence, variants, PnP and optional indexes.<input-stem>_compiled_schematic_graph.json: the exactcompiled_schematic_graphobject from the Design JSON.<input-stem>_netlist.json:kicad_monkey.netlist.a0JSON.<input-stem>_netlist.net: kicad-cli-style S-expression netlist.design_review_manifest.json:kicad_cruncher.design_review_manifest.b0artifact index. Python output omits nativedesign_factsprovenance; the optional schema field remains available to separate native artifacts.README.md: agent-facing explanation of the generated bundle.schematics/*.svg: one enriched schematic SVG per concrete hierarchy instance.pcb/copper_layers/*__review.svg: one enriched PCB review SVG per copper layer when a board is present.
Review Issues
The bundle is always written. Design review never stops or gives up on a disagreement between KiCad Monkey's netlist and the drawn schematic (owner, 2026-11-24). Each disagreement leaves its part unresolved and becomes a located issue naming the sheet, designators, pins and nets, and the command logs each as a warning:
- a pin the netlist cannot tie to exactly one physical pin is left out of its net;
- a pin listed on two nets keeps its first net, and its drawn pins on the other nets are left unbound;
- a drawn pin in no net, or drawn on a net other than the one it keeps, is left unbound;
- a wire group whose pins are on different nets is left unresolved;
- a sheet pin that joins two nets does not propagate, and the side whose net came only through the hierarchy is left unresolved;
- a symbol instance that maps to two components keeps the first.
The netlist follows kicad-cli 10.0.8: a pin of an off-board symbol, or of any symbol under an off-board sheet, is never a net node, though it still joins wires and names nets, and a net left with no node is not listed. On the KiCad corpus only the pin on two nets fires, on repeated designators, where kicad-cli does the same.
Known limits: a one-pin net is named Net-(U1-2) where kicad-cli writes unconnected-(U1-2-Pad); a pin numbered "" warns, since B0 needs a terminal designation; schematics older than KiCad 6 (format 20200512) do not load into the compiled schematic graph (owner, 2026-11-24). Rule areas excluded from the board, and off-board sheets in the Rust importer, are not yet checked against kicad-cli.
DesignReviewGraphLinkage
Rationale
Review agents need authoritative connectivity and hierarchy context for rendered schematic objects without joining by mutable labels or reconstructing nets from geometry.
Purpose
The standalone graph is the exact Design B0 realization. B0 drawable selectors use scene_key + instance_path + node_key in an actual supplied IR2D scene; a separate checked correspondence resolves the unique final SVG element.
Test Requirements
L3 verifies exact graph equality with Design JSON, final SVG selector uniqueness, reused page ownership, --no-indexes, nested Megamaid discovery, and consumer-only SVG-to-net-to-component and graph-to-SVG traversal.
Working Definition
The interface is working when every advertised graph selector resolves exactly once in its owning SVG and an artifact-only consumer can traverse connectivity and hierarchy without names, text, DOM order, or geometry.
Design JSON
The primary document has type: design and version: b0. Its compiled netlist owns component terminals and net membership; the schematic realization references that same authority. The source-design sidecar preserves Monkey's original payload, including text variables, variants and compatibility indexes, as source evidence.
Fresh generic identities may differ between invocations. Source UUIDs and displayed labels are not generic connectivity keys. Unsupported projection knowledge is reported explicitly.
Schematic SVGs
Each SVG preserves the source plotter drawing, with the existing black-and-white role theme. Its schematic-enrichment-b0 metadata points to the Design, graph and __drawing.json artifacts. That companion contains the actual IR2D scene, B0 graphical bindings, scene-to-SVG correspondence and coverage issues for the concrete page occurrence.
The Python scene currently lowers solid unfilled paths and groups. Unsupported operations remain in the complete SVG and are reported; scene coverage is partial. Native drawing uses its existing generic graphics importer. A selector is advertised only when its scene node and unique final SVG target resolve.
PCB Review SVGs
Each PCB review SVG contains one copper layer plus Edge.Cuts. Physical geometry comes from kicad-monkey enriched PCB SVG output. kicad-cruncher only adds root review attributes such as data-review-theme, data-review-layer, and data-review-draw-order, then recolors existing SVG elements according to the review theme.
The review page is the board outline without its stroke, as kicad-cli's fit-to-board page, falling back to the drawn bounds when the board has no closed outline. The command reuses a render cache for the duration of one design-review bundle. The cache preserves the same enriched metadata, root viewBox, width, height, and coordinate framing as the direct per-layer render path, but avoids rebuilding the board IR for every copper layer. The cache is not shared across daemon, plugin, process, or mutable-board lifetimes.
Drill and slot semantics come from existing kicad-monkey records. The records must use data-primitive="pad-hole" or data-primitive="via-hole", data-hole-owner, data-hole-kind, data-hole-plating, and dimensional fields such as data-hole-diameter-mm or data-hole-width-mm / data-hole-height-mm. The plating values are plated, non_plated, or unknown.
The review theme colors pads black, tracks/arcs/vias/zones light gray, Edge.Cuts black, plated drill records blue, plated slot records cyan, non-plated drill records red, non-plated slot records orange, and unknown-plating hole records neutral gray. Unknown plating is retained as unknown and should be treated as review-required data, not silently converted to plated or non-plated.
The command must not create a second drill/slot overlay group, add duplicate plating attributes such as boolean mirrors, or translate non_plated into a different spelling. Applications should read the canonical kicad-monkey attributes directly.
Manifest
design_review_manifest.json records the design JSON path, compiled graph artifact/schema/type/version/netlist reference/counts/linkage contract, netlist JSON path, KiCad S-expression netlist path, README path, schematic SVG list, and PCB SVG list. Each schematic artifact additionally records canonical page occurrence, companion drawing path, coverage issue count, artifact key, graph-link count, and resolved SVG-identity count. Each PCB artifact records the SVG path, copper layer, included layers, and the count of enriched drill/slot records present in that SVG.
Tests
L3 public workflow tests execute design, design-review, and dr against synthetic and reviewed KiCad projects, including HLR, taillight, Yoshi, Speedy, and the 4-channel backplane. L3_011 compares the Rust CLI with the Python oracle across CLI behavior, structured artifacts, hierarchy, fonts and worksheets, schematic review SVGs, PCB review SVGs, complete bundles, and transactional failure. L3_012 installs both Rust executable names, extracts led_component from the reviewed KM_CORPUS ZIP, removes Python from the runtime environment, generates a bundle, rejects workspace-path leakage, and verifies the hash/version/commit-bound release candidate and tamper failures.