agentleFS
Job-YangJob-Yang/jobbyang-ai-skills/skills/diff-review/SKILL.md

diff-review

Skill108 starsChanged 10 days agoMITView on GitHub

只读深度代码审查:审同事 PR/MR、分支或提交前本地改动,分级排查并证伪去误报,输出报告或评审评论。触发:「帮我看看改动有没有问题」「审下同事 MR」「帮我 CR」「提交前自查」。不适用:修 Bug(code-bugfix)或完成门禁(vdd)。

27 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use prototype, triage and 5 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.
  • GoogleSkill

    prototype

    Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

    Also in 5 projects that use this

  • Google CloudSkill

    triage

    Gather context on a change or bug and plan the implementation.

    Also in 4 projects that use this

  • GoogleSkill

    tdd

    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

    Also in 4 projects that use this

  • NVIDIASkill

    research

    Before designing a feature, research how comparable libraries solve the problem, check best practices, known pitfalls, and upstream changes. Use when starting a new feature, investigating an unfamiliar area, or the user asks to research something.

    Also in 3 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 4 projects that use this

  • +2 more from google

The file

Files
SKILL.md

Diff Review · 只读深度代码审查

只读报障、不改源码;用范围核查、调用方追读与怀疑论证伪把关合入前风险,零硬凑噪音。

顶部硬底线(每轮必守): ① 仅生产高危路径(鉴权、计费、数据库迁移、CI 工作流、删除;tests/ 夹具与单测不视作 CI)均在报告中逐项显式标红「需人类维护者人工必审」;② Skeptic 一票剔除(优先于泛化提醒):凡已知由上游强校验拦住或仅测试初始化触发的误报,直接从正式发现/评审列表中剔除,不凑低风险意见;③ 真正干净的重构直接签收「无阻塞问题」。

1. 保护现场与冻结审查面

  • 严守只读:绝不执行 git checkout、switch、reset、stash 或 clean;未提交与未跟踪改动都是作者工作成果。
  • 平台无关解析 diff:
    • 本地改动:git diff HEAD 配合 git ls-files -o --exclude-standard 读全每个未跟踪新文件;
    • 分支或范围:git diff <base>...HEAD(若需 PR 元数据,可选用 gh / glab 等宿主 CLI,缺失时直接读本地分支/patch);
    • 需要「代码规范/坏味道轴 vs 需求/Spec 符合轴」分开评估时,按需查阅 双轴审查指南。
  • 冻结快照:记录 <base>..<head> 与待审文件清单;用配套 diff_surface.py 运行 python3 <skill_dir>/scripts/diff_surface.py --root <目标仓路径> 统计改动规模与高危路径标签(若工具不可用则手动 git diff --shortstat)。

2. 按规模与路径风险定档

档位规模或触发条件审查深度
Quick< 100 行且 1–5 文件(或纯静态文案/版本号)主审读通全 diff 与直接调用方
Standard100–500 行或 6–10 文件主审 + 按触发条件启用安全/架构专家视角
Deep> 500 行、> 10 文件,或涉及鉴权/资金/数据迁移(auth/billing/migration)主审 + 全专家视角 + 四角度对抗攻击

无论改动多少行,只要触碰 CI 工作流、发布签名、权限鉴权、计费校验、安装脚本或删除路径,均在报告中标红「需人类维护者人工必审」。

3. 先审范围漂移,再逐 hunk 追查

  1. 范围判定(on target / drift / incomplete):每处改动都要一句话对上目标;顺手重构、无真实分流依据的新开关或抽象层,跑一次「删掉它功能是否仍成立」检验,可删项单列为 removable。
  2. 读全上下文与同类清扫:不仅看 diff 片段,追读上游调用方与下游消费方;修了一处模式缺陷时,用 rg 搜全仓同类兄弟点(Sibling Sweep),未清理的同源新隐患标为阻塞,跨模块且属本次变更前已存在的低风险兄弟点单列为后续跟进、不强卡当前 PR。
  3. 按需加载模式与大仓清单:
    • 遇到非原子写文件、sleep 假同步、删除逻辑、重复派生规则、空心测试或锁文件变更时,按需查阅 常见高危审查模式;
    • 多人协作大仓涉及协议/DB 兼容、锁表迁移、并发热点、灰度回滚与工作区隔离时,按需查阅 多人大仓生产安全清单 与 工程工作区契约。

4. 怀疑论证伪(Skeptic)与隔离验测

  • 证伪去误报:Standard / Deep 下的专家线索、对抗假设与高危判断,按需查阅 专家视角与证伪协议;重读实际源码确认调用链与现有类型/校验防线,已被上游防线拦住或属设计意图的线索立刻丢弃或降级。
  • 按需隔离验测:仅存在并发脏改动或高危 Deep 审查时,才按需开临时 detached git worktree 应用待审路径后跑测;Quick 档本地自查直接跑受影响模块最小测试即可。多人大仓优先验证变更包与直接下游契约,不强跑耗时全仓构建。无 runnable 检查时写明「基于静态读码,未运行测试」。

5. 质检门与双模式交付

每条正式发现都须集齐四项,缺项降至建议或丢弃:精确 file:line、触发坏结果的输入或状态、已读调用方与既有防线为何拦不住的证据、真实工程严重度(CRITICAL / HIGH / MEDIUM / LOW)。真正无问题时明确签收「无阻塞问题」,不为显得严格硬凑空洞建议。

  • 自审模式(默认):首行给结论与审查范围,按漏洞类别聚合(严重度从高到低,既有问题单列 pre-existing),末尾附含范围、风险、可删项、同行清扫、文档债与实测命令结果的 Sign-off 卡片。
  • 审同事 PR/MR 模式:只输出可直接粘贴的评审评论草稿——每条写明位置、触发路径、影响与具体改法建议,保持客观就事论事,不说教。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.