backend-data-masking
Use when the user asks about PII masking, redaction, field-level encryption, tokenization, anonymization or pseudonymization, GDPR erasure or masking…
от j4flmao★ 47 звёзд на GitHub
Установить backend-data-masking в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Backend Data Masking
Purpose
Protect personally identifiable information (PII) using masking, encryption, tokenization, and anonymization techniques for GDPR/CCPA compliance.
Agent Protocol
Trigger
Exact user phrases: "data masking", "PII", "personally identifiable information", "encryption", "anonymization", "GDPR", "CCPA", "data privacy", "field-level encryption", "tokenization", "redaction", "data classification", "mask sensitive data".
Input Context
- Data model — which fields contain sensitive data.
- Classification of each field (PII, PCI, PHI, internal).
- Regulatory requirements (GDPR, CCPA, HIPAA, PCI-DSS).
Output Artifact
Data masking configuration or implementation code. No file unless requested.
Response Format
Field: {field name}
Classification: {PII|PCI|PHI|Internal}
Protection: {mask|encrypt|tokenize|anonymize|redact}
Completion Criteria
- All sensitive fields identified and classified.
- Protection strategy chosen per classification.
- Masking/encryption implemented at the application or database layer.
- Audit log of data access recorded.
- Right-to-deletion workflow for GDPR Article 17.
Max Response Length
3 lines per field. 15 lines for full plan.
Architecture Decision Tree
Which Protection Strategy?
Is the data needed for business operations?
├── Yes → Does the business need the original value?
│ ├── Yes → Encrypt (symmetric or asymmetric)
│ └── No → Tokenize (map to surrogate value)
├── No → Is the data needed for display/UI?
│ ├── Yes → Mask on read (partial display)
│ └── No → Is the data needed for analytics?
│ ├── Yes → Anonymize (statistically useful, not reversible)
│ └── No → Redact (remove entirely)
Where to Apply Protection?
Is the data at rest in a database?
├── Yes → Field-level encryption OR tokenization at write time
├── No → Is the data in transit in an API response?
│ ├── Yes → Mask or redact at the presentation layer
│ └── No → Is the data in logs?
│ ├── Yes → Redact entirely — never log PII
│ └── No → Is the data in a backup/export?
│ ├── Yes → Anonymize or encrypt
│ └── No → Apply at the closest boundary
Workflow
Step 1: Classify Data Fields
| Field | Classification | Protection |
|---|---|---|
| PII | Mask: j***@example.com | |
| phone | PII | Mask: +1 (***) ***-1234 |
| credit_card | PCI | Tokenize |
| ssn | PII/Sensitive | Encrypt at rest + mask |
| diagnosis | PHI | Encrypt at rest |
| name | PII | Mask on UI, encrypt at rest |
Step 2: Implement Masking
function maskEmail(email) {
const [local, domain] = email.split('@');
return `${local[0]}${'*'.repeat(Math.max(local.length - 2, 0))}${local[local.length - 1]}@${domain}`;
}
// [email protected] -> j******[email protected]
def mask_email(email: str) -> str:
local, domain = email.split('@')
return f"{local[0]}{'*' * max(len(local) - 2, 0)}{local[-1]}@{domain}"
def mask_phone(phone: str) -> str:
# +1234567890 -> +1******890
return phone[:2] + '*' * (len(phone) - 5) + phone[-3:]
Step 3: Implement Field-Level Encryption
const algorithm = 'aes-256-gcm';
const key = crypto.scryptSync(process.env.DATA_KEY, 'salt', 32);
function encryptField(plaintext) {
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv(algorithm, key, iv);
const encrypted = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);
const authTag = cipher.getAuthTag();
return `${iv.toString('hex')}:${authTag.toString('hex')}:${encrypted.toString('hex')}`;
}
function decryptField(ciphertext) {
const [iv, authTag, encrypted] = ciphertext.split(':').map(s => Buffer.from(s, 'hex'));
const decipher = crypto.createDecipheriv(algorithm, key, iv);
decipher.setAuthTag(authTag);
return decipher.update(encrypted) + decipher.final('utf8');
}
Step 4: Implement Tokenization
async function tokenizeField(plaintext) {
const token = crypto.randomUUID();
await vaultStore.set(token, plaintext, { ttl: 86400 });
return token;
}
async function detokenizeField(token) {
return vaultStore.get(token);
}
Step 5: Handle GDPR Deletion
-- Right to be forgotten — anonymize, do not delete
UPDATE users SET
email = NULL,
name = 'ANONYMIZED',
phone = NULL,
anonymized_at = NOW(),
deletion_requested_at = NOW()
WHERE id = $1;
Masking Techniques
Character Masking
// Show first/last characters, mask middle
function maskString(value, showFirst = 1, showLast = 1, maskChar = '*') {
if (value.length <= showFirst + showLast) return value;
return value.slice(0, showFirst) +
maskChar.repeat(value.length - showFirst - showLast) +
value.slice(-sho
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/data-classification.md
- references/data-masking-advanced.md
- references/data-masking-audit.md
- references/data-masking-compliance.md
- references/data-masking-fundamentals.md
- references/data-masking-performance.md
- references/data-masking-techniques.md
- references/encryption-strategies.md
- references/masking-patterns.md
- references/pii-detection.md
FAQ
Что делает скилл backend-data-masking?
Use when the user asks about PII masking, redaction, field-level encryption, tokenization, anonymization or pseudonymization, GDPR erasure or masking production data for test environments. Produces a data protection plan with code. Not for encryption at rest and key management (use security-data-security).
Как установить скилл backend-data-masking?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл backend-data-masking запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…