posthog-instrumentation
БесплатноБез исполняемых скриптовНе проверенProduct analytics with posthog. Use when adding a meaningful user action or feature in `web/**`, touching PostHog capture code, changing session replay or its…
от langfuse★ 38 069 звёзд на GitHubОб этом скилле
PostHog Instrumentation
One idea: every event exists to answer a question ("how do people filter?", "v3 vs v4?"), and it captures shape/metadata — NEVER raw values. If you cannot name the question an event answers, do not add it. If a property could contain user content, that is a bug.
Propose instrumentation when adding a frontend action
When adding a meaningful user action to web/**, decide explicitly whether it
should emit an event — do not skip the question silently.
- Meaningful: a new feature surface, a funnel step (open → configure → submit), an adoption signal the team would act on, a mode/view switch that segments behavior.
- Not meaningful: styling, refactors, hover states, programmatic state changes, anything autocapture-grade. Capture the critical path, not everything — event bloat is an anti-pattern.
- If meaningful: write a one-line tracking plan (question → event → props → key dimension) and include it in the plan or PR description. If deliberately not instrumenting, say so in one sentence.
The Langfuse pattern (match it exactly)
- Hook:
usePostHogClientCapture()→capture(eventName, props?)(usePostHogClientCapture.ts). The component calls the hook'scapture— it never imports or touchesposthogdirectly. The only client-side exceptions are app-shell infrastructure in_app.tsx($pageview,identify,register). - Names =
resource:action, snake_case action. Enforced by the typed registry — theeventsobject +EventNametype in that file. New events MUST be added to the registry or they will not typecheck (e.g.saved_views:view_selected,table:filter_builder_open). Names are static strings only — never interpolate (apage_view_${name}explodes into un-analyzable definitions). Event names cannot be renamed after they exist — version instead (…_v2). - Props: camelCase, metadata-only. IDs of enums / counts / booleans /
lengths — never content. Property naming:
objectAdjective(filterType,valueCount),is/hasprefix for booleans (isV4,hasFreeText),Date/Timestampsuffix for times. - Global dimensions ride as a super property registered once in
_app.tsx(e.g.v4BetaEnabledviaposthog.register, removed on sign-out viaposthog.unregister) so they attach to every event. Also put a per-event copy on events where the value at the moment of the action matters (Rule 4). For org/project-level segmentation, PostHog group analytics is the documented mechanism — see references/posthog-code-patterns.md §4. - Server-side events are separate. A few server paths capture via
ServerPosthog(e.g.cloud_signup_complete, playground analytics) with event names distinct from any frontend event — keep it that way; reusing a name across client and server double-counts. - The HIPAA region runs NO product analytics. Both entry points gate on
productAnalyticsAvailability.ts: the browser SDK (posthog-js) is only initialized whengetPostHogClientConfig()returns a config —init()itself fetches remote config, so skip it rather than opting out after. The server SDK (posthog-node, viaServerPosthog) is constructed as usual, thendisable()d whenisProductAnalyticsAvailable()is false. Missing env vars are NOT a gate —ServerPosthogfalls back to Langfuse's telemetry key. Never add a per-call-site region list, and never construct a PostHog client that bypasses that module.
The 6 rules (each earned the hard way on LFE-10781 / PR #14929)
- PRIVACY is rule #1 — metadata only, never raw values. Safe:
type,column,operator,key(a field name, not a value), counts (valueCount,conditionCount), lengths (queryLength= char count, NOT the text), enums (trigger,reason),tableName, booleans. Never: the raw filtervalue, search text, the AI prompt, userId/sessionId, metadata content, tag names. ⚠ Real leak:table:filter_builder_closesent{ filter: filterState }— the whole filter including values → PII in PostHog. Fixed to{ filterCount }in #14929. Grep any event you touch for a raw value. 💡 How PostHog itself keeps PII out (see references/posthog-code-patterns.md §2): not SDK denylists — the payload only accepts metadata. Encode "counts/lengths/booleans/enums only" into parameter types (raw content → a type error) and sharedsanitize*()helpers for complex objects. Reserve a client-sidebefore_sendhook for last-mile secrets (tokens in URLs/share links) and for disabling capture on publicly-embedded views — a backstop, not the primary defense.
2
Установить posthog-instrumentation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл posthog-instrumentation?
Product analytics with posthog. Use when adding a meaningful user action or feature in `web/**`, touching PostHog capture code, changing session replay or its privacy boundaries, or answering product-usage questions.
Как установить скилл posthog-instrumentation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл posthog-instrumentation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic