jitx/SKILL.md
Base skill for JITX hardware design workflow. Use for JITX Python projects, PCB design, circuit creation, and build commands. Use when the user asks to "build my JITX design", "set up JITX environment", "create a circuit", "build a complete board", "design a PCB from requirements", or "create a full JITX project". For multi-component designs (3+ components, substrate, circuits), invoke the Project Builder workflow for orchestrated parallel agent execution with quality gates. CRITICAL - If user asks to create/model/generate a component or mentions a part number (NE555, LM1117, RP2040, etc.), immediately invoke jitx-component-modeler subskill. If user asks to create a substrate, stackup, via definitions, or routing structures, invoke jitx-substrate-modeler subskill.
npx skillsauth add jitx-inc/jitx-skills jitxInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Base skill for JITX hardware design automation. JITX is a Python framework for programmatic PCB design.
Before any JITX work, check and fix the environment automatically:
# Check for JITX project
if [ ! -f pyproject.toml ] || ! grep -q "jitx" pyproject.toml; then
echo "ERROR: Not a JITX project (no pyproject.toml with jitx dependency)"
exit 1
fi
# Create venv if missing, install deps
if [ ! -d .venv ]; then
python3 -m venv .venv
source .venv/bin/activate
pip install -e . --quiet 2>&1 | tail -1
pip install ruff --quiet 2>&1 | tail -1
else
source .venv/bin/activate
fi
# Verify core imports (don't check __version__ — not present in all JITX versions).
# Fail loud if any import is missing; do not work around with substitutions.
python - <<'PY'
import sys
required = [
"jitx",
"jitxlib",
"jitxlib.parts",
"jitxlib.symbols.box",
"jitxlib.voltage_divider",
]
missing = []
for mod in required:
try:
__import__(mod)
except Exception as e:
missing.append(f"{mod}: {e}")
if missing:
print("ERROR: missing required JITX modules:")
for m in missing:
print(f" - {m}")
sys.exit(1)
print("JITX core ready")
PY
Also probe the target substrate package if known (e.g., python -c "import jitxlib.jlcpcb" when the user has chosen JLCPCB). For complete-board tier, the Phase 0 → 1 gate requires this probe.
Missing-dependency rule: if any required import fails, stop and surface it to the user as a blocker. Do NOT remove or substitute design requirements as a workaround (e.g. dropping controlled-impedance routing because jitxlib didn't import). See references/project-builder-flow.md Recovery Procedures → "Missing dependency escalation".
Only install deps on first run (venv creation). Skip pip install on subsequent runs — it's slow and noisy. Don't ask user to do manual setup.
Pyright is available for Python type checking:
Install:
pip install pyright
or
npm install -g pyright
Verify: Ask Claude to "check for type errors" or run manually:
pyright src/
Durable rules for JITX Python user code. The first three don'ts protect JITX's internal instantiation tracking; the rest are standard Python encapsulation discipline.
setattr / getattr. They exist for very narrow scenarios; JITX user code is not one of them. Use lists/dicts when you need to store a programmatic collection on self.type(...) to construct a new class on the fly. This breaks JITX's internal instantiation tracking. Express the same intent with parameterized classes — instantiate, don't synthesize.type() for type checks. Use isinstance so subclasses are handled correctly.ruff check for common-mistake analysis (the ruff package is already installed by the environment-setup step).ruff format for style consistency.# Build a specific design
python -m jitx build <module.path.DesignClass>
# Build all designs in project
python -m jitx build-all
Don't run parallel builds on the same design. Concurrent JITX builds against the same design aren't reliable — cache state, build artifacts, and design-explorer output overlap. Sequence those. Parallel builds of different designs in the same project (different test designs, different module paths) share the WebSocket session but are generally safe — the JITX backend serializes internally, possibly with a wait. The skill orchestrator's Phase 1 runs sub-agents in parallel on different test designs; the parallelism is at the design-work level, and concurrent builds on distinct designs are an acceptable consequence.
Success output: status: ok
Error output: Python traceback or status: error
Output files (in designs/<design_name>/):
cache/netlist.json - JSON netlist for verificationcache/design-explorer.json - Design hierarchydesign-info/stable.design - Design snapshotStandard JITX project layout:
project/
├── pyproject.toml # Project config with JITX deps
├── src/<namespace>/
│ ├── components/ # Custom component definitions
│ │ ├── <category>/ # mcus, connectors, power, etc.
│ │ │ └── <mfr>_<mpn>.py
│ │ └── __init__.py
│ ├── circuits/ # Reusable circuit blocks
│ └── designs/ # Top-level designs
├── designs/ # Build output directory
└── .venv/ # Virtual environment
STOP. Classify first. Before any architecture proposal, parts research, design prose, code, or
Skill(...)invocation other than environment probes, your first observable action must be a chat line of the form:Workflow tier:
single-task|complete-board— because<one-sentence reason>For
complete-board, the next observable action must be writingPLAN.md(andARCHITECTURE.md). Verbal architecture proposals, parts-list bullets, "here's what I'll build" prose, orWrite(...)of code beforePLAN.mdexists are explicitly invalid work for a complete-board project — they must be backed out before the workflow can continue.If you find yourself already typing "Big design — here's my proposed architecture..." or "I'll set up the skeleton and start filling in components", you have skipped Phase 0. Stop, classify, and create
PLAN.mdfirst.This callout exists because the prior failure mode was exactly this: the agent jumped from request to architecture prose to component files without classifying, never entered Phase 0, and bypassed every Pass 1–5 enforcement.
After environment setup, classify the work into one of two tiers. The tier names which output blocks are required and whether the formal Phase 0 → Phase 4 chain applies. Every tier requires a task acceptance block for each unit of work — no exceptions.
| Tier | When | Required output | Path | |------|------|-----------------|------| | single-task | One subskill against one artifact: a component, a circuit, a substrate, a constraint set, a pin-assignment wrapper. No top-level assembly. | Task acceptance block in chat | Invoke the subskill directly | | complete-board | Anything beyond a single isolated artifact — anything that produces a buildable board, no matter how few components. | Task acceptance block per task + phase exit gate blocks + Phase 3b audit + Phase 4 verification | Full Project Builder Workflow below |
If you're tempted to call something "small" or "trivial" to avoid the workflow, classify it as complete-board. The Phase 0–4 ceremony is cheap on a small board (a few extra block emissions); the cost of skipping it on a real board is shipping with required features missing. The original failure mode of this skill was exactly the "looks small, skip the workflow" escape hatch.
For tier definitions, the task acceptance block, phase exit gate blocks, the Phase 3b design audit block, and the Phase 4 verification block: read references/completion-blocks.md.
Do NOT skip the planning phase for complete-board designs. Do not start exploring libraries or writing code until PLAN.md exists.
Circuit: Python class inheriting from jitx.Circuit. Contains components and connections.
Component: Python class inheriting from jitx.Component. Defines ports, landpattern, symbol.
Design: Python class inheriting from design base (e.g., SampleDesign). Top-level entry point.
For net wiring, passives, and circuit patterns, invoke the jitx-circuit-builder subskill.
For building complete JITX designs from requirements — multiple components, substrate, circuits, and constraints assembled into a working board. Use this when the design involves 3+ components with a substrate and interconnected circuits.
| Phase | What | Parallelism | |-------|------|-------------| | 0 | Requirements analysis, decompose into tasks, create PLAN.md | Orchestrator only | | 1 | Model substrate + all components | Fully parallel sub-agents | | 2 | SI constraints, pin assignment, circuit wiring | Clustered parallel | | 3 | Top-level assembly (instantiate, connect, constrain) | Single agent | | 3b | Design-level analysis + loopback (voltage domains, bus contention, missing components, SI) | Orchestrator — loops back to fix upstream | | 4 | Build, verify DRC + SI, iterate on failures | Single agent |
For full phase details and gate criteria: read references/project-builder-flow.md
For how to decompose requirements into tasks: read references/decomposition-guide.md
For PLAN.md format: read references/plan-template.md
For ARCHITECTURE.md format: read references/architecture-template.md
Concurrent builds of the same JITX design share cache state, build artifacts, and design-explorer output. Sequence them. Concurrent builds of different designs in the same project — for example, parallel sub-agents each building their own component test design — share the WebSocket session but are generally safe: the JITX backend serializes the work internally, possibly with a wait.
For the project-builder workflow: Phase 1 sub-agents can run in parallel, each working on its own component file and its own test design. They are not running concurrent builds of the same design. Phase 2/3/4 builds are inherently sequential.
For ad-hoc work outside the project-builder flow: just don't run two python -m jitx build calls against the same design at once.
Copy scripts/grep_gates.sh from this skill into the project's scripts/ directory. Sub-agents (and the orchestrator at every phase exit gate) run it against src/<ns>/ to enforce JITX code conventions and top-level-only rules:
bash scripts/grep_gates.sh src/<ns>/
The script reports hard-fail hits (which block task acceptance and gate transitions) and review-required hits (which need a disposition in the task acceptance block). Pattern set and disposition rules: references/completion-blocks.md "Grep Gate Patterns".
Sub-agent work goes through TWO quality checks before being accepted:
1. Sub-Agent Self-Validation ("Think Twice")
After initial implementation, sub-agents MUST stop and run the domain-specific checklist against the datasheet before returning. This forced second pass typically catches 3-5 missed details (floating enable pins, missing thermal pads, wrong output types, forgotten decoupling). Sub-agents return a task acceptance block documenting what they checked and fixed — the block is mandatory; "build clean" is not a substitute. See references/completion-blocks.md for the template.
2. Orchestrator Acceptance Review
The orchestrator does NOT blindly trust the self-validation block. For each returned task:
python -m jitx build for critical tasks)A task without an acceptance block is in-progress, not done. Phase gates only open when ALL tasks in the phase have Verdict (acceptance): accept blocks.
For the full protocol: read references/task-execution.md
For block templates: read references/completion-blocks.md
For domain checklists: read references/domain-checklists.md
| Gate | Key Criteria | |------|-------------| | 0 → 1 | PLAN.md created with all tasks, data source audit approved, user approved plan | | 1 → 2 | All components + substrate build individually, acceptance reviews passed | | 2 → 3 | All circuits build, constraint classes valid, provide/require interfaces consistent | | 3 → 3b | Top-level assembles, all nets connected, power tree complete | | 3b → 4 | Design-level analysis passed: voltage domains correct, no bus contention, no missing components, SI constraints functional. All blocking issues fixed via loopback. |
Do NOT proceed past a gate if any task has unresolved failures. Fix upstream before moving downstream.
Claude selects parts based on engineering requirements first. Data for each component comes from the user-approved data source plan (see Phase 0 data audit).
Data sources (in priority order):
parts2jitx — split consent. Lookup / evidence (parts2jitx-lcsc <C-number>, --pinout) is implied when the user names LCSC/JLCPCB as the channel; the orchestrator may pip install parts2jitx automatically. Footprint data ingestion (parts2jitx-lcsc --footprint, parts2jitx-kicad) is a separate path that requires explicit per-project user approval because EasyEDA component data has its own terms of use.
pip install parts2jitx
parts2jitx-lcsc <C-number> # lookup / evidence (auto-OK with named channel)
parts2jitx-lcsc <C-number> --pinout # lookup / evidence
parts2jitx-lcsc <C-number> --footprint -o ... # footprint data — explicit approval required
parts2jitx-kicad <file.kicad_mod> # footprint data — explicit approval required
See references/parts-sourcing.md "LCSC / JLCPCB via parts2jitx" for the full split-consent table.For non-standard packages (connectors, RF modules): convert from a .kicad_mod file (user-provided or downloaded). NEVER hand-craft pad positions — use the converter. Standard packages use built-in JITX generators. All symbols use BoxSymbol. Exception: mechanical / vendor-defined footprints (Tag-Connect, pogo-pin fixtures, castellations, fiducials) where no purchasable component exists — see references/parts-sourcing.md "Mechanical / Vendor-Defined Footprints".
For details: read references/parts-sourcing.md
The orchestrator creates and maintains these in the project root:
jitx-component-modeler)ALWAYS invoke this subskill when user:
How to invoke: Use the Skill tool with skill: "jitx-skills:jitx-component-modeler"
Supports:
Do NOT attempt component generation without invoking this subskill - it contains critical patterns, dimension mappings, and code templates.
jitx-circuit-builder)Invoke this subskill when user asks to:
How to invoke: Use the Skill tool with skill: "jitx-skills:jitx-circuit-builder"
Covers:
For provide/require pin assignment patterns, use jitx-pin-assignment instead.
jitx-substrate-modeler)Ask the user which fab house they are targeting. If they confirm JLCPCB, predefined substrates from jitxlib.jlcpcb are available:
JLC04161H_1080 — 4-layer, 1080 prepreg, RS_50/DRS_90/DRS_100JLC04161H_7628 — 4-layer, 7628 prepreg, RS_50/DRS_90/DRS_100JLC06161H_7628 — 6-layer, 7628 prepreg, RS_50/DRS_100Import: from jitxlib.jlcpcb import JLC04161H_1080. These include stackup, fab rules, 11 via definitions, and routing structures.
Invoke this subskill to create a custom substrate (the default path unless user opts into a predefined one):
How to invoke: Use the Skill tool with skill: "jitx-skills:jitx-substrate-modeler"
Covers:
jitx-interconnect-constraints)Invoke this subskill when user asks to:
>> topology operator for ordered routingHow to invoke: Use the Skill tool with skill: "jitx-skills:jitx-interconnect-constraints"
Covers:
>> operator) vs Net (+ operator)jitx-pin-assignment)Invoke this subskill when user asks to:
@provide.subset_of or programmatic Provide>>) and SI constraints on pin-assigned portsConstrainDiffPair or ConstrainReferenceDifference for high-speed protocolsHow to invoke: Use the Skill tool with skill: "jitx-skills:jitx-pin-assignment"
Covers:
@provide, @provide.one_of, @provide.subset_of decoratorsProvide().one_of(), Provide().all_of(), Provide().subset_of()self.require() inside @provideDiffPairConstraint and ConstrainReferenceDifference with require()JITX docs: https://docs.jitx.com/en/latest/
or LLM-friendly access at https://docs.jitx.com/llms.txt
When to fetch docs:
How to look up:
references/docs-index.md to find the right page URLCommon lookups:
| Topic | Doc Path |
|-------|----------|
| Pin assignment | essentials/design/pin_assignment.html |
| Design hierarchy | essentials/design/design-hierarchy.html |
| Autorouter | essentials/physical_design/autorouter.html |
| SI constraints | essentials/SI/constraints.html |
| SI topology | essentials/SI/topology.html |
| SI API reference | api/jitx.si.html |
| Component class | api/jitx.component.html |
| Circuit class | api/jitx.circuit.html |
| QFN landpattern | jitxlib-standard/jitxlib.landpatterns.generators.qfn.html |
| BGA landpattern | jitxlib-standard/jitxlib.landpatterns.generators.bga.html |
| USB protocol | jitxlib-standard/jitxlib.protocols.usb.html |
| Box symbol | jitxlib-standard/jitxlib.symbols.box.html |
For complete index with all pages, see references/docs-index.md.
Run ruff format on generated code to keep it consistent:
ruff format path/to/file.py
| Task | Command/Pattern |
|------|-----------------|
| Build design | python -m jitx build module.Design (sequence calls — see "Build Safety") |
| Format code | ruff format path/to/file.py |
testing
This skill should be used when the user asks to "create a substrate", "define a stackup", "add via definitions", "set up routing structures", "configure impedance control", "define differential pairs", "set fabrication rules", "ring a shape with fence vias", "fence a pour outline", "fence an antipad", or "model a PCB layer structure". Ask the user which fabrication house they are targeting — if they confirm JLCPCB, predefined substrates from jitxlib.jlcpcb (JLC04161H_1080, JLC04161H_7628, JLC06161H_7628) are available with 4/6-layer FR-4, 50/90/100 ohm routing structures, vias, and fab rules. Otherwise, create a custom substrate. Covers Stackup, Symmetric, Conductor, Dielectric, Via (laser, mechanical, backdrilled, blind, buried, stacked), RoutingStructure, DifferentialRoutingStructure, NeckDown, via fencing along traces, fenced pour outlines (Tag + fence_via rule paired with a Pour + optional same-shape KeepOut — covers antipads, RF cavities, BGA breakouts), geometry, reference planes, and FabricationConstraints.
development
This skill should be used when the user asks to "wire up", "connect", "build a circuit", create an "application circuit", work with passives (resistors, capacitors), set up power connections, "add pours", or "place components". Covers the Circuit class, net operators, passive queries, voltage dividers, and copper geometry. For provide/require pin assignment patterns, use jitx-pin-assignment instead.
testing
This skill should be used when the user asks about "provide/require patterns", "@provide.one_of" or "@provide.subset_of" decorators, "programmatic Provide", "pin muxing" (MCU peripherals on shared pins), "DiffPair P/N polarity swapping", "PCIe lane swapping" or width variants, "DDR4 byte/bit swapping", "LPDDR5 channel swapping", "hierarchical provider composition", topology (>>) on pin-assigned ports, ConstrainDiffPair or ConstrainReferenceDifference with provide/require, or "flexible pin mapping" for FPGAs and MCUs. Covers provide, Provide, require, all_of, one_of, subset_of, and protocol-specific pin flexibility with SI constraints.
testing
This skill should be used when the user asks about "topology" (>> operator), "timing constraints", "skew matching", "insertion loss limits", "differential pairs", DiffPair bundles, protocol constraints (PCIe, USB, DisplayPort, RGMII, Ethernet, DDR), pin models (BridgingPinModel, TerminatingPinModel), "reference planes", "length matching", "impedance-controlled routing", or SignalConstraint definitions. Covers TopologyNet, Constrain, ConstrainDiffPair, ConstrainReferenceDifference, DiffPairConstraint, ReferencePlanes, and protocol-specific constraint patterns.