Agent skill

Posthog Core Workflow A

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

Design and implement a governed PostHog event taxonomy with capture, identity, group, and property contracts.

MITAuto-check passedBackend & APIs

Install Posthog Core Workflow A

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

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

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

At a glance

Design and implement a governed PostHog event taxonomy with capture, identity, group, and property contracts.

  • Works in 6 steps: Define Event Taxonomy → Capture Events (Browser) → Identify Users and Set Properties → …
  • Instrumenting a product workflow
  • SKILL.md covers Overview, Prerequisites, Instructions and Error Handling, plus 4 more sections
  • Calls curl; reaches us.i.posthog.com and us.posthog.com; needs NEXT_PUBLIC_POSTHOG_KEY and POSTHOG_PERSONAL_API_KEY

What it does

Posthog Core Workflow A is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design and implement a governed PostHog event taxonomy with capture, identity, group, and property contracts. Use when instrumenting a product workflow or repairing inconsistent analytics events. Trigger with "PostHog analytics", "capture events", or "PostHog identify".

Its SKILL.md is about 1.9k 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 Backend & APIs. It works with PostHog. 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

  • Instrumenting a product workflow
  • Repairing inconsistent analytics events
  • With PostHog analytics
  • PostHog identify

Example prompts

  • “PostHog analytics”
  • “capture events”
  • “PostHog identify”
  • “/posthog-core-workflow-a”

Requirements

  • A credential in NEXT_PUBLIC_POSTHOG_KEY
  • 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:*), Grep

Workflow steps

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

  1. Define Event Taxonomy
  2. Capture Events (Browser)
  3. Identify Users and Set Properties
  4. Group Analytics (B2B Company Tracking)
  5. Server-Side Event Capture (posthog-node)
  6. Create Annotations for Context

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:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl

    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.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_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 Core Workflow A loads about 1.9k tokens when it runs, and up to ~2.1k if it reads all its reference files. Until then it costs about 74 tokens; SKILL.md has 315 words of instructions outside code blocks.

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

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). 315 words, ~1,856 tokens.

Download SKILL.mdSave it as .claude/skills/posthog-core-workflow-a/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
posthog-core-workflow-a
description
Design and implement a governed PostHog event taxonomy with capture, identity, group, and property contracts. Use when instrumenting a product workflow or repairing inconsistent analytics events. Trigger with "PostHog analytics", "capture events", or "PostHog identify".
allowed-tools
Read, Write, Edit, Bash(npm:*), Grep
compatibility
Designed for Claude Code
argument-hint
[project-path] [workflow-name]
version
1.14.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, posthog, workflow, analytics

PostHog Core Workflow A — Product Analytics

Overview

Primary PostHog workflow covering event capture, user identification, group analytics, and person properties. This is the foundation for all PostHog analytics: capturing what users do, linking events to identified users, and grouping users by company/team for B2B analytics.

Prerequisites

  • Completed posthog-install-auth setup
  • posthog-js (browser) and/or posthog-node (server) installed
  • Project API key (phc_...) configured

Instructions

Tool discipline

Use Read to inspect the relevant configuration and implementation before proposing changes. Use Grep to locate initialization, capture, flag, and credential boundaries. 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: Define Event Taxonomy
typescript
// src/analytics/events.ts
// Define all events as typed constants for consistency
export const EVENTS = {
  // User lifecycle
  USER_SIGNED_UP: 'user_signed_up',
  USER_LOGGED_IN: 'user_logged_in',
  USER_ONBOARDING_COMPLETED: 'user_onboarding_completed',

  // Core product actions
  FEATURE_USED: 'feature_used',
  ITEM_CREATED: 'item_created',
  ITEM_UPDATED: 'item_updated',
  ITEM_DELETED: 'item_deleted',
  SEARCH_PERFORMED: 'search_performed',
  EXPORT_COMPLETED: 'export_completed',

  // Revenue events
  SUBSCRIPTION_STARTED: 'subscription_started',
  SUBSCRIPTION_UPGRADED: 'subscription_upgraded',
  SUBSCRIPTION_CANCELED: 'subscription_canceled',
  PAYMENT_COMPLETED: 'payment_completed',
} as const;

// Standard property schema for consistency across events
interface BaseProperties {
  source?: 'web' | 'mobile' | 'api' | 'webhook';
  plan_tier?: 'free' | 'pro' | 'enterprise';
  duration_ms?: number;
}
Step 2: Capture Events (Browser)
typescript
import posthog from 'posthog-js';
import { EVENTS } from './events';

// Custom event with properties
posthog.capture(EVENTS.ITEM_CREATED, {
  item_type: 'document',
  source: 'web',
  plan_tier: 'pro',
});

// Timed event (measure duration)
const start = performance.now();
await doExpensiveOperation();
posthog.capture(EVENTS.EXPORT_COMPLETED, {
  format: 'csv',
  row_count: 1500,
  duration_ms: Math.round(performance.now() - start),
});

// Pageview with custom properties (if capture_pageview: false)
posthog.capture('$pageview', {
  page_title: document.title,
  referrer: document.referrer,
});
Step 3: Identify Users and Set Properties
typescript
// After user logs in — links anonymous events to this user
posthog.identify('user-456', {
  // $set properties (persist, overwrite on change)
  email: 'jane@acme.com',
  name: 'Jane Smith',
  plan: 'enterprise',
  signup_date: '2025-06-15',
});

// Update properties later without re-identifying
posthog.people.set({
  last_active: new Date().toISOString(),
  total_items: 42,
});

// Set properties only if not already set ($set_once)
posthog.people.set_once({
  first_seen: new Date().toISOString(),
  original_referrer: document.referrer,
});

// Unset properties
posthog.people.unset(['deprecated_field']);

// Reset on logout (clears distinct_id, starts new anonymous session)
posthog.reset();
Step 4: Group Analytics (B2B Company Tracking)
typescript
// Associate user with a company group
posthog.group('company', 'company-789', {
  name: 'Acme Corp',
  industry: 'SaaS',
  plan: 'enterprise',
  employee_count: 150,
  arr: 250000,
});

// Events now automatically include company context
posthog.capture(EVENTS.FEATURE_USED, {
  feature_name: 'bulk-export',
});
// This event is attributed to both user-456 AND company-789

// Multiple group types
posthog.group('team', 'team-alpha', { name: 'Alpha Team' });
Step 5: Server-Side Event Capture (posthog-node)
typescript
import { PostHog } from 'posthog-node';

const posthog = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
  host: 'https://us.i.posthog.com',
});

// Server-side capture (e.g., in API route or webhook handler)
function trackServerEvent(userId: string, event: string, properties?: Record<string, any>) {
  posthog.capture({
    distinctId: userId,
    event,
    properties: {
      ...properties,
      source: 'api',
    },
  });
}

// Identify with server-side properties
posthog.identify({
  distinctId: 'user-456',
  properties: {
    subscription_status: 'active',
    mrr: 99,
  },
});

// Group identify from server
posthog.groupIdentify({
  groupType: 'company',
  groupKey: 'company-789',
  properties: {
    plan: 'enterprise',
    total_seats: 50,
  },
});

// CRITICAL: Flush in serverless/edge functions
await posthog.flush();
Step 6: Create Annotations for Context
bash
set -euo pipefail
# Mark a deployment or product change in PostHog
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": "v2.5.0 deployed — new checkout flow",
    "date_marker": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'",
    "scope": "project"
  }'

Error Handling

ErrorCauseSolution
Events not appearingposthog.init not calledEnsure init runs before any capture
Anonymous/identified splitDifferent distinct_id across platformsUse consistent user ID from your auth system
Group data missingposthog.group() not calledCall group() before capture for group attribution
Server events lostNo flush() in serverlessAlways call await posthog.flush() before response
Properties not updatingUsing $set_once for mutable dataUse posthog.people.set() for values that change

Output

  • Typed event taxonomy for consistent tracking
  • Browser event capture with user identification
  • B2B group analytics linking users to companies
  • Server-side event capture with proper flushing
  • Annotations marking deployments and product changes

Examples

For a B2B checkout flow, define stable event names and properties, identify only after authentication, attach the company group, and add focused capture tests. Produce an instrumentation table plus the exact files changed and validation evidence.

Resources

See official PostHog references for current authority and verification boundaries.

Next Steps

For feature flags and experiments, see posthog-core-workflow-b.

© 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-core-workflow-a of jeremylongshore/tons-of-skills-marketplace.

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

Open the folder on GitHubat commit cfae287

Compare with similar skills

Posthog Core Workflow A 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 Core Workflow A compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Posthog Core Workflow A this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.9kAutomated safety check: PassMIT
Feature Flagspeakeasy-api/gram273—~2.6kAutomated safety check: PassAGPL-3.0
tRPC Release Compatibility Checksuperset-sh/superset15k—~1.7kAutomated safety check: PassCustom licence
Adding Personhog RpcPostHog/posthog40k—~2.1kAutomated safety check: PassCustom licence
Authoring Error Tracking AlertsPostHog/posthog40k—~2.8kAutomated safety check: PassCustom licence
Improving Drf EndpointsPostHog/posthog40k—~3kAutomated safety check: PassCustom licence

Similar skills

  • Feature Flag

    speakeasy-api/gram

    A skill your agent uses when gating a feature behind a flag, dogfooding or gradually rolling out a change, choosing between productfeatures and PostHog feature flags, adding or checking a product…

    273 GitHub stars~2.6k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Checks whether a tRPC procedure change is safe for released desktop, mobile, CLI and SDK builds, picks a compatible pattern and decides when a deprecated procedure can go.

    15k GitHub stars~1.7k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Adding Personhog Rpc

    PostHog/posthog

    Official

    Guide for adding a new RPC to personhog-replica and personhog-router.

    40k GitHub stars~2.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Official

    Author error tracking alerts that fire when an issue is created, reopened, or starts spiking.

    40k GitHub stars~2.8k tokensUpdated today
    Backend & APIsAuto-check passed
  • Official

    A skill your agent uses when editing, reviewing, or auditing DRF viewsets and serializers in PostHog.

    40k GitHub stars~3k tokensUpdated today
    Backend & APIsAuto-check passed
  • Official

    Guides PostHog engineers through dashboard widget platform work — ship a new widgettype (WIDGETREGISTRY, catalog, runwidgets, WidgetCard) or update a shipped type (config, query, layout, RBAC, tile…

    40k GitHub stars~2.3k tokensUpdated today
    Backend & APIsAuto-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 yesterday
    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 yesterday
    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 yesterday
    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 yesterday
    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 yesterday
    Auto-check passed

Works with

Categories

Questions about Posthog Core Workflow A

What does Posthog Core Workflow A do?

Design and implement a governed PostHog event taxonomy with capture, identity, group, and property contracts. Posthog Core Workflow A is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design and implement a governed PostHog event taxonomy with capture, identity, group, and property contracts.

When should I use Posthog Core Workflow A?

Posthog Core Workflow A fits situations like: instrumenting a product workflow; repairing inconsistent analytics events; with PostHog analytics; postHog identify.

How do I install Posthog Core Workflow A in Claude Code?

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

How do I install Posthog Core Workflow A in Codex?

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

Can I use Posthog Core Workflow A 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-core-workflow-a -a cursor` (or -a -a, -a or -a for the others). To copy it by hand, put the folder in .cursor/skills/posthog-core-workflow-a, .gemini/skills/posthog-core-workflow-a, .github/skills/posthog-core-workflow-a and .opencode/skills/posthog-core-workflow-a in your project.

What does Posthog Core Workflow A need to run?

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

Does Posthog Core Workflow A access the network?

SKILL.md names 3 domains. In commands or code: us.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 Core Workflow A 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 Core Workflow A use?

Posthog Core Workflow A 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 Core Workflow A use?

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

What are the alternatives to Posthog Core Workflow A?

Skills that share tags, products or a category with Posthog Core Workflow A: Feature Flag (speakeasy-api/gram, 273 stars), tRPC Release Compatibility Check (superset-sh/superset, 15k stars), Adding Personhog Rpc (PostHog/posthog, 40k stars) and Authoring Error Tracking Alerts (PostHog/posthog, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Posthog Core Workflow A?

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.