GitHub Default Active

GitHub gh CLI — issues, PRs, CI, code review, releases

Skill Name
github
Category
Dev Workflow
Requires
gh CLI Binary
Source
~/.cli-jaw/skills/github/SKILL.md
This skill is active by default and injected into every session. It covers all GitHub interactions via the gh CLI, including merged capabilities from the former gh-address-comments, gh-fix-ci, gh-issues, and yeet skills.

Quick Reference

CommandDescriptionExample
gh pr listList pull requestsgh pr list --repo owner/repo
gh pr viewView PR detailsgh pr view 55 --repo owner/repo
gh pr checksCheck CI status on a PRgh pr checks 55 --repo owner/repo
gh pr createCreate a pull requestgh pr create --title "feat: X" --body "..."
gh pr mergeMerge a pull requestgh pr merge 55 --squash
gh issue listList issuesgh issue list --state open
gh issue createCreate an issuegh issue create --title "Bug: X"
gh issue closeClose an issuegh issue close 42
gh run listList CI workflow runsgh run list --limit 10
gh run viewView a specific CI rungh run view <id> --log-failed
gh run rerunRe-run failed jobsgh run rerun <id> --failed
gh apiQuery GitHub REST/GraphQL APIgh api repos/o/r/pulls/55 --jq '.title'

When to Use / When Not to Use

Use this skill when

  • Checking PR status, reviews, or merge readiness
  • Viewing CI/workflow run status and logs
  • Creating, closing, or commenting on issues
  • Creating or merging pull requests
  • Querying GitHub API for repository data
  • Listing repos, releases, or collaborators
  • Addressing PR review comments
  • Debugging and fixing failing CI checks
  • Auto-fixing issues and opening PRs
  • Stage, commit, push, and PR in one flow (yeet)

Do NOT use when

  • Local git operations (commit, push, pull, branch) — use git directly
  • Non-GitHub repos (GitLab, Bitbucket, self-hosted) — different CLIs
  • Cloning repositories — use git clone
  • Reviewing actual code changes — use coding-agent skill
  • Complex multi-file diffs — use coding-agent or read files directly

Setup & Installation

The github skill requires the gh CLI binary. CLI-JAW can auto-install it for you, or you can install manually:

# macOS (Homebrew) brew install gh
# Linux (apt) sudo apt install gh

After installing, authenticate once:

# One-time authentication
gh auth login

# Verify authentication
gh auth status
Token scope: Make sure your gh token has repo, read:org, and workflow scopes. If CI operations fail, re-authenticate with gh auth login and select the required scopes.

Pull Requests

Listing PRs

# List open PRs in a repo
gh pr list --repo owner/repo

# Filter by state
gh pr list --repo owner/repo --state merged --limit 20

# JSON output with jq filtering
gh pr list --json number,title,state,mergeable \
  --jq '.[] | select(.mergeable == "MERGEABLE")'

Viewing PR Details

# View PR by number
gh pr view 55 --repo owner/repo

# View by URL directly
gh pr view https://github.com/owner/repo/pull/55

# Structured JSON output
gh pr view 55 --repo owner/repo \
  --json title,body,author,additions,deletions,changedFiles \
  --jq '"**\(.title)** by @\(.author.login)\n+\(.additions) -\(.deletions) across \(.changedFiles) files"'

Checking CI Status

# Check all CI checks on a PR
gh pr checks 55 --repo owner/repo

Creating PRs

# Basic PR creation
gh pr create --title "feat: add feature" --body "Description"

# With reviewers and labels
gh pr create --title "fix: resolve timeout" \
  --body "Fixes #42" \
  --reviewer alice,bob \
  --label bug,urgent

# Draft PR
gh pr create --title "wip: new dashboard" --body "WIP" --draft

Merging PRs

# Squash merge
gh pr merge 55 --squash --repo owner/repo

# Merge commit
gh pr merge 55 --merge --repo owner/repo

# Rebase merge
gh pr merge 55 --rebase --repo owner/repo

# Auto-merge when checks pass
gh pr merge 55 --auto --squash

Issues

Listing Issues

# Open issues
gh issue list --repo owner/repo --state open

# Filter by label
gh issue list --repo owner/repo --label bug --limit 10

# JSON with formatting
gh issue list --repo owner/repo --state open \
  --json number,title,labels,createdAt \
  --jq '.[] | "[\(.number)] \(.title) - \([.labels[].name] | join(", ")) (\(.createdAt[:10]))"'

Creating Issues

# Basic issue
gh issue create --title "Bug: something broken" --body "Details..."

# With labels and assignee
gh issue create --title "Feature: dark mode" \
  --body "Add dark mode toggle" \
  --label enhancement \
  --assignee @me

Closing Issues

# Close by number
gh issue close 42 --repo owner/repo

# Close with comment
gh issue close 42 --comment "Fixed in PR #55"

CI / Workflow Runs

Listing Runs

# Recent runs
gh run list --repo owner/repo --limit 10

# Filter by workflow
gh run list --workflow build.yml --limit 5

# Filter by status
gh run list --status failure --limit 10

Viewing Run Details

# View specific run
gh run view <run-id> --repo owner/repo

# View ONLY failed step logs (most useful for debugging)
gh run view <run-id> --repo owner/repo --log-failed

Re-running Failed Jobs

# Re-run only the failed jobs
gh run rerun <run-id> --failed --repo owner/repo

# Re-run all jobs
gh run rerun <run-id> --repo owner/repo

API Queries

The gh api command provides direct access to the GitHub REST and GraphQL API. Use --jq to filter JSON results.

# Get PR with specific fields
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'

# List all labels
gh api repos/owner/repo/labels --jq '.[].name'

# Get repo stats
gh api repos/owner/repo --jq '{stars: .stargazers_count, forks: .forks_count}'

# List PR review comments
gh api repos/{owner}/{repo}/pulls/{pr}/comments \
  --jq '.[] | "\(.id): \(.body[:80])"'

# Cache repeated queries (1 hour)
gh api --cache 1h repos/owner/repo

JSON Output Mode

Most gh commands support --json for structured output combined with --jq filtering:

# Issues as formatted list
gh issue list --repo owner/repo --json number,title \
  --jq '.[] | "\(.number): \(.title)"'

# PRs that are mergeable
gh pr list --json number,title,state,mergeable \
  --jq '.[] | select(.mergeable == "MERGEABLE")'

Integrated Workflows

The github skill consolidates several formerly-separate skills into unified workflows. These run as multi-step procedures triggered by natural language.

PR Comment Handling

Address review comments and issue comments on the open PR for the current branch.

  1. Check authentication: gh auth status
  2. Find current PR: gh pr view --json number,url
  3. List review comments: gh api repos/{owner}/{repo}/pulls/{pr}/comments --jq '.[] | "\(.id): \(.body[:80])"'
  4. Address each comment, implement fixes, and commit changes
  5. Push and re-request review from the original reviewers

Fix Failing CI

Debug and fix failing GitHub Actions checks automatically.

  1. Find failing checks: gh pr checks <PR> --repo owner/repo
  2. Get failed run logs: gh run view <run-id> --log-failed
  3. Summarize failure snippet and identify root cause
  4. Draft fix plan, get approval, then implement the fix
  5. Push fix and verify CI passes

Auto-Fix Issues

Fetch issues from a repository, implement fixes, and open PRs for each.

  1. List target issues: gh issue list --label bug --limit 5
  2. For each issue: create a branch, implement the fix, open a PR
  3. Monitor PR reviews and address comments
  4. Uses the GitHub REST API with $GH_TOKEN for automation

Yeet: Stage, Commit, Push, PR

One-shot flow to ship changes from working tree to a PR in a single command.

  1. If on main/master, create a new branch: git checkout -b codex/{description}
  2. Stage all changes: git add -A
  3. Commit with description: git commit -m "{description}"
  4. Push to remote: git push -u origin HEAD
  5. Open PR: gh pr create --title "[codex] {description}" --body "..."

Templates

PR Review Summary

PR=55 REPO=owner/repo
echo "## PR #$PR Summary"
gh pr view $PR --repo $REPO \
  --json title,body,author,additions,deletions,changedFiles \
  --jq '"**\(.title)** by @\(.author.login)\n\n\(.body)\n\n+\(.additions) -\(.deletions) across \(.changedFiles) files"'
gh pr checks $PR --repo $REPO

Issue Triage Report

gh issue list --repo owner/repo --state open \
  --json number,title,labels,createdAt \
  --jq '.[] | "[\(.number)] \(.title) - \([.labels[].name] | join(", ")) (\(.createdAt[:10]))"'

Rules & Best Practices

RuleDetails
Always specify --repoWhen not inside a git directory, always pass --repo owner/repo to avoid ambiguity.
Use URLs directlygh pr view https://github.com/owner/repo/pull/55 works and is unambiguous.
Cache repeated API callsUse gh api --cache 1h for queries you run frequently to avoid rate limits.
Prefer --log-failedWhen debugging CI, use gh run view <id> --log-failed instead of --log to avoid massive output.
Use --json + --jqFor structured data extraction, always prefer JSON output with jq filtering over parsing text.
Local git stays localDo not use this skill for git commit, git push, git pull, or git branch. Use git directly.
Rate limitsGitHub API has rate limits (5,000 req/hr for authenticated). Cache aggressively and batch queries.

Usage Examples (~haejwo)

These examples show how to invoke the github skill using natural language. Both Korean and English work interchangeably.

Example 1
"PR 55번 상태 확인해줘 -- CI 다 통과했는지 봐줘"
Checks CI status on PR #55 using gh pr checks 55 and summarizes pass/fail results.
Example 2
"이 변경사항 PR로 올려줘 -- 리뷰어 alice 지정하고 bug 라벨 붙여줘"
Runs the yeet flow: stages all changes, commits, pushes, and creates a PR with --reviewer alice --label bug.
Example 3
"CI 실패한 거 고쳐줘 -- 로그 보고 원인 분석해줘"
Triggers the Fix Failing CI workflow: finds the failing check, pulls --log-failed, diagnoses the root cause, and proposes a fix.
Example 4
"이 리포에 bug 라벨 이슈 목록 보여주고 정리해줘"
Lists open issues with the bug label, formats them as a triage report with creation dates and labels.
Example 5
"PR 리뷰 코멘트 다 처리하고 다시 리뷰 요청해줘"
Runs the PR Comment Handling flow: reads all review comments, addresses each one, commits fixes, pushes, and re-requests review.

Related Skills

SkillRelationship
dev-code-reviewerReviews code content; github handles the PR mechanics (create, merge, comment).
dev orchestratorMay delegate to github when a dev task requires PR creation or CI checking.
code-reviewDeep code review skill; pairs with github for --comment to post inline PR feedback.
security-reviewSecurity audit skill; uses github to check dependency alerts and security advisories.