anomaly-detection

anomaly-detection is a skill for Claude Code from LGDiMaggio/predictive-maintenance-mcp. It costs 105 tokens per session (1,269 once invoked), scanned A, original, MIT.

A workflow that uses machine-learning methods to find unusual patterns in vibration signals and train detection models.

In plain words
What is it for?
Use it for anomaly and outlier detection, comparing normal and abnormal behaviour, and training models such as one-class SVM or LOF.
Why use it?
It helps identify signals that differ from normal machine behaviour without relying only on manual inspection.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the predictive-maintenance plugin — 9 skills, 3 commands, 2 agents shipped together

Good fit Use it for anomaly and outlier detection, comparing normal and abnormal behaviour, and training models such as one-class SVM or LOF.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lgdimaggio/predictive-maintenance-mcp/anomaly-detection
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LGDiMaggio/predictive-maintenance-mcp --skill anomaly-detection
Clone the repo
git clone --depth 1 https://github.com/LGDiMaggio/predictive-maintenance-mcp

Made for: Claude Code.

Or install predictive-maintenance, the plugin that ships this one along with the rest of its 9 skills, 3 commands, 2 agents.

Wrote 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.

agentmods badge for anomaly-detection

README.md
[![agentmods](https://agentmods.dev/badge/skills/lgdimaggio/predictive-maintenance-mcp/anomaly-detection/github.svg)](https://agentmods.dev/skills/lgdimaggio/predictive-maintenance-mcp/anomaly-detection)
Your own site
<a href="https://agentmods.dev/skills/lgdimaggio/predictive-maintenance-mcp/anomaly-detection"><img src="https://agentmods.dev/badge/skills/lgdimaggio/predictive-maintenance-mcp/anomaly-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.

agentmods 80×15 button for anomaly-detection

Your own site · 80×15
<a href="https://agentmods.dev/skills/lgdimaggio/predictive-maintenance-mcp/anomaly-detection"><img src="https://agentmods.dev/badge/skills/lgdimaggio/predictive-maintenance-mcp/anomaly-detection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,269 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00105 $0.01269
Opus 5.5 $0.00042 $0.00508
Sonnet 5.5 $0.00021 $0.00254
Haiku 4.5 $0.00011 $0.00127

Measured 8d ago against content hash 7b71c794a647, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

anomaly-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 8d 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.

plugin/skills/anomaly-detection/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Anomaly Detection

Train and use machine learning models to detect anomalous vibration patterns. Supports OneClassSVM and LocalOutlierFactor novelty detection with PCA visualization. The models flag statistical outliers for the engineer to investigate — they supplement, and never replace, physics-based diagnosis.

Prerequisite: The predictive-maintenance-mcp MCP server must be connected.

Workflow

Training a New Model

Step 1 — Prepare the Healthy Baseline

Gather signals representing NORMAL machine operation. Check what is loaded with list_signals(scope="memory"); browse files with list_signals(scope="disk"). Load the training set in one atomic batch:

Call load_signal(filepath=["real_train/baseline_1.csv", "real_train/baseline_2.csv"], signal_unit="g")

The batch is fail-fast: if any file is missing or an id collides, ONE error names the offending entries and nothing is loaded. For raw binary files (.bin/.raw/.dat), also declare sample_format and sampling_rate (broadcast to the whole batch), or provide companion <stem>_metadata.json files — see the signal-management skill.

Ask the user:

  • Which signals represent normal/healthy operation?
  • Which algorithm? ("OneClassSVM" recommended for small datasets, "LocalOutlierFactor" for larger ones)
Step 2 — Screen the Baseline Quality

For each baseline signal, call analyze_statistics(signal_id="<id>"). Signals with very high kurtosis or crest factor may already contain damage and should be excluded from the healthy baseline — confirm with the user.

Step 3 — Train the Model

Call train_anomaly_model(healthy_signal_ids=["real_train_baseline_1", "real_train_baseline_2"], model_type="OneClassSVM", model_name="pump_a_health")

Parameters:

  • healthy_signal_ids: signal_ids of the healthy baseline (training data)
  • model_type: "OneClassSVM" or "LocalOutlierFactor"
  • model_name: name for the saved model files (echoed in the result; pass the same name to predict_anomalies later)
  • fault_signal_ids (optional): known-fault signal_ids used to tune the hyperparameters (semi-supervised mode), never to fit the model. The reported fault detection rate comes from the same signals, so it is not a held-out figure
  • healthy_validation_ids (optional): held-out healthy signal_ids for the specificity check. Without them, the check runs only when fault_signal_ids are given, on the last 20% of the training windows
  • segment_duration / overlap_ratio: feature-extraction segmentation (defaults 0.1 s / 0.5)

Read the full file on GitHub · 125 lines

Changes

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.

  1. 8d ago Changed · +6 lines 7b71c794a647
  2. 18d ago Changed · +2 lines · +5 tokens per session 8fc44b96ea47
  3. 3mo ago First seen · 117 lines · 100 tokens per session scan A eb9a8ec05a42

Subscribe to this mod's changes

anomaly-detection is a skill published in the GitHub repository LGDiMaggio/predictive-maintenance-mcp (122 stars, last pushed yesterday), licensed MIT. It adds 105 tokens to every session and 1,269 once invoked, about $0.0004 per session on Opus 5.5. 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.

Related

anomaly-detection compared with skills from other repositories

anomaly-detection next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
anomaly-detectionLGDiMaggio/predictive-maintenance-mcpSkill122yesterdayMITA105Claude Code
agent-work-verificationWeaverse/.agentsSkill121d agoMITA45Claude Code
pr-merge-gatesWeaverse/.agentsSkill121d agoMITA52Claude Code
debug-logsWeaverse/.agentsSkill121d agoMITA42Claude Code
fix-prWeaverse/.agentsSkill121d agoMITA40Claude Code
shipWeaverse/.agentsSkill121d agoMITA43Claude Code
workWeaverse/.agentsSkill121d agoMITA43Claude Code