关于 receiving-code-review
Receiving Code Review 是一项针对代码库评估审查意见的技能。它帮助开发者核实建议、澄清含糊之处,并制定有依据的回复和实施计划。
主要功能
- 01对照代码库核实意见
- 02标出需澄清的内容
- 03评估技术正确性与风险
- 04准备认可或有理据的反驳
- 05安排修改与测试顺序
适用场景
- 01修改前评估审查建议
- 02澄清多项反馈中的歧义
- 03回应技术上不正确的建议
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ shipshitdev/ skills --skill receiving-code-review安装后在 Claude Code 中输入/receiving-code-review确认已加载。
附带文件plugin.jsonREADME.md
详细介绍
接收代码审查意见
核心原则
代码审查需要进行技术评估,而非情绪化表态。
先验证,再实施。先提问,再假设。技术正确性优先于社交上的舒适。
约定
输入:
- 收到的审查反馈(PR 评论、口头审查意见)以及反馈所指向的代码库。
输出:
- 针对每条意见作出技术确认或有理有据地提出异议,并为经评估后保留的修改制定行动计划。
创建/修改:
- 不会直接创建或修改任何内容。此技能用于生成回复;代码编辑由其他技能完成。
外部副作用:
- 只读调用
git/gh,对照代码库核实相关说法。
是否需要确认:
- 不需要。所有输出仅供参考。
委托给:
pr-comments的address模式,用于将回复发布到 PR。code-review,用于修改合并后进行新一轮审查。
回复模式
WHEN receiving code review feedback:
1. READ: Complete feedback without reacting
2. UNDERSTAND: Restate the requirement in your own words (or ask)
3. VERIFY: Check against codebase reality
4. EVALUATE: Is this technically sound for THIS codebase?
5. RESPOND: Technical acknowledgment or reasoned pushback
6. IMPLEMENT: One item at a time, test each
禁止的回复
绝对不要说:
- “你说得完全正确!”
- “说得好!”/“这个反馈非常棒!”
- “我现在就来实现”(尚未验证时)
- 任何表示感谢的话语(“谢谢你指出这一点!”、“谢谢你……!”)
改为:
- 重述技术要求
- 提出澄清问题
- 如果建议有误,则基于技术理由提出异议
- 直接开始处理——行动胜于言辞
处理不明确的反馈
IF any item is unclear:
STOP — do not implement anything yet
ASK for clarification on all unclear items before proceeding
WHY: Items may be related. Partial understanding leads to wrong implementation.
示例:
Reviewer: "Fix items 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: Is this technically correct for THIS codebase?
2. Check: Would this break existing functionality?
3. Check: Is there a reason the current implementation exists?
4. Check: Does this work on all required platforms/versions?
5. Check: Does the reviewer understand the full context?
IF the suggestion seems wrong:
Push back with technical reasoning
IF you cannot easily verify:
Say so: "I can't verify this without [X]. Should I [investigate / ask / proceed]?"
IF the suggestion conflicts with prior architectural decisions:
Stop and surface the conflict before implementing
针对“正确实现”建议进行 YAGNI 检查
IF a reviewer suggests adding or expanding a feature "properly":
grep the codebase for actual usage
IF unused: "This isn't called anywhere. Remove it (YAGNI)?"
IF used: Then evaluate and implement properly
审查者经常会建议改进尚未在任何地方接入的代码。扩大范围前先验证其用法。
实施顺序
FOR multi-item feedback:
1. Clarify anything unclear FIRST
2. Then implement in this order:
- Blocking issues (broken behaviour, security)
- Simple fixes (typos, imports, naming)
- Complex fixes (refactoring, logic changes)
3. Test each fix individually
4. Verify no regressions before moving to the next item
何时提出异议
出现以下情况时应提出异议:
- 会破坏现有功能
- 假设了审查者并不了解的上下文
- 违反 YAGNI 原则(添加未使用的代码)
- 对当前技术栈而言在技术上不正确
- 与遗留或兼容性要求冲突
- 与既定的架构决策相矛盾
如何提出异议:
- 使用技术理由,而非采取防御姿态
- 提出具体问题,指出其中的缺漏
- 引用现有测试或可正常运行的代码
- 如果分歧涉及架构,升级请代码库所有者处理
- 如果提出异议让你感到不自在,说明这种顾虑,并解释具体问题
确认正确的反馈
当反馈确实正确时:
✅ "Fixed. [Brief description of what changed]"
✅ "Good catch — [specific issue]. Fixed in [location]."
✅ [Just fix it and let the diff speak]
❌ "You're absolutely right!"
❌ "Great point!"
❌ "Thanks for catching that!"
❌ 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 the legacy code"
❌ "You're absolutely right! Let me remove that..."
技术验证(良好):
Reviewer: "Remove the legacy code"
✅ "Checking... build target is 10.15+, this API requires 13+.
Removing it drops pre-13 support. Is that intentional,
or should I gate it behind a version check instead?"
YAGNI 检查(良好):
Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
✅ "Grepped the codebase — nothing calls this endpoint.
Remove it (YAGNI)? Or is there usage I'm missing?"
事项不明确(良好):
Reviewer: "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 PR 评论回复
回复 GitHub 上的行内审查评论时,应在评论串中回复,而不是作为 PR 顶层评论发布:
gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies \
-f body="[your response]"
审查者的反馈是需要评估的建议,而非必须遵循的命令。先验证,再质疑,然后实施。不要表演式地表示认同。始终保持技术严谨。
评论
支持 Markdown