detect-metric-anomaly
Analyze a metric for statistical anomalies using z-score analysis and threshold checking. Detects spikes, drops, and trends. Use for proactive monitoring and early warning. Keywords: anomaly, detection, metric, z-score, threshold, alert, statistical.
npx skills add majiayu000/claude-skill-registry --skill detect-metric-anomaly --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Detect Metric Anomaly ## Preconditions Before applying this skill, verify: - Metric name and current value available - Historical baseline exists (or can be established) - Threshold configuration available ## Actions ### 1. Retrieve Baseline Statistics Get or calculate baseline from history: ```yaml metric: $metric_name window_size: 1000 # Last N data points statistics: - mean - std_dev - percentile_95 ``` ### 2. Calculate Z-Score Determine how far current value deviates from baseline: ```python z_score = (current_value - baseline.mean) / baseline.std_dev ``` Interpret z-score: - |z| < 2: Normal variation - 2 <= |z| < 3: Warning (unusual) - |z| >= 3: Critical (anomaly) ### 3. Check Absolute Thresholds Compare against configured thresholds: ```yaml cpu_percent: warning: 80 critical: 95 memory_percent: warning: 80 critical: 90 error_rate: warning: 0.01 critical: 0.05 ``` ### 4. Detect Trends Analyze recent window for sustained deviation: ```python if 80% of last 10 values > baseline.mean: trend = "increasing" elif 80% of last 10 values < baseline.mean: trend = "decreasing" else: trend = "stable" ``` ### 5. Generate Alert If anomaly detected: ```yaml alert: metric: $metric_name seve
- Preconditions
- Actions
- 1. Retrieve Baseline Statistics
- 2. Calculate Z-Score
- 3. Check Absolute Thresholds
- 4. Detect Trends
- 5. Generate Alert
- Success Criteria
- Failure Handling
- Examples
What does the detect-metric-anomaly skill do?
Analyze a metric for statistical anomalies using z-score analysis and threshold checking. Detects spikes, drops, and trends. Use for proactive monitoring and early warning. Keywords: anomaly, detection, metric, z-score, threshold, alert, statistical.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill detect-metric-anomaly --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
