Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

fix(marketing-optimizer): align input schema with ops-marketing-dash

auroracapital52997d73d640
diff --git a/claude-ops/agents/marketing-optimizer.md b/claude-ops/agents/marketing-optimizer.md
index f56f3a38..be1c55b0 100644
--- a/claude-ops/agents/marketing-optimizer.md
+++ b/claude-ops/agents/marketing-optimizer.md
@@ -16,11 +16,17 @@ Read pre-gathered marketing data from the ops-marketing-dash script:
"${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/ops-ops-marketplace}/bin/ops-marketing-dash" 2>/dev/null
```
-Parse the JSON output. Look for:
-- `meta_ads.spend`, `meta_ads.roas`, `meta_ads.purchases`, `meta_ads.campaigns[]`
-- `google_ads.spend`, `google_ads.conversions_value`, `google_ads.campaigns[]`
-- `klaviyo.attributed_revenue`
-- `ga4.revenue`, `ga4.conversions`
+Parse the JSON output. The schema emitted by `ops-marketing-dash` (v1.5+) is:
+
+- `meta` — account-level Meta Ads totals (last 7 days): `meta.spend`, `meta.impressions`, `meta.clicks`, `meta.ctr`, `meta.purchases`, `meta.purchase_value`, `meta.roas`. All values are strings. No per-campaign breakdown is pre-gathered — fetch campaigns directly via the fallback query below if you need per-campaign analysis.
+- `google_ads` — raw Google Ads `searchStream` response (array of pages). Each page has `.results[]` with `.campaign.{id,name,status}` and `.metrics.{costMicros,impressions,clicks,conversions,conversionsValue}`. Compute `google_ads.spend` as `[.[].results[]?.metrics.costMicros | tonumber] | add / 1000000` and `google_ads.conversions_value` as `[.[].results[]?.metrics.conversionsValue | tonumber] | add`.
+- `klaviyo` — `klaviyo.subscribers`, `klaviyo.last_campaign`, `klaviyo.last_campaign_status`, `klaviyo.open_rate`.
+- `ga4` — `ga4.sessions`, `ga4.users`, `ga4.conversions`, `ga4.revenue`, `ga4.cvr`.
+- `gsc` — `gsc.clicks`, `gsc.impressions`, `gsc.ctr`, `gsc.avg_position`.
+- `instagram` — `instagram.followers`, `instagram.media_count`, `instagram.reach_7d`.
+- Top-level: `blended_roas`, `health_score`, `health_status`, `date`.
+
+Any channel the user has not configured will be JSON `null` rather than an object.
If ops-marketing-dash data is unavailable, pull directly: