claude-ads README

项目的 README,来自 github.com/AgriciDaniel/claude-ads。合并为一个 markdown 文件:README.md。

Paid Ads (Claude Ads): every ad account, one command line

Paid Ads (Claude Ads) v3.0.0

Paid Ads (formerly Claude Ads) is a free, open source paid-media operations plugin for Claude Code, Codex, claude.ai, and Agent Skills hosts. Give it your ad account exports or API data and it runs deterministic waste, budget, and MER diagnostics, scores Tier-1 Google and Meta accounts against source-grounded controls, and reports what is working, what is broken, and what to fix first across twelve ad platforms.

It is built for agencies, consultants, and in-house marketing teams. It is read-only by default and never changes your live ad accounts without explicit approval, diff preview, and rollback checks.

[!NOTE] Paid Ads is released at AgriciDaniel/claude-ads (MIT licensed, no membership needed).

Quickstart (One-Step Claude Code Install)

/plugin install paid-ads --marketplace agricidaniel/claude-ads

From a terminal, the same install is claude plugin install paid-ads --marketplace agricidaniel/claude-ads. The two-step form also works: claude plugin marketplace add AgriciDaniel/claude-ads, then claude plugin install paid-ads@ai-marketing-hub-claude-ads.

If you already added this marketplace before (for example for v2), run claude plugin marketplace update ai-marketing-hub-claude-ads first. Otherwise a stale cached copy makes the one-step install report that the marketplace is already added and then fail with Plugin paid-ads not found.

[!IMPORTANT] Already using Claude Ads v2? The plugin is now called paid-ads and its commands moved from /claude-ads:* to /paid-ads:*. See Upgrading from v2 for the exact steps, or for how to stay on v2.

How to invoke Paid Ads on your host:

The commands below use the plugin form. On a standalone install, drop the paid-ads: prefix (/paid-ads:ads setup becomes /ads setup).

Then run your first audit:

  1. Run /paid-ads:ads setup and answer a few questions: business model, goal, main conversion, monthly spend, active platforms, and approval rules. Never paste API keys or tokens.
  2. Bring evidence: a raw Google Ads or Meta Ads UI CSV export, GAQL JSON, or a structured export with its date range, currency, and timezone.
  3. Run /paid-ads:ads audit google (or /paid-ads:ads audit meta / /paid-ads:ads audit all). Deterministic Python diagnostics run before prose synthesis, returning passed, failed, and unknown controls with evidence.
  4. Run /paid-ads:ads report to render Markdown, HTML, or PDF, and /paid-ads:ads next to see the highest-priority blocker.

Three steps: tell it about your business, give it your data, then read the audit

Two Runtime Tiers

Paid Ads v3.0.0 runs cleanly across both CLI environments and browser chat:

Runtime Tier How You Use It Deterministic Tooling Included
Tier 1: Full CLI-backed (Claude Code, Codex, standalone) Install via /plugin install paid-ads --marketplace agricidaniel/claude-ads (add local Python helpers with bash install.sh --deps-only), or install standalone with bash install.sh --source=local. Full claude-ads-core CLI (ingest-export, diagnose, math, export-editor, score, validate, render), hash-locked .venv, guarded fetch_page.py, screenshot/PDF helpers, and optional Cockpit companion.
Tier 2: claude.ai Skill ZIP Upload or local --no-deps Download the Markdown-only paid-ads-3.0.0-claude-ai-skill.zip from the GitHub Release and upload it to claude.ai Skills (or install locally with --no-deps). paid-ads-3.0.0-claude-ai-skill.zip is strictly Markdown-only (no .py files, matching Anthropic uploader rules). In claude.ai chat, use <=25-row inline arithmetic with explicit totals (tagging uncomputed bulk metrics not_computed_no_runtime or manual_calculation_unverified), or upload the zero-dependency diagnose_portable.py into Code Execution. That script is not in the Skill ZIP: take it from the full release archive paid-ads-3.0.0.zip at plugins/paid-ads/scripts/diagnose_portable.py. Local --no-deps or checkout users can run the same script directly for generic campaign/spend or Google/Meta UI CSVs.

12-Platform Coverage Tiers

Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, Apple, Amazon, Reddit, Pinterest, Snapchat and X

Each platform has its own focused skill, control reference, and capability entry in plugins/paid-ads/control-plane/manifests/capability-manifest.json.

Tier Platforms Ingestion & Diagnostics Health Scoring
Tier 1 (Active Scoring & Full Diagnostics) Google Ads, Meta Ads Forgiving UI-CSV and GAQL ingestion (AccountSnapshot v2), deterministic waste/N-gram/Shopping zombie-SKU/PMax channel-mix/Meta creative-fatigue/Budget-IS/Smart Bidding diagnostics, MER & nCAC math, and reviewed Google Ads Editor bulk-CSV export (claude-ads-core). Enabled: 17 active source-grounded controls (10 Google, 7 Meta) with >=60% evidence coverage gate.
Tier 2 (Structured Audits & Native Exports) TikTok, LinkedIn, Microsoft, YouTube, Reddit, Pinterest, Snapchat, Apple, Amazon Structured platform audit references plus fixture-verified native export normalization (including Apple Ads Platform API v1 and Amazon Unified Reporting v1) and generic CSV ingestion. Disabled (discovery findings, unknowns, and coverage only; no unapproved composite score).
Tier 3 (Advisory & Generic CSV) X Ads Structured platform audit guidance and generic CSV export ingestion. Disabled (advisory findings and evidence gaps only).

What You Can Do

You want to Run You get
Find out what is wrong /ads audit Deterministic diagnostics plus passed, failed, and unchecked controls with evidence
Run paid-media math /ads math MER, nCAC, break-even ROAS, CPA, LTV:CAC, and budget pacing math
Decide where to spend /ads plan Channel, budget, measurement, and competitor plans
Make ads /ads create Campaign concepts, messaging, copy, and creative briefs (image files come from /ads generate; no video rendering)
Keep watch /ads monitor Checks on pacing, delivery, tracking, ad fatigue, and policy
Improve results /ads optimize --draft Evidence-backed change drafts without mutating the account
Test an idea /ads experiment Controlled experiment design or readout

Commands

Standalone installs use /ads. Claude Code plugin installs are namespaced as /paid-ads:ads. Both load plugins/paid-ads/skills/ads/SKILL.md.

Command What it does
/ads setup Save client, account, goal, privacy, and guardrail profile
/ads audit [all|platform|scope] Run a full or scoped audit backed by evidence
/ads google, /ads meta, ... Shortcut to any single platform's read-only audit
/ads math Compute MER, nCAC, ROAS, CPA, break-even, and pacing math
/ads plan Build channel, campaign, budget, competitor, and measurement plans
/ads create Produce campaign concepts, messaging, copy, and creative briefs (concepts and copy only; video stops at the brief)
/ads generate Generate image assets from a validated brief through a configured provider
/ads launch --draft Draft a campaign change plan without touching the account
/ads monitor Review pacing, delivery, tracking, fatigue, policy, and performance
/ads optimize --draft Draft evidence-backed improvements
/ads experiment Design or read out a controlled test
/ads report Render a saved run as Markdown, HTML, or PDF
/ads research refresh Refresh platform, policy, API, and benchmark evidence
/ads validate, /ads status, /ads next Check contracts, capabilities, and highest-priority blocker

Built to Be Trusted

Read only by default, evidence for every finding, honest about gaps, and your data stays yours

Every check ends in one of four results: pass, fail, unknown, or not_applicable. Unknown is a real answer: missing data is never guessed, and platform optimization scores are treated as vendor incentives rather than account health.

Claude Ads Cockpit (Optional)

Cockpit is an optional local companion plugin (ads-cockpit, version 0.2.0). /ads-cockpit opens a local terminal workbench to inspect a finished audit run, its evidence, operator insights (Top Wasted Spend and Platform vs Blended MER), missing inputs, baseline diffs, report receipts, and formula-safe Google Ads Editor CSV drafts (export-editor), with a synthetic demo mode. See the Cockpit guide and compatibility limits.

Installation

/plugin install paid-ads --marketplace agricidaniel/claude-ads

If you already added this marketplace, run claude plugin marketplace update ai-marketing-hub-claude-ads first (see Quickstart).

Plugin users who also want the local hash-locked Python .venv (for claude-ads-core, guarded fetch_page.py, and PDF/screenshot helpers) can provision dependencies without touching skill directories:

git clone https://github.com/AgriciDaniel/claude-ads.git
cd claude-ads
bash install.sh --deps-only

2. claude.ai Skill ZIP Upload

Download paid-ads-3.0.0-claude-ai-skill.zip and SHA256SUMS from the GitHub Release page, verify the single-file checksum (grep paid-ads-3.0.0-claude-ai-skill.zip SHA256SUMS | shasum -a 256 -c), and upload the single-root Markdown-only ZIP (ads/SKILL.md, ads/references/*, ads/skills/ads-*/SKILL.md) directly in claude.ai Skills. claude.ai registers one skill, ads. The workflow and platform skills under ads/skills/ are reference files that the root skill loads when needed; they do not trigger on their own, so start every request through the root skill.

The archive contains portable Markdown skills and references only (no .py files). For bulk CSV math in claude.ai Code Execution, upload diagnose_portable.py alongside your export, or rely on <=25-row inline arithmetic with explicit totals. The script is not in the Skill ZIP; it is in the full release archive paid-ads-3.0.0.zip at plugins/paid-ads/scripts/diagnose_portable.py.

diagnose_portable.py mirrors the package's core checks for Google and Meta UI CSVs and generic campaign/spend exports. Like the package, it fails closed on mixed currencies and on mixed or ambiguous decimal conventions, and it abstains on keyword exports instead of misreading them. A parity test (tests/core/test_engine_parity.py) runs the script and claude-ads-core on one fixture corpus and enforces that their shared outputs match. It does not replace the package: keyword self-blocking checks, scoring, and Editor export need the full CLI.

3. Multi-Host Standalone Installer (Linux, macOS, Windows)

Prefer a host-native plugin install or a tagged release archive verified with SHA256SUMS. Never pipe a remote installer directly to a shell.

git clone https://github.com/AgriciDaniel/claude-ads.git
cd claude-ads
bash install.sh --source=local

Supported standalone targets (--target=<host>):

Examples:

bash install.sh --target=codex --source=local
bash install.sh --target=agents --source=local --no-deps
bash install.sh --source=local --dry-run

On Windows PowerShell 5.1+ or PowerShell 7+:

git clone https://github.com/AgriciDaniel/claude-ads.git
Set-Location claude-ads
.\install.ps1 -Source local

Managed dependencies require CPython 3.11 to 3.13 and support Linux (x86_64, arm64, glibc >= 2.28; musl is unsupported), macOS (arm64, macOS 11+), and Windows (amd64). The installer automatically probes $CLAUDE_ADS_PYTHON, python3.13, python3.12, python3.11, uv python find --system --no-project, and python3 (or py -3.13/3.12/3.11 on Windows), and prints a clear message when it finds no supported Python, an old glibc, or musl. Use --no-deps (PowerShell: -NoDeps) for a skill-only install.

To pin a git install, pass --ref (PowerShell: -Ref) with --source=git:

bash install.sh --source=git --ref=v3.0.0

A git ref is not a checksum-verified release, and nothing here is signed. The verified path is downloading all four checksummed release assets (paid-ads-3.0.0.zip, paid-ads-3.0.0-claude-ai-skill.zip, release-manifest.json, and sbom.cdx.json) plus SHA256SUMS into an empty directory and checking:

sha256sum -c SHA256SUMS      # macOS: shasum -a 256 -c SHA256SUMS

Every line must report OK before you install from the archive:

unzip paid-ads-3.0.0.zip
cd paid-ads-3.0.0
bash install.sh --source=local

To verify only the claude.ai Skill ZIP on macOS or Linux without downloading the other assets, run:

grep paid-ads-3.0.0-claude-ai-skill.zip SHA256SUMS | shasum -a 256 -c

Upgrading from v2

v3.0.0 renames the plugin from claude-ads to paid-ads. Plugin commands move from /claude-ads:* to /paid-ads:*, and the 17 audit-* workers and 4 creative agents of v2 are replaced by two generic workers (maintainer-only agents no longer ship). Your saved v2 plugin options do not carry over.

Claude Code plugin users. Run these in a terminal (the slash forms such as /plugin marketplace update ... work the same inside Claude Code):

claude plugin marketplace update ai-marketing-hub-claude-ads
claude plugin install paid-ads@ai-marketing-hub-claude-ads
claude plugin uninstall claude-ads@ai-marketing-hub-claude-ads

Then restart Claude Code. Commands are now /paid-ads:ads ....

Staying on v2. Nothing is required until 2027-03-01. Until then the marketplace keeps a temporary legacy entry named claude-ads that points at the immutable v2.1.1 tag (the final v2 release, also the tip of the frozen v2 branch), so existing v2 installs keep working after a catalog refresh, and claude plugin update claude-ads@ai-marketing-hub-claude-ads moves you to 2.1.1. The legacy entry is removed on 2027-03-01. To keep v2 after that, pin the v2 marketplace:

claude plugin marketplace remove ai-marketing-hub-claude-ads
claude plugin marketplace add AgriciDaniel/claude-ads#v2.1.1
claude plugin install claude-ads@ai-marketing-hub-claude-ads

Warning: marketplace remove also uninstalls every plugin from that marketplace, including its saved options, so you will re-enter them after the reinstall. The v2 branch receives no new features.

Standalone install.sh / install.ps1 users. Re-run the v3 installer (see Multi-Host Standalone Installer). It removes v2 files that you never modified (including the old agents in ~/.claude/agents). Edited files that v3 no longer ships are kept and listed. If you edited a file that v3 still ships, your copy is saved next to it as <name>.user-<timestamp>.bak (the path is printed) and the new file is installed. Uninstall never deletes those backups or any file you changed.

Uninstall

Uninstall removes only manifest-owned files (supporting the unified v3 JSON v2 manifest .paid-ads-<target>.manifest.json as well as legacy v2 Bash TSV and PowerShell JSON v1 manifests):

bash uninstall.sh --target=claude

PowerShell equivalent: .\uninstall.ps1 -Target claude.

For Engineers and Contributors

Architecture, scoring rules, safety gates, and local development

Architecture

plugins/paid-ads/ is the single-source shipping plugin root. One conductor (plugins/paid-ads/skills/ads/SKILL.md) owns scope, policy, aggregation, and final artifacts. Two generic workers (agents/audit-platform.md and agents/audit-cross-platform.md) analyze bounded slices and return schema-valid JSON without model pins. Deterministic Python tools (claude-ads-core ingest-export, diagnose, math, export-editor, score, validate, render) execute before prose synthesis. export-editor --kind negatives refuses to draft negatives without positive keyword evidence (a keyword export, or a search terms report with Keyword and Added/Excluded columns) unless you pass --allow-missing-keyword-inventory.

Scoring and Evidence

  • Controls resolve to pass, fail, unknown, or not_applicable.
  • Tier-1 Google Ads (10 controls) and Meta Ads (7 controls) profiles are active when evidence coverage is at least 60% (>=80% graded, 60-79% provisional, <60% insufficient evidence).
  • Tier-2 and Tier-3 platforms remain unscored discovery audits until source-grounded severity policies are approved.
  • Optional, beta, premium, unavailable, and ineligible features stay unscored.

Account Safety

All adapters are read-only by default. Applying any live change requires an enabled capability, explicit object IDs, a before/after diff with blast radius, owner approval within ceilings, idempotency, verification, audit logging, and rollback.

Development

python3.12 -m venv .venv
.venv/bin/python -m pip install --no-deps -e .
.venv/bin/python -m pip install --require-hashes --only-binary=:all: -r plugins/paid-ads/requirements.lock
.venv/bin/python -m pip install --require-hashes --only-binary=:all: -r requirements-dev.lock
.venv/bin/python -m pip check
.venv/bin/python -m pytest -q

Focused checks:

python tools/release.py audit
python tools/eval_release_smoke.py --dry-run
claude plugin validate --strict --profile directory plugins/paid-ads
bash -n install.sh uninstall.sh

Repository Map

plugins/paid-ads/     single-source shipping plugin root (skills, agents, scripts, claude_ads_core, control-plane, requirements.lock)
mods/claude-ads-cockpit/  optional local Cockpit companion plugin
tools/                repository-only release, dependency audit, packaging, and smoke-eval scripts
.claude/agents/       repository-only maintainer agents (not shipped in user plugin)
evals/                routing and behavioral evaluation cases
tests/                deterministic, security, installer, core, and adapter tests

Contributing

Found a problem or have an idea? See CONTRIBUTING.md.

Thank you to everyone who has reported issues and proposed fixes, including @GrzegorzAgree, @aleps001, @bq9kpv2h98-max, @haruntekin89, @reikjarloekl, @osilova, @Nath24591, @sistemasond-ux, @principisimone-sys, @HarKro753, @plcosta, @ulises2k, @kutzki, @SamaEducationalCo, @Bortlesboat, @gabbyran2026-gif, @AbundantASG, @hendrixfreire, @josefresco, @dead-simba, @c6zks4gssn-droid, @kershrita, @popey, @xiaolai, @seojcarlos, and @botbikamordehai2-sketch. Full credits are listed in CONTRIBUTING.md.

Privacy

Client data, raw private research, captured prompts, credentials, account exports, and agent transcripts never belong in Git history, reports, or release archives. Keep credentials in environment variables, an OS keychain, or an approved secret manager.

License

Original Paid Ads (Claude Ads) code and documentation are available under the MIT License. Third-party APIs, trademarks, documentation, and cited artifacts remain subject to their own terms. Review the source ledger and third-party notices before importing external work.

claude-ads (AgriciDaniel/claude-ads)

正在搜索数据库…

这是做什么用的?一个面向付费媒体运营的 Claude Code 技能:它把经授权的广告账户导出数据或读取结果,转化为有出处依据的审计报告、广告系列计划、创意简报、实验方案、监控方案和带版本记录的报告,覆盖 12 个广告平台。
它是一个独立应用,还是运行在 Claude Code 里面的东西?它是一个技能,不是应用:Claude Code 是官方支持的运行环境,在运行环境支持的情况下,Codex、Gemini、Cursor、Windsurf 和 Goose 也可以使用同一套技能文件。独立安装使用 /ads 命令;Claude Code 插件则使用 /claude-ads:ads。
要让一切正常运转,还有哪些依赖需要我自己安装?有,两个:浏览器抓取需要操作者自行安装 Playwright 浏览器组件,PDF 渲染需要宿主机上的 WeasyPrint 和 Pango 系统库。两者都在外部运行时依赖清单中有说明。
它能真正改动我的广告账户,还是只能做分析?默认只读。在实际改动生效之前,每一个具体的平台操作都必须通过能力、审批、幂等性、验证、审计和回滚这几道关卡——缺少上限配置就无法写入,而且 v2 版本不支持永久删除。
它支持哪些广告平台?共十二个:社交类有 Google、Meta、YouTube、LinkedIn、TikTok、Microsoft、Reddit、Snapchat 和 X Ads,电商与零售媒体类还有 Apple、Amazon 和 Pinterest Ads。每个平台都有自己专属的技能、审计工作器和能力清单。
我的凭据和客户数据最终会存在哪里?凭据应放在环境变量、操作系统钥匙串或经认可的秘密管理工具中——绝不能放进仓库、配置文件、报告或日志。客户数据、账户导出内容和代理对话记录也绝不能进入 Git 历史、报告或发布归档。
用它来做客户项目是免费的吗?是的——公开发布的版本采用 MIT 许可证,不需要任何会员资格,所以代理公司和企业内部的商业使用都没问题。第三方的 API、商标和引用的素材仍受其各自的条款约束。
这个仓库和 AI Marketing Hub 镜像有什么区别?这里的公开发布版本采用 MIT 许可证,不需要任何会员资格。AI-Marketing-Hub/claude-ads 社区镜像则是 AI Marketing Hub Pro 会员获取抢先版本和直接参与协作的地方。
“有出处依据”在实践中到底是什么意思?每个结论都需要注明日期的来源:没有来源就不能对当前平台状况下结论;没有实现、测试数据和测试,就不能声称具备某项能力。报告还会标出缺失数据、过时来源、相互矛盾之处和部分失败的情况,而不是掩盖过去。
它能同时处理多个客户账户吗?可以。/ads setup 会创建客户、账户、KPI、隐私和防护规则配置,而且评分是在项目组合层面进行的——某个平台失败后会被排除在项目组合评分之外,并将整次运行标记为部分完成。
为什么 launch 和 optimize 只是草稿命令?/ads launch --draft 和 /ads optimize --draft 会生成人类可读的修改前后对比(diff),并标注影响范围,这样负责人可以在任何改动实际应用之前,在账户设定的上限范围内进行审批。缺少上限配置就无法写入。
大小
6 MB
星标
11.1K
时长
9个月
提交 · 90 天