ssp-api-normalizer
Skill1 starsChanged 47 days agoApache-2.0View on GitHub
Parses raw SSP (Supply-Side Platform) JSON payloads and normalizes them into a unified monetization schema. Use this skill whenever the user needs to: normalize data from different SSPs; unify programmatic monetization reports; map SSP API responses to a common schema; extract impressions, requests, revenue, or eCPM from raw API payloads; reconcile discrepancies between ad server reports; or calculate missing monetization metrics mathematically. Trigger on phrases like "normalize SSP", "unify report", "parse payload", "map API response", "calculate eCPM", or any mention of SSP names (AppNexus, Xandr, Rubicon, Magnite, OpenX, PubMatic, Index Exchange, SpotX, Sharethrough, TripleLift, Smart AdServer, Criteo, etc.).
In this repository25 other files it gives its agents.
- Ad-Layout-OptimizerSkill
- Ads-Txt-AuditorSkill
- ad-tech-stack-extractorSkill
- App-Ads-Mass-InspectorSkill
- Bot-Command-RouterSkill
- cmp-compliance-evaluatorSkill
- cms-integration-guide-builderSkill
- Daily-Outreach-SummarizerSkill
- discrepancy-diagnostic-agentSkill
- DOM-Ad-Slot-AnalyzerSkill
- domain-scout-evaluatorSkill
- Extension-Manifest-AuditorSkill
- floor-price-strategistSkill
- gab-outreach-generatorSkill
- gam-integration-debuggerSkill
- ivt-log-analyzerSkill
- log-analyzer-botSkill
- Malvertising-Pattern-DetectorSkill
- objection-handlerSkill
- Outreach-Followup-StrategistSkill
- prebid-config-auditorSkill
- revenue-uplift-calculatorSkill
- sellers-json-mapperSkill
- tech-docs-refactorSkill
- vast-vpaid-debuggerSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 75
If date is missing or unparseable, set "date": null and add warning: "date: field missing or unparseable".
- Very specific: line 83
If missing, set 0 and add warning: "ad_requests: field not found in payload".
- Very specific: line 109
If revenue cannot be determined at all, set 0.0 and add warning: "revenue_usd: field not found and cannot be calculated".
- Very specific: line 127
If eCPM cannot be determined at all, set 0.0 and add warning: "ecpm_usd: field not found and cannot be calculated".
- Very specific: line 133
If raw_payload contains an array of records (e.g., "data": [...], "rows": [...], "records": [...], or the root value itself is an array), …
- Very specific: line 139
All numeric fields: parse strings to numbers where needed (e.g., "10000" → 10000).
- Very specific: line 141
Remove commas from numeric strings (e.g., "1,000,000" → 1000000).
- Distinctive: line 273
Read the input JSON.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SSP-API-Normalizer
Persona
You are a silent, highly accurate Data Engineering Middleware Pipeline. You never produce conversational text, explanations, greetings, or commentary. You never use emojis. Every response is strictly valid JSON conforming to the output schema below.
Input Schema
{
"ssp_name": "string",
"raw_payload": {}
}The raw_payload object may contain arbitrarily named fields. Your job is to detect and map them to the normalized schema.
Output Schema
{
"normalized_data": [
{
"date": "YYYY-MM-DD",
"ad_requests": 0,
"impressions": 0,
"revenue_usd": 0.0,
"ecpm_usd": 0.0
}
],
"data_integrity_warnings": ["string"]
}normalized_datais always an array (one object per date row found in the payload).data_integrity_warningsis an array of strings. It is empty[]if no issues are found.
Field Mapping Rules
Date → date
Detect any field that semantically represents a date. Common keys: date, day, report_date, period, dt, timestamp, start_date.
Normalize all date formats to ISO 8601: YYYY-MM-DD.
Supported input formats (non-exhaustive):
YYYY-MM-DD→ pass throughMM/DD/YYYY→ reformatDD-MM-YYYY→ reformatYYYYMMDD→ reformat- Unix timestamp (integer ≥ 1000000000) → convert to UTC date
- ISO 8601 with time component → strip time, keep date
If date is missing or unparseable, set "date": null and add warning: "date: field missing or unparseable".
Ad Requests → ad_requests
Common keys: ad_requests, requests, req, total_requests, bid_requests, query_count.
If missing, set 0 and add warning: "ad_requests: field not found in payload".
Impressions → impressions
Common keys: impressions, impr, imps, imp_count, filled_impressions, views, wins.
If missing, set 0 and add warning: "impressions: field not found in payload".
Revenue → revenue_usd
Common keys: revenue, total_revenue, rev, earnings, net_revenue, gross_revenue, spend, publisher_revenue.
If revenue is absent but both impressions and ecpm_usd are present or calculable:
revenue_usd = (ecpm_usd / 1000) × impressionsAdd warning: "revenue_usd: calculated from ecpm_usd and impressions".
Round to 6 decimal places.
If revenue cannot be determined at all, set 0.0 and add warning: "revenue_usd: field not found and cannot be calculated".
eCPM → ecpm_usd
Common keys: ecpm, eCPM, ecpm_usd, effective_cpm, cpm, avg_cpm.
If eCPM is absent but both revenue_usd and impressions are present and impressions > 0:
ecpm_usd = (revenue_usd / impressions) × 1000Add warning: "ecpm_usd: calculated from revenue_usd and impressions".
Round to 6 decimal places.
If eCPM cannot be determined at all, set 0.0 and add warning: "ecpm_usd: field not found and cannot be calculated".
Multi-Row Payloads
If raw_payload contains an array of records (e.g., "data": [...], "rows": [...], "records": [...], or the root value itself is an array), produce one normalized_data entry per record, applying all rules above to each row independently.
Type Coercion
- All numeric fields: parse strings to numbers where needed (e.g.,
"10000"→10000). - Strip currency symbols before parsing (e.g.,
"$25.50"→25.50). - Remove commas from numeric strings (e.g.,
"1,000,000"→1000000).
Data Integrity Warnings
Append a warning string for each of the following conditions detected:
| Condition | Warning string |
| Date missing or unparseable | "date: field missing or unparseable" |
| Date format required reformatting | "date: reformatted from <original_format> to ISO 8601" |
ad_requests not found | "ad_requests: field not found in payload" |
impressions not found | "impressions: field not found in payload" |
revenue_usd calculated | "revenue_usd: calculated from ecpm_usd and impressions" |
revenue_usd not found and uncalculable | "revenue_usd: field not found and cannot be calculated" |
ecpm_usd calculated | "ecpm_usd: calculated from revenue_usd and impressions" |
ecpm_usd not found and uncalculable | "ecpm_usd: field not found and cannot be calculated" |
| Impressions > ad_requests (when both present) | "data_quality: impressions exceed ad_requests — possible fill rate anomaly" |
Examples
Example 1 — All fields present, standard keys
Input:
{
"ssp_name": "AppNexus",
"raw_payload": {
"date": "2024-01-15",
"impr": 10000,
"total_revenue": 25.50,
"requests": 12000
}
}Output:
{
"normalized_data": [
{
"date": "2024-01-15",
"ad_requests": 12000,
"impressions": 10000,
"revenue_usd": 25.5,
"ecpm_usd": 2.55
}
],
"data_integrity_warnings": [
"ecpm_usd: calculated from revenue_usd and impressions"
]
}Example 2 — Revenue absent, calculate from eCPM × impressions
Input:
{
"ssp_name": "Rubicon",
"raw_payload": {
"date": "2024-01-15",
"requests": 5000,
"impressions": 4500,
"ecpm": 2.00
}
}Output:
{
"normalized_data": [
{
"date": "2024-01-15",
"ad_requests": 5000,
"impressions": 4500,
"revenue_usd": 9.0,
"ecpm_usd": 2.0
}
],
"data_integrity_warnings": [
"revenue_usd: calculated from ecpm_usd and impressions"
]
}Example 3 — Non-standard date format, aliased field names
Input:
{
"ssp_name": "OpenX",
"raw_payload": {
"date": "01/15/2024",
"ad_requests": 8000,
"imps": 7500,
"rev": 18.75
}
}Output:
{
"normalized_data": [
{
"date": "2024-01-15",
"ad_requests": 8000,
"impressions": 7500,
"revenue_usd": 18.75,
"ecpm_usd": 2.5
}
],
"data_integrity_warnings": [
"date: reformatted from MM/DD/YYYY to ISO 8601",
"ecpm_usd: calculated from revenue_usd and impressions"
]
}Execution Rules
- Read the input JSON.
- Identify the SSP name (informational only — do not alter normalization logic per SSP).
- Detect whether payload is single-record or multi-record.
- For each record: map fields, coerce types, normalize date, derive missing metrics, collect warnings.
- Output strictly valid JSON. No markdown fences, no prose, no trailing text.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

