Swmm Report logo

Swmm Report

Community
Zhonghao1995
swmm-report

Generate a client-deliverable Word (.docx) report from an audited SWMM run directory. Reads manifest.json, experiment_provenance.json, model_diagnostics.json, comparison.json, and any PNG figures — SWMM is never re-run. Supports custom YAML/JSON section templates.

Overview

PublisherZhonghao1995
Repositoryagentic-swmm-workflow
Skill nameswmm-report
Stars
33
Forks
15
Bundled files
2
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.

  • 2 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 Report 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-report
  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-report .claude/skills/swmm-report
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Swmm Report 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 Report 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 Report 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 Report Export Skill

Purpose

Assemble a reproducible, client-deliverable Word (.docx) report from the artifacts produced by swmm-experiment-audit and swmm-plot. The script reads only existing files; it never re-runs SWMM or modifies the run directory.

Prerequisite: the run directory must contain a 09_audit/ subdirectory with at least experiment_provenance.json. Run aiswmm audit --run-dir <path> first if that directory is absent.


CLI usage

bash
# Standalone script
python3 skills/swmm-report/scripts/generate_report.py \
    --run-dir <path>         # required: audited run directory
    [--out <path.docx>]      # default: <run-dir>/report.docx
    [--template <path>]      # YAML or JSON template (default: built-in)

# CLI verb (registered in aiswmm CLI)
aiswmm report --run-dir <path> [--out <path.docx>] [--template <template.yaml>]

Exit codes: 0 = success; 1 = missing dependency, missing audit dir, or template error; 2 = argument error.

python-docx dependency: install with pip install 'aiswmm[report]'. The script exits immediately with a clear message if python-docx is absent.


Agent tool: generate_report

Registered in AgentToolRegistry. Direct handler (not MCP-routed) — shells out to generate_report.py, writes <run-dir>/report.docx (or the path supplied via out).

generate_report(run_dir="runs/my_run/")
generate_report(run_dir="runs/my_run/", out="deliverables/run_report.docx")
generate_report(run_dir="runs/my_run/", template="templates/client_a.yaml")

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

If python-docx is not installed the tool returns a failure dict whose summary carries the install hint pip install 'aiswmm[report]'.


Executed example

bash
# Create a minimal synthetic fixture
mkdir -p /tmp/swmm_report_fixture/09_audit
cat > /tmp/swmm_report_fixture/09_audit/experiment_provenance.json << 'EOF'
{
  "schema_version": "1.0",
  "run_id": "smoke-test-run",
  "generated_at_utc": "2025-01-01T00:00:00Z",
  "metrics": {"peak_flow": {"value": 1.23, "time_hhmm": "06:30"},
              "continuity_error": -0.5, "swmm_return_code": 0},
  "qa": {"checks": [{"id": "continuity", "ok": true, "detail": "within tolerance"}]},
  "repo": {"git_head": "abc1234", "git_branch": "main"},
  "tools": {"swmm5_version": "5.1.015", "python_version": "3.11"},
  "artifacts": {
    "model.inp": {"role": "input", "sha256": "4840dbe4abcdef", "exists": true,
                  "produced_by": "builder"}
  },
  "generated_by": "aiswmm"
}
EOF

python3 skills/swmm-report/scripts/generate_report.py \
    --run-dir /tmp/swmm_report_fixture \
    --out /tmp/swmm_report_smoke.docx
# Output: Report written to: /tmp/swmm_report_smoke.docx

The generated .docx follows engineering-report conventions:

  • Pure black text: Normal, Heading 1, Heading 2, and Title styles all use RGB(0,0,0) — no Word default blue or grey.
  • Numbered body sections: 1 Run Summary, 2 Model Description, … assigned automatically from template order. The cover title is unnumbered.
  • Table captions above each table: Table N — <text> with bold Table N prefix, numbering sequential across the whole document.
  • Narrative paragraph below each table: a short explanatory paragraph stating what the table shows and where the numbers come from (text sourced from template).
  • Figure captions below each figure: Figure N — <stem>, with a separate counter from the table counter.
  • Page number in footer: right-aligned Word PAGE field inserted via OOXML (fldChar begin + instrText " PAGE " + fldChar end) so Word/LibreOffice renders a live page number.

Template override

Pass --template <path> (YAML or JSON) to control which sections appear and in what order. The built-in template at skills/swmm-report/templates/default.yaml uses all eleven sections:

Section IDContent
coverTitle, run ID, generated-at timestamp
run_summaryPeak flow, time of peak, continuity error, return code
model_descriptionBasin area, simulation window, impervious %, Green-Ampt params
qa_gatesQA check table from experiment_provenance.json
design_reviewRulebook verdict and per-rule table from 11_review/design_review.json (says so when no review was run)
evidence_boundaryCalibration status and review verdict stated in words: what these numbers are and are not
figuresEmbedded PNG figures from 00_raw/ (study-area map), 08_plot/ (canonical plots), 07_plots/ and 07_plot/ (legacy), plus root network_layout.png
diagnosticsModel diagnostics from model_diagnostics.json
comparisonBaseline comparison (skipped silently when unavailable)
provenanceArtifact SHA-256 hashes from experiment_provenance.json
appendixGit head/branch, SWMM version, Python version

A custom template only needs the sections it uses. Unknown section IDs are warned and skipped — they do not abort the build.


Determinism contract

  • No random state, no timestamps injected by the script itself.
  • All metadata (run ID, generated-at, SHA-256) comes from existing JSON artifacts, not re-computed at report time.
  • Identical inputs produce bit-identical .docx output (python-docx's internal XML is deterministic for a given template + data combination).

Scripts

  • scripts/generate_report.py — single entrypoint; stdlib + python-docx + PyYAML only.

Templates

  • templates/default.yaml — built-in nine-section template.

Dependencies

PackagePurposeInstall
python-docxWrite .docx outputpip install 'aiswmm[report]'
PyYAMLParse YAML template filespip install PyYAML

Part of

PRD_report_export.md — Report Export skill. PR1: generate_report.py + default template. PR2 (this): ToolSpec wiring + CLI verb + SKILL.md.

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 Report AI skill do?

Generate a client-deliverable Word (.docx) report from an audited SWMM run directory. Reads manifest.json, experiment_provenance.json, model_diagnostics.json, comparison.json, and any PNG figures — SWMM is never re-run. Supports custom YAML/JSON section templates.

Why use Swmm Report on TypingMind?

Because you install it once and use it with any model. Swmm Report 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 Report in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Zhonghao1995/agentic-swmm-workflow/tree/main/skills/swmm-report. 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 Report?

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 Report?

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

Is the Swmm Report 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 👇