Design PCBs as code with tscircuit (React/TSX) and the tsci CLI - schematic, layout, DRC, Gerber/BOM/CPL export for JLCPCB fabrication. Use after the BOM stage when the product needs a custom PCB.
75
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
PCBs are authored as React/TSX code and compiled to circuit JSON, then exported to fabrication files. The tsci binary lives at <repo>/node_modules/.bin/tsci.
product/bom.json exists with bom_ready: true. Every populated BOM row must map to a component in the circuit source.pcb/index.circuit.tsx (see references/tscircuit-basics.md for syntax) — do not invent JSX props; stick to documented elements: <board>, <chip>, <resistor>, <capacitor>, <led>, <pinheader>, <trace>, etc.cd <project>/pcb && <repo>/node_modules/.bin/tsci add C2913202 # imports part by LCSC codepcb.run(profile="check"):cd <project>/pcb && <repo>/node_modules/.bin/tsci build # emits circuit.json, fails on errorsRead the error output; fix source until the build is clean.
tsci export index.circuit.tsx -f pcb-svg (and -f schematic-svg) then convert or open the SVG; inspect the board image before release.mkdir -p releases/1 && cd <project>/pcb
<repo>/node_modules/.bin/tsci export index.circuit.tsx -f gerbers -o releases/1/gerbers.zip
<repo>/node_modules/.bin/tsci export index.circuit.tsx -f readable-netlist -o releases/1/netlist.txtAlso generate JLC assembly files when SMT assembly is intended (BOM csv from product/bom.json designators; CPL from circuit JSON placements).
product/bom.json. Record the release in releases/<n>/README.md with date and source git hash.tscircuit skill (MIT, by tscircuit) for authoritative syntax, workflow, and checklists: SYNTAX.md, WORKFLOW.md, CHECKLIST.md, CLI.md, and per-element docs under elements/.references/tscircuit-basics.md - quick cheat sheet for common patterns.<repo>/reference/replicator-original/project-replicator/pcb/references/:
footprints.md - CRITICAL: footprint chirality rules (never transcribe bottom-side coordinates - tscircuit x-negates on bottom placement, double-mirror scrambles pins invisibly to DRC), Pin-1/origin/rotation conventions, JLC CPL rotation corrections, footprint source decision order.built-in-elements.md - element gotchas (net names can't start with digits, via geometry, keepout limits).pcb-config.md - manufacturing numbers: trace 0.30mm nominal / 0.25mm min signal, via 0.6/0.3mm default, net class schemas, copper weight rules.<repo>/seeds/hardware-profiles.json - per-board pin capability maps (gpio/pwm/i2c/uart per pin). Use these instead of guessing MCU pinouts.<repo>/reference/replicator-original/me/pcb-release-review/SKILL.md (P0 = board wrong if fabricated: connectivity, part identity, footprint mismatch, missing opening, reversed connector).references/cpl-rotation-checklist.md - manual CPL rotation verification before paying for JLC PCBA.Run with any python3 (stdlib only), from the skill's scripts/ dir:
pcb_measure.py <circuit.json> [--report board|components|drills|routing|gaps|all] - physical facts from the built board (open pcb.measure): board dims/layers, per-component side+rotation+pads, drill table, per-net trace widths and vias, smallest differently-netted pad gaps. Generate input with npx tsci export -f circuit-json <entry>.circuit.tsx. Use it to verify claims instead of eyeballing footprint source.release.py <pcb_dir> --artifacts <files...> - content-addressed release gate: hashes editable source, refuses a release content-identical to an existing one, writes releases/<n>/manifest.json with source + artifact sha256. --check prints status.kicad_drc.py <entry>.circuit.tsx - independent second-opinion DRC: exports .kicad_pcb via tsci, runs kicad-cli pcb drc. Degrades gracefully (exit 2 + instructions) when KiCad is not installed (brew install --cask kicad).The open equivalent of Replicator's managed pcb-toolchain runtime (Temurin JRE + Freerouting jar, installed by install.sh into <repo>/runtime/pcb-toolchain/). Use when tscircuit's built-in autorouter fails, leaves nets unrouted, or violates clearance:
npx tsci export -f circuit-json <entry>.circuit.tsx # or tsci build
node <repo>/skills/replicator-pcb/scripts/freeroute.mjs dist/.../circuit.json \
--passes 20 --out routed.circuit.jsonChain: circuit JSON → Specctra DSN (dsn-converter) → Freerouting headless (-de/-do, exits when done) → SES → routed pcb_trace/pcb_via merged back → routed circuit JSON + SVG preview.
Rules learned from the original: Freerouting owns the complete copper layer — existing routes are stripped before the DSN export (leaving them in trips Freerouting 2.x's parser: "padstack name expected"). Run pcb_measure.py and kicad_drc.py on the routed output before releasing; Freerouting optimizes completion, not your process floor.
18436cc
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.