Borrowing it
Nothing to install: this file belongs to ScottDuncanAI/industrial-ai-troubleshooting-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ScottDuncanAI/industrial-ai-troubleshooting-agent/main/.claude/commands/ml-fault-detection.mdgit clone --depth 1 https://github.com/ScottDuncanAI/industrial-ai-troubleshooting-agentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/scottduncanai/industrial-ai-troubleshooting-agent/ml-fault-detection)<a href="https://agentmods.dev/commands/scottduncanai/industrial-ai-troubleshooting-agent/ml-fault-detection"><img src="https://agentmods.dev/badge/commands/scottduncanai/industrial-ai-troubleshooting-agent/ml-fault-detection/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/scottduncanai/industrial-ai-troubleshooting-agent/ml-fault-detection"><img src="https://agentmods.dev/badge/commands/scottduncanai/industrial-ai-troubleshooting-agent/ml-fault-detection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00953 |
| Opus 5 | $0.00000 | $0.00477 |
| Sonnet 5 | $0.00000 | $0.00191 |
| Haiku 4.5 | $0.00000 | $0.00095 |
Grade A, and why
ml-fault-detection scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ML Fault Detection
Run Isolation Forest anomaly detection and XGBoost feature importance analysis on the boiler historian data to identify fault periods and rank early-warning sensors.
Conventions
- Python: Always use the project's virtual-environment Python, never bare
python(which on macOS may not exist or may point at a dependency-free system Python). Written as<venv-python>below — substitute.venv/bin/pythonon macOS/Linux or.venv/Scripts/pythonon Windows. - Opening files: Use the command for the user's OS, written as
<open>below —openon macOS,xdg-openon Linux,starton Windows.
Steps
1. Confirm data range
Call historian_get_data_range to confirm the dataset's time span and report it to the user before running.
2. Run the analysis
Run the ML fault detection script:
<venv-python> ml_fault_detection.py --downsample-minutes 1 --top-n-events 5
Capture the JSON output from stdout. The script prints progress to stderr and the JSON summary to stdout. If xgboost is unavailable for any reason — not installed, or installed but unable to load (e.g. missing libomp on macOS) — the script automatically falls back to GradientBoostingClassifier. Note which model was used from the feature_importance.model field.
If the script fails, diagnose the error from stderr and report it to the user.
3. Open key plots
All outputs are saved to plots/MLFault/MLFault_<date>/. Open the monitoring chart, feature importance chart, and fault report:
<open> <monitoring_plot_path>
<open> <feature_importance_plot_path>
<open> <fault_report_path>
4. Present model summary
Report to the user:
- Total observations and downsample resolution
- NOC training set size (rows where TE_8332A is in [530–545°C] vs total rows)
- Contamination parameter used and resulting anomaly rate
- Number of fault periods detected
5. Investigate worst fault events
For each of the top fault events in worst_events:
- Call
alarm_search_context(event.start, window_minutes=30)— what alarms were firing around this event? - Call
alarm_get_active_at(event.start)— full list of active alarms at the fault peak - Note whether
TE_8332Awas outside 530–545°C at that time (cross-reference with monitoring plot)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 83 lines · 0 tokens per session scan A cd4fb5b3ec39
ml-fault-detection is a command published in the GitHub repository ScottDuncanAI/industrial-ai-troubleshooting-agent (59 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 953 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
verify-math
Verify a self-authored mathematical result end to end by routing claims across adversarial review, numerical falsification, symbolic or CAS checks, and Lean, then aggregating one report. Use when a theorem, proposition, conjecture, or paper-wide mathematical argument needs the appropriate combination of verification…
replication-package
Scaffold or audit a social-science replication package at a target directory, and audit the manuscript and its archived research objects against FAIR principles.
diff
Quantitative volume comparison between a CadQuery model and a reference STEP file.
simulation-calibrator
Test and refine simulation accuracy with validation loops, bias detection, and continuous improvement frameworks.
arg-diagram
ARG academic-paper diagram mode — standalone structural & conceptual diagram generation.
graphite-morphology-classify
Classify graphite in a cast-iron micrograph per ASTM A247 / ISO 945-1, quantify nodularity, and read the matrix — the single most diagnostic observation in a cast-iron case.