code_review
Analyzes code, Git diffs, or managed Plans to check delivery consistency across changed files, tests, APIs, and architecture evidence. Detects semantic issues without acting as a static scanner.
Instructions
当用户需要审查代码、真实 Git diff 或托管 Plan 的交付一致性时使用。MCP 可确定性收集 changed files、Plan 声明范围、产物、测试、公共契约、架构和 revision 证据;代码语义问题仍由 Agent 审查,不伪装成静态扫描器
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | 要审查的代码。可以是代码片段、完整文件或 git diff 输出 | |
| focus | No | 审查重点:security(安全)、performance(性能)、quality(质量)、all(全部)。可选,默认 all | |
| plan_id | No | 可选托管 Plan ID。提供后读取 Plan 状态并比较 declaredScope、产物、测试、架构证据和 revision | |
| base_ref | No | diff_mode=range 时的基线 Git ref | |
| head_ref | No | diff_mode=range 时的目标 Git ref | |
| diff_mode | No | Git diff 范围。auto 默认审查相对 HEAD 的 staged+unstaged 变更;working 仅未暂存;staged 仅已暂存;range 使用 base_ref/head_ref | |
| file_path | No | 要审查的文件路径(相对 project_root 或绝对路径)。未传 code 时从磁盘读取 | |
| project_root | No | 项目根目录绝对路径。未传 code/file_path 时,可从该 Git 仓库自动收集真实 diff | |
| max_diff_chars | No | 最大 diff 字符数,1000-500000,默认 120000。超出时明确标记 truncated |