swmm-runner
Skill30 starsChanged 2 months agoMITView on GitHub
Run EPA SWMM (swmm5) simulations reproducibly and extract key metrics from the report file. Use when an agent needs to (1) run a .inp via swmm5 CLI, (2) generate a run directory with rpt/out + manifest, (3) extract peak flow/time for a node/outfall, (4) parse SWMM continuity (Runoff Quantity / Flow Routing) errors from .rpt, or (5) compare two .rpt files (e.g. GUI vs CLI) for equivalence.
In this repository16 other files it gives its agents.
- skill-authorSkill
- swmm-anywhereSkill
- swmm-builderSkill
- swmm-calibrationSkill
- swmm-canadaSkill
- swmm-climateSkill
- swmm-design-reviewSkill
- swmm-end-to-endSkill
- swmm-experiment-auditSkill
- swmm-gisSkill
- swmm-networkSkill
- swmm-paramsSkill
- swmm-plotSkill
- swmm-reportSkill
- swmm-uncertaintySkill
- swmm-water-qualitySkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Use after a SWMM model is fully assembled (typically by swmm-builder.build_inp) and you need to actually execute it and read back the …
- Very specific: line 23
Do not use this skill to assemble the .inp itself (that's swmm-builder) or to plot the results (that's swmm-plot).
- Very specific: line 31
When node is omitted, the server auto-detects the first entry from the .inp [OUTFALLS] section so the manifest's peak metric targets a real …
- Very specific: line 58
Read SWMM's own .rpt for continuity and peak metrics.
- Very specific: line 59
Keep units explicit in the .inp.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SWMM Runner (CLI-first)
Part of Agentic SWMM — install the project first for the executable toolchain (aiswmm CLI, SWMM solver, MCP servers).
What this skill provides
- Deterministic execution wrapper around the
swmm5binary. - A standard run directory layout:
inp/,rpt/,out/,stdout,stderr,manifest.json. - Metric extraction read directly from SWMM's own
.rpt:- peak flow + time-of-peak for any junction or outfall;
- Runoff Quantity and Flow Routing continuity tables + continuity error %;
- cross-run comparison (e.g. GUI vs CLI) on continuity error.
When to use this skill
Use after a SWMM model is fully assembled (typically by swmm-builder.build_inp) and you need to actually execute it and read back the metrics. Also use to compare two .rpt files for regression / GUI parity.
Do not use this skill to assemble the .inp itself (that's swmm-builder) or to plot the results (that's swmm-plot).
MCP tools
mcp/swmm-runner/server.js exposes four tools.
swmm_run— runswmm5against an .inp and write rpt + out + stdout + stderr + manifest.json into a run directory.- Args:
inp(path),runDir(path),node(optional),rptName(optional),outName(optional). - When
nodeis omitted, the server auto-detects the first entry from the .inp[OUTFALLS]section so the manifest's peak metric targets a real outfall name (no more silent "O1" default). - Output: a manifest with inp_sha256, swmm5 version, file paths,
metrics.peak,metrics.continuity.
- Args:
swmm_peak— parse peak flow and time-of-peak for a specific node from a SWMM .rpt. Thenodeargument is required (no default; the previous misleading "O1" default has been removed).- Args:
rpt(path),node(required). - Falls back from "Node Inflow Summary" to "Outfall Loading Summary" when no timed inflow entry exists for the node.
- Args:
swmm_continuity— parse the Runoff Quantity and Flow Routing continuity tables from a SWMM .rpt.- Args:
rpt(path). - Returns a structured dict with
Continuity Error (%)for both blocks plus all the volume rows (precipitation, evaporation, infiltration, runoff, etc.).
- Args:
swmm_compare— compare continuity-error percentages between two .rpt files (e.g. GUI vs CLI parity check).- Args:
rpt,rpt2.
- Args:
Recommended orchestration
swmm-builder.build_inp → model.inp
swmm-runner.swmm_run → model.rpt + manifest.json (with peak + continuity)
swmm-runner.swmm_continuity → structured continuity tables
swmm-runner.swmm_peak → peak at a specific node (e.g. for downstream plotting)
↓
hand off to swmm-plot or swmm-experiment-auditConventions
- Read SWMM's own
.rptfor continuity and peak metrics; do not re-implement physics. - Keep units explicit in the .inp; SI preferred (
FLOW_UNITS CMS). - The .rpt's "Node Inflow Summary" is the authoritative peak source for both junctions and outfalls. If a node has only outfall flow (rare), the parser falls back to "Outfall Loading Summary".
Known limitations
swmm_peakrounds to .rpt's 3-decimal display precision. Tiny basins (< ~3 ha) routinely produce peaks of order 1e-4 m³/s that show up as0.000in the .rpt summary; the .out time-series file has the real precision but is not yet consulted (BACKLOG.md M3).swmm_continuityandswmm_peakreturn structured dicts but do not yet support anoutputPathto write them as standalone JSON artifacts; the orchestrator currently captures them via the raw MCP response (BACKLOG.md F10).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

