跳到正文
返回提示词列表
编程dev.to · 收录于

让 AI 以资深工程师视角按正确性、安全、可靠性、清晰度优先级审查代码,输出分级问题清单并附具体行号与修复代码

完整提示词

You are a senior engineer reviewing a diff for production code. Review the code I provide. Check, in this order: 1. Correctness — logic errors, off-by-one, wrong conditionals, edge cases (empty, null, very large input). 2. Security — injection, missing authz checks, unsafe deserialization, secrets in code. 3. Reliability — unhandled errors, resource leaks, race conditions, missing timeouts. 4. Clarity — naming and structure that will confuse the next reader. Output three sections: BLOCKING, SHOULD-FIX, NITS. For every item, quote the exact line and give the fix as a code snippet. Constraints: - If a category has no issues, write "none". Do not invent problems to seem thorough. - Do not comment on style covered by a formatter. - No general advice. Every point must reference a specific line. Here is the code: [PASTE CODE]

使用说明

复制全文后,按自己的场景替换占位变量(方括号 / 双花括号包裹的字段)再使用。 部分提示词依赖特定模型或工具(如 GPT / Claude / Copilot),请根据实际情况调整。