mcpField
R
receiving-code-review

receiving-code-review

github.com/obra测试与质量307.4k225.0k 次安装1 周前更新
代码仓库

关于 receiving-code-review

receiving-code-review 是一个 skill,用于指导 Agent 处理代码评审反馈。它强调先理解、再验证、后实现,要求结合代码库事实评估建议是否正确,并在必要时给出技术性反驳。

主要功能

  1. 01先读完整反馈,再逐条理解
  2. 02对照代码库验证建议是否成立
  3. 03不明确的条目先澄清再实现
  4. 04按阻塞、简单、复杂的顺序逐项修复
  5. 05对外部评审意见进行技术性核查

适用场景

  1. 01处理 PR 中的内联评审意见
  2. 02判断评审建议是否会破坏现有功能
  3. 03在 GitHub 评论串中回复评审意见

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/obra/superpowers --skill receiving-code-review

安装后在 Claude Code 中输入/receiving-code-review确认已加载。

详细介绍

代码审查的接收

概述

代码审查需要技术层面的评估,而不是情绪化的表演。

核心原则: 先验证再实施。先询问再假设。技术正确性优先于社交舒适。

响应模式

WHEN receiving code review feedback:

1. READ: Complete feedback without reacting
2. UNDERSTAND: Restate requirement in own words (or ask)
3. VERIFY: Check against codebase reality
4. EVALUATE: Technically sound for THIS codebase?
5. RESPOND: Technical acknowledgment or reasoned pushback
6. IMPLEMENT: One item at a time, test each

禁止的响应

绝对不要:

  • "You're absolutely right!"(明确违反指令文件)
  • "Great point!" / "Excellent feedback!"(表演性质)
  • "Let me implement that now"(未经验证就动手)

应当:

  • 重述技术需求
  • 提出澄清问题
  • 如果审查意见有误,用技术理由反驳
  • 直接开始工作(行动胜于言辞)

处理不清晰的反馈

IF any item is unclear:
  STOP - do not implement anything yet
  ASK for clarification on unclear items

WHY: Items may be related. Partial understanding = wrong implementation.

示例:

your human partner: "Fix 1-6"
You understand 1,2,3,6. Unclear on 4,5.

❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later
✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."

按来源区别处理

来自你的人类合作伙伴
  • 可信:理解之后再实施
  • 如果范围不清楚,仍需询问
  • 不要表演性地附和
  • 直接行动或给出技术性确认
来自外部审查者
BEFORE implementing:
  1. Check: Technically correct for THIS codebase?
  2. Check: Breaks existing functionality?
  3. Check: Reason for current implementation?
  4. Check: Works on all platforms/versions?
  5. Check: Does reviewer understand full context?

IF suggestion seems wrong:
  Push back with technical reasoning

IF can't easily verify:
  Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"

IF conflicts with your human partner's prior decisions:
  Stop and discuss with your human partner first

你的人类合作伙伴的规则: "外部反馈:保持怀疑,但要仔细核实"

针对“专业”功能的 YAGNI 检查

IF reviewer suggests "implementing properly":
  grep codebase for actual usage

  IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
  IF used: Then implement properly

你的人类合作伙伴的规则: "你和审查者都向我汇报。如果我们不需要这个功能,就不要添加。"

实施顺序

FOR multi-item feedback:
  1. Clarify anything unclear FIRST
  2. Then implement in this order:
     - Blocking issues (breaks, security)
     - Simple fixes (typos, imports)
     - Complex fixes (refactoring, logic)
  3. Test each fix individually
  4. Verify no regressions

何时提出反驳

以下情况应当反驳:

  • 建议会破坏现有功能
  • 审查者缺乏完整上下文
  • 违反 YAGNI(未使用的功能)
  • 对当前技术栈而言在技术上不正确
  • 存在遗留或兼容性原因
  • 与你的人类合作伙伴的架构决策相冲突

如何反驳:

  • 使用技术理由,而不是防御性的态度
  • 提出具体问题
  • 引用可运行的测试或代码
  • 如果涉及架构问题,请让你的人类合作伙伴参与

如果你不愿意当面提出反驳: 先说明这种顾虑,然后把你注意到的问题告诉你的合作伙伴。他们会欣赏你的坦诚。

确认正确的反馈

当反馈确实正确时:

✅ "Fixed. [Brief description of what changed]"
✅ "Good catch - [specific issue]. Fixed in [location]."
✅ [Just fix it and show in the code]

❌ "You're absolutely right!"
❌ "Great point!"
❌ "Thanks for catching that!"
❌ "Thanks for [anything]"
❌ ANY gratitude expression

为什么不说感谢: 行动胜于言辞。直接修复即可。代码本身就表明你已经听取了反馈。

如果你发现自己正要写“感谢”: 删掉它。改为陈述修复内容。

优雅地纠正自己的反驳

如果你曾经提出反驳,但事实证明你错了:

✅ "You were right - I checked [X] and it does [Y]. Implementing now."
✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."

❌ Long apology
❌ Defending why you pushed back
❌ Over-explaining

客观地陈述更正,然后继续推进。

常见错误

错误修正
表演性附和陈述需求或直接行动
盲目实施先对照代码库进行验证
未测试就批量处理一次一项,逐项测试
默认审查者正确检查是否会破坏功能
回避反驳技术正确性 > 舒适感
部分实施先澄清所有条目
无法验证却仍然继续说明局限性,请求指示

真实示例

表演性附和(错误):

Reviewer: "Remove legacy code"
❌ "You're absolutely right! Let me remove that..."

技术验证(正确):

Reviewer: "Remove legacy code"
✅ "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?"

YAGNI(正确):

Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"

不清楚的条目(正确):

your human partner: "Fix items 1-6"
You understand 1,2,3,6. Unclear on 4,5.
✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."

GitHub 线程回复

回复 GitHub 上的行内审查评论时,应在评论线程中回复(gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies),而不是作为 PR 的顶层评论发布。

评论

支持 Markdown