KiCad 8+  ·  Python 3.10+  ·  MIT License

CIRCUIT
WEAVER

From hardware design intent to real KiCad schematics, optimized PCB placement, firmware stubs, and manufacturing-ready artifact bundles.

Circuit Weaver is a spec-first, AI-assisted circuit design system. Describe the design, validate it through a real intermediate model (DesignIR), and generate real KiCad schematics — not stubs, not templates, not chat artifacts.

14
VALIDATION CHECKS
7
RESOLVER TIERS
1009+
PASSING TESTS

From Requirements to Quote-Ready Manufacturing Package

Each step shows what runs (the engine, script, or slash command), what happens, and what it produces.

INPUTS
01
>_ rails:
/circuit-weaver design-wizard

Requirements Capture

Engineer + Codex / Claude define block intent, interfaces, power rails, buses, and constraints — no hand-drawing every schematic page first.

AI AGENT ENGINEER
02
distributor skills — digikey, mouser, lcsc, element14

Part Sourcing + Symbol Pull

Distributor workflow skills resolve vague component choices into concrete MPNs, datasheets, and pricing. KiCad symbols are pulled directly from DigiKey and JLCPCB — no manual library management.

DIGIKEY SYMBOLS JLCPCB SYMBOLS MOUSER LCSC
ENGINE
03
circuit_weaver.dispatcher — normalize_design_spec(), validate_design()

Build the Canonical Spec

Assembles part bindings, block topology, support-circuit requirements, and all overrides into a single machine-readable YAML design IR.

DESIGN IR YAML
04
circuit-weaver generate design.yaml -o ./output   ★ CORE

Generate Schematics

Emits .kicad_sch files, placement hints, review SVGs, and design reports. Auto-generates bypass caps, support passives, and topology motifs from the YAML spec. Runs a 14-point validation pipeline.

AUTO PASSIVES 14-POINT VALIDATION KICAD SCH
05
KiCad Schematic Editor — manual review pass

KiCad Review + Human Polish

Generated schematics are typically ~90% complete for serious hardware work. The last editorial pass — page aesthetics, label readability — is done in KiCad.

HUMAN REVIEW KICAD APP
OUTPUTS
06
circuit-weaver optimize-placement  ·  KiCad PCB  ·  Freerouting

PCB Update + Route

Pull the schematic into KiCad PCB, place parts with the simulated-annealing optimizer, route critical nets manually. Use autoroute / Freerouting for non-critical nets where it actually helps.

KICAD PCB PLACEMENT OPTIMIZER FREEROUTING
07
circuit-weaver export-jlcpcb  ·  export-gerbers  ·  cost-bom

Quote-Ready Manufacturing Package

BOMs, sourcing data, review artifacts, and KiCad files ready to hand to PCBWay, JLCPCB, or your preferred fabrication vendor.

PCBWAY JLCPCB GERBERS BOM

The Complete Artifact Bundle

Every circuit-weaver generate run emits a full set of manufacturing-ready outputs — not just the schematic.

.kicad_sch KiCad Schematic

Real, loadable .kicad_sch file — opens directly in KiCad 8+ with all symbols, nets, and annotations intact.

_review.html HTML Review Report

Validation results, per-IC component selection rationale, DFM score, and BOM — rendered in a self-contained HTML file for design review.

_test_points.csv Test Point Map

Auto-detected power, ground, clock, bus, and differential-pair nets — annotated on the schematic and exported as a CSV for bring-up probing.

bom.csv / cpl.csv JLCPCB BOM + CPL

Upload-ready assembly files for JLCPCB — BOM with LCSC part numbers and a centroid placement file matched to the PCB footprints.

.ioc / sdkconfig Firmware Stubs

MCU pin map CSV, STM32 .ioc skeleton, and ESP32 sdkconfig.defaults — generated automatically for every MCU block in the design.

enclosure.scad Enclosure Model

Parametric OpenSCAD enclosure automatically sized to the PCB outline — ready to render to STL and 3D-print.

placement.svg Placement SVG

Editable placement diagram — modify component positions in Inkscape, then import directly back into the KiCad PCB file using import-placement.

.kicad_pcb PCB File

Initial KiCad PCB with zone-based component placement — power zone, digital zone, RF zone, connector zone, and passive banks pre-arranged by topology.

.design_log.json Research Artifact Persistence

Design log traces every research decision, IC selection rationale, and spec mutation — persisted across sessions for a full audit trail.

Structural

Topology, connections, hierarchy coherence

PASS

Electrical

Power, ground, net integrity, ERC pass

PASS

Implementation

Part bindings, footprint assignments, MPNs

PASS

Presentation

Labels, pin numbers, net names, readability

PASS

Thermal

Hotspot proximity, power dissipation clustering, thermal constraint violations

PASS

Signal Integrity

Timing checks, differential-pair balance, signal quality across critical nets

PASS

Power Domains

Rail isolation, domain boundary coherence, pin coverage across power network

PASS

KiCad schematic generation needs real validation.

Most automation tools stop at "did the output file exist." Circuit Weaver runs a 14-point validation pipeline covering electrical safety, thermal constraints, signal integrity, and power domains — so the schematic is structurally sound and review-ready before you ever open KiCad.

Failures are grouped and labeled. You know exactly what category failed and why, not just that something went wrong in the hardware design workflow.

~90%
Programmatic automation Heavy lifting: requirements, part binding, support circuitry, validation, sheet generation, report generation
~10%
Human judgment in KiCad Page aesthetics, editorial cleanup, readability decisions that are inherently design-specific

What This KiCad Automation Engine Does

A complete electronic design automation surface, not a collection of one-off scripts.

Schematic Generation

Emits real .kicad_sch files from a canonical YAML spec. Auto-adds bypass caps, support passives, and topology motifs. Outputs review-ready SVGs and design reports.

Strict Validation

14-point pipeline covering electrical safety, thermal constraints, signal integrity, power domains, and pin coverage. The output must be loadable, coherent, sourced, and reviewable — not just "did the export finish."

Transactional Patching

Apply design mutations atomically — reject on failure, never silently corrupt the spec. Diff two canonical designs semantically. Ingest PCB feedback as constraints back into the spec.

BOM, Sourcing + Symbol Pull

KiCad symbols pulled directly from DigiKey and JLCPCB — no manual library hunting. Mouser, LCSC, and PCBWay workflow skills resolve the rest: MPNs, package decisions, datasheets, and pricing.

HTTP API Service

A full FastAPI server wraps every engine capability over HTTP. Generate schematics from YAML, validate specs, apply patches, and diff designs — all accessible over REST.

AI

Agent-Compatible

Designed as a machine-readable contract. Codex, Claude, and any LLM-based agent can validate, patch, diff, and generate through the Python API or HTTP endpoints predictably.

PCB Placement Optimizer

Simulated annealing optimizer with --strategy thermal minimizes overlap, thermal clustering, and DFM zone penalties. Interactive HTML viewer with thermal heatmap overlay and net highlight. Inkscape SVG round-trip: export → edit → import back into KiCad PCB.

FW

Firmware Co-Design Export

Auto-generates {project}_pinout.csv, a STM32 .ioc skeleton, and ESP32 sdkconfig.defaults for every MCU block — keeping firmware pin assignment in sync with the schematic without manual hand-off.

Auto Test Point Generation

Runs inside every generate_artifacts() call — classifies power, ground, clock, bus, and differential-pair nets, annotates the schematic with TP labels, and emits {project}_test_points.csv for bring-up and debug.

SPICE Simulation

ngspice integration runs circuit simulation directly from the YAML spec — verify operating points, transient response, and AC characteristics before committing to layout.

Thermal Analysis

Identifies and visualizes thermal hotspots across the board. Power dissipation per component feeds directly into the placement optimizer's thermal-aware strategy.

Signal Integrity Assessment

Timing and signal quality checks across critical nets. Differential-pair balance, net length constraints, and crosstalk flags surface before schematic sign-off.

0-100

Confidence Scoring

0–100 design readiness score synthesized from validation results, resolver coverage, simulation outcomes, and DFM checks — one number that summarizes design state.

Real Designs, Generated End-to-End

Nine complete reference designs — YAML spec to validated KiCad schematic, BOM, and placement files. Click any card to explore.

Browse all samples on GitHub ↗

PCB Placement Workflow

From topology-aware zone layout to panelization — a six-step pipeline for going from schematic to manufacturable PCB placement.

1

Generate Initial Placement

Topology-aware zone layout: power zone, digital zone, RF zone, connector zone, and passive banks — emits placement.svg and design.kicad_pcb.

$ circuit-weaver generate design.yaml -o ./output
2

Optimize with Simulated Annealing

Minimizes overlap, boundary violations, thermal clustering, and DFM zone penalties. Thermal-aware strategy reduces hotspot proximity.

$ circuit-weaver optimize-placement design.yaml --strategy thermal --iterations 10000
3

Review in Interactive Viewer

Click-to-highlight nets, component hover tooltips (value, footprint, MPN), thermal heatmap overlay (blue→red by power dissipation), CSV export.

$ circuit-weaver placement-viewer design.yaml -o output/viewer.html
4

Edit in Inkscape → Import Back

Edit component positions in Inkscape using the exported SVG, then import edits directly back into the KiCad PCB file.

$ circuit-weaver import-placement placement.svg board.kicad_pcb board_updated.kicad_pcb
5

Write via KiCad API

For KiCad 8+: write placements directly through the pcbnew API without the SVG round-trip.

from circuit_weaver import (
  check_kicad_available,
  update_board_placements,
)
6

DFM Check + Panelization

Run DFM rules against JLCPCB constraints, then panelize for multi-up fabrication and export dual CPL files.

$ circuit-weaver check-dfm design.yaml
$ circuit-weaver panelize design.yaml
$ circuit-weaver export-dual-cpl design.yaml

KiCad Automation API for Hardware Design Workflows

Every engine capability is exposed over HTTP so you can run it locally or deploy it as a circuit design API.

GET
/health
Service health check — version, engine status, capability report
GET
/templates
List component resolver configurations and available design presets
POST
/generate
YAML spec → ZIP of .kicad_sch files + design report
POST
/generate/from-bom
CSV BOM file upload → ZIP of schematics
POST
/validate
YAML spec → full validation results JSON
POST
/mvp/validate
Canonical spec → mvp_strict grouped validation report
POST
/mvp/generate
Canonical spec → full KiCad artifact ZIP (strict mode)
POST
/mvp/apply-patch
Transactional patch application + re-validation
POST
/mvp/diff
Semantic diff between two canonical design specs
POST
/mvp/pcb-feedback
Merge PCB layout feedback back into the design spec

What's New in v0.30.5

Sprints 40–50 shipped the MCP server, data-driven architecture migration, 1009+ regression tests, and the end of legacy template classes — all available now via pip install circuit-weaver.

Sprint 44 MCP Server for AI Agents

New circuit-weaver-mcp entry point exposes validate_design, generate_artifacts, discover_projects, and research_component over FastMCP — Claude Code and other AI agents can drive the engine directly via tool calls.

Sprint 44 Label Collision Avoidance

Dense sheets no longer produce overlapping net labels. _resolve_label_collisions() detects bounding-box overlaps and shifts conflicting labels along their wire-stub direction — same-name labels are correctly skipped.

Sprint 44 Validate-All Regression Gate

All 14+1 bundled sample YAMLs (including zigbee_humidistat) now validate clean. CI enforces zero hard errors across the full corpus — sample regressions are caught on every push.

Sprint 44 Sourcing Auditor Alternates

When a component has CRITICAL or WARNING sourcing risk, the auditor now queries LCSC and DigiKey for functionally similar parts and appends alternate suggestions — so you always have a fallback before ordering.

Sprint 44 Wire-Crossing Minimization

The placement engine scores and penalizes crossing-dense layouts via _count_wire_crossings(). Bus signal groups (4+ numbered nets with a shared prefix) are detected for future parallel routing optimization.

Sprint 44 JLCPCB Price-Break Detection

Assembly export queries LCSC pricing and flags any component where ordering quantity 100 saves ≥20% vs quantity 1. Price-break alerts appear in the assembly README alongside the generated BOM.

Sprint 45–47 JLCPCB Assembly Variants

generate_assembly_variants() now supports include_refs, exclude_refs, and dnp_refs subsets — each variant writes its own BOM and CPL alongside the default output files.

Sprint 45–47 BME688 Bundled IC Data

BME688 sensor pin and footprint metadata now ships in the bundled IC database. IoT_AQ_Sensor_v2 resolves and generates without any local custom.json registration — works out of the box after pip install.

Sprint 40 Report-Fidelity Diagnostic

report.verify_report_fidelity() flags component refs, net names, or annotations mentioned in the HTML report that have no backing wires in the resolved design — catching ghost features before sign-off.

Sprint 40 Five-Archetype Generation Corpus

End-to-end generate_artifacts() regression tests across LED driver, IoT sensor, motor controller, USB bridge, and FPGA power carrier — enforcing all output invariants on every CI run.

Sprint 50 Data-Driven Architecture Migration

Buck, boost, buck-boost, and LDO legacy template classes deleted and replaced with DataDrivenTemplate + topology builders. 34 parity tests, 1009+ passing in full suite. CAN transceiver, EEPROM, and protection templates also migrated.

Sprint 49 Legacy Template Deletion

Flipped SubcircuitRegistry.get() to data-driven-first resolution. Deleted 4 power-stage legacy templates (buck/boost/buck_boost/ldo) after porting to build_generic. Full-suite failures down from 26 to 20.

Sprint 48 Release Validation & Hardening

Windows cp1252 console crash fixes, TLV3691 comparator template with threshold divider, battery-holder footprint upgrades, footprint library readiness checks, and clean JSON error output on invalid generate CLI calls.

generate.py
# Install
# pip install circuit-weaver

from circuit_weaver.dispatcher import (
    validate_design,
    apply_design_patch,
    generate_artifacts,
    diff_designs,
    ingest_pcb_feedback,
)

# Load your canonical spec
spec = yaml.safe_load(open("design.yaml"))

# Validate (14-point pipeline)
report = validate_design(spec)

# Apply a transactional patch
result = apply_design_patch(spec, patch)

# Generate the full KiCad bundle
bundle = generate_artifacts(
    spec,
    output_dir="out/design",
    profile="mvp_strict",
)

Python-first KiCad automation in minutes.

Install the package, point it at a YAML spec, and generate real KiCad schematics without building bespoke hardware automation scripts.

validate_design(spec)

14-point validation pipeline — returns a structured report covering electrical safety, thermal, signal integrity, power domains, and pin coverage

apply_design_patch(spec, patch)

Atomic in-memory mutation — reject on failure, never silently corrupt the design state

generate_artifacts(spec, output_dir)

Emits the full KiCad bundle: .kicad_sch files, placement hints, review SVGs, and a design report

diff_designs(old_spec, new_spec)

Semantic change report — understand exactly what changed between two design revisions

ingest_pcb_feedback(spec, pcb_feedback)

Feed PCB layout feedback back into the canonical design spec as layout constraints

CLI Reference

Every command, organized by workflow stage. Run circuit-weaver --help or circuit-weaver <subcommand> --help for full flag reference.

Design Lifecycle
$ circuit-weaver validate design.yaml
$ circuit-weaver generate design.yaml -o ./output
$ circuit-weaver erc output/design.kicad_sch
$ circuit-weaver diff old.yaml new.yaml
Placement
$ circuit-weaver optimize-placement design.yaml --iterations 5000 --seed 42
$ circuit-weaver placement-viewer design.yaml -o output/viewer.html
$ circuit-weaver import-placement placement.svg board.kicad_pcb out.kicad_pcb
$ circuit-weaver check-dfm design.yaml
$ circuit-weaver panelize design.yaml
$ circuit-weaver export-dual-cpl design.yaml
BOM & Manufacturing
$ circuit-weaver cost-bom design.yaml --qty 1,10,100
$ circuit-weaver export-jlcpcb design.yaml -o ./jlcpcb
$ circuit-weaver export-gerbers design.yaml -o ./gerbers
Design Tools
$ circuit-weaver simulate design.yaml
$ circuit-weaver confidence design.yaml
$ circuit-weaver design-enclosure --board-width 50 --board-height 40
$ circuit-weaver harvest-specs design.yaml
$ circuit-weaver fetch-spice design.yaml

Agent Platform Support

Circuit Weaver ships as a global skill for Claude Code, Codex, and OpenCode — one install command wires it up to your agent workflow.

Claude Code

Global /circuit-weaver skill installed via install-skills. Run directly in Claude Code terminal sessions — validates, patches, and generates without leaving your editor.

/circuit-weaver
Codex

AGENTS.md guidance file and global ~/.codex/skills install. Codex agents can call validate, generate, and diff operations natively.

~/.codex/skills/circuit-weaver
OpenCode / Kilo

opencode.json and .agents/skills/ shims for full compatibility with OpenCode and Kilo agent workflows.

.agents/skills/circuit-weaver

One-time setup

# Install the package
pip install circuit-weaver

# Register skills for all platforms
circuit-weaver install-skills

# Launch in your agent
/circuit-weaver

What It Is, What It's Good At, and What It's Not

Honest answers about Circuit Weaver — capabilities, differentiators, and current limits.

What is Circuit Weaver?

Circuit Weaver is a spec-first, AI-assisted circuit design system. Describe the design, validate it through a real intermediate model (DesignIR), and generate real KiCad schematics — not stubs, not templates, not chat artifacts. The same engine serves every entry point: Claude Code skill, Codex agent, CLI wizard, HTTP API, or direct Python import.

What makes it different from a prompt wrapper around KiCad?

Three things. First, a real intermediate model — DesignIR is a typed, structured representation that every tool reads from, not a string buffer of chat prompts. Second, a layered architecture — skills and docs on top, deterministic Python validation/compilation/generation beneath, communicating through the IR not through prompt engineering. Third, auditable provenance — every IC choice, research citation, and session decision is logged to .design_log.json so design rationale survives the chat session that produced it.

What is Circuit Weaver best at?

Speed to structure. Turning a fuzzy embedded-board idea into a structured, reviewable artifact set — fast — is where we win. Validation that means something. Placement-readiness is hard-gated, not a cosmetic warning bucket. Full lifecycle coverage. Requirements → IC selection → schematic → confidence scoring → placement prep → manufacturing export — most tools stop at one stage. Reusable core. Same engine serves CLI, agents, API, and imports. No per-platform fork.

What are the current limitations?

Best on standard embedded boards. Weaker on odd parts, custom pinouts, exotic buses, RF, and unusual power trees. Part metadata is everything. If IC data, pin maps, or footprint bindings are weak, the experience degrades fast. Validation edge cases remain. False positives still exist in some corners. Workflow can drift from engine. Skills, docs, and runtime constraints need active synchronization. PCB closure is not push-button. Final routing, layout judgment, and fab signoff remain manual — we accelerate the front 80%, not the last mile.

Does it generate real KiCad schematic files?

Yes. Circuit Weaver generates real .kicad_sch files, review artifacts, and validation reports — the output moves into actual engineering review and PCB implementation, not a dead-end diagram.

Does Circuit Weaver support PCB placement optimization?

Yes. The simulated annealing optimizer runs with circuit-weaver optimize-placement, supports thermal-aware strategy, and produces topology-aware zone placement (power, digital, RF, connector, passive banks). An interactive HTML viewer shows a thermal heatmap and net highlights. Placements export as SVG, round-trip through Inkscape, and import back into KiCad.

What firmware and manufacturing outputs does it generate?

Firmware co-design stubs: {project}_pinout.csv, STM32 .ioc skeleton, and ESP32 sdkconfig.defaults. Auto test points: power, ground, clock, bus, and differential-pair nets get annotated TP labels and a {project}_test_points.csv. Manufacturing: BOM and CPL export for JLCPCB and PCBWay, with LCSC part matching, price-break detection, and assembly variant support.