Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

integrating-with-posthog-ai

БесплатноБез исполняемых скриптовНе проверен

Wire a PostHog product surface into the PostHog AI agent from the frontend. Use when attaching scene or entity context, injecting instructions to steer the…

PostHogот PostHog★ 41 278 звёзд на GitHub

Об этом скилле

Integrating a product with PostHog AI

The user-facing doc is products/posthog_ai/README.md. This skill is how to do the work: pick the right seam, avoid the two mistakes that matter, and stop before the deep end.

First: is this a frontend job at all?

There is no backend integration API. An integration has two halves, and the frontend half depends on the backend half:

  1. Capability — the agent reads and writes your entities through MCP tools. If no tool can resolve the thing you want to talk about, start there: /implementing-mcp-tools, products/<name>/mcp/tools.yaml.
  2. Cooperation — the frontend seams below.

Injected context carries references, not data. A reference the agent cannot resolve with a tool is a dead end, so confirm the tool exists before you inject the ref.

Pick the seam

The job Seam Import from Use it? Reference
The agent should know what the user is looking at, including unsaved work Attached context api/logics Recommended injecting-context.md
Steer how the agent behaves here — which tools to prefer, what "this" means on this page, or hand it a skill Trusted instructions api/logics Recommended injecting-instructions.md
The page should update when the agent does something Tool-event bus api/logics Recommended reacting-to-tool-calls.md
Your tool's calls should render as a real card, not the generic fallback Tool registry api/tools Recommended rendering-widgets.md
Build your own agent UI out of the thread, composer, and stream primitives Run primitives api/runSurface, api/primitives Not recommended — see below products/posthog_ai/frontend/README.md

The first four are the product integration. The fifth exists for the three surfaces that host an agent run — the Max scene, the signals inbox, and the tasks runner — not for products that want to cooperate with one. Reaching for it by default is the main way this goes wrong.

Whole scene at once: useSceneAgentPanel({ sceneKey, contextItems, headlines }) from frontend/src/scenes/max/useSceneAgentPanel.ts bundles context, welcome headlines, and gated auto-open of the side panel. Start there for a scene; drop to the individual hooks for one component. products/workflows/frontend/Workflows/WorkflowScene.tsx is the exemplar.

The import rule

Always a domain-scoped api/<module> entry, never a deep path, and there is deliberately no root barrel:

import { useAttachedContext, useMcpToolApplyBack } from 'products/posthog_ai/frontend/api/logics'

Pick the narrowest module. api/logics and api/types are headless; api/primitives drags in markdown and virtualization; api/tools initializes the registry from built-ins and the central manifest at module load, so importing it is a side effect that is not tree-shaken. A status badge that imports the wrong tier doubles its chunk.

The two mistakes that matter

1. Putting variable data in trusted context. type: 'instructions' items land in <posthog_trusted_context> — guidance the agent follows. Everything else lands in <posthog_untrusted_context>, behind hardening prose. So:

  • Instructions carry only your own build-time strings. Never a user-entered name, an ingested value, or anything interpolated from one. A crafted entity name in trusted context is a prompt injection against whoever reads the thread next.
  • Untrusted context is where user data belongs, and injecting it freely is the point — the user's unsaved editor state is usually the most useful thing you have.
  • If a pointer must vary (which id is open, which step is selected), put it on an untrusted item and have the static instruction refer to it by field name.

2. Sending object shapes instead of identifiers. The context block rides on every message in the conversation. Send { type, key, label } and let the agen

Полный SKILL.md на GitHub

Установить integrating-with-posthog-ai в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/injecting-context.mdreferences/injecting-instructions.mdreferences/reacting-to-tool-calls.mdreferences/rendering-widgets.md

FAQ

Что делает скилл integrating-with-posthog-ai?

Wire a PostHog product surface into the PostHog AI agent from the frontend. Use when attaching scene or entity context, injecting instructions to steer the agent, reacting to the agent calling a tool, applying an agent edit back into an open form, or rendering a product tool card in a thread.

Как установить скилл integrating-with-posthog-ai?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл integrating-with-posthog-ai запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить integrating-with-posthog-ai с