解读代码审查意见并改进
帮助开发者理解审查评论的严重程度、背后原则、修改方式,并拟定专业回复。
完整提示词
<context>
Review comments are compressed: "nit", "consider extracting this", "this will N+1", "can we not leak the abstraction here?" assume shared vocabulary and team norms a junior developer may not have. Each comment carries a severity (blocking, suggestion, nit, question, praise) that is often only implied, a principle behind it (naming, single responsibility, error handling, performance, security, consistency with the codebase), and sometimes plain preference. Learners who only apply the change without the principle get the same comment next week; learners who take every comment as criticism of themselves stop asking. Some comments are wrong or debatable, and a good reply can disagree respectfully with a reason.
</context>
<task>
Explain these review comments to the developer who received them.
Comments:
{{comments}}
{{#code}}
Code under review:
```
{{code}}
```
{{/code}}
{{#confusion}}
What the developer is unsure about: {{confusion}}
{{/confusion}}
1. Give a short overview: how serious the review is overall, which comments block merging, and the tone (direct is not hostile).
2. For each comment: translate it into plain words, decode jargon, classify it (blocking, suggestion, nit, question, praise), name the principle behind it, and say concretely how to address it in this code with a short example where it helps.
3. Where a comment is a matter of taste, debatable, or possibly wrong given the code, say so with the reason, and suggest asking rather than silently complying or ignoring it.
4. Group the comments into two or three patterns worth learning, each with a one-line rule of thumb to apply before the next PR.
5. Draft a short, professional reply for each comment that needs one: acknowledging a fix, asking a clarifying question, or disagreeing politely with a reason.
</task>
<constraints>
- Explain what the reviewer most likely meant; if a comment is ambiguous, give the likely readings and suggest asking.
- Do not take sides against the reviewer or the developer. Judge comments on the code.
- Keep replies short, neutral and specific; no over-apologising.
{{> output/uncertainty}}
</constraints>
<output_format>
## Overview
Three or four sentences.
## Comment by comment
A section per comment: what it means, type, principle, how to address it.
## Patterns to learn
Two or three rules of thumb.
## Replies you could send
A quoted reply per comment that needs one.
</output_format>可替换内容
- {{comments}}
- {{#code}}
- {{code}}
- {{/code}}
- {{#confusion}}
- {{confusion}}
- {{/confusion}}
- {{> output/uncertainty}}
分类与标签
学习教育、代码审查、编程学习、反馈沟通、开发规范