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.

7.8 KB
Raw Blame

phase: "10-google-ads" plan: "03" subsystem: ops-marketing tags: [google-ads, campaign-management, keyword-planner, ad-groups, mutate-api, gaql] dependency_graph: requires: [google-ads-credential-resolution, google-ads-token-refresh, google-ads-dashboard, google-ads-search-terms-report, google-ads-budget-recommendations] provides: [google-ads-campaign-management, google-ads-keyword-planner, google-ads-ad-group-management] affects: [ops-marketing/SKILL.md, docs/skills-reference.md]

Phase 10 Plan 03: Google Ads Write Operations

Goal

Implement mutating Google Ads operations in ops-marketing/SKILL.md: campaign management (list/create/pause/enable/budget), Keyword Planner (seed-to-ideas with volume/competition/bids), and ad group management (create groups, add/remove/update keywords). All destructive or financial operations gated via AskUserQuestion confirmation (Rule 5). Update skills reference documentation.

Prerequisite: Plans 01 and 02 must be complete.

Requirements Addressed

  • GADS-02: Campaign management (create, pause, enable, adjust budget)
  • GADS-03: Keyword Planner — discover keywords with volume and bid data
  • GADS-05: Ad group management (create groups, add/remove/bid-update keywords)

Runtime Prerequisites

Same as Plans 01–02. No additional credentials required. All operations use the campaigns:mutate, campaignBudgets:mutate, adGroups:mutate, adGroupCriteria:mutate, and :generateKeywordIdeas endpoints under the same googleads.googleapis.com/v23 base URL.

Deliverables

Files to Modify

  • claude-ops/skills/ops-marketing/SKILL.md — replace Plan 02 "see Plan 03" routing placeholder rows with final entries; add campaign management, keyword planner, and ad group sub-sections
  • claude-ops/docs/skills-reference.md — update /ops:marketing entry to include Google Ads; add 6 sub-command rows

Task Breakdown

Task 1: Campaign Management sub-commands (GADS-02)

File: claude-ops/skills/ops-marketing/SKILL.md → ## google-ads section

Replace placeholder routing rows with:

Input Action
campaigns, manage Campaign management — list, create, pause, enable, adjust budget
keywords, kw, keyword-planner Keyword Planner — discover keywords with volume and bid data
ad-groups, ag Ad group management — list, create, add/remove keywords, adjust bids

Implement ### campaigns sub-section:

List campaigns (campaigns / campaigns list):

  • GAQL searchStream selecting campaign.id, campaign.name, campaign.status, campaign.advertising_channel_type, campaign_budget.amount_micros
  • Output as banner + table: ID | Name | Status | Type | Budget/day

Create campaign (campaigns create):

  • AskUserQuestion: campaign name, daily budget (USD), channel type (SEARCH/DISPLAY/SHOPPING/VIDEO)
  • Two-step mutate:
    1. POST to campaignBudgets:mutate — create budget resource, capture results[0].resourceName
    2. POST to campaigns:mutate — create campaign with status: PAUSED (always starts paused for safety), linking the budget resource name
  • Print created campaign ID; note that user must manually enable after review

Pause campaign (campaigns pause <ID>):

  • AskUserQuestion confirmation (Rule 5) showing campaign name + ID
  • POST to campaigns:mutate with updateMask: "status", status: PAUSED

Enable campaign (campaigns enable <ID>):

  • No confirmation needed (non-destructive)
  • POST to campaigns:mutate with updateMask: "status", status: ENABLED

Adjust budget (campaigns budget <ID> <AMOUNT_USD>):

  • Fetch current budget resource name via searchStream on campaign_budget filtered by campaign ID
  • AskUserQuestion confirmation (Rule 5) showing old amount → new amount
  • POST to campaignBudgets:mutate with updateMask: "amountMicros", converting USD to micros (amount * 1000000)

Task 2: Keyword Planner and Ad Group Management (GADS-03, GADS-05)

File: claude-ops/skills/ops-marketing/SKILL.md → ## google-ads section

Keyword Planner sub-section (GADS-03):

  • Collect seed keywords via AskUserQuestion (comma-separated, split to JSON array)
  • POST to :generateKeywordIdeas on customer resource
  • Defaults: languageConstants/1000 (English), geoTargetConstants/2840 (United States); document alternatives for UK/Canada/Australia
  • Output table: Keyword | Avg Monthly Searches | Competition | Low Bid | High Bid
    • lowTopOfPageBidMicros and highTopOfPageBidMicros ÷ 1,000,000 → $X.XX
    • Sorted by avgMonthlySearches descending
  • Empty state: No keyword ideas found for these seeds. Try different or broader keywords.

Ad Group Management sub-section (GADS-05):

  • List ad groups (ad-groups list <CAMPAIGN_ID>): GAQL query filtered by campaign.id, status != REMOVED
  • Create ad group (ad-groups create <CAMPAIGN_ID>):
    • AskUserQuestion: name, CPC bid (USD)
    • POST to adGroups:mutate with type: SEARCH_STANDARD, bid converted to micros
  • List keywords (ad-groups keywords <AD_GROUP_ID>): GAQL on ad_group_criterion where type = KEYWORD
  • Add keyword (ad-groups add-keyword <AD_GROUP_ID>):
    • AskUserQuestion: keyword text, match type (Broad/Phrase/Exact → BROAD/PHRASE/EXACT), optional CPC bid
    • POST to adGroupCriteria:mutate with create operation
    • Use bash conditional expansion for optional bid field
  • Remove keyword (ad-groups remove-keyword <AD_GROUP_ID> <CRITERION_ID>):
    • AskUserQuestion confirmation (Rule 5)
    • POST to adGroupCriteria:mutate with remove operation, resource name adGroupCriteria/{AD_GROUP_ID}~{CRITERION_ID}
  • Update bid (ad-groups update-bid <AD_GROUP_ID> <CRITERION_ID> <BID_USD>):
    • POST to adGroupCriteria:mutate with updateMask: "cpcBidMicros" only
    • Document keyword immutability: text and match type cannot be changed; require remove+recreate

Task 3: Update skills reference documentation

File: claude-ops/docs/skills-reference.md

  • Update /ops:marketing description to include Google Ads alongside existing channels
  • Add 6 sub-command entries for Google Ads operations with descriptions matching SKILL.md implementation

Threat Model

ID Threat Mitigation
T-10-03-01 Campaign budget mutation without review Mitigated — AskUserQuestion confirmation showing old→new amounts; new campaigns always start PAUSED
T-10-03-02 Keyword removal is irreversible Mitigated — AskUserQuestion confirmation per Rule 5 before any remove operation
T-10-03-03 Enabling a campaign with unreviewed content Accepted — budget was already set and reviewed at create time; user is explicitly choosing to enable
T-10-03-04 Excessive keyword additions inflating spend Accepted — Google Ads API has its own rate limits; plugin adds one keyword at a time

Dependencies

  • Requires: Plans 01 and 02 complete
  • Provides: google-ads-campaign-management, google-ads-keyword-planner, google-ads-ad-group-management

Success Criteria (Self-Check)

  • grep -c "mutate" claude-ops/skills/ops-marketing/SKILL.md returns ≥ 6
  • grep "generateKeywordIdeas" claude-ops/skills/ops-marketing/SKILL.md — PASS
  • grep -c "AskUserQuestion" claude-ops/skills/ops-marketing/SKILL.md returns ≥ 2
  • grep "google-ads" claude-ops/docs/skills-reference.md returns ≥ 3 matches
  • grep "campaigns:mutate" claude-ops/skills/ops-marketing/SKILL.md — PASS
  • grep "campaignBudgets:mutate" claude-ops/skills/ops-marketing/SKILL.md — PASS
  • grep "adGroups:mutate" claude-ops/skills/ops-marketing/SKILL.md — PASS
  • grep "adGroupCriteria:mutate" claude-ops/skills/ops-marketing/SKILL.md — PASS
  • grep "Keywords are immutable" claude-ops/skills/ops-marketing/SKILL.md — PASS
  • grep "languageConstants/1000" claude-ops/skills/ops-marketing/SKILL.md — PASS