Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Configure Customer.io CI/CD integration with automated testing. Use when setting up GitHub Actions, integration test suites, or pre-commit validation for Customer.io code. Trigger: "customer.io ci", "customer.io github actions", "customer.io pipeline", "customer.io automated testing".
.claude/skills/jeremylongshore-customerio-ci-integration/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 80% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 39% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 36% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 77% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 90% | 0% |
Set up CI/CD pipelines for Customer.io integrations: GitHub Actions workflow with unit + integration tests, test fixtures with automatic cleanup, pre-commit hooks, and environment-specific credential management.
yaml# .github/workflows/customerio-tests.yml name: Customer.io Integration Tests on: push: paths: - "lib/customerio-*.ts" - "services/customerio-*.ts" - "tests/customerio*" pull_request: paths: - "lib/customerio-*.ts" - "services/customerio-*.ts" env: CUSTOMERIO_SITE_ID: ${{ secrets.CIO_TEST_SITE_ID }} CUSTOMERIO_TRACK_API_KEY: ${{ secrets.CIO_TEST_TRACK_API_KEY }} CUSTOMERIO_APP_API_KEY: ${{ secrets.CIO_TEST_APP_API_KEY }} CUSTOMERIO_REGION: us jobs: unit-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 cache: npm - run: npm ci - run: npx vitest run tests/customerio --reporter=verbose env: CUSTOMERIO_DRY_RUN: "true" # Unit tests use mocks integration-tests: runs-on: ubuntu-latest needs: unit-tests # Only run if unit tests pass steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 cache: npm - run: npm ci - name: Validate credentials run: | if [ -z "$CUSTOMERIO_SITE_ID" ]; then echo "::warning::CIO credentials not configured — skipping integration tests" exit 0 fi - name: Run integration tests run: npx vitest run tests/customerio.integration --reporter=verbose - name: Cleanup test users if: always() run: npx tsx scripts/cio-cleanup-test-users.ts
typescript// tests/helpers/cio-test-utils.ts import { TrackClient, RegionUS } from "customerio-node"; const TEST_RUN_ID = `ci-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`; const createdUsers: string[] = []; export function getCioTestClient(): TrackClient { return new TrackClient( process.env.CUSTOMERIO_SITE_ID!, process.env.CUSTOMERIO_TRACK_API_KEY!, { region: RegionUS } ); } export function testUserId(label: string): string { const id = `${TEST_RUN_ID}-${label}`; createdUsers.push(id); return id; } export async function cleanupTestUsers(client: TrackClient): Promise<void> { console.log(`Cleaning up ${createdUsers.length} test users...`); for (const userId of createdUsers) { try { await client.suppress(userId); await client.destroy(userId); } catch { // Ignore cleanup errors } } createdUsers.length = 0; }
typescript// tests/customerio.integration.test.ts import { describe, it, expect, afterAll } from "vitest"; import { getCioTestClient, testUserId, cleanupTestUsers } from "./helpers/cio-test-utils"; const cio = getCioTestClient(); describe("Customer.io Integration", () => { afterAll(async () => { await cleanupTestUsers(cio); }); it("should identify a new user", async () => { const userId = testUserId("identify-new"); await expect( cio.identify(userId, { email: `${userId}@test.example.com`, created_at: Math.floor(Date.now() / 1000), }) ).resolves.not.toThrow(); }); it("should update an existing user", async () => { const userId = testUserId("identify-update"); await cio.identify(userId, { email: `${userId}@test.example.com` }); await expect( cio.identify(userId, { plan: "pro", updated: true }) ).resolves.not.toThrow(); }); it("should track an event on a user", async () => { const userId = testUserId("track-event"); await cio.identify(userId, { email: `${userId}@test.example.com` }); await expect( cio.track(userId, { name: "ci_test_event", data: { test_run: true, timestamp: Date.now() }, }) ).resolves.not.toThrow(); }); it("should track an anonymous event", async () => { await expect( cio.trackAnonymous({ anonymous_id: testUserId("anon"), name: "ci_anonymous_test", data: { page: "/test" }, }) ).resolves.not.toThrow(); }); it("should suppress a user", async () => { const userId = testUserId("suppress"); await cio.identify(userId, { email: `${userId}@test.example.com` }); await expect(cio.suppress(userId)).resolves.not.toThrow(); }); it("should reject invalid credentials", async () => { const badClient = new (await import("customerio-node")).TrackClient( "invalid", "invalid", { region: (await import("customerio-node")).RegionUS } ); await expect( badClient.identify("x", { email: "x@test.com" }) ).rejects.toThrow(); }); });
typescript// scripts/cio-cleanup-test-users.ts import { TrackClient, RegionUS } from "customerio-node"; const cio = new TrackClient( process.env.CUSTOMERIO_SITE_ID!, process.env.CUSTOMERIO_TRACK_API_KEY!, { region: RegionUS } ); // Clean up any test users from failed CI runs // This uses the ci- prefix convention from testUserId() async function cleanup() { console.log("Cleaning up CI test users..."); console.log("Note: Customer.io doesn't have a list/search API via Track API."); console.log("Cleanup relies on suppress+destroy for known test user IDs."); console.log("For bulk cleanup, use the Customer.io dashboard People filter."); } cleanup();
bash# Set up CI secrets (use a dedicated test workspace — NEVER production) gh secret set CIO_TEST_SITE_ID --body "your-test-site-id" gh secret set CIO_TEST_TRACK_API_KEY --body "your-test-track-key" gh secret set CIO_TEST_APP_API_KEY --body "your-test-app-key"
bash# .husky/pre-commit (or lint-staged config) npx lint-staged
json// package.json { "lint-staged": { "lib/customerio-*.ts": ["eslint --fix", "vitest related --run"], "services/customerio-*.ts": ["eslint --fix", "vitest related --run"] } }
| Practice | Rationale | |----------|-----------| | Dedicated test workspace | Prevents CI from polluting dev/staging data | | Unique test user IDs | Prevents collisions between parallel CI runs | | Always cleanup in afterAll | Prevents accumulating stale test profiles | | Rate limit awareness | Add small delays between batched API calls in CI | | Skip integration tests if no creds | PRs from forks won't have secrets |
| Issue | Solution | |-------|----------| | Secrets not available in PR | Fork PRs don't get secrets — skip integration tests gracefully | | Test user pollution | Use ${TEST_RUN_ID} prefix, cleanup in afterAll | | Rate limiting in CI | Keep integration test count under 50 API calls | | Flaky network failures | Add retry logic to integration tests |
After CI setup, proceed to customerio-deploy-pipeline for production deployment.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 21,030 | 7,891 | -62% | 1 | 1 | 0% | 2,164 | 3,903 | +80% | 0 | 0 | — |
case-02 | fail→pass | 18,496 | 20,096 | +9% | 1 | 1 | 0% | 3,823 | 5,329 | +39% | 0 | 0 | — |
case-13 | fail→pass | 12,611 | 6,876 | -45% | 1 | 1 | 0% | 2,673 | 3,647 | +36% | 0 | 0 | — |
case-03 | fail→pass | 9,686 | 5,337 | -45% | 1 | 1 | 0% | 1,884 | 3,328 | +77% | 0 | 0 | — |
case-04 | fail→fail | 30,462 | 15,036 | -51% | 1 | 1 | 0% | 1,211 | 5,369 | +343% | 0 | 0 | — |
case-05 | pass→pass | 14,863 | 14,122 | -5% | 1 | 1 | 0% | 3,228 | 5,216 | +62% | 0 | 0 | — |
case-06 | pass→pass | 19,580 | 7,997 | -59% | 1 | 1 | 0% | 2,138 | 3,716 | +74% | 0 | 0 | — |
case-07 | fail→fail | 13,566 | 8,279 | -39% | 1 | 1 | 0% | 2,520 | 3,831 | +52% | 0 | 0 | — |
case-08 | fail→pass | 9,892 | 7,862 | -21% | 1 | 1 | 0% | 1,940 | 3,689 | +90% | 0 | 0 | — |
case-09 | fail→pass | 8,242 | 6,681 | -19% | 1 | 1 | 0% | 1,352 | 3,383 | +150% | 0 | 0 | — |
case-10 | fail→fail | 14,091 | 9,382 | -33% | 1 | 1 | 0% | 2,595 | 3,833 | +48% | 0 | 0 | — |
case-11 | pass→pass | 7,573 | 4,588 | -39% | 1 | 1 | 0% | 1,446 | 2,889 | +100% | 0 | 0 | — |
case-12 | pass→pass | 11,960 | 4,279 | -64% | 1 | 1 | 0% | 2,061 | 2,838 | +38% | 0 | 0 | — |
case-14 | pass→pass | 11,364 | 7,993 | -30% | 1 | 1 | 0% | 2,260 | 3,823 | +69% | 0 | 0 | — |
case-15 | pass→pass | 12,753 | 8,439 | -34% | 1 | 1 | 0% | 2,686 | 3,682 | +37% | 0 | 0 | — |
case-16 | fail→pass | 9,077 | 7,477 | -18% | 1 | 1 | 0% | 1,803 | 3,751 | +108% | 0 | 0 | — |
case-17 | pass→pass | 12,418 | 6,102 | -51% | 1 | 1 | 0% | 2,049 | 3,245 | +58% | 0 | 0 | — |
case-18 | fail→pass | 8,200 | 6,183 | -25% | 1 | 1 | 0% | 1,596 | 3,551 | +122% | 0 | 0 | — |
case-19 | pass→pass | 9,290 | 5,159 | -44% | 1 | 1 | 0% | 1,837 | 3,405 | +85% | 0 | 0 | — |
case-20 | pass→pass | 11,425 | 9,559 | -16% | 1 | 1 | 0% | 1,907 | 4,136 | +117% | 0 | 0 | — |
case-21 | fail→pass | 12,657 | 5,984 | -53% | 1 | 1 | 0% | 2,415 | 3,307 | +37% | 0 | 0 | — |
case-22 | fail→pass | 11,513 | 2,352 | -80% | 1 | 1 | 0% | 2,059 | 2,596 | +26% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +45 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.