
Compliance Patterns
GDPR data handling, audit logging, data classification, retention policies, and consent...
Install
npx skills add vibeeval/vibecosystem --skill compliance-patterns -g -a claude-code -y- Repository
- vibeeval/vibecosystem541
- Category
- Engineering
- Updated
- 3mo ago
- License
- MIT
- Context cost
- Mediumabout 2,131 tokens
- Runs scripts
- No, instructions only
What it does
GDPR data handling, audit logging, data classification, retention policies, and consent management for regulatory compliance.
Compliance Patterns
Data governance and regulatory compliance patterns for software systems.
Data Classification
// 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
}
