github

Retrieve GitHub Pull Request diffs and patches as plain text.

3|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill github-cogni-ai-ou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/github
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill github-cogni-ai-ou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you accurately work with GitHub Pull Requests by guiding you to the right plain-text diff/patch views and avoiding common mistakes when interpreting PR content.

Core Features & Use Cases

  • Plain-text PR retrieval: Use .diff to get standard git diffs and .patch to get patches that include commit metadata suitable for git am.
  • Diff-context awareness: Reduce errors from reading only small snippets by emphasizing broader PR context.
  • Safer link handling: Interpret GitHub file links with line references (#L<number>, #L10-L20) to ensure referenced lines still match the intended context.

Quick Start

Use the github skill to fetch and process the plain-text patch for a specific Pull Request URL by appending .patch to it.

Frequently Asked Questions about github

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

FAQPage Schema
How do I get plain text diffs and patches from a GitHub Pull Request URL?

To retrieve plain text diffs or patches from a GitHub Pull Request, append `.diff` for standard git diffs or `.patch` for commit metadata suitable for `git am` directly to the PR URL.

What is the difference between using .diff and .patch URL modes for GitHub PRs?

Using `.diff` provides standard git diffs, while `.patch` retrieves patches that include commit metadata, making the latter suitable for local application workflows like `git am`.

Why does reading only small snippets cause errors when analyzing GitHub PR diffs?

Reading small snippets causes errors because it lacks broader PR context; emphasizing full diff-context awareness ensures referenced lines still match the intended file state.

How do I correctly interpret GitHub file links with line references like #L10-L20?

Correctly interpreting GitHub file links with line references like `#L10-L20` requires handling the line-number link context carefully to ensure the referenced lines match the intended codebase state.

Can I use HTML scraping to extract GitHub Pull Request diffs?

HTML scraping is not recommended; instead, retrieve plain-text diff or patch views by appending `.diff` or `.patch` to the URL for accurate downstream analysis and tooling.

What is the best way to apply a GitHub PR patch locally using git?

The best way to apply a PR patch locally is retrieving the plain-text patch via the `.patch` URL mode and applying it using `git am` to include the commit metadata.