github-pr-operation

Retrieve GitHub PR details and post inline comments via gh CLI.

11|Updated Mar 12, 2023
One-click install
npx skills add https://github.com/i9wa4/dotfiles --skill github-pr-operation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-pr-operation
Source: https://github.com/i9wa4/dotfiles/tree/main/dot.config/claude/skills/github-pr-operation
Command: npx skills add https://github.com/i9wa4/dotfiles --skill github-pr-operation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates GitHub Pull Request operations using the gh CLI and jq, reducing manual PR management time and errors.

Core Features & Use Cases

  • PR Info & Status: Retrieve PR title, author, state, and URL.
  • Inline & General Comments: Post or reply to PR comments and inline comments with precise target lines.
  • Diff & Review: Generate line-numbered diffs to review changes efficiently.

Quick Start

Retrieve PR details and post a sample comment using gh. Example: gh pr view 123 --repo OWNER/REPO --json title,body,author,state,baseRefName,headRefName,url

Frequently Asked Questions about github-pr-operation

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

FAQPage Schema
How do I automate posting comments on GitHub pull requests?

Automate PR comments using gh CLI and jq to post general or inline comments with precise line targeting. The Skill handles comment creation and replies across repositories without manual GitHub web navigation.

Can I retrieve PR details like title, author, and state from the command line?

Retrieve PR information including title, body, author, state, base and head branch names, and URL using gh CLI with JSON output. This Skill wraps those queries for quick access across repos.

How do I generate a diff with line numbers for PR code review?

Generate line-numbered diffs using gh and jq to map changes to specific lines. This enables precise inline comments and systematic code review without switching between tools.

What do I need to set up before automating GitHub PR operations?

Install gh CLI authenticated to GitHub and jq for JSON processing. The Skill requires both tools configured before retrieving PR data or posting comments.

Can I fetch and reply to existing PR comments programmatically?

Fetch issue and review comments from PRs and reply to them with gh and jq. The Skill supports both general PR comments and inline review comments with line-level precision.

How do I get the latest commit SHA from a pull request?

Retrieve the latest commit SHA using gh CLI JSON queries. This Skill extracts commit information needed for diffs, reviews, or triggering downstream CI checks.