github

MichaelFisher1997's avatarfrom MichaelFisher1997

GitHub workflow best practices using gh CLI and git. Use when working with GitHub repositories, pull requests, issues, or GitHub interactions.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 4, 2026

When & Why to Use This Skill

This Claude skill optimizes GitHub workflows by integrating the GitHub CLI (gh) and git. It enables seamless management of repositories, issues, pull requests, and CI/CD pipelines directly within the agent's environment, ensuring developers can interact with their codebase and project management tools without leaving the chat interface.

Use Cases

  • Streamlined Pull Request Lifecycle: Push local branches and create pull requests with detailed titles, bodies, and reviewers using gh pr create, ensuring a smooth transition from code to review.
  • Context-Aware Issue Management: Automatically extract data from GitHub issue URLs to view details, search for related bugs, or create new issues without manual web navigation.
  • CI/CD Pipeline Monitoring: Inspect GitHub Actions status, view workflow lists, and retrieve detailed logs from failed runs to debug deployment issues efficiently.
  • Repository Exploration and Metadata Retrieval: Fetch comprehensive repository information, including stars, topics, and descriptions, to quickly understand the context of private or public projects.
  • Advanced API Interactions: Utilize gh api for complex GitHub operations not natively supported by standard commands, providing full flexibility for power users.
namegithub
descriptionGitHub workflow best practices using gh CLI and git. Use when working with GitHub repositories, pull requests, issues, or GitHub interactions.

GitHub

  • Prefer using gh CLI commands for all GitHub operations including viewing issues, PRs, repos, and discussions.
  • Use gh issue view, gh pr view, gh repo view to inspect GitHub resources instead of web search.
  • When given a GitHub URL (e.g., https://github.com/user/repo/issues/123), extract the info and use gh to fetch the issue/PR data.
  • Use gh api for advanced GitHub API interactions that are not natively supported by gh commands.
  • Always assume GitHub URLs may refer to private repositories and use gh for authentication.
  • Use git for all local git operations (clone, branch, commit, push, etc.).

When to Use gh CLI

Use gh for:

  • Viewing issues: gh issue view <number> --repo owner/repo
  • Viewing PRs: gh pr view <number> --repo owner/repo
  • Searching issues/PRs: gh issue list --repo owner/repo --search "query"
  • Viewing repository info: gh repo view owner/repo
  • Creating PRs: gh pr create
  • Creating issues: gh issue create
  • Checking CI status: gh run list, gh run view
  • Viewing workflows: gh workflow list, gh workflow view
  • Creating releases: gh release create

Workflows

Pull Request

  • You must git push a branch before creating a pull request with gh pr create.
  • Use gh pr create with appropriate flags for title, body, reviewers, etc.

Viewing Issues from URLs

When given a GitHub issue URL like https://github.com/owner/repo/issues/123:

  1. Extract owner, repo, and issue number
  2. Run gh issue view 123 --repo owner/repo
  3. Use the issue data instead of web search

Viewing PRs from URLs

When given a GitHub PR URL like https://github.com/owner/repo/pull/456:

  1. Extract owner, repo, and PR number
  2. Run gh pr view 456 --repo owner/repo
  3. Use the PR data instead of web search

Searching Issues

Use gh issue list to search:

gh issue list --repo owner/repo --search "bug"
gh issue list --repo owner/repo --search "is:open label:enhancement"

Searching PRs

Use gh pr list to search:

gh pr list --repo owner/repo --search "is:open"
gh pr list --repo owner/repo --search "base:main"

Common Commands

Repository Info

gh repo view owner/repo
gh repo view owner/repo --json name,description,topics,stars

Issues

gh issue list --repo owner/repo
gh issue view 123 --repo owner/repo
gh issue create --repo owner/repo --title "Title" --body "Body"

Pull Requests

gh pr list --repo owner/repo
gh pr view 456 --repo owner/repo
gh pr create --base main --title "Title" --body "Body"

CI/Workflows

gh workflow list --repo owner/repo
gh run list --repo owner/repo
gh run view run-id --repo owner/repo --log

Keywords

GitHub, issue, pull request, PR, repository, repo, gh, git, GitHub CLI, GitHub API, workflow, release, CI/CD