indranilbanerjee/anomaly-scan
Detect marketing anomalies. Use when: traffic drops, cost spikes, conversion changes, deliverability issues, budget overruns.
npx skills add https://github.com/indranilbanerjee/digital-marketing-pro --skill anomaly-scan
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.
The user must provide (or will be prompted for):
or relaxed (>3 std dev). Defaults to normal
Defaults to last 7 days
If omitted, all connected platforms are scanned
If omitted, all available metrics are evaluated
Defaults to the rolling 30-day average maintained by performance-monitor.py
"site migration on Jan 15") so expected deviations are not flagged as anomalies
~/.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.(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.
python "${CLAUDE_PLUGIN_ROOT}/scripts/performance-monitor.py" --brand {slug} --action get-baselineto 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.
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.
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?
(Google core updates, Meta policy changes), industry events, seasonal patterns, and any user-provided
known events that could explain the deviation.
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).
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).
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.
A structured anomaly report containing:
total anomalies detected (by severity), and overall marketing health assessment (healthy, caution, or critical)
deviation magnitude (in std devs and percentage), probable cause, estimated revenue impact, and recommended
immediate action
action plan for each
if the trend continues or reverses
caused which deviations, with confidence levels (strong, possible, unlikely)
of anomalies detected, plus a trend vs the last scan if previous scan data exists
for warnings, monitoring adjustments for info items, and any baseline recalibrations needed
launched, channel added, seasonal shift, or pricing change that permanently alters expected ranges)
Take indranilbanerjee/anomaly-scan from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.