[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CHCNS6GPJ1H74DCEPKB6V7":3,"skill-same:01M6CHCNS6GPJ1H74DCEPKB6V7":83},{"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":18,"publishedAt":45,"linkOnly":46,"markdownContent":47,"markdownBody":48,"frontMatter":49,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":6,"ownerHtmlUrl":59,"ownerBlogUrl":60,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M6CHCNS6GPJ1H74DCEPKB6V7","apollo-reference-architecture",null,"Implement Apollo.io reference architecture.\nUse when designing Apollo integrations, establishing patterns,\nor building production-grade sales intelligence systems.\nTrigger with phrases like \"apollo architecture\", \"apollo system design\",\n\"apollo integration patterns\", \"apollo best practices architecture\".","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-reference-architecture\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],"architecture","apollo reference architecture","apollo","reference","edit","when","sales intelligence","trigger","io","intelligence","patterns","system design","use","sales","design","write","read","curl","gh","integrations","system","Bash","Production","integration","best practices","implement","2026-11-10 10:12:30",false,"---\nname: apollo-reference-architecture\ndescription: |\n  Implement Apollo.io reference architecture.\n  Use when designing Apollo integrations, establishing patterns,\n  or building production-grade sales intelligence systems.\n  Trigger with phrases like \"apollo architecture\", \"apollo system design\",\n  \"apollo integration patterns\", \"apollo best practices architecture\".\nallowed-tools: Read, Write, Edit, Bash(gh:*), Bash(curl:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\n---\n\n# Apollo Reference Architecture\n\n## Overview\nProduction-ready reference architecture for Apollo.io integrations covering system design, data flows, and integration patterns.\n\n## Architecture Diagram\n\n```\n+------------------+     +------------------+     +------------------+\n|   Frontend       |     |   API Gateway    |     |   Apollo API     |\n|   (React\u002FVue)    |---->|   (Express)      |---->|   (External)     |\n+------------------+     +------------------+     +------------------+\n                                |                        |\n                                v                        |\n                    +------------------+                 |\n                    |   Apollo Service |\u003C----------------+\n                    |   (Business Logic)|\n                    +------------------+\n                          |    |    |\n            +-------------+    |    +-------------+\n            v                  v                  v\n    +------------+     +------------+     +------------+\n    |   Cache    |     |  Database  |     |   Queue    |\n    |   (Redis)  |     | (Postgres) |     |   (Bull)   |\n    +------------+     +------------+     +------------+\n```\n\n## Project Structure\n\n```\nsrc\u002F\n├── lib\u002F\n│   └── apollo\u002F\n│       ├── client.ts          # Apollo API client\n│       ├── cache.ts           # Caching layer\n│       ├── rate-limiter.ts    # Rate limiting\n│       ├── errors.ts          # Custom errors\n│       └── types.ts           # TypeScript types\n├── services\u002F\n│   └── apollo\u002F\n│       ├── search.service.ts  # People\u002Forg search\n│       ├── enrich.service.ts  # Enrichment logic\n│       ├── sequence.service.ts # Email sequences\n│       └── sync.service.ts    # Data synchronization\n├── jobs\u002F\n│   └── apollo\u002F\n│       ├── enrich.job.ts      # Background enrichment\n│       ├── sync.job.ts        # Periodic sync\n│       └── cleanup.job.ts     # Cache cleanup\n├── routes\u002F\n│   └── api\u002F\n│       └── apollo\u002F\n│           ├── search.ts      # Search endpoints\n│           ├── enrich.ts      # Enrichment endpoints\n│           └── webhooks.ts    # Webhook handlers\n├── models\u002F\n│   ├── contact.model.ts       # Contact entity\n│   ├── company.model.ts       # Company entity\n│   └── engagement.model.ts    # Email engagement\n└── config\u002F\n    └── apollo.config.ts       # Apollo configuration\n```\n\n## Core Components\n\n### 1. Apollo Service Layer\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Fapollo\u002Fapollo.service.ts\nimport { Injectable } from '@nestjs\u002Fcommon';\nimport { InjectRepository } from '@nestjs\u002Ftypeorm';\nimport { Repository } from 'typeorm';\nimport { ApolloClient } from '..\u002F..\u002Flib\u002Fapollo\u002Fclient';\nimport { ApolloCache } from '..\u002F..\u002Flib\u002Fapollo\u002Fcache';\nimport { Contact } from '..\u002F..\u002Fmodels\u002Fcontact.model';\nimport { Company } from '..\u002F..\u002Fmodels\u002Fcompany.model';\n\n@Injectable()\nexport class ApolloService {\n  constructor(\n    private readonly client: ApolloClient,\n    private readonly cache: ApolloCache,\n    @InjectRepository(Contact)\n    private readonly contactRepo: Repository\u003CContact>,\n    @InjectRepository(Company)\n    private readonly companyRepo: Repository\u003CCompany>,\n  ) {}\n\n  async searchAndEnrich(criteria: SearchCriteria): Promise\u003CEnrichedLead[]> {\n    \u002F\u002F 1. Search Apollo\n    const searchResults = await this.client.searchPeople(criteria);\n\n    \u002F\u002F 2. Filter and score\n    const qualified = this.qualifyLeads(searchResults.people, criteria);\n\n    \u002F\u002F 3. Enrich top leads\n    const enriched = await Promise.all(\n      qualified.slice(0, 25).map(lead => this.enrichLead(lead))\n    );\n\n    \u002F\u002F 4. Persist to database\n    await this.persistLeads(enriched);\n\n    return enriched;\n  }\n\n  private async enrichLead(lead: RawLead): Promise\u003CEnrichedLead> {\n    \u002F\u002F Check cache\n    const cached = await this.cache.get(`lead:${lead.id}`);\n    if (cached) return cached;\n\n    \u002F\u002F Enrich from Apollo\n    const [personData, companyData] = await Promise.all([\n      this.client.enrichPerson({ id: lead.id }),\n      lead.organization?.primary_domain\n        ? this.client.enrichOrganization(lead.organization.primary_domain)\n        : null,\n    ]);\n\n    const enriched = this.mergeData(lead, personData, companyData);\n\n    \u002F\u002F Cache result\n    await this.cache.set(`lead:${lead.id}`, enriched, 86400); \u002F\u002F 24h\n\n    return enriched;\n  }\n\n  private async persistLeads(leads: EnrichedLead[]): Promise\u003Cvoid> {\n    for (const lead of leads) {\n      \u002F\u002F Upsert contact\n      await this.contactRepo.upsert({\n        apolloId: lead.id,\n        email: lead.email,\n        name: lead.name,\n        title: lead.title,\n        linkedinUrl: lead.linkedinUrl,\n        companyId: lead.company?.id,\n        enrichedAt: new Date(),\n      }, ['apolloId']);\n\n      \u002F\u002F Upsert company\n      if (lead.company) {\n        await this.companyRepo.upsert({\n          apolloId: lead.company.id,\n          name: lead.company.name,\n          domain: lead.company.domain,\n          industry: lead.company.industry,\n          employeeCount: lead.company.employeeCount,\n          enrichedAt: new Date(),\n        }, ['apolloId']);\n      }\n    }\n  }\n}\n```\n\n### 2. Background Job Processing\n\n```typescript\n\u002F\u002F src\u002Fjobs\u002Fapollo\u002Fenrich.job.ts\nimport { Job, Queue } from 'bull';\nimport { Process, Processor } from '@nestjs\u002Fbull';\nimport { ApolloService } from '..\u002F..\u002Fservices\u002Fapollo\u002Fapollo.service';\n\ninterface EnrichJobData {\n  contactIds: string[];\n  priority: 'high' | 'normal' | 'low';\n}\n\n@Processor('apollo-enrich')\nexport class EnrichProcessor {\n  constructor(private readonly apolloService: ApolloService) {}\n\n  @Process('enrich-contacts')\n  async handleEnrich(job: Job\u003CEnrichJobData>): Promise\u003Cvoid> {\n    const { contactIds, priority } = job.data;\n\n    \u002F\u002F Process in batches to respect rate limits\n    const batchSize = priority === 'high' ? 10 : 5;\n\n    for (let i = 0; i \u003C contactIds.length; i += batchSize) {\n      const batch = contactIds.slice(i, i + batchSize);\n\n      await Promise.all(\n        batch.map(id => this.apolloService.enrichContact(id))\n      );\n\n      \u002F\u002F Update progress\n      await job.progress(((i + batchSize) \u002F contactIds.length) * 100);\n\n      \u002F\u002F Rate limit delay\n      if (i + batchSize \u003C contactIds.length) {\n        await new Promise(r => setTimeout(r, 1000));\n      }\n    }\n  }\n}\n\n\u002F\u002F Queue producer\n@Injectable()\nexport class EnrichQueue {\n  constructor(@InjectQueue('apollo-enrich') private queue: Queue) {}\n\n  async enqueueContacts(contactIds: string[], priority: 'high' | 'normal' | 'low' = 'normal') {\n    await this.queue.add('enrich-contacts', {\n      contactIds,\n      priority,\n    }, {\n      priority: priority === 'high' ? 1 : priority === 'normal' ? 5 : 10,\n      attempts: 3,\n      backoff: {\n        type: 'exponential',\n        delay: 5000,\n      },\n    });\n  }\n}\n```\n\n### 3. Data Models\n\n```typescript\n\u002F\u002F src\u002Fmodels\u002Fcontact.model.ts\nimport { Entity, Column, PrimaryGeneratedColumn, ManyToOne, Index } from 'typeorm';\nimport { Company } from '.\u002Fcompany.model';\n\n@Entity('contacts')\nexport class Contact {\n  @PrimaryGeneratedColumn('uuid')\n  id: string;\n\n  @Index({ unique: true })\n  @Column()\n  apolloId: string;\n\n  @Index()\n  @Column({ nullable: true })\n  email: string;\n\n  @Column()\n  name: string;\n\n  @Column({ nullable: true })\n  firstName: string;\n\n  @Column({ nullable: true })\n  lastName: string;\n\n  @Column({ nullable: true })\n  title: string;\n\n  @Column({ nullable: true })\n  seniority: string;\n\n  @Column({ nullable: true })\n  linkedinUrl: string;\n\n  @Column({ nullable: true })\n  phone: string;\n\n  @Column({ type: 'jsonb', nullable: true })\n  customFields: Record\u003Cstring, any>;\n\n  @ManyToOne(() => Company, company => company.contacts)\n  company: Company;\n\n  @Column()\n  companyId: string;\n\n  @Column({ type: 'timestamp' })\n  enrichedAt: Date;\n\n  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })\n  createdAt: Date;\n\n  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })\n  updatedAt: Date;\n}\n\n\u002F\u002F src\u002Fmodels\u002Fcompany.model.ts\n@Entity('companies')\nexport class Company {\n  @PrimaryGeneratedColumn('uuid')\n  id: string;\n\n  @Index({ unique: true })\n  @Column()\n  apolloId: string;\n\n  @Column()\n  name: string;\n\n  @Index()\n  @Column()\n  domain: string;\n\n  @Column({ nullable: true })\n  industry: string;\n\n  @Column({ nullable: true })\n  subIndustry: string;\n\n  @Column({ nullable: true })\n  employeeCount: number;\n\n  @Column({ nullable: true })\n  annualRevenue: number;\n\n  @Column({ nullable: true })\n  foundedYear: number;\n\n  @Column({ type: 'text', nullable: true })\n  description: string;\n\n  @Column({ type: 'jsonb', nullable: true })\n  technologies: string[];\n\n  @Column({ type: 'jsonb', nullable: true })\n  location: {\n    city: string;\n    state: string;\n    country: string;\n  };\n\n  @OneToMany(() => Contact, contact => contact.company)\n  contacts: Contact[];\n}\n```\n\n### 4. API Routes\n\n```typescript\n\u002F\u002F src\u002Froutes\u002Fapi\u002Fapollo\u002Fsearch.ts\nimport { Router } from 'express';\nimport { ApolloService } from '..\u002F..\u002F..\u002Fservices\u002Fapollo\u002Fapollo.service';\nimport { validateRequest } from '..\u002F..\u002F..\u002Fmiddleware\u002Fvalidation';\n\nconst router = Router();\n\nrouter.post('\u002Fsearch', validateRequest(SearchSchema), async (req, res) => {\n  const { domains, titles, locations, minEmployees, maxEmployees } = req.body;\n\n  const results = await apolloService.searchAndEnrich({\n    domains,\n    titles,\n    locations,\n    minEmployees,\n    maxEmployees,\n  });\n\n  res.json({\n    success: true,\n    data: results,\n    meta: {\n      count: results.length,\n      timestamp: new Date().toISOString(),\n    },\n  });\n});\n\nrouter.post('\u002Fenrich\u002Fbulk', validateRequest(BulkEnrichSchema), async (req, res) => {\n  const { contactIds, priority } = req.body;\n\n  \u002F\u002F Queue for background processing\n  await enrichQueue.enqueueContacts(contactIds, priority);\n\n  res.json({\n    success: true,\n    message: `Queued ${contactIds.length} contacts for enrichment`,\n    jobId: 'job-id-here',\n  });\n});\n\nexport default router;\n```\n\n## Integration Patterns\n\n### CRM Integration (Salesforce)\n\n```typescript\n\u002F\u002F src\u002Fintegrations\u002Fsalesforce.ts\nexport class SalesforceIntegration {\n  async syncContact(contact: Contact): Promise\u003Cvoid> {\n    const sfContact = await this.salesforce.sobject('Contact').upsert({\n      Email: contact.email,\n      FirstName: contact.firstName,\n      LastName: contact.lastName,\n      Title: contact.title,\n      Apollo_ID__c: contact.apolloId,\n      LinkedIn_URL__c: contact.linkedinUrl,\n    }, 'Email');\n\n    console.log(`Synced contact ${contact.email} to Salesforce`);\n  }\n\n  async syncCompany(company: Company): Promise\u003Cvoid> {\n    const sfAccount = await this.salesforce.sobject('Account').upsert({\n      Name: company.name,\n      Website: `https:\u002F\u002F${company.domain}`,\n      Industry: company.industry,\n      NumberOfEmployees: company.employeeCount,\n      Apollo_ID__c: company.apolloId,\n    }, 'Website');\n  }\n}\n```\n\n### Event-Driven Architecture\n\n```typescript\n\u002F\u002F src\u002Fevents\u002Fapollo.events.ts\nexport const APOLLO_EVENTS = {\n  CONTACT_ENRICHED: 'apollo.contact.enriched',\n  COMPANY_ENRICHED: 'apollo.company.enriched',\n  SEARCH_COMPLETED: 'apollo.search.completed',\n  SEQUENCE_STARTED: 'apollo.sequence.started',\n  EMAIL_ENGAGEMENT: 'apollo.email.engagement',\n};\n\n\u002F\u002F Event handlers\neventBus.on(APOLLO_EVENTS.CONTACT_ENRICHED, async (contact) => {\n  \u002F\u002F Sync to CRM\n  await salesforceIntegration.syncContact(contact);\n\n  \u002F\u002F Update search index\n  await searchIndex.indexContact(contact);\n\n  \u002F\u002F Notify relevant teams\n  if (contact.score >= 80) {\n    await slackNotifier.sendHighValueLead(contact);\n  }\n});\n```\n\n## Output\n- Layered architecture (client, service, job, model)\n- Background job processing with Bull\n- Database models with TypeORM\n- RESTful API endpoints\n- CRM integration patterns\n- Event-driven architecture\n\n## Error Handling\n| Layer | Strategy |\n|-------|----------|\n| Client | Retry with backoff |\n| Service | Graceful degradation |\n| Jobs | Dead letter queue |\n| API | Structured error responses |\n\n## Resources\n- [NestJS Documentation](https:\u002F\u002Fdocs.nestjs.com\u002F)\n- [Bull Queue](https:\u002F\u002Fgithub.com\u002FOptimalBits\u002Fbull)\n- [TypeORM](https:\u002F\u002Ftypeorm.io\u002F)\n- [Event Sourcing Patterns](https:\u002F\u002Fmartinfowler.com\u002FeaaDev\u002FEventSourcing.html)\n\n## Next Steps\nProceed to `apollo-multi-env-setup` for environment configuration.\n","# Apollo Reference Architecture\n\n## Overview\nProduction-ready reference architecture for Apollo.io integrations covering system design, data flows, and integration patterns.\n\n## Architecture Diagram\n\n```\n+------------------+     +------------------+     +------------------+\n|   Frontend       |     |   API Gateway    |     |   Apollo API     |\n|   (React\u002FVue)    |---->|   (Express)      |---->|   (External)     |\n+------------------+     +------------------+     +------------------+\n                                |                        |\n                                v                        |\n                    +------------------+                 |\n                    |   Apollo Service |\u003C----------------+\n                    |   (Business Logic)|\n                    +------------------+\n                          |    |    |\n            +-------------+    |    +-------------+\n            v                  v                  v\n    +------------+     +------------+     +------------+\n    |   Cache    |     |  Database  |     |   Queue    |\n    |   (Redis)  |     | (Postgres) |     |   (Bull)   |\n    +------------+     +------------+     +------------+\n```\n\n## Project Structure\n\n```\nsrc\u002F\n├── lib\u002F\n│   └── apollo\u002F\n│       ├── client.ts          # Apollo API client\n│       ├── cache.ts           # Caching layer\n│       ├── rate-limiter.ts    # Rate limiting\n│       ├── errors.ts          # Custom errors\n│       └── types.ts           # TypeScript types\n├── services\u002F\n│   └── apollo\u002F\n│       ├── search.service.ts  # People\u002Forg search\n│       ├── enrich.service.ts  # Enrichment logic\n│       ├── sequence.service.ts # Email sequences\n│       └── sync.service.ts    # Data synchronization\n├── jobs\u002F\n│   └── apollo\u002F\n│       ├── enrich.job.ts      # Background enrichment\n│       ├── sync.job.ts        # Periodic sync\n│       └── cleanup.job.ts     # Cache cleanup\n├── routes\u002F\n│   └── api\u002F\n│       └── apollo\u002F\n│           ├── search.ts      # Search endpoints\n│           ├── enrich.ts      # Enrichment endpoints\n│           └── webhooks.ts    # Webhook handlers\n├── models\u002F\n│   ├── contact.model.ts       # Contact entity\n│   ├── company.model.ts       # Company entity\n│   └── engagement.model.ts    # Email engagement\n└── config\u002F\n    └── apollo.config.ts       # Apollo configuration\n```\n\n## Core Components\n\n### 1. Apollo Service Layer\n\n```typescript\n\u002F\u002F src\u002Fservices\u002Fapollo\u002Fapollo.service.ts\nimport { Injectable } from '@nestjs\u002Fcommon';\nimport { InjectRepository } from '@nestjs\u002Ftypeorm';\nimport { Repository } from 'typeorm';\nimport { ApolloClient } from '..\u002F..\u002Flib\u002Fapollo\u002Fclient';\nimport { ApolloCache } from '..\u002F..\u002Flib\u002Fapollo\u002Fcache';\nimport { Contact } from '..\u002F..\u002Fmodels\u002Fcontact.model';\nimport { Company } from '..\u002F..\u002Fmodels\u002Fcompany.model';\n\n@Injectable()\nexport class ApolloService {\n  constructor(\n    private readonly client: ApolloClient,\n    private readonly cache: ApolloCache,\n    @InjectRepository(Contact)\n    private readonly contactRepo: Repository\u003CContact>,\n    @InjectRepository(Company)\n    private readonly companyRepo: Repository\u003CCompany>,\n  ) {}\n\n  async searchAndEnrich(criteria: SearchCriteria): Promise\u003CEnrichedLead[]> {\n    \u002F\u002F 1. Search Apollo\n    const searchResults = await this.client.searchPeople(criteria);\n\n    \u002F\u002F 2. Filter and score\n    const qualified = this.qualifyLeads(searchResults.people, criteria);\n\n    \u002F\u002F 3. Enrich top leads\n    const enriched = await Promise.all(\n      qualified.slice(0, 25).map(lead => this.enrichLead(lead))\n    );\n\n    \u002F\u002F 4. Persist to database\n    await this.persistLeads(enriched);\n\n    return enriched;\n  }\n\n  private async enrichLead(lead: RawLead): Promise\u003CEnrichedLead> {\n    \u002F\u002F Check cache\n    const cached = await this.cache.get(`lead:${lead.id}`);\n    if (cached) return cached;\n\n    \u002F\u002F Enrich from Apollo\n    const [personData, companyData] = await Promise.all([\n      this.client.enrichPerson({ id: lead.id }),\n      lead.organization?.primary_domain\n        ? this.client.enrichOrganization(lead.organization.primary_domain)\n        : null,\n    ]);\n\n    const enriched = this.mergeData(lead, personData, companyData);\n\n    \u002F\u002F Cache result\n    await this.cache.set(`lead:${lead.id}`, enriched, 86400); \u002F\u002F 24h\n\n    return enriched;\n  }\n\n  private async persistLeads(leads: EnrichedLead[]): Promise\u003Cvoid> {\n    for (const lead of leads) {\n      \u002F\u002F Upsert contact\n      await this.contactRepo.upsert({\n        apolloId: lead.id,\n        email: lead.email,\n        name: lead.name,\n        title: lead.title,\n        linkedinUrl: lead.linkedinUrl,\n        companyId: lead.company?.id,\n        enrichedAt: new Date(),\n      }, ['apolloId']);\n\n      \u002F\u002F Upsert company\n      if (lead.company) {\n        await this.companyRepo.upsert({\n          apolloId: lead.company.id,\n          name: lead.company.name,\n          domain: lead.company.domain,\n          industry: lead.company.industry,\n          employeeCount: lead.company.employeeCount,\n          enrichedAt: new Date(),\n        }, ['apolloId']);\n      }\n    }\n  }\n}\n```\n\n### 2. Background Job Processing\n\n```typescript\n\u002F\u002F src\u002Fjobs\u002Fapollo\u002Fenrich.job.ts\nimport { Job, Queue } from 'bull';\nimport { Process, Processor } from '@nestjs\u002Fbull';\nimport { ApolloService } from '..\u002F..\u002Fservices\u002Fapollo\u002Fapollo.service';\n\ninterface EnrichJobData {\n  contactIds: string[];\n  priority: 'high' | 'normal' | 'low';\n}\n\n@Processor('apollo-enrich')\nexport class EnrichProcessor {\n  constructor(private readonly apolloService: ApolloService) {}\n\n  @Process('enrich-contacts')\n  async handleEnrich(job: Job\u003CEnrichJobData>): Promise\u003Cvoid> {\n    const { contactIds, priority } = job.data;\n\n    \u002F\u002F Process in batches to respect rate limits\n    const batchSize = priority === 'high' ? 10 : 5;\n\n    for (let i = 0; i \u003C contactIds.length; i += batchSize) {\n      const batch = contactIds.slice(i, i + batchSize);\n\n      await Promise.all(\n        batch.map(id => this.apolloService.enrichContact(id))\n      );\n\n      \u002F\u002F Update progress\n      await job.progress(((i + batchSize) \u002F contactIds.length) * 100);\n\n      \u002F\u002F Rate limit delay\n      if (i + batchSize \u003C contactIds.length) {\n        await new Promise(r => setTimeout(r, 1000));\n      }\n    }\n  }\n}\n\n\u002F\u002F Queue producer\n@Injectable()\nexport class EnrichQueue {\n  constructor(@InjectQueue('apollo-enrich') private queue: Queue) {}\n\n  async enqueueContacts(contactIds: string[], priority: 'high' | 'normal' | 'low' = 'normal') {\n    await this.queue.add('enrich-contacts', {\n      contactIds,\n      priority,\n    }, {\n      priority: priority === 'high' ? 1 : priority === 'normal' ? 5 : 10,\n      attempts: 3,\n      backoff: {\n        type: 'exponential',\n        delay: 5000,\n      },\n    });\n  }\n}\n```\n\n### 3. Data Models\n\n```typescript\n\u002F\u002F src\u002Fmodels\u002Fcontact.model.ts\nimport { Entity, Column, PrimaryGeneratedColumn, ManyToOne, Index } from 'typeorm';\nimport { Company } from '.\u002Fcompany.model';\n\n@Entity('contacts')\nexport class Contact {\n  @PrimaryGeneratedColumn('uuid')\n  id: string;\n\n  @Index({ unique: true })\n  @Column()\n  apolloId: string;\n\n  @Index()\n  @Column({ nullable: true })\n  email: string;\n\n  @Column()\n  name: string;\n\n  @Column({ nullable: true })\n  firstName: string;\n\n  @Column({ nullable: true })\n  lastName: string;\n\n  @Column({ nullable: true })\n  title: string;\n\n  @Column({ nullable: true })\n  seniority: string;\n\n  @Column({ nullable: true })\n  linkedinUrl: string;\n\n  @Column({ nullable: true })\n  phone: string;\n\n  @Column({ type: 'jsonb', nullable: true })\n  customFields: Record\u003Cstring, any>;\n\n  @ManyToOne(() => Company, company => company.contacts)\n  company: Company;\n\n  @Column()\n  companyId: string;\n\n  @Column({ type: 'timestamp' })\n  enrichedAt: Date;\n\n  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })\n  createdAt: Date;\n\n  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })\n  updatedAt: Date;\n}\n\n\u002F\u002F src\u002Fmodels\u002Fcompany.model.ts\n@Entity('companies')\nexport class Company {\n  @PrimaryGeneratedColumn('uuid')\n  id: string;\n\n  @Index({ unique: true })\n  @Column()\n  apolloId: string;\n\n  @Column()\n  name: string;\n\n  @Index()\n  @Column()\n  domain: string;\n\n  @Column({ nullable: true })\n  industry: string;\n\n  @Column({ nullable: true })\n  subIndustry: string;\n\n  @Column({ nullable: true })\n  employeeCount: number;\n\n  @Column({ nullable: true })\n  annualRevenue: number;\n\n  @Column({ nullable: true })\n  foundedYear: number;\n\n  @Column({ type: 'text', nullable: true })\n  description: string;\n\n  @Column({ type: 'jsonb', nullable: true })\n  technologies: string[];\n\n  @Column({ type: 'jsonb', nullable: true })\n  location: {\n    city: string;\n    state: string;\n    country: string;\n  };\n\n  @OneToMany(() => Contact, contact => contact.company)\n  contacts: Contact[];\n}\n```\n\n### 4. API Routes\n\n```typescript\n\u002F\u002F src\u002Froutes\u002Fapi\u002Fapollo\u002Fsearch.ts\nimport { Router } from 'express';\nimport { ApolloService } from '..\u002F..\u002F..\u002Fservices\u002Fapollo\u002Fapollo.service';\nimport { validateRequest } from '..\u002F..\u002F..\u002Fmiddleware\u002Fvalidation';\n\nconst router = Router();\n\nrouter.post('\u002Fsearch', validateRequest(SearchSchema), async (req, res) => {\n  const { domains, titles, locations, minEmployees, maxEmployees } = req.body;\n\n  const results = await apolloService.searchAndEnrich({\n    domains,\n    titles,\n    locations,\n    minEmployees,\n    maxEmployees,\n  });\n\n  res.json({\n    success: true,\n    data: results,\n    meta: {\n      count: results.length,\n      timestamp: new Date().toISOString(),\n    },\n  });\n});\n\nrouter.post('\u002Fenrich\u002Fbulk', validateRequest(BulkEnrichSchema), async (req, res) => {\n  const { contactIds, priority } = req.body;\n\n  \u002F\u002F Queue for background processing\n  await enrichQueue.enqueueContacts(contactIds, priority);\n\n  res.json({\n    success: true,\n    message: `Queued ${contactIds.length} contacts for enrichment`,\n    jobId: 'job-id-here',\n  });\n});\n\nexport default router;\n```\n\n## Integration Patterns\n\n### CRM Integration (Salesforce)\n\n```typescript\n\u002F\u002F src\u002Fintegrations\u002Fsalesforce.ts\nexport class SalesforceIntegration {\n  async syncContact(contact: Contact): Promise\u003Cvoid> {\n    const sfContact = await this.salesforce.sobject('Contact').upsert({\n      Email: contact.email,\n      FirstName: contact.firstName,\n      LastName: contact.lastName,\n      Title: contact.title,\n      Apollo_ID__c: contact.apolloId,\n      LinkedIn_URL__c: contact.linkedinUrl,\n    }, 'Email');\n\n    console.log(`Synced contact ${contact.email} to Salesforce`);\n  }\n\n  async syncCompany(company: Company): Promise\u003Cvoid> {\n    const sfAccount = await this.salesforce.sobject('Account').upsert({\n      Name: company.name,\n      Website: `https:\u002F\u002F${company.domain}`,\n      Industry: company.industry,\n      NumberOfEmployees: company.employeeCount,\n      Apollo_ID__c: company.apolloId,\n    }, 'Website');\n  }\n}\n```\n\n### Event-Driven Architecture\n\n```typescript\n\u002F\u002F src\u002Fevents\u002Fapollo.events.ts\nexport const APOLLO_EVENTS = {\n  CONTACT_ENRICHED: 'apollo.contact.enriched',\n  COMPANY_ENRICHED: 'apollo.company.enriched',\n  SEARCH_COMPLETED: 'apollo.search.completed',\n  SEQUENCE_STARTED: 'apollo.sequence.started',\n  EMAIL_ENGAGEMENT: 'apollo.email.engagement',\n};\n\n\u002F\u002F Event handlers\neventBus.on(APOLLO_EVENTS.CONTACT_ENRICHED, async (contact) => {\n  \u002F\u002F Sync to CRM\n  await salesforceIntegration.syncContact(contact);\n\n  \u002F\u002F Update search index\n  await searchIndex.indexContact(contact);\n\n  \u002F\u002F Notify relevant teams\n  if (contact.score >= 80) {\n    await slackNotifier.sendHighValueLead(contact);\n  }\n});\n```\n\n## Output\n- Layered architecture (client, service, job, model)\n- Background job processing with Bull\n- Database models with TypeORM\n- RESTful API endpoints\n- CRM integration patterns\n- Event-driven architecture\n\n## Error Handling\n| Layer | Strategy |\n|-------|----------|\n| Client | Retry with backoff |\n| Service | Graceful degradation |\n| Jobs | Dead letter queue |\n| API | Structured error responses |\n\n## Resources\n- [NestJS Documentation](https:\u002F\u002Fdocs.nestjs.com\u002F)\n- [Bull Queue](https:\u002F\u002Fgithub.com\u002FOptimalBits\u002Fbull)\n- [TypeORM](https:\u002F\u002Ftypeorm.io\u002F)\n- [Event Sourcing Patterns](https:\u002F\u002Fmartinfowler.com\u002FeaaDev\u002FEventSourcing.html)\n\n## Next Steps\nProceed to `apollo-multi-env-setup` for environment configuration.\n",{"name":5,"author":50,"license":15,"version":51,"description":52,"allowed-tools":53},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Implement Apollo.io reference architecture.\nUse when designing Apollo integrations, establishing patterns,\nor building production-grade sales intelligence systems.\nTrigger with phrases like \"apollo architecture\", \"apollo system design\",\n\"apollo integration patterns\", \"apollo best practices architecture\".\n","Read, Write, Edit, Bash(gh:*), Bash(curl:*)","main","7439377908fdee98c9bb5863391212b95453de95","tests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fapollo-pack\u002Fskills\u002Fapollo-reference-architecture",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":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add Dicklesworthstone\u002Fpi_agent_rust --skill apollo-reference-architecture",{"tool":69,"command":70},"bunx","bunx skills add Dicklesworthstone\u002Fpi_agent_rust --skill apollo-reference-architecture",{"tool":72,"command":73},"pnpm","pnpm dlx skills add Dicklesworthstone\u002Fpi_agent_rust --skill apollo-reference-architecture","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fapollo-pack\u002Fskills\u002Fapollo-reference-architecture\u002FSKILL.md",true,[77],{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Flayering-patterns.md","REFERENCE","参考文档",8648,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FHDeibler\u002Funiversal-design-principles\u002Fplugins\u002Finteraction-and-control-principles\u002Fskills\u002Fcontrol-power-vs-simplicity\u002Freferences\u002Flayering-patterns.md",[84,118,153,176,202,228],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":97,"publishedAt":117},"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",[92],{"categoryNo":93,"categoryName":94,"taxonomyType":95,"taxonomyTypeDesc":96},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",[98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116],"theme factory","factory","theme","docs","toolkit","generate","artifacts","SET","fly","slides","landing","html","styling","artifact","pages","themes","with","you","fonts","2026-11-11 15:11:14",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":122,"sourceHtmlUrl":123,"categories":124,"keywords":128,"publishedAt":45},"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",[125],{"categoryNo":126,"categoryName":127,"taxonomyType":95,"taxonomyTypeDesc":96},"01JBSEEDCAT000000000000009","前端开发",[129,130,104,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,31,109,146,147,148,149,150,151,152],"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":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":157,"sourceHtmlUrl":158,"categories":159,"keywords":164,"publishedAt":45},"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",[160,163],{"categoryNo":161,"categoryName":162,"taxonomyType":95,"taxonomyTypeDesc":96},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":126,"categoryName":127,"taxonomyType":95,"taxonomyTypeDesc":96},[165,166,167,133,168,169,130,170,102,171,143,172,173,174,175,114,150],"testing","webapp testing","webapp","screenshots","playwright","debugging","browser","logs","applications","behavior","local",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":180,"sourceHtmlUrl":181,"categories":182,"keywords":183,"publishedAt":45},"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",[],[184,185,186,187,188,189,190,191,31,192,193,194,195,196,197,198,114,199,200,201,150,24],"analysis","neuropixels analysis","spike","metrics","data","open","quality","user","recordings","Neural","motion","visual","quality metrics","unit","sorting","curation","recording","load",{"skillNo":203,"name":204,"nameZh":6,"description":205,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":88,"licenseFileUrl":206,"sourceHtmlUrl":207,"categories":208,"keywords":212,"publishedAt":45},"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",[209],{"categoryNo":210,"categoryName":211,"taxonomyType":95,"taxonomyTypeDesc":96},"01JBSEEDCAT000000000000023","Skill与智能体开发",[213,214,215,216,217,218,219,220,38,221,222,223,224,225,114,150,226,24,227],"skill creator","creator","workflows","create","update","capabilities","knowledge","tool","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":229,"name":230,"nameZh":6,"description":231,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":232,"sourceHtmlUrl":233,"categories":234,"keywords":236,"publishedAt":45},"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",[235],{"categoryNo":210,"categoryName":211,"taxonomyType":95,"taxonomyTypeDesc":96},[230,237,238,239,240,241,242,171,243,244,31,245,246,247,248,150,249],"google","browser automation","gemini","automation","auth","code","library","management","only","document","query","Citation","source"]