Marketing Anomaly Detector

/digital-marketing-pro:anomaly-scan

by indranilbanerjee · MIT license · ★ 866 on GitHub

/digital-marketing-pro:anomaly-scan cover

Scan connected platforms for anomalies against stored baselines, with likely causes.

---
name: anomaly-scan
description: "Scan connected platforms for anomalies against stored baselines, with likely causes. \"why did our CPA spike\""
---

# /digital-marketing-pro:anomaly-scan

> **Script location.** If your host does not set `${CLAUDE_PLUGIN_ROOT}`, the scripts are in this plugin's `scripts/` folder, next to `skills/`. Run them with Python 3.10 or newer: `python`, or `python3` where `python` is not found (macOS, many Linux systems).

## Purpose

Scan all connected marketing platforms for anomalies — statistically significant deviations from established baselines that could indicate problems (traffic drops, CPA spikes, deliverability collapse, budget overruns) or opportunities (viral content, conversion rate improvements, unexpected channel growth). Designed to catch issues early, before they compound into costly problems, and to surface wins worth amplifying.

## Input Required

The user must provide (or will be prompted for):

- **Sensitivity level**: Strict (flags deviations >1.5 standard deviations from baseline), normal (>2 std dev),

Overview

Scan all connected marketing platforms for anomalies — statistically significant deviations from established baselines that could indicate problems (traffic drops, CPA spikes, deliverability collapse, budget overruns) or opportunities (viral content, conversion rate improvements, unexpected channel growth). Designed to catch issues early, before they compound into costly problems, and to surface wins worth amplifying.

What you get

  • Scan summaryPlatforms scanned, time period analyzed, sensitivity level used, baseline period,
  • Critical anomalies(if any): Metric name, platform, expected range (mean +/- threshold), actual value,
  • Warning anomaliesSame structure as critical, with recommended investigation steps and a 24-hour
  • Info anomaliesNotable deviations worth monitoring with watch criteria — what to look for to determine
  • Correlation analysisConnections between anomalies and recent execution history — which changes may have
  • Platform health summaryPer-platform health indicator (green/yellow/red) based on the number and severity
Manual install (npx, ZIP)
Claude Codenpx skills add indranilbanerjee/digital-marketing-pro --skill anomaly-scan -g -a claude-code
Claude Code (degit)npx degit indranilbanerjee/digital-marketing-pro/skills/anomaly-scan#main ~/.claude/skills/anomaly-scan
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md7.3 KB
Read SKILL.md here
indranilbanerjee/main1 file shown
SKILL.md
Show the full text89 lines

/digital-marketing-pro:anomaly-scan

Script location. If your host does not set ${CLAUDE_PLUGIN_ROOT}, the scripts are in this plugin's scripts/ folder, next to skills/. Run them with Python 3.10 or newer: python, or python3 where python is not found (macOS, many Linux systems).

Purpose

Scan all connected marketing platforms for anomalies — statistically significant deviations from established baselines that could indicate problems (traffic drops, CPA spikes, deliverability collapse, budget overruns) or opportunities (viral content, conversion rate improvements, unexpected channel growth). Designed to catch issues early, before they compound into costly problems, and to surface wins worth amplifying.

Input Required

The user must provide (or will be prompted for):

  • Sensitivity level: Strict (flags deviations >1.5 standard deviations from baseline), normal (>2 std dev), or relaxed (>3 std dev). Defaults to normal
  • Time period: The window to scan for anomalies — today, last 3 days, last 7 days, last 30 days, or custom range. Defaults to last 7 days
  • Platforms (optional): Specific platforms to focus the scan on (e.g., "Google Ads and Meta only"). If omitted, all connected platforms are scanned
  • Metrics focus (optional): Specific metrics to prioritize (e.g., "CPA and conversion rate only"). If omitted, all available metrics are evaluated
  • Baseline period (optional): Custom baseline for comparison instead of the default. Defaults to the rolling 30-day average maintained by performance-monitor.py
  • Exclude known events (optional): List of known events to filter out (e.g., "Black Friday sale", "site migration on Jan 15") so expected deviations are not flagged as anomalies

Process

  1. Load brand context: Read ~/.claude-marketing/brands/_active-brand.json for the active slug, then load ~/.claude-marketing/brands/{slug}/profile.json. Apply brand voice, compliance rules for target markets (skills/context-engine/compliance-rules.md), and industry context. Also check for guidelines at ~/.claude-marketing/brands/{slug}/guidelines/_manifest.json — if present, load restrictions. Check for agency SOPs at ~/.claude-marketing/sops/. If no brand exists, ask: "Set up a brand first (/digital-marketing-pro:brand-setup)?" — or proceed with defaults.
  2. Pull current metrics from all connected MCPs: Query each connected analytics platform (google-analytics, google-ads, meta-marketing, linkedin-marketing, tiktok-ads, mailchimp, stripe, mixpanel, amplitude, shopify, etc.) for all available metrics across the specified scan period. Include traffic, spend, conversions, CPA, ROAS, engagement rates, deliverability, and revenue metrics.
  3. Load historical baselines: Execute python "${CLAUDE_PLUGIN_ROOT}/scripts/performance-monitor.py" --brand {slug} --action get-baseline to retrieve rolling averages, standard deviations, and expected ranges for each metric. If no baseline exists yet, use the comparison period data to establish a temporary baseline and note this in the output.
  4. Run anomaly detection: Execute python "${CLAUDE_PLUGIN_ROOT}/scripts/performance-monitor.py" --brand {slug} --action detect-anomalies --data '{...current-period metrics...}' to flag metrics that fall outside the expected ranges computed from the stored baseline (mean ± standard deviations). Apply day-of-week and seasonality adjustments where historical data supports it.
  5. Cross-reference with recent executions: Check execution history via python "${CLAUDE_PLUGIN_ROOT}/scripts/execution-tracker.py" --brand {slug} --action get-history --limit 14 to correlate anomalies with recent changes — did a campaign launch, pause, budget shift, creative swap, landing page change, or audience expansion precede the anomaly?
  6. Cross-reference with known factors: Check for known platform outages, algorithm updates (Google core updates, Meta policy changes), industry events, seasonal patterns, and any user-provided known events that could explain the deviation.
  7. Classify anomalies by severity: Critical (revenue-impacting, requires immediate action — tracking broken, CPA 3x+ baseline, budget overspend >20%, deliverability below 80%), Warning (significant deviations worth investigating within 24 hours — traffic down 30%+, engagement halved, CTR dropped 40%+), or Info (notable but non-urgent — gradual trend shifts, minor CPA increases, seasonal patterns emerging).
  8. Determine probable causes: For each anomaly, analyze root causes using the diagnostic framework from skills/analytics-insights/anomaly-diagnosis.md. Categorize as data/tracking issue, external factor (algorithm update, competitor action, seasonal shift), internal change (campaign modification, landing page update), or platform change (policy update, feature deprecation, auction dynamics shift).
  9. Save critical anomalies as insights: For critical and warning-level anomalies, persist via python "${CLAUDE_PLUGIN_ROOT}/scripts/campaign-tracker.py" --brand {slug} --action save-insight --data '{"type":"anomaly","insight":"...","context":"..."}' so they are tracked, surface in future reports, and can be referenced in post-mortems.

Output

A structured anomaly report containing:

  • Scan summary: Platforms scanned, time period analyzed, sensitivity level used, baseline period, total anomalies detected (by severity), and overall marketing health assessment (healthy, caution, or critical)
  • Critical anomalies (if any): Metric name, platform, expected range (mean +/- threshold), actual value, deviation magnitude (in std devs and percentage), probable cause, estimated revenue impact, and recommended immediate action
  • Warning anomalies: Same structure as critical, with recommended investigation steps and a 24-hour action plan for each
  • Info anomalies: Notable deviations worth monitoring with watch criteria — what to look for to determine if the trend continues or reverses
  • Correlation analysis: Connections between anomalies and recent execution history — which changes may have caused which deviations, with confidence levels (strong, possible, unlikely)
  • Platform health summary: Per-platform health indicator (green/yellow/red) based on the number and severity of anomalies detected, plus a trend vs the last scan if previous scan data exists
  • Recommended actions: Priority-ordered list of responses — immediate fixes for critical issues, investigations for warnings, monitoring adjustments for info items, and any baseline recalibrations needed
  • Baseline update notes: Whether any baselines need recalibration due to structural changes (e.g., new campaign launched, channel added, seasonal shift, or pricing change that permanently alters expected ranges)

Agents Used

  • performance-monitor-agent — Anomaly detection engine, baseline management, statistical threshold evaluation, historical trend analysis, severity classification, and seasonality adjustment
  • analytics-analyst — Root cause interpretation, cross-platform correlation, contextual analysis (seasonality, algorithm updates, competitive shifts), impact estimation, and actionable recommendation generation
1---
2name: anomaly-scan
3description: "Scan connected platforms for anomalies against stored baselines, with likely causes. \"why did our CPA spike\""
4---
5 
6# /digital-marketing-pro:anomaly-scan
7 
8> **Script location.** If your host does not set `${CLAUDE_PLUGIN_ROOT}`, the scripts are in this plugin's `scripts/` folder, next to `skills/`. Run them with Python 3.10 or newer: `python`, or `python3` where `python` is not found (macOS, many Linux systems).
9 
10## Purpose
11 
12Scan all connected marketing platforms for anomalies — statistically significant deviations from established baselines that could indicate problems (traffic drops, CPA spikes, deliverability collapse, budget overruns) or opportunities (viral content, conversion rate improvements, unexpected channel growth). Designed to catch issues early, before they compound into costly problems, and to surface wins worth amplifying.
13 
14## Input Required
15 
16The user must provide (or will be prompted for):
17 
18- **Sensitivity level**: Strict (flags deviations >1.5 standard deviations from baseline), normal (>2 std dev),
19 or relaxed (>3 std dev). Defaults to normal
20- **Time period**: The window to scan for anomalies — today, last 3 days, last 7 days, last 30 days, or custom range.
21 Defaults to last 7 days
22- **Platforms** (optional): Specific platforms to focus the scan on (e.g., "Google Ads and Meta only").
23 If omitted, all connected platforms are scanned
24- **Metrics focus** (optional): Specific metrics to prioritize (e.g., "CPA and conversion rate only").
25 If omitted, all available metrics are evaluated
26- **Baseline period** (optional): Custom baseline for comparison instead of the default.
27 Defaults to the rolling 30-day average maintained by performance-monitor.py
28- **Exclude known events** (optional): List of known events to filter out (e.g., "Black Friday sale",
29 "site migration on Jan 15") so expected deviations are not flagged as anomalies
30 
31## Process
32 
331. **Load brand context**: Read `~/.claude-marketing/brands/_active-brand.json` for the active slug, then load `~/.claude-marketing/brands/{slug}/profile.json`. Apply brand voice, compliance rules for target markets (`skills/context-engine/compliance-rules.md`), and industry context. Also check for guidelines at `~/.claude-marketing/brands/{slug}/guidelines/_manifest.json` — if present, load restrictions. Check for agency SOPs at `~/.claude-marketing/sops/`. If no brand exists, ask: "Set up a brand first (/digital-marketing-pro:brand-setup)?" — or proceed with defaults.
342. **Pull current metrics from all connected MCPs**: Query each connected analytics platform
35 (google-analytics, google-ads, meta-marketing, linkedin-marketing, tiktok-ads, mailchimp, stripe, mixpanel,
36 amplitude, shopify, etc.) for all available metrics across the specified scan period. Include traffic, spend,
37 conversions, CPA, ROAS, engagement rates, deliverability, and revenue metrics.
383. **Load historical baselines**: Execute `python "${CLAUDE_PLUGIN_ROOT}/scripts/performance-monitor.py" --brand {slug} --action get-baseline`
39 to retrieve rolling averages, standard deviations, and expected ranges for each metric. If no baseline exists yet,
40 use the comparison period data to establish a temporary baseline and note this in the output.
414. **Run anomaly detection**: Execute `python "${CLAUDE_PLUGIN_ROOT}/scripts/performance-monitor.py" --brand {slug} --action detect-anomalies --data '{...current-period metrics...}'`
42 to flag metrics that fall outside the expected ranges computed from the stored baseline (mean ± standard deviations).
43 Apply day-of-week and seasonality adjustments where historical data supports it.
445. **Cross-reference with recent executions**: Check execution history via
45 `python "${CLAUDE_PLUGIN_ROOT}/scripts/execution-tracker.py" --brand {slug} --action get-history --limit 14`
46 to correlate anomalies with recent changes — did a campaign launch, pause, budget shift, creative swap,
47 landing page change, or audience expansion precede the anomaly?
486. **Cross-reference with known factors**: Check for known platform outages, algorithm updates
49 (Google core updates, Meta policy changes), industry events, seasonal patterns, and any user-provided
50 known events that could explain the deviation.
517. **Classify anomalies by severity**: Critical (revenue-impacting, requires immediate action — tracking broken,
52 CPA 3x+ baseline, budget overspend >20%, deliverability below 80%), Warning (significant deviations worth
53 investigating within 24 hours — traffic down 30%+, engagement halved, CTR dropped 40%+), or Info (notable
54 but non-urgent — gradual trend shifts, minor CPA increases, seasonal patterns emerging).
558. **Determine probable causes**: For each anomaly, analyze root causes using the diagnostic framework from
56 `skills/analytics-insights/anomaly-diagnosis.md`. Categorize as data/tracking issue, external factor
57 (algorithm update, competitor action, seasonal shift), internal change (campaign modification, landing page
58 update), or platform change (policy update, feature deprecation, auction dynamics shift).
599. **Save critical anomalies as insights**: For critical and warning-level anomalies, persist via
60 `python "${CLAUDE_PLUGIN_ROOT}/scripts/campaign-tracker.py" --brand {slug} --action save-insight --data '{"type":"anomaly","insight":"...","context":"..."}'`
61 so they are tracked, surface in future reports, and can be referenced in post-mortems.
62 
63## Output
64 
65A structured anomaly report containing:
66 
67- **Scan summary**: Platforms scanned, time period analyzed, sensitivity level used, baseline period,
68 total anomalies detected (by severity), and overall marketing health assessment (healthy, caution, or critical)
69- **Critical anomalies** (if any): Metric name, platform, expected range (mean +/- threshold), actual value,
70 deviation magnitude (in std devs and percentage), probable cause, estimated revenue impact, and recommended
71 immediate action
72- **Warning anomalies**: Same structure as critical, with recommended investigation steps and a 24-hour
73 action plan for each
74- **Info anomalies**: Notable deviations worth monitoring with watch criteria — what to look for to determine
75 if the trend continues or reverses
76- **Correlation analysis**: Connections between anomalies and recent execution history — which changes may have
77 caused which deviations, with confidence levels (strong, possible, unlikely)
78- **Platform health summary**: Per-platform health indicator (green/yellow/red) based on the number and severity
79 of anomalies detected, plus a trend vs the last scan if previous scan data exists
80- **Recommended actions**: Priority-ordered list of responses — immediate fixes for critical issues, investigations
81 for warnings, monitoring adjustments for info items, and any baseline recalibrations needed
82- **Baseline update notes**: Whether any baselines need recalibration due to structural changes (e.g., new campaign
83 launched, channel added, seasonal shift, or pricing change that permanently alters expected ranges)
84 
85## Agents Used
86 
87- **performance-monitor-agent** — Anomaly detection engine, baseline management, statistical threshold evaluation, historical trend analysis, severity classification, and seasonality adjustment
88- **analytics-analyst** — Root cause interpretation, cross-platform correlation, contextual analysis (seasonality, algorithm updates, competitive shifts), impact estimation, and actionable recommendation generation
89 
View all files on GitHub →

Details

License
MIT
Stars on the repo
★ 866
Checked
Source
indranilbanerjee/digital-marketing-pro ↗
Creator
indranilbanerjee · 114 listings
View creator

Similar skills

See all →
SkillTime Series MLK-Dense-AI/scientific-agent-skills · by K-Dense-AIThis skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.★ 46k GitHub starsSkillCellProfiler Microscopy PipelineK-Dense-AI/scientific-agent-skills · by K-Dense-AIRuns reproducible CellProfiler microscopy pipelines for nuclear segmentation, cell counts, and per-object fluorescence measurements. Supports image/channel manifests, headless batch execution, segmentation overlays, and measurement QC for 2D fluorescence assays.★ 46k GitHub starsSkillDeepTools NGS VisualizationK-Dense-AI/scientific-agent-skills · by K-Dense-AINGS analysis toolkit. BAM to bigWig conversion, QC (correlation, PCA, fingerprints), heatmaps/profiles (TSS, peaks), for ChIP-seq, RNA-seq, ATAC-seq visualization.★ 46k GitHub starsSkillData ExplorerK-Dense-AI/scientific-agent-skills · by K-Dense-AIPerform bounded, local exploratory analysis of explicitly supported scientific files. Use for redacted CSV/TSV/JSON profiles; optional NumPy, HDF5, FASTA/FASTQ, and basic image metadata inspection; missingness/leakage audits; outlier and transformation sensitivity; and rigorous EDA report scaffolds. Other domain formats are reference-only and unknown formats fail closed.★ 46k GitHub starsSkillNeuropixels Recording AnalyzerK-Dense-AI/scientific-agent-skills · by K-Dense-AIAnalyze Neuropixels extracellular recordings end-to-end with SpikeInterface. Covers loading SpikeGLX/Open Ephys/NWB data, preprocessing, drift/motion correction, Kilosort4 (and CPU) spike sorting, quality metrics, and unit curation (threshold-based, model-based UnitRefine, and AI-assisted visual review). Use when working with Neuropixels 1.0/2.0 recordings, spike sorting, or extracellular electrophysiology analysis.★ 46k GitHub starsSkillSample Size CalculatorK-Dense-AI/scientific-agent-skills · by K-Dense-AISample-size and statistical power calculations for planning studies. Use whenever someone asks "how many subjects/samples/replicates do I need", wants an a priori power analysis, a minimum detectable effect (MDE), a power curve, or needs to justify a sample size for a grant, IRB protocol, or pre-registration. Covers closed-form power for t-tests, ANOVA, proportions, correlations, chi-square, and regression, plus simulation-based (Monte Carlo) power for designs with no formula — logistic/Poisson regression, mixed models, cluster-randomized trials, survival, and interactions. Use this skill even when the request only mentions an effect size, alpha, or "80% power" without saying "power analysis" explicitly. For laying out the study (randomization, blocking, factorial/DOE, crossover, sequential designs) use experimental-design; for analyzing data already collected and reporting it use statistical-analysis.★ 46k GitHub stars

More from indranilbanerjee