[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F654WTKR3H8VYF2MGK9846":3,"skill-same:01M6F654WTKR3H8VYF2MGK9846":76},{"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":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":53,"commitSha":54,"skillDirectory":55,"forksCount":56,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":59,"ownerDescription":60,"updatedAt":61,"install":62,"resources":75},"01M6F654WTKR3H8VYF2MGK9846","customerio-reference-architecture",null,"Implement Customer.io reference architecture.\nUse when designing integrations, planning architecture,\nor implementing enterprise patterns.\nTrigger with phrases like \"customer.io architecture\", \"customer.io design\",\n\"customer.io enterprise\", \"customer.io integration pattern\".","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\u002Fcustomerio-pack\u002Fskills\u002Fcustomerio-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],"architecture","customerio reference architecture","reference","write","when","implementing","enterprise patterns","with","trigger","io","pattern","patterns","use","edit","design","read","curl","gh","integrations","Bash","Enterprise","integration","planning","customer","implement","2026-11-10 10:12:30",false,"---\nname: customerio-reference-architecture\ndescription: |\n  Implement Customer.io reference architecture.\n  Use when designing integrations, planning architecture,\n  or implementing enterprise patterns.\n  Trigger with phrases like \"customer.io architecture\", \"customer.io design\",\n  \"customer.io enterprise\", \"customer.io integration pattern\".\nallowed-tools: Read, Write, Edit, Bash(gh:*), Bash(curl:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\n---\n\n# Customer.io Reference Architecture\n\n## Overview\nEnterprise-grade reference architecture for Customer.io integration with proper separation of concerns, reliability, and scalability.\n\n## Architecture Diagram\n\n```\n                                    Customer.io\n                                        |\n                    +-------------------+-------------------+\n                    |                   |                   |\n              Track API            App API            Webhooks\n                    |                   |                   |\n                    v                   v                   v\n            +-------+-------+   +-------+-------+   +-------+-------+\n            |   Event Bus   |   |  Transactional |   | Webhook Handler|\n            |   (Kafka)     |   |    Service     |   |   (Express)   |\n            +-------+-------+   +-------+-------+   +-------+-------+\n                    |                   |                   |\n                    v                   v                   v\n            +-------+-------+   +-------+-------+   +-------+-------+\n            | CustomerIO    |   |    Email       |   |   Event       |\n            | Worker        |   |    Templates   |   |   Processor   |\n            +-------+-------+   +-------+-------+   +-------+-------+\n                    |                   |                   |\n                    +-------------------+-------------------+\n                                        |\n                                        v\n                                +-------+-------+\n                                |   Data Lake   |\n                                |  (BigQuery)   |\n                                +---------------+\n```\n\n## Instructions\n\n### Step 1: Core Service Layer\n```typescript\n\u002F\u002F src\u002Fservices\u002Fcustomerio\u002Findex.ts\nimport { TrackClient, APIClient, RegionUS } from '@customerio\u002Ftrack';\nimport { EventEmitter } from 'events';\n\nexport interface CustomerIOConfig {\n  trackSiteId: string;\n  trackApiKey: string;\n  appApiKey: string;\n  region: 'us' | 'eu';\n  environment: 'development' | 'staging' | 'production';\n}\n\nexport class CustomerIOService extends EventEmitter {\n  private trackClient: TrackClient;\n  private apiClient: APIClient;\n  private config: CustomerIOConfig;\n\n  constructor(config: CustomerIOConfig) {\n    super();\n    this.config = config;\n\n    this.trackClient = new TrackClient(\n      config.trackSiteId,\n      config.trackApiKey,\n      { region: config.region === 'eu' ? RegionEU : RegionUS }\n    );\n\n    this.apiClient = new APIClient(config.appApiKey, {\n      region: config.region === 'eu' ? RegionEU : RegionUS\n    });\n  }\n\n  \u002F\u002F User management\n  async identifyUser(userId: string, attributes: UserAttributes): Promise\u003Cvoid> {\n    this.emit('identify:start', { userId, attributes });\n\n    try {\n      await this.trackClient.identify(userId, {\n        ...attributes,\n        _env: this.config.environment,\n        _updated_at: Math.floor(Date.now() \u002F 1000)\n      });\n      this.emit('identify:success', { userId });\n    } catch (error) {\n      this.emit('identify:error', { userId, error });\n      throw error;\n    }\n  }\n\n  \u002F\u002F Event tracking\n  async trackEvent(userId: string, event: EventPayload): Promise\u003Cvoid> {\n    this.emit('track:start', { userId, event });\n\n    try {\n      await this.trackClient.track(userId, {\n        name: event.name,\n        data: {\n          ...event.data,\n          _env: this.config.environment\n        }\n      });\n      this.emit('track:success', { userId, event: event.name });\n    } catch (error) {\n      this.emit('track:error', { userId, event: event.name, error });\n      throw error;\n    }\n  }\n\n  \u002F\u002F Transactional messaging\n  async sendTransactional(request: TransactionalRequest): Promise\u003Cvoid> {\n    return this.apiClient.sendEmail(request);\n  }\n}\n```\n\n### Step 2: Event Bus Integration\n```typescript\n\u002F\u002F src\u002Fservices\u002Fcustomerio\u002Fevent-bus.ts\nimport { Kafka, Producer, Consumer } from 'kafkajs';\nimport { CustomerIOService } from '.\u002Findex';\n\ninterface CustomerIOEvent {\n  type: 'identify' | 'track' | 'transactional';\n  userId: string;\n  payload: any;\n  timestamp: number;\n  correlationId: string;\n}\n\nexport class CustomerIOEventBus {\n  private producer: Producer;\n  private consumer: Consumer;\n  private service: CustomerIOService;\n\n  constructor(kafka: Kafka, service: CustomerIOService) {\n    this.producer = kafka.producer();\n    this.consumer = kafka.consumer({ groupId: 'customerio-worker' });\n    this.service = service;\n  }\n\n  async start(): Promise\u003Cvoid> {\n    await this.producer.connect();\n    await this.consumer.connect();\n\n    await this.consumer.subscribe({\n      topics: ['customerio.identify', 'customerio.track', 'customerio.transactional']\n    });\n\n    await this.consumer.run({\n      eachMessage: async ({ topic, message }) => {\n        const event: CustomerIOEvent = JSON.parse(message.value!.toString());\n        await this.processEvent(topic, event);\n      }\n    });\n  }\n\n  private async processEvent(topic: string, event: CustomerIOEvent): Promise\u003Cvoid> {\n    const startTime = Date.now();\n\n    try {\n      switch (event.type) {\n        case 'identify':\n          await this.service.identifyUser(event.userId, event.payload);\n          break;\n        case 'track':\n          await this.service.trackEvent(event.userId, event.payload);\n          break;\n        case 'transactional':\n          await this.service.sendTransactional(event.payload);\n          break;\n      }\n\n      \u002F\u002F Emit success metrics\n      await this.producer.send({\n        topic: 'customerio.processed',\n        messages: [{\n          key: event.correlationId,\n          value: JSON.stringify({\n            ...event,\n            status: 'success',\n            processingTime: Date.now() - startTime\n          })\n        }]\n      });\n    } catch (error) {\n      \u002F\u002F Dead letter queue for failed events\n      await this.producer.send({\n        topic: 'customerio.dlq',\n        messages: [{\n          key: event.correlationId,\n          value: JSON.stringify({\n            ...event,\n            status: 'failed',\n            error: error.message,\n            processingTime: Date.now() - startTime\n          })\n        }]\n      });\n    }\n  }\n\n  \u002F\u002F Publish events to be processed\n  async publish(event: CustomerIOEvent): Promise\u003Cvoid> {\n    await this.producer.send({\n      topic: `customerio.${event.type}`,\n      messages: [{\n        key: event.userId,\n        value: JSON.stringify(event)\n      }]\n    });\n  }\n}\n```\n\n### Step 3: Repository Pattern\n```typescript\n\u002F\u002F src\u002Frepositories\u002Fuser-messaging.ts\nimport { CustomerIOService } from '..\u002Fservices\u002Fcustomerio';\nimport { UserRepository } from '.\u002Fuser';\n\nexport interface MessagingPreferences {\n  email: boolean;\n  push: boolean;\n  sms: boolean;\n  inApp: boolean;\n}\n\nexport class UserMessagingRepository {\n  constructor(\n    private cio: CustomerIOService,\n    private users: UserRepository\n  ) {}\n\n  async syncUser(userId: string): Promise\u003Cvoid> {\n    const user = await this.users.findById(userId);\n    if (!user) throw new Error(`User ${userId} not found`);\n\n    const preferences = await this.getPreferences(userId);\n\n    await this.cio.identifyUser(userId, {\n      email: user.email,\n      first_name: user.firstName,\n      last_name: user.lastName,\n      created_at: Math.floor(user.createdAt.getTime() \u002F 1000),\n      plan: user.subscription?.plan || 'free',\n      \u002F\u002F Preferences\n      email_opt_in: preferences.email,\n      push_opt_in: preferences.push,\n      sms_opt_in: preferences.sms\n    });\n  }\n\n  async getPreferences(userId: string): Promise\u003CMessagingPreferences> {\n    \u002F\u002F Load from your preferences store\n    return {\n      email: true,\n      push: false,\n      sms: false,\n      inApp: true\n    };\n  }\n\n  async updatePreferences(\n    userId: string,\n    preferences: Partial\u003CMessagingPreferences>\n  ): Promise\u003Cvoid> {\n    \u002F\u002F Update local store\n    await this.savePreferences(userId, preferences);\n\n    \u002F\u002F Sync to Customer.io\n    await this.cio.identifyUser(userId, {\n      email_opt_in: preferences.email,\n      push_opt_in: preferences.push,\n      sms_opt_in: preferences.sms\n    });\n  }\n}\n```\n\n### Step 4: Webhook Handler\n```typescript\n\u002F\u002F src\u002Fwebhooks\u002Fcustomerio.ts\nimport { Router } from 'express';\nimport { EventEmitter } from 'events';\n\nexport class CustomerIOWebhooks extends EventEmitter {\n  private router: Router;\n  private signingSecret: string;\n\n  constructor(signingSecret: string) {\n    super();\n    this.signingSecret = signingSecret;\n    this.router = Router();\n    this.setupRoutes();\n  }\n\n  private setupRoutes(): void {\n    this.router.post('\u002F', async (req, res) => {\n      \u002F\u002F Verify signature\n      if (!this.verifySignature(req)) {\n        return res.status(401).send('Invalid signature');\n      }\n\n      \u002F\u002F Process events\n      const events = req.body.events || [];\n\n      for (const event of events) {\n        this.emit(event.metric, event);\n        this.emit('*', event);\n      }\n\n      res.status(200).json({ received: events.length });\n    });\n  }\n\n  getRouter(): Router {\n    return this.router;\n  }\n}\n\n\u002F\u002F Usage\nconst webhooks = new CustomerIOWebhooks(process.env.WEBHOOK_SECRET!);\n\nwebhooks.on('email_delivered', (event) => {\n  \u002F\u002F Update delivery status\n});\n\nwebhooks.on('email_bounced', async (event) => {\n  \u002F\u002F Handle bounce - suppress user\n  await cio.suppress(event.data.customer_id);\n});\n\nwebhooks.on('*', (event) => {\n  \u002F\u002F Stream all events to data warehouse\n  await streamToDataWarehouse(event);\n});\n\napp.use('\u002Fwebhooks\u002Fcustomerio', webhooks.getRouter());\n```\n\n### Step 5: Infrastructure as Code\n```hcl\n# terraform\u002Fcustomerio.tf\nresource \"google_secret_manager_secret\" \"customerio_site_id\" {\n  secret_id = \"customerio-site-id\"\n\n  replication {\n    auto {}\n  }\n}\n\nresource \"google_secret_manager_secret\" \"customerio_api_key\" {\n  secret_id = \"customerio-api-key\"\n\n  replication {\n    auto {}\n  }\n}\n\nresource \"google_cloud_run_service\" \"customerio_worker\" {\n  name     = \"customerio-worker\"\n  location = var.region\n\n  template {\n    spec {\n      containers {\n        image = \"gcr.io\u002F${var.project}\u002Fcustomerio-worker:latest\"\n\n        env {\n          name = \"CUSTOMERIO_SITE_ID\"\n          value_from {\n            secret_key_ref {\n              name = google_secret_manager_secret.customerio_site_id.secret_id\n              key  = \"latest\"\n            }\n          }\n        }\n\n        env {\n          name = \"CUSTOMERIO_API_KEY\"\n          value_from {\n            secret_key_ref {\n              name = google_secret_manager_secret.customerio_api_key.secret_id\n              key  = \"latest\"\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\nresource \"google_pubsub_topic\" \"customerio_events\" {\n  name = \"customerio-events\"\n}\n\nresource \"google_bigquery_dataset\" \"customerio\" {\n  dataset_id = \"customerio_events\"\n  location   = var.region\n}\n\nresource \"google_bigquery_table\" \"delivery_events\" {\n  dataset_id = google_bigquery_dataset.customerio.dataset_id\n  table_id   = \"delivery_events\"\n\n  schema = file(\"${path.module}\u002Fschemas\u002Fdelivery_events.json\")\n\n  time_partitioning {\n    type  = \"DAY\"\n    field = \"timestamp\"\n  }\n}\n```\n\n## Architecture Principles\n\n1. **Separation of Concerns**: Track API, App API, and Webhooks are handled by separate services\n2. **Event-Driven**: Use message queues for reliable async processing\n3. **Idempotency**: All operations can be safely retried\n4. **Observability**: Events are emitted for monitoring and debugging\n5. **Infrastructure as Code**: All resources defined in Terraform\n\n## Output\n- Core Customer.io service layer\n- Event bus integration (Kafka)\n- Repository pattern for user messaging\n- Webhook handler with signature verification\n- Terraform infrastructure code\n\n## Resources\n- [Customer.io API Reference](https:\u002F\u002Fcustomer.io\u002Fdocs\u002Fapi\u002F)\n- [Webhook Documentation](https:\u002F\u002Fcustomer.io\u002Fdocs\u002Fwebhooks\u002F)\n\n## Next Steps\nAfter implementing architecture, proceed to `customerio-multi-env-setup` for multi-environment configuration.\n","# Customer.io Reference Architecture\n\n## Overview\nEnterprise-grade reference architecture for Customer.io integration with proper separation of concerns, reliability, and scalability.\n\n## Architecture Diagram\n\n```\n                                    Customer.io\n                                        |\n                    +-------------------+-------------------+\n                    |                   |                   |\n              Track API            App API            Webhooks\n                    |                   |                   |\n                    v                   v                   v\n            +-------+-------+   +-------+-------+   +-------+-------+\n            |   Event Bus   |   |  Transactional |   | Webhook Handler|\n            |   (Kafka)     |   |    Service     |   |   (Express)   |\n            +-------+-------+   +-------+-------+   +-------+-------+\n                    |                   |                   |\n                    v                   v                   v\n            +-------+-------+   +-------+-------+   +-------+-------+\n            | CustomerIO    |   |    Email       |   |   Event       |\n            | Worker        |   |    Templates   |   |   Processor   |\n            +-------+-------+   +-------+-------+   +-------+-------+\n                    |                   |                   |\n                    +-------------------+-------------------+\n                                        |\n                                        v\n                                +-------+-------+\n                                |   Data Lake   |\n                                |  (BigQuery)   |\n                                +---------------+\n```\n\n## Instructions\n\n### Step 1: Core Service Layer\n```typescript\n\u002F\u002F src\u002Fservices\u002Fcustomerio\u002Findex.ts\nimport { TrackClient, APIClient, RegionUS } from '@customerio\u002Ftrack';\nimport { EventEmitter } from 'events';\n\nexport interface CustomerIOConfig {\n  trackSiteId: string;\n  trackApiKey: string;\n  appApiKey: string;\n  region: 'us' | 'eu';\n  environment: 'development' | 'staging' | 'production';\n}\n\nexport class CustomerIOService extends EventEmitter {\n  private trackClient: TrackClient;\n  private apiClient: APIClient;\n  private config: CustomerIOConfig;\n\n  constructor(config: CustomerIOConfig) {\n    super();\n    this.config = config;\n\n    this.trackClient = new TrackClient(\n      config.trackSiteId,\n      config.trackApiKey,\n      { region: config.region === 'eu' ? RegionEU : RegionUS }\n    );\n\n    this.apiClient = new APIClient(config.appApiKey, {\n      region: config.region === 'eu' ? RegionEU : RegionUS\n    });\n  }\n\n  \u002F\u002F User management\n  async identifyUser(userId: string, attributes: UserAttributes): Promise\u003Cvoid> {\n    this.emit('identify:start', { userId, attributes });\n\n    try {\n      await this.trackClient.identify(userId, {\n        ...attributes,\n        _env: this.config.environment,\n        _updated_at: Math.floor(Date.now() \u002F 1000)\n      });\n      this.emit('identify:success', { userId });\n    } catch (error) {\n      this.emit('identify:error', { userId, error });\n      throw error;\n    }\n  }\n\n  \u002F\u002F Event tracking\n  async trackEvent(userId: string, event: EventPayload): Promise\u003Cvoid> {\n    this.emit('track:start', { userId, event });\n\n    try {\n      await this.trackClient.track(userId, {\n        name: event.name,\n        data: {\n          ...event.data,\n          _env: this.config.environment\n        }\n      });\n      this.emit('track:success', { userId, event: event.name });\n    } catch (error) {\n      this.emit('track:error', { userId, event: event.name, error });\n      throw error;\n    }\n  }\n\n  \u002F\u002F Transactional messaging\n  async sendTransactional(request: TransactionalRequest): Promise\u003Cvoid> {\n    return this.apiClient.sendEmail(request);\n  }\n}\n```\n\n### Step 2: Event Bus Integration\n```typescript\n\u002F\u002F src\u002Fservices\u002Fcustomerio\u002Fevent-bus.ts\nimport { Kafka, Producer, Consumer } from 'kafkajs';\nimport { CustomerIOService } from '.\u002Findex';\n\ninterface CustomerIOEvent {\n  type: 'identify' | 'track' | 'transactional';\n  userId: string;\n  payload: any;\n  timestamp: number;\n  correlationId: string;\n}\n\nexport class CustomerIOEventBus {\n  private producer: Producer;\n  private consumer: Consumer;\n  private service: CustomerIOService;\n\n  constructor(kafka: Kafka, service: CustomerIOService) {\n    this.producer = kafka.producer();\n    this.consumer = kafka.consumer({ groupId: 'customerio-worker' });\n    this.service = service;\n  }\n\n  async start(): Promise\u003Cvoid> {\n    await this.producer.connect();\n    await this.consumer.connect();\n\n    await this.consumer.subscribe({\n      topics: ['customerio.identify', 'customerio.track', 'customerio.transactional']\n    });\n\n    await this.consumer.run({\n      eachMessage: async ({ topic, message }) => {\n        const event: CustomerIOEvent = JSON.parse(message.value!.toString());\n        await this.processEvent(topic, event);\n      }\n    });\n  }\n\n  private async processEvent(topic: string, event: CustomerIOEvent): Promise\u003Cvoid> {\n    const startTime = Date.now();\n\n    try {\n      switch (event.type) {\n        case 'identify':\n          await this.service.identifyUser(event.userId, event.payload);\n          break;\n        case 'track':\n          await this.service.trackEvent(event.userId, event.payload);\n          break;\n        case 'transactional':\n          await this.service.sendTransactional(event.payload);\n          break;\n      }\n\n      \u002F\u002F Emit success metrics\n      await this.producer.send({\n        topic: 'customerio.processed',\n        messages: [{\n          key: event.correlationId,\n          value: JSON.stringify({\n            ...event,\n            status: 'success',\n            processingTime: Date.now() - startTime\n          })\n        }]\n      });\n    } catch (error) {\n      \u002F\u002F Dead letter queue for failed events\n      await this.producer.send({\n        topic: 'customerio.dlq',\n        messages: [{\n          key: event.correlationId,\n          value: JSON.stringify({\n            ...event,\n            status: 'failed',\n            error: error.message,\n            processingTime: Date.now() - startTime\n          })\n        }]\n      });\n    }\n  }\n\n  \u002F\u002F Publish events to be processed\n  async publish(event: CustomerIOEvent): Promise\u003Cvoid> {\n    await this.producer.send({\n      topic: `customerio.${event.type}`,\n      messages: [{\n        key: event.userId,\n        value: JSON.stringify(event)\n      }]\n    });\n  }\n}\n```\n\n### Step 3: Repository Pattern\n```typescript\n\u002F\u002F src\u002Frepositories\u002Fuser-messaging.ts\nimport { CustomerIOService } from '..\u002Fservices\u002Fcustomerio';\nimport { UserRepository } from '.\u002Fuser';\n\nexport interface MessagingPreferences {\n  email: boolean;\n  push: boolean;\n  sms: boolean;\n  inApp: boolean;\n}\n\nexport class UserMessagingRepository {\n  constructor(\n    private cio: CustomerIOService,\n    private users: UserRepository\n  ) {}\n\n  async syncUser(userId: string): Promise\u003Cvoid> {\n    const user = await this.users.findById(userId);\n    if (!user) throw new Error(`User ${userId} not found`);\n\n    const preferences = await this.getPreferences(userId);\n\n    await this.cio.identifyUser(userId, {\n      email: user.email,\n      first_name: user.firstName,\n      last_name: user.lastName,\n      created_at: Math.floor(user.createdAt.getTime() \u002F 1000),\n      plan: user.subscription?.plan || 'free',\n      \u002F\u002F Preferences\n      email_opt_in: preferences.email,\n      push_opt_in: preferences.push,\n      sms_opt_in: preferences.sms\n    });\n  }\n\n  async getPreferences(userId: string): Promise\u003CMessagingPreferences> {\n    \u002F\u002F Load from your preferences store\n    return {\n      email: true,\n      push: false,\n      sms: false,\n      inApp: true\n    };\n  }\n\n  async updatePreferences(\n    userId: string,\n    preferences: Partial\u003CMessagingPreferences>\n  ): Promise\u003Cvoid> {\n    \u002F\u002F Update local store\n    await this.savePreferences(userId, preferences);\n\n    \u002F\u002F Sync to Customer.io\n    await this.cio.identifyUser(userId, {\n      email_opt_in: preferences.email,\n      push_opt_in: preferences.push,\n      sms_opt_in: preferences.sms\n    });\n  }\n}\n```\n\n### Step 4: Webhook Handler\n```typescript\n\u002F\u002F src\u002Fwebhooks\u002Fcustomerio.ts\nimport { Router } from 'express';\nimport { EventEmitter } from 'events';\n\nexport class CustomerIOWebhooks extends EventEmitter {\n  private router: Router;\n  private signingSecret: string;\n\n  constructor(signingSecret: string) {\n    super();\n    this.signingSecret = signingSecret;\n    this.router = Router();\n    this.setupRoutes();\n  }\n\n  private setupRoutes(): void {\n    this.router.post('\u002F', async (req, res) => {\n      \u002F\u002F Verify signature\n      if (!this.verifySignature(req)) {\n        return res.status(401).send('Invalid signature');\n      }\n\n      \u002F\u002F Process events\n      const events = req.body.events || [];\n\n      for (const event of events) {\n        this.emit(event.metric, event);\n        this.emit('*', event);\n      }\n\n      res.status(200).json({ received: events.length });\n    });\n  }\n\n  getRouter(): Router {\n    return this.router;\n  }\n}\n\n\u002F\u002F Usage\nconst webhooks = new CustomerIOWebhooks(process.env.WEBHOOK_SECRET!);\n\nwebhooks.on('email_delivered', (event) => {\n  \u002F\u002F Update delivery status\n});\n\nwebhooks.on('email_bounced', async (event) => {\n  \u002F\u002F Handle bounce - suppress user\n  await cio.suppress(event.data.customer_id);\n});\n\nwebhooks.on('*', (event) => {\n  \u002F\u002F Stream all events to data warehouse\n  await streamToDataWarehouse(event);\n});\n\napp.use('\u002Fwebhooks\u002Fcustomerio', webhooks.getRouter());\n```\n\n### Step 5: Infrastructure as Code\n```hcl\n# terraform\u002Fcustomerio.tf\nresource \"google_secret_manager_secret\" \"customerio_site_id\" {\n  secret_id = \"customerio-site-id\"\n\n  replication {\n    auto {}\n  }\n}\n\nresource \"google_secret_manager_secret\" \"customerio_api_key\" {\n  secret_id = \"customerio-api-key\"\n\n  replication {\n    auto {}\n  }\n}\n\nresource \"google_cloud_run_service\" \"customerio_worker\" {\n  name     = \"customerio-worker\"\n  location = var.region\n\n  template {\n    spec {\n      containers {\n        image = \"gcr.io\u002F${var.project}\u002Fcustomerio-worker:latest\"\n\n        env {\n          name = \"CUSTOMERIO_SITE_ID\"\n          value_from {\n            secret_key_ref {\n              name = google_secret_manager_secret.customerio_site_id.secret_id\n              key  = \"latest\"\n            }\n          }\n        }\n\n        env {\n          name = \"CUSTOMERIO_API_KEY\"\n          value_from {\n            secret_key_ref {\n              name = google_secret_manager_secret.customerio_api_key.secret_id\n              key  = \"latest\"\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\nresource \"google_pubsub_topic\" \"customerio_events\" {\n  name = \"customerio-events\"\n}\n\nresource \"google_bigquery_dataset\" \"customerio\" {\n  dataset_id = \"customerio_events\"\n  location   = var.region\n}\n\nresource \"google_bigquery_table\" \"delivery_events\" {\n  dataset_id = google_bigquery_dataset.customerio.dataset_id\n  table_id   = \"delivery_events\"\n\n  schema = file(\"${path.module}\u002Fschemas\u002Fdelivery_events.json\")\n\n  time_partitioning {\n    type  = \"DAY\"\n    field = \"timestamp\"\n  }\n}\n```\n\n## Architecture Principles\n\n1. **Separation of Concerns**: Track API, App API, and Webhooks are handled by separate services\n2. **Event-Driven**: Use message queues for reliable async processing\n3. **Idempotency**: All operations can be safely retried\n4. **Observability**: Events are emitted for monitoring and debugging\n5. **Infrastructure as Code**: All resources defined in Terraform\n\n## Output\n- Core Customer.io service layer\n- Event bus integration (Kafka)\n- Repository pattern for user messaging\n- Webhook handler with signature verification\n- Terraform infrastructure code\n\n## Resources\n- [Customer.io API Reference](https:\u002F\u002Fcustomer.io\u002Fdocs\u002Fapi\u002F)\n- [Webhook Documentation](https:\u002F\u002Fcustomer.io\u002Fdocs\u002Fwebhooks\u002F)\n\n## Next Steps\nAfter implementing architecture, proceed to `customerio-multi-env-setup` for multi-environment configuration.\n",{"name":5,"author":49,"license":15,"version":50,"description":51,"allowed-tools":52},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Implement Customer.io reference architecture.\nUse when designing integrations, planning architecture,\nor implementing enterprise patterns.\nTrigger with phrases like \"customer.io architecture\", \"customer.io design\",\n\"customer.io enterprise\", \"customer.io integration pattern\".\n","Read, Write, Edit, Bash(gh:*), Bash(curl:*)","main","90b50ed0778745a80fd5bfb13b1843d45b9e82f7","tests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fcustomerio-pack\u002Fskills\u002Fcustomerio-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":63,"prompt":73,"zipAvailable":74},[64,67,70],{"tool":65,"command":66},"npx","npx skills add Dicklesworthstone\u002Fpi_agent_rust --skill customerio-reference-architecture",{"tool":68,"command":69},"bunx","bunx skills add Dicklesworthstone\u002Fpi_agent_rust --skill customerio-reference-architecture",{"tool":71,"command":72},"pnpm","pnpm dlx skills add Dicklesworthstone\u002Fpi_agent_rust --skill customerio-reference-architecture","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fcustomerio-pack\u002Fskills\u002Fcustomerio-reference-architecture\u002FSKILL.md",true,[],[77,110,145,168,194,220],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":82,"sourceHtmlUrl":83,"categories":84,"keywords":90,"publishedAt":109},"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",[85],{"categoryNo":86,"categoryName":87,"taxonomyType":88,"taxonomyTypeDesc":89},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",[91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,26,107,108],"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":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":114,"sourceHtmlUrl":115,"categories":116,"keywords":120,"publishedAt":44},"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",[117],{"categoryNo":118,"categoryName":119,"taxonomyType":88,"taxonomyTypeDesc":89},"01JBSEEDCAT000000000000009","前端开发",[121,122,97,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,31,102,138,139,140,141,142,143,144],"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":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":149,"sourceHtmlUrl":150,"categories":151,"keywords":156,"publishedAt":44},"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",[152,155],{"categoryNo":153,"categoryName":154,"taxonomyType":88,"taxonomyTypeDesc":89},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":118,"categoryName":119,"taxonomyType":88,"taxonomyTypeDesc":89},[157,158,159,125,160,161,122,162,95,163,135,164,165,166,167,26,142],"testing","webapp testing","webapp","screenshots","playwright","debugging","browser","logs","applications","behavior","local",{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":172,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":44},"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",[],[176,177,178,179,180,181,182,183,31,184,185,186,187,188,189,190,26,191,192,193,142,23],"analysis","neuropixels analysis","spike","metrics","data","open","quality","user","recordings","Neural","motion","visual","quality metrics","unit","sorting","curation","recording","load",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":198,"sourceHtmlUrl":199,"categories":200,"keywords":204,"publishedAt":44},"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",[201],{"categoryNo":202,"categoryName":203,"taxonomyType":88,"taxonomyTypeDesc":89},"01JBSEEDCAT000000000000023","Skill与智能体开发",[205,206,207,208,209,210,211,212,37,213,214,215,216,217,26,142,218,23,219],"skill creator","creator","workflows","create","update","capabilities","knowledge","tool","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":221,"name":222,"nameZh":6,"description":223,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":224,"sourceHtmlUrl":225,"categories":226,"keywords":228,"publishedAt":44},"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",[227],{"categoryNo":202,"categoryName":203,"taxonomyType":88,"taxonomyTypeDesc":89},[222,229,230,231,232,233,234,163,235,236,31,237,238,239,240,142,241],"google","browser automation","gemini","automation","auth","code","library","management","only","document","query","Citation","source"]