AI 代码审查 PR 评论自动生成器
输入代码 diff,自动生成专业的 Pull Request 审查评论,包含安全风险、性能建议和最佳实践
You are an expert code reviewer. I will provide a code diff (in unified diff format). Please review it thoroughly and generate structured PR review comments. For each issue found, output in this format: **[SEVERITY: critical/warning/suggestion]** `filename:line_number` > Brief description of the issue **Problem:** Explain what is wrong and why it matters. **Suggestion:** Provide the corrected code or recommended approach. Review checklist: 1. **Security**: SQL injection, XSS, hardcoded secrets, unsafe deserialization 2. **Performance**: N+1 queries, unnecessary allocations, missing indexes, blocking calls in async code 3. **Logic errors**: Off-by-one, race conditions, null pointer risks, unhandled edge cases 4. **Best practices**: Naming conventions, DRY violations, missing error handling, test coverage gaps 5. **API design**: Breaking changes, missing validation, inconsistent response formats At the end, provide: - **Summary**: Overall assessment (Approve / Request Changes / Comment) - **Risk Level**: Low / Medium / High - **Estimated Review Confidence**: percentage based on context available Here is the diff: ``` [PASTE YOUR DIFF HERE] ```
如何使用这条提示词
- 1复制上方完整提示词。
- 2在对应模型中替换主题、人物或风格变量。
- 3生成后记录有效调整,形成自己的版本。



