error-tracking-react

在 React 应用中使用 PostHog 进行错误追踪的方案与说明。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "error-tracking-react":https://skillpi.com/zh/skills/deepskill-e7742b38a4ab1c916598ac5a99c02cfc592e7a802e64f9b446626ec04ed8579d。安装前核对上游来源和版本:https://skills.sh/posthog/skills/error-tracking-react。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skills.sh

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

在 React 应用中使用 PostHog 进行错误追踪的方案与说明。

0 下载

介绍来源: third_party · posthog · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
来源文档未说明。
输入和输出
来源文档未说明。
软件、账号及付费要求
来源文档未说明。
限制与区别
来源文档未说明。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: error-tracking-react
description: PostHog error tracking for React
metadata:
  author: PostHog
  version: 1.9.4

PostHog error tracking for React

This skill helps you add PostHog error tracking to React applications.

Reference files

  • references/react.md - React error tracking installation - docs
  • references/fingerprints.md - Fingerprints - docs
  • references/alerts.md - Send error tracking alerts - docs
  • references/monitoring.md - Monitor and search issues - docs
  • references/assigning-issues.md - Assign issues to teammates - docs
  • references/upload-source-maps.md - Upload source maps - docs

Consult the documentation for API details and framework-specific patterns.

Key principles

  • Environment variables: Always use environment variables for PostHog keys and host URLs. Never hardcode them.
  • Minimal changes: Add error tracking alongside existing error handling. Don't replace or restructure existing error handling code.
  • Autocapture first: Enable exception autocapture in the SDK initialization before adding manual captures.
  • Source maps: Upload source maps so stack traces resolve to original source code, not minified bundles.
  • Manual capture for boundaries: Use captureException() at error boundaries and catch blocks for errors that don't propagate to the global handler.

Framework guidelines

  • For feature flags, use useFeatureFlagEnabled() or useFeatureFlagPayload() hooks - they handle loading states and external sync automatically
  • Add analytics capture in event handlers where user actions occur, NOT in useEffect reacting to state changes
  • Do NOT use useEffect for data transformation - calculate derived values during render instead
  • Do NOT use useEffect to respond to user events - put that logic in the event handler itself
  • Do NOT use useEffect to chain state updates - calculate all related updates together in the event handler
  • Do NOT use useEffect to notify parent components - call the parent callback alongside setState in the event handler
  • To reset component state when a prop changes, pass the prop as the component's key instead of using useEffect
  • useEffect is ONLY for synchronizing with external systems (non-React widgets, browser APIs, network subscriptions)

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值75/100

亮点

  • 提供 React 应用集成 PostHog 错误追踪的实用解决方案
  • 针对开发者群体的明确需求,具有较高的实用价值
触发精准85/100

亮点

  • 触发词精准完整,明确指向 PostHog React 错误追踪场景
结构规范70/100

待提升项

  • 缺少具体示例和使用场景说明 原报告严重程度:轻微

    文档缺少端到端的代码示例和具体使用场景说明

    改进建议:建议添加完整的安装配置示例和常见使用场景的代码片段

亮点

  • 结构清晰,包含关键原则和框架指南
  • 提供了详细的实施最佳实践
执行可靠65/100

待提升项

  • 引用文件缺失 原报告严重程度:重大

    SKILL.md 引用了多个 reference 文件但未实际传入

    改进建议:请确保所有被引用的文件都包含在 Skill 包中,或移除无法提供的引用

  • 缺少具体安装和实施代码 原报告严重程度:轻微

    未提供具体的安装命令、配置代码和 API 调用示例

    改进建议:建议添加 npm 安装命令、初始化配置代码和常见使用场景的代码示例

亮点

  • 强调了重要的实施原则,如环境变量使用和 source maps 上传
  • 提供了框架特定的最佳实践指导
证据可验 (前四项均值)74/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

来源文档未说明。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。