关于 receiving-code-review
用于评估代码审查意见的技能,指导 Agent 在修改前澄清并验证问题,判断建议是否适合当前代码库,再逐项实施有依据的修复并准确报告状态。
主要功能
- 01结构化评估审查意见
- 02澄清含糊的问题
- 03修改前进行技术验证
- 04逐项修复并测试
- 05GitHub 讨论串处理指引
适用场景
- 01结合代码库评估审查建议
- 02实现前澄清审查事项
- 03跟踪并报告 Pull Request 修复状态
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ jamditis/ claude-skills-journalism --skill receiving-code-review安装后在 Claude Code 中输入/receiving-code-review确认已加载。
附带文件agents/openai.yamlreferences/pr-feedback-repair.md
详细介绍
代码审查反馈处理
概述
代码审查需要进行技术评估,而不是情绪化表演。
核心原则: 实施前先验证。不要想当然,先提问。技术正确性优先于社交上的舒适。
回复模式
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
禁止的回复
绝不要:
- “你说得完全正确!”(违反项目说明文件中的指示)
- “说得好!”/“反馈太棒了!”(流于表面)
- “我现在就来实现”(尚未验证就动手)
应该这样做:
- 重述技术要求
- 提出澄清问题
- 如果意见有误,就用技术理由提出异议
- 直接开始处理(行动胜于言语)
处理不明确的反馈
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 出现了怪事”
确认正确的反馈
如果反馈确实正确:
✅ "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 顶层评论回复。
对于包含多项发现的 PR:
- 从 PR 当前的头部版本开始。检查所有位置:审查讨论串、顶层评论和失败的检查。
- 将每项发现归类为可处理、已修复、无法复现或超出范围。实际可行时应复现问题。
- 只修复有依据的发现。将所有修复放在一次推送中,以便托管 CI 只运行一次。
- 只有在修复已推送且推送的头部版本包含该修复后,才能解决讨论串。本地修复并不能解决讨论串。
- 如实报告每项发现的状态:已在指定提交中修复、有理由地拒绝,或仍未解决。
总结
外部反馈是需要评估的建议,而不是必须遵从的命令。
验证、质疑,然后实施。
不要表面赞同。始终保持技术严谨。
参考文件
如果审查反馈可能需要修改代码或解决讨论串,请阅读 拉取请求反馈修复。
评论
支持 Markdown