pypsa
/pypsa
Progressive-disclosure workflow for PyPSA studies. Use whenever the user wants to load or build a PyPSA network, inspect components or time series, run power flow, solve operational OPF, or run capacity-expansion / investment optimization — even when they just say "optimize the dispatch", "size the storage", "run an expansion", or hand over a netCDF/CSV network like case39.nc. Exposes network inspection and feasibility before large optimization, and operational optimization before investment. Reach for this instead of answering PyPSA questions unaided.
- Author
- power-agent ↗
- Repository
- powerskills ↗
- Licence
- MIT
- Last repository change
- 24.10.2026
Assessment and security
- Files in this package
- 10
- Scripts
- 5
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 5 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/build_case39.py, scripts/contingency_analysis.py, scripts/expansion_analysis.py, scripts/network_analysis.py, scripts/optimization_analysis.py
What it does and when to use it
Progressive-disclosure workflow for PyPSA studies. Use whenever the user wants to load or build a PyPSA network, inspect components or time series, run power flow, solve operational OPF, or run capacity-expansion / investment optimization — even when they just say "optimize the dispatch", "size the storage", "run an expansion", or hand over a netCDF/CSV network like case39.nc. Exposes network inspection and feasibility before large optimization, and operational optimization before investment. Reach for this instead of answering PyPSA questions unaided.
Triggers from the description
Original author description
Progressive-disclosure workflow for PyPSA studies. Use whenever the user wants to load or build a PyPSA network, inspect components or time series, run power flow, solve operational OPF, or run capacity-expansion / investment optimization — even when they just say "optimize the dispatch", "size the storage", "run an expansion", or hand over a netCDF/CSV network like case39.nc. Exposes network inspection and feasibility before large optimization, and operational optimization before investment. Reach for this instead of answering PyPSA questions unaided.
How it works
- Default tool ladder
- Working rules
- Escalation triggers
- Local assets in this skill
- Deliver
SKILL.md preview
---
name: pypsa
description: Progressive-disclosure workflow for PyPSA studies. Use whenever the user wants to load or build a PyPSA network, inspect components or time series, run power flow, solve operational OPF, or run capacity-expansion / investment optimization — even when they just say "optimize the dispatch", "size the storage", "run an expansion", or hand over a netCDF/CSV network like case39.nc. Exposes network inspection and feasibility before large optimization, and operational optimization before investment. Reach for this instead of answering PyPSA questions unaided.
---
# PyPSA workflow
Start by creating or loading a named network handle. Use network inspection before optimization, and use operational optimization before investment optimization.
## Default tool ladder
1. `load_network(file_path)` or `create_network(...)` to create the active network handle.
2. `get_network_info(network_name)` and `get_component_details(...)` to understand topology, assets, and time series.
3. `run_power_flow(network_name, linear=False)` for feasibility checks.
4. `optimize_network(network_name, ...)` for dispatch or operational studies.
5. `optimize_investment(network_name, ...)` for expansion questions.
6. `import_from_csv_folder(...)` or `export_to_csv_folder(...)` once the network state is worth moving.
### Example sequence
Using the `case39.nc` network shipped with this skill:
```
load_network("case39.nc") -> network "case39" active, 39 buses
get_network_info("case39") -> 10 generators, 46 branches, 19 loads
run_power_flow("case39", linear=False) -> converged, max branch loading 87%
optimize_network("case39", solver_name="highs") -> feasible dispatch, hourly cost reported
```
Feasibility first, then dispatch. Only move to `optimize_investment` once a dispatch
study cannot answer the question.
## Working rules
- Do not jump straight into expansion optimization when a dispatch study can answer the question.
- Use AC or DC power flow to sanity-check a network before relying on optimization outputs.
- Treat PyPSA as a planning and scheduling engine, not the final authority on detailed reactive mitigation.
## Escalation triggers
Quote the numbers that tripped each row (bus + v_mag_pu, element + loading, infeasibility cause) rather than saying "it failed".
| Observation | Escalate to |
|---|---|
| Bus `v_mag_pu` < 0.95 or > 1.05 on an AC power flow | `voltage-violation-mitigation` |
| Line or transformer loaded > 100% of `s_nom` | `thermal-overload-mitigation` |
| `run_contingency_analysis` N-1 overload or post-outage islanding | `contingency-mitigation` |
| `optimize_network` / `optimize_investment` infeasible, reserve-short, or heavily curtailed | `operations-planning-mitigation` |
| `run_power_flow` fails to converge | `convergence-failure-mitigation` |
## Local assets in this skill
- `case39.nc` — a ready test network.
- `scripts/network_analysis.py` — inspection.
- `scripts/optimization_analysis.py` — OPF result review.
- `scripts/expansion_analysis.py` — capacity-expansion studies.
- `scripts/contingency_analysis.py` — local N-1 screening outside PowerMCP.
## Deliver
- The network handle and study type.
- The main feasibility or cost result.
- Whether the next step is mitigation, AC validation, or a larger optimization.
Files in this package (10)
- SKILL.md 3 KB
- case39.nc 54 KB
- requirements.txt 1 KB
- references/API_REFERENCE.md 9 KB
- references/EXAMPLES.md 17 KB
- scripts/build_case39.py 5 KB
- scripts/contingency_analysis.py 16 KB
- scripts/expansion_analysis.py 13 KB
- scripts/network_analysis.py 9 KB
- scripts/optimization_analysis.py 12 KB
Versions
The database has no other skills named pypsa.
Database snapshot: 13.11.2026 · package version 2611b114b63a (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100pandapower
Progressive-disclosure workflow for pandapower power-system studies. Use whenever the user wants to load, build, or inspect a pandapower network, run AC power flow, check bus voltages or line and transformer loading, or screen N-1 contingencies — even when they just say "run a… - 100pandapower
Power systems analysis and optimization library (pandapower v3.4.0). Use when working with electric power networks: building network models (buses, lines, transformers, loads, generators), running AC/DC power flow, optimal power flow (OPF), short circuit calculations (IEC… - 90powerworld
Progressive-disclosure workflow for PowerWorld Simulator studies through PowerMCP. Use whenever the user wants to open a PowerWorld case, solve the base power flow, inspect flows or voltages, change model data, run contingency analysis, or pull sensitivity matrices (PTDF, LODF,… - 100dc-power-flow
DC power flow analysis for power systems. Use when computing power flows using DC approximation, building susceptance matrices, calculating line flows and loading percentages, or performing sensitivity analysis on transmission networks. - 90energy-systems
Applies energy-systems modelling conventions so that capacity, energy, cost and emissions numbers are consistent and comparable, covering kW versus kWh and MW versus MWh, capacity versus energy, capacity factors, load duration curves, the LCOE formula with discounting and…