Dust Posthog Tracking logo

Dust Posthog Tracking

OrganizationPopular
dust-tt
dust-posthog-tracking

Track user interactions as PostHog events while implementing features in `front`, so their usage can be analysed later. Use when adding or changing a user-facing feature, flow, or surface, or when the user mentions PostHog, event tracking, or `trackEvent`.

Overview

Publisherdust-tt
Repositorydust
Skill namedust-posthog-tracking
Stars
1.5K
Forks
370
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dust-tt on GitHub. Read the source before you install it.

Installation

Install the Dust Posthog Tracking AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dust-tt/dust/tree/main/.claude/skills/dust-posthog-tracking
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dust-tt/dust.git /tmp/dust
mkdir -p .claude/skills
cp -r /tmp/dust/.claude/skills/dust-posthog-tracking .claude/skills/dust-posthog-tracking
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Dust Posthog Tracking in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Dust Posthog Tracking on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Dust Posthog Tracking is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

PostHog event tracking

A user-facing feature ships with the PostHog events needed to analyse how it is used. Add them in the same change as the feature, not as a follow-up.

What to track

Track the moments someone will ask about later:

  • a surface is shown (view, open)
  • a user acts on it (click, select, submit, dismiss, close)
  • the outcome of that action (create, delete, connect), and outcomes only the server knows (a limit hit, a request refused, a model downgraded)

Do not track UI plumbing (hover, scroll, re-render). Check what the feature already sends before adding: git grep -n "trackEvent\|withTracking" front/components/<feature>.

Client events

Use trackEvent or withTracking from @app/lib/tracking, never posthog directly. The event name is built as ${area}:${object}:${action}:

  • area: from TRACKING_AREAS, the product surface. Add a key only for a real new surface.
  • object: snake_case, stable, names the thing acted on (model_picker, suggestion_card). Put variants in extra, not in the object.
  • action: from TRACKING_ACTIONS, defaults to click.
tsx
<Button onClick={withTracking(TRACKING_AREAS.BUILDER, "create_agent", handleCreate)} />

trackEvent({
  area: TRACKING_AREAS.TOOLS,
  object: "tool_select",
  action: TRACKING_ACTIONS.SELECT,
  extra: { tool_id: serverView.sId },
});

A feature with several events gets one <feature>Tracking.ts module next to its components, with one typed helper per event. Components call the helpers. Models: front/components/model_picker/modelPickerTracking.ts, front/components/markdown/suggestion/suggestionTracking.ts.

Views fire from an effect, once per mount. For a list whose items change state, remember the ids already seen in a ref so each item counts once (model: useTrackSuggestionCardViews):

ts
const seenIds = useRef(new Set<string>());
useEffect(() => {
  for (const item of items) {
    if (!seenIds.current.has(item.id)) {
      seenIds.current.add(item.id);
      trackItemView(item.id);
    }
  }
}, [items]);

Server events

Use PostHogServerSideTracking.trackEvent from @app/lib/api/posthog for outcomes the browser cannot see. Name the outcome in flat snake_case (premium_model_downgraded), always pass distinctId: user.sId and workspaceId, and never await it: tracking must not slow down or fail the request.

ts
PostHogServerSideTracking.trackEvent({
  distinctId: user.sId,
  event: "trigger_blocked",
  workspaceId: workspace.sId,
  extra: { trigger_id: trigger.sId },
});

Properties

extra is a flat Record<string, string | number | boolean>, sent both spread for PostHog and as one object for Snowflake.

  • Carry the id that joins the event to the data it will be analysed with (batch_id, agent_id), or every id for an action on several items (batch_ids). If that id is not available where the event fires, skip the event.
  • Ids are sIds, never ModelIds. Keys are snake_case, units are in the name (duration_ms).
  • No PII and no user content: no emails, names, messages, prompts, file names, or typed text.
  • Do not repeat what is added for every event (URL, referrer, UTM, user and workspace).
  • Prefer a small string enum over a boolean when a third value is plausible (surface: "pile" | "single" rather than in_pile).

Contracts and tests

When analysis relies on a guarantee about events (every event carries a join key, a view is counted once), state it as a @cc contract on the tracking helper (see the code-contracts skill).

Test the helpers by mocking only the emit and asserting the exact event:

ts
vi.mock("@app/lib/tracking", async (importOriginal) => {
  const actual = await importOriginal<typeof import("@app/lib/tracking")>();
  return { ...actual, trackEvent: vi.fn() };
});

For a view hook, renderHook it, rerender with the same and with changed items, and assert the call count. Model: front/components/markdown/suggestion/suggestionTracking.test.ts. For server events, mock PostHogServerSideTracking.trackEvent the same way.

Frequently asked questions

What does the Dust Posthog Tracking AI skill do?

Track user interactions as PostHog events while implementing features in `front`, so their usage can be analysed later. Use when adding or changing a user-facing feature, flow, or surface, or when the user mentions PostHog, event tracking, or `trackEvent`.

Why use Dust Posthog Tracking on TypingMind?

Because you install it once and use it with any model. Dust Posthog Tracking is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Dust Posthog Tracking in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dust-tt/dust/tree/main/.claude/skills/dust-posthog-tracking. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Dust Posthog Tracking?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Dust Posthog Tracking?

As many as you like. As long as a model supports skills, you can use Dust Posthog Tracking with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Dust Posthog Tracking AI skill free?

Yes. It is published on GitHub by dust-tt under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇