Agent skill

Algo Ad Gsp

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

Implement Generalized Second Price auction for ad slot allocation and pricing.

MITAuto-check passedMarketing & SEO

Install Algo Ad Gsp

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

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

GitHub CLI
$ gh skill install asgard-ai-platform/skills algo-ad-gsp --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-gsp .claude/skills/algo-ad-gsp && 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-gsp
GitHub stars
242
Token cost
~995 tokens
SKILL.md length
406 words
Files
4 (incl. references)
Skills in repo
207
Repo updated
First seen
Licence
MIT

At a glance

Implement Generalized Second Price auction for ad slot allocation and pricing.

  • Works in 4 steps: Input Validation → Core Algorithm → Verification → …
  • The user needs to understand search ad auctions
  • 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 Gsp is an agent skill from asgard-ai-platform/skills. Implement Generalized Second Price auction for ad slot allocation and pricing. Use this skill when the user needs to understand search ad auctions, compute ad positions and costs-per-click, or analyze bidding dynamics — even if they say 'how does Google Ads auction work', 'ad rank calculation', or 'second price auction for ads'.

Its SKILL.md is about 1000 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/gsp-equilibrium.md` and `references/gsp-vs-vcg.md`).

It sits in Marketing & SEO, covering Paid advertising. It works with Google Ads. 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 understand search ad auctions
  • Compute ad positions and costs-per-click
  • Analyze bidding dynamics — even if they say how does Google Ads auction work
  • Ad rank calculation

Example prompts

  • “how does Google Ads auction work”
  • “ad rank calculation”
  • “second price auction for ads”
  • “/algo-ad-gsp”

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 Gsp loads about 995 tokens when it runs, and up to ~5.3k if it reads all its reference files. Until then it costs about 86 tokens; SKILL.md has 406 words of instructions outside code blocks.

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

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). 406 words, ~995 tokens.

Download SKILL.mdSave it as .claude/skills/algo-ad-gsp/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
algo-ad-gsp
description
Implement Generalized Second Price auction for ad slot allocation and pricing. Use this skill when the user needs to understand search ad auctions, compute ad positions and costs-per-click, or analyze bidding dynamics — even if they say 'how does Google Ads auction work', 'ad rank calculation', or 'second price auction for ads'.
metadata.category
WP-37 廣告演算法
metadata.tags
advertising, auction, gsp, ad-pricing

Generalized Second Price Auction

Overview

GSP allocates K ad slots to N bidders, assigning the highest bidder the top slot, second-highest the second slot, etc. Each winner pays the bid of the advertiser ONE POSITION BELOW them (per-slot second price). Used by Google Ads and Bing Ads. Runs in O(N log N) for sorting bids.

When to Use

Trigger conditions:

  • Understanding search engine ad auction mechanics
  • Computing ad position and cost-per-click from bid and quality data
  • Analyzing bidding strategy in sponsored search

When NOT to use:

  • When you need incentive-compatible truthful bidding (use VCG mechanism)
  • When analyzing display/programmatic ad auctions (typically use first-price)

Algorithm

IRON LAW: GSP Is NOT Incentive-Compatible
Unlike Vickrey (single-item second-price) auctions, truthful bidding
is NOT a dominant strategy in GSP. Bidders may strategically shade
bids below their true value. The equilibrium depends on competitor bids.
Ad Rank = Bid × Quality Score (Google's variant adds format/extensions).
Phase 1: Input Validation

Collect: bids, quality scores (or ad rank scores) for all competing advertisers. Define available slot positions and their click-through rate multipliers. Gate: All bids positive, quality scores in valid range.

Phase 2: Core Algorithm
  1. Compute Ad Rank for each advertiser: AdRank_i = Bid_i × QualityScore_i
  2. Sort advertisers by Ad Rank descending
  3. Assign top-K to slots 1 through K
  4. Compute payment: CPC_i = AdRank_{i+1} / QualityScore_i (price to maintain position)
  5. Last slot winner pays the minimum bid threshold
Phase 3: Verification

Check: all payments ≤ bids, positions ordered by Ad Rank, no advertiser pays more than their bid. Gate: Payment ≤ bid for all winners, positions consistent.

Phase 4: Output

Return slot assignments with positions, CPCs, and estimated clicks.

Output Format

json
{
  "slots": [{"advertiser": "A", "position": 1, "ad_rank": 8.5, "cpc": 2.10, "est_clicks": 100}],
  "metadata": {"total_bidders": 15, "slots_available": 4, "auction_type": "gsp"}
}

Examples

Sample I/O

Input: Bidders: A(bid=3, QS=8), B(bid=4, QS=5), C(bid=2, QS=9). Slots: 2. Expected: Ranks: A=24, C=18, B=20. Order: A(1st), B(2nd). CPC_A = 20/8 = 2.50, CPC_B = 18/5 = 3.60.

Show full SKILL.md (152 more words)Show less
Edge Cases
InputExpectedWhy
Tie in Ad RankPlatform tiebreaker (historical CTR, etc.)GSP needs strict ordering
One bidderWins slot 1, pays minimum CPCNo competition → floor price
Bid below thresholdNot eligibleMinimum bid requirement enforced

Gotchas

  • Quality Score is opaque: Google's QS includes expected CTR, ad relevance, and landing page experience. The exact formula is proprietary.
  • Strategic bid shading: Since GSP isn't truthful, sophisticated advertisers shade bids. This means observed bids don't reflect true willingness to pay.
  • Position ≠ value: Higher position gets more clicks but at higher CPC. The most profitable position may be #2 or #3, not #1.
  • Budget constraints: GSP doesn't account for daily budgets. Budget-constrained advertisers must pace bids throughout the day.
  • Broad match expansion: The auction includes query-expanded matches, which may have different conversion rates than exact matches.

References

  • For Nash equilibrium analysis of GSP, see references/gsp-equilibrium.md
  • For comparison with VCG mechanism, see references/gsp-vs-vcg.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-gsp of asgard-ai-platform/skills.

  • SKILL.md
  • examples/sample_scenario.md
  • references/gsp-equilibrium.md
  • references/gsp-vs-vcg.md

Open the folder on GitHubat commit 4e7f4f8

Compare with similar skills

Algo Ad Gsp 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 Gsp compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Algo Ad Gsp this skillasgard-ai-platform/skills242—~995Automated safety check: PassMIT
Blog GoogleAgriciDaniel/claude-blog2.3k1 repos~3.3kAutomated safety check: NotesMIT
AdsCesarjoquin/Marketing-Skills2021 repos~3.5kAutomated safety check: PassMIT
Adscoreyhaines31/marketingskills54k1 repos~7kAutomated safety check: PassMIT
Google Adssuperdesigndev/treg5k—~1.9kAutomated safety check: PassCustom licence
Money Adsiamzifei/show-me-the-money1k—~2.4kAutomated safety check: PassCustom licence

Similar skills

  • 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
  • Ads

    Cesarjoquin/Marketing-Skills

    When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms.

    202 GitHub starsUsed in 1 repo~3.5k tokens
    Marketing & SEOAuto-check passed
  • Ads

    coreyhaines31/marketingskills

    When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms.

    54k GitHub starsUsed in 1 repo~7k tokens
    Marketing & SEOAuto-check passed
  • Google Ads

    superdesigndev/treg

    Traps when running Google Ads through treg — the API requirements and cleanup semantics that cost round-trips or money.

    5k GitHub stars~1.9k tokensUpdated today
    Marketing & SEOAuto-check passed
  • Money Ads

    iamzifei/show-me-the-money

    Paid advertising automation for Google Ads, Meta Ads, and other ad platforms.

    1k GitHub stars~2.4k tokensUpdated 1 mo ago
    Marketing & SEOAuto-check passed
  • Paid Ads

    freekmurze/dotfiles

    When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms.

    1k GitHub starsUsed in 14 repos~2.4k tokens
    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

Works with

Categories

Questions about Algo Ad Gsp

What does Algo Ad Gsp do?

Implement Generalized Second Price auction for ad slot allocation and pricing. Algo Ad Gsp is an agent skill from asgard-ai-platform/skills. Implement Generalized Second Price auction for ad slot allocation and pricing.

When should I use Algo Ad Gsp?

Algo Ad Gsp fits situations like: the user needs to understand search ad auctions; compute ad positions and costs-per-click; analyze bidding dynamics — even if they say how does Google Ads auction work; ad rank calculation.

How do I install Algo Ad Gsp in Claude Code?

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

How do I install Algo Ad Gsp in Codex?

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

Can I use Algo Ad Gsp 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-gsp -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-gsp, .gemini/skills/algo-ad-gsp, .github/skills/algo-ad-gsp and .opencode/skills/algo-ad-gsp in your project.

What does Algo Ad Gsp need to run?

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

Does Algo Ad Gsp 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 Gsp 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 Gsp use?

Algo Ad Gsp 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 Gsp use?

About 995 tokens (SKILL.md is roughly 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 4.3k tokens, read only when the agent opens those files.

What are the alternatives to Algo Ad Gsp?

Skills that share tags, products or a category with Algo Ad Gsp: Blog Google (AgriciDaniel/claude-blog, 2.3k stars), Ads (Cesarjoquin/Marketing-Skills, 202 stars), Ads (coreyhaines31/marketingskills, 54k stars) and Google Ads (superdesigndev/treg, 5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Algo Ad Gsp?

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.