Claude-skill-registry gh-pr-issue
Keep pull requests and issues healthy using gh CLI (list, view, comment, close).
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/gh-pr-issue" ~/.claude/skills/majiayu000-claude-skill-registry-gh-pr-issue && rm -rf "$T"
manifest:
skills/data/gh-pr-issue/SKILL.mdsource content
When to Use
Invoke this skill when triaging review queues, summarizing checks, or updating GitHub issues. It wraps
gh pr and gh issue commands so you can stay on top of reviews without leaving Opencode.
Prerequisites
CLI authenticated (gh
).gh auth login --scopes repo,workflow
installed for JSON parsing.jq- Environment variables (ask for them if absent):
GITHUB_REPOSITORYDEFAULT_BRANCH
Pull Request Procedures
List Pull Requests (/pr-list
)
/pr-list- Command template:
gh pr list --repo "$GITHUB_REPOSITORY" \ --state ${STATE:-open} \ ${LABEL:+--label "$LABEL"} \ ${SEARCH:+--search "$SEARCH"} \ --limit ${LIMIT:-20} \ --json number,title,author,reviewDecision,updatedAt,url - Pipe to
.jq '.' - Highlight numbers, titles, reviewDecision, and last updated timestamps.
View Pull Request (/pr-checks
, /pr-open
)
/pr-checks/pr-open- Fetch metadata + checks:
gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" \ --json number,title,author,baseRefName,headRefName,isDraft,mergeable,reviewDecision,checks - Summarize failing checks with names, status, and URLs.
- To open in browser, run
(gh will launch the default browser; echo the URL when possible).gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --web
Comment on Pull Request (/pr-comment
)
/pr-comment- Ensure a comment body exists; request it if missing.
- Run
.gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$BODY" - Share the resulting comment URL from gh output.
Close / Reopen Pull Request (/pr-close
)
/pr-close- Optional: leave a note explaining why the PR is closing.
- If deleting the branch, append
.--delete-branch - Command:
[ -n "$BODY" ] && gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$BODY" gh pr close "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" ${DELETE_BRANCH:+--delete-branch} - Report final state.
Issue Procedures
List Issues (/issue-list
)
/issue-list- Command template:
gh issue list --repo "$GITHUB_REPOSITORY" \ --state ${STATE:-open} \ ${LABEL:+--label "$LABEL"} \ ${SEARCH:+--search "$SEARCH"} \ --limit ${LIMIT:-20} \ --json number,title,author,assignees,updatedAt,url - Use
and summarize.jq '.'
View Issue (/issue-view
)
/issue-view- Fetch metadata:
gh issue view "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY" \ --json number,title,state,body,labels,assignees,url - Surface body excerpt, labels, assignees, and share the URL.
Comment on Issue (/issue-comment
)
/issue-comment- Confirm comment body.
- Run
.gh issue comment "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$BODY" - Return confirmation output.
Close or Reopen Issue (/issue-close
, /issue-reopen
)
/issue-close/issue-reopen- For closing:
- Optionally comment with context first.
- Run
.gh issue close "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY"
- For reopening:
- Optionally state the reason.
- Run
.gh issue reopen "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY"
- Confirm the resulting state.
Safety Checks
- Never mutate PRs/issues outside
.GITHUB_REPOSITORY - Validate required arguments (PR/issue numbers, comment bodies) before running gh commands.
- When summarizing checks, focus on failing or pending contexts to avoid noisy output.