better-github-skill
Skill này làm gì
Skill cung cấp cho agent AI ba trợ giúp có sẵn về trạng thái pull request, luồng review và các kiểm tra CI thất bại. Skill dành cho lập trình viên muốn có câu trả lời nhanh về một pull request.
Khi nào nên dùng
- ✓Khi bạn muốn có báo cáo đầy đủ về trạng thái pull request, gồm các kiểm tra và review.
- ✓Khi bạn cần đọc cuộc trao đổi review, gồm cả bình luận chưa được giải quyết.
- ✓Khi một bản build CI thất bại và bạn muốn biết bước nào hỏng và vì sao.
Liên kết skill
https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/better-github-skill/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
“Vì sao các kiểm tra CI trên pull request của tôi thất bại, và người review đã nói gì?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent chạy các script nhỏ để gom chi tiết pull request, luồng review hoặc nhật ký công việc lỗi trong một lần. Với mọi việc khác, agent dùng công cụ dòng lệnh GitHub thông thường.
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.
better-github-skill
Use these scripts only for the three flows listed below. Otherwise use raw
gh. Scripts run TypeScript with Bun and have no dependencies.
Scripts
| script | use for |
|---|---|
bun run scripts/pr-snapshot.ts [pr] [-R o/r] |
full PR state in one call: meta, mergeability, checks, files, reviews, comments, thread counts. Use instead of hand-assembling pr view --json field sets or chaining view/checks/comments calls. |
bun run scripts/pr-threads.ts [pr] [-R o/r] [--all] [--author X] [--since ISO] |
the full review conversation: review bodies, issue comments, and unresolved inline threads (resolution state porcelain gh cannot get). Resolved/outdated threads are hidden by default, counted in the header; --all includes them. Read-only: never reply to or resolve threads unless explicitly told to. |
bun run scripts/ci-failures.ts [run-id] [--pr N] [--list] [-R o/r] |
failing checks → failing jobs/steps → log snippet each; full logs saved to files (paths printed); rg those instead of re-fetching. --list [--workflow W] [-L n] shows recent runs with conclusions; use it to find the failing run id instead of gh run list --json field sets. |
Rule of thumb: pr-snapshot answers "what's the state of this PR", pr-threads answers "what did reviewers write". Neither replaces the other.
All scripts: --json for structured output, --help for usage (includes the
--json shape). Omit the PR number to use the current branch's PR. Default
output is sized for context; pass --full only when a truncation marker
([…+N chars]) hides something you need. They exit 0 when the report
succeeds even if CI is red or threads are unresolved.
Gotchas (each one burned real sessions repeatedly)
- Never pipe gh into
head: SIGPIPE can kill gh mid-write (spurious nonzero exit, shell-dependent) or silently truncate large output. Redirect to a file and read that, or trim with--jq '.[0:20]'. gh pr diffhas no--statand no positive pathspec (--name-onlyand-e/--excludeglobs exist in gh ≥ 2.95). Per-file stats:gh api 'repos/{owner}/{repo}/pulls/N/files' --jq '.[]|[.filename,.additions,.deletions]|@tsv'Full diff:gh pr diff N > "$TMPDIR/pr.diff"once, then rg/sed the file.gh pr checksexits 1 = failing, 8 = pending by design; append|| true, read the table.- File at any ref, no base64 dance:
gh api 'repos/{owner}/{repo}/contents/PATH?ref=SHA' -H 'Accept: application/vnd.github.raw' gh apifills{owner}/{repo}from the cwd repo (GH_REPO=o/roverrides). Quote any api path containing?(zsh globs it), or use-X GET -F per_page=100(any-f/-Fsilently flips the request to POST without-X GET).--paginateon any list endpoint (/comments,/files,/reviews);--jqalready runs per page; don't add--slurp.- PR/comment bodies:
--body-file file.mdor a quoted heredoc. Never inline--body "..."containing backticks. - Field cheat-sheet: CI status on a PR =
statusCheckRollup(pr view); steps live undergh run view N --json jobs;gh search prsfields ≠gh pr viewfields. - gh has no
-C; pass-R owner/repoto every command, or cd first. - Branch rules live at
gh api 'repos/{owner}/{repo}/rulesets'on modern repos;/branches/main/protection404s unless classic protection is on AND you have admin ("Branch not protected" or plain "Not Found" both mean check rulesets; neither is a path error). - Branch drift:
gh api 'repos/{owner}/{repo}/compare/BASE...HEAD' --jq '{ahead_by,behind_by}' - jq beyond one line: write the program to a file and
jq -f prog.jq; inline zsh quoting breaks. - Don't sleep-poll runs or checks;
gh run watch IDandgh pr checks N --watch --fail-fastexist; let the harness background them.
Câu hỏi thường gặp
Nó có cần phần mềm đặc biệt không?
Có. Các script chạy bằng Bun, một runtime JavaScript, và hoạt động cùng công cụ dòng lệnh GitHub.
Nó có trả lời hoặc giải quyết bình luận review không?
Không. Script luồng review chỉ đọc, nên agent không trả lời hay giải quyết luồng trừ khi bạn yêu cầu rõ.
Nó khác gì với các lệnh GitHub thông thường?
Nó gom nhiều loại thông tin trong một lần gọi và lưu nhật ký CI đầy đủ vào file, nên agent không phải nối nhiều lệnh.
Chi tiết
Mô tả gốc của tác giả
Use for 1) inspecting PR state, 2) reading review threads, or 3) debugging CI failures. Otherwise use the gh CLI.
repo: humanlayer/humanlayer
Độ phổ biến
- Sao GitHub
- 13k
- Vị trí xếp hạng
- #11381
- Giấy phép
- Apache-2.0
- Cập nhật
- 31/10/2026
Bình luận
- …
Thêm skill từ kho mã này
asd-ste100
13kDạy agent của bạn viết lại tiếng Anh khó hiểu thành câu ngắn, mỗi câu một nghĩa, dễ đọc đối với con người và phần mềm khác.
calldiff
13kGiúp agent của bạn so sánh chuỗi lời gọi hàm trong một codebase giữa hai phiên bản git, để review code thấy hành vi nào đã thay đổi.
chrome-devtools-cli
13kCho phép agent của bạn điều khiển Chrome từ terminal để mở trang, nhấp, điền biểu mẫu và chụp snapshot trang cho tự động hóa và kiểm thử trình duyệt.
effect-program-design
13kGiúp agent của bạn thiết kế và kiểm thử chương trình Effect v4 sẵn sàng cho production, với service rõ ràng, lỗi có kiểu, layer và xử lý tài nguyên an toàn.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.