installing-posthog-from-chat
Skill này làm gì
Skill này cho phép agent cài đặt PostHog trong một kho mã GitHub mà không cần terminal, bằng agent thiết lập của PostHog trên cloud. Skill dành cho người dùng công cụ chat và không thể tự sửa mã của mình.
Khi nào nên dùng
- ✓Khi bạn không thể sửa mã trực tiếp, chẳng hạn trong ChatGPT hoặc Claude trên web, và muốn cài PostHog.
- ✓Khi bạn muốn cài PostHog trong kho GitHub của mình từ một khung chat.
- ✓Khi bạn muốn các thay đổi cài đặt được gửi dưới dạng pull request để bạn xem xét.
Liên kết skill
https://github.com/PostHog/posthog/blob/master/products/wizard/skills/installing-posthog-from-chat/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy cài PostHog trong ứng dụng GitHub của tôi và mở một pull request chứa các thay đổi để tôi xem xét.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kết nối tài khoản GitHub của bạn, để bạn chọn kho mã, rồi khởi động agent thiết lập của PostHog. Agent đó thực hiện các thay đổi mã và mở một pull request, bạn xem xét trước khi bất cứ thứ gì vào nhánh chính.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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.
- Call
integrations-listand look for an integration with kindgithub. - 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 callintegrations-listagain.
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: theowner/namefrom 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_stepto the user when it changes. It is written to be passed on as is. - Mention progress from
taskswhen it helps, but don't send an update on every poll. - Stop polling when
statusiscompleted,failed, orcancelled.
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
completedwithpull_request_url: share the link. Say the user should review the changes and merge the pull request to finish setting up PostHog.completedwithoutpull_request_url: the setup agent changed nothing, often because PostHog is already set up. Relaynext_step.failed: relaynext_stepanderror_message. Offer to start a new run whennext_stepsuggests one.
Câu hỏi thường gặp
Nhánh chính của tôi có thay đổi ngay không?
Không. Các thay đổi nằm trong pull request cho đến khi bạn xem xét và gộp.
Tôi cần làm gì trước?
Cài ứng dụng PostHog GitHub và chọn những kho mã nào nó có thể truy cập.
Nếu kho mã của tôi không hiện ra thì sao?
Có lẽ ứng dụng GitHub chưa có quyền truy cập vào nó, nên bạn thêm kho đó vào quyền truy cập của ứng dụng rồi tìm kiếm lại.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6978
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
depot-ci
41kGiúp agent của bạn thiết lập và chạy quy trình Depot CI, một lựa chọn thay thế GitHub Actions, gồm chuyển các quy trình hiện có và đọc nhật ký chạy.
depot-container-builds
41kGiúp agent của bạn build image Docker trên các builder từ xa của Depot, gồm image đa nền tảng, đẩy lên registry và sửa lỗi build.
depot-github-runners
41kGiúp agent của bạn chuyển các job GitHub Actions sang runner do Depot quản lý, chọn kích thước và nhãn runner, và xử lý lỗi thiết lập runner.
editing-agents-md
41kGiúp agent của bạn quyết định một quy tắc nên nằm trong file AGENTS.md hay CLAUDE.md, và viết sao cho quy tắc được tuân thủ mà file không bị phình to.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.