Communitygithub.com

ad-ex-machina

Audit, research, architect, mutate, and optimize Google Ads, Keyword Planner, Local Services Ads (LSA), Google Search Console, GA4 conversion funnels, and high-converting landing pages. Includes built-in rate-limit shielding, Ad Library & human voice-of-customer research, human-first RSA copy linting, Anti-Model-Tampering routing across Claude, AGY/Gemini, and Codex (with solo fallback), and a 2026-2027 telemetry-driven self-improvement loop.

Qu'est-ce que ad-ex-machina ?

ad-ex-machina is a Claude Code agent skill that audit, research, architect, mutate, and optimize Google Ads, Keyword Planner, Local Services Ads (LSA), Google Search Console, GA4 conversion funnels, and high-converting landing pages. Includes built-in rate-limit shielding, Ad Library & human voice-of-customer research, human-first RSA copy linting, Anti-Model-Tampering routing across Claude, AGY/Gemini, and Codex (with solo fallback), and a 2026-2027 telemetry-driven self-improvement loop.

Compatible avec✓Claude Code✓Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/FranciscoContreras/ad-ex-machina/tree/HEAD

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Ad Ex Machina

Ads out of the Machine. Built to turn allotted ad budgets into paying customers — never vanity clicks, DIY browsers, student researchers, or cannibalized brand traffic.

Every capability in this skill is backed by zero-dependency Python 3.10+ executables in scripts/. Do not improvise raw curl loops, unvalidated mutations, or unresearched ad copy when a deterministic tool below already enforces the guardrails.


0. Iron Law — Zero Credential Exposure

  1. Credentials never enter any repository, prompt, commit, or markdown report.
    • developer_token, OAuth client_id / client_secret / refresh_token, and Customer IDs live only in ~/.google-ads.yaml (chmod 600) or environment variables outside Git.
    • scripts/gads.py refuses to execute if the config file sits inside a Git working tree.
  2. Pre-flight scan before peer dispatch or publishing:
    python3 scripts/secret_guard.py .
    python3 scripts/secret_guard.py --check-cred-file ~/.google-ads.yaml
    

1. Built-In Executable Toolkit

ScriptWhat It DoesKey Commands
scripts/gads.pyRate-shielded Google Ads REST + Keyword Planner + Offline Conversion CLI (searchStream, dual token-bucket limiter, TTL cache, mandatory validateOnly dry-run).onboarding, doctor, accounts, audit <CID>, keyword-planner <CID>, search-terms <CID>, query <CID> "<GAQL>", mutate <CID> --ops-file ops.json [--apply], offline-upload <CID>
scripts/gsuite_telemetry.pyGoogle Search Console organic-moat detector & GA4 paid landing-page funnel auditor.auth-guide, gsc-sites, gsc-organic-moat --site sc-domain:example.com, ga4-properties, ga4-funnel --property <ID>
scripts/research_vault.pyFree Ad Library deep-linker (Google Transparency, Meta, LinkedIn, TikTok), public forum VoC harvester, and Human-First RSA policy/anti-slop linter.ad-libraries --vertical "..." --competitors "a.com,b.com", mine-anecdotes --query "...", lint-rsa rsa.json
scripts/triad_router.pyAnti-Model-Tampering Protocol (AMTP) workspace planner & cross-model artifact gatekeeper (triad or solo mode).plan --workspace ./runs/r1 --mission "..." --mode triad, verify-gate --workspace ./runs/r1 --gate all
scripts/self_improve.pyScrubbed empirical lesson recorder & deterministic guardrail synthesizer (2026–2027 eval-first loop).record --category search_term_leak ..., synthesize
scripts/secret_guard.pyBlocks leaked tokens, keys, PEM blocks, non-placeholder emails, and live CIDs.secret_guard.py .

2. Anti-Model-Tampering Protocol (AMTP) — Model Routing

When a single agent researches competitors, edits landing pages, configures conversion actions, mutates Google Ads, and grades its own work in one context, it tampers with the scoreboard (counting soft scroll/tool events as primary leads, bidding on existing brand customers, or pointing ads at broken forms).

Route substantive builds across three sovereign lanes — or run --mode solo when only one model is available so deterministic gates still separate every stage. Full specification: references/anti-model-tampering.md.

LanePreferred Model FamilyOwnsHard Tampering Boundary
1. Recon, Browser & CreativeOpenAI Codex (Browser-use + image/creative + adversarial review)Scrapes public Ad Libraries & live SERPs, mines Reddit/review buyer language, generates visual ad creative & image briefs, and reviews diffs/ops adversarially.Read-only on googleAds:mutate and backend routes. Outputs 01-research-dossier.json.
2. Website & Conversion StackAnthropic Claude (Frontend, backend, UX & conversion tagging)Builds /lp/* landing pages, 2-step mobile forms, /api/contact + CRM webhooks, gclid capture, Enhanced Conversions, WEBSITE_CALL forwarding, and post-submit /thank-you calendar embeds.Cannot alter Google Ads customConversionGoals to mask low conversion rates. Outputs 02-conversion-surface-manifest.json.
3. Ads Mechanics & TelemetryGoogle AGY / Gemini (1M-context GAQL, Keyword Planner & creative setup)Runs gads.py audit, keyword-planner, gsc-organic-moat, ga4-funnel, creative asset assembly, Custom Goal isolation, and atomic validateOnly -> --apply mutations.Must pass research_vault.py lint-rsa + triad_router.py verify-gate before --apply. Outputs 03-mutate-operations.json.

Solo-Model Fallback: Any single frontier model (Claude alone, AGY/Gemini alone, or Codex alone) can execute all three lanes end-to-end by initializing python3 scripts/triad_router.py plan --mode solo ... and passing verify-gate (research -> surface -> ads) between phases.


3. End-to-End Execution Workflow

Step 1 — Bootstrap Access & Telemetry Health

If credentials are not yet configured, run python3 scripts/gads.py onboarding and python3 scripts/gsuite_telemetry.py auth-guide (full documentation in references/api-access-and-rate-limits.md). Otherwise verify connectivity first:

python3 scripts/gads.py doctor
python3 scripts/gads.py audit 1234567890
python3 scripts/gsuite_telemetry.py gsc-organic-moat --site sc-domain:example.com
python3 scripts/gsuite_telemetry.py ga4-funnel --property 123456789

Step 2 — Steal Proven Market Angles & Real Human Language

Good artists borrow; great artists steal. Never invent ad copy out of thin air:

python3 scripts/research_vault.py ad-libraries \
  --vertical "commercial hvac repair" \
  --competitors "competitor-one.com,competitor-two.com"
python3 scripts/research_vault.py mine-anecdotes --query "fired our seo agency"

Follow references/ad-library-and-human-copy.md to extract ads running >= 60 days and real buyer switching triggers into 01-research-dossier.json.

Step 3 — Model Keyword Economics & Channel Fit (Search vs. LSA)

Query real search volume and top-of-page CPC bounds before setting budgets or bid caps:

python3 scripts/gads.py keyword-planner 1234567890 \
  --mode metrics \
  --keywords "emergency plumber near me,water heater repair,commercial plumber" \
  --geo 2840

Apply the 7 Non-Negotiable Campaign Laws:

  1. Zero Junk Match Types on Constrained Budgets (<$150/day): Use 100% [EXACT] match (or tightly qualified high-intent phrases only in hyper-local zip radiuses) backed by templates/universal-negatives.json. Pause BROAD unless feeding 50+ verified offline revenue conversions/month.
  2. Never Starve CPC Caps Below Top-of-Page Low Bid: Setting a $9 Max CPC cap in a $16 market locks ads out of buyer auctions and forces TARGET_SPEND (Maximize Clicks) to buy $2 student/DIY junk. Set ceilings at 1.15x–1.30x Keyword Planner's top_of_page_cpc_high_usd on pure [EXACT] buyer terms.
  3. Isolate Conversion Goals cleanly: Demote soft events (PAGE_VIEW, scroll depth, free audit email gates) to primaryForGoal: false. When using a campaign Custom Goal, set overlapping standard campaign_conversion_goal rows to biddable: false.
  4. Never Pay for Customers You Already Own (Brand & Organic Moat Check): Check gsc-organic-moat + GA4 organic conversion rates before running Brand Defense. If you own #1 organic + a dominant GBP Knowledge Panel and competitors are not actively conquesting your name, put 100% of budget into net-new non-brand acquisition.
  5. LSA vs. Search Follows Review Moat: For local trades, put budget into Google Local Services Ads (LSA) where your linked GBP already holds a massive review lead (150–400+ 5★ reviews + live 3-ring phone pickup). Use Search for new expansion territories (where a brand-new GBP has too few reviews to rank in LSA) and for high-ticket specialty jobs (e.g., termite tenting, full system replacements) that LSA categories blur.
  6. Close Every Conversion Leak on /lp/*: Surface tracked click-to-call (WEBSITE_CALL forwarding snippet, 60s+ call threshold) on all paid landers, use 2-step progressive forms on mobile dialogs, and place booking calendars on /thank-you after form submit — never as an untracked pre-form outbound tab that drops gclid.
  7. Human Copy Only — Lint Before Mutating: Every RSA must pass research_vault.py lint-rsa (<=30 char headlines, <=90 char descriptions, <=15 char paths, 0 exclamation marks in headlines, 0 single-pin POOR traps, 0 synthetic buzzwords, concrete proof numbers + risk reversal).

Step 4 — Atomic Dry-Run (validateOnly) -> Live Apply -> Read-Back

Batch budgets, campaigns, ad groups, keywords, and RSAs using temporary negative IDs (templates/atomic-campaign-build.example.json):

python3 scripts/research_vault.py lint-rsa rsa-spec.json
python3 scripts/triad_router.py verify-gate --workspace ./runs/r1 --gate all
python3 scripts/gads.py mutate 1234567890 --ops-file ./runs/r1/03-mutate-operations.json          # validateOnly=true dry-run
python3 scripts/gads.py mutate 1234567890 --ops-file ./runs/r1/03-mutate-operations.json --apply  # live atomic commit
python3 scripts/gads.py audit 1234567890                                                          # read-back verification

4. Self-Improvement Loop (2026–2027 Standard)

After every 7-day search-term review, GA4 funnel check, or offline CRM upload (gads.py offline-upload), record empirical findings via scripts/self_improve.py and promote recurring patterns into deterministic code inside scripts/ + regression tests in evals/run_evals.py. Read references/self-improvement-2026-2027.md before modifying this skill.

Skills associés