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.
phase: "10-google-ads" plan: "02" subsystem: ops-marketing tags: [google-ads, gaql, searchstream, campaign-dashboard, search-terms, budget-recommendations] dependency_graph: requires: [google-ads-credential-resolution, google-ads-token-refresh] provides: [google-ads-dashboard, google-ads-search-terms-report, google-ads-budget-recommendations] affects: [ops-marketing/SKILL.md]
Phase 10 Plan 02: Google Ads Read-Only Operations
Goal
Implement three read-only Google Ads sub-commands in ops-marketing/SKILL.md: a campaign performance dashboard (last 7 days), a Search Terms Report with negative keyword candidates (last 30 days), and budget optimization recommendations — all using GAQL searchStream with monetary values converted from micros to dollars.
Prerequisite: Plan 01 must be complete (credential resolution and token refresh in place).
Requirements Addressed
GADS-01: Campaign performance dashboardGADS-04: Search Terms Report with negative keyword candidatesGADS-06: Budget optimization recommendations
Runtime Prerequisites
Same as Plan 01 — credentials must be configured via /ops:setup google-ads.
No additional credentials required for read-only operations.
Deliverables
Files to Modify
claude-ops/skills/ops-marketing/SKILL.md— add routing table inside## google-ads, implement dashboard, search-terms, and budget-recs sub-commands
Task Breakdown
Task 1: Campaign Dashboard sub-command (GADS-01)
File: claude-ops/skills/ops-marketing/SKILL.md → ## google-ads section
Add sub-command routing table immediately after the credential/token guard:
| Input | Action |
|---|---|
| (empty), dashboard, overview | Campaign dashboard — last 7 days |
| search-terms, terms | Search Terms Report — last 30 days |
| budget-recs, recommendations, recs | Budget recommendations |
| campaigns, manage | Plan 03 |
| keywords, kw | Plan 03 |
Implement ### dashboard sub-command:
GAQL query (POST to https://googleads.googleapis.com/v23/customers/${GADS_CUSTOMER_ID}/googleAds:searchStream):
SELECT campaign.id, campaign.name, campaign.status, campaign_budget.amount_micros,
metrics.cost_micros, metrics.impressions, metrics.clicks, metrics.conversions,
metrics.conversions_value
FROM campaign
WHERE segments.date DURING LAST_7_DAYS AND campaign.status != REMOVED
ORDER BY metrics.cost_micros DESC LIMIT 20
Output format (banner + summary header + per-campaign table):
- Banner:
══ GOOGLE ADS — Last 7 Days ══ - Summary: Total Spend (
SUM(costMicros)/1e6via awk), Total Conversions, Overall ROAS (conversionsValue/spendwith zero-spend guard showing "—") - Per-campaign table:
Campaign | Status | Budget/day | Spend | Impr | Clicks | CTR | Conv | ROAS - All monetary values:
costMicros / 1000000viaawk printf "%.2f" - CTR:
clicks / impressions * 100with zero-impressions guard - Empty state:
No active campaigns found in the last 7 days. - Error: parse
.[0].error.message, print with credential hint
Implementation notes:
- Use
jq @tsv + while IFS=$'\t' readpipeline to avoid subshell output loss - Render table using
printf "%-40s %-10s ..."column format
Task 2: Search Terms Report and Budget Recommendations (GADS-04, GADS-06)
File: claude-ops/skills/ops-marketing/SKILL.md → ## google-ads section
Search Terms sub-command (GADS-04):
GAQL query on search_term_view resource:
SELECT search_term_view.search_term, search_term_view.status,
campaign.name, ad_group.name,
metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions
FROM search_term_view
WHERE segments.date DURING LAST_30_DAYS AND metrics.impressions > 0
ORDER BY metrics.impressions DESC LIMIT 100
Status column mapping: ADDED → ✓ Added, EXCLUDED → ✗ Excluded, NONE → ○ New
Per-term table: Search Term | Status | Campaign | Ad Group | Impr | Clicks | Cost | Conv
Negative keyword candidates section using inline jq select():
- Filter:
conversions == 0 AND costMicros > 1000000(>$1 spend, no conversions) - Print as bullet list under
Negative keyword candidates:
Empty state: No search term data found for the last 30 days.
Budget Recommendations sub-command (GADS-06):
GAQL query on recommendation resource:
SELECT recommendation.type, recommendation.campaign, recommendation.text,
recommendation.campaign_budget_recommendation.current_budget_amount_micros,
recommendation.campaign_budget_recommendation.recommended_budget_amount_micros,
recommendation.campaign_budget_recommendation.base_metrics.impressions,
recommendation.campaign_budget_recommendation.potential_metrics.impressions
FROM recommendation
WHERE recommendation.type IN (
CAMPAIGN_BUDGET, MOVE_UNUSED_BUDGET,
MARGINAL_ROI_CAMPAIGN_BUDGET, FORECASTING_CAMPAIGN_BUDGET
)
Type column human-readable labels:
CAMPAIGN_BUDGET→Budget IncreaseMOVE_UNUSED_BUDGET→Reallocate BudgetMARGINAL_ROI_CAMPAIGN_BUDGET→Marginal ROIFORECASTING_CAMPAIGN_BUDGET→Forecast Boost
Per-recommendation table: Type | Campaign | Current Budget | Recommended | Impact
Impact: percentage impressions increase (potentialMetrics.impressions - baseMetrics.impressions) / baseMetrics.impressions * 100; show — if base is 0.
Empty state: No budget recommendations available. Google needs campaign data to generate recommendations.
Threat Model
| ID | Threat | Mitigation |
|---|---|---|
| T-10-02-01 | GAQL responses expose campaign names and spend data in terminal | Accepted — terminal output is local; same exposure level as any CLI tool |
| T-10-02-02 | searchStream queries on large accounts returning excessive data |
Mitigated — LIMIT 20 on dashboard, LIMIT 100 on search terms |
| T-10-02-03 | Division by zero in ROAS/CTR calculations | Mitigated — awk guards on all division operations |
Dependencies
- Requires: Plan 01 complete (
GADS_ACCESS_TOKENavailable in## google-adsscope) - Provides:
google-ads-dashboard,google-ads-search-terms-report,google-ads-budget-recommendations
Success Criteria (Self-Check)
-
grep "GOOGLE ADS.*Last 7 Days" claude-ops/skills/ops-marketing/SKILL.md— PASS -
grep "SEARCH TERMS REPORT" claude-ops/skills/ops-marketing/SKILL.md— PASS -
grep "BUDGET RECOMMENDATIONS" claude-ops/skills/ops-marketing/SKILL.md— PASS -
grep -c "searchStream" claude-ops/skills/ops-marketing/SKILL.mdreturns ≥ 3 -
grep "Negative keyword candidates" claude-ops/skills/ops-marketing/SKILL.md— PASS -
grep "recommendedBudgetAmountMicros" claude-ops/skills/ops-marketing/SKILL.md— PASS