Swmm Design Review logo

Swmm Design Review

Community
Zhonghao1995
swmm-design-review

Score a completed SWMM run against a configurable YAML rulebook of design checks — GB50014-style standards for real catchments, or the reference-free physical-plausibility rulebook for synthesized networks. Reads the run's existing manifest.json / model.rpt / model.inp and never re-runs SWMM. Use it post-run for compliance or plausibility review; continuity gating stays with postflight.

Overview

PublisherZhonghao1995
Repositoryagentic-swmm-workflow
Skill nameswmm-design-review
Stars
33
Forks
15
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Zhonghao1995 on GitHub. Read the source before you install it.

Installation

Install the Swmm Design Review AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Zhonghao1995/agentic-swmm-workflow/tree/main/skills/swmm-design-review
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Zhonghao1995/agentic-swmm-workflow.git /tmp/agentic-swmm-workflow
mkdir -p .claude/skills
cp -r /tmp/agentic-swmm-workflow/skills/swmm-design-review .claude/skills/swmm-design-review
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Swmm Design Review in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Swmm Design Review on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Swmm Design Review is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

swmm-design-review — Design Review / Code-Compliance Checker

What this skill does

Evaluates a completed SWMM run against a configurable rulebook of design checks. Reads the run's existing artifacts (manifest.json + model.rpt + model.inp) — SWMM is never re-run. Classifies each rule as pass, fail, warn, or needs-data and writes 11_review/design_review.json + 11_review/design_review.md into the run directory (canonical per ADR-0004; the underlying script's own bare default is the legacy 09_review/ — see CLI usage below).

This skill is decision-support only. It never certifies regulatory compliance.


CLI usage

bash
# Standalone script
python3 skills/swmm-design-review/scripts/design_review.py \
    --run-dir <path>         # required: directory with model.rpt, manifest.json, model.inp
    [--rpt <path>]           # override: explicit model.rpt path
    [--inp <path>]           # override: explicit model.inp path
    [--manifest <path>]      # override: explicit manifest.json path
    [--rules <rulebook>]     # override rulebook YAML/JSON (repeatable for multiple books)
    [--out-dir <dir>]        # bare-script default: <run-dir>/09_review/ (legacy)
    [--no-inp]               # skip INP-derived metrics (slope, diameter)

# CLI verb (registered in aiswmm CLI) — always passes --out-dir explicitly,
# defaulting to the canonical <run-dir>/11_review/ (ADR-0004)
aiswmm review --run-dir <path> [--rules <rulebook.yaml>] [--out-dir <dir>]

Exit codes: 0 = pass/warn/needs-data only; 1 = any FAIL; 2 = script/input error.

Agent tool: review_run

Registered in AgentToolRegistry. Direct handler (not MCP-routed) — writes 11_review/design_review.json + 11_review/design_review.md into the run dir (canonical per ADR-0004).

review_run(run_dir="runs/my_run/")
review_run(run_dir="runs/my_run/", rules="skills/swmm-design-review/rulebooks/gb50014_template.yaml")

is_read_only=False — QUICK profile prompts the user (tool writes files).

Executed example

bash
python3 skills/swmm-design-review/scripts/design_review.py \
    --run-dir tests/fixtures/design_review \
    --manifest tests/fixtures/design_review/sample_manifest.json \
    --rpt tests/fixtures/design_review/sample_mini.rpt \
    --inp tests/fixtures/design_review/sample_mini.inp \
    --rules tests/fixtures/design_review/sample_rules.yaml \
    --out-dir /tmp/design_review_out
# Exit 1 = FAIL (1 pass, 1 fail, 0 warn, 1 needs-data)
# Report: /tmp/design_review_out/design_review.md

Return-period adequacy workflow

To check return-period adequacy (RETURN_PERIOD_ADEQUACY rule):

  1. generate_design_storm with the target return period P.
  2. build_inp to integrate the design storm into the model.
  3. run_swmm_inp --storm-return-period-yr P to propagate provenance to manifest.
  4. design_review.py --run-dir <path> — extractor reads manifest.metadata.storm_return_period_yr.

Until step 3 is wired (separate PR), RETURN_PERIOD_ADEQUACY returns needs-data.


Metrics available today (PR1)

MetricSource
run.peak_flowmanifest.json
run.continuity_error_pctmanifest.json
link.max_velocityrpt Link Flow Summary
link.max_full_flow_ratiorpt Link Flow Summary
link.max_full_depth_ratiorpt Link Flow Summary
link.peak_flowrpt Link Flow Summary
outfall.max_flowrpt Outfall Loading Summary
node.flow_balance_error_pctrpt Node Inflow Summary
conduit.slope_pctINP [CONDUITS] + [JUNCTIONS]/[OUTFALLS] join
conduit.diameter_mINP [XSECTIONS] GEOM1 (CIRCULAR only)
conduit.roughnessINP [CONDUITS]

Metrics returning needs-data until PR2: node.surcharge_hours, node.max_depth_m, node.flooding_hours, node.flooding_volume_m3, junction.freeboard_m, run.return_period_yr.


Output files

  • <run-dir>/11_review/design_review.json — machine-readable results (schema_version 1.0)
  • <run-dir>/11_review/design_review.md — human report with disclaimer and sign-off table

(Canonical location per ADR-0004. Runs from before that migration, or the bare script invoked without --out-dir, carry these under the legacy 09_review/.)


What the agent MUST say

When presenting review results, the agent must:

  1. Lead with the overall status (PASS / FAIL / WARN / NEEDS-DATA).
  2. State the disclaimer: "Findings are decision-support only and do NOT constitute compliance with any drainage standard."
  3. Invite the engineer to inspect any FAIL or NEEDS-DATA finding before proceeding.
  4. List NEEDS-DATA rules prominently with the reason they cannot produce a result.

What the agent MUST NOT say

  • Do NOT say "the design is compliant with GB 50014" or any equivalent.
  • Do NOT say "no issues found" when there are NEEDS-DATA rules — those are not passes.
  • Do NOT paraphrase away the disclaimer.
  • Do NOT imply the thresholds are authoritative — all template thresholds carry verify: true precisely because they must be confirmed by the user.

Custom rulebooks

Write a YAML file following the schema in rulebooks/gb50014_template.yaml. Every rule must have:

  • id (SCREAMING_SNAKE_CASE, unique)
  • metric (named extractor from the table above)
  • operator (lte / lt / gte / gt / eq / neq / between)
  • threshold (float, SI) or threshold_low + threshold_high for between
  • units: SI
  • severity: FAIL or severity: WARN
  • citation — clause reference or "TODO: cite local standard"
  • verify: true unless you have personally confirmed the threshold against the applicable edition of the standard

Honesty rule: a rule MUST NOT have verify: false while citation is still "TODO: cite local standard". The test suite enforces this invariant.


Part of

Issue #249 capability backlog — design-review / code-compliance checker. PR1: extractor layer + evaluator + rulebook + reports + tests. PR2 (upcoming): ToolSpec wiring, CLI verb, rpt_summary extensions.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Swmm Design Review AI skill do?

Score a completed SWMM run against a configurable YAML rulebook of design checks — GB50014-style standards for real catchments, or the reference-free physical-plausibility rulebook for synthesized networks. Reads the run's existing manifest.json / model.rpt / model.inp and never re-runs SWMM. Use it post-run for compliance or plausibility review; continuity gating stays with postflight.

Why use Swmm Design Review on TypingMind?

Because you install it once and use it with any model. Swmm Design Review is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Swmm Design Review in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Zhonghao1995/agentic-swmm-workflow/tree/main/skills/swmm-design-review. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Swmm Design Review?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Swmm Design Review?

As many as you like. As long as a model supports skills, you can use Swmm Design Review with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Swmm Design Review AI skill free?

Yes. It is published on GitHub by Zhonghao1995 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇