Skip to main content

AI-driven TikZ circuit schematics: symbol library, renderer, linter, MCP server, xschem bridge

Project description

cictikz

AI-driven TikZ circuit schematics.

Docs: overview · CLI · MCP server · dialect & converters · symbol gallery · domain libraries

A standalone Python package that ships the full aic2026 TikZ macro vocabulary as package data — cictikz_lib (the ckt_lib schematic dialect, grid = 1.6, one transistor tall) plus the domain libraries (boot, constellation, dacsm, esd, gmc, mos, plane, rdac, sc, sfg, spec) — renders figures reproducibly with pdflatex, and exposes the whole loop — discover symbols, render, look at the result — to an AI assistant over MCP. Later phases add a schematic IR with writers/readers for the constrained TikZ dialect and xschem .sch files.

Install

make dev-install        # pip install -e ".[mcp]"

Rendering needs pdflatex (with standalone + circuitikz) on PATH, and pdftoppm (poppler) for PNG / pdf2svg for SVG. Without them the package still imports; render calls fail with a clear message and the render tests skip.

CLI

cictikz render fig.tex --png        # compile a full standalone figure
cictikz render body.tex --wrap      # wrap a bare macro body in the packaged preamble
cictikz symbols [QUERY]             # list the symbol library
cictikz info vnmos                  # pins, entry/exit, example for one symbol
cictikz draw spec.json --fmt tikz   # schematic IR (JSON) -> TikZ or xschem
cictikz tikz2sch fig.tex            # dialect TikZ -> xschem .sch
cictikz sch2tikz circuit.sch        # any xschem .sch -> dialect TikZ
cictikz export-symlib DIR           # generate cictikz/*.sym for xschem
cictikz watch fig.tex               # live preview: recompile on save, browser follows

watch is the iteration loop: edit the file in any editor (or let an AI edit it), and the browser shows the new render half a second later — compile errors appear inline instead of a stale image.

The TikZ-to-xschem direction accepts only the cictikz dialect (registry macros, moves, named coordinates, --/|-/-|/to[short] wires) and fails loudly with a line number on anything else; xschem-to-TikZ works on any .sch, drawing unrecognised symbols as labelled boxes.

MCP

claude mcp add cictikz -- cictikz-mcp

Tools: render_tikz (source → PNG, or the parsed TeX errors), render_file, list_symbols, symbol_info, style_guide, list_examples / get_example (searches a figure corpus; set CICTIKZ_EXAMPLES to a directory of .tex figures).

Figure dialect

Figures are written against cictikz_lib.tex (macro names identical to the aic2026 course repo's ckt_lib.tex): path-fragment macros that compose in one \draw, e.g.

\draw (0,0) \vground \vresistor{$R_s$} \lvnmos{M1}{$v_i$};
\draw (M1.drain) to[short] ++(0,\grid);

See cictikz style-guide (or the MCP style_guide tool) for the house rules: one line width, one arrow tip, colour only when it means something.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cictikz-0.1.1.tar.gz (93.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cictikz-0.1.1-py3-none-any.whl (125.5 kB view details)

Uploaded Python 3

File details

Details for the file cictikz-0.1.1.tar.gz.

File metadata

  • Download URL: cictikz-0.1.1.tar.gz
  • Upload date:
  • Size: 93.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cictikz-0.1.1.tar.gz
Algorithm Hash digest
SHA256 81d9c4f75d6dab1be0998e1f482500880bd0c2270f1af4ff1904015fbe3c8116
MD5 ba7473dfc1fcfa4043b23cc0868dfc3b
BLAKE2b-256 00694f2b3c2f91a0feb222bcf9ce70a32a0b5543d5764c0e6e7809c5d80961cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for cictikz-0.1.1.tar.gz:

Publisher: release.yml on wulffern/cictikz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cictikz-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cictikz-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 125.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cictikz-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d49312472491fe6b50b426d21ded961409e5e3daaa5fcbffab2b2289de41dd6
MD5 a5955d7a50d0dbc8aa4ac05a6ce6c5f6
BLAKE2b-256 25751136987453810ad6ae78a2818e6a4c14140239af141431ac46bdaa030ebe

See more details on using hashes here.

Provenance

The following attestation bundles were made for cictikz-0.1.1-py3-none-any.whl:

Publisher: release.yml on wulffern/cictikz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page