$npx -y skills add Arcadia-1/gmoverid-skill --skill ngspicengspice simulation tutorial and template skill. Provides nine standard simulation examples: (1) Transient — RC charging voltage and current; (2) DC — NMOS Id-Vds family curves; (3) AC — RC low-pass filter frequency response; (4) Noise — RC filter output noise spectral density and
| 1 | # ngspice Simulation Skill |
| 2 | |
| 3 | > **Important — do not modify skill files during normal use.** |
| 4 | > All new scripts, netlists, simulation outputs, and plots should go into the |
| 5 | > user's **project working directory** (outside `.claude/`). Do not modify |
| 6 | > the skill's `assets/` folder or `SKILL.md`. Only edit skill-internal files |
| 7 | > when the user explicitly asks to improve or extend the skill itself. |
| 8 | |
| 9 | --- |
| 10 | |
| 11 | ## Prerequisites & Installation |
| 12 | |
| 13 | **Dependencies:** system-installed `ngspice`, Python 3 with `numpy ≥ 1.20`, `matplotlib ≥ 3.3`, `scipy ≥ 1.7` (NumPy 1.x and 2.x both supported). |
| 14 | |
| 15 | If `ngspice` is not found when a script starts, `check_ngspice()` will print a brief |
| 16 | error and exit. Full platform-specific install instructions — including a portable |
| 17 | Windows install that requires no PATH change, Chinese-network pip mirror fallbacks, |
| 18 | and `python-dateutil`/`six` troubleshooting — are in: |
| 19 | |
| 20 | ``` |
| 21 | references/installation.md |
| 22 | ``` |
| 23 | |
| 24 | --- |
| 25 | |
| 26 | ``` |
| 27 | assets/ |
| 28 | ├── ngspice_common.py — shared utilities: path constants, runner, parsers, template renderer |
| 29 | ├── models/ |
| 30 | │ ├── ptm180.lib — PTM 180nm BSIM3v3 |
| 31 | │ ├── ptm45hp.lib — PTM 45nm HP BSIM4 |
| 32 | │ └── ptm22hp.lib — PTM 22nm HP BSIM4 |
| 33 | ├── netlist/ |
| 34 | │ ├── tran_rc_charging.cir.tmpl — Transient: RC charging voltage and current |
| 35 | │ ├── dc_nmos_iv.cir.tmpl — DC: NMOS Id-Vds family curves |
| 36 | │ ├── ac_rc_filter.cir.tmpl — AC: RC low-pass frequency response |
| 37 | │ ├── noise_rc_filter.cir.tmpl — Noise: RC output noise spectral density |
| 38 | │ ├── tran_sample_hold_nmos.cir.tmpl — Transient: 180nm NMOS sample-and-hold |
| 39 | │ ├── tran_sample_hold_ideal.cir.tmpl — Transient: ideal switch sample-and-hold |
| 40 | │ ├── tran_ktc_noise.cir.tmpl — Transient: kT/C noise time-domain statistics |
| 41 | │ ├── dc_current_mirror.cir.tmpl — DC: NMOS current mirror |
| 42 | │ ├── ac_cs_amp.cir.tmpl — AC: common-source amplifier frequency response |
| 43 | │ └── dc_tgate_ron.cir.tmpl — DC: transmission gate on-resistance |
| 44 | ├── simulate_tran_rc_charging.py — RC charging simulation engine |
| 45 | ├── plot_tran_rc_charging.py — RC charging plotting |
| 46 | ├── run_tran_rc_charging.py — RC charging entry point |
| 47 | ├── simulate_dc_nmos_iv.py — DC family-curve simulation engine |
| 48 | ├── plot_dc_nmos_iv.py — DC family-curve plotting |
| 49 | ├── run_dc_nmos_iv.py — DC family-curve entry point |
| 50 | ├── simulate_ac_rc_filter.py — AC + noise simulation engine |
| 51 | ├── plot_ac_rc_filter.py — AC + noise plotting |
| 52 | ├── run_ac_rc_filter.py — AC + noise entry point |
| 53 | ├── simulate_tran_sample_hold.py — sample-and-hold simulation engine |
| 54 | ├── plot_tran_sample_hold.py — sample-and-hold plotting |
| 55 | ├── run_tran_sample_hold.py — sample-and-hold entry point |
| 56 | ├── simulate_tran_ktc_noise.py — kT/C noise simulation engine |
| 57 | ├── plot_tran_ktc_noise.py — kT/C noise plotting |
| 58 | ├── run_tran_ktc_noise.py — kT/C noise entry point |
| 59 | ├── simulate_dc_current_mirror.py — current mirror simulation engine |
| 60 | ├── plot_dc_current_mirror.py — current mirror plotting |
| 61 | ├── run_dc_current_mirror.py — current mirror entry point |
| 62 | ├── simulate_ac_cs_amp.py — common-source amplifier simulation engine |
| 63 | ├── plot_ac_cs_amp.py — common-source amplifier plotting |
| 64 | ├── run_ac_cs_amp.py — common-source amplifier entry point |
| 65 | ├── simulate_dc_tgate_ron.py — transmission gate Ron simulation engine |
| 66 | ├── plot_dc_tgate_ron.py — transmission gate Ron plotting |
| 67 | ├── run_dc_tgate_ron.py — transmission gate Ron entry point |
| 68 | ├── logs/ — simulation logs (auto-created) |
| 69 | └── plots/ — output figures (auto-created) |
| 70 | ``` |
| 71 | |
| 72 | **Naming convention:** netlist templates are prefixed by simulation type (`dc_`, `ac_`, `noise_`, `tran_`); Python files follow the same naming (e.g. `run_dc_nmos_iv.py`). |
| 73 | |
| 74 | --- |
| 75 | |
| 76 | ## Deployment and Running |
| 77 | |
| 78 | 1. Copy all files under `assets/` to the project directory. |
| 79 | 2. Run any entry-point script: |
| 80 | |
| 81 | ```bash |
| 82 | python run_tran_rc_charging.py # RC charging (simplest — good for verifying ngspice install) |
| 83 | python run_dc_nmos_iv.py # DC family curves |
| 84 | python run |