/jitx-skills:jitxfrom jitx-skills
Base skill for JITX Python PCB design: install, CLI, auth, runtime, building designs, viewers, exports, code quality, and design introspection. Use to set up JITX, start the runtime, build or find a design, open the viewer, or fix build/environment errors.
Ships in jitx-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Run this skill's setup before any sub-skill: they assume a working runtime.
Bundle 2.0.0 targets JITX 4.6. This table is the only place the skills name supported versions; the install commands below apply them, and the other skills assume them.
| Package | Release | Install with |
|---|---|---|
jitx (framework and CLI) | 4.6.0 | "jitx>=4.6,<4.7" (Step 1) |
| JITX runtime | 4.6.0 | jitx runtime install (Step 4); its major.minor must match jitx |
jitxlib-standard | 4.6.0 | jitxlib-standard (Step 1); it requires jitx>=4.6,<4.7 |
jitxlib-parts | 2.0.0 | "jitxlib-parts>=2,<3" (Step 1) |
jitxlib-jlcpcb, JLCPCB boards only | 4.0.0 | "jitxlib-jlcpcb>=4,<5" (jitx-jlcpcb, once the user chooses JLCPCB) |
jitxexamples | 2.1.0 | --no-deps "jitxexamples>=2.1,<2.2" (Step 1) |
jitxlib-mechanical, mechanical CAD only | 0.2.0 | pip install --extra-index-url https://pypi.jitx.com/jitx/main/+simple "jitxlib-mechanical==0.2.0" |
pyright.Commands are bash. In Windows PowerShell: use python for python3, activate with .\.venv\Scripts\Activate.ps1, write the [ ... ] || guards as if (-not (Test-Path ...)) and grep -q as Select-String -Quiet, and clear a $env:VAR= setting with Remove-Item Env:VAR when it should apply to one command. On Windows, in PowerShell or Git Bash, the &, pkill and pgrep steps have no verified form: ask the user to run long-lived commands in their own terminal and to close viewers themselves.
In an existing project, activate its venv, read jitx --version, and ask before moving it to another line.
[ -d .venv ] || python3 -m venv .venv
source .venv/bin/activate # Git Bash on Windows: .venv/Scripts/activate
python -c 'import sys; assert sys.version_info >= (3, 12), sys.version'
pip install "jitx>=4.6,<4.7" jitxlib-standard "jitxlib-parts>=2,<3" ruff pyright
pip install --no-deps --upgrade "jitxexamples>=2.1,<2.2"
pip install "eseries>=1.2.1,<2" # the one jitxexamples requirement the lines above don't bring
jitx --version
jitx brings the framework and CLI but no jitxlib: jitxlib-standard gives jitxlib.landpatterns, .symbols, .protocols, .bundles, .via_structures and .physics; jitxlib-parts the Resistor/Capacitor/Inductor queries; jitxlib-jlcpcb, only once the user chooses JLCPCB (jitx-jlcpcb), its substrates and parts. jitxexamples holds the worked patterns, example components and example parts CSV the other skills point at; --no-deps keeps its own pins off the project's jitx and jitxlib-parts. It is a project dependency only when the design imports it (jitx-layout-constraints).
If the assertion fails, recreate .venv with Python 3.12 or newer.
[ -f pyproject.toml ] && grep -q jitx pyproject.toml || jitx project layout init # ask first if files other than .venv exist
pip install -e . "jitx>=4.6,<4.7" jitxlib-standard "jitxlib-parts>=2,<3"
python -c "import jitxlib.landpatterns, jitxlib.parts"
jitx project layout init writes a flat <ns>/ package (not src/<ns>/) and pyproject.toml. Change its jitx>=4.4.0,<5 to jitx>=4.6,<4.7; add jitxlib-parts>=2,<3 to dependencies. Without pip install -e ., jitx find exits 0 listing no designs (import failed: ModuleNotFoundError).
Name a provider chain in pyproject.toml: without one, queries raise NoChainConfigured, unless an installed package publishes one (as jitxlib-jlcpcb does). Commit parts/approved-parts.csv (user-approved parts only) and the build-written parts.lock.json (never hand-made). If the user has none, copy in the example CSV from jitxexamples (jitx-project-builder Phase 0), telling them it is not an approval:
[tool.jitx.parts]
chain = ["csv:parts/approved-parts.csv", "ideal"]
ideal, last, synthesizes unorderable IDEAL-... parts so the design builds before approval, silently answering most queries the CSV cannot. Before calling it done, pass jitx build <design> and jitx design export parts-check <design> --fail all, and check that no MPN starts with IDEAL-: the parts check passes an ideal part. Take an IDEAL- part to the user; change a value or rating only with their sign-off. On the stand-in, the user approves the final build's MPNs or supplies a list. Read parts and IDEAL- MPNs from the design, never from the lock. Run prune_lock.py, excluding test designs, after removing a component or running tests, and before committing the lock. Never delete the whole lock once parts are placed, routed or approved without the user's say-so. Lock care: references/parts-lock.md. Docs: https://docs.jitx.com/en/latest/essentials/design/parts.html
The scaffold skips git init (do it and say so). Its .gitignore keeps the built design directory tracked on purpose: do not broaden it.
jitx auth show prints Authorized: yes | no. On no with a token on disk, jitx auth refresh renews it headlessly. With no account on disk, stop and ask the user to sign in: jitx auth login (opens a browser), the VSCode JITX sidebar, jitx auth login --email <email> --password-stdin for password accounts, or jitx auth install-token for a token a team admin exported. LauncherError: no JITX runtime found means none is installed: do Step 4's install, then return. LauncherError: ... did not produce valid JSON usually means JITX_ROOT points at a dev build: unset it, retry, and tell the user.
Each project runs its own runtime daemon (socket: .socket.jitx).
jitx runtime introspect | grep '"version"'; jitx --version # major.minor must match
grep jitx_version .jitx/runtime.json 2>/dev/null # the running daemon, if any
A mismatch fails like a code bug. If introspect fails or any major.minor differs, ask first: the switch applies to every project on the machine. Honor a pin in $JITX_RUNTIME_VERSION, a jitx.version file or mise.toml with --version, then run jitx runtime install. A pre-release X.Y.ZrcN needs --version X.Y.Z-rc.N --testing, or it can get a production runtime. Install doesn't touch a running daemon: jitx runtime stop here (other projects need it too: tell the user), then repeat the check. Start only once it passes; if it cannot, report a blocker:
jitx runtime status | grep -q reachable || jitx runtime start --background
jitx runtime status exits 0 either way: read its text (reachable at ws://... or not running).
jitx runtime status reads reachable, and jitx find lists the designs with no import failed line. On later runs, repeat Step 4's check and gated start, then this check.
Missing-dependency rule. If the runtime won't start, jitx find errors, or a required import is missing, stop and report a blocker. Never drop or substitute a design requirement to get past it.
| Task | Command |
|---|---|
| List designs | jitx find |
| Build one / all | jitx build <module.path.DesignClass> / jitx build-all |
| Runtime | jitx runtime start --background, status, stop, introspect, cleanup (leaked runtimes; reports unless --kill) |
| Viewers | jitx ui open --board / --schematic [--design <module.path.DesignClass>] |
| Export | jitx design export <plugin> <module.path.DesignClass> |
| Script the open layout | jitx design session <design> > .jitx/session.log 2>&1 &, then jitx design exec <design> script.py (runs main(design); paths start root.). Until the session is up, exec fails with message could not be delivered: retry every 5 s up to a minute. Then, or on a traceback, report what .jitx/session.log says. End with jitx design session --stop <design> |
| Dependencies | jitx project dependencies check |
| Support | jitx support bundle / jitx support request (sends data to JITX: ask first) |
jitx --format json <command> gives JSON.
jitx build prints status: ok or a traceback and status: error. Results land in designs/<module.path.DesignClass>/: cache/design-explorer.json (the module tree, nets kept per module: check connectivity with tests, jitx-circuit-builder "Asserting connectivity in tests", not by parsing it), and design-info/ (interactive placements). Never delete designs/<design> casually. A cryptic No field with key '$_...' after a version change means design-info/ is unreadable by the new pairing: restore it from git and restart the runtime.
--dry is not a build. With no runtime, jitx build exits 1 and offers --dry, which then reports status: ok. It misses failures such as Public name already in use, and never satisfies a step that asks for a build.jitx project dependencies upgrade a build suggests: it can leave the supported versions.jitx find lists a Design whose __init__ takes required arguments, but building it fails with Design is parameterized but no parameters were provided. Add a thin module-scope subclass with concrete values and build that.[Y/n] before deleting stale instances; headless, the build ends EOF when reading a line. The answer is the user's: end your build, tell them what it printed, and rebuild once they answer in the JITX UI or their own terminal. Pipe yes | only when the user says to; PowerShell has no verified equivalent.PYTHONUNBUFFERED=1. If a build shows no output and little CPU for a minute, check jitx runtime status in every other open JITX project, pgrep -fl interactive-client for accumulated clients, and what jitx runtime cleanup reports. Ask before stopping anything.status: ok is not routed copper. Realization is silent: verify geometry from Python (Introspection, jitx-code-layout).jitxlib-ansys) add plugins.Concurrent builds of one design share cache and output: sequence them. Different designs in one project are generally safe: the runtime serializes them.
jitx ui open --board or --schematic opens the jitx-ui viewer on the running runtime (no runtime: exit 1). Pass --design from a script, and background it: it runs until the window closes. Killing the backgrounded jitx ui open leaves the window up: close only the viewer you opened, matched by the runtime port (jitx runtime status) and design, pkill -f "jitx-ui .* <port> design/<module.path.DesignClass>$". Never a bare pkill -f jitx-ui: another viewer is an interactive editor and may hold unsaved edits.
These hold for every JITX skill.
-> None). No # type: ignore and no # pyright: comments: narrow, assert or annotate instead.jitx, pyright reports Import "jitx" could not be resolved: that's the interpreter, not the code, so never "fix" the imports. A tool launched from outside the venv points at it with [tool.pyright] venvPath/venv or pyright --pythonpath.line-length explicitly if anything in the project emits Python. RUF012 flags class-body port arrays (GND = [Port() for _ in range(n)]), which are the declaration model: silence it per file in [tool.ruff.lint.per-file-ignores] with a comment. Moving the ports into __init__ breaks the component.scripts/check.py and scripts/grep_gates.py from this skill into the project's scripts/ and run python scripts/check.py <ns>/ before calling work done. It runs ruff, ruff format, pyright, the grep gates and, with --build, a build. How to disposition a gate hit: jitx-project-builder references/completion-blocks.md.jitx.test.TestCase and python -m unittest discover -s tests. Take expected values from their source (datasheet, fab report, standard, requirement, independent formula), never copied from the tested code: a copy can't tell regressions from fixes. Test designs set parts_lock = Lock(mode=LockMode.OFF) (references/parts-lock.md).jitx-code-review as a self-critique before declaring a task complete.Worked counter-examples for each: references/architectural-patterns.md.
dict[str, X] indexed by f"TX_b{i}" means the structural object is missing. Use lists, @dataclass(frozen=True), or dicts keyed by Ports and structural objects. @provide mappings keyed by Port are the framework's contract, not a parallel model.self by name to find your own children. Declare a list or dict attribute up front: self.lanes: list[DiffPair] = [...].list[dict[str, Any]] "spec" model and iterate it to emit JITX calls. Construct JITX objects directly.Container or Circuit subclass and assign it as a member.self.substrate.signal_via[layer], lp.get_pad(row, col).name= (jitx-circuit-builder, Nets).setattr / getattr, no type(...) to build classes, no JITX subclass defined inside a function. These break instantiation tracking.type() for type checks (use isinstance), no double-underscore members, and no leading-underscore names from elsewhere; a method may call another method on its own class.The design tree exists only inside an instantiation context: a jitx.test.TestCase, or a design submitted to the runtime. Outside one, MyDesign() is an Instantiable placeholder whose traversal yields nothing: an empty result there isn't evidence.
from jitx.copper import Copper
from jitx.inspect import decompose, extract, visit
from jitx.net import Port
from jitx.query import query
from jitx.test import TestCase
class Find(TestCase):
def test_find(self) -> None:
design = MyDesign() # MyDesign, MyResistor: your own classes
for trace, port in visit(design, Port): # str(trace.path) == "circuit.r1.p1"
...
ports = list(extract(design.circuit, Port))
p1, p2 = decompose(MyResistor(), Port)
top = [c for _, c in query(design, Copper, filter=lambda c: c.layer == 0)]
visit yields each structural match with its Trace (path, transform). extract is visit without the trace. decompose stops at direct children, traversing lists and dicts.jitx.query.query takes keyword-only through, opaque, refs and filter and converts objects through registered transformers, such as Pad -> Copper, Via -> Copper, Via -> Cutout and Route -> Copper; a Pour is already Copper. Results are in the source's local frame: compose trace.transform.with jitx.runtime as r: rd = r.submit(MyDesign) gives rd.root, rd.query(...), rd.nets.find(element) (the Net the runtime assigned, or None) and rd.layers. Realized routes and pours need r.capture(...). Capture semantics, verification loop: jitx-code-layout "Verification".Invoke it before writing that code.
| Work | Skill |
|---|---|
| A whole board from requirements: PLAN.md, phases, gates, sub-agents | jitx-project-builder |
| A component from a datasheet, part number, pin file or footprint | jitx-component-modeler |
| Wiring, nets, typed ports and bundles, hierarchy, placement, passives | jitx-circuit-builder |
| Stackup, materials, vias, routing structures, fab rules | jitx-substrate-modeler |
| Pours, copper, shapes, code placement, code-placed vias and routes, realized-geometry checks | jitx-code-layout |
| Place and route in the open layout from scripts (session and exec), editable in the board editor; route status, issues and skew margins | jitx-interactive-layout |
| Design rules, clearances, classes of nets by tag, power widths, pour and relief rules, stitching and fencing, routing structures applied by tag, fanout step-down | jitx-layout-constraints |
| Topology, SI constraints, diff pairs, protocol constraints | jitx-interconnect-constraints |
| provide/require, pin muxing, lane and polarity swapping | jitx-pin-assignment |
| Self-review of JITX code against the rules above | jitx-code-review |
| DXF/IDF/STEP import and export, board outlines, 3D models | jitx-mechanical |
| JLCPCB substrates, parts and order packet, once chosen | jitx-jlcpcb |
One artifact goes to its sub-skill; a buildable board, to jitx-project-builder.
JITX docs live at https://docs.jitx.com/en/latest/ (LLM index: https://docs.jitx.com/llms.txt). For anything unfamiliar, find its page in references/docs-index.md, fetch and apply it. If it doesn't resolve, say so rather than proceed from memory.
evals/cases/build-outputs.json (opens in a new tab)evals/cases/reference/build-outputs/NOTES.md (opens in a new tab)evals/cases/reference/build-outputs/build_outputs_design.py (opens in a new tab)evals/cases/reference/build-outputs/check_build_outputs.py (opens in a new tab)evals/eval-contract.yaml (opens in a new tab)evals/routing.jsonl (opens in a new tab)references/architectural-patterns.md (opens in a new tab)references/docs-index.md (opens in a new tab)references/parts-lock.md (opens in a new tab)scripts/check.py (opens in a new tab)scripts/grep_gates.py (opens in a new tab)scripts/prune_lock.py (opens in a new tab)scripts/test_check.py (opens in a new tab)scripts/test_grep_gates.py (opens in a new tab)scripts/test_prune_lock.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
13 skills in this plugin
/jitx-circuit-builderUse when the user asks to "wire up", "connect", "build a circuit", create an "application circuit", declare a circuit's typed ports or bundles (Power, I2C, RGMII), compose sub-circuits into a hierarchy and connect them port to port, "place components" or sub-circuits (fixed or floating), add passives (resistors, capacitors, inductors) or decoupling, or set up power connections. Covers the Circuit class, nets and the + operator, typed ports, hierarchy, placement, and jitxlib-parts passives. Drawing a pour or copper is jitx-code-layout; pour rules are jitx-layout-constraints; provide/require pin assignment is jitx-pin-assignment./jitx-code-layoutUse when the user asks to write a fixed PCB layout in Python: place vias, and parts relative to another instance (Circuit.place), code routes through control points (RoutePoint, PairPoint, PairInsertion), Route.Sketch, Route.Config, a Route.Target taper, narrowing a route in a BGA field or a fine-pitch pad, escape or fanout geometry fixed by a stated number or pad geometry, a connector launch on its pad axis, serpentine or deskew settings on a matched section, thermal vias in an exposed pad, pours, keepouts, cutouts, Copper or OverlappableCopper (antennas, net ties), or reading the realized layout back (capture, Empty pours, 'Unable to find path'). Sorts control points between code and jitx-interactive-layout. Tag rules, escape width rules, stitching and fencing go to jitx-layout-constraints; stackups, vias and structure definitions to jitx-substrate-modeler; land-pattern mask, paste and thermal pads to jitx-component-modeler; nets and passives to jitx-circuit-builder; timing to jitx-interconnect-constraints.npx claudepluginhub jitx-inc/jitx-skills --plugin jitx-skillsOther plugins' skills for the same job