How nirbanravi/ppc-agent works
SpendSentry is a Claude Code PPC agent whose engine ingests ad exports, computes evidence-linked findings and pacing, and produces versioned reports or proposed changes. For account writes, proposals must pass a safety gate and receive explicit approval before a hook permits exact tool calls. The graph preserves the README’s audit, monitor, plan, experiment, report, optimize, create, and validate capabilities. Some command behavior is documented but its implementation was not sampled; those links cite the README rather than imply source inspection.
Main entry points: ads.py Ads CLI · approve.py Approval hook · checks.py Audit checks · audit.md Audit workflow
Components 18
Analysis engine
- Ads CLI
skills/ads/scripts/ads.py - Export intake
skills/ads/scripts/adslib/normalize.py - Audit checks
skills/ads/scripts/adslib/checks.py - Confidence scoring
skills/ads/scripts/adslib/confidence.py - Pacing analysis
skills/ads/scripts/adslib/pacing.py
PPC workflows
- Audit workflow
skills/ads/references/commands/audit.md - Monitor workflow
skills/ads/references/commands/monitor.md - Plan and experiments
skills/ads/references/commands/plan.md - Optimize and create
skills/ads/references/commands/optimize.md - Create workflow
skills/ads/references/commands/create.md
Approval safeguards
- Changeset gate
skills/ads/scripts/adslib/gate.py - Approval hook
skills/ads/hooks/approve.py - Write guard
skills/ads/hooks/guard.py
Runs and reports
- Run records
skills/ads/scripts/ads.py - Report rendering
skills/ads/scripts/adslib/render.py - Run validation
skills/ads/scripts/adslib/validate.py
Other components
- PPC operator
- Ad platform tools
Connections 23
- PPC operator → Ads CLI: runs commands
README.md - Ads CLI → Export intake: normalizes exports
skills/ads/scripts/ads.py - Ads CLI → Audit checks: runs checks
skills/ads/scripts/ads.py - Audit checks → Confidence scoring: scores findings
skills/ads/scripts/adslib/checks.py - Ads CLI → Pacing analysis: computes pacing
skills/ads/scripts/ads.py - Ads CLI → Run records: writes run records
README.md - Ads CLI → Report rendering: renders reports
skills/ads/scripts/ads.py - Ads CLI → Run validation: validates runs
skills/ads/scripts/ads.py - PPC operator → Audit workflow: requests audit
README.md - Audit workflow → Ads CLI: invokes engine
README.md - PPC operator → Monitor workflow: requests monitoring
README.md - Monitor workflow → Ads CLI: invokes engine
README.md - PPC operator → Plan and experiments: requests planning
README.md - Plan and experiments → Ads CLI: invokes engine
README.md - PPC operator → Optimize and create: requests optimization
README.md - Optimize and create → Ads CLI: invokes engine
README.md - PPC operator → Create workflow: requests creation
README.md - Create workflow → Ads CLI: invokes engine
README.md - Ads CLI → Changeset gate: gates changesets
skills/ads/scripts/ads.py - Changeset gate → Approval hook: issues approval code
README.md - PPC operator → Approval hook: approves code
README.md - Approval hook → Write guard: records approval
README.md - Write guard → Ad platform tools: permits approved calls
README.md