跳到正文
Skillpedia
通用编程41k · #6978

installing-posthog-from-chat

它能做什么

这项技能让智能体无需终端,就能在 GitHub 仓库中设置 PostHog,它使用 PostHog 位于云端的设置智能体。适合使用聊天工具、无法直接编辑自己代码的人。

适用场景

  • ✓当你无法直接编辑代码,例如在 ChatGPT 或网页版 Claude 中,并且希望安装 PostHog 的时候。
  • ✓当你想通过聊天在 GitHub 仓库中设置 PostHog 的时候。
  • ✓当你希望把设置更改作为可供审阅的拉取请求交付的时候。

技能链接

https://github.com/PostHog/posthog/blob/master/products/wizard/skills/installing-posthog-from-chat/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/PostHog/posthog/blob/master/products/wizard/skills/installing-posthog-from-chat/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请在我的 GitHub 应用中安装 PostHog,并打开一个包含这些更改的拉取请求,让我可以审阅。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会连接你的 GitHub 账户,让你选择仓库,然后启动 PostHog 的设置智能体。该智能体会进行代码更改并打开一个拉取请求,你在任何内容进入主分支之前都可以审阅。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Installing PostHog from chat

Wizard is PostHog's setup agent. With wizard-install-start it runs in a cloud workspace on a GitHub repository, makes the code changes, and opens a pull request. The user reviews and merges that pull request. Nothing changes on their default branch until they do.

Work through the steps in order. Skip a step when its outcome is already known from the conversation.

1. Connect GitHub

The run uses the project's GitHub connection, so the project needs one.

  1. Call integrations-list and look for an integration with kind github.
  2. When there is none, give the user this link, built from the base URL and project ID in your context: <base URL>/integrations/connect/github/?project_id=<project id>&connect_from=mcp. They install the PostHog GitHub App and choose which repositories it can access. Wait until they say they are done, then call integrations-list again.

2. Pick the repository

Call integrations-github-repos-retrieve with the GitHub integration's ID. Use search when the user named the repository, and page with offset when has_more is true.

  • One clear match: confirm it with the user in one line.
  • Several matches: list them and ask which one.
  • No match: the GitHub App cannot access it. Ask the user to add the repository to the app's repository access in GitHub, then search again.

Pass the repository as full_name (owner/name).

The setup agent works at the repository root. If the user describes a monorepo where the app lives in a subdirectory, tell them the run may not find it, and offer to try anyway.

3. Start the run

Call wizard-install-start with:

  • repository: the owner/name from step 2.
  • branch: only when the user wants a branch other than the default one. The pull request targets that branch.
  • idempotency_key: a fresh unique value for this request. Reuse the same value if you retry after a network error, so the retry returns the same run.

Errors the user can act on:

Error code What to do
github_not_connected Go back to step 1.
repository_not_accessible Ask the user to add the repository to the PostHog GitHub App, then retry with a new idempotency_key.
run_already_active The user already has a run in progress in this project. Ask them to wait for it, or check it in PostHog.
HTTP 429 The user reached the hourly or daily limit for setup runs. Relay the message. Don't retry right away.

Tell the user the run started and share the url from the response, where they can follow it in PostHog.

4. Poll the run

Call wizard-install-status with the run_id about every 30 seconds while status is created or running. A run usually takes several minutes.

  • Relay next_step to the user when it changes. It is written to be passed on as is.
  • Mention progress from tasks when it helps, but don't send an update on every poll.
  • Stop polling when status is completed, failed, or cancelled.

When the client cannot wait that long in one turn, tell the user the run is in progress and check again when they come back.

5. Share the result

  • completed with pull_request_url: share the link. Say the user should review the changes and merge the pull request to finish setting up PostHog.
  • completed without pull_request_url: the setup agent changed nothing, often because PostHog is already set up. Relay next_step.
  • failed: relay next_step and error_message. Offer to start a new run when next_step suggests one.
常见问题

我的主分支会立即改变吗?

不会。更改会停留在拉取请求中,直到你审阅并合并。

我需要先做什么?

安装 PostHog GitHub App,并选择它可以访问哪些仓库。

如果我的仓库没有出现怎么办?

GitHub App 可能没有访问该仓库的权限,所以请把它添加到应用的仓库访问权限中,然后重新搜索。

详情

作者的原始描述

Set up PostHog in a user's GitHub repository from a chat, without a terminal. Wizard, PostHog's setup agent, runs in the cloud, adds the SDK and first events, and opens a pull request. Use only when you can't read or edit the user's code, which is common in web chat apps such as ChatGPT on the web or Claude on the web. Typical requests: install, add, or set up PostHog in their app or repository, or open a pull request that adds PostHog. When you're working in the user's repository, use installing-posthog-in-a-codebase instead. Covers connecting GitHub, picking the repository, starting the run,

repo: PostHog/posthog

热度

GitHub 星标
41k
排名
#6978
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能