mcpField
R
receiving-code-review

receiving-code-review

github.com/srbhr测试与质量29.0k77 次安装1 天前更新
代码仓库

关于 receiving-code-review

帮助 Agent 以技术核验而非直接附和的方式处理代码审查意见。它指导先澄清并评估反馈,再逐项实施更改并测试每项修复。

主要功能

  1. 01先澄清不明确的反馈
  2. 02结合代码库核验建议
  3. 03逐项排序并实施修复
  4. 04测试每项更改并检查回归
  5. 05基于技术理由提出异议

适用场景

  1. 01整理多项代码审查意见
  2. 02评估外部审查者的建议
  3. 03避免实现未使用的功能
  4. 04回应不明确或不正确的评论

安装

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

$npx skills add https://github.com/srbhr/resume-matcher --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!"(明确违反 CLAUDE.md)
  • "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(未使用的功能)
  • 对于当前技术栈在技术上不正确
  • 存在遗留或兼容性原因
  • 与你的人类合作伙伴的架构决策相冲突

如何反驳:

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

如果你不好意思直接反驳,可以发出这个暗号:"Strange things are afoot at the Circle K"

认可正确的反馈

当反馈确实正确时:

✅ "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

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

**如果你发现自己正要写"Thanks":**删掉它。直接陈述修复内容。

体面地更正你自己的反驳

如果你曾经反驳过,但结果是你错了:

✅ "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