budget-optimizer
Skill4 starsChanged 6 months agoMITView on GitHub
Cross-platform budget optimizer that reallocates spend based on ROAS across Google, Meta, LinkedIn, X, Reddit, TikTok, Amazon, The Trade Desk, and Amazon DSP. Use for budget reallocation, ROAS optimization, or cross-platform spend efficiency.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- Synter-Media-AI/mcp-servertheir own version, first seen Oct 18, 2026
- wpfbcr/AtlasAgenttheir own version, first seen Oct 13, 2026
- teachskillofskills-ai/DigitalMarketingPro-techshutheir own version, first seen Oct 11, 2026
- TheMattBerman/meta-ads-kittheir own version, first seen Oct 8, 2026
- OneWave-AI/claude-skillstheir own version, first seen Sep 21, 2026
- indranilbanerjee/digital-marketing-protheir own version, first seen Feb 12, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- indranilbanerjee/digital-marketing-pro★ 934same name
- OneWave-AI/claude-skills★ 378same name
- TheMattBerman/meta-ads-kit★ 331same name
- Synter-Media-AI/mcp-server★ 21same name
- wpfbcr/AtlasAgent★ 2same name
- teachskillofskills-ai/DigitalMarketingPro-techshu★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository59 other files it gives its agents.
- ad-copy-generationSkill
- ad-creative-fatigue-detectorSkill
- ad-policy-complianceSkill
- amazon-ads-optimizerSkill
- anomaly-detectorSkill
- attribution-modelingSkill
- audience-expansion-strategySkill
- bid-optimizationSkill
- campaign-ide-handoffSkill
- campaign-preflightSkill
- campaign-structure-auditorSkill
- chatgpt-ads-conversion-trackingSkill
- chatgpt-ads-launchSkill
- competitor-analysisSkill
- creative-testingSkill
- cross-platform-attributionSkill
- cross-platform-launcherSkill
- dayparting-schedulerSkill
- executive-reportingSkill
- first-party-data-strategySkill
- google-ads-operatorSkill
- google-ads-quality-scoreSkill
- google-shopping-optimizerSkill
- gtm-metricsSkill
- incrementality-testingSkill
- keyword-researchSkill
- kill-scale-rulesSkill
- klaviyo-campaignsSkill
- landing-page-optimizerSkill
- launch-gatesSkill
- linkedin-ads-operatorSkill
- linkedin-ads-targetingSkill
- media-plan-builderSkill
- meta-ads-diagnosticsSkill
- meta-ads-operatorSkill
- mmm-budget-plannerSkill
- multi-channel-reportingSkill
- multi-platform-ads-operatorSkill
- multi-platform-launchSkill
- negative-keyword-minerSkill
- openai-ads-operatorSkill
- performance-max-optimizerSkill
- pixel-capi-auditorSkill
- pixel-capi-setupSkill
- platform-cost-benchmarksSkill
- public-ad-library-intelligenceSkill
- retargeting-sequence-designerSkill
- roas-calculatorSkill
- seasonal-budget-plannerSkill
- spearSkill
- spec-driven-devSkill
- synter-mcp-setupSkill
- tiktok-ads-operatorSkill
- tracking-leak-detectorSkill
- ugc-creative-briefSkill
- ui-contrast-reviewSkill
- utm-builderSkill
- video-ad-scriptwriterSkill
- x-ads-operatorSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Never auto-applies budget changes without --apply flag
- Very specific: line 24
Historical Trend Analysis: - Consider 7/14/30-day ROAS trends
- Very specific: line 67
Remove --dry-run to execute changes:
- Very specific: line 325
Start conservative: - Use --conservative flag initially
- Distinctive: line 326
Review before applying: - Always preview recommendations first
- Distinctive: line 327
Respect learning periods: - Don't optimize campaigns in learning phase
- Distinctive: line 331
Keep minimum budgets: - Never starve platforms completely
- Distinctive: line 335
campaign-preflight: - Run before applying budget changes
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cross-Platform Budget Optimizer
Analyzes ROAS performance across all connected ad platforms and generates budget reallocation recommendations to maximize overall return. Supports Google Ads, Meta Ads, LinkedIn Ads, X Ads, Reddit Ads, TikTok Ads, Amazon Ads, The Trade Desk, and Amazon DSP.
Safety Guardrails
Read-only by default. This skill:
- Analyzes performance data and outputs recommendations only
- Never auto-applies budget changes without
--applyflag - Requires explicit
--confirmfor applying changes over threshold - Generates detailed reports before any modifications
Capabilities
- Cross-Platform ROAS Analysis - Pull and compare ROAS across all platforms
- Budget Reallocation Recommendations - Suggest moving spend from low to high ROAS platforms
- Campaign-Level Optimization - Identify top/bottom performers within each platform
- Constraint-Aware Planning - Respect minimum budgets, daily caps, and platform limits
- Historical Trend Analysis - Consider 7/14/30-day ROAS trends
- Apply Budget Changes - Execute approved reallocations across platforms
Workflow
Step 1: Pull Performance Data
Fetch ROAS data from all connected platforms:
python3 scripts/pull_platform_metrics.py \
--platforms all \
--date-range 30d \
--output metrics.jsonStep 2: Analyze & Generate Recommendations
python3 scripts/analyze_budgets.py \
--input metrics.json \
--target-roas 3.0 \
--min-budget 10 \
--reallocation-threshold 0.15 \
--output recommendations.jsonStep 3: Preview Recommendations
python3 scripts/preview_reallocation.py \
--recommendations recommendations.jsonStep 4: Apply Budget Changes (Optional)
python3 scripts/apply_budget_changes.py \
--recommendations recommendations.json \
--confirm \
--dry-runRemove --dry-run to execute changes:
python3 scripts/apply_budget_changes.py \
--recommendations recommendations.json \
--confirmCommon Operations
Quick ROAS check across all platforms
python3 scripts/pull_platform_metrics.py \
--platforms all \
--date-range 7d \
--summary-onlyOptimize for a specific ROAS target
python3 scripts/analyze_budgets.py \
--input metrics.json \
--target-roas 4.0 \
--aggressive \
--output recommendations.jsonReallocate between specific platforms
python3 scripts/analyze_budgets.py \
--input metrics.json \
--platforms google,meta,linkedin \
--target-roas 3.0 \
--output recommendations.jsonWeekly optimization report
python3 scripts/generate_optimization_report.py \
--date-range 7d \
--format markdown \
--output weekly_report.mdReallocation Algorithm
The optimizer uses a ROAS-weighted reallocation algorithm:
- Calculate Platform Scores:
score = ROAS × conversion_volume_weight - Identify Donors: Platforms with ROAS < target × 0.8
- Identify Recipients: Platforms with ROAS > target × 1.2
- Calculate Shifts: Proportional to score difference, capped at thresholds
- Apply Constraints: Minimum budgets, max reallocation %, platform caps
Score Formula
platform_score = (
roas_normalized × 0.6 +
conversion_volume_normalized × 0.25 +
trend_score × 0.15
)Where:
roas_normalized= platform_roas / max(all_roas)conversion_volume_normalized= platform_conversions / max(all_conversions)trend_score= 7d_roas_change / 30d_avg_roas
Parameters
| Parameter | Required | Default | Description |
--platforms | No | all | Comma-separated platform list |
--date-range | No | 30d | Analysis period (7d, 14d, 30d, 60d, 90d) |
--target-roas | No | 2.0 | Target ROAS for optimization |
--min-budget | No | 10 | Minimum daily budget per platform ($) |
--reallocation-threshold | No | 0.10 | Max % to reallocate per cycle |
--aggressive | No | false | Allow larger reallocations (up to 25%) |
--conservative | No | false | Limit reallocations to 5% |
--dry-run | No | false | Preview without applying changes |
--confirm | No | false | Required to apply changes |
--output | No | stdout | Output file path |
Scripts Reference
| Script | Purpose |
pull_platform_metrics.py | Pull ROAS/spend/conversion data from all platforms |
analyze_budgets.py | Generate reallocation recommendations |
preview_reallocation.py | Display recommendations in human-readable format |
apply_budget_changes.py | Execute approved budget changes |
generate_optimization_report.py | Create comprehensive optimization report |
platform_metrics_adapters.py | Platform-specific API adapters for metrics |
Output Format
Recommendations JSON
{
"generated_at": "2026-01-18T10:00:00Z",
"analysis_period": "30d",
"target_roas": 3.0,
"total_budget": 1500.00,
"platforms": {
"google": {
"current_budget": 500.00,
"recommended_budget": 650.00,
"change": 150.00,
"change_pct": 30.0,
"roas": 4.2,
"conversions": 125,
"revenue": 2100.00,
"spend": 500.00,
"trend_7d": 0.15
},
"meta": {
"current_budget": 400.00,
"recommended_budget": 350.00,
"change": -50.00,
"change_pct": -12.5,
"roas": 2.1,
"conversions": 84,
"revenue": 840.00,
"spend": 400.00,
"trend_7d": -0.08
}
},
"reallocations": [
{
"from_platform": "meta",
"to_platform": "google",
"amount": 50.00,
"reason": "Google ROAS 4.2x vs Meta 2.1x"
},
{
"from_platform": "reddit",
"to_platform": "google",
"amount": 100.00,
"reason": "Reddit ROAS 1.5x vs Google 4.2x"
}
],
"estimated_impact": {
"current_blended_roas": 2.8,
"projected_blended_roas": 3.4,
"projected_revenue_increase": 450.00,
"confidence": "medium"
}
}Platform-Specific Notes
Google Ads
- Uses GAQL to query campaign performance
- Includes Search, Display, pMax campaign types
- Respects shared budgets
Meta Ads
- Queries campaign insights via Graph API
- Combines Facebook and Instagram data
- Handles CBO (Campaign Budget Optimization) campaigns
LinkedIn Ads
- Rest.li 2.0 protocol for metrics
- Includes Sponsored Content and Message Ads
- B2B conversion tracking
X Ads
- Campaign analytics via v12 API
- Includes promoted tweets and video views
- Engagement-to-conversion attribution
Reddit Ads
- API v3 for campaign metrics
- Includes subreddit targeting performance
- User-Agent header required
TikTok Ads
- Business API for reporting
- Video-first metrics (VTR, engagement)
- Interest targeting performance
Amazon Ads
- Sponsored Products/Brands/Display metrics
- ACOS (Advertising Cost of Sale) converted to ROAS
- Product-level attribution
The Trade Desk
- Programmatic display, video, CTV, audio
- Uses delta sync for efficient metric pulls
- Campaign-level budget optimization
- Supports GraphQL for complex queries
Amazon DSP
- Programmatic display and video on Amazon
- Async reporting (request → poll → download)
- Order-level budgets (lifetime, not daily)
- Region-aware (NA, EU, FE)
Minimum Budget Requirements
| Platform | Minimum Daily | Recommended Minimum |
| Google Ads | $1 | $10 |
| Meta Ads | $1 | $10 |
| LinkedIn Ads | $10 | $50 |
| X Ads | $1 | $10 |
| Reddit Ads | $5 | $20 |
| TikTok Ads | $20 | $50 |
| Amazon Ads | $1 | $10 |
| The Trade Desk | $0.01 | $50 |
| Amazon DSP | $100 (lifetime) | $500 (lifetime) |
Environment Variables
Required environment variables:
# Platform Connection IDs
# Platform Account IDs
GOOGLE_ADS_CUSTOMER_ID
META_AD_ACCOUNT_ID
LINKEDIN_AD_ACCOUNT_ID
TWITTER_AD_ACCOUNT_ID
REDDIT_AD_ACCOUNT_ID
TIKTOK_ADVERTISER_ID
AMAZON_ADS_PROFILE_ID
TTD_ADVERTISER_ID
AMAZON_DSP_PROFILE_ID
AMAZON_DSP_ADVERTISER_ID
# Google Ads specific
GOOGLE_ADS_DEVELOPER_TOKEN
GOOGLE_ADS_LOGIN_CUSTOMER_IDError Handling
| Error | Cause | Solution |
MISSING_CREDENTIALS | Platform OAuth not connected | Connect platform in Settings |
INSUFFICIENT_DATA | Not enough conversions for analysis | Extend date range or exclude platform |
BUDGET_BELOW_MINIMUM | Recommended budget below platform min | Increase total budget or exclude platform |
RATE_LIMITED | Too many API requests | Retry with backoff |
PARTIAL_DATA | Some platforms failed to report | Check individual platform errors |
APPLY_FAILED | Budget update failed on platform | Check platform-specific error, retry |
Best Practices
- Run weekly - Weekly optimization cycles balance data freshness with stability
- Start conservative - Use
--conservativeflag initially - Review before applying - Always preview recommendations first
- Respect learning periods - Don't optimize campaigns in learning phase
- Consider seasonality - Adjust targets for seasonal patterns
- Monitor after changes - Watch performance 48-72 hours after reallocation
- Set realistic targets - Base target ROAS on historical blended performance
- Keep minimum budgets - Never starve platforms completely
Integration with Other Skills
- campaign-preflight - Run before applying budget changes
- multi-channel-reporting - Generate reports after optimization
- bid-optimization - Optimize bids within reallocated budgets
- cross-platform-launcher - Deploy new campaigns with optimized allocation
About this skill
Part of the Synter free skills collection — open-source agent skills for advertising, PPC, and marketing automation.
Want this skill (and 40+ more) running on autopilot against your live ad accounts? Try Synter — AI Agent Media Buyers that connect to Google, Meta, LinkedIn, TikTok, Reddit, Amazon, and 7+ more platforms.
- 🌐 syntermedia.ai
- 📚 All free skills
- 💬 Built by @syntermedia — questions? Open an issue.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

