explain-diff

Generates a self-contained HTML teaching page explaining a git diff, branch, or pull request.

3|Updated Nov 8, 2014
One-click install
npx skills add https://github.com/mintuz/.dotfiles --skill explain-diff-mintuz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: explain-diff
Source: https://github.com/mintuz/.dotfiles/tree/main/agents/.agents/skills/explain-diff
Command: npx skills add https://github.com/mintuz/.dotfiles --skill explain-diff-mintuz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Understanding an unfamiliar code change—whether a branch diff, staged changes, or a pull request—often requires digging through surrounding code and reconstructing context manually. This Skill turns any change set into a single self-contained HTML page that teaches the change with background, intuition, a code walkthrough, and a quiz. ## Core Features & Use Cases - Flexible diff sources: Explain a branch diff (--target), a pull request via gh pr diff (--pr), staged changes (--staged), or unstaged changes (--unstaged). - Structured teaching artifact: Produces one HTML file with Background, Intuition, Code, and Quiz sections, including a table of contents, callouts, diagrams, and an interactive five-question multiple-choice quiz. - Traceable explanations: Every claim about the change traces back to a diff hunk or to surrounding code read during analysis, keeping the explanation grounded. - Use Case: Before reviewing a teammate's PR, run the Skill with --pr 42 to get a browser-openable page that explains the system context, the core idea of the change, and a guided walkthrough of the diff grouped by theme. ## Quick Start Ask the assistant to explain the current branch's changes against main as an HTML page, optionally specifying a PR number or staged changes and an output path.

Frequently Asked Questions about explain-diff

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

FAQPage Schema
How do I generate an HTML explanation of a git diff?

Run the Skill against a diff source such as a target branch, staged changes, or unstaged changes. It reads the diff plus surrounding code and writes a single self-contained HTML file with Background, Intuition, Code, and Quiz sections to /tmp or a path you specify.

How do I explain a GitHub pull request as a web page?

Use the --pr flag with a PR number or URL, which fetches the diff via gh pr diff along with the PR title and body for context. If no number is given, it tries gh pr view to resolve the current branch's PR and stops to ask if none exists.

Can I explain only staged or unstaged git changes?

Yes, the --staged flag uses git diff --cached and the --unstaged flag uses git diff. Diff sources are mutually exclusive, and the first detected among --pr, --staged, and --unstaged takes precedence over the default branch target.

What happens if the diff is empty?

The Skill stops immediately and reports that no changes were found to explain. It does not produce an HTML file when there is no diff content to analyze.

Does the generated HTML file get committed to the repository?

No, the HTML is written only to the --output path or a default dated path under /tmp, outside the repository. The Skill explicitly never commits, pushes, or opens a PR.