account-research
Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect…
\"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
Claude Code
$ npx -y skills add charlieviettq/awesome-agent-skill --skill algo-ad-gsp --agent claude-code
Codex
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-ad-gsp -a codex -y
Cursor
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-ad-gsp -a cursor -y
Gemini CLI
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-ad-gsp -a gemini-cli -y
GitHub Copilot
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-ad-gsp -a github-copilot -y
OpenCode
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-ad-gsp -a opencode -y
Windsurf
$ npx skills add charlieviettq/awesome-agent-skill --skill algo-ad-gsp -a windsurf -y
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'.\"." allowed-tools: Read, Glob, Grep
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.
**Trigger conditions:**
**When NOT to use:**
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).
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.
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
Check: all payments ≤ bids, positions ordered by Ad Rank, no advertiser pays more than their bid. **Gate:** Payment ≤ bid for all winners, positions consistent.
Return slot assignments with positions, CPCs, and estimated clicks.
{
"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"}
}**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.
| Input | Expected | Why | |-------|----------|-----| | Tie in Ad Rank | Platform tiebreaker (historical CTR, etc.) | GSP needs strict ordering | | One bidder | Wins slot 1, pays minimum CPC | No competition → floor price | | Bid below threshold | Not eligible | Minimum bid requirement enforced |
Curated skill pack for LLM agents in engineer and science workflow (Cursor & Claude ready).
Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect…
Evaluate LLM agents and tool-using workflows—task success, tool accuracy, latency/cost, safety, and regression suites. Use when…
Design agent tools and CLI surfaces—schemas, naming, errors, idempotency, and discoverability for LLM callers. Use when defining…
\"Implement and select ad bidding strategies from manual CPC to automated target-CPA and target-ROAS. Use this skill when the…
\"Optimize advertising budget allocation across campaigns using marginal returns analysis. Use this skill when the user needs to…
\"Build CTR prediction models for estimating ad click-through rates from features. Use this skill when the user needs to predict…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.