explain-diff-for-human-review

explain-diff-for-human-review is a skill for Claude Code, Codex from GitHubxsy/agent-skills. It costs 93 tokens per session (1,717 once invoked), scanned A, original, Apache-2.0.

A tool for turning code changes into a self-contained HTML report for a person to review. It explains the purpose, behavior, risks, compatibility, and evidence behind a difference in code.

In plain words
What is it for?
Use it to review commits, branches, pull or merge requests, staged changes, working-tree changes, or selected files.
Why use it?
Raw code differences can be difficult to understand without their surrounding files and context. The report gathers that context while leaving the final approval decision to the reviewer.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/githubxsy/agent-skills/explain-diff-for-human-review
Any agent
npx skills add GitHubxsy/agent-skills --skill explain-diff-for-human-review
Clone the repo
git clone --depth 1 https://github.com/GitHubxsy/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for explain-diff-for-human-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/githubxsy/agent-skills/explain-diff-for-human-review.svg)](https://agentmods.dev/skills/githubxsy/agent-skills/explain-diff-for-human-review)
Your own site
<a href="https://agentmods.dev/skills/githubxsy/agent-skills/explain-diff-for-human-review"><img src="https://agentmods.dev/badge/skills/githubxsy/agent-skills/explain-diff-for-human-review.svg" alt="Measured on agentmods" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,717 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00093 $0.01717
Opus 5 $0.00046 $0.00859
Sonnet 5 $0.00019 $0.00343
Haiku 4.5 $0.00009 $0.00172

Measured 4d ago against content hash a5398e78c636, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

explain-diff-for-human-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/explain-diff-for-human-review/SKILL.md · 131 lines

How it starts

The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.

生成人工代码检视报告

生成一份自包含的 HTML 报告,将原始代码差异转化为供人类检视的上下文、证据和待确认事项。帮助检视者作出判断,不要替检视者自动批准改动,也不要只复述增加或删除了哪些代码行。

确定检视范围

  1. 准确解析用户指定的目标:单个提交、提交范围、分支比较、代码评审请求(PR 或 MR)、暂存区、工作区或指定文件。
  2. 如果目标不明确,使用对话中最近讨论的一组改动,并在报告中明确说明该假设。
  3. 检查 diff、改动前的代码、相关调用方、测试、配置和文档。
  4. 区分代码中可以确认的事实和对修改意图的推断;对不确定的结论加以标注。
  5. 除非用户另行要求修复,否则在解释 diff 时不要修改产品代码。

优先使用仓库原生命令,例如:

git show --stat --oneline <commit>
git diff <base>...<head>
git show <commit> -- <path>
rg "<symbol>" <relevant-paths>

生成报告

除非用户指定其他位置,否则将一个 UTF-8 HTML5 文件写入本 Skill 目录下的 reports/explain-diff-<target>.html。运行时先确定当前 Skill 所在目录;如果 reports 目录不存在,则创建它。不要假设 Skill 安装在某个特定项目目录、用户目录或 Agent 平台目录中。

报告必须能够通过直接打开文件使用:

  • 将全部 CSS 内嵌到 HTML。
  • 不使用远程字体、脚本、样式表、图片、分析服务或其他托管资源。
  • 使用语义化 HTML、响应式布局、清晰的键盘焦点和足够的文字对比度。
  • 将代码、路径、提交信息以及用户提供的文本写入 HTML 前进行转义。
  • 优先使用 CSS 图示和带标签的流程图;仅在确实有助于理解关系时使用内联 SVG。
  • 使用 <details> 折叠较长的代码片段、验证命令和问答答案。
  • 如果代码托管平台提供稳定的网页地址,链接到具体提交、文件和代码行;支持 GitHub、CodeHub、GitLab、Gitee 及其他类似平台,不绑定任何特定厂商。
  • 优先使用固定到提交哈希的永久链接,不使用可能随分支变化而失效的链接。
  • 先读取仓库 remote,并仅在能够可靠识别托管平台及其 URL 规则时生成网页链接。不要根据猜测拼接地址。
  • 如果托管平台未知、没有网页访问地址或无法确定链接格式,则显示仓库相对路径、符号、提交哈希和行号,不降低报告的可读性。
  • 提供打印样式,确保报告导出为 PDF 后仍然可读。

报告结构

页头

显示仓库、检视目标、基准版本、作者和日期(如果可知)、改动规模,以及一句话结论。提供简洁的风险等级说明:严重提示

结论摘要

说明:

  • 修改了什么。
  • 为什么需要这项修改。
  • 用户或运维人员会观察到哪些行为变化。
  • 是否向后兼容。
  • 总体检视结论:可以合入、可以合入但需要后续处理,或需要修改。

架构与数据流

解释相关系统在修改前和修改后的模型。如果涉及三个及以上组件或处理步骤,提供简洁的可视化关系图。

改动导览

按行为或职责组织改动,不要简单按照文件顺序罗列。每组改动说明:

  • 修改目的。
  • 关键实现选择。
  • 涉及的文件和符号。
  • 输入、输出、状态和失败行为。
  • 兼容性影响。

只展示短小且关键的代码片段,将原始 diff 细节放入可折叠区域。

影响矩阵

使用表格覆盖适用的影响面:配置、API 或协议、运行时行为、并发、安全、指标与可观测性、部署、兼容性和测试。如果“未受影响”本身对检视有价值,也要明确标出。

检视发现

先列出可执行的发现,并按严重程度排序。每项发现包括:

  • 严重程度和简短标题。
  • 文件、符号和代码行证据。
  • 可能的失败场景或需要确认的问题。
  • 建议的处理决定或后续工作。

明确区分已确认缺陷、设计决策和残余风险。如果没有发现明确缺陷,应直接说明,不要为了填充报告而虚构问题。

验证

将验证证据分为三类:

  1. 本次检视实际执行的测试及观察到的结果。
  2. diff 中存在但本次检视没有执行的测试。
  3. 建议补充的验证。

只有在命令输出或可靠的已有证据能够证明时,才可将命令标记为通过。适用时提供可复现的人工验证步骤。

替代方案

只有在能够识别出实质不同的实现方式时,才列出一到两个替代方案。比较其收益、成本,以及当前实现为何被选择或更合适。

检视清单与理解问答

提供一份简短清单,列出检视者需要明确确认的决定。如果报告还用于知识传递,增加不超过五个中等难度的问题,并将答案放在 <details> 中;对于范围很小的缺陷修复,可以省略问答。

Read the full file on GitHub · 131 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 131 lines · 93 tokens per session scan A a5398e78c636

Subscribe to this mod's changes

explain-diff-for-human-review is a skill published in the GitHub repository GitHubxsy/agent-skills (22 stars, last pushed 6d ago), licensed Apache-2.0. It adds 93 tokens to every session and 1,717 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens