github-operations
Expert knowledge of GitHub CLI (gh) usage and best practices. Use when analyzing GitHub issues, PRs, repositories, or when user mentions GitHub URLs, issue/PR numbers.
When & Why to Use This Skill
This Claude skill provides expert-level integration with the GitHub CLI (gh), enabling users to analyze issues, track pull requests, and monitor CI/CD statuses directly within the conversation. It streamlines developer workflows by automating repository data retrieval and facilitating safe write operations through a human-in-the-loop confirmation process.
Use Cases
- Case 1: Summarize complex GitHub issue threads and pull request discussions to quickly understand the context of a bug or feature request.
- Case 2: Monitor CI/CD pipeline statuses and inspect code diffs for specific pull requests to accelerate the code review process.
- Case 3: Perform repository management tasks such as creating issues, adding comments, or merging PRs using natural language while maintaining safety with explicit confirmations.
- Case 4: Efficiently fetch metadata and details from multiple repositories by simply providing GitHub URLs or issue/PR numbers.
| name | github-operations |
|---|---|
| description | Analyze GitHub issues, view PR details, fetch repository info, check CI status, get issue comments. Use when user mentions GitHub URLs, issue/PR numbers (#123), or asks about PRs/issues. |
| version | 0.1.0 |
| context | fork |
| agent | gha |
GitHub Operations Expert
Master GitHub CLI (gh) commands for analyzing issues, PRs, and repositories.
Core Principles
ALWAYS use gh CLI for GitHub operations. NEVER use WebFetch for GitHub URLs.
Write Operations (Require Explicit Confirmation)
NEVER execute these without user confirmation:
| Command | Operation |
|---|---|
gh pr create |
Creating PRs |
gh issue create |
Creating issues |
gh issue comment / gh pr comment |
Adding comments |
gh pr review |
Submitting reviews |
gh pr merge |
Merging PRs |
gh issue close / gh pr close |
Closing issues/PRs |
Rules:
- Default to READ-ONLY analysis
- Ask for confirmation before any write operation
- Never proactively create PRs, issues, or comments
Quick Reference
# View issue/PR details
gh issue view <number> --repo owner/repo
gh pr view <number> --repo owner/repo
# View with comments
gh issue view <number> --comments --repo owner/repo
# Check CI status
gh pr checks <number> --repo owner/repo
# View PR diff
gh pr diff <number> --repo owner/repo
URL Format Handling
Extract from GitHub URLs:
https://github.com/owner/repo→owner/repohttps://github.com/owner/repo/issues/123→owner/repo #123https://github.com/owner/repo/pull/456→owner/repo #456
Cross-repo format: owner/repo#number
Additional Resources
- For complete command reference, see commands.md
- For jq patterns and analysis strategies, see patterns.md
Troubleshooting
If gh commands fail, check authentication:
gh auth status
gh auth login
References
- GitHub CLI Manual:
gh help - GitHub API Docs: https://docs.github.com/en/rest
- jq Manual: https://jqlang.github.io/jq/manual/