Ai-legal-claude legal-compliance

Compliance Gap Analysis

install
source · Clone the upstream repo
git clone https://github.com/zubair-trabzada/ai-legal-claude
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/zubair-trabzada/ai-legal-claude "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/legal-compliance" ~/.claude/skills/zubair-trabzada-ai-legal-claude-legal-compliance && rm -rf "$T"
manifest: skills/legal-compliance/SKILL.md
source content

Compliance Gap Analysis

You are the compliance auditor for

/legal compliance <url>
. You scan a website for compliance gaps across multiple regulatory frameworks and produce a scored compliance audit report with specific remediation steps.

When This Skill Is Invoked

The user runs

/legal compliance <url>
where
<url>
is a live website URL. You scan the site, evaluate compliance across all applicable frameworks, and output a detailed gap analysis with a compliance scorecard.


Phase 1: Website Scanning

Use WebFetch to retrieve and analyze the target website. You may need to scan multiple pages:

  • The homepage
  • The privacy policy page (look for links: "Privacy," "Privacy Policy," "Legal")
  • The terms of service page (look for links: "Terms," "Terms of Service," "Terms of Use")
  • The cookie policy page (if separate)
  • Any trust/security page (look for links: "Security," "Trust," "Compliance," "Trust Center")
  • The footer (often contains required legal links)

1.1 Initial Detection Scan

Before evaluating compliance, detect what the site does so you know which frameworks apply:

DetectionFrameworks Triggered
Collects any personal dataGDPR, CCPA
Uses cookies or trackingGDPR (ePrivacy), CCPA
Processes paymentsPCI-DSS
Collects email addressesCAN-SPAM
Content could appeal to children (under 13)COPPA
B2B SaaS productSOC 2
Has a website (any)ADA/WCAG
Serves EU/EEA usersGDPR
Serves California usersCCPA/CPRA
Health-related dataHIPAA (flag only)
Financial dataGLBA (flag only)

Phase 2: Framework-by-Framework Audit

For EACH applicable framework, evaluate every check item. Use these statuses:

StatusSymbolMeaning
PassRequirement appears to be met
FailRequirement is clearly not met
Warning⚠️Partially met or cannot fully verify
N/ANot applicable to this site

2.1 GDPR Compliance (General Data Protection Regulation)

Applies if: Site is accessible to EU/EEA residents or processes data of EU individuals.

#Check ItemWhat to Look ForStatusNotes
G1Cookie Consent BannerBanner present BEFORE non-essential cookies load. Must have accept/reject options. Pre-checked boxes are non-compliant.
G2Granular Cookie ControlUsers can select cookie categories (essential, analytics, marketing) individually.
G3Privacy Policy ExistsAccessible privacy policy linked from footer or banner.
G4Legal Basis StatedPrivacy policy states legal basis for each processing activity (consent, legitimate interest, contractual necessity, legal obligation).
G5Data Subject RightsPrivacy policy describes: access, rectification, erasure, portability, restriction, objection rights.
G6Right to Erasure ProcessClear instructions or mechanism for users to request data deletion.
G7Data PortabilityMechanism or process described for users to receive their data in a portable format.
G8DPO ContactData Protection Officer contact information provided (required for large-scale processing, public authorities).
G9International Transfer DisclosuresIf data leaves the EEA, the safeguards used (SCCs, adequacy decisions) are disclosed.
G10Breach Notification ProcedurePrivacy policy or security page mentions 72-hour breach notification to supervisory authority.
G11Data Processing RecordsEvidence of maintaining processing records (typically not visible on website, flag as advisory).
G12Consent WithdrawalEasy mechanism to withdraw consent, as easy as giving it.
G13Children's DataIf applicable, age verification or parental consent mechanisms.
G14Third-Party DisclosuresAll third parties receiving data are named or categorized in the privacy policy.

2.2 CCPA/CPRA Compliance (California Consumer Privacy Act / California Privacy Rights Act)

Applies if: Business meets CCPA thresholds (revenue >$25M, data on >100K consumers, or >50% revenue from selling data) or serves California residents.

#Check ItemWhat to Look ForStatusNotes
C1"Do Not Sell or Share" LinkVisible link in footer: "Do Not Sell or Share My Personal Information."
C2Privacy Policy — CCPA SectionPrivacy policy includes California-specific section with CCPA rights.
C3Categories of PI CollectedPrivacy policy lists categories of personal information collected in the past 12 months.
C4Purpose for Each CategoryBusiness purpose stated for each category of PI collected.
C5Consumer Rights DescribedRight to know, delete, opt-out, non-discrimination, correct, and limit sensitive PI use.
C6Request Submission MethodsAt least two methods for submitting consumer rights requests (web form, email, phone).
C7Response TimelinePolicy states 45-day response timeline for consumer requests.
C8Financial Incentive DisclosuresIf loyalty programs or data-for-discounts exist, financial incentive disclosures are present.
C9Third-Party Sharing DisclosuresCategories of third parties with whom PI is shared/sold.
C10Retention PeriodsData retention periods or criteria disclosed for each category.

2.3 ADA / WCAG Accessibility

Applies to: All websites (ADA Title III applies to "places of public accommodation"; courts have extended this to websites).

#Check ItemWhat to Look ForStatusNotes
A1Alt Text on ImagesImages have descriptive alt attributes (not empty, not "image.jpg").
A2Heading StructureProper heading hierarchy (H1 > H2 > H3, no skipped levels).
A3Color ContrastText has sufficient contrast ratio against background (4.5:1 for normal text, 3:1 for large text).
A4Keyboard NavigationInteractive elements are reachable and operable via keyboard (tab order, focus indicators).
A5Form LabelsAll form inputs have associated label elements or aria-labels.
A6Link TextLinks have descriptive text (not "click here" or "read more" without context).
A7Language AttributeHTML element has
lang
attribute set.
A8Responsive DesignSite is usable at 200% zoom and on mobile devices.
A9Video CaptionsIf video content exists, captions or transcripts are available.
A10Accessibility StatementSite has an accessibility statement or policy page.

Note: This is a surface-level accessibility scan. A full WCAG 2.1 AA audit requires automated tools (axe, WAVE) and manual testing. Flag this limitation.

2.4 PCI-DSS (Payment Card Industry Data Security Standard)

Applies if: Site processes, stores, or transmits credit card data.

#Check ItemWhat to Look ForStatusNotes
P1HTTPS EverywhereSite uses HTTPS on all pages, especially payment pages. No mixed content.
P2Hosted Payment FieldsPayment form uses iframes from a PCI-compliant processor (Stripe Elements, PayPal hosted fields, Braintree Drop-in) rather than raw card inputs.
P3No Card Data in URLsCard numbers never appear in URL parameters or GET requests.
P4Security PageTrust/security page mentioning PCI compliance, security certifications.
P5Secure Payment BadgesPCI compliance badge or security badges displayed near checkout.
P6Third-Party Processor IdentifiedPayment processor identified (Stripe, PayPal, Square, etc.) — indicates SAQ-A eligible offloading.

2.5 CAN-SPAM Compliance

Applies if: Site collects email addresses or has email signup forms.

#Check ItemWhat to Look ForStatusNotes
S1Unsubscribe MechanismEmail signup mentions ability to unsubscribe.
S2Physical AddressFooter or privacy policy includes a physical mailing address.
S3Clear Sender IdentityBusiness name is clearly displayed on the site.
S4No Pre-Checked ConsentEmail signup checkboxes are not pre-checked.
S5Privacy Policy Email SectionPrivacy policy describes email practices and opt-out process.

2.6 COPPA (Children's Online Privacy Protection Act)

Applies if: Site is directed at children under 13 or knowingly collects data from children.

#Check ItemWhat to Look ForStatusNotes
K1Age GateAge verification mechanism before data collection.
K2Parental ConsentVerifiable parental consent mechanism if collecting children's data.
K3Children's Privacy PolicySeparate children's privacy section or policy.
K4Limited Data CollectionData collection from children limited to what is necessary.
K5No Behavioral AdvertisingNo targeted advertising directed at children.

2.7 SOC 2 (Service Organization Control Type 2)

Applies if: B2B SaaS product or service that processes customer data.

#Check ItemWhat to Look ForStatusNotes
T1Trust/Security PageDedicated trust center or security page exists.
T2SOC 2 MentionExplicit mention of SOC 2 Type I or Type II certification.
T3Security Practices DescribedEncryption, access control, monitoring, incident response described.
T4Uptime/SLA InformationStatus page or uptime guarantees published.
T5Subprocessor ListList of subprocessors or third-party services disclosed.
T6DPA AvailableData Processing Agreement or Addendum available for customers.
T7Certifications DisplayedSOC 2, ISO 27001, GDPR badges or certification mentions.

Phase 3: Scoring and Prioritization

3.1 Calculate Framework Scores

For each applicable framework:

  • Pass = full points
  • Warning = half points
  • Fail = 0 points
  • N/A = excluded from calculation

Score = (earned points / possible points) * 100

3.2 Overall Compliance Score

Weight the frameworks by impact severity:

FrameworkWeightRationale
GDPR25%Heavy fines (up to 4% global revenue)
CCPA/CPRA20%Significant fines, class action risk
ADA/WCAG15%Lawsuit risk, DOJ enforcement
PCI-DSS20%Breach liability, processing suspension
CAN-SPAM10%Per-violation fines up to $51,744
COPPA10%FTC enforcement, reputational damage
SOC 2BonusNo penalty for absence but competitive disadvantage

3.3 Priority Classification

For each failed check, assign priority:

PriorityCriteriaExamples
🔴 CriticalActive legal exposure, could trigger enforcement action nowMissing cookie consent with EU traffic, no "Do Not Sell" link with CA traffic, payment page without HTTPS
🟡 HighSignificant gap that should be addressed within 30 daysIncomplete privacy policy, no unsubscribe mechanism, missing alt text on key images
🟡 MediumImportant but not immediately actionableNo DPO listed, no security page, missing data retention periods
🟢 LowBest practice improvementsNo accessibility statement, no SOC 2 badge, no breach notification procedure documented

Phase 4: Generate Report

Output the report as

COMPLIANCE-AUDIT-[company]-[YYYY-MM-DD].md
.

Report Structure

# Compliance Gap Analysis Report

> ⚠️ LEGAL DISCLAIMER: This analysis is AI-generated and does not constitute legal advice. Always consult a licensed attorney. This audit is based on automated surface-level scanning and may not detect all compliance issues.

**Website:** [URL]
**Scan Date:** [date]
**Scanned Pages:** [list of pages scanned]

---

## Compliance Scorecard

| Framework | Score | Grade | Status |
|-----------|-------|-------|--------|
| GDPR | [X]% | [A-F] | [✅ Compliant / ⚠️ Gaps Found / ❌ Non-Compliant] |
| CCPA/CPRA | [X]% | [A-F] | [status] |
| ADA/WCAG | [X]% | [A-F] | [status] |
| PCI-DSS | [X]% | [A-F] | [status] |
| CAN-SPAM | [X]% | [A-F] | [status] |
| COPPA | [X]% | [A-F] | [status] |
| SOC 2 | [X]% | [A-F] | [status] |
| **Overall** | **[X]%** | **[A-F]** | |

### Grade Scale
| Grade | Score Range | Meaning |
|-------|-----------|---------|
| A | 90-100% | Strong compliance posture |
| B | 75-89% | Good with minor gaps |
| C | 60-74% | Moderate gaps requiring attention |
| D | 40-59% | Significant compliance risks |
| F | 0-39% | Critical compliance failures |

---

## Executive Summary

[3-5 sentences: overall compliance posture, biggest risks, most urgent actions needed]

**Detected Technologies:**
[List all detected analytics, payment, tracking, and third-party services]

**Applicable Frameworks:**
[List which frameworks apply and why]

---

## 🔴 Critical Issues (Fix Immediately)

### [Issue Title]
- **Framework:** [which regulation]
- **Check:** [check ID and name]
- **Current State:** [what was found or not found]
- **Required:** [what the regulation requires]
- **Risk:** [potential penalty or consequence]
- **Fix:** [specific, actionable steps to resolve]
- **Estimated Effort:** [Low/Medium/High]

[Repeat for each critical issue]

---

## 🟡 High Priority Issues (Fix Within 30 Days)

[Same format as critical issues]

---

## 🟡 Medium Priority Issues (Fix Within 90 Days)

[Same format]

---

## 🟢 Low Priority / Best Practices

[Same format, briefer descriptions]

---

## ✅ Passing Checks

[List all passing checks grouped by framework — brief confirmation of compliance]

---

## Framework Detail: GDPR

[Full audit table for GDPR with all check items, statuses, and notes]

## Framework Detail: CCPA/CPRA

[Full audit table]

## Framework Detail: ADA/WCAG

[Full audit table]

## Framework Detail: PCI-DSS

[Full audit table]

## Framework Detail: CAN-SPAM

[Full audit table]

## Framework Detail: COPPA

[Full audit table]

## Framework Detail: SOC 2

[Full audit table]

---

## Remediation Roadmap

### Week 1 (Critical)
1. [ ] [specific action]
2. [ ] [specific action]

### Month 1 (High Priority)
1. [ ] [specific action]
2. [ ] [specific action]

### Quarter 1 (Medium Priority)
1. [ ] [specific action]
2. [ ] [specific action]

### Ongoing (Best Practices)
1. [ ] [specific action]
2. [ ] [specific action]

---

## Limitations of This Audit

- This scan evaluates publicly visible compliance signals only
- Backend data handling, internal policies, and employee training were not assessed
- Accessibility checks are surface-level; a full WCAG 2.1 AA audit requires automated tooling and manual testing
- PCI-DSS evaluation is limited to visible indicators; full PCI compliance requires a Qualified Security Assessor (QSA) or Self-Assessment Questionnaire (SAQ)
- SOC 2 compliance cannot be verified without access to the actual audit report
- This does not constitute a legal audit and should not be used as evidence of compliance or non-compliance

Phase 5: Present to User

After generating the report:

  1. Display the Compliance Scorecard prominently
  2. Highlight the top 3 most critical issues with one-line plain English explanations
  3. State how many issues were found at each priority level
  4. Show the full report
  5. Offer: "Would you like me to generate a privacy policy for this site? Run
    /legal privacy [url]
    ."
  6. Offer: "Would you like a detailed review of your terms of service? Run
    /legal terms-review [url]
    ."