[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71MMPCHZXA786YTBVP9A5WB":3,"skill-same:01M71MMPCHZXA786YTBVP9A5WB":91},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":14,"repositoryHtmlUrl":51,"repositoryHomepageUrl":52,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":54,"install":55,"resources":68},"01M71MMPCHZXA786YTBVP9A5WB","compliance-testing",null,"Test for regulatory compliance: GDPR\u002FCMP consent verification, Google Consent Mode v2, Global Privacy Control (GPC), CCPA\u002FUS state opt-out, EU AI Act Article 50 transparency, Better Ads Standards, and cookie-inventory auditing. Covers automated consent-flow testing, third-party script blocking before consent, and cookie drift detection. Use when: \"GDPR test,\" \"compliance,\" \"CMP test,\" \"cookie consent,\" \"consent mode,\" \"CCPA,\" \"GPC,\" \"AI Act,\" \"Better Ads,\" \"privacy banner.\" Not for: WCAG\u002Faxe-core test authoring — use accessibility-testing. Not for: OWASP\u002Fvuln scanning — use security-testing. Not for: evaluating your LLM feature's quality or safety — use ai-system-testing. Related: accessibility-testing, security-testing, ai-system-testing, ci-cd-integration.","pattanation\u002FNorvik","pattanation","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235419268?v=4","01M71M5THHYYB15ME8R2E4FCZG","Patta","01M71M5TJM1NDM992M8PDKYR2K",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fcompliance-testing\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"compliance testing","compliance","testing","transparency","flow","global privacy control","authoring","google","Safety","scanning","article","ads","verification","drift","when","google consent mode v2","ci","mode","inventory","cookie","2026-11-10 10:56:23",false,"---\nname: compliance-testing\ndescription: >-\n  Test for regulatory compliance: GDPR\u002FCMP consent verification, Google Consent\n  Mode v2, Global Privacy Control (GPC), CCPA\u002FUS state opt-out, EU AI Act Article 50\n  transparency, Better Ads Standards, and cookie-inventory auditing. Covers automated\n  consent-flow testing, third-party script blocking before consent, and cookie drift\n  detection.\n  Use when: \"GDPR test,\" \"compliance,\" \"CMP test,\" \"cookie consent,\" \"consent mode,\"\n  \"CCPA,\" \"GPC,\" \"AI Act,\" \"Better Ads,\" \"privacy banner.\"\n  Not for: WCAG\u002Faxe-core test authoring — use accessibility-testing. Not for: OWASP\u002Fvuln\n  scanning — use security-testing. Not for: evaluating your LLM feature's quality or\n  safety — use ai-system-testing.\n  Related: accessibility-testing, security-testing, ai-system-testing, ci-cd-integration.\nlicense: MIT\nmetadata:\n  author: kindlmann\n  version: \"2.0\"\n  category: process\n---\n\n\u003Cobjective>\nCompliance is binary: a single analytics cookie that fires before consent, or a \"Reject all\" rendered as a tiny grey link, is a violation no matter how polished the rest of the flow looks. Manual quarterly audits miss the regression a developer shipped on a Tuesday. This skill automates the technical checks — consent state, script blocking, cookie attributes, GPC, Consent Mode v2, AI Act disclosure — so configuration drift fails CI instead of a regulator's inbox.\n\u003C\u002Fobjective>\n\n## Discovery Questions\n\nFirst, check for `.agents\u002Fqa-project-context.md` in the project root — it carries applicable regulations, CMP details, ad networks, and geographic scope. Skip any question already answered there. If it is missing, suggest creating one with the `qa-project-context` skill.\n\n### Applicable regulations\n- **Which privacy and platform regulations apply?** This sets the entire test matrix.\n  - **EU:** GDPR, ePrivacy Directive (cookies), Digital Services Act (DSA, applied 17 Feb 2024), EU AI Act (prohibitions + AI literacy live since 2 Feb 2025; GPAI obligations + penalties since 2 Aug 2025; Article 50 transparency from 2 Aug 2026 — high-risk obligations postponed, see below).\n  - **US:** CCPA\u002FCPRA plus comprehensive state laws now active in ~20 states (Texas TDPSA, Indiana CDPA eff. 1 Jan 2026, Delaware DPDPA, Nebraska NDPA, Minnesota CDPA, Rhode Island DTPPA, …). Most require honoring Global Privacy Control (`Sec-GPC: 1`).\n  - **UK:** UK GDPR\u002FDPA, PECR (cookies), Online Safety Act 2023, Data Use and Access Act (DUAA).\n  - **Other:** LGPD (Brazil), PIPEDA (Canada), POPIA (South Africa).\n- **What is the legal basis for processing?** Consent (opt-in), legitimate interest, or contractual necessity — this decides whether explicit consent must precede processing.\n- **Is there a DPO or legal team?** They define the legal requirements; this skill only validates the technical implementation against them.\n\n### Consent management\n- **What CMP is in use?** OneTrust, Cookiebot, Didomi, Usercentrics, Iubenda, Sourcepoint, or Axeptio — or custom? The CMP sets the consent storage format, API, and integration. **If you serve ads in the EEA or UK, you must use a Google-certified CMP and Consent Mode v2** — uncertified CMPs block Google ad serving. **As of 28 Feb 2026, new TC strings must be TCF v2.3** or Google demand treats traffic as unconsented and drops to Limited Ads.\n- **What consent categories exist?** Typically Strictly Necessary (always on), Analytics\u002FPerformance, Functional\u002FPreferences, Marketing\u002FTargeting.\n- **How is consent signaled to third-party scripts?** IAB TCF v2 (`__tcfapi`), a custom data layer, or direct CMP API?\n\n### Advertising and accessibility\n- **What ad networks and formats?** Google Ads, Meta, programmatic; display, video, interstitial. The Coalition for Better Ads defines which formats trigger Chrome ad-filtering.\n- **Are there accessibility obligations (ADA, EAA, Section 508)?** Those are real compliance, but author them in `accessibility-testing` — this skill only maps the legal landscape, see below.\n\n## Core Principles\n\n### 1. Compliance is binary\nThere is no \"mostly compliant.\" A cookie that fires before consent is a violation. A banner you cannot dismiss without accepting is a violation. Test for exact compliance, not \"good enough.\"\n\n### 2. Automate the technical checks, schedule the legal audits\nAutomate: cookies before consent, scripts loading without consent, banner functionality, cookie attributes, consent persistence, GPC, Consent Mode signals. A human still audits privacy-policy *language* and cross-border transfer documentation. Don't pretend a test settles a legal-language question.\n\n### 3. Test the unhappy consent states\nThe compliance boundary lives in the \"no interaction,\" \"rejected,\" and \"withdrawn\" states — that is where violations hide. The \"all accepted\" state is the least interesting one to test.\n\n### 4. Verify behavior, not the CMP\nCMPs have bugs. Don't trust the CMP UI as proof. Assert the actual outcome: were cookies set, did scripts load, was the GPC opt-out registered. The CMP is an implementation detail; compliance is measured by behavior.\n\n### 5. Defense in depth, config-driven\nVerify at multiple layers — CMP config, network requests, cookie state, client signals. Drive tests from a typed inventory and a tracking-domain list so adding a category or threshold is a data edit, not a suite rewrite. Regulations change; the suite must be cheap to update.\n\n## GDPR \u002F CMP Testing with Playwright\n\nConsent-flow compliance breaks into distinct, independently failing checks. Full runnable code for each is in `references\u002Fgdpr-cmp-tests.md`.\n\n- **Consent banner and dark patterns** — banner appears on first visit; accept and reject have equal prominence (reject is not a tiny link); a privacy-policy link is present.\n- **Cookie state before\u002Fafter consent** — the critical test: no non-essential cookies before consent; analytics cookies only after accepting; nothing non-essential after rejecting. Maintain `isStrictlyNecessary` \u002F `isAnalyticsCookie` classifiers against your inventory.\n- **Consent persistence and withdrawal** — consent survives navigation; the user can withdraw via privacy settings, which must then clear the relevant cookies.\n- **Third-party script blocking** — tracking scripts (`google-analytics.com`, `googletagmanager.com`, `facebook.net`, `analytics.tiktok.com`, `bat.bing.com`, …) must not load before consent and should load after acceptance. This is the most critical check — monitor with `page.on('request')`.\n- **Global Privacy Control (`Sec-GPC: 1`)** — a required honored signal under CCPA\u002FCPRA and most active US state laws. With the header set, assert `navigator.globalPrivacyControl === true` (the real browser signal) and that marketing cookies are absent. **Do not** assert an invented `window.__cmp.gpcStatus` global — it does not exist; TCF v1's `__cmp` is legacy and TCF v2 uses `__tcfapi`.\n- **TCF v2 consent state** — every TCF-certified CMP exposes `window.__tcfapi('getTCData', 2, cb)`. Read purpose\u002Fvendor consent through it directly instead of guessing at CMP-private globals; the same call exposes `tcfPolicyVersion`, which doubles as a TCF-v2.3 freshness guard.\n- **Google Consent Mode v2** — required since March 2024 for Google ads in the EEA\u002FUK. Default state must be `denied` for `ad_storage` \u002F `analytics_storage` \u002F `ad_user_data` \u002F `ad_personalization`; an `update` signal must fire `granted` after acceptance. The interception assumes the gtag `arguments`-array shape — note the object-form fallback in the reference.\n\n## EU AI Act Compliance\n\nThe Act applies in phases, and the timeline shifted in 2026. **Note: the Digital Omnibus (Nov 2025 proposal; 7 May 2026 provisional agreement) postponed the high-risk obligations** — do not test against the old 2 Aug 2026 high-risk date.\n\n| Obligation | Applies | What to test |\n|------------|---------|--------------|\n| Prohibitions + AI literacy | 2 Feb 2025 (live) | No Article 5 prohibited practices (social scoring, real-time public biometric ID, manipulative AI). Document AI features in scope; gate prohibited libraries. |\n| GPAI obligations + penalties | 2 Aug 2025 (live) | Model cards, training-data summaries, copyright-policy and disclosure pages exist. |\n| **Article 50 transparency** | **2 Aug 2026** | AI-generated content marked; deepfake disclosure; user told they are interacting with AI. Test the disclosure label\u002Fwatermark. **Still live on this date.** |\n| Machine-readable marking grace | 2 Dec 2026 | Systems already on the market before 2 Aug 2026 get until here to add the watermark\u002Fmarking (Omnibus compressed six months to three). |\n| High-risk (Annex III, use-case) | **2 Dec 2027** | Risk management, data governance, human oversight, transparency UI. **Postponed from 2 Aug 2026** by the Omnibus. |\n| High-risk (Annex I, product-regulated) | **2 Aug 2028** | As above, embedded in regulated products. Postponed from 2 Aug 2027. |\n\nWrite the Article 50 disclosure test now; defer the high-risk UI tests until the Annex III obligations land. See `references\u002Feu-ai-act-tests.md` for the Article 50 transparency-disclosure test and the Article 5 prohibited-practice (biometric library) gate. For LLM-specific evaluation (hallucination, jailbreak resistance, prompt-injection), use the `ai-system-testing` skill.\n\n## Better Ads Standards\n\nThe Coalition for Better Ads defines ad formats that trigger browser-level ad filtering (Chrome filters ads on non-compliant sites).\n\n| Format | Desktop | Mobile | Test approach |\n|--------|---------|--------|---------------|\n| Pop-up ads | Yes | Yes | Check for modal\u002Foverlay within 5s of load without user action |\n| Auto-playing video with sound | Yes | Yes | Read the live `video.autoplay` \u002F `video.muted` properties (not the HTML attributes) |\n| Prestitial countdown ads | Yes | Yes | Check for a countdown timer blocking content |\n| Large sticky ads (>30% viewport) | Yes | Yes | Measure sticky element dimensions vs viewport |\n| Ad density >30% | No | Yes | Calculate total ad area vs content area |\n| Flashing animated ads | No | Yes | Monitor animation frame rate (>3 flashes\u002Fsecond) |\n\nThe muted-video check must read the **live DOM property** (`el.muted`), not `getAttribute('muted')` — player scripts set `video.muted = true` in JS without ever adding the content attribute, so an attribute-only check reports muted ads as having sound and misses muted-then-unmuted ads.\n\n**Note: the CBA added two desktop and two mobile ad experiences on 14 Jan 2025; Chrome assessment of those begins no earlier than 14 May 2026.** Re-check newer combined formats against the current Better Ads Standards page before that date. See `references\u002Fbetter-ads-tests.md` for the auto-playing-video and mobile ad-density checks.\n\n## Cookie Compliance\n\nMaintain a typed cookie inventory as the source of truth, then assert that actual cookies match it on three axes:\n\n- **Inventory** — a `CookieDefinition[]` capturing name, category, purpose, max expiry, and the `Secure` \u002F `HttpOnly` \u002F `SameSite` attributes each cookie must carry.\n- **Attribute validation** — every observed cookie must match its definition's flags and not exceed its declared max expiry. Normalize an unset `SameSite` to `None` before comparing — Playwright omits or varies it when the server doesn't set it, so an un-normalized check fails spuriously or passes silently.\n- **Drift detection** — fail the suite (`throw`, don't warn) when a cookie appears that is not in the inventory, forcing the inventory to stay current as scripts are added.\n\nSee `references\u002Fcookie-compliance.md` for the typed inventory and both implementations.\n\n## Accessibility Compliance — legal map only\n\nAccessibility is a legal requirement in many jurisdictions, but author the actual tests in `accessibility-testing` (axe-core, keyboard, screen reader). This table is only the legal landscape so you know what the obligation is.\n\n| Region | Law | Standard | Enforcement |\n|--------|-----|----------|-------------|\n| EU | European Accessibility Act (EAA) | EN 301 549 \u002F WCAG 2.1 AA | Applied 28 June 2025; member-state penalties active. WCAG 2.2 alignment expected in the next EN 301 549 revision. |\n| USA | ADA | WCAG 2.1 AA (court precedent) | Private lawsuits |\n| USA (federal) | Section 508 | WCAG 2.0 AA | Federal procurement requirement |\n| Canada (Ontario) | AODA | WCAG 2.0 AA | Fines up to $100K\u002Fday |\n| UK | Equality Act 2010 | WCAG 2.1 AA (guidance) | Lawsuits |\n\n## Scheduled Compliance Audits\n\nRun compliance tests weekly (not just on PR) to catch configuration drift, and retain results as long-lived CI artifacts for the audit trail. See `references\u002Fci-automation.md` for the scheduled GitHub Actions workflow with 90-day artifact retention.\n\n## Anti-Patterns\n\n### Testing only with consent accepted\nRunning compliance tests only in the \"all accepted\" state. The compliance boundary is the \"no interaction\" and \"rejected\" states — that is where violations hide. Test every state: no interaction, accepted, rejected, partially accepted, withdrawn.\n\n### Asserting an invented CMP global\nChecking `window.__cmp.gpcStatus` or similar fabricated globals to \"prove\" a GPC opt-out. That global does not exist. Assert `navigator.globalPrivacyControl === true` and verify marketing cookies are absent; read real consent state via `__tcfapi`.\n\n### Attribute-only video checks\nTreating `getAttribute('muted') === null` as \"has sound.\" The content attribute is frequently absent on programmatically-muted videos. Read `el.muted` \u002F `el.autoplay` live properties instead.\n\n### Hardcoded cookie lists that drift\nA cookie inventory nobody updates. Use the drift-detection test that `throw`s on any unknown cookie — reality and inventory stay in sync automatically.\n\n### CMP-only testing\nTrusting the CMP and only exercising its UI. CMPs have bugs. Test the outcome: cookies set, scripts loaded, data transmitted.\n\n### Manual-only quarterly audits\nAuditing by hand once a quarter. Between audits a developer adds an analytics script that fires before consent and nobody notices for three months. Automated tests catch it on the next CI run.\n\n### Ignoring regional differences\nOne global consent model. GDPR requires opt-in; CCPA allows opt-out via GPC. Serving both regions means testing both experiences.\n\n### Treating compliance as one-time\nBuilding the suite once and freezing it. Regulations evolve (ePrivacy Regulation, TCF version bumps, AI Act phases, updated CBA standards). Review quarterly.\n\n## Verification\n\nSmallest check first — confirm the compliance suite runs and gates before trusting it:\n\n```bash\nnpx playwright test --project=chromium --grep @compliance\n```\n\nA correct run shows the unhappy-path tests as the gate: \"no non-essential cookies before consent\" and \"no tracking scripts load before consent\" must **pass on a fresh context** (`storageState: undefined`). To prove the suite actually catches violations, temporarily point it at a page that loads GA before consent — the script-blocking test must go red. A suite that stays green against a known-bad page is asserting nothing. Then confirm the GPC test sees `navigator.globalPrivacyControl === true` with the `Sec-GPC: 1` header set, and that the Consent Mode default-state test reports `denied` for all four signals.\n\n## Done When\n\n- Applicable regulations identified for the product and geographic audience (GDPR, ePrivacy, DSA, EU AI Act, the relevant US state-law subset, UK OSA\u002FDUAA) and documented in `.agents\u002Fqa-project-context.md`.\n- Consent flow tested for every entry point: first visit, accept, reject, withdrawal, and cross-navigation persistence — each as a distinct passing test.\n- Global Privacy Control honored: with `Sec-GPC: 1`, `navigator.globalPrivacyControl === true` and marketing cookies absent.\n- Google Consent Mode v2 verified: default `denied` for `ad_storage` \u002F `analytics_storage` \u002F `ad_user_data` \u002F `ad_personalization`; `update` fires `granted` after accept (only required for sites serving Google ads in EEA\u002FUK).\n- EU AI Act applicability assessed: prohibited-practice gate, GPAI documentation review (if applicable), and Article 50 transparency disclosure tested for any AI-generated content.\n- Cookie audit complete: all cookies categorized in the typed inventory; drift-detection test passes with zero unknown cookies.\n- No undeclared tracking domains or cookies fire that the privacy policy does not disclose (the automatable half — legal-language review is a separate manual\u002Flegal sign-off, not a test).\n- Compliance suite runs green in the weekly CI job with results stored as artifacts at 90-day retention.\n\n## Related Skills\n\n- **accessibility-testing** — Author the actual WCAG\u002Faxe-core\u002Fkeyboard\u002Fscreen-reader tests there. This skill only maps the accessibility legal landscape; it does not write a11y assertions.\n- **security-testing** — Security compliance (OWASP Top 10:2025, dependency and supply-chain scanning) complements privacy compliance; different threat model, different tools.\n- **ai-system-testing** — Defines the eval layer (hallucination, jailbreak, prompt-injection) for AI features. This skill only tests the Article 50 *disclosure*; that skill tests whether the AI itself behaves.\n- **ci-cd-integration** — Pipeline configuration for the scheduled weekly audit and compliance quality gates.\n- **release-readiness** — A failing compliance gate (consent firing before opt-in, missing AI Act disclosure) is a release blocker; wire this suite into the go\u002Fno-go checklist there.\n\n## Reference Files (in `references\u002F`)\n\n- **gdpr-cmp-tests.md** — Playwright code for banners\u002Fdark patterns, cookie state before\u002Fafter consent, persistence and withdrawal, third-party script blocking, Global Privacy Control (`navigator.globalPrivacyControl`), TCF v2 `__tcfapi` consent read + v2.3 version guard, and Google Consent Mode v2.\n- **eu-ai-act-tests.md** — Article 50 transparency-disclosure test and the Article 5 prohibited-practice (biometric library) gate, with the Omnibus timeline note.\n- **better-ads-tests.md** — Coalition for Better Ads checks: live-property auto-playing-unmuted-video detection and mobile ad-density measurement.\n- **cookie-compliance.md** — Typed cookie inventory, attribute validation (with SameSite normalization), and inventory drift detection.\n- **ci-automation.md** — Scheduled weekly compliance-audit GitHub Actions workflow with 90-day artifact retention.\n","\u003Cobjective>\nCompliance is binary: a single analytics cookie that fires before consent, or a \"Reject all\" rendered as a tiny grey link, is a violation no matter how polished the rest of the flow looks. Manual quarterly audits miss the regression a developer shipped on a Tuesday. This skill automates the technical checks — consent state, script blocking, cookie attributes, GPC, Consent Mode v2, AI Act disclosure — so configuration drift fails CI instead of a regulator's inbox.\n\u003C\u002Fobjective>\n\n## Discovery Questions\n\nFirst, check for `.agents\u002Fqa-project-context.md` in the project root — it carries applicable regulations, CMP details, ad networks, and geographic scope. Skip any question already answered there. If it is missing, suggest creating one with the `qa-project-context` skill.\n\n### Applicable regulations\n- **Which privacy and platform regulations apply?** This sets the entire test matrix.\n  - **EU:** GDPR, ePrivacy Directive (cookies), Digital Services Act (DSA, applied 17 Feb 2024), EU AI Act (prohibitions + AI literacy live since 2 Feb 2025; GPAI obligations + penalties since 2 Aug 2025; Article 50 transparency from 2 Aug 2026 — high-risk obligations postponed, see below).\n  - **US:** CCPA\u002FCPRA plus comprehensive state laws now active in ~20 states (Texas TDPSA, Indiana CDPA eff. 1 Jan 2026, Delaware DPDPA, Nebraska NDPA, Minnesota CDPA, Rhode Island DTPPA, …). Most require honoring Global Privacy Control (`Sec-GPC: 1`).\n  - **UK:** UK GDPR\u002FDPA, PECR (cookies), Online Safety Act 2023, Data Use and Access Act (DUAA).\n  - **Other:** LGPD (Brazil), PIPEDA (Canada), POPIA (South Africa).\n- **What is the legal basis for processing?** Consent (opt-in), legitimate interest, or contractual necessity — this decides whether explicit consent must precede processing.\n- **Is there a DPO or legal team?** They define the legal requirements; this skill only validates the technical implementation against them.\n\n### Consent management\n- **What CMP is in use?** OneTrust, Cookiebot, Didomi, Usercentrics, Iubenda, Sourcepoint, or Axeptio — or custom? The CMP sets the consent storage format, API, and integration. **If you serve ads in the EEA or UK, you must use a Google-certified CMP and Consent Mode v2** — uncertified CMPs block Google ad serving. **As of 28 Feb 2026, new TC strings must be TCF v2.3** or Google demand treats traffic as unconsented and drops to Limited Ads.\n- **What consent categories exist?** Typically Strictly Necessary (always on), Analytics\u002FPerformance, Functional\u002FPreferences, Marketing\u002FTargeting.\n- **How is consent signaled to third-party scripts?** IAB TCF v2 (`__tcfapi`), a custom data layer, or direct CMP API?\n\n### Advertising and accessibility\n- **What ad networks and formats?** Google Ads, Meta, programmatic; display, video, interstitial. The Coalition for Better Ads defines which formats trigger Chrome ad-filtering.\n- **Are there accessibility obligations (ADA, EAA, Section 508)?** Those are real compliance, but author them in `accessibility-testing` — this skill only maps the legal landscape, see below.\n\n## Core Principles\n\n### 1. Compliance is binary\nThere is no \"mostly compliant.\" A cookie that fires before consent is a violation. A banner you cannot dismiss without accepting is a violation. Test for exact compliance, not \"good enough.\"\n\n### 2. Automate the technical checks, schedule the legal audits\nAutomate: cookies before consent, scripts loading without consent, banner functionality, cookie attributes, consent persistence, GPC, Consent Mode signals. A human still audits privacy-policy *language* and cross-border transfer documentation. Don't pretend a test settles a legal-language question.\n\n### 3. Test the unhappy consent states\nThe compliance boundary lives in the \"no interaction,\" \"rejected,\" and \"withdrawn\" states — that is where violations hide. The \"all accepted\" state is the least interesting one to test.\n\n### 4. Verify behavior, not the CMP\nCMPs have bugs. Don't trust the CMP UI as proof. Assert the actual outcome: were cookies set, did scripts load, was the GPC opt-out registered. The CMP is an implementation detail; compliance is measured by behavior.\n\n### 5. Defense in depth, config-driven\nVerify at multiple layers — CMP config, network requests, cookie state, client signals. Drive tests from a typed inventory and a tracking-domain list so adding a category or threshold is a data edit, not a suite rewrite. Regulations change; the suite must be cheap to update.\n\n## GDPR \u002F CMP Testing with Playwright\n\nConsent-flow compliance breaks into distinct, independently failing checks. Full runnable code for each is in `references\u002Fgdpr-cmp-tests.md`.\n\n- **Consent banner and dark patterns** — banner appears on first visit; accept and reject have equal prominence (reject is not a tiny link); a privacy-policy link is present.\n- **Cookie state before\u002Fafter consent** — the critical test: no non-essential cookies before consent; analytics cookies only after accepting; nothing non-essential after rejecting. Maintain `isStrictlyNecessary` \u002F `isAnalyticsCookie` classifiers against your inventory.\n- **Consent persistence and withdrawal** — consent survives navigation; the user can withdraw via privacy settings, which must then clear the relevant cookies.\n- **Third-party script blocking** — tracking scripts (`google-analytics.com`, `googletagmanager.com`, `facebook.net`, `analytics.tiktok.com`, `bat.bing.com`, …) must not load before consent and should load after acceptance. This is the most critical check — monitor with `page.on('request')`.\n- **Global Privacy Control (`Sec-GPC: 1`)** — a required honored signal under CCPA\u002FCPRA and most active US state laws. With the header set, assert `navigator.globalPrivacyControl === true` (the real browser signal) and that marketing cookies are absent. **Do not** assert an invented `window.__cmp.gpcStatus` global — it does not exist; TCF v1's `__cmp` is legacy and TCF v2 uses `__tcfapi`.\n- **TCF v2 consent state** — every TCF-certified CMP exposes `window.__tcfapi('getTCData', 2, cb)`. Read purpose\u002Fvendor consent through it directly instead of guessing at CMP-private globals; the same call exposes `tcfPolicyVersion`, which doubles as a TCF-v2.3 freshness guard.\n- **Google Consent Mode v2** — required since March 2024 for Google ads in the EEA\u002FUK. Default state must be `denied` for `ad_storage` \u002F `analytics_storage` \u002F `ad_user_data` \u002F `ad_personalization`; an `update` signal must fire `granted` after acceptance. The interception assumes the gtag `arguments`-array shape — note the object-form fallback in the reference.\n\n## EU AI Act Compliance\n\nThe Act applies in phases, and the timeline shifted in 2026. **Note: the Digital Omnibus (Nov 2025 proposal; 7 May 2026 provisional agreement) postponed the high-risk obligations** — do not test against the old 2 Aug 2026 high-risk date.\n\n| Obligation | Applies | What to test |\n|------------|---------|--------------|\n| Prohibitions + AI literacy | 2 Feb 2025 (live) | No Article 5 prohibited practices (social scoring, real-time public biometric ID, manipulative AI). Document AI features in scope; gate prohibited libraries. |\n| GPAI obligations + penalties | 2 Aug 2025 (live) | Model cards, training-data summaries, copyright-policy and disclosure pages exist. |\n| **Article 50 transparency** | **2 Aug 2026** | AI-generated content marked; deepfake disclosure; user told they are interacting with AI. Test the disclosure label\u002Fwatermark. **Still live on this date.** |\n| Machine-readable marking grace | 2 Dec 2026 | Systems already on the market before 2 Aug 2026 get until here to add the watermark\u002Fmarking (Omnibus compressed six months to three). |\n| High-risk (Annex III, use-case) | **2 Dec 2027** | Risk management, data governance, human oversight, transparency UI. **Postponed from 2 Aug 2026** by the Omnibus. |\n| High-risk (Annex I, product-regulated) | **2 Aug 2028** | As above, embedded in regulated products. Postponed from 2 Aug 2027. |\n\nWrite the Article 50 disclosure test now; defer the high-risk UI tests until the Annex III obligations land. See `references\u002Feu-ai-act-tests.md` for the Article 50 transparency-disclosure test and the Article 5 prohibited-practice (biometric library) gate. For LLM-specific evaluation (hallucination, jailbreak resistance, prompt-injection), use the `ai-system-testing` skill.\n\n## Better Ads Standards\n\nThe Coalition for Better Ads defines ad formats that trigger browser-level ad filtering (Chrome filters ads on non-compliant sites).\n\n| Format | Desktop | Mobile | Test approach |\n|--------|---------|--------|---------------|\n| Pop-up ads | Yes | Yes | Check for modal\u002Foverlay within 5s of load without user action |\n| Auto-playing video with sound | Yes | Yes | Read the live `video.autoplay` \u002F `video.muted` properties (not the HTML attributes) |\n| Prestitial countdown ads | Yes | Yes | Check for a countdown timer blocking content |\n| Large sticky ads (>30% viewport) | Yes | Yes | Measure sticky element dimensions vs viewport |\n| Ad density >30% | No | Yes | Calculate total ad area vs content area |\n| Flashing animated ads | No | Yes | Monitor animation frame rate (>3 flashes\u002Fsecond) |\n\nThe muted-video check must read the **live DOM property** (`el.muted`), not `getAttribute('muted')` — player scripts set `video.muted = true` in JS without ever adding the content attribute, so an attribute-only check reports muted ads as having sound and misses muted-then-unmuted ads.\n\n**Note: the CBA added two desktop and two mobile ad experiences on 14 Jan 2025; Chrome assessment of those begins no earlier than 14 May 2026.** Re-check newer combined formats against the current Better Ads Standards page before that date. See `references\u002Fbetter-ads-tests.md` for the auto-playing-video and mobile ad-density checks.\n\n## Cookie Compliance\n\nMaintain a typed cookie inventory as the source of truth, then assert that actual cookies match it on three axes:\n\n- **Inventory** — a `CookieDefinition[]` capturing name, category, purpose, max expiry, and the `Secure` \u002F `HttpOnly` \u002F `SameSite` attributes each cookie must carry.\n- **Attribute validation** — every observed cookie must match its definition's flags and not exceed its declared max expiry. Normalize an unset `SameSite` to `None` before comparing — Playwright omits or varies it when the server doesn't set it, so an un-normalized check fails spuriously or passes silently.\n- **Drift detection** — fail the suite (`throw`, don't warn) when a cookie appears that is not in the inventory, forcing the inventory to stay current as scripts are added.\n\nSee `references\u002Fcookie-compliance.md` for the typed inventory and both implementations.\n\n## Accessibility Compliance — legal map only\n\nAccessibility is a legal requirement in many jurisdictions, but author the actual tests in `accessibility-testing` (axe-core, keyboard, screen reader). This table is only the legal landscape so you know what the obligation is.\n\n| Region | Law | Standard | Enforcement |\n|--------|-----|----------|-------------|\n| EU | European Accessibility Act (EAA) | EN 301 549 \u002F WCAG 2.1 AA | Applied 28 June 2025; member-state penalties active. WCAG 2.2 alignment expected in the next EN 301 549 revision. |\n| USA | ADA | WCAG 2.1 AA (court precedent) | Private lawsuits |\n| USA (federal) | Section 508 | WCAG 2.0 AA | Federal procurement requirement |\n| Canada (Ontario) | AODA | WCAG 2.0 AA | Fines up to $100K\u002Fday |\n| UK | Equality Act 2010 | WCAG 2.1 AA (guidance) | Lawsuits |\n\n## Scheduled Compliance Audits\n\nRun compliance tests weekly (not just on PR) to catch configuration drift, and retain results as long-lived CI artifacts for the audit trail. See `references\u002Fci-automation.md` for the scheduled GitHub Actions workflow with 90-day artifact retention.\n\n## Anti-Patterns\n\n### Testing only with consent accepted\nRunning compliance tests only in the \"all accepted\" state. The compliance boundary is the \"no interaction\" and \"rejected\" states — that is where violations hide. Test every state: no interaction, accepted, rejected, partially accepted, withdrawn.\n\n### Asserting an invented CMP global\nChecking `window.__cmp.gpcStatus` or similar fabricated globals to \"prove\" a GPC opt-out. That global does not exist. Assert `navigator.globalPrivacyControl === true` and verify marketing cookies are absent; read real consent state via `__tcfapi`.\n\n### Attribute-only video checks\nTreating `getAttribute('muted') === null` as \"has sound.\" The content attribute is frequently absent on programmatically-muted videos. Read `el.muted` \u002F `el.autoplay` live properties instead.\n\n### Hardcoded cookie lists that drift\nA cookie inventory nobody updates. Use the drift-detection test that `throw`s on any unknown cookie — reality and inventory stay in sync automatically.\n\n### CMP-only testing\nTrusting the CMP and only exercising its UI. CMPs have bugs. Test the outcome: cookies set, scripts loaded, data transmitted.\n\n### Manual-only quarterly audits\nAuditing by hand once a quarter. Between audits a developer adds an analytics script that fires before consent and nobody notices for three months. Automated tests catch it on the next CI run.\n\n### Ignoring regional differences\nOne global consent model. GDPR requires opt-in; CCPA allows opt-out via GPC. Serving both regions means testing both experiences.\n\n### Treating compliance as one-time\nBuilding the suite once and freezing it. Regulations evolve (ePrivacy Regulation, TCF version bumps, AI Act phases, updated CBA standards). Review quarterly.\n\n## Verification\n\nSmallest check first — confirm the compliance suite runs and gates before trusting it:\n\n```bash\nnpx playwright test --project=chromium --grep @compliance\n```\n\nA correct run shows the unhappy-path tests as the gate: \"no non-essential cookies before consent\" and \"no tracking scripts load before consent\" must **pass on a fresh context** (`storageState: undefined`). To prove the suite actually catches violations, temporarily point it at a page that loads GA before consent — the script-blocking test must go red. A suite that stays green against a known-bad page is asserting nothing. Then confirm the GPC test sees `navigator.globalPrivacyControl === true` with the `Sec-GPC: 1` header set, and that the Consent Mode default-state test reports `denied` for all four signals.\n\n## Done When\n\n- Applicable regulations identified for the product and geographic audience (GDPR, ePrivacy, DSA, EU AI Act, the relevant US state-law subset, UK OSA\u002FDUAA) and documented in `.agents\u002Fqa-project-context.md`.\n- Consent flow tested for every entry point: first visit, accept, reject, withdrawal, and cross-navigation persistence — each as a distinct passing test.\n- Global Privacy Control honored: with `Sec-GPC: 1`, `navigator.globalPrivacyControl === true` and marketing cookies absent.\n- Google Consent Mode v2 verified: default `denied` for `ad_storage` \u002F `analytics_storage` \u002F `ad_user_data` \u002F `ad_personalization`; `update` fires `granted` after accept (only required for sites serving Google ads in EEA\u002FUK).\n- EU AI Act applicability assessed: prohibited-practice gate, GPAI documentation review (if applicable), and Article 50 transparency disclosure tested for any AI-generated content.\n- Cookie audit complete: all cookies categorized in the typed inventory; drift-detection test passes with zero unknown cookies.\n- No undeclared tracking domains or cookies fire that the privacy policy does not disclose (the automatable half — legal-language review is a separate manual\u002Flegal sign-off, not a test).\n- Compliance suite runs green in the weekly CI job with results stored as artifacts at 90-day retention.\n\n## Related Skills\n\n- **accessibility-testing** — Author the actual WCAG\u002Faxe-core\u002Fkeyboard\u002Fscreen-reader tests there. This skill only maps the accessibility legal landscape; it does not write a11y assertions.\n- **security-testing** — Security compliance (OWASP Top 10:2025, dependency and supply-chain scanning) complements privacy compliance; different threat model, different tools.\n- **ai-system-testing** — Defines the eval layer (hallucination, jailbreak, prompt-injection) for AI features. This skill only tests the Article 50 *disclosure*; that skill tests whether the AI itself behaves.\n- **ci-cd-integration** — Pipeline configuration for the scheduled weekly audit and compliance quality gates.\n- **release-readiness** — A failing compliance gate (consent firing before opt-in, missing AI Act disclosure) is a release blocker; wire this suite into the go\u002Fno-go checklist there.\n\n## Reference Files (in `references\u002F`)\n\n- **gdpr-cmp-tests.md** — Playwright code for banners\u002Fdark patterns, cookie state before\u002Fafter consent, persistence and withdrawal, third-party script blocking, Global Privacy Control (`navigator.globalPrivacyControl`), TCF v2 `__tcfapi` consent read + v2.3 version guard, and Google Consent Mode v2.\n- **eu-ai-act-tests.md** — Article 50 transparency-disclosure test and the Article 5 prohibited-practice (biometric library) gate, with the Omnibus timeline note.\n- **better-ads-tests.md** — Coalition for Better Ads checks: live-property auto-playing-unmuted-video detection and mobile ad-density measurement.\n- **cookie-compliance.md** — Typed cookie inventory, attribute validation (with SameSite normalization), and inventory drift detection.\n- **ci-automation.md** — Scheduled weekly compliance-audit GitHub Actions workflow with 90-day artifact retention.\n",{"name":5,"license":15,"metadata":44,"description":7},{"author":45,"version":46,"category":47},"kindlmann","2.0","process","claude\u002Finstall-gsd-build-foQdV","d86cd127f527124b5fd0fd0bc679a4d79b7d01d7",".agents\u002Fskills\u002Fcompliance-testing","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik","https:\u002F\u002Fnorvik-orpin.vercel.app","https:\u002F\u002Fgithub.com\u002Fpattanation","2026-07-17 11:17:04",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add pattanation\u002FNorvik --skill compliance-testing",{"tool":61,"command":62},"bunx","bunx skills add pattanation\u002FNorvik --skill compliance-testing",{"tool":64,"command":65},"pnpm","pnpm dlx skills add pattanation\u002FNorvik --skill compliance-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fcompliance-testing\u002FSKILL.md",true,[69,75,79,83,87],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fbetter-ads-tests.md","REFERENCE","参考文档",2444,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fcompliance-testing\u002Freferences\u002Fbetter-ads-tests.md",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fci-automation.md",1085,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fcompliance-testing\u002Freferences\u002Fci-automation.md",{"path":80,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fcookie-compliance.md",3950,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fcompliance-testing\u002Freferences\u002Fcookie-compliance.md",{"path":84,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Feu-ai-act-tests.md",2281,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fcompliance-testing\u002Freferences\u002Feu-ai-act-tests.md",{"path":88,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fgdpr-cmp-tests.md",12121,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fcompliance-testing\u002Freferences\u002Fgdpr-cmp-tests.md",[92,101,108,115,140,165],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":100},"01M73Z1NPMJ667E0DSPBS9FH0B","jetson-set-target","Switch the active Jetson target-platform pointer to an existing profile YAML. Use before customize\u002Fbuild\u002Fflash to change target; not for authoring profiles — use jetson-init-target instead.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fjetson-set-target\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":100},"01M73YC29YWGCW521P7B0NM3HQ","earth2studio-data-fetch","Fetch weather\u002Fclimate data via Earth2Studio data sources for specific variables and times. Do NOT use for inference pipelines, model discovery, or installation.","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fearth2studio-data-fetch\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":100},"01M73YBNHMHFDFP83MAVGQQ92N","earth2studio-create-datasource","Create and validate Earth2Studio data source wrappers (DataSource, ForecastSource, DataFrameSource, ForecastFrameSource) from remote stores. Do NOT use for fetching data with existing sources, model inference, or installation tasks.","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fearth2studio-create-datasource\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":119,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":139},"01M71QDV4DM8T19HEHWATEF1K4","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[123,21,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138],"webapp","webapp testing","local","screenshots","for","applications","browser","ui","behavior","web","playwright","with","frontend","debugging","toolkit","logs","2026-11-10 13:02:02",{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":96,"licenseFileUrl":144,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":139},"01M71QDH2GGMXGA9105C9W1N7B","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[148,132,149,150,151,152,153,154,155,156,157,158,127,159,160,135,161,162,163,164],"web artifacts builder","artifacts","artifacts builder","builder","multi","state","routing","state management","react","single-file","css","Tailwind","ui components","single","use","file","components",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":169,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":139},"01M71QD9T2XC3EWMQNN9ACNWQ1","vueuse-functions","Apply VueUse composables where appropriate to build concise, maintainable Vue.js \u002F Nuxt features.","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fvueuse-functions\u002FLICENSE.md","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fvueuse-functions\u002FSKILL.md",[],[173,174,175,176,177,178,179,180,181,182,183,184,185,186],"vueuse","vueuse functions","functions","composables","project","nuxt","apply","github","concise","build","https","features","vue","js"]