agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/posthog/SKILL.md

posthog

Skill13 starsChanged 27 days agoMITView on GitHub

  • Installs packages

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use hubspot and n8n.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • refly-aiSkill

    hubspot

    Integrate with HubSpot for CRM management. Use when you need to: (1) manage contacts and deals, (2) track sales pipelines, or (3) automate marketing and CRM workflows.

    Also in 4 projects that use this

  • rawvegSkill

    n8n

    N8N Documentation - Workflow automation platform with AI capabilities

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When a user signs up, call posthog.identify() to map their internal DB ID to their analytics profile.

    line 12
  2. Distinctive:

    Do not log PII (Passwords, SSNs, raw financial data) to PostHog.

    line 22
  3. Distinctive:

    If events are missing in the dashboard, verify that you are flushing the queue before the serverless function (e.g., AWS Lambda) terminates.

    line 31
  4. Distinctive:

    Use this when your agent works with posthog — structured patterns beat pasted docs and prevent common hallucinations.

    line 40

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PostHog API Skill

Quick Start

PostHog provides complete product analytics. The Node.js SDK allows you to capture events, identify users, and evaluate feature flags from your backend.

npm install posthog-node

Common Workflows

User Identification and Events

When a user signs up, call posthog.identify() to map their internal DB ID to their analytics profile. Then, call posthog.capture() for key backend actions (e.g., 'Subscription Created').

Production Patterns

Feature Flag Evaluation

Evaluate feature flags on the backend before returning UI states. Use posthog.getFeatureFlag(flagKey, distinctId) to gate beta features securely. Local evaluation can dramatically speed up flag checks without hitting the API.

Error Recovery

The posthog-node SDK batches events and flushes them asynchronously. Ensure you call await posthog.shutdown() during your application's graceful shutdown sequence, or you will lose pending events.

Security Notes

Do not log PII (Passwords, SSNs, raw financial data) to PostHog. Scrub payloads before capture. Utilize PostHog's proxy capabilities to bypass ad-blockers securely.

Performance Considerations

Backend feature flag evaluation requires a network round-trip unless you configure Local Evaluation, which periodically syncs flag definitions and evaluates them entirely in-memory.

Testing Guidance

Disable PostHog in unit tests by passing a dummy API key and setting enable: false in the client configuration, or mock the posthog module entirely.

Troubleshooting

If events are missing in the dashboard, verify that you are flushing the queue before the serverless function (e.g., AWS Lambda) terminates. Standard asynchronous event capture will be killed instantly in Lambda.

References

Related Skills

  • Mixpanel

Why use this skill

Use this when your agent works with posthog — structured patterns beat pasted docs and prevent common hallucinations.

AI pitfalls

  • Using outdated SDK or API versions from training data
  • Inventing environment variable names
  • Omitting error handling and retry logic

Production checklist

  • Secrets in environment variables, not source code
  • Error handling and logging in place
  • Rate limits and timeouts configured

Related skills

  • mixpanel — related to

Last Verified: 2026-07-02

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.