--- name: legal-audit description: This skill should be used when the user asks to "check privacy compliance", "audit GDPR", "is this legal", "do we need a DPA", "check our privacy policy", "DSGVO check", "is our site compliant", "update the privacy policy", "cookie consent legal", "Datenschutz", "Impressum", "TTDSG", "data protection", "review our terms", "legal compliance", "privacy audit", or asks any question about GDPR, DSGVO, TTDSG, BDSG, data processor agreements, cookie law, or German data protection law. version: 1.0.0 --- # /legal-audit — German DSGVO Legal Compliance German-jurisdiction legal compliance for websites and apps. Covers DSGVO, TDDDG, BDSG, DDG, and relevant German case law. Grounds all findings in actual statute via the `rechtsinformationen-bund-de` MCP when available (see README for setup). **Default jurisdiction:** Germany. Supervisory authority defaults to the authority of your Bundesland — see `references/law-reference.md` for a complete list. Also covers Austria (DSG) and Switzerland (nDSG) where noted. --- ## Step 0 — Route Parse the invocation args or user intent: | Pattern | Mode | |---|---| | `audit ` or a file/dir path given | → **Code Audit** | | `scan ` or arg starts with `http` | → **URL Scan** | | `flow ` | → **Data Flow Review** | | `draft ` | → **Document Draft** | | No args or natural-language legal question | → **Full Suite** (Audit + Scan + Flow → Draft offer) | Check MCP availability: attempt `semantische_rechtssuche` with query `DSGVO Artikel 6`. If it responds, use it for every law lookup. If unavailable, fall back to built-in knowledge — note which source was used in each finding. Display: > **legal-audit** | Mode: [X] | Target: [Y] | Law source: [MCP / built-in knowledge] --- ## Mode A — Code Audit Scan the codebase for data collection points and classify each finding by severity. ### A1 — Discover Run these grep patterns (load `references/audit-patterns.md` for the full list): ```bash # Third-party fetches grep -r "fetch(\|axios\.\|import.*resend\|import.*nodemailer\|gtag(\|posthog\|supabase\|stripe\|loadStripe" --include="*.ts" --include="*.tsx" --include="*.js" . # Storage writes grep -r "document\.cookie\|localStorage\.setItem\|sessionStorage\.setItem\|setCookie\|set-cookie" --include="*.ts" --include="*.tsx" . # PII field names grep -rEi "email|phone|iban|firstName|lastName|birthDate|passport|ipAddress" --include="*.ts" --include="*.tsx" . # Consent gating grep -r "consent\|cookie_consent\|analytics_storage\|posthog\.init\|opt_out" --include="*.ts" --include="*.tsx" . ``` ### A2 — Classify For each finding, assign severity (🔴 Hoch / 🟡 Mittel / 🟢 Niedrig) and cite the relevant article. Load `references/law-reference.md` for the full article-to-violation mapping table. Key rules: - Third-party script fires before consent check → 🔴 Hoch — TDDDG § 25(1), DSGVO Art. 6(1)(a) - Google Consent Mode **"advanced"** (gtag.js loads before consent and sends cookieless pings, `gcs=G100` in `/g/collect`) → 🔴 Hoch — IP/device data reach Google before any choice; privacy texts usually claim "only after consent". Fix: inject gtag.js only after Accept ("basic" mode); set `ad_user_data`/`ad_personalization` too - Third-party iframes (Google Maps, YouTube, Google Drive video previews, social embeds) loading on page view → 🔴 Hoch — click-to-load gate; check **every** page, not just the one the privacy text mentions - Operator alert channels (Telegram/Slack/Discord bots, error trackers) receiving customer names/emails → 🔴 Hoch — undisclosed recipient, usually no Art. 28 agreement; send IDs/booking refs only, redact centrally - Controller not named with full postal address in the privacy policy → 🔴 Hoch — DSGVO Art. 13(1)(a) - Hosting provider (Vercel, Netlify, …) not disclosed, US vendors without DPF/SCC basis, EU entity misnamed (e.g. Stripe Payments Europe Ltd., not Stripe Inc.) → 🟡 Mittel — Art. 13(1)(e)/(f) - No retention periods for booking/invoice data → 🟡 Mittel — Art. 13(2)(a); § 147 AO / § 14b UStG (8 years for Buchungsbelege since BEG IV, 10 for books) - Privacy section exists in one language only on a multilingual site → 🟡 Mittel — Art. 12(1) (transparent, intelligible) - PII collected in form with no Art. 13 disclosure → 🔴 Hoch — DSGVO Art. 13 - Email send handler, processor not in privacy policy → 🔴 Hoch — DSGVO Art. 13, Art. 28 - US processor used, no SCC documented → 🟡 Mittel — DSGVO Art. 46(2)(c) - Google Fonts loaded from CDN → 🟡 Mittel — LG München I 2022 - localStorage for consent preference only → 🟢 Niedrig — TDDDG § 25(2) exemption - Analytics gated behind consent → 🟢 Niedrig — compliant Also check: - **Impressum:** DDG § 5 — name, address, contact, VAT ID required on every commercial site. "§ 5 TMG" / "§ 55 RStV" wording is outdated → 🟡 - **DPO threshold:** BDSG § 38 — mandatory if 20+ employees regularly process personal data ### A3 — Law lookup For each 🔴 finding, use `semantische_rechtssuche` to pull the exact statutory language. Quote the article verbatim in the finding output. ### A4 — Output format ``` ## Code Audit — [project] | [date] | Law: [MCP/built-in] 🔴 Hoch — [N] [file:line] [issue] — [Article] DSGVO / § [X] TDDDG Statutory text: "[quoted text from MCP]" Fix: [one-line concrete action] 🟡 Mittel — [N] ... 🟢 Niedrig / Compliant — [N] ... Impressum: [found / missing / partial — list gaps] DPO threshold: [below / above / unclear] Summary: 🔴 [N] | 🟡 [N] | 🟢 [N] | Remediation effort: [low/medium/high] ``` --- ## Mode B — URL Scan Audit the live site as a user agent sees it. Use `WebFetch` on the target URL. Extract and analyze: 1. All `