spice-sim

spice-sim is a skill for Claude Code, Codex from diodeinc/pcb. It costs 22 tokens per session (892 once invoked), scanned A, original, MIT.

A workflow for adding or running an ngspice simulation for a Zener circuit design in a .zen file. ngspice is a circuit simulator that models electrical behavior and can produce plots.

In plain words
What is it for?
Use it to create Zener testbenches, run DC or transient analyses, and save simulation plots as SVG files.
Why use it?
It provides a defined structure for checking whether a design can be simulated, supplying a missing circuit model, and testing a focused scenario.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create Zener testbenches, run DC or transient analyses, and save simulation plots as SVG files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/diodeinc/pcb/spice-sim
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add diodeinc/pcb --skill spice-sim
Clone the repo
git clone --depth 1 https://github.com/diodeinc/pcb

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spice-sim

README.md
[![agentmods](https://agentmods.dev/badge/skills/diodeinc/pcb/spice-sim/github.svg)](https://agentmods.dev/skills/diodeinc/pcb/spice-sim)
Your own site
<a href="https://agentmods.dev/skills/diodeinc/pcb/spice-sim"><img src="https://agentmods.dev/badge/skills/diodeinc/pcb/spice-sim/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for spice-sim

Your own site · 80×15
<a href="https://agentmods.dev/skills/diodeinc/pcb/spice-sim"><img src="https://agentmods.dev/badge/skills/diodeinc/pcb/spice-sim.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 892 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 26 Sept 2026
  • Snyk pass 26 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.00892
Opus 5.5 $0.00009 $0.00357
Sonnet 5.5 $0.00004 $0.00178
Haiku 4.5 $0.00002 $0.00089

Measured 22d ago against content hash 5acf4e9fd6d3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

spice-sim scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 22d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/spice-sim/SKILL.md · 79 lines

How it starts

The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spice Simulation

Use a focused testbench such as <package>/testbench/test_<scenario>.zen for one behavior: startup, enable, a protection threshold, or current limit. Reuse an existing bench when it covers the request. Run it with pcb sim -v <file>.zen; a separate dummy simulation is only useful when diagnosing setup problems.

pcb sim runs the ngspice executable in batch mode in the testbench's directory and waits for it to finish; it sets no time limit. Without -v, a successful run prints only that it passed.

Model and testbench

Every component that is not DNP needs a SPICE model. The stdlib generics, such as resistors, capacitors, inductors, ferrite beads, crystals, diodes, LEDs, and TVS diodes, have their own. A leaf component needs spice_model=SpiceModel(...). Obtain a vendor model or, when appropriate, use a behavioral model with explicit limitations. Match nets to the subcircuit's declared terminal order, and pass every PARAMS: entry in args, because defaults are not applied:

Component(
    name="MyPart",
    symbol=Symbol(library="MyPart.kicad_sym"),
    footprint=File("MyPart.kicad_mod"),
    part=Part(mpn="MYPART-1", manufacturer="Vendor"),
    pins={"VIN": VIN, "VOUT": VOUT, "GND": GND},
    spice_model=SpiceModel(
        "MyPart.lib",
        "MyPart_SUBCKT",
        nets=[VIN, VOUT, GND],
        args={},
    ),
)

The model text goes into the netlist, so a .include in the model file resolves from the testbench's directory. The .subckt line must list all its terminals on one line; terminals on + continuation lines are not counted. For a PSpice model, put set ngbehavior=psa in a .spiceinit file beside the testbench; for an LTspice model, set ngbehavior=ltpsa. Without it, PSpice expressions such as VALUE={LIMIT(...)} give wrong results without an error. Verilog-A and encrypted models do not run.

Instantiate the module under test and needed loads/passives in Zener. Put sources, waveforms, analysis, and plot commands in the raw ngspice setup string of a top-level Simulation:

Read the full file on GitHub · 79 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 22d ago Changed 5acf4e9fd6d3
  2. 2mo ago Changed · +21 lines d6a2dfde9516
  3. 3mo ago Changed · -89 lines · -4 tokens per session 5cf04c71a426
  4. 3mo ago First seen · 147 lines · 26 tokens per session scan A fa89c0870962

Subscribe to this mod's changes

spice-sim is a skill published in the GitHub repository diodeinc/pcb (540 stars, last pushed today), licensed MIT. It adds 22 tokens to every session and 892 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

spice-sim compared with skills from other repositories

spice-sim next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
spice-simdiodeinc/pcbSkill540todayMITA22Claude Code, Codex
neuroskill-bciNousResearch/hermes-agentSkill269ktodayMITA18Claude Code, Codex
ruview-applicationsruvnet/RuViewSkill106ktodayMITA79Claude Code
lab-hardware-cadK-Dense-AI/scientific-agent-skillsSkill60k6d agoMITA108Claude Code
pylabrobotK-Dense-AI/scientific-agent-skillsSkill60k6d agoMITA49Claude Code
pybammK-Dense-AI/scientific-agent-skillsSkill60k6d agoMITA70Claude Code, Codex
calibrate-roomruvnet/RuViewSkill106ktodayMITA41Claude Code