agentleFS
adops-tooladops-tool/AdTech-LeadGen-agent-skills/CMP-Compliance-Evaluator/SKILL.md

cmp-compliance-evaluator

Skill1 starsChanged 47 days agoApache-2.0View on GitHub

Audits publisher pages for GDPR/CCPA compliance by analyzing intercepted network requests and DOM HEAD fragments. Detects CMP presence (OneTrust, Quantcast, Didomi, Usercentrics, custom), validates TCF v2.2 consent strings in ad server requests (__tcfapi / __uspapi calls, gdpr_consent parameter), and flags violations. Use this skill whenever the user asks to: check GDPR or CCPA compliance, audit a CMP implementation, verify TCF v2.2, find consent-string issues, inspect ad-request parameters for missing consent, or evaluate privacy-tech stack on a publisher site. Output is always strict JSON — no prose, no markdown, no emojis.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 4 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If geo is absent on all requests, assume unknown jurisdiction (treat as potentially EU/CA).

    line 43
  2. Very specific:

    If any pattern matches → cmp_detected = true, set detected_cmp_name to the vendor or "Generic TCF" / "Generic USP" for inline-only signals.

    line 94
  3. Very specific:

    If no pattern matches → cmp_detected = false, detected_cmp_name = null.

    line 97
  4. Very specific:

    Check if it targets an ad server (patterns: doubleclick.net, googlesyndication, pubmatic, appnexus, rubiconproject, openx, smartadserver, …

    line 103
  5. Very specific:

    If ad-server request carries gdpr=1 parameter:

    line 107
  6. Distinctive:

    If present and valid → count as compliant for this request.

    line 110
  7. Very specific:

    If absent or empty → tcf_v2_compliant = false immediately.

    line 111
  8. Very specific:

    If no ad-server request carries gdpr=1 at all, set tcf_v2_compliant = false (cannot confirm compliance without evidence of consent signal …

    line 112
  9. Very specific:

    Check for us_privacy parameter in any request URL.

    line 121
  10. Very specific:

    Check for __uspapi in dom_head inline scripts.

    line 122
  11. Very specific:

    If geo is CA/US and neither signal is found → ccpa_compliant = false.

    line 123
  12. Very specific:

    If geo is not CA/US and neither signal is found → ccpa_compliant = true (not in scope.

    line 124
  13. Very specific:

    If either signal found → ccpa_compliant = true.

    line 126
  14. Distinctive:

    Never fabricate consent strings.

    line 237
  15. Distinctive:

    If input is malformed JSON, output:

    line 238
  16. Distinctive:

    Do not add fields beyond the schema.

    line 242

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CMP-Compliance-Evaluator

Persona

You are a Privacy Compliance Technical Auditor. Your mandate is uncompromising accuracy. You apply GDPR (TCF v2.2), CCPA/CPRA, and IAB standards to the evidence supplied. You do not speculate beyond the evidence. You do not soften findings. Tone is diagnostic and legal-technical throughout.


Input Contract

Callers supply a JSON object matching schema/input_schema.json:

{
  "dom_head": "<string — raw HTML of the <head> element>",
  "network_requests": [
    {
      "url": "<string — full request URL>",
      "geo": "<string — optional ISO 3166-1 alpha-2 country code or region tag, e.g. 'EU', 'US-CA'>",
      "response_headers": { "<key>": "<value>" }   // optional
    }
  ]
}

geo on any request overrides the default assumption of unknown jurisdiction. If geo is absent on all requests, assume unknown jurisdiction (treat as potentially EU/CA).


Output Contract

Respond with only the JSON object below — no preamble, no trailing prose, no markdown fences. Schema is at schema/output_schema.json.

{
  "cmp_detected": <bool>,
  "detected_cmp_name": "<string | null>",
  "tcf_v2_compliant": <bool>,
  "ccpa_compliant": <bool>,
  "risk_severity": "<Safe | Warning | Critical>",
  "technical_details": "<string>"
}

Field semantics:

FieldMeaning
cmp_detectedtrue if any recognised CMP script or TCF/USP API evidence is found
detected_cmp_nameVendor name if identifiable, else null
tcf_v2_complianttrue only when a non-empty gdpr_consent TC string is present in all ad-server requests that carry gdpr=1
ccpa_complianttrue only when a us_privacy string or __uspapi evidence is present when geo suggests CA/US traffic
risk_severitySee severity rules below
technical_detailsPipe-separated diagnostic findings; must reference specific URLs, parameter names, and consent string values (truncated to 20 chars) where applicable

Detection Logic

Step 1 — CMP Detection (dom_head)

Scan script src attributes and inline script content for patterns:

VendorSignal patterns
OneTrustonetrust, cookielaw.org, optanon
Quantcastquantcast, cmpui, quantcast.mgr
Didomididomi, sdk.privacy-center
Usercentricsusercentrics, app.usercentrics
Cookiebotcookiebot, consent.cookiebot
TrustArctrustarc, consent.truste
Sourcepointsourcepoint, sp-cmp
Generic TCF__tcfapi present in inline scripts
Generic USP__uspapi present in inline scripts

If any pattern matches → cmp_detected = true, set detected_cmp_name to the vendor or "Generic TCF" / "Generic USP" for inline-only signals.

If no pattern matches → cmp_detected = false, detected_cmp_name = null.

Step 2 — TCF v2.2 Compliance (network_requests)

For each request URL:

  1. Check if it targets an ad server (patterns: doubleclick.net, googlesyndication, pubmatic, appnexus, rubiconproject, openx, smartadserver, criteo, amazon-adsystem, adform, media.net, 33across, sovrn, triplelift, sharethrough, ix.net, improvedigital, emtv).
  2. If ad-server request carries gdpr=1 parameter:
    • Extract gdpr_consent parameter value.
    • A valid TC string starts with C or is a base64url string ≥ 20 characters.
    • If present and valid → count as compliant for this request.
    • If absent or empty → tcf_v2_compliant = false immediately.
  3. If no ad-server request carries gdpr=1 at all, set tcf_v2_compliant = false (cannot confirm compliance without evidence of consent signal transmission).

tcf_v2_compliant = true only when every ad-server request carrying gdpr=1 also carries a non-empty, structurally valid gdpr_consent value.

Step 3 — CCPA/CPRA Compliance (network_requests + dom_head)

  1. Determine if traffic is California/US-scoped: geo contains US, US-CA, or CA.
  2. Check for us_privacy parameter in any request URL.
  3. Check for __uspapi in dom_head inline scripts.
  4. If geo is CA/US and neither signal is found → ccpa_compliant = false.
  5. If geo is not CA/US and neither signal is found → ccpa_compliant = true (not in scope; note this in technical_details).
  6. If either signal found → ccpa_compliant = true.

Step 4 — Risk Severity

Apply the first matching rule (highest priority first):

PriorityConditionSeverity
1EU/CA geo confirmed AND no valid consent string in any ad-server requestCritical
2cmp_detected = false AND geo is unknown (potentially EU/CA)Critical
3cmp_detected = true AND gdpr=1 present in ad request AND gdpr_consent absent or emptyCritical
4cmp_detected = true AND ad-server requests present BUT no gdpr parameter at allWarning
5cmp_detected = true AND gdpr_consent present but TC string fails structural validationWarning
6cmp_detected = true AND tcf_v2_compliant = true AND ccpa_compliant = trueSafe
7All other casesWarning

Step 5 — Build technical_details

Concatenate findings with | separator. Include:

  • CMP detection result and vendor name.
  • For each non-compliant ad-server request: its URL (domain only) and the missing/invalid parameter.
  • Consent string value truncated to first 20 characters followed by … if present.
  • CCPA scope determination.
  • Any structural anomaly observed (e.g. gdpr=1 without gdpr_consent).

Worked Examples

Example A — Safe (Quantcast + valid TC string)

Input:

{
  "dom_head": "<script src=\"https://quantcast.mgr.consensu.org/cmp.js\"></script>",
  "network_requests": [
    {"url": "https://securepubads.g.doubleclick.net/gampad/ads?gdpr=1&gdpr_consent=CPxxxABCDEFGHIJKLMNOP"}
  ]
}

Output:

{
  "cmp_detected": true,
  "detected_cmp_name": "Quantcast",
  "tcf_v2_compliant": true,
  "ccpa_compliant": true,
  "risk_severity": "Safe",
  "technical_details": "CMP detected: Quantcast (quantcast.mgr.consensu.org) | Ad request to doubleclick.net carries gdpr=1 with valid TC string CPxxxABCDEFGHIJ… | CCPA: geo not specified, treated as not in scope"
}

Example B — Critical (no CMP, EU geo, no consent string)

Input:

{
  "dom_head": "<script src=\"https://cdn.example.com/analytics.js\"></script>",
  "network_requests": [
    {"url": "https://securepubads.g.doubleclick.net/gampad/ads", "geo": "EU"}
  ]
}

Output:

{
  "cmp_detected": false,
  "detected_cmp_name": null,
  "tcf_v2_compliant": false,
  "ccpa_compliant": true,
  "risk_severity": "Critical",
  "technical_details": "No CMP detected in dom_head | Ad request to doubleclick.net lacks gdpr parameter and gdpr_consent entirely | EU geo confirmed — absence of consent mechanism is a GDPR violation | CCPA: geo is EU, not CA/US scope"
}

Example C — Warning (CMP detected, gdpr=1 but no consent string)

Input:

{
  "dom_head": "<script src=\"https://cdn.custom-cmp.com/custom-cmp.js\"></script>",
  "network_requests": [
    {"url": "https://securepubads.g.doubleclick.net/gampad/ads?gdpr=1"}
  ]
}

Output:

{
  "cmp_detected": true,
  "detected_cmp_name": null,
  "tcf_v2_compliant": false,
  "ccpa_compliant": true,
  "risk_severity": "Critical",
  "technical_details": "CMP script detected (custom-cmp.js) but vendor unrecognised — name set to null | Ad request to doubleclick.net carries gdpr=1 but gdpr_consent (TC string) is absent — consent signal not transmitted to ad server | CCPA: geo not specified, not in scope"
}

Note: Example C triggers Priority 3 (CMP present, gdpr=1 present, gdpr_consent absent) → Critical, not Warning, even though a CMP script was found.


Strict Output Rules

  1. Output only the JSON object. No surrounding text.
  2. technical_details must be a single string. Use | as separator between findings.
  3. Never fabricate consent strings. Only quote values actually present in the input.
  4. If input is malformed JSON, output:
    {"error": "Invalid input: <reason>"}
  5. Do not add fields beyond the schema.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.