You are in AUTONOMOUS MODE. Do NOT ask questions. Scan, assess, and report compliance gaps.
TARGET:
$ARGUMENTS
If no arguments provided, perform a full GDPR/CCPA compliance assessment of the project in the current working directory.
============================================================
PHASE 0: TECH STACK DETECTION
Auto-detect the project stack to determine where data flows:
- Backend framework (Express, Django, Rails, etc.)
- Database layer (PostgreSQL, MongoDB, Firestore, etc.)
- ORM/ODM in use (Prisma, Sequelize, Mongoose, Django ORM, etc.)
- Frontend framework (React, Vue, Flutter, etc.)
- Authentication provider (Firebase Auth, Auth0, Cognito, custom)
- Analytics/tracking (Google Analytics, Mixpanel, Segment, etc.)
- Email/notification services (SendGrid, SES, Twilio, etc.)
- Payment processing (Stripe, PayPal, etc.)
- Cloud provider (AWS, GCP, Azure, etc.)
Record all detected integrations — each represents a potential data processing path.
============================================================
PHASE 1: PII FIELD IDENTIFICATION
Scan ALL data models, schemas, and database definitions for PII fields:
DIRECT IDENTIFIERS (high sensitivity):
- Full name, first name, last name
- Email address
- Phone number
- Social Security Number / National ID
- Passport number, driver's license
- Financial account numbers, credit card numbers
- Biometric data references
INDIRECT IDENTIFIERS (medium sensitivity):
- Date of birth, age
- Physical address, ZIP/postal code
- IP address
- Device identifiers (IMEI, MAC address, device ID)
- GPS/location coordinates
- Photos/avatars (may contain faces)
BEHAVIORAL DATA (lower sensitivity, still regulated):
- Purchase history, browsing history
- Search queries
- Usage patterns, session data
- Preferences, settings tied to a user
For each PII field found, record:
- File path and line number
- Field name and type
- Which data model it belongs to
- Whether it is encrypted at rest
- Whether it has a retention policy
============================================================
PHASE 2: DATA COLLECTION POINTS
Identify every point where user data enters the system:
FORMS AND UI:
- Registration/signup forms — what fields are collected
- Profile edit forms
- Contact/support forms
- Payment forms
- Any form collecting personal data
API ENDPOINTS:
- POST/PUT endpoints that accept user data
- File upload endpoints
- Webhook receivers that process user data
IMPLICIT COLLECTION:
- IP address logging in middleware/access logs
- User-agent string storage
- Geolocation tracking
- Cookie setting (what data, what purpose, what duration)
- Analytics event tracking (what user properties are sent)
- Error reporting services (what user context is attached)
For each collection point:
- What data is collected
- Is there a stated purpose for collection
- Is consent obtained before collection
- Is the data minimized (collecting only what is needed)
============================================================
PHASE 3: CONSENT MECHANISMS
Check for proper consent handling:
COOKIE CONSENT:
- Cookie banner/consent manager present
- Consent obtained before setting non-essential cookies
- Cookie categories defined (necessary, analytics, marketing)
- Consent preferences stored and respected
- Easy mechanism to withdraw consent
DATA PROCESSING CONSENT:
- Explicit opt-in for marketing communications
- Consent recorded with timestamp
- Separate consent for separate purposes (not bundled)
- Pre-checked boxes (violation if used for consent)
PRIVACY POLICY:
- Privacy policy page exists and is accessible
- Policy linked from data collection points
- Policy covers: what data, why, how long, who has access, user rights
- Policy is up to date (check for stale dates or references)
TERMS OF SERVICE:
- ToS exists and covers data processing
- ToS linked during registration
============================================================
PHASE 4: DATA SUBJECT RIGHTS
Check implementation of required data subject rights:
RIGHT TO ACCESS (Article 15 / CCPA Right to Know):
- Can users request a copy of their data?
- Is there an API endpoint or UI for data export?
- Does the export include ALL user data across all tables/collections?
- Export format: machine-readable (JSON, CSV)?
RIGHT TO ERASURE (Article 17 / CCPA Right to Delete):
- Can users request account deletion?
- Does deletion cascade to all related data?
- Does deletion reach third-party services (analytics, email lists)?
- Are backups considered (data may persist in backups)?
- Is there a soft-delete with scheduled hard-delete, or immediate?
RIGHT TO RECTIFICATION (Article 16):
- Can users edit/correct their personal data?
- Are corrections propagated to all copies of the data?
RIGHT TO PORTABILITY (Article 20):
- Can users export their data in a portable format?
- Is the format interoperable (JSON, CSV, not proprietary)?
RIGHT TO OBJECT (Article 21 / CCPA Right to Opt-Out):
- Can users opt out of data processing for marketing?
- Can users opt out of automated profiling/decision-making?
- Is there a "Do Not Sell" mechanism (CCPA requirement)?
============================================================
PHASE 5: THIRD-PARTY DATA SHARING
Identify all third-party services that receive user data:
ANALYTICS:
- Google Analytics, Mixpanel, Amplitude, Segment, etc.
- What user properties are sent
- Is consent obtained before tracking
ADVERTISING:
- Facebook Pixel, Google Ads, etc.
- What conversion data is shared
- Is there a "Do Not Sell" opt-out
INTEGRATIONS:
- Payment processors (Stripe, PayPal) — what data is shared
- Email services (SendGrid, Mailchimp) — email + name + preferences
- SMS services (Twilio) — phone numbers
- Cloud storage — what user data is stored
- Error tracking (Sentry, Bugsnag) — what user context is attached
For each third party:
- What data is shared
- Is there a Data Processing Agreement (DPA) in place
- Is the data transfer compliant (EU→US: adequate safeguards?)
- Is the sharing disclosed in the privacy policy
============================================================
PHASE 6: DATA RETENTION
Check data retention practices:
- Are retention periods defined for each data category?
- Is there automated data expiry/cleanup?
- Are inactive accounts purged after a defined period?
- Are logs rotated and expired?
- Are backups expired according to retention policy?
- Is there a data retention schedule document?
Flag any data that appears to be stored indefinitely without justification.
============================================================
SELF-HEALING VALIDATION (max 2 iterations)
After producing the security analysis, validate thoroughness:
- Verify every category in the audit was actually checked (not skipped).
- Verify every finding has a specific file:line location.
- Verify severity ratings are justified by impact assessment.
- Verify no false positives by re-reading flagged code in context.
IF VALIDATION FAILS:
- Re-audit skipped categories or vague findings
- Verify or remove false positives
- Repeat up to 2 iterations
============================================================
OUTPUT
GDPR/CCPA Compliance Report
Project: [name]
Stack: [detected technologies]
Assessment Date: [date]
Compliance Summary
| Area |
Status |
Findings |
| PII Identification |
[PASS/PARTIAL/FAIL] |
N fields found |
| Consent Mechanisms |
[PASS/PARTIAL/FAIL] |
N gaps |
| Data Subject Rights |
[PASS/PARTIAL/FAIL] |
N missing |
| Third-Party Sharing |
[PASS/PARTIAL/FAIL] |
N services |
| Data Retention |
[PASS/PARTIAL/FAIL] |
N issues |
| Privacy Policy |
[PASS/PARTIAL/FAIL] |
N gaps |
PII Inventory
| Field |
Model/Table |
Encrypted |
Retention |
Purpose |
| email |
users |
No |
Indefinite |
Authentication |
Missing Data Subject Rights
| Right |
Status |
Implementation Guidance |
| Access/Export |
[Implemented/Missing] |
Build GET /api/user/export endpoint |
| Erasure/Delete |
[Implemented/Missing] |
Build DELETE /api/user with cascade |
| Rectification |
[Implemented/Missing] |
Ensure profile edit covers all PII |
| Portability |
[Implemented/Missing] |
Add JSON/CSV export option |
| Object/Opt-Out |
[Implemented/Missing] |
Add marketing preference toggle |
Third-Party Data Flows
| Service |
Data Shared |
DPA |
Consent |
Disclosed |
| Google Analytics |
IP, pages, events |
? |
No banner |
No |
Compliance Checklist
Remediation Priority
[Ordered list: Critical gaps first, then CCPA-specific, then best practices]
============================================================
NEXT STEPS
After reviewing the compliance report:
- "Implement missing data subject rights (export, delete, opt-out)."
- "Run
/encryption to ensure PII is encrypted at rest and in transit."
- "Run
/soc2 for broader compliance assessment."
- "Run
/secure for full security posture including data handling."
- "Consult legal counsel for privacy policy and DPA review."
============================================================
SELF-EVOLUTION TELEMETRY
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
- Look for the project path in
~/.claude/projects/
- If found, append to
skill-telemetry.md in that memory directory
Entry format:
### /gdpr — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}
Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.
============================================================
DO NOT
- Do NOT modify any code — this is an assessment skill, not an implementation skill.
- Do NOT provide legal advice — flag gaps and suggest technical implementations.
- Do NOT expose actual PII values found in the codebase — redact in output.
- Do NOT skip third-party integrations — they are the most common compliance gap.
- Do NOT assume compliance based on the presence of a privacy policy alone.
- Do NOT conflate GDPR and CCPA requirements — note which regulation each finding applies to.
- Do NOT ignore implicit data collection (logs, analytics, error tracking).
1---2name: gdpr-23description: GDPR and CCPA/CPRA privacy compliance audit for codebases. Inventories PII fields (email, phone, SSN, IP, device ID, geolocation, biometrics, behavioral data), maps data collection points (forms, APIs, cookies, analytics, error tracking), audits consent mechanisms (cookie banners, opt-in.4---56You are in AUTONOMOUS MODE. Do NOT ask questions. Scan, assess, and report compliance gaps.78TARGET:9$ARGUMENTS1011If no arguments provided, perform a full GDPR/CCPA compliance assessment of the project in the current working directory.1213============================================================14PHASE 0: TECH STACK DETECTION15============================================================1617Auto-detect the project stack to determine where data flows:1819- Backend framework (Express, Django, Rails, etc.)20- Database layer (PostgreSQL, MongoDB, Firestore, etc.)21- ORM/ODM in use (Prisma, Sequelize, Mongoose, Django ORM, etc.)22- Frontend framework (React, Vue, Flutter, etc.)23- Authentication provider (Firebase Auth, Auth0, Cognito, custom)24- Analytics/tracking (Google Analytics, Mixpanel, Segment, etc.)25- Email/notification services (SendGrid, SES, Twilio, etc.)26- Payment processing (Stripe, PayPal, etc.)27- Cloud provider (AWS, GCP, Azure, etc.)2829Record all detected integrations — each represents a potential data processing path.3031============================================================32PHASE 1: PII FIELD IDENTIFICATION33============================================================3435Scan ALL data models, schemas, and database definitions for PII fields:3637DIRECT IDENTIFIERS (high sensitivity):38- Full name, first name, last name39- Email address40- Phone number41- Social Security Number / National ID42- Passport number, driver's license43- Financial account numbers, credit card numbers44- Biometric data references4546INDIRECT IDENTIFIERS (medium sensitivity):47- Date of birth, age48- Physical address, ZIP/postal code49- IP address50- Device identifiers (IMEI, MAC address, device ID)51- GPS/location coordinates52- Photos/avatars (may contain faces)5354BEHAVIORAL DATA (lower sensitivity, still regulated):55- Purchase history, browsing history56- Search queries57- Usage patterns, session data58- Preferences, settings tied to a user5960For each PII field found, record:61- File path and line number62- Field name and type63- Which data model it belongs to64- Whether it is encrypted at rest65- Whether it has a retention policy6667============================================================68PHASE 2: DATA COLLECTION POINTS69============================================================7071Identify every point where user data enters the system:7273FORMS AND UI:74- Registration/signup forms — what fields are collected75- Profile edit forms76- Contact/support forms77- Payment forms78- Any form collecting personal data7980API ENDPOINTS:81- POST/PUT endpoints that accept user data82- File upload endpoints83- Webhook receivers that process user data8485IMPLICIT COLLECTION:86- IP address logging in middleware/access logs87- User-agent string storage88- Geolocation tracking89- Cookie setting (what data, what purpose, what duration)90- Analytics event tracking (what user properties are sent)91- Error reporting services (what user context is attached)9293For each collection point:94- What data is collected95- Is there a stated purpose for collection96- Is consent obtained before collection97- Is the data minimized (collecting only what is needed)9899============================================================100PHASE 3: CONSENT MECHANISMS101============================================================102103Check for proper consent handling:104105COOKIE CONSENT:106- Cookie banner/consent manager present107- Consent obtained before setting non-essential cookies108- Cookie categories defined (necessary, analytics, marketing)109- Consent preferences stored and respected110- Easy mechanism to withdraw consent111112DATA PROCESSING CONSENT:113- Explicit opt-in for marketing communications114- Consent recorded with timestamp115- Separate consent for separate purposes (not bundled)116- Pre-checked boxes (violation if used for consent)117118PRIVACY POLICY:119- Privacy policy page exists and is accessible120- Policy linked from data collection points121- Policy covers: what data, why, how long, who has access, user rights122- Policy is up to date (check for stale dates or references)123124TERMS OF SERVICE:125- ToS exists and covers data processing126- ToS linked during registration127128============================================================129PHASE 4: DATA SUBJECT RIGHTS130============================================================131132Check implementation of required data subject rights:133134RIGHT TO ACCESS (Article 15 / CCPA Right to Know):135- Can users request a copy of their data?136- Is there an API endpoint or UI for data export?137- Does the export include ALL user data across all tables/collections?138- Export format: machine-readable (JSON, CSV)?139140RIGHT TO ERASURE (Article 17 / CCPA Right to Delete):141- Can users request account deletion?142- Does deletion cascade to all related data?143- Does deletion reach third-party services (analytics, email lists)?144- Are backups considered (data may persist in backups)?145- Is there a soft-delete with scheduled hard-delete, or immediate?146147RIGHT TO RECTIFICATION (Article 16):148- Can users edit/correct their personal data?149- Are corrections propagated to all copies of the data?150151RIGHT TO PORTABILITY (Article 20):152- Can users export their data in a portable format?153- Is the format interoperable (JSON, CSV, not proprietary)?154155RIGHT TO OBJECT (Article 21 / CCPA Right to Opt-Out):156- Can users opt out of data processing for marketing?157- Can users opt out of automated profiling/decision-making?158- Is there a "Do Not Sell" mechanism (CCPA requirement)?159160============================================================161PHASE 5: THIRD-PARTY DATA SHARING162============================================================163164Identify all third-party services that receive user data:165166ANALYTICS:167- Google Analytics, Mixpanel, Amplitude, Segment, etc.168- What user properties are sent169- Is consent obtained before tracking170171ADVERTISING:172- Facebook Pixel, Google Ads, etc.173- What conversion data is shared174- Is there a "Do Not Sell" opt-out175176INTEGRATIONS:177- Payment processors (Stripe, PayPal) — what data is shared178- Email services (SendGrid, Mailchimp) — email + name + preferences179- SMS services (Twilio) — phone numbers180- Cloud storage — what user data is stored181- Error tracking (Sentry, Bugsnag) — what user context is attached182183For each third party:184- What data is shared185- Is there a Data Processing Agreement (DPA) in place186- Is the data transfer compliant (EU→US: adequate safeguards?)187- Is the sharing disclosed in the privacy policy188189============================================================190PHASE 6: DATA RETENTION191============================================================192193Check data retention practices:194195- Are retention periods defined for each data category?196- Is there automated data expiry/cleanup?197- Are inactive accounts purged after a defined period?198- Are logs rotated and expired?199- Are backups expired according to retention policy?200- Is there a data retention schedule document?201202Flag any data that appears to be stored indefinitely without justification.203204205============================================================206SELF-HEALING VALIDATION (max 2 iterations)207============================================================208209After producing the security analysis, validate thoroughness:2102111. Verify every category in the audit was actually checked (not skipped).2122. Verify every finding has a specific file:line location.2133. Verify severity ratings are justified by impact assessment.2144. Verify no false positives by re-reading flagged code in context.215216IF VALIDATION FAILS:217- Re-audit skipped categories or vague findings218- Verify or remove false positives219- Repeat up to 2 iterations220221============================================================222OUTPUT223============================================================224225## GDPR/CCPA Compliance Report226227**Project:** [name]228**Stack:** [detected technologies]229**Assessment Date:** [date]230231### Compliance Summary232233| Area | Status | Findings |234|------|--------|----------|235| PII Identification | [PASS/PARTIAL/FAIL] | N fields found |236| Consent Mechanisms | [PASS/PARTIAL/FAIL] | N gaps |237| Data Subject Rights | [PASS/PARTIAL/FAIL] | N missing |238| Third-Party Sharing | [PASS/PARTIAL/FAIL] | N services |239| Data Retention | [PASS/PARTIAL/FAIL] | N issues |240| Privacy Policy | [PASS/PARTIAL/FAIL] | N gaps |241242### PII Inventory243244| Field | Model/Table | Encrypted | Retention | Purpose |245|-------|-------------|-----------|-----------|---------|246| email | users | No | Indefinite | Authentication |247248### Missing Data Subject Rights249250| Right | Status | Implementation Guidance |251|-------|--------|------------------------|252| Access/Export | [Implemented/Missing] | Build GET /api/user/export endpoint |253| Erasure/Delete | [Implemented/Missing] | Build DELETE /api/user with cascade |254| Rectification | [Implemented/Missing] | Ensure profile edit covers all PII |255| Portability | [Implemented/Missing] | Add JSON/CSV export option |256| Object/Opt-Out | [Implemented/Missing] | Add marketing preference toggle |257258### Third-Party Data Flows259260| Service | Data Shared | DPA | Consent | Disclosed |261|---------|------------|-----|---------|-----------|262| Google Analytics | IP, pages, events | ? | No banner | No |263264### Compliance Checklist265266- [ ] All PII fields identified and documented267- [ ] Cookie consent banner with opt-in268- [ ] Privacy policy covers all data processing269- [ ] Data export endpoint (right to access)270- [ ] Account deletion with cascade (right to erasure)271- [ ] Marketing opt-out mechanism272- [ ] Data retention policies defined and automated273- [ ] DPAs in place with all third-party processors274- [ ] Data breach notification process documented275- [ ] Data Protection Impact Assessment completed (if high-risk processing)276277### Remediation Priority278[Ordered list: Critical gaps first, then CCPA-specific, then best practices]279280============================================================281NEXT STEPS282============================================================283284After reviewing the compliance report:285- "Implement missing data subject rights (export, delete, opt-out)."286- "Run `/encryption` to ensure PII is encrypted at rest and in transit."287- "Run `/soc2` for broader compliance assessment."288- "Run `/secure` for full security posture including data handling."289- "Consult legal counsel for privacy policy and DPA review."290291292============================================================293SELF-EVOLUTION TELEMETRY294============================================================295296After producing output, record execution metadata for the /evolve pipeline.297298Check if a project memory directory exists:299- Look for the project path in `~/.claude/projects/`300- If found, append to `skill-telemetry.md` in that memory directory301302Entry format:303```304### /gdpr — {{YYYY-MM-DD}}305- Outcome: {{SUCCESS | PARTIAL | FAILED}}306- Self-healed: {{yes — what was healed | no}}307- Iterations used: {{N}} / {{N max}}308- Bottleneck: {{phase that struggled or "none"}}309- Suggestion: {{one-line improvement idea for /evolve, or "none"}}310```311312Only log if the memory directory exists. Skip silently if not found.313Keep entries concise — /evolve will parse these for skill improvement signals.314315============================================================316DO NOT317============================================================318319- Do NOT modify any code — this is an assessment skill, not an implementation skill.320- Do NOT provide legal advice — flag gaps and suggest technical implementations.321- Do NOT expose actual PII values found in the codebase — redact in output.322- Do NOT skip third-party integrations — they are the most common compliance gap.323- Do NOT assume compliance based on the presence of a privacy policy alone.324- Do NOT conflate GDPR and CCPA requirements — note which regulation each finding applies to.325- Do NOT ignore implicit data collection (logs, analytics, error tracking).