Agent skill

Posthog Migration Deep Dive

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

Plan and execute a controlled historical migration into PostHog with identity mapping, timestamp validation, dual-write evidence, and rollback boundaries.

MITAuto-check passedDevOps & Cloud

Install Posthog Migration Deep Dive

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-migration-deep-dive -a claude-code

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

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-migration-deep-dive --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/posthog-migration-deep-dive .claude/skills/posthog-migration-deep-dive && 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
posthog-migration-deep-dive
GitHub stars
2.8k
Token cost
~1.8k tokens
SKILL.md length
720 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Plan and execute a controlled historical migration into PostHog with identity mapping, timestamp validation, dual-write evidence, and rollback boundaries.

  • Works in 6 steps: Event Name Mapping → Dual-Write Adapter → Historical Data Import → …
  • Moving from another analytics platform
  • SKILL.md covers Overview, Prerequisites, Authentication and Migration Types, plus 5 more sections
  • Calls curl and jq; reaches us.posthog.com; needs POSTHOG_PROJECT_TOKEN and POSTHOG_PERSONAL_API_KEY

What it does

Posthog Migration Deep Dive is an agent skill from jeremylongshore/tons-of-skills-marketplace. Plan and execute a controlled historical migration into PostHog with identity mapping, timestamp validation, dual-write evidence, and rollback boundaries. Use when moving from another analytics platform or PostHog region. Trigger with "migrate to PostHog", "PostHog historical import", or "PostHog dual write".

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

It sits in DevOps & Cloud. It works with PostHog and Google Analytics. 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

  • Moving from another analytics platform
  • With migrate to PostHog
  • PostHog historical import
  • PostHog dual write

Example prompts

  • “migrate to PostHog”
  • “PostHog historical import”
  • “PostHog dual write”
  • “/posthog-migration-deep-dive”

Requirements

  • Python 3
  • A credential in POSTHOG_PROJECT_TOKEN
  • A credential in POSTHOG_PERSONAL_API_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npm:*), Bash(node:*), Bash(kubectl:*)

Workflow steps

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

  1. Event Name Mapping
  2. Dual-Write Adapter
  3. Historical Data Import
  4. Batch Import via HTTP API
  5. Feature Flag Controlled Cutover
  6. Validation

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(node:*)
    • Bash(kubectl:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • jq

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • us.posthog.com

    Also links to:

    • posthog.com

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

  • Credentials

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

    • POSTHOG_PROJECT_TOKEN
    • POSTHOG_PERSONAL_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

Posthog Migration Deep Dive loads about 1.8k tokens when it runs, and up to ~2k if it reads all its reference files. Until then it costs about 85 tokens; SKILL.md has 720 words of instructions outside code blocks.

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

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). 720 words, ~1,825 tokens.

Download SKILL.mdSave it as .claude/skills/posthog-migration-deep-dive/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
posthog-migration-deep-dive
description
Plan and execute a controlled historical migration into PostHog with identity mapping, timestamp validation, dual-write evidence, and rollback boundaries. Use when moving from another analytics platform or PostHog region. Trigger with "migrate to PostHog", "PostHog historical import", or "PostHog dual write".
allowed-tools
Read, Write, Edit, Bash(npm:*), Bash(node:*), Bash(kubectl:*)
compatibility
Designed for Claude Code
argument-hint
[source-platform] [target-project]
version
1.14.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, posthog, migration

PostHog Migration Deep Dive

Overview

Migrate from Google Analytics, Mixpanel, Amplitude, or Segment to PostHog using a dual-write strategy (send events to both old and new platforms) followed by gradual traffic shifting. PostHog's capture API accepts events in a format similar to Segment's track/identify calls, making migration straightforward.

Prerequisites

  • A paid product analytics plan and a dedicated target project are confirmed for historical imports.
  • The event taxonomy, distinct-ID map, timestamp policy, and rollback owner are approved.
  • A representative sample can be validated before full ingestion.

Authentication

  • Use the target project's public project token only for event capture. It is an ingestion identifier, not a secret or a credential for private APIs.
  • Use a least-privilege personal API key or OAuth token for private project APIs, keep it in a secret manager, and never place it in browser code, logs, examples, or committed files.
  • If server-side local feature-flag evaluation is required, use a feature flags secure API key through the SDK's personalApiKey option; do not reuse a broadly scoped personal API key.
  • Select the matching US or EU host for the target project before any sample or bulk write.

Migration Types

SourcePrimary discovery riskEvidence required before import
Google Analytics (GA4)Event and identity models differApproved taxonomy and identity mapping
MixpanelSimilar names can hide property or identity driftSample export reconciliation
AmplitudeCohort and user-property semantics can differProperty and timestamp comparison
SegmentDestination behavior can differ from direct SDK captureDual-write sample and delivery logs
Custom analyticsSource semantics are implementation-specificSource contract, resumable export, and representative sample

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: Event Name Mapping

Create a reviewed mapping table with source event, target event, source property, target property, source identity, target distinct ID, timestamp conversion, consent class, and owner. Reject unknown identities, empty event names, invalid timestamps, and unreviewed PII instead of silently coercing them.

Step 2: Dual-Write Adapter

Wrap the existing analytics boundary once, apply the frozen mapping before either destination, and attach a migration-run identifier. Track delivery results separately for the legacy and PostHog paths. The application path must remain successful when either analytics destination fails, and the adapter must expose independent kill switches plus a bounded flush on shutdown.

Show full SKILL.md (316 more words)Show less
Step 3: Historical Data Import
typescript
import { PostHog } from 'posthog-node';

const importer = new PostHog(process.env.POSTHOG_PROJECT_TOKEN!, {
  host: process.env.POSTHOG_PUBLIC_HOST!,
  historicalMigration: true,
});

Historical imports require a paid product analytics plan even though the import itself is free. Use the Python or Node SDK, or the public batch endpoint, only with events dated at least 48 hours before import. Export to durable storage first, checkpoint every batch, preserve ISO 8601 timestamps and stable distinct IDs, and stop on the first reconciliation breach.

Step 4: Batch Import via HTTP API
json
{
  "api_key": "project-token-from-secret-source",
  "historical_migration": true,
  "batch": [
    {
      "event": "mapped_event_name",
      "properties": {"distinct_id": "stable-user-id", "migration_run": "approved-run-id"},
      "timestamp": "approved-iso-8601-timestamp"
    }
  ]
}

POST this shape to the selected regional /batch/ endpoint. Keep each request below the documented body-size limit, record its checkpoint and response, and never paste a real project token into a generated file or transcript.

Step 5: Feature Flag Controlled Cutover

Use explicit legacy, dual-write, and posthog-only states with legacy as the fail-closed default. If PostHog evaluates the cutover flag server-side, pass the feature flags secure API key through the SDK's personalApiKey option. Advance only after the approved observation window passes identity, count, property, timestamp, and business-metric reconciliation; roll back on any breach.

Step 6: Validation
bash
set -euo pipefail
# Compare event counts between old platform and PostHog
echo "=== PostHog Event Counts (last 7 days) ==="
curl "https://us.posthog.com/api/projects/$POSTHOG_PROJECT_ID/query/" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "kind": "HogQLQuery",
      "query": "SELECT event, count() AS total FROM events WHERE timestamp > now() - interval 7 day AND properties.migration_source = '"'"'dual-write'"'"' GROUP BY event ORDER BY total DESC LIMIT 20"
    }
  }' | jq '.results[] | {event: .[0], count: .[1]}'

Error Handling

IssueCauseSolution
Event counts don't matchSampling, identity, or timing differencesStop and compare against the migration's approved reconciliation tolerance
Historical import slowSingle-threadedUse batch endpoint, increase flushAt
Identity mismatchDifferent user ID formatsNormalize IDs in event map
Duplicate eventsDual-write without dedupUse migration_source property to filter

Output

  • Event name and property mapping from source platform
  • Dual-write adapter for gradual migration
  • Historical data import script
  • Feature flag controlled cutover plan
  • Validation queries comparing event counts

Examples

For a Mixpanel migration, freeze the event and identity map, run a tiny historical sample with historical_migration enabled, compare counts and properties, then expand in bounded batches. Keep live dual-write and historical import evidence separate, and stop on identity or timestamp drift.

Resources

See official PostHog references for current authority and verification boundaries.

© 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 1 other file (references) in skills/.curated/posthog-migration-deep-dive of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/official-docs.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Posthog Migration Deep Dive 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.

Posthog Migration Deep Dive compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Posthog Migration Deep Dive this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.8kAutomated safety check: PassMIT
Monitoring Capture ServicePostHog/posthog40k—~5kAutomated safety check: PassCustom licence
C15tc15t/c15t1.9k1 repos~1.6kAutomated safety check: PassApache-2.0
Soku CLIAbout-Intelligence/soku-cli306—~2.4kAutomated safety check: PassMIT
Telemetry AnalyticsOpenHands/OpenHands91k—~305Automated safety check: PassMIT
Temps Best Practicesgotempsh/temps833—~2.9kAutomated safety check: PassApache-2.0

Similar skills

  • Official

    Guide for using the Grafana MCP to monitor and diagnose the capture service (rust/capture) in production.

    40k GitHub stars~5k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • C15t

    c15t/c15t

    Work with c15t consent management docs, APIs, and integrations for Next.js, React, and JavaScript.

    1.9k GitHub starsUsed in 1 repo~1.6k tokens
    Legal & ComplianceAuto-check passed
  • Soku CLI

    About-Intelligence/soku-cli

    Guides an agent through the soku command line tool for ads, GA4 and PostHog data reads, ads writes, SEO hosting, automations, files and skill management.

    306 GitHub stars~2.4k tokensUpdated today
    Marketing & SEOAuto-check passed
  • Telemetry Analytics

    OpenHands/OpenHands

    This skill should be used when the user asks to "add tracking", "add a PostHog event", "change telemetry consent", "instrument onboarding", "debug analytics", or changes telemetry.ts…

    91k GitHub stars~305 tokensUpdated today
    DevOps & CloudAuto-check passed
  • Temps Best Practices

    gotempsh/temps

    Best-practices reference for preparing and instrumenting applications on Temps.

    833 GitHub stars~2.9k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Exploring Apm Traces

    PostHog/posthog

    Official

    Investigates distributed application performance using PostHog APM (OpenTelemetry span) data via MCP.

    40k GitHub stars~3.5k tokensUpdated today
    DevOps & CloudAuto-check passed

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

Questions about Posthog Migration Deep Dive

What does Posthog Migration Deep Dive do?

Plan and execute a controlled historical migration into PostHog with identity mapping, timestamp validation, dual-write evidence, and rollback boundaries. Posthog Migration Deep Dive is an agent skill from jeremylongshore/tons-of-skills-marketplace. Plan and execute a controlled historical migration into PostHog with identity mapping, timestamp validation, dual-write evidence, and rollback boundaries.

When should I use Posthog Migration Deep Dive?

Posthog Migration Deep Dive fits situations like: moving from another analytics platform; with migrate to PostHog; postHog historical import; postHog dual write.

How do I install Posthog Migration Deep Dive in Claude Code?

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

How do I install Posthog Migration Deep Dive in Codex?

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

Can I use Posthog Migration Deep Dive 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 posthog-migration-deep-dive -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/posthog-migration-deep-dive, .gemini/skills/posthog-migration-deep-dive, .github/skills/posthog-migration-deep-dive and .opencode/skills/posthog-migration-deep-dive in your project.

What does Posthog Migration Deep Dive need to run?

Going by SKILL.md and its folder, Posthog Migration Deep Dive needs the command-line tools its instructions call (curl and jq) and credentials named POSTHOG_PROJECT_TOKEN and POSTHOG_PERSONAL_API_KEY. Our summary lists: Python 3; A credential in POSTHOG_PROJECT_TOKEN; A credential in POSTHOG_PERSONAL_API_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Bash(node:*), Bash(kubectl:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Posthog Migration Deep Dive access the network?

SKILL.md names 2 domains. In commands or code: us.posthog.com; the agent is likely to contact it when it follows the instructions. As links in the text: posthog.com. This is read from the text; nothing was executed.

Is Posthog Migration Deep Dive 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 Posthog Migration Deep Dive use?

Posthog Migration Deep Dive 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 Posthog Migration Deep Dive use?

About 1.8k tokens (SKILL.md is roughly 7.3k 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 208 tokens, read only when the agent opens those files.

What are the alternatives to Posthog Migration Deep Dive?

Skills that share tags, products or a category with Posthog Migration Deep Dive: Monitoring Capture Service (PostHog/posthog, 40k stars), C15t (c15t/c15t, 1.9k stars), Soku CLI (About-Intelligence/soku-cli, 306 stars) and Telemetry Analytics (OpenHands/OpenHands, 91k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Posthog Migration Deep Dive?

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.