FE

fetch-diff

Fetches and displays GitHub pull request diffs with line-number annotation for easier code review.

Install

mkdir -p .claude/skills/fetch-diff && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4478" && unzip -o skill.zip -d .claude/skills/fetch-diff && rm skill.zip

Installs to .claude/skills/fetch-diff

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Fetch PR diff with filtering and line numbers for code review.
62 charsno explicit “when” trigger
Beginner

Key capabilities

  • Fetch a pull request diff from GitHub
  • Add line numbers to the diff for review
  • Filter diffs by file patterns
  • Mask diffs for auto-generated files
  • Mask diffs for deleted files

How it works

The skill fetches a pull request diff, annotates lines with numbers, and applies filtering based on provided file patterns, masking auto-generated or deleted files.

Inputs & outputs

You give it
A GitHub pull request URL and optional file patterns
You get back
A formatted diff with line numbers, filtered by specified patterns

When to use fetch-diff

  • Review PR diffs in terminal
  • Filter PR changes by file type
  • Add review comments with line numbers

About this skill

Fetch PR Diff

Fetches a pull request diff and adds line numbers for easier review comment placement. Auto-generated files are shown with masked diffs.

Usage

uv run --package skills skills fetch-diff <pr_url> [--files <pattern> ...]

Examples:

# Fetch the full diff
uv run --package skills skills fetch-diff https://github.com/mlflow/mlflow/pull/123

# Fetch only Python files
uv run --package skills skills fetch-diff https://github.com/mlflow/mlflow/pull/123 --files '*.py'

# Fetch only frontend files
uv run --package skills skills fetch-diff https://github.com/mlflow/mlflow/pull/123 --files 'mlflow/server/js/*'

# Multiple patterns
uv run --package skills skills fetch-diff https://github.com/mlflow/mlflow/pull/123 --files '*.py' '*.ts'

Token is auto-detected from GH_TOKEN env var or gh auth token.

Output Example

Regular file:

diff --git a/path/to/file.py b/path/to/file.py
index abc123..def456 100644
--- a/path/to/file.py
+++ b/path/to/file.py
@@ -10,7 +10,7 @@
10    10 |  import os
11    11 |  import sys
12    12 |  from typing import Optional
13       | -from old_module import OldClass
      14 | +from new_module import NewClass
14    15 |
15    16 |  def process_data(input_file: str) -> dict:

Auto-generated file (masked):

diff --git a/uv.lock b/uv.lock
index abc123..def456 100644
--- a/uv.lock
+++ b/uv.lock
[Auto-generated file - diff masked]

Deleted file (masked):

diff --git a/path/to/removed.py b/dev/null
index abc123..0000000 100644
--- a/path/to/removed.py
+++ /dev/null
[Deleted file - diff masked]

Each line is annotated as old_line new_line | <marker> content:

  • - marker (left number only) -> deleted line, side=LEFT, line=old_line
  • + marker (right number only) -> added line, side=RIGHT, line=new_line
  • No marker (both numbers) -> unchanged line, side=RIGHT, line=new_line

Prerequisites

GH_TOKEN environment variable or gh auth token

How it compares

This skill automates the process of fetching, formatting, and filtering PR diffs with line numbers, which is more efficient than manually reviewing raw diff outputs.

Compared to similar skills

fetch-diff side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
fetch-diff (this skill)13moReviewBeginner
resolve-conflicts818moReviewIntermediate
dependency-upgrade265moReviewIntermediate
git-commits214moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry