github-pr-review-operation

Automate GitHub PR reviews with diff analysis and comment operations via GitHub CLI.

1|Updated Nov 17, 2023
One-click install
npx skills add https://github.com/Suntory-N-Water/sui-blog --skill github-pr-review-operation-suntory-n-water
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-pr-review-operation
Source: https://github.com/Suntory-N-Water/sui-blog/tree/main/.claude/skills/github-pr-review-operation
Command: npx skills add https://github.com/Suntory-N-Water/sui-blog --skill github-pr-review-operation-suntory-n-water

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates PR review tasks using the GitHub CLI, enabling quick access to PR data, diffs with line numbers, and streamlined commenting workflows.

Core Features & Use Cases

  • PR情報取得: gh pr view NUMBER --repo OWNER/REPO --json title,body,author,state,baseRefName,headRefName,url
  • 差分取得(行番号付き): gh pr diff NUMBER --repo OWNER/REPO | awk '...'
  • コメント取得: gh api repos/OWNER/REPO/issues/NUMBER/comments
  • PRへコメント: gh pr comment NUMBER --repo OWNER/REPO --body "..."
  • インラインコメント: gh pr comments API を利用した行指定コメント
  • 使用ケース: レビュー指摘を自動的に抽出・返信するワークフロー

Quick Start

Fetch PR details and an inline comment on a specific file/line to illustrate a quick review cycle.

Frequently Asked Questions about github-pr-review-operation

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

FAQPage Schema
How do I automate GitHub PR reviews using the command line?

Automate PR reviews by using GitHub CLI (gh) to fetch PR details, generate diffs with line numbers, retrieve comments, and post inline reviews programmatically. This eliminates manual navigation and enables batch review workflows integrated with automation pipelines.

Can I retrieve PR diffs with line numbers using gh?

Yes, gh pr diff retrieves the full diff for a PR with line numbers intact. Pipe the output through awk or similar tools to parse and annotate specific lines for targeted review comments.

What do I need to set up before automating PR review tasks?

You need GitHub CLI installed, authenticated with valid credentials, and the repository owner/name and PR number. The Skill handles PR URL parsing and structured access to PR data, diffs, and comments for immediate use.

How do I post inline comments on specific lines in a GitHub PR?

Use the GitHub API through gh to post comments targeting specific file paths and line numbers. The Skill automates line-specific comment operations, enabling precise feedback without manual review UI navigation.

Can I reply to existing PR comments programmatically?

Yes, retrieve existing comments via gh api and post replies using gh pr comment. The Skill streamlines comment threading workflows, letting you extract review feedback and respond automatically in batch cycles.

What's the difference between posting a PR comment and an inline comment?

PR comments appear on the conversation tab; inline comments attach to specific lines in the diff. The Skill supports both operations, enabling general feedback alongside granular code-line annotations in a single review cycle.