Agent skill

Posthog Deploy Integration

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

Deploy a PostHog application integration with correct regional hosts, reverse-proxy coverage, server lifecycle, and rollback checks.

MITAuto-check passedDevOps & Cloud

Install Posthog Deploy Integration

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-deploy-integration -a claude-code

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

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

At a glance

Deploy a PostHog application integration with correct regional hosts, reverse-proxy coverage, server lifecycle, and rollback checks.

  • Works in 5 steps: Next.js + Vercel Deployment → Server-Side Capture in Vercel Edge… → Validate the Proxy and Rollback Boundary → …
  • Shipping PostHog instrumentation to a hosted application
  • SKILL.md covers Overview, Prerequisites, Instructions and Error Handling, plus 4 more sections
  • Calls vercel, curl and gcloud; reaches us.i.posthog.com and us-assets.i.posthog.com; needs NEXT_PUBLIC_POSTHOG_KEY and POSTHOG_FEATURE_FLAGS_SECURE_API_KEY

What it does

Posthog Deploy Integration is an agent skill from jeremylongshore/tons-of-skills-marketplace. Deploy a PostHog application integration with correct regional hosts, reverse-proxy coverage, server lifecycle, and rollback checks. Use when shipping PostHog instrumentation to a hosted application. Trigger with "deploy PostHog", "PostHog Vercel", or "PostHog reverse proxy".

Its SKILL.md is about 2k 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, covering Cloud networking and Deployment. It works with PostHog and Vercel. 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

  • Shipping PostHog instrumentation to a hosted application
  • With deploy PostHog
  • PostHog reverse proxy

Example prompts

  • “deploy PostHog”
  • “PostHog Vercel”
  • “PostHog reverse proxy”
  • “/posthog-deploy-integration”

Requirements

  • A credential in NEXT_PUBLIC_POSTHOG_KEY
  • A credential in POSTHOG_FEATURE_FLAGS_SECURE_API_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(vercel:*), Bash(fly:*), Bash(gcloud:*)

Workflow steps

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

  1. Next.js + Vercel Deployment
  2. Server-Side Capture in Vercel Edge Functions
  3. Validate the Proxy and Rollback Boundary
  4. Google Cloud Run Deployment
  5. Deploy Annotation (Mark Deployments in PostHog)

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(vercel:*)
    • Bash(fly:*)
    • Bash(gcloud:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • vercel
    • curl
    • gcloud
    • git
    • 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.i.posthog.com
    • us-assets.i.posthog.com
    • 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:

    • NEXT_PUBLIC_POSTHOG_KEY
    • POSTHOG_FEATURE_FLAGS_SECURE_API_KEY
    • 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 Deploy Integration loads about 2k tokens when it runs, and up to ~2.2k if it reads all its reference files. Until then it costs about 76 tokens; SKILL.md has 405 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~76
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.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). 405 words, ~2,006 tokens.

Download SKILL.mdSave it as .claude/skills/posthog-deploy-integration/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
posthog-deploy-integration
description
Deploy a PostHog application integration with correct regional hosts, reverse-proxy coverage, server lifecycle, and rollback checks. Use when shipping PostHog instrumentation to a hosted application. Trigger with "deploy PostHog", "PostHog Vercel", or "PostHog reverse proxy".
allowed-tools
Read, Write, Edit, Bash(vercel:*), Bash(fly:*), Bash(gcloud:*)
compatibility
Designed for Claude Code
argument-hint
[project-path] [deployment-platform]
version
1.14.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, posthog, deployment

PostHog Deploy Integration

Overview

Ship an application's PostHog integration with regional routing, a supported reverse proxy, server-side flushing, validation evidence, and an instrumentation rollback. This workflow deploys the application integration; it does not present open-source self-hosting as a supported production PostHog service.

Prerequisites

  • PostHog project API key (phc_...)
  • A feature flags secure API key only when server-side local evaluation is required
  • A scoped private-API credential only when deployment annotations are required
  • Platform CLI installed (vercel, fly, or gcloud)

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. Use the vercel, fly, or gcloud Bash allowance only for the deployment platform actually selected by the user.

Step 1: Next.js + Vercel Deployment
bash
set -euo pipefail
# Set environment variables in Vercel
vercel env add NEXT_PUBLIC_POSTHOG_KEY production     # phc_... (public)
vercel env add NEXT_PUBLIC_POSTHOG_HOST production    # /ingest (if using proxy)
vercel env add POSTHOG_FEATURE_FLAGS_SECURE_API_KEY production # only for local evaluation
vercel env add POSTHOG_PERSONAL_API_KEY production    # only for scoped private API automation
vercel env add POSTHOG_PROJECT_ID production          # Project ID number
typescript
// next.config.js — Reverse proxy to bypass ad blockers
module.exports = {
  async rewrites() {
    return [
      {
        source: '/ingest/static/:path*',
        destination: 'https://us-assets.i.posthog.com/static/:path*',
      },
      {
        source: '/ingest/:path*',
        destination: 'https://us.i.posthog.com/:path*',
      },
    ];
  },
};
typescript
// app/providers.tsx — Client-side PostHog with proxy
'use client';
import posthog from 'posthog-js';
import { PostHogProvider } from 'posthog-js/react';
import { useEffect } from 'react';

export function PHProvider({ children }: { children: React.ReactNode }) {
  useEffect(() => {
    posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
      api_host: '/ingest', // Routes through your domain's reverse proxy
      capture_pageview: false, // Handle manually in App Router
      capture_pageleave: true,
    });
  }, []);

  return <PostHogProvider client={posthog}>{children}</PostHogProvider>;
}
Step 2: Server-Side Capture in Vercel Edge Functions
typescript
// app/api/track/route.ts — Server-side event capture
import { PostHog } from 'posthog-node';
import { NextResponse } from 'next/server';

export const runtime = 'edge';

export async function POST(request: Request) {
  const body = await request.json();
  const { userId, event, properties } = body;

  const posthog = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
    host: 'https://us.i.posthog.com',
    flushAt: 1,       // Immediate flush in serverless
    flushInterval: 0,
  });

  try {
    posthog.capture({ distinctId: userId, event, properties });
    await posthog.shutdown(); // CRITICAL: flush before function exits
    return NextResponse.json({ status: 'ok' });
  } catch (error) {
    return NextResponse.json({ error: 'capture failed' }, { status: 500 });
  }
}
Step 3: Validate the Proxy and Rollback Boundary
bash
set -euo pipefail
# Use the deployed application URL; do not test against a guessed region.
: "${APPLICATION_URL:?Set the deployed application URL}"
: "${NEXT_PUBLIC_POSTHOG_KEY:?Set the public project token}"

# Static asset and flag routes should traverse the same proxy configuration.
curl -fsSI "$APPLICATION_URL/ingest/static/array.js" | head -n 1
curl -fsS -X POST "$APPLICATION_URL/ingest/flags/?v=2" \
  -H 'Content-Type: application/json' \
  -d "{\"api_key\":\"$NEXT_PUBLIC_POSTHOG_KEY\",\"distinct_id\":\"deployment-proxy-check\"}" \
  | jq '{errorsParsingFlags, flags}'

The rollback must disable the new SDK initialization or restore the previous proxy mapping without blocking the application. PostHog's open-source self-hosted distribution is explicitly a hobbyist, single-machine option with limited support and no recovery guarantee; evaluate it as a separate infrastructure project, not as a step in this application-deployment workflow.

Step 4: Google Cloud Run Deployment
bash
set -euo pipefail
# Reference secrets that were created through the organization's approved secret workflow.
gcloud secrets describe posthog-project-token >/dev/null
gcloud secrets describe posthog-feature-flags-secure-key >/dev/null

# Deploy with PostHog secrets
gcloud run deploy my-app \
  --image gcr.io/my-project/my-app:latest \
  --set-secrets "NEXT_PUBLIC_POSTHOG_KEY=posthog-project-token:latest" \
  --set-secrets "POSTHOG_FEATURE_FLAGS_SECURE_API_KEY=posthog-feature-flags-secure-key:latest" \
  --set-env-vars "POSTHOG_HOST=https://us.i.posthog.com" \
  --region us-central1 \
  --allow-unauthenticated
Step 5: Deploy Annotation (Mark Deployments in PostHog)
bash
set -euo pipefail
# Create annotation on each deploy so you can correlate metric changes with releases
curl -X POST "https://us.posthog.com/api/projects/$POSTHOG_PROJECT_ID/annotations/" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"content\": \"Deploy: $(git rev-parse --short HEAD) — $(git log -1 --pretty=%s)\",
    \"date_marker\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",
    \"scope\": \"project\"
  }"
Show full SKILL.md (183 more words)Show less

Error Handling

IssueCauseSolution
Events not appearingWrong api_hostUse us.i.posthog.com (not app.posthog.com)
Ad blocker blocks eventsDirect PostHog requestsSet up reverse proxy via Next.js rewrites
Edge function events lostNo shutdown() callAlways await posthog.shutdown() in serverless
Proxy assets load but flags failProxy does not cover /flagsCompare all proxy paths with the official platform guide
Cloud Run cold start lagClient initialized per requestReuse a module-scoped client where the runtime permits it and flush at lifecycle boundaries

Output

  • Application integration deployed to the chosen platform with credential boundaries documented
  • Reverse proxy enabled for ad blocker bypass (Vercel/Next.js)
  • Server-side event capture with proper shutdown hooks
  • Deployment annotations marking releases in PostHog timeline

Examples

For a Vercel-hosted Next.js app, verify the region-specific ingest and asset routes, keep private keys server-only, test capture and flags through the proxy, and record a rollback that disables instrumentation without blocking the application.

Resources

See official PostHog references for current authority and verification boundaries.

Next Steps

For webhook handling, see posthog-webhooks-events.

© 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-deploy-integration of jeremylongshore/tons-of-skills-marketplace.

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

Open the folder on GitHubat commit cfae287

Compare with similar skills

Posthog Deploy Integration 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 Deploy Integration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Posthog Deploy Integration this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2kAutomated safety check: PassMIT
Frontmcp Deploymentagentfront/frontmcp146—~9.2kAutomated safety check: NotesApache-2.0
Vercelremotion-dev/remotion63k—~1.2kAutomated safety check: PassCustom licence
Use Vercel Actionamondnet/vercel-action764—~2.7kAutomated safety check: PassMIT
Deployments Cicdvercel/vercel-plugin3011 repos~3kAutomated safety check: PassCustom licence
Nullprivate DeployNullPrivate/NullPrivate111—~2kAutomated safety check: PassGPL-3.0

Similar skills

  • Frontmcp Deployment

    agentfront/frontmcp

    A skill your agent uses when deploying, building for production, packaging, or shipping a FrontMCP server.

    146 GitHub stars~9.2k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Vercel

    remotion-dev/remotion

    Official

    Set up a Codex monitor for Vercel deployments and preview URLs.

    63k GitHub stars~1.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Use Vercel Action

    amondnet/vercel-action

    Wire amondnet/vercel-action into a GitHub Actions workflow to deploy Vercel projects from CI.

    764 GitHub stars~2.7k tokensUpdated 2 mo ago
    DevOps & CloudAuto-check passed
  • Deployments Cicd

    vercel/vercel-plugin

    Official

    Vercel deployment and CI/CD expert guidance. An agent skill from vercel/vercel-plugin.

    301 GitHub starsUsed in 1 repo~3k tokens
    DevOps & CloudAuto-check passed
  • Nullprivate Deploy

    NullPrivate/NullPrivate

    构建并发布 NullPrivate 镜像到阿里云容器镜像服务,更新 k3s 工作负载并完成 rollout、镜像 digest、Pod、Service、Gateway/Ingress、HTTPS 与 DNS/DoH 验收。Use when: 推送 dev 镜像、发布 NullPrivate、更新 public3 Pod、部署 adguardprivate、回滚 public3、检查…

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

    gotempsh/temps

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

    831 GitHub stars~2.9k 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

Works with

Categories

Questions about Posthog Deploy Integration

What does Posthog Deploy Integration do?

Deploy a PostHog application integration with correct regional hosts, reverse-proxy coverage, server lifecycle, and rollback checks. Posthog Deploy Integration is an agent skill from jeremylongshore/tons-of-skills-marketplace. Deploy a PostHog application integration with correct regional hosts, reverse-proxy coverage, server lifecycle, and rollback checks.

When should I use Posthog Deploy Integration?

Posthog Deploy Integration fits situations like: shipping PostHog instrumentation to a hosted application; with deploy PostHog; postHog reverse proxy.

How do I install Posthog Deploy Integration in Claude Code?

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

How do I install Posthog Deploy Integration in Codex?

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

Can I use Posthog Deploy Integration 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-deploy-integration -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-deploy-integration, .gemini/skills/posthog-deploy-integration, .github/skills/posthog-deploy-integration and .opencode/skills/posthog-deploy-integration in your project.

What does Posthog Deploy Integration need to run?

Going by SKILL.md and its folder, Posthog Deploy Integration needs the command-line tools its instructions call (vercel, curl, gcloud, git and jq) and credentials named NEXT_PUBLIC_POSTHOG_KEY, POSTHOG_FEATURE_FLAGS_SECURE_API_KEY and POSTHOG_PERSONAL_API_KEY. Our summary lists: A credential in NEXT_PUBLIC_POSTHOG_KEY; A credential in POSTHOG_FEATURE_FLAGS_SECURE_API_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(vercel:*), Bash(fly:*), Bash(gcloud:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Posthog Deploy Integration access the network?

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

Is Posthog Deploy Integration 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 Deploy Integration use?

Posthog Deploy Integration 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 Deploy Integration use?

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

What are the alternatives to Posthog Deploy Integration?

Skills that share tags, products or a category with Posthog Deploy Integration: Frontmcp Deployment (agentfront/frontmcp, 146 stars), Vercel (remotion-dev/remotion, 63k stars), Use Vercel Action (amondnet/vercel-action, 764 stars) and Deployments Cicd (vercel/vercel-plugin, 301 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Posthog Deploy Integration?

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.