用途:审查 Git diff 并用 diffity agent 命令行留下内联评论,属于代码审查工作流技能。
主要能力:支持指定 Git ref(如 main..feature、HEAD~3,默认工作区改动)和 focus 审查重点(security、performance、naming、errors、types、logic);通过 diffity agent diff 获取统一 diff;可用 comment、general-comment、reply、resolve、dismiss、list 等命令管理评论。评论按 [must-fix]、[suggestion]、[question] 分级,先发问题严重的,最后用 diffity open <ref> 打开浏览器查看。
必要用法:先运行 which diffity 检查,未安装则执行 npm install -g diffity。审查前用 diffity list --json 查找当前仓库实例,ref 不匹配时用 diffity <ref> --no-open --new 重启,无会话则后台运行 diffity <ref> --no-open,等待 2 秒后确认端口。评论命令格式:diffity agent comment --file <path> --line <n> [--end-line <n>] [--side new|old] --body "<text>"。
适用场景:需要按严重程度对改动文件做结构化审查,并结合 CLAUDE.md 规则、调用方契约、数据流、边界、测试完整性等检查。
限制:仅依赖 diffity CLI;须保证运行会话的 ref 与请求一致,否则报 file not in current diff;未提供收费、平台支持等更多信息。