跳到主内容
智客 ZICQ

技能库 智客分类:数据与分析 posthog-instrumentation

Posthog Instrumentation

将 PostHog 分析仪表自动添加到代码中. 当用户要求添加跟踪,仪器事件,添加分析,或在其代码库中执行特征标记时会触发.

1868 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

将 PostHog 分析仪表自动添加到代码中. 当用户要求添加跟踪,仪器事件,添加分析,或在其代码库中执行特征标记时会触发.

何时用

- 用户要求"添加后霍格"或"添加分析"

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:PostHog Instrumentation Skill、When to Use、Workflow、Code Patterns、JavaScript/TypeScript、Python。 其中含规范建议的小节:分步指令。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Automatically add PostHog analytics instrumentation to code. Triggers when user asks to add tracking, instrument events, add analytics, or implement feature flags in their codebase.

PostHog Instrumentation SkillWhen to UseWorkflowCode PatternsJavaScript/TypeScriptPythonEvent trackingFeature flagsReactBest Practices

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
posthog-instrumentation
description
Automatically add PostHog analytics instrumentation to code. Triggers when user asks to add tracking, instrument events, add analytics, or implement feature flags in their codebase.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「posthog-instrumentation」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-e8d235a32207be73-%E5%90%B8%E9%99%84%E5%90%8E%E4%BB%AA%E5%99%A8.html
请存为 .cursor/skills/posthog-instrumentation/SKILL.md 或 .claude/skills/posthog-instrumentation/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/posthog/posthog-for-claude' --list

npx skills add 'https://github.com/posthog/posthog-for-claude' --skill 'posthog-instrumentation'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: posthog-instrumentation description: Automatically add PostHog analytics instrumentation to code. Triggers when user asks to add tracking, instrument events, add analytics, or implement feature flags in their codebase. --- # PostHog Instrumentation Skill Help users add PostHog analytics, event tracking, and feature flags to their code. ## When to Use - User asks to "add PostHog" or "add analytics" - User wants to track events or user actions - User needs to implement feature flags - User asks about instrumenting their code ## Workflow 1. Identify the framework (React, Next.js, Python, Node.js, etc.) 2. Check for existing PostHog setup 3. Add appropriate instrumentation ## Code Patterns ### JavaScript/TypeScript ```javascript // Event tracking posthog.capture('button_clicked', { button_name: 'signup' }) // Feature flags if (posthog.isFeatureEnabled('new-feature')) { // Show new feature } // User identification posthog.identify(userId, { email: user.email }) ``` ### Python ```python from posthog import Posthog posthog = Posthog(api_key='') # Event tracking posthog.capture(distinct_id='user_123', event='purchase_completed') # Feature flags if posthog.feature_enabled('new-feature', 'user_123'): # Show new feature ``` ### React ```jsx import { usePostHog } from 'posthog-js/react' function MyComponent() { const posthog = usePostHog() const handleClick = () => { posthog.capture('button_clicked') } } ``` ## Best Practices - Use consistent event naming (snake_case recommended) - Include relevant properties with events - Identify users early in their session - Use feature flags for gradual rollouts

相关技能

数据与分析

Marketing Skills

TL; DR:23个营销剧本(CRO,SEO,拷贝,分析,实验,定价,发布,广告,社交). 用于快速获取清单+副本/粘贴可交付品.

数据与分析

Crypto & Stock Market Data (Node.js)

免费等级不需要 API 关键值 。 专业级别的密码货币和股票市场数据集成,用于实时价格、公司概况和全球分析。 由Node.js提供动力,外部依赖性为零.

数据与分析

Azure Storage

Azure存储服务包括Blob存储,文件共享,等式存储,表存储,和数据湖. 解答关于存储访问级别(热,凉,冷,存档),何时使用每个级别,以及级别比较的问题. 提供对象存储,SMB文件共享,async消息,NoSQL密钥-值,和大数据分析. 包括生命周期管理。 USE FOR: b…

数据与分析

Azure Kusto

Azure Data Explorer(Kusto/ADX)中使用KQL进行日志分析,遥测和时间序列分析的查询并分析数据. When: KQL 查询, Kusto 数据库查询, Azure Data Explorer, ADX 集群, 日志分析, 时间序列数据, IoT 遥测, …