Skip to content

About

Agent skill for drawing and reviewing readable electronic schematics without changing connectivity

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

Schematic Readability

An agent skill for drawing, reviewing, and repairing electronic schematics that are both electrically faithful and actually readable.

Most schematic automation can prove a drawing is electrically correct. Almost none can tell you whether a human can read it. This skill closes that gap with a deterministic readability score, a render-review loop, and a hard rule that readability work may never change the netlist.

Gate layer  (binary, must all pass)
  netlist unchanged  +  schCheck zero errors and zero warnings
  +  pre-write pin and geometry gate

Score layer (continuous 0-100, advisory)
  readability score with per-category breakdown and a worst_category pointer

The gates outrank the score. A high score never excuses a failed gate, and a clean electrical check does not mean the schematic is readable - that is precisely why the second layer exists.

What It Covers

  • Placement grammar for analog blocks: functional islands, current mirrors, differential pairs, cascode stacks, protection networks.
  • Full visual bounds rather than body-only boxes - symbol body, pin figures, pin names, instance name, parameters, power pins, stubs.
  • Symmetry as an explicit constraint with a caller-supplied axis, never inferred from net names.
  • Routing and annotation hygiene: orthogonal routes, no wires through symbol bodies, no ambiguous four-way junctions, consistent label height, clearance from text and pins.
  • External interface banks: pin access points on the symbol border, pin figures outside, names inside, a confirmed bank pitch.
  • Connection-signature safety: compute a connectivity signature before and after a cosmetic change and refuse the write if any net changed.
  • Cross-tool adapters for KiCad, LTspice, QSpice, xschem/XCircuit, standalone SVG/PDF/EMF/HTML figures, and code-driven figure builders (SchemDraw, Circuitikz, matplotlib, in-house generators), where a generator supplies coordinates and the library owns the render.

Cadence Virtuoso / OA is the authoritative adapter. Rules borrowed from other tools are marked as such and never silently promoted to OA truth.

The Construction Handbook

SKILL.md states the contract - what must hold, and what each write needs authorized. The construction handbook states the procedure - what to actually do, in what order, and why that order matters.

Its organizing idea is one sentence: a schematic is a lossy visual encoding of a netlist, and readability is how quickly and reliably a competent engineer can decode it back. Every rule in the skill follows from that, and the handbook makes the link explicit - each rule is paired with the specific decoding failure it prevents.

The seven phases:

0  Freeze before drawing   contract, grid, exemplar, authorization, backup
1  Read the circuit        idioms, islands, flow direction, symmetry axes
2  Budget the canvas       full visual envelopes, on-grid coordinates
3  Place                   spine first, mirrors as exact pairs, no overlap
4  Route                   escapes from real geometry, trunks, no crossings
5  Annotate                labels, text, frames, notes
6  Verify                  two gates, geometry review, score, render review
7  Deliver                 a two-layer report with explicit evidence levels

Phases are ordered because most unreadable schematics are the product of starting at phase 3. Two sections are worth reading even if you never follow the rest: the structural cookbook (detection signatures and placement recipes for differential pairs, current mirrors, cascode stacks, tail sources, level shifters, transmission gates, bias ladders, and digital cells) and the failure catalog (eighteen defects with their root causes and the early check that catches each).

Layout

SKILL.md                                        entry point and reference map
README.md                                       this file
ATTRIBUTION.md                                  upstream credits and evidence levels
LICENSE                                         MIT
CALIBRATION.md                                  calibrate the skill for your project
CALIBRATION.ja.md                               the same, in Japanese
CALIBRATION.zh-TW.md                            the same, in Traditional Chinese
references/
  construction-handbook.md                      the end-to-end construction procedure
  readability-rules.md                          cross-tool rules with evidence grades
  readability-scoring.md                        score model and render-review loop
  layout-algorithms.md                          placement and routing algorithms
  tool-adapters.md                              per-tool mapping and exclusions
  figure-builder-pipeline.md                    code-driven figures: silent failure modes, measurements
  compact-functional-block-style.md             analog island style guide
  hierarchical-mixed-signal-readability.md      hierarchy, pin banks, mixed signal
  generation-failure-prevention.md              scripted-transaction gates and stop conditions
  batched-testbench-source-transaction.md       batch testbench source/instance contract
  review-checklist.md                           pre- and post-generation checklists
scripts/
  validate_spectre_hierarchy_contract.py        producer/consumer contract checker
  test_validate_spectre_hierarchy_contract.py   its tests
  audit_figure_svg.py                           readability audit of a figure-builder SVG export
  test_audit_figure_svg.py                      its tests
  thin_wide_wires.il                            wide-path to thin-line converter
  fixtures/                                     example contract, netlists, SVG fixture

The two Python checkers and their tests use the standard library only and run under Python 3.9 and later:

python3 scripts/audit_figure_svg.py drawing.svg --expect-texts 12
python3 scripts/test_audit_figure_svg.py

Calibrating For Your Project

The shipped values are starting points, not measurements. Several are marked [calibrated] for exactly that reason.

Calibrating This Skill For Your Project - also available in 日本語 and 繁體中文 - walks through the three axes that make the output match your house style:

  1. Exemplar calibration. Draw a five-transistor OTA with the skill as-is, then compare it against one you drew yourself and feed the differences back. Repeat until a fresh run reproduces your exemplar's grammar.
  2. Grid requirements. Declare your project's lattice, pin-bank pitch, label height, and half-grid policy. Every geometry rule derives from this, so settle it first.
  3. Note requirements. Fix your conventions for in-drawing annotations and for the delivery record, so a drawing reads as finished to your reviewers.

Installing As A Skill

Copy the directory into your agent's skill folder, for example:

cp -R schematic-readability ~/.codex/skills/cadence-schematic-generation-readability

The skill is plain Markdown plus two scripts. There is nothing to build and no dependency to install. The Python checker uses the standard library only.

Evidence Grades

Every borrowed rule carries a grade, because a rule copied from another tool is not evidence that it holds in yours:

Grade Meaning
[verified] Read line by line in the upstream source during the 2026-10-04 survey, or measured in a live session (the figure-builder findings, 2026-10-11)
[read] Read in upstream prose documentation
[reported] Reported by a parallel survey pass; not independently verified
[calibrated] This skill's own starting value, with no external validation

The score formula and its weight table are [verified]: they were read directly out of the one upstream project that publishes a deterministic implementation (see ATTRIBUTION.md). The figure-builder section of references/figure-builder-pipeline.md is [verified] by measurement rather than by reading - eight behaviour classes were reproduced on a shipped SDK. Its own thresholds are not adopted: that project's acceptance documents contradict each other, so they are quoted as failure examples only.

Honest Limits

  • The skill does not establish circuit function, simulation correctness, DRC/LVS, or signoff. It governs drawing and review only.
  • A clean schCheck is necessary but never sufficient for readability.
  • The readability score is a directional proxy. The upstream implementation it is based on states plainly that the render is the ground truth, and that a score is only a fast way to decide what to fix first.
  • Text-extent checks are estimates, since schematic databases do not store rasterised text boxes. Findings derived from them are marked as estimates. For a code-driven figure, settle text collisions with a pixel mask instead.
  • A code-driven figure builder fails quietly: a device name passed through a keyword the builder ignores, a branch that stops a fraction of a unit short of its pin, and an argument that is never read all produce a drawing that looks finished. None of the three is visible in the image; they need the text inventory, the endpoint-to-pin distance, and a parameter-difference check.
  • Stopping rule: when a full repair pass produces no applicable change, stop - even if the score is still below target. The remaining gap needs human judgement, not more automated nudging.

Non-Negotiable Rules

These are the invariants the whole skill is built around:

  1. A readability change must not change the netlist. Snapshot the (instance, terminal) -> net mapping before and after and require an exact match. If a readability goal cannot be met without moving a terminal to another net, stop and report the conflict.
  2. Never save a schematic that is not warning-free. Floating, dangling, or unused wire and label objects are defects to fix, not noise to accept.
  3. An instance-terminal binding alone is not reviewable. Every terminal needs visible geometry or a short stub plus an unambiguous net label, and every visible wire must be bound to its real net.
  4. Never exchange terminals for appearance. Drain, source, gate, and bulk assignments are frozen during layout work. A cleaner drawing with an unexplained terminal change is a failed result.
  5. A label never creates a connection in a schematic database. It names a net. Connectivity comes from coincident geometry and the global-net convention. Any advice of the form "prefer labels over wires" is wrong for this target.

Scope Note

This is a working engineering skill, not a specification. Some rules are dated because they were confirmed in practice on a specific date, and a few record measured evidence from real repair passes. Where a rule is project-specific it says so; do not universalise a project convention into a portable one.

Licence

MIT - see LICENSE. Rules and mechanisms were informed by the public projects listed in ATTRIBUTION.md; no third-party source code is redistributed here.

About

Agent skill for drawing and reviewing readable electronic schematics without changing connectivity

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages