# Compliance Patterns

GDPR data handling, audit logging, data classification, retention policies, and consent...

- Repository: https://github.com/vibeeval/vibecosystem (541 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-08-08
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add vibeeval/vibecosystem --skill compliance-patterns -g -a claude-code -y`
Codex: `npx skills add vibeeval/vibecosystem --skill compliance-patterns -g -a codex -y`
Cursor: `npx skills add vibeeval/vibecosystem --skill compliance-patterns -g -a cursor -y`
Gemini CLI: `npx skills add vibeeval/vibecosystem --skill compliance-patterns -g -a gemini-cli -y`

## Description

GDPR data handling, audit logging, data classification, retention policies, and consent management for regulatory compliance.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Compliance Patterns

Data governance and regulatory compliance patterns for software systems.

## Data Classification

```typescript
// Tag every data field with its classification level
enum DataClass {
  PUBLIC = 'public',           // Marketing content, product info
  INTERNAL = 'internal',       // Business metrics, employee count
  CONFIDENTIAL = 'confidential', // Customer emails, order history
  RESTRICTED = 'restricted',   // Passwords, SSN, payment cards, health data
}

// Schema-level classification
interface UserRecord {
  id: string                    // INTERNAL
  email: string                 // CONFIDENTIAL (PII)
  displayName: string           // CONFIDENTIAL (PII)
  passwordHash: string          // RESTRICTED
  dateOfBirth: string           // RESTRICTED (sensitive PII)
  preferences: object           // INTERNAL
  createdAt: Date              // INTERNAL
}

// Field-level encryption for RESTRICTED data
const ENCRYPTED_FIELDS: Record<string, DataClass> = {
  'user.email': DataClass.CONFIDENTIAL,
  'user.dateOfBirth': DataClass.RESTRICTED,
  'user.ssn': DataClass.RESTRICTED,
  'payment.cardNumber': DataClass.RESTRICTED,
}

function shouldEncryptAtRest(fieldPath: string): boolean {
  const classification = ENCRYPTED_FIELDS[fieldPath]
  return classification === DataClass.RESTRICTED
}

function shouldMaskInLogs(fieldPath: string): boolean {
  const classification = ENCRYPTED_FIELDS[fieldPath]
  return classification === DataClass.CONFIDENTIAL || classification === DataClass.RESTRICTED
}
```

## Audit Logging

The rest: https://github.com/vibeeval/vibecosystem/blob/HEAD/skills/compliance-patterns/SKILL.md
