Skip to content
Skills Library
Programming · Tool integration

typescript-analytics

/typescript-analytics

Use when implementing analytics with PostHog in a TypeScript app — capturing events, identifying users, adding feature flags, tracking errors, or wiring API lifecycle telemetry. Triggers on edits to analytics integration files, or mentions of "PostHog", "analytics", "feature flag", "event tracking", "capture", "identify", "A/B test", or "experiment".

Repository
agentic-os ↗
Licence
MIT
Last repository change
22.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
8
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when implementing analytics with PostHog in a TypeScript app — capturing events, identifying users, adding feature flags, tracking errors, or wiring API lifecycle telemetry. Triggers on edits to analytics integration files, or mentions of "PostHog", "analytics", "feature flag", "event tracking", "capture", "identify", "A/B test", or "experiment".

Triggers from the description

PostHoganalyticsfeature flagevent trackingcaptureidentifyA/B testexperiment
Original author description

Use when implementing analytics with PostHog in a TypeScript app — capturing events, identifying users, adding feature flags, tracking errors, or wiring API lifecycle telemetry. Triggers on edits to analytics integration files, or mentions of "PostHog", "analytics", "feature flag", "event tracking", "capture", "identify", "A/B test", or "experiment".

How it works

  1. Universal Rules
  2. References
Original SKILL.md headings · 30 lines, 315 words
SKILL.md preview
---
name: typescript-analytics
description: Use when implementing analytics with PostHog in a TypeScript app — capturing events, identifying users, adding feature flags, tracking errors, or wiring API lifecycle telemetry. Triggers on edits to analytics integration files, or mentions of "PostHog", "analytics", "feature flag", "event tracking", "capture", "identify", "A/B test", or "experiment".
when_to_use: |
  Use when instrumenting event tracking, adding analytics calls, or working with PostHog integration in a TypeScript/Next.js app: adding or modifying event capture, user identification, feature flags, A/B test experiments, error tracking, or API lifecycle telemetry. Triggers on edits to PostHog or analytics modules, or any work that involves event enums, analytics wrapper functions, or PostHog client/server initialization.

  Not when: the task is building data pipelines, ETL jobs, or BigQuery integrations — use typescript-data-engineering. Not when the task is writing tests for analytics code — use typescript-testing-backend or typescript-testing-frontend. Not when the need is the skills library's own opt-in usage telemetry — use telemetry.
compatibility: Requires Bash (Python 3 where scripts are invoked). Works in Claude Code and Codex via install.sh.
---

# Analytics Engineering (PostHog + TypeScript)

You are operating as an analytics engineer. Your job is to ship telemetry that product can actually trust — explicit events, consistent naming, and full lifecycle coverage — never autocapture noise.

PostHog client/server SDKs integrated into a Next.js app via a unified `getPostHog()` getter, with proxied ingest to bypass ad blockers, typed event enums, and serverless-safe flush semantics. Covers explicit event capture, feature flags, error tracking, user identification, and source-map uploads.

## Universal Rules

1. **Never use autocapture** — all events must be explicit and registered in the project's event enum.
2. **Track the full lifecycle** — `cta_clicked` → `in_progress` → `success` / `error`.
3. **Use the unified pattern** — use the project's analytics wrapper functions for both client and server, not raw SDK imports.
4. **Flush immediately on server** — `flushAt: 1`, `flushInterval: 0`, always `shutdown()` in `finally`.
5. **Default flags to disabled** — `false` on error or when flags haven't loaded (fail-closed).
6. **Identify by user ID** — never by email; set email as a person property.
7. **Proxy through `/ph`** — never call PostHog directly from the client.
8. **Add new events to the project's event enum** — never use raw strings for event names.
9. **Include domain context** — slug, name, status, and relevant IDs in every event.
10. **Mask sensitive data** — wallet addresses should be masked in properties.

## References

- [references/setup-and-architecture.md](references/setup-and-architecture.md) — dependencies, proxy, init, env vars, file layout, unified client/server pattern, automatic metadata injection
- [references/event-tracking.md](references/event-tracking.md) — `EVENTS` enum, naming convention, `capturePostHogEvent`, `captureApiEvent`, manual capture example
- [references/typed-analytics.md](references/typed-analytics.md) — `ANALYTICS_EVENTS`, typed property maps, `Analytics` class, `useAnalytics` hook, pageview tracking
- [references/user-identification.md](references/user-identification.md) — `PosthogTrackIdentity`, identify by user ID, group membership
- [references/feature-flags.md](references/feature-flags.md) — `FEATURE_FLAGS` enum, client-side `useFeatureFlag`, server-side `checkFeatureFlag`/`getFeatureFlag`
- [references/error-tracking.md](references/error-tracking.md) — `capturePosthogError`, `useComponentError`, `ERROR_TYPES`, automatic API error tracking
- [references/properties-and-source-maps.md](references/properties-and-source-maps.md) — auto-injected metadata, commonly tracked properties, PostHog source map upload workflow
Files in this package (8)
  • SKILL.md 4 KB
  • references/error-tracking.md 2 KB
  • references/event-tracking.md 4 KB
  • references/feature-flags.md 2 KB
  • references/properties-and-source-maps.md 1 KB
  • references/setup-and-architecture.md 5 KB
  • references/typed-analytics.md 3 KB
  • references/user-identification.md 1 KB

Versions

The database has no other skills named typescript-analytics.

Database snapshot: 13.11.2026 · package version bd2e05f8e89a (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100api-analytics-posthog-analytics
    PostHog event tracking, user identification, group analytics for B2B, GDPR consent patterns. Use when implementing product analytics, tracking user behavior, setting up funnels, or configuring privacy-compliant tracking.
  • 100posthog-core-workflow-b
    Implement a safe PostHog feature-flag and experiment lifecycle with defaults, exposure integrity, rollout ownership, and cleanup. Use when releasing behind flags or running controlled experiments. Trigger with "PostHog feature flag", "PostHog experiment", or "A/B test".
  • 100agent-product-analytics-specialist
    Specialist subagent: PostHog, Mixpanel, Amplitude event tracking, funnels, cohorts, and A/B testing specialist. Use when implementing analytics, designing event schemas, or setting up experimentation. Trigger phrases: analytics, tracking, PostHog, Mixpanel, Amplitude, Segment,…
  • 100posthog-common-errors
    Diagnose PostHog ingestion, identity, feature-flag, SDK, and private-API failures from concrete evidence. Use when events are missing, flags return unexpected values, or PostHog requests fail. Trigger with "debug PostHog", "PostHog events missing", or "PostHog 401".
  • 100api-flags-posthog-flags
    PostHog feature flags, rollouts, A/B testing. Use when implementing gradual rollouts, A/B tests, kill switches, remote configuration, beta features, or user targeting with PostHog.
  • 100posthog
    PostHog is an open-source product analytics platform: event tracking, funnels, retention, session replay, feature flags and experiments in one tool, on PostHog Cloud or self-hosted. Use when someone asks to "add product analytics", "track events with PostHog", "set up session…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.