代码审查
MVPavan2026-10-25查看 170复制 1738
用于实质性代码审查,或用于验证并处理审查发现。常规的最终差异检查不是单独的审查工作流。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md3152 chars
--- name: code-review description: Use for substantive code review or to verify and act on review findings. Routine final diff inspection is not a separate review workflow. --- # Code Review Review implemented changes against requirements and consequential risks. Routine final diff inspection follows AGENTS.md without requiring this full workflow. ## Select a mode - `inline` or combined: review requirements and quality on the supplied scope. - `spec` / `quality`: a dispatched role with its corresponding verdict contract. - `re-review`: resolve prior findings and new breakage in the fix delta. - `feedback`: verify and act on incoming review findings within authorization. Dispatched reviewers and structured re-reviews use `references/review-contract.md`. Feedback handling uses `references/feedback.md`; producing a review is read-only, whereas applying feedback requires implementation authority. ## Establish scope and evidence Use the supplied diff/package and requirements. Infer an obvious supplied base or working-tree scope; ask only when the choice changes what should be reviewed. For uncommitted work, use `git diff <base> -- <owned paths>` and inspect in-scope untracked files separately. `BASE..HEAD` covers committed work only. Distinguish pre-existing edits using the task baseline; filenames alone do not establish ownership. Read enough surrounding code and affected callers to evaluate concrete risks. Treat implementer reports and reviewer claims as evidence to verify, not authority. A package saves repeated reads but does not forbid necessary source inspection. If requirements are missing, state that spec compliance is unverified and review quality against the known task; do not invent requirements from the diff. Record failing/unavailable checks with their scope and impact. They may prevent approval but do not prevent a useful review of inspectable code. Reuse applicable check evidence; run focused additional checks when a consequential doubt remains. Read-only review must preserve checkout, index and refs; use permitted isolated facilities for checks that need mutations. ## Review Check missing, extra and misunderstood requirements before quality. Examine correctness, error handling, compatibility, data migration, ownership and relevant invariants. Judge tests by whether they detect meaningful failures with independent expectations; changes to tests are not inherently defects. Apply the security skill's relevant boundary controls for material security changes. Report actionable defects introduced or exposed by the change, with file/line, trigger, consequence and evidence. Separate pre-existing issues and uncertainty. Leave formatting to configured tools; do not treat harmless warnings as defects. Severity follows consequence: Critical for severe safety/data-loss or operational failure; Important for acceptance or correctness issues blocking trust; Minor for nonblocking improvements. Preference alone is not a finding. End with findings, actual checks, limits and a justified verdict. Explicitly say when no defects were found; do not invent praise or findings to fill a template.