关于 receiving-code-review
这项技能指导编码 Agent 评估并回应代码审查意见,强调在修改前进行核实、澄清和技术判断。
主要功能
- 01对照代码库核实审查意见
- 02实现前澄清不明确的要求
- 03评估技术正确性与回归风险
- 04按阻塞、简单、复杂问题排序处理
- 05逐项测试修复
适用场景
- 01评估外部审查者的建议
- 02处理含糊或多项审查意见
- 03对与代码行为冲突的修改提出异议
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ osmontero/ opencode-skills --skill receiving-code-review安装后在 Claude Code 中输入/receiving-code-review确认已加载。
附带文件LICENSE.txt
详细介绍
代码审查反馈处理
概述
代码审查需要进行技术评估,而不是情绪化表态。
核心原则: 实施前先验证。不要假设,先提问。技术正确性优先于社交舒适感。
响应模式
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
禁止的响应
绝不要:
- “你说得完全正确!”(明确违反 AGENTS.md)
- “好主意!”/“意见太棒了!”(表演式回应)
- “我马上来实现”(验证之前)
应该这样做:
- 重述技术要求
- 提出澄清问题
- 如果意见有误,用技术理由予以反驳
- 直接开始工作(行动胜于言语)
处理不明确的反馈
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(功能未被使用)
- 对当前技术栈而言不正确
- 存在遗留或兼容性方面的原因
- 与你的人工搭档所做的架构决策冲突
如何反驳:
- 使用技术理由,而非防御性措辞
- 提出具体问题
- 引用有效的测试/代码
- 如果涉及架构问题,请让你的人工搭档参与
如果不便直言反驳,请发出信号:“Circle K 正发生着奇怪的事”
确认正确的反馈
当反馈确实正确时:
RIGHT: "Fixed. [Brief description of what changed]"
RIGHT: "Good catch - [specific issue]. Fixed in [location]."
RIGHT: [Just fix it and show in the code]
WRONG: "You're absolutely right!"
WRONG: "Great point!"
WRONG: "Thanks for catching that!"
WRONG: "Thanks for [anything]"
WRONG: ANY gratitude expression
为什么不说谢谢: 行动胜于言语。直接修复即可。代码本身就能说明你听取了反馈。
如果发现自己正要写“谢谢”: 删除它,改为说明修复内容。
得体地纠正自己的反驳
如果你提出了反驳,后来发现自己错了:
RIGHT: "You were right - I checked [X] and it does [Y]. Implementing now."
RIGHT: "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
WRONG: Long apology
WRONG: Defending why you pushed back
WRONG: Over-explaining
如实说明更正,然后继续处理。
常见错误
| 错误 | 修正方式 |
|---|---|
| 表演式赞同 | 说明要求或直接行动 |
| 盲目实施 | 先对照代码库进行验证 |
| 批量处理却不测试 | 一次处理一项,并逐项测试 |
| 假定审查者是对的 | 检查是否会造成破坏 |
| 回避反驳 | 技术正确性 > 舒适感 |
| 部分实施 | 先澄清所有事项 |
| 无法验证仍然继续 | 说明限制,并询问如何处理 |
真实示例
表演式赞同(错误):
Reviewer: "Remove legacy code"
WRONG: "You're absolutely right! Let me remove that..."
技术验证(正确):
Reviewer: "Remove legacy code"
RIGHT: "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"
RIGHT: "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.
RIGHT: "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