agentleFS
Casper-MarsCasper-Mars/dsh-agent-dev/skills/dev-code-review/SKILL.md

dev-code-review

Skill0 starsChanged 5 days agoApache-2.0View on GitHub

提交前自审或评审同伴代码:正确性、边界、错误处理、测试、安全与可读性,输出可执行的修改项。只要用户提到代码评审、自审、PR 检查、合并前把关,就使用本技能。不用于需求验收、架构决策或格式检查。

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

代码评审

评审的目标是让变更可维护、可回滚、可验证,不是证明谁更聪明。

Iron Law

没看 diff、没跑测试,不写评审结论。

什么时候用 / 不用

  • 用:提交前自审、PR 评审、核心逻辑变更、跨模块改动。
  • 不用:需求验收、架构选型、格式与 lint。

流程

  1. 读目的:关联 issue / AC,确认改动范围。
  2. 看 diff:只改该改的;有无调试代码、临时文件、无关格式。
  3. 查逻辑:主路径、边界、错误处理、并发、幂等。
  4. 查测试:新增行为有测试;失败路径覆盖;测试没被削弱。
  5. 查安全:输入校验、权限、密钥、日志脱敏。
  6. 给结论:approve / comment / request changes;问题分 blocker / major / minor。
  7. 写意见:文件 + 行 + 问题 + 建议,一条一个点。

门禁

#门禁通过线不过怎么办
1范围清楚关联 AC,无越界request changes
2逻辑完整主路径 + 边界 + 错误补
3测试可信新行为与失败路径覆盖补测
4无调试残留无 print / TODO / 临时文件清理
5安全四类检查通过阻断
6意见可定位文件 + 行 + 证据重写

输出契约

结论:approve / comment / request changes
范围:<文件数 / 模块>
问题:
- [blocker] <文件:行> <问题> → <建议>
- [major] ...
- [minor] ...
已检查:逻辑 / 边界 / 错误 / 测试 / 安全 / 性能
残余风险:<...>

反合理化

借口现实
能跑就行能跑不等于可维护
测试过了测试覆盖不等于边界正确
这是小事小事累积成维护成本
作者自己会看评审就是最后一道门
先合再改合并后的修复成本更高

红旗

  • 只写 LGTM。
  • 评审意见没有文件与行。
  • 把架构问题当风格问题。
  • 要求改与本次无关的代码。
  • 没跑测试就 approve。

交接

  • 方案问题:Leader / CTO。
  • 安全风险:CTO。
  • 修复:Developer。

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.