Agent skill · software engineering · jeremylongshore
posthog-ci-integration
Build repository-specific PostHog CI gates for SDK initialization, typed capture tests, release annotations, and secret boundaries. Use when adding or reviewing PostHog checks in continuous integration. Trigger with "posthog CI", "PostHog GitHub Actions", or "test PostHog integration".
Why this skill is useful
Adds a complete CI/CD pipeline setup for PostHog with executable scripts for GitHub Actions that aren't in public documentation.
What it needs
Requires gh, npm installed locally. Requires posthog account access. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
PostHog CI Integration Overview Set up CI/CD pipelines for PostHog integrations. Covers mocked unit tests (no API key needed), integration tests against a PostHog dev project, and deployment annotations that mark releases in your PostHog timeline. Prerequisites GitHub repository with Actions enabled PostHog dev project API key for integration tests PostHog personal API key for deployment annotations npm/pnpm project with vitest or jest Instructions Tool discipline Use Read to inspect the relevant configuration and implementation before proposing changes. Use Write only for a new, explicitly requested artifact inside the target project. Use Edit for minimal changes to existing project files after the evidence pass. Step 1: Configure GitHub Secrets Step 2: GitHub Actions Workflow Step 3: Unit Tests with Mocked PostHog Step 4: Integration Tests (Real PostHog Project) Step 5: Package Scripts Error Handling Issue Cause Solution ------- ------- ---------- Integration tests fail in CI Secret not configured Run gh secret set POSTHOGTESTKEY Tests timeout PostHog unreachable from CI runner Increase timeout, add retry Annotation fails Wrong personal key Verify phx key, check project ID Mock type mismatch PostHog SDK updated Update mock to match new SDK exports Output Unit test suite with mocked PostHog (runs everywhere, no keys needed) Integration test suite against PostHog dev project (runs on main only) Deployment annotations marking each release in PostHog timeline GitHub Actions workflow with proper secret management Examples For a Next.js service, inspect the analytics wrapper and test setup, add a mocked capture contract, and gate the workflow on type checks plus the focused test. Report the changed files, commands run, and whether a deployment annotation remains opt-in behind protected credentials. Resources See official PostHog references for current authority and verification boundaries. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/posthog-ci-integration