| name | github-explorer |
| description | General-purpose GitHub exploration and analysis tool for searching issues, creating PRs, analyzing git history, and reviewing PR comments Use when this capability is needed. |
| metadata | {"author":"C00ldudeNoonan"} |
GitHub Explorer Skill
Description
This skill provides interactive GitHub exploration and analysis capabilities using the GitHub CLI (gh) and git commands. It enables searching and filtering issues, creating pull requests with custom templates, analyzing file history with git blame, and reviewing PR comments and feedback. Use this skill when you need flexible, exploratory interactions with GitHub repositories.
Usage
Invoke this skill when you need to:
- Search for issues with specific labels, assignees, or text queries
- List and filter issues across repositories
- Create pull requests with customized content and templates
- Analyze who authored specific lines of code and when
- Review pull request comments and identify actionable feedback
- Investigate code history and track changes to specific functions
- Parse and analyze PR review threads
Prerequisites
This skill requires the following tools to be installed and configured:
-
GitHub CLI (gh): Version 2.0 or higher
-
Git: Any recent version
- Check installation:
git --version
-
jq: JSON processor for parsing API responses
-
GitHub Authentication: Must be logged in to gh CLI
- Check status:
gh auth status
- Login:
gh auth login
Instructions
Feature 1: Search and List Issues
Use this feature to find and explore GitHub issues across repositories.
Step 1: List Issues in Current Repository
gh issue list --state open
gh issue list --state all
gh issue list --state open --limit 20
Step 2: Filter Issues by Labels
gh issue list --label "bug" --state open
gh issue list --label "bug,high-priority" --state open
gh issue list --label "enhancement" --state open --limit 10
Step 3: Filter Issues by Assignee
gh issue list --assignee @me --state open
gh issue list --assignee username --state open
gh issue list --assignee @me --label "bug,high-priority" --state open
Step 4: Search Issues with Text Queries
gh search issues "authentication error"
gh search issues "docker configuration" --repo owner/repo
gh search issues "api timeout" --owner orgname
gh search issues "memory leak" --state open --label "bug" --limit 10
Step 5: View Issue Details
gh issue view 123
gh issue view 123 --comments
gh issue view 123 --json title,body,state,labels,assignees,createdAt
Step 6: Parse and Format Issue Data
gh issue list --json number,title,state,labels,assignees,createdAt --limit 10 | \
jq -r '.[] | "\(.number): \(.title) [\(.state)]"'
gh issue list --json number,title,assignees --limit 20 | \
jq -r '.[] | "\(.number)\t\(.title)\t\(.assignees[0].login // "unassigned")"'
gh issue list --state all --json labels --jq '[.[].labels[].name] | group_by(.) | map({label: .[0], count: length}) | sort_by(.count) | reverse'
Feature 2: Create Pull Requests
Use this feature to create pull requests with custom content and templates.
Step 1: Review Current Branch Changes
Before creating a PR, review what changes will be included:
git diff main...HEAD --stat
git diff main...HEAD
git log main...HEAD --oneline
git log main...HEAD --pretty=fuller
Step 2: Create Basic Pull Request
gh pr create --fill
gh pr create --title "Fix authentication bug" --body "This PR fixes the token validation issue"
gh pr create --base develop --head feature-branch
Step 3: Create PR with Custom Template
gh pr create --title "Add user profile feature" --body "$(cat <<'EOF'
## Summary
- Implemented user profile page
- Added avatar upload functionality
- Created profile editing form
## Changes Made
- New UserProfile component
- Profile API endpoints
- Avatar storage in GCS
## Related Issues
Fixes #42
Relates to #38
## Testing
- [ ] Manual testing completed
- [ ] Unit tests added
- [ ] Integration tests passing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Step 4: Create Draft or WIP Pull Requests
gh pr create --draft --title "WIP: Refactor authentication"
gh pr create --title "Fix login bug" --body "Ready for review"
Step 5: Link PR to Issues
gh pr create --title "Fix memory leak" --body "Fixes #123"
gh pr create --title "Bug fixes" --body "$(cat <<'EOF'
## Summary
Multiple bug fixes
## Issues
Fixes #123
Fixes #124
Relates to #125
EOF
)"
Step 6: Advanced PR Creation
REPO_URL=$(gh repo view --json url --jq .url)
CURRENT_BRANCH=$(git branch --show-current)
COMMITS=$(git log main...HEAD --pretty=format:"- %s")
gh pr create --title "Feature: $(git log -1 --pretty=%s)" --body "$(cat <<EOF
## Changes in this PR
$COMMITS
## Branch
\`$CURRENT_BRANCH\`
## Repository
$REPO_URL
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Feature 3: Git Blame Analysis
Use this feature to analyze file history and identify code authors.
Step 1: Basic Git Blame
git blame path/to/file.py
git blame -L 50,100 path/to/file.py
git blame -L 50,100 path/to/file.py --date=short
Step 2: Enhanced Blame Output
git blame --show-email path/to/file.py
git blame -L 10,20 path/to/file.py --abbrev=40
git blame -w path/to/file.py
git blame --follow path/to/file.py
Step 3: Analyze File History
git log -L 50,100:path/to/file.py --pretty=fuller --patch
git log -S "function_name" --source --all --pretty=fuller path/to/file.py
git log --follow --oneline path/to/file.py
git blame path/to/file.py | awk '{print $2}' | sort | uniq -c | sort -nr
Step 4: Link Blame to GitHub Commits
COMMIT_HASH=$(git blame -L 50,50 path/to/file.py | awk '{print $1}')
REPO_URL=$(gh repo view --json url --jq .url)
echo "$REPO_URL/commit/$COMMIT_HASH"
Step 5: Format Blame Output
git blame -L 10,20 path/to/file.py | \
awk '{printf "Line %s: %s %s %s\n", substr($0, index($0, ")") + 1, 4), $2, $3, $4}'
echo "Line,Author,Date,Commit" > blame_output.csv
git blame -L 1,100 path/to/file.py --date=short | \
awk '{print NR "," $2 "," $3 "," $1}' >> blame_output.csv
Step 6: Advanced History Analysis
git log -S "critical_function" --source --all -p path/to/file.py
git log --stat path/to/file.py
git blame path/to/file.py | awk '{print $2, $3}' | sort | uniq -c | sort -nr
COMMIT=$(git blame -L 50,50 path/to/file.py | awk '{print $1}')
git diff $COMMIT path/to/file.py
Feature 4: Analyze PR Comments
Use this feature to analyze pull request review comments and feedback.
Step 1: View PR with Comments
gh pr view 123 --comments
gh pr view 123 --json title,body,state,comments
Step 2: Check PR Review Status
gh pr checks 123
gh pr reviews 123
gh pr view 123 --json reviewDecision
Step 3: Get Detailed Review Comments
gh api repos/:owner/:repo/pulls/123/comments | jq '.'
gh api repos/:owner/:repo/pulls/123/comments --jq '.[] | {
author: .user.login,
body: .body,
path: .path,
line: .line,
created: .created_at
}'
gh api repos/:owner/:repo/pulls/123/comments --jq '.[] | select(.path == "src/main.py") | {author: .user.login, line: .line, body: .body}'
Step 4: Analyze Conversation Threads
gh api repos/:owner/:repo/pulls/123/reviews --jq '.[] | {
author: .user.login,
state: .state,
body: .body,
submitted: .submitted_at
}'
gh pr view 123 --json reviews --jq '.reviews[] | select(.state == "CHANGES_REQUESTED")'
gh pr view 123 --json reviews --jq '.reviews | group_by(.state) | map({state: .[0].state, count: length})'
Step 5: Track Comment Authors
gh api repos/:owner/:repo/pulls/123/comments --jq 'group_by(.user.login) | map({author: .[0].user.login, count: length})'
gh api repos/:owner/:repo/pulls/123/comments --jq '[.[].user.login] | unique'
gh api repos/:owner/:repo/pulls/123/comments --jq 'group_by(.user.login) | map({author: .[0].user.login, count: length}) | sort_by(.count) | reverse | .[0]'
Step 6: Identify Actionable Feedback
gh pr reviews 123 --json author,state,body | \
jq '.[] | select(.state == "CHANGES_REQUESTED")'
gh api repos/:owner/:repo/pulls/123/comments --jq '[.[].path] | unique'
gh api repos/:owner/:repo/pulls/123/comments --jq 'group_by(.path) | map({file: .[0].path, comment_count: length})'
gh pr diff 123
gh pr diff 123 -- path/to/file.py
Error Handling
Authentication Errors
If you encounter authentication issues:
gh auth status
gh auth login
gh api user
gh repo view
Rate Limiting
GitHub API has rate limits. If you encounter rate limit errors:
gh api rate_limit
gh api rate_limit --jq '.resources.core | {
limit: .limit,
remaining: .remaining,
reset: .reset,