{"id":70947,"plugin_id":"plugin_asdk_app_6ad952447f7481918caf0285fb042792","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-10-29T19:06:07.014Z","digest":"23ee26cc7f98e867cccc665c2f775c1e16b892c2764a8ccf108aea6526aa0b60","against":null,"payload":{"description":"Find spend anomalies across all connected ad platforms with Toffu: sudden spikes, drops to zero and slow drift. Use when the user asks if anything is wrong or unusual in spend, whether something spiked, or wants a morning check before standup.","included_files":[],"name":"spend-anomaly-detection","skill_md_contents":"---\nname: spend-anomaly-detection\ndescription: Find spend anomalies across all connected ad platforms with Toffu: sudden spikes, drops to zero and slow drift. Use when the user asks if anything is wrong or unusual in spend, whether something spiked, or wants a morning check before standup.\n---\n\nUse the Toffu tools. Never apply a change the user has not confirmed.\n\n1. Call `get_account_context`. If a platform has several accounts, ask which one. Pass the ids as `account_ids` to `query_campaign_performance`, and as `account_id` to the other tools.\n2. Read data with `query_campaign_performance` (daily rows: `time_increment` \"1\"), `list_campaigns`, `list_ad_sets` and `list_ads`.\n3. To change something, call `propose_update_campaign`, `propose_update_ad_set` or `propose_update_ad`, and show the preview. Call `apply_change` only after the user confirms that change.\n\n`list_campaigns` gives the current status only, with no change history: say \"paused now\", without a time or a person.\n\n# Cross-Channel Spend Anomaly Detection\n\nUse when the user asks \"anything weird in spend yesterday\", \"did anything spike\", \"is everything pacing\", \"anomalies\", or wants a daily morning sanity check across Google Ads, Meta Ads, LinkedIn Ads, TikTok Ads. This is the first thing an agency lead checks before standup.\n\n## What counts as an anomaly\n\nCompare yesterday's spend per (account, campaign) to the trailing-14-day median for the same weekday slot:\n\n1. **Spike**: yesterday > 1.5x median AND absolute delta > $100. Could be a budget bug, a runaway bid, a Smart Bidding excursion, or an unexpected promo.\n2. **Drop-to-zero**: median > $20 AND yesterday == 0. Account suspended, payment failed, campaign accidentally paused, daily budget exhausted before midnight.\n3. **Slow drift**: 7-day moving average up > 25% vs prior 7-day moving average. Less urgent but a brief should mention it.\n\nWeekday-aware comparison matters. Saturday spend is structurally different from Tuesday. Don't use a single trailing-N-day mean.\n\n## Procedure\n\n1. Pull yesterday's per-campaign spend for every active account in scope. Same for the prior 14 days.\n2. For each (account, campaign), compute the weekday-matched median (e.g., last 2 Tuesdays if yesterday was Tuesday).\n3. Apply the three rules above.\n4. Cross-reference against status changes: if `effective_status` flipped to PAUSED in the last 24h, the drop is operator-induced — note it as \"paused yesterday at HH:MM by <user>\" rather than as an anomaly.\n\n## Output format\n\nThree sections, in this order:\n\n**Critical (act today)**: drops to zero on accounts spending > $200/day. Bullet per anomaly with the diagnostic (\"budget exhausted at 14:32 — raise budget\" / \"ad account disapproved — check Business Manager\").\n\n**High (review today)**: spikes above 1.5x median, absolute delta > $500.\n\n**Watch (mention in weekly)**: drift, smaller spikes.\n\nLead with the headline: \"X critical, Y high, Z watch. Total unexpected spend yesterday: $N.\" If empty: \"Nothing unusual.\"\n\n## Pitfalls\n\n- New campaigns don't have 14 days of history. Skip them or flag as \"new — no baseline\" — don't false-positive every launch.\n- Account-level vs campaign-level: detect at campaign level so a budget shift between two campaigns in the same account isn't reported as both a spike AND a drop.\n- Currency mixing kills the dollar-threshold logic. Convert everything to the agency's reporting currency before applying $100/$500 cutoffs.\n- Don't alert on weekend spend dropping. Most accounts intentionally taper. Use weekday-matched medians.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}