retrieve-diff-from-github-pr

Retrieve GitHub Pull Request diffs and metadata for automated code reviews.

8|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/xinbenlv/codereview-skills --skill retrieve-diff-from-github-pr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: retrieve-diff-from-github-pr
Source: https://github.com/xinbenlv/codereview-skills/tree/main/skills/retrieve-diff-from-github-pr
Command: npx skills add https://github.com/xinbenlv/codereview-skills --skill retrieve-diff-from-github-pr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill retrieves the unified diff and metadata for a GitHub Pull Request, empowering automated code-review pipelines to start from the exact changes.

Core Features & Use Cases

  • PR Diff Retrieval: Fetch PR diffs and file-level changes via GitHub API.
  • PR Metadata Extraction: Extracts title, author, base/head branches, state, labels, and reviewers for context.
  • Use Case: Use this skill as the entry point in a review workflow to prepare inputs for downstream analyzers and specialist reviews.

Quick Start

Provide the PR reference (owner/repo#pull_number or a full PR URL) to retrieve its diff and metadata.

Frequently Asked Questions about retrieve-diff-from-github-pr

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

FAQPage Schema
How do I retrieve a GitHub pull request diff for automated code review?

To retrieve a GitHub pull request diff for automated code review, provide the PR reference via the owner/repo#number format or a full GitHub URL to fetch the unified diff and file-level changes via the GitHub API.

What metadata can I extract from a GitHub pull request alongside the diff?

You can extract metadata from a GitHub pull request including the title, author, base and head branches, state, labels, and reviewers, alongside structured outputs like pr_info, commits, and files for downstream orchestration.

Can I use a full GitHub URL to fetch pull request details instead of the owner/repo format?

Yes, you can use a full GitHub URL to fetch pull request details, as the skill accepts multiple PR reference formats including full URLs, owner/repo#number, or just the number with sufficient context.

How do I integrate MCP tools to fetch pull request details and changed files?

You integrate MCP tools to fetch pull request details by running this skill as the entry point in a review workflow, allowing the MCP integration to automatically retrieve PR metadata and changed files for downstream analyzers.

What is the best way to automate code review pipelines using GitHub PR diffs?

The best way to automate code review pipelines using GitHub PR diffs is to use this skill as the entry point, preparing structured inputs such as pr_info, base_ref, head_ref, and diff for specialist reviews and analyzers.

Do I need any dependencies to fetch PR details and changed files from GitHub?

No specific dependencies are required to fetch PR details and changed files from GitHub, as the skill operates without external dependencies and integrates directly with MCP tools to retrieve pull request data.