integration-react-react-router-6
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "integration-react-react-router-6":https://skillpi.com/zh/skills/deepskill-232be2492d9c8a84546c8b6894864286157ec25d278ccb238bbcc1fe71f1002f。安装前核对上游来源和版本:https://skills.sh/posthog/skills/integration-react-react-router-6。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
skills.sh
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
为使用 React Router v6 的 React 应用程序集成 PostHog,用于在路由事件中捕获和上报分析数据并与应用路由生命周期协同工作。
介绍来源: third_party · posthog · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: integration-react-react-router-6
description: PostHog integration for React Router v6 applications
metadata:
author: PostHog
version: 1.9.4PostHog integration for React Router v6
This skill helps you add PostHog analytics to React Router v6 applications.
Workflow
Follow these steps in order to complete the integration:
basic-integration-1.0-begin.md- PostHog Setup - Begin ← Start herebasic-integration-1.1-edit.md- PostHog Setup - Editbasic-integration-1.2-revise.md- PostHog Setup - Revisebasic-integration-1.3-conclude.md- PostHog Setup - Conclusion
Reference files
references/EXAMPLE.md- React Router v6 example project codereferences/react-router-v6.md- React router v6 - docsreferences/identify-users.md- Identify users - docsreferences/basic-integration-1.0-begin.md- PostHog setup - beginreferences/basic-integration-1.1-edit.md- PostHog setup - editreferences/basic-integration-1.2-revise.md- PostHog setup - revisereferences/basic-integration-1.3-conclude.md- PostHog setup - conclusion
The example project shows the target implementation pattern. Consult the documentation for API details.
Key principles
- Environment variables: Always use environment variables for PostHog keys. Never hardcode them.
- Minimal changes: Add PostHog code alongside existing integrations. Don't replace or restructure existing code.
- Match the example: Your implementation should follow the example project's patterns as closely as possible.
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)
Identifying users
Identify users during login and signup events. Refer to the example code and documentation for the correct identify pattern for this framework. If both frontend and backend code exist, pass the client-side session and distinct ID using X-POSTHOG-DISTINCT-ID and X-POSTHOG-SESSION-ID headers to maintain correlation.
Error tracking
Add PostHog error tracking to relevant files, particularly around critical user flows and API boundaries.
当前收录版本
1.0.0
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供 React Router v6 集成 PostHog 的完整工作流,解决前端分析集成的明确需求
- 包含关键原则和框架指南,帮助用户避免常见陷阱
亮点
- 触发描述精准,明确限定于 React Router v6 应用集成 PostHog 场景
待提升项
-
缺少 When to Use 和端到端完整示例 原报告严重程度:轻微
文档结构良好,但未包含 When to Use 说明和完整的端到端执行示例
改进建议:建议补充 When to Use 章节和完整的端到端示例,帮助用户更好地理解何时以及如何使用该 Skill
亮点
- Phase 步骤划分清晰,从 begin 到 conclude 形成完整工作流
- 提供了详细的参考文件列表和关键集成原则
待提升项
-
引用文件未验证存在性 原报告严重程度:重大
Skill 依赖多个参考文件(basic-integration-*.md、references/*),但未验证这些文件是否实际存在,可能导致执行失败
改进建议:请确保所有引用的文件都包含在 Skill 包中,或提供明确的获取方式
亮点
- 提供了清晰的集成模式和最佳实践指南
- 错误处理建议合理,特别是在用户识别和错误跟踪方面
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。