explain-diff-html
Skill455 starsChanged 4 months agoMITView on GitHub
Use when the user asks for a rich explanation of a code change, diff, branch, or PR and wants an interactive HTML document as output
We split this skill into the rules it gives an agent
11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Write a single self-contained HTML file (no external dependencies) to /tmp/ with a filename starting with today's date: …
- Distinctive: line 35
Before/after comparisons (use a two-column grid)
- Distinctive: line 38
Use callout boxes for key concepts, definitions, and important edge cases.
- Very specific: line 47
Use <pre> tags for code blocks.
- Very specific: line 61
Use system font stack: system-ui, -apple-system, sans-serif
- Very specific: line 65
Use white-space: pre-wrap on all <pre> code blocks (verify before saving)
- Distinctive: line 84
No ASCII diagrams — always use HTML/CSS
- Distinctive: line 85
No external dependencies — everything in one file
- Distinctive: line 86
Don't describe every line of the diff — group by concept
- Distinctive: line 87
Don't skip the quiz — it's the most important section for verifying understanding
- Distinctive: line 88
Don't use emoji in the output HTML
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Explain Diff (HTML)
Produce a self-contained HTML file that explains a code change — a diff, a branch, or a PR — with the clarity and flow of Martin Kleppmann. The reader should come away with genuine understanding, not just a summary.
Output Format
Write a single self-contained HTML file (no external dependencies) to /tmp/ with a filename starting with today's date: /tmp/YYYY-MM-DD-explanation-<slug>.html.
The file must include embedded CSS and JavaScript for interactive features. No external stylesheets or scripts.
Required Sections
The HTML page is one long page with a table of contents at the top.
1. Background
Two parts:
Deep background (skippable). Explain the existing system broadly. Assume a capable engineer who may not know this particular codebase. Context from surrounding modules, the problem domain, and relevant history.
Narrow background. Focus on the specific area the change touches. What was the state of the code before this diff? What pain points or limitations existed?
2. Intuition
The core idea of the change, explained with concrete examples and toy data. Use HTML-based diagrams throughout — never ASCII art.
Good diagram types:
- Simplified UI mockups (use HTML/CSS elements)
- System / data-flow diagrams showing how data moves between components
- Before/after comparisons (use a two-column grid)
- Annotated code snippets that highlight what changes
Use callout boxes for key concepts, definitions, and important edge cases. Mark them visually distinct from the main text.
3. Code Walkthrough
Group changes in a logical order (not file-by-file or line-by-line). For each group:
- What was the problem / motivation
- What the new code does
- How it connects to the rest of the change
Use <pre> tags for code blocks. Every <pre> element must have white-space: pre-wrap or white-space: pre in its CSS — scan the output to confirm this before saving.
4. Quiz
Five interactive multiple-choice questions that test genuine understanding of the diff. Each question:
- Has 4 options (A/B/C/D)
- Shows correct/incorrect feedback on click (use JavaScript)
- Includes an explanation of the correct answer
- Is tough enough that you need to understand the substance to answer, but not a gotcha
Styling Rules
- Responsive design — works on phone and desktop
- Light + dark theme support via
prefers-color-scheme - Use system font stack:
system-ui, -apple-system, sans-serif - Callout boxes for definitions, edge cases, and "why this matters"
- Smooth scroll between sections
- Table of contents with anchor links
- Use
white-space: pre-wrapon all<pre>code blocks (verify before saving) - No emoji
Tone
Write in classic style — as if you are showing the reader something they can see for themselves. Be direct, concrete, and confident. Use the flow and clarity of Martin Kleppmann: start with what the reader already knows, bridge to what's new, and make each step feel inevitable.
Workflow
- Explore the diff/branch/PR thoroughly —
git diff,git log, surrounding files, related tests - Understand the motivation — what bug or feature drove this?
- Plan the explanation — what background is needed? What's the core intuition? How to group the code changes?
- Draft the HTML in one shot — all four sections, with real content
- Scan for code blocks and confirm
white-spaceis set on every<pre> - Open the file in browser to verify it renders correctly and all JavaScript works
- Tell the user the file path
Red Flags
- No ASCII diagrams — always use HTML/CSS
- No external dependencies — everything in one file
- Don't describe every line of the diff — group by concept
- Don't skip the quiz — it's the most important section for verifying understanding
- Don't use emoji in the output HTML
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- latitude-dev/latitude-llm★ 4.7ksame name
- sendou-ink/sendou.ink★ 302same name
- scibly-dev/scibly★ 39same name
- malav2110/explain-diff-html★ 16same name
- cranberrii/skills-stack★ 2same name
- jamesyang124/agent-skills★ 2same name
- caelaxie/skillet★ 1same name
- caelaxie/supragent★ 1same name
- kenbanks-peng/skills★ 1same name
- laststance/skills★ 1same name
6 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use commit, domain-modeling and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 4 projects that use this
GoogleSkilldomain-modeling
Build and sharpen a project's domain model. Use when the user wants to pin down domain terminology or a ubiquitous language, record an architectural decision, or when another skill needs to maintain the domain model.
Also in 3 projects that use this
GoogleSkillgrill-me
A relentless interview to sharpen a plan or design.
Also in 3 projects that use this
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/llms.txtllms.txt
- brainstormingSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-superpowersSkill
- verification-before-completionSkill
- writing-plansSkill
- writing-skillsSkill
- anywidget-devSkill
- prep-releaseSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

