Grid dispatch operator

From XuShuwenn/RedAct · View interactive version

Grid dispatch operator is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Optimize generator dispatches for power grid with DC power balance, transmission limits, and spinning reserve requirements.

How to use this skill

Skill file

Power Grid Generator Dispatch Optimization

When to Use

When to Use

Execution Rules

Input

Constraints

  1. DC power balance at each bus
  2. Generator and transmission limits
  3. Spinning reserve requirements (standard capacity coupling)
  1. Final dispatch must be network-feasible: enforce nodal DC power balance, generator bounds, transmission limits, and reserve-capacity coupling in the optimization model itself, not only as a post hoc check.
  2. If transmission compliance is required, use bus-angle variables and DC flow relations or an equivalent PTDF/shift-factor formulation.
  3. Restrict dispatch and reserve decisions to online generators only (GEN_STATUS > 0); exclude offline units from feasible capacity, reserve totals, and operating margin.
  4. Preserve MATPOWER gencost semantics in the objective; if costs are quadratic/polynomial, optimize that objective or clearly state any unavoidable approximation.
  1. If the task requires DC bus-level feasibility, include nodal balance and branch-limit constraints directly in the solved model; a system-wide sum(generation)=sum(load) constraint alone is not sufficient.
  2. If you eliminate one nodal balance equation by fixing/removing a reference bus angle, add an explicit aggregate-balance constraint sum(Pg_online) = total_load as a backstop against hidden slack/reference-bus imbalance.
  3. Treat this aggregate-balance equation as a supplement, not a replacement, for nodal DC balance at the remaining buses and branch-flow constraints.
  4. If MATPOWER gencost is polynomial/quadratic, preserve those terms in the optimization and reported cost evaluation whenever the available solver supports it; do not silently replace the objective with a linear or ad hoc approximation.
  5. If a gencost approximation is truly unavoidable, disclose it clearly and report that the optimized objective differs from the original MATPOWER cost model.

Output Format

JSON at the task-specified absolute output path (use /root/report.json only if the runtime instructions explicitly direct that path), for example:

{
  "generator_dispatch": [
    {"id": 1, "bus": 1, "output_MW": 100.0, "reserve_MW": 30.0, "pmax_MW": 150.0}
  ],
  "totals": {
    "cost_dollars_per_hour": 8000.0,
    "load_MW": 259.0,
    "generation_MW": 259.0,
    "reserve_MW": 500.0
  },
  "most_loaded_lines": [{"from": 1, "to": 2, "loading_pct": 85.0}, ...],
  "operating_margin_MW": 50.0
}

Use the exact top-level keys shown above: generator_dispatch, totals, most_loaded_lines, operating_margin_MW.

Do not rename keys. After writing the report, re-open and parse the JSON to confirm it is readable, complete, and contains the required nested fields such as output_MW, reserve_MW, and loading_pct.

Before finalizing, compare the written JSON keys against the requested schema verbatim. Do not accept aliases or self-invented names such as generators for generator_dispatch or top_3_loaded_lines for most_loaded_lines.

Validate the actual file you wrote against the task-required schema, and inspect the exact fields you plan to mention, especially generator_dispatch, totals, most_loaded_lines, and operating_margin_MW.

Also verify the artifact exists at the required absolute path and has plausible populated content before declaring success.

If any requirement is ambiguous, especially reserve obligation or reserve-capability semantics, report the assumption explicitly instead of presenting it as given input.

Key Metrics

Tips

Tips

Final Validation

Before concluding success:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.