gh-pr-handling

Automate GitHub PR creation, review, merge, and CI checks via gh CLI.

2|1|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/hanibalsk/autopilot --skill gh-pr-handling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-pr-handling
Source: https://github.com/hanibalsk/autopilot/tree/main/skills/gh-pr-handling
Command: npx skills add https://github.com/hanibalsk/autopilot --skill gh-pr-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Expert guidance for GitHub CLI operations to manage pull requests, issues, reviews, CI checks, and Copilot interactions.

Core Features & Use Cases

  • PR Creation & Management: Create, view, and merge PRs using gh.
  • CI & Checks: Inspect checks, view statuses, and wait for completion.
  • Reviews & Comments: Fetch reviews, reply to comments, and resolve threads via GraphQL.

Quick Start

  • Create a PR: gh pr create --title "feat: add feature X" --body "Details..."
  • View current PR: gh pr view
  • Monitor CI checks: gh pr checks --watch

Frequently Asked Questions about gh-pr-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate pull request creation and merging with GitHub CLI?

GitHub CLI (gh) automates PR workflows by creating PRs with formatted bodies, viewing status, and merging using squash, rebase, or auto strategies. Use gh pr create for creation, gh pr view for status, and gh pr merge to apply your merge strategy while respecting branch protections.

Can I monitor CI/CD checks and wait for them to complete using gh commands?

Yes. The gh pr checks command inspects CI check status and the --watch flag polls until completion. This lets you query check results and block subsequent automation steps until CI passes, integrating status monitoring directly into your PR workflow.

How do I handle pull request reviews and comments via GitHub CLI?

Fetch reviews and reply to comments using gh pr commands combined with GraphQL queries. You can automate review retrieval, comment resolution, and thread interactions, enabling scripted workflows for managing Copilot reviews and PR feedback at scale.

What's the best way to format PR descriptions when creating pull requests from the command line?

Use Bash heredoc syntax with gh pr create --body to compose multi-line PR descriptions without escaping complexity. This technique keeps formatting readable, embeds structured content, and integrates naturally into CI/CD automation pipelines.

Do I need to understand branch protection rules when automating PR merges?

Yes. Automated PR merges must respect branch protection settings configured on your repository. The gh pr merge command enforces these protections, so your automation adapts to review requirements, status checks, and dismissal rules without bypassing governance.