From lgpd-skills
Defines retention rules and erasure mechanisms for LGPD compliance, reconciling right to erasure with legal retention obligations. Includes Prisma schema, strategies, and automated cleanup jobs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/lgpd-skills:lgpd-retention-erasureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Arts. 15-16 LGPD definem o término do tratamento. Art. 18, VI dá direito à eliminação. A tensão prática é com **retenções legais obrigatórias**.
Arts. 15-16 LGPD definem o término do tratamento. Art. 18, VI dá direito à eliminação. A tensão prática é com retenções legais obrigatórias.
Retenção legal obrigatória > Retenção contratual > Vontade do titular (Art. 18, VI)
Quando há obrigação legal de manter (fiscal, trabalhista, bancário, Marco Civil), o tratamento continua bloqueado (não usado para finalidade original) até o fim do prazo legal, depois é eliminado.
| Categoria | Prazo | Fonte |
|---|---|---|
| Fiscal (notas, impostos) | 5 anos | CTN Art. 173-174 |
| Trabalhista (contratos, folha) | 5 anos | CLT Art. 11 |
| Previdenciária | 10 anos | Lei 8.212/91 |
| Bancário | 10 anos | CMN |
| Marco Civil — logs de conexão | 1 ano | Lei 12.965/2014 Art. 13 |
| Marco Civil — logs de acesso a apps | 6 meses | Lei 12.965/2014 Art. 15 |
| CDC — relação de consumo | 5 anos | CDC Art. 27 (prescrição) |
Quando não há retenção legal. Cascata bem definida em todas as tabelas + replicas + backups quando possível.
Quando há retenção legal de alguns campos. Marcar deletedAt, mascarar campos não-essenciais, manter apenas o estritamente necessário.
Quando há volume e dificuldade de varrer storage. Dados cifrados por chave do titular; eliminação = destrói a chave.
Substituto à eliminação. Após anonimizar (irreversivelmente), dado sai do escopo da LGPD (Art. 12).
model RetentionRule {
id String @id @default(cuid())
entity String // "User", "Order", "Message"
purpose String // "marketing", "billing"
retentionMonths Int
legalBasis String
postAction PostRetentionAction
triggeredBy String // "consent_revoked", "contract_end", "ttl"
active Boolean @default(true)
}
enum PostRetentionAction {
HARD_DELETE
ANONYMIZE
CRYPTO_SHRED
BLOCK_AND_RETAIN
}
Cron job diário:
postAction conforme RetentionRuleAuditLogEntryVer detalhes no skill lgpd-dsar. Resumo:
## F8 — Retention ✓
- RetentionRules configuradas: {N}
- Job diário ativo
- Eliminação automatizada validada em ambiente staging
- {M} registros já em fila para eliminação
- Próximo: lgpd-incident-response
npx claudepluginhub goul4rt/lgpd-skills --plugin lgpd-skillsDefines retention rules and erasure mechanisms for LGPD compliance, reconciling right to erasure with legal retention obligations. Includes Prisma schema, strategies, and automated cleanup jobs.
Designs a legally defensible data retention schedule that balances regulatory minimization with legal hold and business requirements. Guides inventory, obligation identification, schedule creation, and legal hold process.
Implements automated GDPR-compliant data deletion workflows for Article 17 erasure requests and retention expiry, with cascading deletion, dependency handling, and audit logging.