Agent skill

Algo Ad Budget

by asgard-ai-platform in asgard-ai-platform/skills

Optimize advertising budget allocation across campaigns using marginal returns analysis.

MITAuto-check passedMarketing & SEO

Install Algo Ad Budget

skills CLI
$ npx skills add asgard-ai-platform/skills --skill algo-ad-budget -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install asgard-ai-platform/skills algo-ad-budget --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/asgard-ai-platform/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/algo-ad-budget .claude/skills/algo-ad-budget && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
algo-ad-budget
GitHub stars
242
Token cost
~1.1k tokens
SKILL.md length
417 words
Files
4 (incl. references)
Skills in repo
207
Repo updated
First seen
Licence
MIT

At a glance

Optimize advertising budget allocation across campaigns using marginal returns analysis.

  • Works in 4 steps: Input Validation → Core Algorithm → Verification → …
  • The user needs to distribute budget across multiple campaigns
  • SKILL.md covers Overview, When to Use, Algorithm and Output Format, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Algo Ad Budget is an agent skill from asgard-ai-platform/skills. Optimize advertising budget allocation across campaigns using marginal returns analysis. Use this skill when the user needs to distribute budget across multiple campaigns, optimize spend pacing, or maximize overall ROAS under budget constraints — even if they say 'how to split my ad budget', 'campaign budget optimization', or 'diminishing returns on ad spend'.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `examples/sample_scenario.md`, `references/attribution-integration.md` and `references/response-curves.md`).

It sits in Marketing & SEO, covering Paid advertising. The repository describes itself as: 301 open-source coding agent skills across 22 domains — methodology, judgment & gotchas packaged as Claude Agent Skills for the Asgard AI Platform. The licence is MIT.

When your agent uses it

  • The user needs to distribute budget across multiple campaigns
  • Optimize spend pacing
  • Maximize overall ROAS under budget constraints — even if they say how to split my ad budget
  • Campaign budget optimization

Example prompts

  • “how to split my ad budget”
  • “campaign budget optimization”
  • “diminishing returns on ad spend”
  • “/algo-ad-budget”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Input Validation
  2. Core Algorithm
  3. Verification
  4. Output

What it can do on your machine

Read from SKILL.md and the folder at commit 4e7f4f8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Algo Ad Budget loads about 1.1k tokens when it runs, and up to ~7.1k if it reads all its reference files. Until then it costs about 94 tokens; SKILL.md has 417 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~94
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from asgard-ai-platform/skills at commit 4e7f4f8, republished under its MIT licence (© asgard-ai-platform). 417 words, ~1,091 tokens.

Download SKILL.mdSave it as .claude/skills/algo-ad-budget/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
algo-ad-budget
description
Optimize advertising budget allocation across campaigns using marginal returns analysis. Use this skill when the user needs to distribute budget across multiple campaigns, optimize spend pacing, or maximize overall ROAS under budget constraints — even if they say 'how to split my ad budget', 'campaign budget optimization', or 'diminishing returns on ad spend'.
metadata.category
WP-37 廣告演算法
metadata.tags
advertising, budget-optimization, allocation, marginal-returns

Ad Budget Allocation Optimization

Overview

Budget allocation distributes a total advertising budget across campaigns to maximize overall returns. Uses the equal marginal returns principle: allocate until the marginal CPA (or marginal ROAS) is equalized across all campaigns. Handles diminishing returns and budget constraints.

When to Use

Trigger conditions:

  • Distributing a fixed budget across multiple campaigns or channels
  • Identifying diminishing returns and optimal spend levels per campaign
  • Rebalancing budget after performance changes

When NOT to use:

  • When optimizing bids within a single campaign (use bidding strategy)
  • When there's only one campaign (nothing to allocate across)

Algorithm

IRON LAW: Equal Marginal Returns Principle
Optimal allocation makes the MARGINAL return of the last dollar
equal across ALL campaigns. If Campaign A's marginal CPA is $5
and Campaign B's is $15, shift budget from B to A until they equalize.
Total budget constraint: Σ budget_i = total_budget.
Phase 1: Input Validation

Collect per-campaign: historical spend, conversions, revenue at multiple spend levels. Need at least 3 data points per campaign to fit response curve. Gate: Sufficient historical data to estimate response curves.

Phase 2: Core Algorithm
  1. Fit response curve per campaign: conversions = f(spend). Common models: log curve, power curve, or S-curve
  2. Compute marginal return curve: f'(spend) for each campaign
  3. Allocate: use Lagrangian optimization or iterative greedy — assign next marginal dollar to campaign with highest marginal return
  4. Apply constraints: minimum spend floors, maximum caps, channel-specific rules
Phase 3: Verification

Check: total allocation = total budget, no campaign below floor or above cap, marginal returns approximately equal at boundaries. Gate: Allocation sums to budget, constraints satisfied.

Phase 4: Output

Return allocation table with expected performance projections.

Output Format

json
{
  "allocation": [{"campaign": "Search-Brand", "budget": 50000, "expected_conversions": 200, "expected_cpa": 250}],
  "total": {"budget": 200000, "expected_conversions": 650, "blended_cpa": 308},
  "metadata": {"optimization_method": "lagrangian", "response_model": "log_curve"}
}

Examples

Sample I/O

Input: Budget: $100K, Campaigns: Search ($50K, 100 conv), Social ($30K, 60 conv), Display ($20K, 20 conv) Expected: Shift budget from Display (high marginal CPA) to Search (low marginal CPA). e.g., Search $60K, Social $30K, Display $10K.

Show full SKILL.md (152 more words)Show less
Edge Cases
InputExpectedWhy
One campaign dominatesMost budget to winnerBut maintain minimum floor for others
All campaigns saturatedReduce total spendSpending more won't help
New campaign, no dataUse minimum test budgetNeed data before optimizing

Gotchas

  • Response curve extrapolation: Don't optimize beyond observed spend ranges. The curve may change shape at higher spend levels.
  • Attribution overlap: Users may see ads across campaigns. Last-click attribution double-counts, inflating high-funnel campaign CPA. Use multi-touch attribution.
  • Diminishing returns assumption: Not all campaigns follow smooth diminishing returns. Some have step functions (e.g., reaching a new audience segment at a spend threshold).
  • Time dynamics: Response curves shift seasonally and competitively. Refit curves monthly or use rolling windows.
  • Minimum viable spend: Each campaign needs enough budget to exit the learning phase. Spreading too thin means no campaign gets sufficient data.

References

  • For response curve fitting methods, see references/response-curves.md
  • For multi-touch attribution integration, see references/attribution-integration.md

© asgard-ai-platform, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in algo-ad-budget of asgard-ai-platform/skills.

  • SKILL.md
  • examples/sample_scenario.md
  • references/attribution-integration.md
  • references/response-curves.md

Open the folder on GitHubat commit 4e7f4f8

Compare with similar skills

Algo Ad Budget next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Algo Ad Budget compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Algo Ad Budget this skillasgard-ai-platform/skills242—~1.1kAutomated safety check: PassMIT
Ad CreativeLeoYeAI/openclaw-marketing-skills1k8 repos~3.4kAutomated safety check: PassCustom licence
Blog GoogleAgriciDaniel/claude-blog2.3k1 repos~3.3kAutomated safety check: NotesMIT
Ad Account Auditoraaron-he-zhu/aaron-marketing-skills2.9k2 repos~2.2kAutomated safety check: PassApache-2.0
Ad Creative Builderaaron-he-zhu/aaron-marketing-skills2.9k2 repos~2.2kAutomated safety check: PassApache-2.0
Ad Test Designeraaron-he-zhu/aaron-marketing-skills2.9k2 repos~2.8kAutomated safety check: PassApache-2.0

Similar skills

  • Ad Creative

    LeoYeAI/openclaw-marketing-skills

    When the user wants to generate, iterate, or scale ad creative — headlines, descriptions, primary text, or full ad variations — for any paid advertising platform.

    1k GitHub starsUsed in 8 repos~3.4k tokens
    Marketing & SEOAuto-check passed
  • Blog Google

    AgriciDaniel/claude-blog

    Google API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity…

    2.3k GitHub starsUsed in 1 repo~3.3k tokens
    Marketing & SEOAuto-check: notes
  • Ad Account Auditor

    aaron-he-zhu/aaron-marketing-skills

    A skill your agent uses when auditing a paid ad account for incremental contribution, wasted spend, or measurement integrity before scaling; runs a typed 20-item ROAS profile with verified vetoes…

    2.9k GitHub starsUsed in 2 repos~2.2k tokens
    Marketing & SEOAuto-check passed
  • Ad Creative Builder

    aaron-he-zhu/aaron-marketing-skills

    A skill your agent uses when the user asks to "write ad copy", "generate RSA headlines", or "build ad creative at volume"; produces ad units — RSA headlines/descriptions, hooks, and an angle matrix…

    2.9k GitHub starsUsed in 2 repos~2.2k tokens
    Marketing & SEOAuto-check passed
  • Ad Test Designer

    aaron-he-zhu/aaron-marketing-skills

    A skill your agent uses when the user asks to "design an A/B test", "set up a creative/landing test", "run an incrementality test", or "is this result statistically and practically material?"…

    2.9k GitHub starsUsed in 2 repos~2.8k tokens
    Marketing & SEOAuto-check passed
  • Paid Ads Audit

    AgriciDaniel/claude-ads

    Runs a source-grounded paid advertising audit across up to 12 ad platforms, with parallel platform workers, deterministic scoring and a versioned JSON bundle.

    9.9k GitHub stars~1.5k tokensUpdated 3 days ago
    Marketing & SEOAuto-check passed

More from asgard-ai-platform/skills

All 207 skills in this repo
  • Algo Ecom Bm25

    asgard-ai-platform/skills

    Implement BM25 ranking function for e-commerce product search relevance scoring.

    242 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Mfg Cpk

    asgard-ai-platform/skills

    Calculate Cpk process capability index to assess whether a process meets specification requirements.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Price Elasticity

    asgard-ai-platform/skills

    Calculate price elasticity of demand to quantify how price changes affect sales volume.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Bayesian

    asgard-ai-platform/skills

    Apply Bayesian averaging to rank items by combining observed ratings with prior expectations.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Elo

    asgard-ai-platform/skills

    Implement Elo rating system to rank items or players from pairwise comparison outcomes.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Wilson

    asgard-ai-platform/skills

    Calculate Wilson Score confidence intervals for ranking items by positive proportion with sample size correction.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed

Categories

Questions about Algo Ad Budget

What does Algo Ad Budget do?

Optimize advertising budget allocation across campaigns using marginal returns analysis. Algo Ad Budget is an agent skill from asgard-ai-platform/skills. Optimize advertising budget allocation across campaigns using marginal returns analysis.

When should I use Algo Ad Budget?

Algo Ad Budget fits situations like: the user needs to distribute budget across multiple campaigns; optimize spend pacing; maximize overall ROAS under budget constraints — even if they say how to split my ad budget; campaign budget optimization.

How do I install Algo Ad Budget in Claude Code?

Run `npx skills add asgard-ai-platform/skills --skill algo-ad-budget -a claude-code`. Or copy the skill folder (algo-ad-budget in asgard-ai-platform/skills) into .claude/skills/algo-ad-budget in your project. Claude Code loads it when a task matches its description.

How do I install Algo Ad Budget in Codex?

Run `npx skills add asgard-ai-platform/skills --skill algo-ad-budget -a codex`. Or copy the skill folder (algo-ad-budget in asgard-ai-platform/skills) into .agents/skills/algo-ad-budget in your project. Codex loads it when a task matches its description.

Can I use Algo Ad Budget in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add asgard-ai-platform/skills --skill algo-ad-budget -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/algo-ad-budget, .gemini/skills/algo-ad-budget, .github/skills/algo-ad-budget and .opencode/skills/algo-ad-budget in your project.

What does Algo Ad Budget need to run?

SKILL.md names no scripts, command-line tools or credentials: Algo Ad Budget is instructions for the agent only.

Does Algo Ad Budget access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Algo Ad Budget safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Algo Ad Budget use?

Algo Ad Budget is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Algo Ad Budget use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6k tokens, read only when the agent opens those files.

What are the alternatives to Algo Ad Budget?

Skills that share tags, products or a category with Algo Ad Budget: Ad Creative (LeoYeAI/openclaw-marketing-skills, 1k stars), Blog Google (AgriciDaniel/claude-blog, 2.3k stars), Ad Account Auditor (aaron-he-zhu/aaron-marketing-skills, 2.9k stars) and Ad Creative Builder (aaron-he-zhu/aaron-marketing-skills, 2.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Algo Ad Budget?

asgard-ai-platform (a GitHub organization) maintains it in asgard-ai-platform/skills, which has 242 GitHub stars. The repository holds 207 skills in this directory. The repository was last updated on June 6, 2026.

Source: asgard-ai-platform/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.