G

GitHub Ops Skill

Comprehensive GitHub operations suite for managing pull requests, issues, releases, Actions workflows, and repository settings. Wraps the `gh` CLI with intelligent defaults and batch operations for efficient repo management.

SkillCommunitydevelopmentv1.0.0MIT
0 views0 copies

Description

This skill provides streamlined GitHub operations using the gh CLI. It handles common tasks like PR management, issue triage, release creation, and Actions workflow monitoring with smart defaults and batch capabilities.

Instructions

When the user asks about GitHub operations, use the appropriate pattern:

Pull Request Operations

# List open PRs with key details gh pr list --json number,title,author,updatedAt,reviewDecision --limit 20 # View PR with full context gh pr view 123 --json title,body,files,additions,deletions,reviews,comments # Create PR with template gh pr create --title "feat: add user dashboard" --body "$(cat <<'EOF' ## Summary - Added dashboard component with stats grid - Created API routes for dashboard data ## Test Plan - [x] Unit tests for API routes - [x] Component tests for Dashboard - [ ] E2E test for full flow EOF )" # Merge with squash gh pr merge 123 --squash --delete-branch # Batch: close stale PRs gh pr list --state open --json number,updatedAt | \ jq '[.[] | select(.updatedAt < "2025-01-01")] | .[].number' | \ xargs -I{} gh pr close {} --comment "Closing stale PR. Please reopen if still needed."

Issue Operations

# Create issue with labels gh issue create --title "Bug: login fails on Safari" \ --body "Steps to reproduce..." --label bug,priority-high # Triage: list unassigned bugs gh issue list --label bug --no-assignee --json number,title,createdAt # Batch label issues gh issue list --search "is:open no:label" --json number | \ jq '.[].number' | xargs -I{} gh issue edit {} --add-label needs-triage

Release Operations

# Create release with auto-generated notes gh release create v1.2.0 --generate-notes --latest # Create release with custom notes gh release create v1.2.0 --title "v1.2.0 - Dashboard Release" \ --notes "$(cat CHANGELOG.md)" # Upload release assets gh release upload v1.2.0 dist/app.zip dist/checksums.txt

Actions & Workflow Monitoring

# View recent workflow runs gh run list --limit 10 --json status,conclusion,name,createdAt # Watch a running workflow gh run watch 12345 # Re-run failed jobs gh run rerun 12345 --failed # View workflow logs gh run view 12345 --log-failed

Repository Queries

# Search across repos gh search code "TODO FIXME" --repo owner/repo --json path,textMatches # Get repo stats gh api repos/{owner}/{repo} --jq '{stars: .stargazers_count, forks: .forks_count, issues: .open_issues_count}' # List collaborators gh api repos/{owner}/{repo}/collaborators --jq '.[].login'

Rules

  • Always use --json flag for parseable output when processing data
  • Use --jq for server-side filtering when possible (faster than local jq)
  • Never force-push or delete branches without explicit user confirmation
  • For batch operations, show a preview (dry run) before executing
  • Use --limit to avoid fetching excessive data
  • Check gh auth status if commands fail unexpectedly
  • Prefer gh CLI over raw API calls — it handles auth and pagination

Examples

User: Show me all PRs waiting for my review Action: gh pr list --search "review-requested:@me" --json number,title,author

User: Create a release from the latest tag Action: Get latest tag, generate release notes, create release

User: Close all issues labeled wontfix Action: List matching issues, show preview, close with comment after confirmation

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates