Agent skill

Ac Branch Pi Model

by benchflow-ai in benchflow-ai/skillsbench

AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

Apache-2.0Auto-check passedDevelopment

Install Ac Branch Pi Model

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill ac-branch-pi-model -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install benchflow-ai/skillsbench ac-branch-pi-model --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tasks/energy-ac-optimal-power-flow/environment/skills/ac-branch-pi-model .claude/skills/ac-branch-pi-model && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ac-branch-pi-model
GitHub stars
1.8k
Token cost
~1.1k tokens
SKILL.md length
385 words
Files
2 (incl. scripts)
Skills in repo
189
Repo updated
First seen
Licence
Apache-2.0

At a glance

AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

  • Computing branch flows in either direction
  • SKILL.md covers Quick start, Model details (match the task…, Power flow equations (use… and Common uses, plus 1 more section
  • Runs Python scripts from its folder
  • Aggregating bus injections for nodal balance

What it does

Ac Branch Pi Model is an agent skill from benchflow-ai/skillsbench. AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields. Use when computing branch flows in either direction, aggregating bus injections for nodal balance, checking MVA (rateA) limits, computing branch loading %, or debugging sign/units issues in AC power flow.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/branch_flows.py`).

It sits in Development. The repository describes itself as: SkillsBench evaluates how well skills work and how effective agents are at using them. The licence is Apache-2.0.

When your agent uses it

  • Computing branch flows in either direction
  • Aggregating bus injections for nodal balance
  • Checking MVA (rateA) limits
  • Computing branch loading %

Example prompts

  • “/ac-branch-pi-model”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 9a1f4dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ac Branch Pi Model loads about 1.1k tokens when it runs. Until then it costs about 95 tokens; SKILL.md has 385 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~95
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from benchflow-ai/skillsbench at commit 9a1f4dd, republished under its Apache-2.0 licence (© benchflow-ai). 385 words, ~1,070 tokens.

Download SKILL.mdSave it as .claude/skills/ac-branch-pi-model/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
ac-branch-pi-model
description
AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching `acopf-math-model.md` and MATPOWER branch fields. Use when computing branch flows in either direction, aggregating bus injections for nodal balance, checking MVA (rateA) limits, computing branch loading %, or debugging sign/units issues in AC power flow.

AC Branch Pi-Model + Transformer Handling

Implement the exact branch power flow equations in acopf-math-model.md using MATPOWER branch data:

[F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, TAP, SHIFT, BR_STATUS, ANGMIN, ANGMAX]

Quick start

  • Use scripts/branch_flows.py to compute per-unit branch flows.
  • Treat the results as power leaving the “from” bus and power leaving the “to” bus (i.e., compute both directions explicitly).

Example:

python
import json
import numpy as np

from scripts.branch_flows import compute_branch_flows_pu, build_bus_id_to_idx

data = json.load(open("/root/network.json"))
baseMVA = float(data["baseMVA"])
buses = np.array(data["bus"], dtype=float)
branches = np.array(data["branch"], dtype=float)

bus_id_to_idx = build_bus_id_to_idx(buses)

Vm = buses[:, 7]  # initial guess VM
Va = np.deg2rad(buses[:, 8])  # initial guess VA

br = branches[0]
P_ij, Q_ij, P_ji, Q_ji = compute_branch_flows_pu(Vm, Va, br, bus_id_to_idx)

S_ij_MVA = (P_ij**2 + Q_ij**2) ** 0.5 * baseMVA
S_ji_MVA = (P_ji**2 + Q_ji**2) ** 0.5 * baseMVA
print(S_ij_MVA, S_ji_MVA)

Model details (match the task formulation)

Per-unit conventions
  • Work in per-unit internally.
  • Convert with baseMVA:
    • (P_{pu} = P_{MW} / baseMVA)
    • (Q_{pu} = Q_{MVAr} / baseMVA)
    • (|S|{MVA} = |S|{pu} \cdot baseMVA)
Transformer handling (MATPOWER TAP + SHIFT)
  • Use (T_{ij} = tap \cdot e^{j \cdot shift}).
  • Implementation shortcut (real tap + phase shift):
    • If abs(TAP) < 1e-12, treat tap = 1.0 (no transformer).
    • Convert SHIFT from degrees to radians.
    • Use the angle shift by modifying the angle difference:
      • (\delta_{ij} = \theta_i - \theta_j - shift)
      • (\delta_{ji} = \theta_j - \theta_i + shift)
Series admittance

Given BR_R = r, BR_X = x:

  • If r == 0 and x == 0, set g = 0, b = 0 (avoid divide-by-zero).
  • Else:
    • (y = 1/(r + jx) = g + jb)
    • (g = r/(r^2 + x^2))
    • (b = -x/(r^2 + x^2))
Line charging susceptance
  • BR_B is the total line charging susceptance (b_c) (per unit).
  • Each end gets (b_c/2) in the standard pi model.

Power flow equations (use these exactly)

Let:

  • (V_i = |V_i| e^{j\theta_i}), (V_j = |V_j| e^{j\theta_j})
  • tap is real, shift is radians
  • inv_t = 1/tap, inv_t2 = inv_t^2

Then the real/reactive power flow from i→j is:

  • (P_{ij} = g |V_i|^2 inv_t2 - |V_i||V_j| inv_t (g\cos\delta_{ij} + b\sin\delta_{ij}))
  • (Q_{ij} = -(b + b_c/2)|V_i|^2 inv_t2 - |V_i||V_j| inv_t (g\sin\delta_{ij} - b\cos\delta_{ij}))

And from j→i is:

  • (P_{ji} = g |V_j|^2 - |V_i||V_j| inv_t (g\cos\delta_{ji} + b\sin\delta_{ji}))
  • (Q_{ji} = -(b + b_c/2)|V_j|^2 - |V_i||V_j| inv_t (g\sin\delta_{ji} - b\cos\delta_{ji}))

Compute apparent power:

  • (|S_{ij}| = \sqrt{P_{ij}^2 + Q_{ij}^2})
  • (|S_{ji}| = \sqrt{P_{ji}^2 + Q_{ji}^2})
Show full SKILL.md (135 more words)Show less

Common uses

Enforce MVA limits (rateA)
  • RATE_A is an MVA limit (may be 0 meaning “no limit”).
  • Enforce in both directions:
    • (|S_{ij}| \le RATE_A)
    • (|S_{ji}| \le RATE_A)
Compute branch loading %

For reporting “most loaded branches”:

  • loading_pct = 100 * max(|S_ij|, |S_ji|) / RATE_A if RATE_A > 0, else 0.
Aggregate bus injections for nodal balance

To build the branch flow sum for each bus (i):

  • Add (P_{ij}, Q_{ij}) to bus i
  • Add (P_{ji}, Q_{ji}) to bus j

This yields arrays P_out[i], Q_out[i] such that the nodal balance can be written as:

  • (P^g - P^d - G^s|V|^2 = P_{out})
  • (Q^g - Q^d + B^s|V|^2 = Q_{out})

Sanity checks (fast debug)

  • With SHIFT=0 and TAP=1, if (V_i = V_j) and (\theta_i=\theta_j), then (P_{ij}\approx 0) and (P_{ji}\approx 0) (lossless only if r=0).
  • For a pure transformer (r=x=0) you should not get meaningful flows; treat as g=b=0 (no series element).

© benchflow-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in tasks/energy-ac-optimal-power-flow/environment/skills/ac-branch-pi-model of benchflow-ai/skillsbench.

  • SKILL.md
  • scripts/branch_flows.py

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Ac Branch Pi Model next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ac Branch Pi Model compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ac Branch Pi Model this skillbenchflow-ai/skillsbench1.8k—~1.1kAutomated safety check: PassApache-2.0
Vercel Composition Patternssupabase/supabase111k58 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k4 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 58 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 4 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from benchflow-ai/skillsbench

All 189 skills in this repo
  • Lean4 Memories

    benchflow-ai/skillsbench

    This skill should be used when working on Lean 4 formalization projects to maintain persistent memory of successful proof patterns, failed approaches, project conventions, and user preferences…

    1.8k GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Senior Data Engineer

    benchflow-ai/skillsbench

    World-class data engineering skill for building scalable data pipelines, ETL/ELT systems, real-time streaming, and data infrastructure.

    1.8k GitHub stars~5.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Civ6lib

    benchflow-ai/skillsbench

    Civilization 6 district mechanics library. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • D3 Visualization

    benchflow-ai/skillsbench

    Build deterministic, verifiable data visualizations with D3.js (v6).

    1.8k GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Dc Power Flow

    benchflow-ai/skillsbench

    DC power flow analysis for power systems. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~717 tokensUpdated 2 mo ago
    Auto-check passed
  • Energy Calculator

    benchflow-ai/skillsbench

    Calculate per-second RMS energy from audio files. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~437 tokensUpdated 2 mo ago
    Auto-check passed

Categories

Questions about Ac Branch Pi Model

What does Ac Branch Pi Model do?

AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields. Ac Branch Pi Model is an agent skill from benchflow-ai/skillsbench.md and MATPOWER branch fields.

When should I use Ac Branch Pi Model?

Ac Branch Pi Model fits situations like: computing branch flows in either direction; aggregating bus injections for nodal balance; checking MVA (rateA) limits; computing branch loading %.

How do I install Ac Branch Pi Model in Claude Code?

Run `npx skills add benchflow-ai/skillsbench --skill ac-branch-pi-model -a claude-code`. Or copy the skill folder (tasks/energy-ac-optimal-power-flow/environment/skills/ac-branch-pi-model in benchflow-ai/skillsbench) into .claude/skills/ac-branch-pi-model in your project. Claude Code loads it when a task matches its description.

How do I install Ac Branch Pi Model in Codex?

Run `npx skills add benchflow-ai/skillsbench --skill ac-branch-pi-model -a codex`. Or copy the skill folder (tasks/energy-ac-optimal-power-flow/environment/skills/ac-branch-pi-model in benchflow-ai/skillsbench) into .agents/skills/ac-branch-pi-model in your project. Codex loads it when a task matches its description.

Can I use Ac Branch Pi Model in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add benchflow-ai/skillsbench --skill ac-branch-pi-model -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ac-branch-pi-model, .gemini/skills/ac-branch-pi-model, .github/skills/ac-branch-pi-model and .opencode/skills/ac-branch-pi-model in your project.

What does Ac Branch Pi Model need to run?

Going by SKILL.md and its folder, Ac Branch Pi Model needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Ac Branch Pi Model access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Ac Branch Pi Model safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Ac Branch Pi Model use?

Ac Branch Pi Model is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ac Branch Pi Model use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ac Branch Pi Model?

Skills that share tags, products or a category with Ac Branch Pi Model: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ac Branch Pi Model?

benchflow-ai (a GitHub organization) maintains it in benchflow-ai/skillsbench, which has 1,835 GitHub stars. The repository holds 189 skills in this directory. The repository was last updated on July 23, 2026.

Source: benchflow-ai/skillsbench on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.