본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)13k · #11381

better-github-skill

하는 일

이 스킬은 에이전트에게 풀 리퀘스트 상태, 리뷰 대화, 실패한 CI 검사를 위한 세 가지 준비된 도우미를 제공합니다. 풀 리퀘스트에 대해 빠른 답을 원하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓검사와 리뷰를 포함한 풀 리퀘스트 전체 상태 보고서가 필요할 때.
  • ✓아직 해결되지 않은 댓글을 포함해 리뷰 대화를 읽어야 할 때.
  • ✓CI 빌드가 실패해서 어느 단계가 왜 깨졌는지 알고 싶은 경우.

스킬 링크

https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/better-github-skill/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/better-github-skill/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 풀 리퀘스트의 CI 검사가 왜 실패했고, 리뷰어들은 무엇이라고 했나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 작은 스크립트를 실행해 풀 리퀘스트 세부 정보, 리뷰 스레드, 실패한 작업 로그를 한 번에 모읍니다. 그 밖의 작업에는 일반 GitHub 명령줄 도구를 사용합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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 diff has no --stat and no positive pathspec (--name-only and -e/--exclude globs 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 checks exits 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 api fills {owner}/{repo} from the cwd repo (GH_REPO=o/r overrides). Quote any api path containing ? (zsh globs it), or use -X GET -F per_page=100 (any -f/-F silently flips the request to POST without -X GET).
  • --paginate on any list endpoint (/comments, /files, /reviews); --jq already runs per page; don't add --slurp.
  • PR/comment bodies: --body-file file.md or a quoted heredoc. Never inline --body "..." containing backticks.
  • Field cheat-sheet: CI status on a PR = statusCheckRollup (pr view); steps live under gh run view N --json jobs; gh search prs fields ≠ gh pr view fields.
  • gh has no -C; pass -R owner/repo to every command, or cd first.
  • Branch rules live at gh api 'repos/{owner}/{repo}/rulesets' on modern repos; /branches/main/protection 404s 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 ID and gh pr checks N --watch --fail-fast exist; let the harness background them.
자주 묻는 질문

특별한 프로그램이 필요한가요?

네. 스크립트는 JavaScript 런타임인 Bun으로 실행되며 GitHub 명령줄 도구와 함께 작동합니다.

리뷰 댓글에 답하거나 해결할 수 있나요?

아니요. 리뷰 스레드 스크립트는 읽기 전용이라, 명시적으로 요청하지 않으면 스레드에 답하거나 해결하지 않습니다.

일반 GitHub 명령과 무엇이 다른가요?

여러 종류의 정보를 한 번의 호출로 모으고 전체 CI 로그를 파일에 저장하므로, 에이전트가 많은 명령을 연결할 필요가 없습니다.

상세 정보

작성자의 원본 설명

Use for 1) inspecting PR state, 2) reading review threads, or 3) debugging CI failures. Otherwise use the gh CLI.

repo: humanlayer/humanlayer

인기도

GitHub 스타
13k
순위
#11381
라이선스
Apache-2.0
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬