skill-author
Draft a well-formed new skill (a SKILL.md scaffold, optionally with scripts/references) from a described recurring need, for human review and approval. Use…
Deterministic rainfall/climate formatting for SWMM. Use when converting timestamped rainfall CSV files into SWMM-ready [TIMESERIES] lines and [RAINGAGES] helper snippets for swmm-builder.
$ npx -y skills add Zhonghao1995/agentic-swmm-workflow --skill swmm-climate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/swmm-climateContext preview
The summary Claude sees to decide when to auto-load this skill.
Deterministic rainfall/climate formatting for SWMM. Use when converting timestamped rainfall CSV files into SWMM-ready [TIMESERIES] lines and [RAINGAGES] helper snippets for swmm-builder.
name: swmm-climate description: Deterministic rainfall/climate formatting for SWMM. Use when converting timestamped rainfall CSV files into SWMM-ready [TIMESERIES] lines and [RAINGAGES] helper snippets for swmm-builder.
Part of [Agentic SWMM](https://github.com/Zhonghao1995/agentic-swmm-workflow) — install the project first for the executable toolchain (aiswmm CLI, SWMM solver, MCP servers).
`format_rainfall.py` expects a header row and at minimum:
Optional extensions:
Accepted rainfall units (`--value-units`):
Unit policy (`--unit-policy`):
For SWMM-native rainfall `.dat` files (e.g. `<series> YYYY M D HH MM value`), use `--input-dat <path>` and declare row units via `--dat-value-units`:
In `.dat` mode the `--window-start` / `--window-end` filters expect `%Y-%m-%d`. Use `--default-station-id` to override the series token taken from the .dat row. `--input-dat` may be repeated to batch multiple .dat files but cannot be mixed with `--input` / `--input-glob`.
Via the MCP tool, pass `inputDatPaths: [<path>]` and `datValueUnits: "mm_per_day"` (or another supported unit) instead of `inputCsvPath`.
Temporal validation:
MCP wrapper location:
Exposed tools:
python3 skills/swmm-climate/scripts/format_rainfall.py \ --input skills/swmm-climate/examples/rainfall_event.csv \ --out-json runs/swmm-climate/example_rainfall.json \ --out-timeseries runs/swmm-climate/example_timeseries.txt \ --series-name TS_EVENT
python3 skills/swmm-climate/scripts/format_rainfall.py \
--input skills/swmm-climate/examples/rainfall_multi_station.csv \
--station-column station_id \
--series-name-template 'TS_EVENT_{station_safe}' \
--out-json runs/swmm-climate/example_multi_station.json \
--out-timeseries runs/swmm-climate/example_multi_station.txtpython3 skills/swmm-climate/scripts/format_rainfall.py \ --input skills/swmm-climate/examples/rainfall_batch_rg1.csv \ --input skills/swmm-climate/examples/rainfall_batch_rg2.csv \ --window-start '2025-06-01 00:05' \ --window-end '2025-06-01 00:15' \ --series-name TS_BATCH \ --out-json runs/swmm-climate/example_batch_windowed.json \ --out-timeseries runs/swmm-climate/example_batch_windowed.txt
python3 skills/swmm-climate/scripts/build_raingage_section.py \ --gage-id RG1 \ --rainfall-json runs/swmm-climate/example_multi_station.json \ --station-id RG1 \ --interval-min 5 \ --out-text runs/swmm-climate/example_raingage.txt \ --out-json runs/swmm-climate/example_raingage.json
Use `design_storm.py` to synthesise a hyetograph from a return period and IDF coefficients when no measured rainfall data exists. The output format matches `format_rainfall.py` so `build_inp --rainfall-json` consumes it unchanged.
| Method | When to use | Required inputs | |--------|-------------|-----------------| | `chicago` (Keifer-Chu) | IDF formula coefficients available | `--form`, coefficient flags, `--return-period`, `--duration` | | `alternating_block` | Explicit IDF table (duration → intensity) | `--idf-csv` or `--idf-json`, `--duration` |
**CN form** (`--form CN`): `q = 167·A1·(1+C·lgP)/(t+b)^n` [L/s/ha → converted to mm/hr] Flags: `--a1`, `--C`, `--b`, `--n`
**Generic form** (`--form generic`): `i = a/(t+b)^c` [mm/hr] Flags: `--a-coeff`, `--b`, `--c-exp`
python3 skills/swmm-climate/scripts/design_storm.py \ --method chicago \ --form CN \ --a1 10.0 \ --C 0.811 \ --b 11.0 \ --n 0.711 \ --return-period 2 \ --duration 120 \ --dt 5 \ --out-json runs/swmm-climate/storm_p2y.json \ --out-timeseries runs/swmm-climate/storm_p2y.txt
Executed output:
{
"ok": true,
"out_json": "/tmp/design_storm_test/storm_p2y.json",
"out_timeseries": "/tmp/design_storm_test/storm_p2y.txt",
"series_name": "TS_DESIGN_P2Y_120MIN",
"series_names": [
"TS_DESIGN_P2Y_120MIN"
],
"rows": 24,
"stations": 1,
"interval_minutes": 5
}Pre-1.0 · stable v0.9.4 · pip install aiswmm==0.9.4 · CHANGELOG Headaches from tedious model setup? Try our another project SWMMCanada, our automated model-building project: draw an area anywhere in Canada and get a ready-to-run SWMM model. Up and running now.
Repo: Zhonghao1995/agentic-swmm-workflow
Draft a well-formed new skill (a SKILL.md scaffold, optionally with scripts/references) from a described recurring need, for human review and approval. Use…
Synthesize a plausible SWMM drainage network from public data (OSM streets + DEM) when NO real pipe-network data exists — input is just a bbox. Use ONLY when…
Assemble a runnable SWMM INP deterministically from subcatchment geometry/attributes, merged parameter JSON, network JSON, and climate references. Use when…
Calibration and validation scaffold for EPA SWMM. Use when an agent needs to (1) compare simulated vs observed flow, (2) evaluate candidate parameter sets, (3)…
Fetch a ready-to-run SWMM model for any Canadian area from the SWMMCanada upstream service — real published municipal storm pipes where a supported city covers…
Score a completed SWMM run against a configurable YAML rulebook of design checks — GB50014-style standards for real catchments, or the reference-free…