[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CHBAGXGJ6M0D5JKWM27YX9":3,"skill-same:01M6CHBAGXGJ6M0D5JKWM27YX9":98},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":63,"repositoryHtmlUrl":64,"repositoryHomepageUrl":6,"ownerHtmlUrl":65,"ownerBlogUrl":66,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6CHBAGXGJ6M0D5JKWM27YX9","apollo-data-handling",null,"Apollo.io data management and compliance.\nUse when handling contact data, implementing GDPR compliance,\nor managing data exports and retention.\nTrigger with phrases like \"apollo data\", \"apollo gdpr\", \"apollo compliance\",\n\"apollo data export\", \"apollo data retention\", \"apollo pii\".","Dicklesworthstone\u002Fpi_agent_rust","Dicklesworthstone","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F35050222?v=4","01M6CG26AR942CSVMN1M5E3DSE","Jeff Emanuel","01M6CG26EPP71PSHW1VDS71121",1992,"MIT","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fapollo-pack\u002Fskills\u002Fapollo-data-handling\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000037","律师与法务",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"data","apollo data handling","apollo","export","when","data export","implementing","with","gdpr compliance","retention","data management","trigger","io","compliance","use","management","edit","write","read","curl","Bash","pii","kubectl","gdpr","2026-11-10 10:12:30",false,"---\nname: apollo-data-handling\ndescription: |\n  Apollo.io data management and compliance.\n  Use when handling contact data, implementing GDPR compliance,\n  or managing data exports and retention.\n  Trigger with phrases like \"apollo data\", \"apollo gdpr\", \"apollo compliance\",\n  \"apollo data export\", \"apollo data retention\", \"apollo pii\".\nallowed-tools: Read, Write, Edit, Bash(kubectl:*), Bash(curl:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\n---\n\n# Apollo Data Handling\n\n## Overview\nData management, compliance, and governance practices for Apollo.io contact data including GDPR, data retention, and secure handling.\n\n## Data Classification\n\n| Data Type | Classification | Retention | Handling |\n|-----------|---------------|-----------|----------|\n| Email addresses | PII | 2 years | Encrypted at rest |\n| Phone numbers | PII | 2 years | Encrypted at rest |\n| Names | PII | 2 years | Standard |\n| Job titles | Business | 5 years | Standard |\n| Company info | Business | 5 years | Standard |\n| Engagement data | Analytics | 1 year | Aggregated |\n\n## GDPR Compliance\n\n### Right to Access (Subject Access Request)\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Fgdpr\u002Faccess.service.ts\nimport { Contact } from '..\u002F..\u002Fmodels\u002Fcontact.model';\nimport { Engagement } from '..\u002F..\u002Fmodels\u002Fengagement.model';\n\ninterface SubjectAccessResponse {\n  personalData: {\n    contact: Partial\u003CContact>;\n    engagements: Partial\u003CEngagement>[];\n  };\n  processingPurposes: string[];\n  dataRetention: string;\n  dataSources: string[];\n}\n\nexport async function handleSubjectAccessRequest(\n  email: string\n): Promise\u003CSubjectAccessResponse> {\n  \u002F\u002F Find all data for this subject\n  const contact = await prisma.contact.findFirst({\n    where: { email },\n    select: {\n      id: true,\n      email: true,\n      name: true,\n      firstName: true,\n      lastName: true,\n      title: true,\n      phone: true,\n      linkedinUrl: true,\n      company: {\n        select: {\n          name: true,\n          domain: true,\n        },\n      },\n      createdAt: true,\n      updatedAt: true,\n    },\n  });\n\n  if (!contact) {\n    return {\n      personalData: { contact: {}, engagements: [] },\n      processingPurposes: [],\n      dataRetention: 'No data found',\n      dataSources: [],\n    };\n  }\n\n  const engagements = await prisma.engagement.findMany({\n    where: { contactId: contact.id },\n    select: {\n      type: true,\n      occurredAt: true,\n      sequenceId: true,\n    },\n  });\n\n  return {\n    personalData: {\n      contact,\n      engagements,\n    },\n    processingPurposes: [\n      'B2B sales outreach',\n      'Lead qualification',\n      'Marketing communications',\n    ],\n    dataRetention: '2 years from last activity',\n    dataSources: ['Apollo.io API', 'User-provided forms'],\n  };\n}\n```\n\n### Right to Erasure (Right to be Forgotten)\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Fgdpr\u002Ferasure.service.ts\ninterface ErasureResult {\n  success: boolean;\n  recordsDeleted: {\n    contacts: number;\n    engagements: number;\n    sequences: number;\n  };\n  apolloNotified: boolean;\n}\n\nexport async function handleErasureRequest(email: string): Promise\u003CErasureResult> {\n  const result: ErasureResult = {\n    success: false,\n    recordsDeleted: { contacts: 0, engagements: 0, sequences: 0 },\n    apolloNotified: false,\n  };\n\n  try {\n    \u002F\u002F Start transaction\n    await prisma.$transaction(async (tx) => {\n      \u002F\u002F Find contact\n      const contact = await tx.contact.findFirst({ where: { email } });\n      if (!contact) {\n        throw new Error('Contact not found');\n      }\n\n      \u002F\u002F Delete engagements\n      const deletedEngagements = await tx.engagement.deleteMany({\n        where: { contactId: contact.id },\n      });\n      result.recordsDeleted.engagements = deletedEngagements.count;\n\n      \u002F\u002F Remove from sequences\n      const deletedSequences = await tx.sequenceEnrollment.deleteMany({\n        where: { contactId: contact.id },\n      });\n      result.recordsDeleted.sequences = deletedSequences.count;\n\n      \u002F\u002F Delete contact\n      await tx.contact.delete({ where: { id: contact.id } });\n      result.recordsDeleted.contacts = 1;\n\n      \u002F\u002F Notify Apollo (if they support it)\n      try {\n        await notifyApolloOfDeletion(email);\n        result.apolloNotified = true;\n      } catch (e) {\n        console.warn('Could not notify Apollo of deletion', e);\n      }\n    });\n\n    result.success = true;\n\n    \u002F\u002F Log for audit\n    await auditLog.create({\n      type: 'GDPR_ERASURE',\n      subject: hashEmail(email), \u002F\u002F Don't store email in audit log\n      timestamp: new Date(),\n      recordsAffected: result.recordsDeleted,\n    });\n\n    return result;\n  } catch (error) {\n    console.error('Erasure request failed:', error);\n    throw error;\n  }\n}\n\nasync function notifyApolloOfDeletion(email: string): Promise\u003Cvoid> {\n  \u002F\u002F Apollo doesn't have a deletion API, but we can:\n  \u002F\u002F 1. Remove from all sequences\n  \u002F\u002F 2. Mark as do-not-contact\n  \u002F\u002F 3. Open support ticket for full removal\n\n  console.log(`Note: Contact Apollo support to fully delete ${email} from their system`);\n}\n```\n\n### Consent Management\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Fconsent\u002Fconsent.service.ts\nimport { z } from 'zod';\n\nconst ConsentSchema = z.object({\n  email: z.string().email(),\n  purposes: z.array(z.enum([\n    'sales_outreach',\n    'marketing_email',\n    'analytics',\n    'third_party_sharing',\n  ])),\n  timestamp: z.date(),\n  source: z.string(),\n  ipAddress: z.string().optional(),\n});\n\ntype Consent = z.infer\u003Ctypeof ConsentSchema>;\n\nexport async function recordConsent(consent: Consent): Promise\u003Cvoid> {\n  await prisma.consent.create({\n    data: {\n      email: consent.email,\n      purposes: consent.purposes,\n      grantedAt: consent.timestamp,\n      source: consent.source,\n      ipAddress: consent.ipAddress,\n    },\n  });\n}\n\nexport async function checkConsent(email: string, purpose: string): Promise\u003Cboolean> {\n  const consent = await prisma.consent.findFirst({\n    where: {\n      email,\n      purposes: { has: purpose },\n      revokedAt: null,\n    },\n    orderBy: { grantedAt: 'desc' },\n  });\n\n  return !!consent;\n}\n\nexport async function revokeConsent(email: string, purpose?: string): Promise\u003Cvoid> {\n  if (purpose) {\n    \u002F\u002F Revoke specific purpose\n    await prisma.consent.updateMany({\n      where: { email, purposes: { has: purpose } },\n      data: { revokedAt: new Date() },\n    });\n  } else {\n    \u002F\u002F Revoke all\n    await prisma.consent.updateMany({\n      where: { email },\n      data: { revokedAt: new Date() },\n    });\n  }\n}\n```\n\n## Data Retention\n\n```typescript\n\u002F\u002F src\u002Fjobs\u002Fdata-retention.job.ts\nimport { CronJob } from 'cron';\n\n\u002F\u002F Run daily at 2 AM\nconst retentionJob = new CronJob('0 2 * * *', async () => {\n  console.log('Starting data retention cleanup...');\n\n  const retentionPolicies = [\n    { table: 'contacts', field: 'lastActivityAt', maxAgeDays: 730 },\n    { table: 'engagements', field: 'occurredAt', maxAgeDays: 365 },\n    { table: 'auditLogs', field: 'createdAt', maxAgeDays: 2555 }, \u002F\u002F 7 years\n  ];\n\n  for (const policy of retentionPolicies) {\n    const cutoffDate = new Date();\n    cutoffDate.setDate(cutoffDate.getDate() - policy.maxAgeDays);\n\n    const deleted = await prisma[policy.table].deleteMany({\n      where: {\n        [policy.field]: { lt: cutoffDate },\n      },\n    });\n\n    console.log(`Deleted ${deleted.count} records from ${policy.table}`);\n  }\n\n  \u002F\u002F Archive before deletion for compliance\n  await archiveOldData();\n});\n\nasync function archiveOldData(): Promise\u003Cvoid> {\n  const archiveCutoff = new Date();\n  archiveCutoff.setDate(archiveCutoff.getDate() - 365);\n\n  \u002F\u002F Export to cold storage before deletion\n  const oldContacts = await prisma.contact.findMany({\n    where: { lastActivityAt: { lt: archiveCutoff } },\n  });\n\n  if (oldContacts.length > 0) {\n    await uploadToArchive('contacts', oldContacts);\n  }\n}\n```\n\n## Data Export\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Fexport\u002Fexport.service.ts\nimport { stringify } from 'csv-stringify\u002Fsync';\nimport { createWriteStream } from 'fs';\nimport archiver from 'archiver';\n\ninterface ExportOptions {\n  format: 'csv' | 'json';\n  includeEngagements: boolean;\n  dateRange?: { start: Date; end: Date };\n}\n\nexport async function exportContactData(\n  criteria: any,\n  options: ExportOptions\n): Promise\u003Cstring> {\n  const contacts = await prisma.contact.findMany({\n    where: {\n      ...criteria,\n      ...(options.dateRange && {\n        createdAt: {\n          gte: options.dateRange.start,\n          lte: options.dateRange.end,\n        },\n      }),\n    },\n    include: options.includeEngagements ? { engagements: true } : undefined,\n  });\n\n  const filename = `apollo-export-${Date.now()}`;\n\n  if (options.format === 'csv') {\n    const csv = stringify(contacts, {\n      header: true,\n      columns: ['id', 'email', 'name', 'title', 'company', 'createdAt'],\n    });\n    await writeFile(`exports\u002F${filename}.csv`, csv);\n    return `${filename}.csv`;\n  } else {\n    await writeFile(`exports\u002F${filename}.json`, JSON.stringify(contacts, null, 2));\n    return `${filename}.json`;\n  }\n}\n\nexport async function createSecureExport(\n  contacts: any[],\n  encryptionKey: string\n): Promise\u003CBuffer> {\n  const data = JSON.stringify(contacts);\n  const encrypted = await encrypt(data, encryptionKey);\n  return encrypted;\n}\n```\n\n## Data Encryption\n\n```typescript\n\u002F\u002F src\u002Flib\u002Fencryption.ts\nimport crypto from 'crypto';\n\nconst ALGORITHM = 'aes-256-gcm';\nconst IV_LENGTH = 16;\nconst AUTH_TAG_LENGTH = 16;\n\nexport function encryptPII(plaintext: string, key: Buffer): string {\n  const iv = crypto.randomBytes(IV_LENGTH);\n  const cipher = crypto.createCipheriv(ALGORITHM, key, iv);\n\n  let encrypted = cipher.update(plaintext, 'utf8', 'hex');\n  encrypted += cipher.final('hex');\n\n  const authTag = cipher.getAuthTag();\n\n  \u002F\u002F Format: iv:authTag:ciphertext\n  return `${iv.toString('hex')}:${authTag.toString('hex')}:${encrypted}`;\n}\n\nexport function decryptPII(encrypted: string, key: Buffer): string {\n  const [ivHex, authTagHex, ciphertext] = encrypted.split(':');\n\n  const iv = Buffer.from(ivHex, 'hex');\n  const authTag = Buffer.from(authTagHex, 'hex');\n\n  const decipher = crypto.createDecipheriv(ALGORITHM, key, iv);\n  decipher.setAuthTag(authTag);\n\n  let decrypted = decipher.update(ciphertext, 'hex', 'utf8');\n  decrypted += decipher.final('utf8');\n\n  return decrypted;\n}\n\n\u002F\u002F Column-level encryption for Prisma\nexport const encryptedFields = {\n  email: {\n    encrypt: (value: string) => encryptPII(value, getEncryptionKey()),\n    decrypt: (value: string) => decryptPII(value, getEncryptionKey()),\n  },\n  phone: {\n    encrypt: (value: string) => encryptPII(value, getEncryptionKey()),\n    decrypt: (value: string) => decryptPII(value, getEncryptionKey()),\n  },\n};\n```\n\n## Audit Logging\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Faudit\u002Faudit.service.ts\ninterface AuditEntry {\n  action: string;\n  actor: string;\n  resource: string;\n  resourceId: string;\n  changes?: Record\u003Cstring, { old: any; new: any }>;\n  metadata?: Record\u003Cstring, any>;\n  timestamp: Date;\n}\n\nexport async function logDataAccess(entry: AuditEntry): Promise\u003Cvoid> {\n  await prisma.auditLog.create({\n    data: {\n      action: entry.action,\n      actor: entry.actor,\n      resource: entry.resource,\n      resourceId: entry.resourceId,\n      changes: entry.changes ? JSON.stringify(entry.changes) : null,\n      metadata: entry.metadata ? JSON.stringify(entry.metadata) : null,\n      occurredAt: entry.timestamp,\n    },\n  });\n}\n\n\u002F\u002F Middleware to audit all data access\nexport function auditMiddleware(req: any, res: any, next: any) {\n  const originalSend = res.send;\n\n  res.send = function(body: any) {\n    \u002F\u002F Log data access\n    if (req.path.includes('\u002Fapollo\u002F') && req.method === 'GET') {\n      logDataAccess({\n        action: 'DATA_ACCESS',\n        actor: req.user?.id || 'anonymous',\n        resource: 'apollo_contact',\n        resourceId: req.params.id || 'bulk',\n        metadata: {\n          path: req.path,\n          query: req.query,\n          responseSize: body?.length,\n        },\n        timestamp: new Date(),\n      });\n    }\n\n    return originalSend.call(this, body);\n  };\n\n  next();\n}\n```\n\n## Output\n- GDPR compliance (access, erasure, consent)\n- Data retention policies\n- Secure data export\n- Column-level encryption\n- Comprehensive audit logging\n\n## Error Handling\n| Issue | Resolution |\n|-------|------------|\n| Export too large | Implement streaming |\n| Encryption key lost | Use key management service |\n| Audit log gaps | Implement retry queue |\n| Consent conflicts | Use latest consent record |\n\n## Resources\n- [GDPR Official Text](https:\u002F\u002Fgdpr.eu\u002F)\n- [CCPA Requirements](https:\u002F\u002Foag.ca.gov\u002Fprivacy\u002Fccpa)\n- [Apollo Privacy Policy](https:\u002F\u002Fwww.apollo.io\u002Fprivacy-policy)\n\n## Next Steps\nProceed to `apollo-enterprise-rbac` for access control.\n","# Apollo Data Handling\n\n## Overview\nData management, compliance, and governance practices for Apollo.io contact data including GDPR, data retention, and secure handling.\n\n## Data Classification\n\n| Data Type | Classification | Retention | Handling |\n|-----------|---------------|-----------|----------|\n| Email addresses | PII | 2 years | Encrypted at rest |\n| Phone numbers | PII | 2 years | Encrypted at rest |\n| Names | PII | 2 years | Standard |\n| Job titles | Business | 5 years | Standard |\n| Company info | Business | 5 years | Standard |\n| Engagement data | Analytics | 1 year | Aggregated |\n\n## GDPR Compliance\n\n### Right to Access (Subject Access Request)\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Fgdpr\u002Faccess.service.ts\nimport { Contact } from '..\u002F..\u002Fmodels\u002Fcontact.model';\nimport { Engagement } from '..\u002F..\u002Fmodels\u002Fengagement.model';\n\ninterface SubjectAccessResponse {\n  personalData: {\n    contact: Partial\u003CContact>;\n    engagements: Partial\u003CEngagement>[];\n  };\n  processingPurposes: string[];\n  dataRetention: string;\n  dataSources: string[];\n}\n\nexport async function handleSubjectAccessRequest(\n  email: string\n): Promise\u003CSubjectAccessResponse> {\n  \u002F\u002F Find all data for this subject\n  const contact = await prisma.contact.findFirst({\n    where: { email },\n    select: {\n      id: true,\n      email: true,\n      name: true,\n      firstName: true,\n      lastName: true,\n      title: true,\n      phone: true,\n      linkedinUrl: true,\n      company: {\n        select: {\n          name: true,\n          domain: true,\n        },\n      },\n      createdAt: true,\n      updatedAt: true,\n    },\n  });\n\n  if (!contact) {\n    return {\n      personalData: { contact: {}, engagements: [] },\n      processingPurposes: [],\n      dataRetention: 'No data found',\n      dataSources: [],\n    };\n  }\n\n  const engagements = await prisma.engagement.findMany({\n    where: { contactId: contact.id },\n    select: {\n      type: true,\n      occurredAt: true,\n      sequenceId: true,\n    },\n  });\n\n  return {\n    personalData: {\n      contact,\n      engagements,\n    },\n    processingPurposes: [\n      'B2B sales outreach',\n      'Lead qualification',\n      'Marketing communications',\n    ],\n    dataRetention: '2 years from last activity',\n    dataSources: ['Apollo.io API', 'User-provided forms'],\n  };\n}\n```\n\n### Right to Erasure (Right to be Forgotten)\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Fgdpr\u002Ferasure.service.ts\ninterface ErasureResult {\n  success: boolean;\n  recordsDeleted: {\n    contacts: number;\n    engagements: number;\n    sequences: number;\n  };\n  apolloNotified: boolean;\n}\n\nexport async function handleErasureRequest(email: string): Promise\u003CErasureResult> {\n  const result: ErasureResult = {\n    success: false,\n    recordsDeleted: { contacts: 0, engagements: 0, sequences: 0 },\n    apolloNotified: false,\n  };\n\n  try {\n    \u002F\u002F Start transaction\n    await prisma.$transaction(async (tx) => {\n      \u002F\u002F Find contact\n      const contact = await tx.contact.findFirst({ where: { email } });\n      if (!contact) {\n        throw new Error('Contact not found');\n      }\n\n      \u002F\u002F Delete engagements\n      const deletedEngagements = await tx.engagement.deleteMany({\n        where: { contactId: contact.id },\n      });\n      result.recordsDeleted.engagements = deletedEngagements.count;\n\n      \u002F\u002F Remove from sequences\n      const deletedSequences = await tx.sequenceEnrollment.deleteMany({\n        where: { contactId: contact.id },\n      });\n      result.recordsDeleted.sequences = deletedSequences.count;\n\n      \u002F\u002F Delete contact\n      await tx.contact.delete({ where: { id: contact.id } });\n      result.recordsDeleted.contacts = 1;\n\n      \u002F\u002F Notify Apollo (if they support it)\n      try {\n        await notifyApolloOfDeletion(email);\n        result.apolloNotified = true;\n      } catch (e) {\n        console.warn('Could not notify Apollo of deletion', e);\n      }\n    });\n\n    result.success = true;\n\n    \u002F\u002F Log for audit\n    await auditLog.create({\n      type: 'GDPR_ERASURE',\n      subject: hashEmail(email), \u002F\u002F Don't store email in audit log\n      timestamp: new Date(),\n      recordsAffected: result.recordsDeleted,\n    });\n\n    return result;\n  } catch (error) {\n    console.error('Erasure request failed:', error);\n    throw error;\n  }\n}\n\nasync function notifyApolloOfDeletion(email: string): Promise\u003Cvoid> {\n  \u002F\u002F Apollo doesn't have a deletion API, but we can:\n  \u002F\u002F 1. Remove from all sequences\n  \u002F\u002F 2. Mark as do-not-contact\n  \u002F\u002F 3. Open support ticket for full removal\n\n  console.log(`Note: Contact Apollo support to fully delete ${email} from their system`);\n}\n```\n\n### Consent Management\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Fconsent\u002Fconsent.service.ts\nimport { z } from 'zod';\n\nconst ConsentSchema = z.object({\n  email: z.string().email(),\n  purposes: z.array(z.enum([\n    'sales_outreach',\n    'marketing_email',\n    'analytics',\n    'third_party_sharing',\n  ])),\n  timestamp: z.date(),\n  source: z.string(),\n  ipAddress: z.string().optional(),\n});\n\ntype Consent = z.infer\u003Ctypeof ConsentSchema>;\n\nexport async function recordConsent(consent: Consent): Promise\u003Cvoid> {\n  await prisma.consent.create({\n    data: {\n      email: consent.email,\n      purposes: consent.purposes,\n      grantedAt: consent.timestamp,\n      source: consent.source,\n      ipAddress: consent.ipAddress,\n    },\n  });\n}\n\nexport async function checkConsent(email: string, purpose: string): Promise\u003Cboolean> {\n  const consent = await prisma.consent.findFirst({\n    where: {\n      email,\n      purposes: { has: purpose },\n      revokedAt: null,\n    },\n    orderBy: { grantedAt: 'desc' },\n  });\n\n  return !!consent;\n}\n\nexport async function revokeConsent(email: string, purpose?: string): Promise\u003Cvoid> {\n  if (purpose) {\n    \u002F\u002F Revoke specific purpose\n    await prisma.consent.updateMany({\n      where: { email, purposes: { has: purpose } },\n      data: { revokedAt: new Date() },\n    });\n  } else {\n    \u002F\u002F Revoke all\n    await prisma.consent.updateMany({\n      where: { email },\n      data: { revokedAt: new Date() },\n    });\n  }\n}\n```\n\n## Data Retention\n\n```typescript\n\u002F\u002F src\u002Fjobs\u002Fdata-retention.job.ts\nimport { CronJob } from 'cron';\n\n\u002F\u002F Run daily at 2 AM\nconst retentionJob = new CronJob('0 2 * * *', async () => {\n  console.log('Starting data retention cleanup...');\n\n  const retentionPolicies = [\n    { table: 'contacts', field: 'lastActivityAt', maxAgeDays: 730 },\n    { table: 'engagements', field: 'occurredAt', maxAgeDays: 365 },\n    { table: 'auditLogs', field: 'createdAt', maxAgeDays: 2555 }, \u002F\u002F 7 years\n  ];\n\n  for (const policy of retentionPolicies) {\n    const cutoffDate = new Date();\n    cutoffDate.setDate(cutoffDate.getDate() - policy.maxAgeDays);\n\n    const deleted = await prisma[policy.table].deleteMany({\n      where: {\n        [policy.field]: { lt: cutoffDate },\n      },\n    });\n\n    console.log(`Deleted ${deleted.count} records from ${policy.table}`);\n  }\n\n  \u002F\u002F Archive before deletion for compliance\n  await archiveOldData();\n});\n\nasync function archiveOldData(): Promise\u003Cvoid> {\n  const archiveCutoff = new Date();\n  archiveCutoff.setDate(archiveCutoff.getDate() - 365);\n\n  \u002F\u002F Export to cold storage before deletion\n  const oldContacts = await prisma.contact.findMany({\n    where: { lastActivityAt: { lt: archiveCutoff } },\n  });\n\n  if (oldContacts.length > 0) {\n    await uploadToArchive('contacts', oldContacts);\n  }\n}\n```\n\n## Data Export\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Fexport\u002Fexport.service.ts\nimport { stringify } from 'csv-stringify\u002Fsync';\nimport { createWriteStream } from 'fs';\nimport archiver from 'archiver';\n\ninterface ExportOptions {\n  format: 'csv' | 'json';\n  includeEngagements: boolean;\n  dateRange?: { start: Date; end: Date };\n}\n\nexport async function exportContactData(\n  criteria: any,\n  options: ExportOptions\n): Promise\u003Cstring> {\n  const contacts = await prisma.contact.findMany({\n    where: {\n      ...criteria,\n      ...(options.dateRange && {\n        createdAt: {\n          gte: options.dateRange.start,\n          lte: options.dateRange.end,\n        },\n      }),\n    },\n    include: options.includeEngagements ? { engagements: true } : undefined,\n  });\n\n  const filename = `apollo-export-${Date.now()}`;\n\n  if (options.format === 'csv') {\n    const csv = stringify(contacts, {\n      header: true,\n      columns: ['id', 'email', 'name', 'title', 'company', 'createdAt'],\n    });\n    await writeFile(`exports\u002F${filename}.csv`, csv);\n    return `${filename}.csv`;\n  } else {\n    await writeFile(`exports\u002F${filename}.json`, JSON.stringify(contacts, null, 2));\n    return `${filename}.json`;\n  }\n}\n\nexport async function createSecureExport(\n  contacts: any[],\n  encryptionKey: string\n): Promise\u003CBuffer> {\n  const data = JSON.stringify(contacts);\n  const encrypted = await encrypt(data, encryptionKey);\n  return encrypted;\n}\n```\n\n## Data Encryption\n\n```typescript\n\u002F\u002F src\u002Flib\u002Fencryption.ts\nimport crypto from 'crypto';\n\nconst ALGORITHM = 'aes-256-gcm';\nconst IV_LENGTH = 16;\nconst AUTH_TAG_LENGTH = 16;\n\nexport function encryptPII(plaintext: string, key: Buffer): string {\n  const iv = crypto.randomBytes(IV_LENGTH);\n  const cipher = crypto.createCipheriv(ALGORITHM, key, iv);\n\n  let encrypted = cipher.update(plaintext, 'utf8', 'hex');\n  encrypted += cipher.final('hex');\n\n  const authTag = cipher.getAuthTag();\n\n  \u002F\u002F Format: iv:authTag:ciphertext\n  return `${iv.toString('hex')}:${authTag.toString('hex')}:${encrypted}`;\n}\n\nexport function decryptPII(encrypted: string, key: Buffer): string {\n  const [ivHex, authTagHex, ciphertext] = encrypted.split(':');\n\n  const iv = Buffer.from(ivHex, 'hex');\n  const authTag = Buffer.from(authTagHex, 'hex');\n\n  const decipher = crypto.createDecipheriv(ALGORITHM, key, iv);\n  decipher.setAuthTag(authTag);\n\n  let decrypted = decipher.update(ciphertext, 'hex', 'utf8');\n  decrypted += decipher.final('utf8');\n\n  return decrypted;\n}\n\n\u002F\u002F Column-level encryption for Prisma\nexport const encryptedFields = {\n  email: {\n    encrypt: (value: string) => encryptPII(value, getEncryptionKey()),\n    decrypt: (value: string) => decryptPII(value, getEncryptionKey()),\n  },\n  phone: {\n    encrypt: (value: string) => encryptPII(value, getEncryptionKey()),\n    decrypt: (value: string) => decryptPII(value, getEncryptionKey()),\n  },\n};\n```\n\n## Audit Logging\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Faudit\u002Faudit.service.ts\ninterface AuditEntry {\n  action: string;\n  actor: string;\n  resource: string;\n  resourceId: string;\n  changes?: Record\u003Cstring, { old: any; new: any }>;\n  metadata?: Record\u003Cstring, any>;\n  timestamp: Date;\n}\n\nexport async function logDataAccess(entry: AuditEntry): Promise\u003Cvoid> {\n  await prisma.auditLog.create({\n    data: {\n      action: entry.action,\n      actor: entry.actor,\n      resource: entry.resource,\n      resourceId: entry.resourceId,\n      changes: entry.changes ? JSON.stringify(entry.changes) : null,\n      metadata: entry.metadata ? JSON.stringify(entry.metadata) : null,\n      occurredAt: entry.timestamp,\n    },\n  });\n}\n\n\u002F\u002F Middleware to audit all data access\nexport function auditMiddleware(req: any, res: any, next: any) {\n  const originalSend = res.send;\n\n  res.send = function(body: any) {\n    \u002F\u002F Log data access\n    if (req.path.includes('\u002Fapollo\u002F') && req.method === 'GET') {\n      logDataAccess({\n        action: 'DATA_ACCESS',\n        actor: req.user?.id || 'anonymous',\n        resource: 'apollo_contact',\n        resourceId: req.params.id || 'bulk',\n        metadata: {\n          path: req.path,\n          query: req.query,\n          responseSize: body?.length,\n        },\n        timestamp: new Date(),\n      });\n    }\n\n    return originalSend.call(this, body);\n  };\n\n  next();\n}\n```\n\n## Output\n- GDPR compliance (access, erasure, consent)\n- Data retention policies\n- Secure data export\n- Column-level encryption\n- Comprehensive audit logging\n\n## Error Handling\n| Issue | Resolution |\n|-------|------------|\n| Export too large | Implement streaming |\n| Encryption key lost | Use key management service |\n| Audit log gaps | Implement retry queue |\n| Consent conflicts | Use latest consent record |\n\n## Resources\n- [GDPR Official Text](https:\u002F\u002Fgdpr.eu\u002F)\n- [CCPA Requirements](https:\u002F\u002Foag.ca.gov\u002Fprivacy\u002Fccpa)\n- [Apollo Privacy Policy](https:\u002F\u002Fwww.apollo.io\u002Fprivacy-policy)\n\n## Next Steps\nProceed to `apollo-enterprise-rbac` for access control.\n",{"name":5,"author":56,"license":15,"version":57,"description":58,"allowed-tools":59},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Apollo.io data management and compliance.\nUse when handling contact data, implementing GDPR compliance,\nor managing data exports and retention.\nTrigger with phrases like \"apollo data\", \"apollo gdpr\", \"apollo compliance\",\n\"apollo data export\", \"apollo data retention\", \"apollo pii\".\n","Read, Write, Edit, Bash(kubectl:*), Bash(curl:*)","main","7439377908fdee98c9bb5863391212b95453de95","tests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fapollo-pack\u002Fskills\u002Fapollo-data-handling",233,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust","https:\u002F\u002Fgithub.com\u002FDicklesworthstone","https:\u002F\u002Fwww.jeffreyemanuel.com\u002F","Building in NY","2026-11-15 01:54:15",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add Dicklesworthstone\u002Fpi_agent_rust --skill apollo-data-handling",{"tool":75,"command":76},"bunx","bunx skills add Dicklesworthstone\u002Fpi_agent_rust --skill apollo-data-handling",{"tool":78,"command":79},"pnpm","pnpm dlx skills add Dicklesworthstone\u002Fpi_agent_rust --skill apollo-data-handling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fapollo-pack\u002Fskills\u002Fapollo-data-handling\u002FSKILL.md",true,[83,88,94],{"path":84,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"LICENSE","许可证",1071,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fdanthamanvoiss-salesportl-pool-cleaning-skill-handoff-protocol\u002FLICENSE",{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"SOURCE.md","REFERENCE","参考文档",500,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fdanthamanvoiss-salesportl-pool-cleaning-skill-handoff-protocol\u002FSOURCE.md",{"path":95,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":96,"sourceHtmlUrl":97},"TRUST.auto.yaml",2217,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fdanthamanvoiss-salesportl-pool-cleaning-skill-handoff-protocol\u002FTRUST.auto.yaml",[99,132,167,190,215,242],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":103,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":112,"publishedAt":131},"01M6FCR7G5A005P364Z6ZWCJDP","theme-factory","Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\u002Ffonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FSKILL.md",[107],{"categoryNo":108,"categoryName":109,"taxonomyType":110,"taxonomyTypeDesc":111},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",[113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,34,129,130],"theme factory","factory","theme","docs","toolkit","generate","artifacts","SET","fly","slides","landing","html","styling","artifact","pages","themes","you","fonts","2026-11-11 15:11:14",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":103,"licenseFileUrl":136,"sourceHtmlUrl":137,"categories":138,"keywords":142,"publishedAt":51},"01M6FEGPPK0ZTKCCM0R3E3KS33","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[139],{"categoryNo":140,"categoryName":141,"taxonomyType":110,"taxonomyTypeDesc":111},"01JBSEEDCAT000000000000009","前端开发",[143,144,119,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,41,124,160,161,162,163,164,165,166],"web artifacts builder","web","artifacts builder","builder","frontend","css","components","react","component","routing","state management","state","shadcn","file","ui","Tools","Tailwind","single-file","simple","ui components","multi","for","jsx","suite",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":103,"licenseFileUrl":171,"sourceHtmlUrl":172,"categories":173,"keywords":178,"publishedAt":51},"01M6FEE9VTK1W4GY21AKREJXRG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[174,177],{"categoryNo":175,"categoryName":176,"taxonomyType":110,"taxonomyTypeDesc":111},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":140,"categoryName":141,"taxonomyType":110,"taxonomyTypeDesc":111},[179,180,181,147,182,183,144,184,117,185,157,186,187,188,189,34,164],"testing","webapp testing","webapp","screenshots","playwright","debugging","browser","logs","applications","behavior","local",{"skillNo":191,"name":192,"nameZh":6,"description":193,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":194,"sourceHtmlUrl":195,"categories":196,"keywords":197,"publishedAt":51},"01M6FE20F7ZTQBFWKF4MPJ2SBX","neuropixels-analysis","Neuropixels neural recording analysis. Load SpikeGLX\u002FOpenEphys data, preprocess, motion correction, Kilosort4 spike sorting, quality metrics, Allen\u002FIBL curation, AI-assisted visual analysis, for Neuropixels 1.0\u002F2.0 extracellular electrophysiology. Use when working with neural recordings, spike sorting, extracellular electrophysiology, or when the user mentions Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, or unit curation.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FSKILL.md",[],[198,199,200,201,27,202,203,204,41,205,206,207,208,209,210,211,34,212,213,214,164,31],"analysis","neuropixels analysis","spike","metrics","open","quality","user","recordings","Neural","motion","visual","quality metrics","unit","sorting","curation","recording","load",{"skillNo":216,"name":217,"nameZh":6,"description":218,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":103,"licenseFileUrl":219,"sourceHtmlUrl":220,"categories":221,"keywords":225,"publishedAt":51},"01M6FDP0PDK6F1GGX395C7625Z","skill-creator","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FSKILL.md",[222],{"categoryNo":223,"categoryName":224,"taxonomyType":110,"taxonomyTypeDesc":111},"01JBSEEDCAT000000000000023","Skill与智能体开发",[226,227,228,229,230,231,232,233,234,235,236,237,238,239,34,164,240,31,241],"skill creator","creator","workflows","create","update","capabilities","knowledge","tool","integrations","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":243,"name":244,"nameZh":6,"description":245,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":246,"sourceHtmlUrl":247,"categories":248,"keywords":250,"publishedAt":51},"01M6FDM8Y7VK7NYG9SM7QPA3PW","notebooklm","Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FSKILL.md",[249],{"categoryNo":223,"categoryName":224,"taxonomyType":110,"taxonomyTypeDesc":111},[244,251,252,253,254,255,256,185,257,42,41,258,259,260,261,164,262],"google","browser automation","gemini","automation","auth","code","library","only","document","query","Citation","source"]