Agent skill

Customerio Performance Tuning

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Optimize Customer.io API performance for high throughput. An agent skill from jeremylongshore/tons-of-skills-marketplace.

MITAuto-check passedDatabases

Install Customerio Performance Tuning

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill customerio-performance-tuning -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace customerio-performance-tuning --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/customerio-performance-tuning .claude/skills/customerio-performance-tuning && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
customerio-performance-tuning
GitHub stars
2.8k
Token cost
~2.4k tokens
SKILL.md length
241 words
Files
3 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Optimize Customer.io API performance for high throughput. An agent skill from jeremylongshore/tons-of-skills-marketplace.

  • Works in 5 steps: HTTP Connection Pooling → Identify Deduplication Cache → Batch Processor → …
  • Improving response times
  • SKILL.md covers Output, Examples, Overview and Prerequisites, plus 6 more sections
  • Needs CUSTOMERIO_TRACK_API_KEY

What it does

Customerio Performance Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Optimize Customer.io API performance for high throughput. Use when improving response times, implementing connection pooling, batching, caching, or regional routing. Trigger: "customer.io performance", "optimize customer.io", "customer.io latency", "customer.io connection pooling".

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/implementation-guide.md` and `references/implementation.md`). Compatibility notes: Designed for Claude Code

It sits in Databases, covering Database administration and Caching. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Improving response times
  • Implementing connection pooling
  • Regional routing

Example prompts

  • “customer.io performance”
  • “optimize customer.io”
  • “customer.io latency”
  • “/customerio-performance-tuning”

Requirements

  • Node.js
  • A credential in CUSTOMERIO_TRACK_API_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npm:*), Bash(npx:*), Glob, Grep

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. HTTP Connection Pooling
  2. Identify Deduplication Cache
  3. Batch Processor
  4. Fire-and-Forget Async Tracking
  5. Regional Routing

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npm:*)
    • Bash(npx:*)
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.customer.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • CUSTOMERIO_TRACK_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Customerio Performance Tuning loads about 2.4k tokens when it runs, and up to ~4.8k if it reads all its reference files. Until then it costs about 78 tokens; SKILL.md has 241 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~78
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 241 words, ~2,393 tokens.

Download SKILL.mdSave it as .claude/skills/customerio-performance-tuning/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
customerio-performance-tuning
description
Optimize Customer.io API performance for high throughput. Use when improving response times, implementing connection pooling, batching, caching, or regional routing. Trigger: "customer.io performance", "optimize customer.io", "customer.io latency", "customer.io connection pooling".
allowed-tools
Read, Write, Edit, Bash(npm:*), Bash(npx:*), Glob, Grep
compatibility
Designed for Claude Code
version
1.14.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, customer-io, performance, optimization

Customer.io Performance Tuning

Output

  • A measured delivery/API performance baseline with a scoped optimization, owner, and rollback trigger.
  • A capacity decision that preserves consent, message correctness, rate limits, and provider reliability.

Examples

Measure event throughput, response latency, error rate, and queue depth in a development workspace using synthetic payloads. Change one batch/concurrency parameter, compare against the baseline, and revert if errors, rate limits, or message ordering regress. Do not increase concurrency by replaying production recipient data.

Overview

Optimize Customer.io API performance for high-volume integrations: HTTP connection pooling, identify deduplication caching, event batching with flush control, fire-and-forget async tracking, and regional routing.

Prerequisites

  • Working Customer.io integration
  • Understanding of your traffic patterns and volume
  • Monitoring to measure improvement (see customerio-observability)

Performance Targets

OperationBaselineOptimizedTechnique
Single identify~200ms~80msConnection pooling
Single track~200ms~80msConnection pooling
100 events batch~20s serial~500msParallel batching
Duplicate identify~200ms~0msDedup cache
Non-critical trackBlockingNon-blockingFire-and-forget

Instructions

Step 1: HTTP Connection Pooling
typescript
// lib/customerio-pooled.ts
import { TrackClient, RegionUS } from "customerio-node";
import https from "https";

// The customerio-node SDK creates new connections by default.
// Reuse connections with a keep-alive agent.
const agent = new https.Agent({
  keepAlive: true,
  maxSockets: 25,        // Max concurrent connections
  maxFreeSockets: 10,    // Keep idle connections open
  timeout: 30000,        // 30s socket timeout
  keepAliveMsecs: 15000, // TCP keep-alive probe interval
});

// Apply to the SDK by creating a singleton with the agent
// Note: customerio-node doesn't directly accept an agent,
// but we configure Node.js global agent for HTTPS
https.globalAgent = agent;

// Singleton client — one instance = one connection pool
const cio = new TrackClient(
  process.env.CUSTOMERIO_SITE_ID!,
  process.env.CUSTOMERIO_TRACK_API_KEY!,
  { region: RegionUS }
);

export { cio };
Step 2: Identify Deduplication Cache
typescript
// lib/customerio-dedup.ts
// Skip duplicate identify() calls within a time window

class LRUCache<K, V> {
  private map = new Map<K, V>();
  constructor(private maxSize: number) {}

  get(key: K): V | undefined {
    const val = this.map.get(key);
    if (val !== undefined) {
      // Move to end (most recent)
      this.map.delete(key);
      this.map.set(key, val);
    }
    return val;
  }

  set(key: K, val: V): void {
    this.map.delete(key);
    this.map.set(key, val);
    if (this.map.size > this.maxSize) {
      const oldest = this.map.keys().next().value;
      this.map.delete(oldest!);
    }
  }
}

import { createHash } from "crypto";
import { TrackClient, RegionUS } from "customerio-node";

const identifyCache = new LRUCache<string, number>(10_000);
const DEDUP_TTL_MS = 5 * 60 * 1000;  // 5 minutes

const cio = new TrackClient(
  process.env.CUSTOMERIO_SITE_ID!,
  process.env.CUSTOMERIO_TRACK_API_KEY!,
  { region: RegionUS }
);

export async function dedupIdentify(
  userId: string,
  attrs: Record<string, any>
): Promise<void> {
  // Create a hash of userId + attributes
  const hash = createHash("sha256")
    .update(userId + JSON.stringify(attrs))
    .digest("hex")
    .substring(0, 16);

  const cached = identifyCache.get(hash);
  if (cached && Date.now() - cached < DEDUP_TTL_MS) {
    return; // Skip — identical identify() call within TTL window
  }

  await cio.identify(userId, attrs);
  identifyCache.set(hash, Date.now());
}
Step 3: Batch Processor
typescript
// lib/customerio-batch.ts
import { TrackClient, RegionUS } from "customerio-node";

interface BatchItem {
  type: "identify" | "track";
  userId: string;
  data: Record<string, any>;
}

export class CioBatchProcessor {
  private buffer: BatchItem[] = [];
  private timer: NodeJS.Timeout | null = null;
  private client: TrackClient;
  private processing = false;

  constructor(
    private readonly maxBatchSize = 100,
    private readonly flushIntervalMs = 3000,
    private readonly concurrency = 15
  ) {
    this.client = new TrackClient(
      process.env.CUSTOMERIO_SITE_ID!,
      process.env.CUSTOMERIO_TRACK_API_KEY!,
      { region: RegionUS }
    );
    this.startFlushTimer();
  }

  add(item: BatchItem): void {
    this.buffer.push(item);
    if (this.buffer.length >= this.maxBatchSize) {
      this.flush();
    }
  }

  async flush(): Promise<void> {
    if (this.processing || this.buffer.length === 0) return;
    this.processing = true;

    const batch = this.buffer.splice(0, this.maxBatchSize);
    const startMs = Date.now();

    // Process in parallel chunks
    for (let i = 0; i < batch.length; i += this.concurrency) {
      const chunk = batch.slice(i, i + this.concurrency);
      const results = await Promise.allSettled(
        chunk.map((item) =>
          item.type === "identify"
            ? this.client.identify(item.userId, item.data)
            : this.client.track(item.userId, item.data)
        )
      );

      const failed = results.filter((r) => r.status === "rejected").length;
      if (failed > 0) {
        console.warn(`CIO batch: ${failed}/${chunk.length} failed`);
      }
    }

    const elapsed = Date.now() - startMs;
    console.log(`CIO batch: ${batch.length} items in ${elapsed}ms`);
    this.processing = false;
  }

  private startFlushTimer(): void {
    this.timer = setInterval(() => this.flush(), this.flushIntervalMs);
  }

  async shutdown(): Promise<void> {
    if (this.timer) clearInterval(this.timer);
    await this.flush();
  }
}
Step 4: Fire-and-Forget Async Tracking
typescript
// lib/customerio-async.ts
// For non-critical analytics events — don't block the request path

import { TrackClient, RegionUS } from "customerio-node";

const cio = new TrackClient(
  process.env.CUSTOMERIO_SITE_ID!,
  process.env.CUSTOMERIO_TRACK_API_KEY!,
  { region: RegionUS }
);

export function fireAndForgetTrack(
  userId: string,
  eventName: string,
  data?: Record<string, any>
): void {
  // No await — returns immediately
  cio
    .track(userId, { name: eventName, data })
    .catch((err) => console.error(`CIO async track failed: ${err.message}`));
}

// Usage in Express route — does NOT slow down response
router.get("/dashboard", async (req, res) => {
  fireAndForgetTrack(req.user.id, "dashboard_viewed", {
    timestamp: Math.floor(Date.now() / 1000),
  });

  const data = await loadDashboardData(req.user.id);
  res.json(data);  // Returns immediately without waiting for CIO
});
Step 5: Regional Routing
typescript
// lib/customerio-region.ts
import { TrackClient, APIClient, RegionUS, RegionEU } from "customerio-node";

// Route to nearest Customer.io region based on configuration
// US accounts: track.customer.io / api.customer.io
// EU accounts: track-eu.customer.io / api-eu.customer.io

interface CioRegionalConfig {
  us: { siteId: string; trackKey: string; appKey: string };
  eu: { siteId: string; trackKey: string; appKey: string };
}

function getClientForUser(
  config: CioRegionalConfig,
  userRegion: "us" | "eu"
): { track: TrackClient; api: APIClient } {
  const creds = config[userRegion];
  const region = userRegion === "eu" ? RegionEU : RegionUS;

  return {
    track: new TrackClient(creds.siteId, creds.trackKey, { region }),
    api: new APIClient(creds.appKey, { region }),
  };
}

Performance Monitoring

typescript
// Wrap operations to measure latency
async function timedCioCall<T>(
  operation: string,
  fn: () => Promise<T>
): Promise<T> {
  const start = Date.now();
  try {
    const result = await fn();
    const elapsed = Date.now() - start;
    console.log(`CIO ${operation}: ${elapsed}ms`);
    return result;
  } catch (err) {
    const elapsed = Date.now() - start;
    console.error(`CIO ${operation} FAILED: ${elapsed}ms`);
    throw err;
  }
}

Error Handling

IssueSolution
High p99 latencyEnable connection pooling, check DNS resolution
Timeout errorsIncrease timeout, reduce payload size
Memory growthCap LRU cache size, limit batch buffer
Dedup cache missesIncrease TTL if same identify calls are >5min apart

Resources

Next Steps

After performance tuning, proceed to customerio-cost-tuning for cost optimization.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/.curated/customerio-performance-tuning of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/implementation-guide.md
  • references/implementation.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Customerio Performance Tuning next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Customerio Performance Tuning compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Customerio Performance Tuning this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.4kAutomated safety check: PassMIT
Redis Connectionsredis/agent-skills1661 repos~1.3kAutomated safety check: PassMIT
Frappe Core DatabaseImpertio-Studio/Frappe_Claude_Skill_Package189—~3.8kAutomated safety check: PassMIT
AWS Cloudformation Elasticachegiuseppe-trisciuoglio/developer-kit357—~1.5kAutomated safety check: NotesMIT
Veloxdb Scalable Performanceveloxbase/veloxdb652—~1.7kAutomated safety check: PassMIT
Golang Samber Hotsamber/cc-skills-golang3.4k—~2kAutomated safety check: PassMIT

Similar skills

  • Redis Connections

    redis/agent-skills

    Official

    Redis client and connection guidance covering connection pooling, multiplexing, pipelining, client-side caching with RESP3, avoiding slow commands (KEYS, SMEMBERS, HGETALL), and tuning socket…

    166 GitHub starsUsed in 1 repo~1.3k tokens
    DatabasesAuto-check passed
  • Frappe Core Database

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when performing database operations in ERPNext/Frappe v14-v16.

    189 GitHub stars~3.8k tokensUpdated 24 days ago
    DatabasesAuto-check passed
  • AWS Cloudformation Elasticache

    giuseppe-trisciuoglio/developer-kit

    Provides AWS CloudFormation patterns for ElastiCache Redis or Memcached infrastructure, including subnet groups, parameter groups, security controls, and cross-stack outputs.

    357 GitHub stars~1.5k tokensUpdated 1 mo ago
    DatabasesAuto-check: notes
  • Guides scalability and performance work for VeloxDB's Tauri + Rust PostgreSQL backend and React + TanStack frontend.

    652 GitHub stars~1.7k tokensUpdated 11 days ago
    DatabasesAuto-check passed
  • Golang Samber Hot

    samber/cc-skills-golang

    In-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing…

    3.4k GitHub stars~2k tokensUpdated 10 days ago
    DevOps & CloudAuto-check passed
  • Redis Inspector

    evolution-foundation/evo-nexus

    Reads keys and server state from Redis instances configured in .env through a read-only Python client, choosing connections by label or index.

    545 GitHub stars~1.3k tokensUpdated 5 mo ago
    DatabasesAuto-check: notes

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Customerio Performance Tuning

What does Customerio Performance Tuning do?

Optimize Customer.io API performance for high throughput. An agent skill from jeremylongshore/tons-of-skills-marketplace. Customerio Performance Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace.io API performance for high throughput.

When should I use Customerio Performance Tuning?

Customerio Performance Tuning fits situations like: improving response times; implementing connection pooling; regional routing.

How do I install Customerio Performance Tuning in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill customerio-performance-tuning -a claude-code`. Or copy the skill folder (skills/.curated/customerio-performance-tuning in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/customerio-performance-tuning in your project. Claude Code loads it when a task matches its description.

How do I install Customerio Performance Tuning in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill customerio-performance-tuning -a codex`. Or copy the skill folder (skills/.curated/customerio-performance-tuning in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/customerio-performance-tuning in your project. Codex loads it when a task matches its description.

Can I use Customerio Performance Tuning in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill customerio-performance-tuning -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/customerio-performance-tuning, .gemini/skills/customerio-performance-tuning, .github/skills/customerio-performance-tuning and .opencode/skills/customerio-performance-tuning in your project.

What does Customerio Performance Tuning need to run?

Going by SKILL.md and its folder, Customerio Performance Tuning needs credentials named CUSTOMERIO_TRACK_API_KEY. Our summary lists: Node.js; A credential in CUSTOMERIO_TRACK_API_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Bash(npx:*), Glob, Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Customerio Performance Tuning access the network?

SKILL.md names 1 domain. As links in the text: docs.customer.io. This is read from the text; nothing was executed.

Is Customerio Performance Tuning safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Customerio Performance Tuning use?

Customerio Performance Tuning is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Customerio Performance Tuning use?

About 2.4k tokens (SKILL.md is roughly 9.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.4k tokens, read only when the agent opens those files.

What are the alternatives to Customerio Performance Tuning?

Skills that share tags, products or a category with Customerio Performance Tuning: Redis Connections (redis/agent-skills, 166 stars), Frappe Core Database (Impertio-Studio/Frappe_Claude_Skill_Package, 189 stars), AWS Cloudformation Elasticache (giuseppe-trisciuoglio/developer-kit, 357 stars) and Veloxdb Scalable Performance (veloxbase/veloxdb, 652 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Customerio Performance Tuning?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.