pypsa

pypsa is a skill for Claude Code from Power-Agent/PowerSkills. It costs 118 tokens per session (780 once invoked), scanned A, original, MIT.

A workflow for PyPSA, a Python tool for modelling and studying energy networks. It covers network construction, power-flow calculations, operating decisions, and planning future generation or storage.

In plain words
What is it for?
Use it to build or inspect a network, examine time-series data, calculate power flows, optimise dispatch, or choose future network investments.
Why use it?
It gives you a defined way to work through common PyPSA studies without having to remember the full process for each type of analysis.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the powerskills-tool plugin — 11 skills shipped together

Good fit Use it to build or inspect a network, examine time-series data, calculate power flows, optimise dispatch, or choose future network investments.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/power-agent/powerskills/pypsa
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 Power-Agent/PowerSkills --skill pypsa
Clone the repo
git clone --depth 1 https://github.com/Power-Agent/PowerSkills

Made for: Claude Code.

Or install powerskills-tool, the plugin that ships this one along with the rest of its 11 skills.

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 pypsa

README.md
[![agentmods](https://agentmods.dev/badge/skills/power-agent/powerskills/pypsa/github.svg)](https://agentmods.dev/skills/power-agent/powerskills/pypsa)
Your own site
<a href="https://agentmods.dev/skills/power-agent/powerskills/pypsa"><img src="https://agentmods.dev/badge/skills/power-agent/powerskills/pypsa/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 pypsa

Your own site · 80×15
<a href="https://agentmods.dev/skills/power-agent/powerskills/pypsa"><img src="https://agentmods.dev/badge/skills/power-agent/powerskills/pypsa.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 780 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.
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.00118 $0.00780
Opus 5.5 $0.00047 $0.00312
Sonnet 5.5 $0.00024 $0.00156
Haiku 4.5 $0.00012 $0.00078

Measured 3mo ago against content hash b68ff038069c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pypsa 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 3mo ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/build_case39.py, scripts/contingency_analysis.py, scripts/expansion_analysis.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

powerskills-tool/skills/pypsa/SKILL.md · 56 lines

How it starts

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

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

Read the full file on GitHub · 56 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. 3mo ago First seen · 56 lines · 118 tokens per session scan A b68ff038069c

Subscribe to this mod's changes

pypsa is a skill published in the GitHub repository Power-Agent/PowerSkills (88 stars, last pushed 1mo ago), licensed MIT. It adds 118 tokens to every session and 780 once invoked, about $0.0005 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

pypsa compared with skills from other repositories

pypsa next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pypsaPower-Agent/PowerSkillsSkill881mo agoMITA118Claude Code
jupyter-notebookNousResearch/hermes-agentSkill268ktodayMITA18Claude Code, Codex
matlabK-Dense-AI/scientific-agent-skillsSkill59k2d agoMITA44Claude Code
pennylaneK-Dense-AI/scientific-agent-skillsSkill59k2d agoMITA74Claude Code
cuequivariance-jaxNVIDIA/skillsSkill4.3ktodayApache-2.0A38Claude Code, Codex
cuequivariance-torchNVIDIA/skillsSkill4.3ktodayApache-2.0A37Claude Code, Codex
cuopt-numerical-optimization-apiNVIDIA/skillsSkill4.3ktodayApache-2.0A51Claude Code, Codex