Explain Diff logo

Explain Diff

Community
kevinslin
explain-diff

Create a self-contained interactive HTML explanation of a code diff, branch, commit, or pull request.

Overview

Publisherkevinslin
Repositoryagstack
Skill nameexplain-diff
Stars
26
Forks
1
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by kevinslin on GitHub. Read the source before you install it.

Installation

Install the Explain Diff AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/kevinslin/agstack/tree/main/active/explain-diff
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kevinslin/agstack.git /tmp/agstack
mkdir -p .claude/skills
cp -r /tmp/agstack/active/explain-diff .claude/skills/explain-diff
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Explain Diff in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Explain Diff on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Explain Diff is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Explain Diff

Turn a code change into a guided explanation that helps a reader build a mental model, understand the implementation, and test their comprehension.

Default to a single local HTML artifact. Do not modify the reviewed repository.

Resolve the change

  1. Identify the repository and exact change boundary.
    • For a pull request, record the repository, PR number, base SHA, and head SHA.
    • For a branch or commit range, resolve both endpoints and their merge base.
    • With no explicit target, inspect git status --short, git diff HEAD, and relevant untracked files as the current working-tree change.
  2. Read the complete changed-file list and diff summary before selecting details.
  3. Explore enough surrounding code and documentation to explain the system that existed before the change. Follow call sites, data shapes, workflow edges, configuration, and tests that define the behavior.
  4. Separate facts observed in code from inferred intent. Label uncertainty.

Build the explanation

Create these sections in order:

  1. Overview: Name the change boundary, summarize the result in two or three sentences, and provide a table of contents.
  2. Background:
    • Start with a skippable beginner-oriented model of the relevant system.
    • Narrow to the exact components, contracts, and failure modes the change touches.
  3. Intuition: Explain the central idea before implementation details. Use a small concrete example with toy values and one or two reusable visual models.
  4. Code walkthrough: Group changes by behavior or execution order rather than filename order. For each group, explain what changed, why it matters, and how tests or evidence support it. Link relationships between files.
  5. Operational impact: Call out compatibility, rollout, failure, security, and observability implications when relevant. Omit this section when the change has none.
  6. Quiz: Include exactly five medium-difficulty multiple-choice questions. Each question must have one correct answer, plausible distractors, and feedback explaining every choice. Reveal feedback only after interaction.

Write with lucid, precise prose. Prefer concrete examples and smooth transitions over exhaustiveness. Explain terminology when first introduced.

Render the artifact

Write one self-contained HTML file with inline CSS and JavaScript.

  • Default path: /tmp/YYYY-MM-DD-explanation-<short-slug>.html.
  • Use the user-provided output directory when specified.
  • Keep the artifact outside the reviewed repository unless the user explicitly requests a repo-owned file.
  • Build one responsive scrolling page with clear section headers and anchored table-of-contents links. Do not use tabs for top-level navigation.
  • Use a small, consistent family of HTML/CSS diagrams. Good choices include a component/data-flow diagram, a simplified UI, or a before/after state model. Include example data in diagrams. Do not use ASCII diagrams.
  • Render code in <pre><code> blocks and escape HTML metacharacters.
  • Make quiz controls keyboard-accessible and provide visible correct/incorrect feedback plus the explanation after a choice.
  • Avoid external scripts, stylesheets, fonts, images, and network requests.

Validate before handoff

  1. Confirm the file starts with the current date and exists outside the reviewed repository unless explicitly requested otherwise.
  2. Confirm every code block preserves whitespace through white-space: pre or white-space: pre-wrap.
  3. Confirm the HTML has no external asset or network dependency.
  4. Confirm all five quiz questions respond to clicks and keyboard activation, reveal feedback, and identify the correct answer.
  5. Confirm every material claim maps to inspected code, tests, documentation, or clearly labeled inference.
  6. Open or render the artifact when browser tooling is available and fix visual overflow, unreadable diagrams, broken anchors, and script errors.

Return a clickable absolute path to the HTML artifact and a one-sentence summary of the reviewed change.

Adapted from Geoffrey Litt's explain-diff gist.

Frequently asked questions

What does the Explain Diff AI skill do?

Create a self-contained interactive HTML explanation of a code diff, branch, commit, or pull request.

Why use Explain Diff on TypingMind?

Because you install it once and use it with any model. Explain Diff is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Explain Diff in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/kevinslin/agstack/tree/main/active/explain-diff. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Explain Diff?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Explain Diff?

As many as you like. As long as a model supports skills, you can use Explain Diff with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Explain Diff AI skill free?

It is published on GitHub by kevinslin. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇