Scan all connected marketing platforms for statistically significant deviations from stored baselines — traffic drops, CPA spikes, deliverability collapse, budget overruns, or unexpected wins — classified critical/warning/info with probable causes, correlation to recent changes, and recommended actions. Triggers on \"/digital-marketing-pro:anomaly-scan\", \"why did our CPA spike\", \"did anything weird happen this week\", \"check for anomalies\", \"our conversions suddenly dropped\". Runs perfor
git clone https://github.com/indranilbanerjee/digital-marketing-pro.git--- name: anomaly-scan description: "Scan all connected marketing platforms for statistically significant deviations from stored baselines — traffic drops, CPA spikes, deliverability collapse, budget overruns, or unexpected wins — classified critical/warning/info with probable causes, correlation to recent changes, and recommended actions. Triggers on \"/digital-marketing-pro:anomaly-scan\", \"why did our CPA spike\", \"did anything weird happen this week\", \"check for anomalies\", \"our conversions suddenly dropped\". Runs performance-monitor.py for baselines and detection, correlates flags against execution-tracker.py history and the diagnostic framework in skills/analytics-insights/anomaly-diagnosis.md, and persists critical findings as insights via campaign-tracker.py. Reads the brand profile." --- # /digital-marketing-pro:anomaly-scan ## 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. **Gather Data**: Export performance metrics from your analytics tools (e.g., Google Analytics, Meta Ads Manager, Klaviyo, Shopify) for the [TIME_PERIOD]. Ensure data covers the metrics you want to scan (e.g., traffic, spend, conversions). 2. **Customize the Prompt**: Replace [COMPANY], [TIME_PERIOD], [METRICS], [THRESHOLD_PERCENTAGE], and [KEY_BUSINESS_GOAL] with your specific details. For example, for a SaaS company, you might scan for "trial signups" and "churn rates." 3. **Run the Scan**: Paste the customized prompt into your AI tool (e.g., Claude, ChatGPT) and execute it. For large datasets, break the scan into smaller timeframes (e.g., weekly) to avoid token limits. 4. **Prioritize Actions**: Use the AI’s output to create a prioritized action plan. Focus on anomalies with the highest financial impact first (e.g., budget overruns, revenue drops). 5. **Monitor and Iterate**: After implementing fixes, re-run the scan weekly to track progress. Adjust the [THRESHOLD_PERCENTAGE] if you need to catch smaller anomalies earlier.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/indranilbanerjee/digital-marketing-pro/tree/main/skills/anomaly-scanCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Analyze the marketing performance data for [COMPANY] covering [TIME_PERIOD]. Flag any anomalies in [METRICS: e.g., website traffic, ad spend, conversion rates, email deliverability, or budget utilization]. For each anomaly, provide: 1) the likely cause (e.g., algorithm update, seasonal trend, technical issue), 2) the impact on [KEY_BUSINESS_GOAL], and 3) recommended corrective actions. Prioritize anomalies that deviate more than [THRESHOLD_PERCENTAGE]% from the 30-day rolling average or expected benchmarks.
Here’s the anomaly scan for **GreenLeaf Organics**, an e-commerce brand specializing in organic skincare, for the week of **June 10–16, 2024**. Data was pulled from Google Analytics, Meta Ads Manager, Klaviyo, and their Shopify store backend. **Anomalies Detected:** 1. **Email Deliverability Drop** - **Metric:** Email open rate fell to **12%** (vs. 30-day avg. of **28%**). - **Likely Cause:** Recent Gmail and Yahoo authentication policy updates may have flagged their sender domain as low-quality due to inconsistent DKIM/SPF records. - **Impact:** Projected **$12,000 in lost revenue** (assuming 15% of their 10,000 weekly email subscribers would have purchased). - **Action:** Immediately re-authenticate their domain with their ESP (Klaviyo) and run a re-engagement campaign to clean their list. Expected recovery time: **3–5 days**. 2. **Meta Ads Cost Spike** - **Metric:** CPC increased by **45%** (from **$0.89 to $1.29**) for their top-performing campaign targeting "organic face serums." - **Likely Cause:** Competitor bidding wars intensified after a viral TikTok trend featuring a rival brand’s product. Additionally, Meta’s iOS 17+ tracking changes may have reduced audience targeting precision. - **Impact:** Their **$5,000 weekly ad budget** now yields **30% fewer conversions** (down from 120 to 85). - **Action:** Pause the underperforming campaign, shift budget to Google Shopping Ads (where CPC is stable at **$0.65**), and retarget high-intent audiences with lookalike models. Expected cost savings: **$1,200/week**. 3. **Website Traffic Decline** - **Metric:** Organic search traffic dropped **22%** (from **8,500 to 6,630 sessions/week**). - **Likely Cause:** Google’s June 2024 core update prioritized larger, more authoritative health/beauty sites. GreenLeaf’s domain authority (DA 42) was outranked by competitors with DA 60+. - **Impact:** **$8,500 in missed organic revenue** (assuming 10% conversion rate). - **Action:** Audit and update their blog content for E-E-A-T (Experience, Expertise, Authoritativeness, Trustworthiness), target long-tail keywords (e.g., "best organic moisturizer for sensitive skin"), and build backlinks via guest posts on health blogs. Expected recovery: **4–6 weeks**. 4. **Budget Overrun** - **Metric:** Their **$10,000 monthly influencer budget** was spent in **10 days** due to unapproved collaborations with micro-influencers. - **Likely Cause:** Lack of a centralized approval workflow for influencer contracts. - **Impact:** **$3,000 overspend** with no measurable ROI. - **Action:** Implement a pre-approval process in their project management tool (Asana) and require signed contracts before any influencer payments. Expected savings: **$2,000/month**. **Summary:** The most urgent issues are the **email deliverability crisis** (risking $12K/week) and **Meta ad inefficiency** ($1.2K/week loss). Addressing these first will stabilize revenue while longer-term fixes (SEO and influencer governance) are implemented.
skills-collection
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan