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.
npx skills add GitHubxsy/agent-skills --skill explain-diff-for-human-reviewgit clone --depth 1 https://github.com/GitHubxsy/agent-skillsWrote 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.
[](https://agentmods.dev/skills/githubxsy/agent-skills/explain-diff-for-human-review)<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/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<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="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00091 | $0.02038 |
| Opus 5.5 | $0.00036 | $0.00815 |
| Sonnet 5.5 | $0.00018 | $0.00408 |
| Haiku 4.5 | $0.00009 | $0.00204 |
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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.
让代码差异适合人类检视
把原始 diff 转化为 reviewer 能快速理解、逐层核验并作出决定的材料。报告不是 diff 的自然语言复述,也不替人自动批准代码。
目标
报告应同时满足两种阅读深度:
- reviewer 在第一屏内理解修改目的、可观察行为变化、最高风险、待确认决定和验证状态;
- reviewer 可以沿证据链接继续检查相关文件、符号、调用方、测试和原始 diff。
报告深度应与改动风险和复杂度相称。小改动不要强行生成完整架构分析;大改动不要用一句摘要掩盖跨模块影响。
确定范围与证据
- 准确解析用户指定的目标:单个提交、提交范围、分支比较、PR/MR、暂存区、工作区或指定文件。
- 如果目标不明确,使用对话中最近讨论的一组改动,并在报告中标明该假设。
- 检查 diff、修改前的代码、相关调用方、测试、配置和文档。按需查看提交历史,理解难以从代码本身确认的原因。
- 区分代码中可以确认的事实、提交或需求中声明的意图,以及检视者作出的推断。明确标注不确定结论。
- 除非用户要求修复,否则只检视,不修改产品代码,也不改写 PR。
优先使用仓库原生命令,例如:
git show --stat --oneline <commit>
git diff <base>...<head>
git show <commit> -- <path>
rg "<symbol>" <relevant-paths>
先建立变更地图
在设计报告前,先回答五个问题:
- 为什么要改?
- 用户、调用方或运维会观察到什么不同?
- 哪条运行时路径、数据流或职责边界发生了变化?
- 最大风险和真正需要人决定的取舍是什么?
- 现有验证证明了什么,还没有证明什么?
据此给出建议的 Review 顺序。按行为和因果链组织,不要按文件名逐个复述。
选择最小有效视图
视觉表达用于降低理解成本,不用于装饰。只保留回答当前 Review 问题所需的调用、文件、状态和边界。通常使用一到三个视图,不需要覆盖所有形式。
- 局部逻辑或算法:使用短小伪代码。
- 运行时调用关系:使用调用树。
- UI 结构与状态归属:使用组件树,并标出关键文件或模块。
- 文件职责或大范围重构:使用浅层文件树,每个目录只写一句职责。
- 组件交互、控制流或数据流:使用紧凑流程图;HTML 中优先使用带标签的 CSS 图示或内联 SVG。
- 已有形状中的局部变化:优先使用
diff形式,在调用树、文件树、组件树或伪代码上直接标出增删。 - 大部分内容都是新的,或省略上下文会隐藏归属和顺序:展示一个完整但最短的目标结构。
每个视图紧邻它所解释的简短文字,并注明它是代码事实、根据代码简化的模型,还是建议方案。不要把概念图伪装成真实调用链。
生成自包含报告
除非用户指定其他位置,否则将 UTF-8 HTML5 文件写入本 Skill 目录下的 reports/explain-diff-<target>.html。运行时确定当前 Skill 所在目录;如果 reports 不存在则创建。不要假设固定安装路径。
报告必须可以直接打开:
- 内嵌全部 CSS,不使用远程字体、脚本、样式表、图片或分析服务;
- 使用语义化 HTML、响应式布局、清晰的键盘焦点和足够的文字对比度;
- 对代码、路径、提交信息和用户文本进行 HTML 转义;
- 使用
<details>折叠长代码、原始 diff、验证命令和次要证据; - 提供打印样式,确保导出 PDF 后仍然可读。
报告结构
只保留适用于本次改动的章节,不要为了模板完整而制造空内容。
第一屏:Review 摘要
显示仓库、检视范围、基准版本、改动规模,以及:
- 一句话说明为什么改、改了什么;
- 最小的“修改前 → 修改后”行为视图;
- 最高优先级风险;
- reviewer 必须确认的决定;
- 已执行验证的真实状态;
- 建议从哪里开始 Review。
风险等级使用:严重、高、中、低、提示。总体结论仅限:可以合入、可以合入但需要后续处理、需要修改。结论必须由证据支持,并明确最终决定属于人类 reviewer。
改动导览
按行为或职责组织改动。每组说明修改目的、关键实现选择、涉及的文件和符号、输入输出、状态、失败行为及兼容性影响。展示最小有效视图,原始细节放入折叠区域。
检视发现
将可执行发现按严重程度排序。每项包括:
- 严重程度和简短标题;
- 文件、符号和代码行证据;
- 可能的失败场景或需要确认的问题;
- 建议的处理决定或后续工作。
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.
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.
- 1mo ago Changed · +14 lines · -2 tokens per session 98b8cc7f0446
- 2mo ago First seen · 131 lines · 93 tokens per session scan A a5398e78c636
explain-diff-for-human-review is a skill published in the GitHub repository GitHubxsy/agent-skills (23 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 91 tokens to every session and 2,038 once invoked, about $0.0004 per session on Opus 5.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.
Other skills, from other repositories
pr
Draft a PR body from OMC's paper trail — the smallest visual that proves the change, evidence consumed from the verify protocol (never re-collected), reversibility from the ADR test on the diff, glossary language throughout.
merge-batch
Prepare and merge an owner-selected PR batch with contributor credit and exact-candidate admission. Use for a pasted PR list; combined focused validation is diagnostic, and every actual landing still requires its applicable checks and authorization.
otto-pr-review-loop
Run Polly and OCR on a PR until all findings settle.
engram-branch-pr
PR creation workflow for Engram following the issue-first enforcement system. Trigger: When creating a pull request, opening a PR, or preparing changes for review.
github-contributor
A step-by-step guide for contributing code, tests, documentation, or build changes to open-source projects you do not maintain. It explains how to prepare a pull request that follows the project’s rules and is easier for maintainers to review.
revdiff
Review diffs, files, and documents with inline annotations in a TUI overlay, or answer questions about revdiff usage, configuration, themes, and keybindings. Opens revdiff in agterm/tmux/zellij/herdr/kitty/wezterm/cmux/ghostty/iterm2/emacs-vterm, captures annotations, and addresses them. Works in git, hg, and jj repos…