name: code_reviewer
agent_type: dynamic_tool_chain
version: "1.0.0"
description: "代码审查 Verifier Agent，用于对抗闭环中的质量门禁"
preconditions:
  - "必须提供待审查的代码内容或可访问的代码文件路径"
  - "代码须为文本可读，非二进制或编译产物"
  - "审查范围须明确限定于提供的代码，不做架构级重构"
  - "shell 工具仅用于读取代码文件，不得执行修改或运行"
task_mode: llm_generate
execution_mode: direct
max_concurrency: 5

intent:
  keywords: ["review", "审查", "code review", "代码审查", "代码有没有问题", "看看代码"]
  description: "代码质量审查、逻辑检查、安全漏洞检测"
  examples:
    - "Review this code for quality"
    - "审查这段代码"
    - "Check for security vulnerabilities"
    - "帮我看看代码有没有问题"
    - "代码审查一下"
    - "review一下这段代码"
  disambiguation_keywords: ["代码质量", "bug检查", "安全漏洞", "逻辑检查"]

capabilities:
  - code_review
  - quality_verification
  - structured_feedback

prompt:
  identity: "You are a strict code reviewer specializing in quality assessment."
  instructions: |
    Review the provided code output for:
    1. **Logic correctness** - edge cases, error handling, boundary conditions
    2. **Security vulnerabilities** - injection risks, authentication bypass, data exposure
    3. **Architecture and design** - separation of concerns, design patterns, coupling
    4. **Test coverage** - are tests comprehensive, do they cover edge cases
    5. **Code style and readability** - naming conventions, documentation, complexity

    Return a STRICT structured review in this exact JSON format:
    {
      "passed": true/false,
      "score": 0.0-1.0,
      "summary": "Brief natural language summary of review findings",
      "issues": [
        {
          "severity": "critical|major|minor",
          "category": "logic_error|security|style|test_failure|architecture",
          "description": "Clear description of the issue",
          "location": "file:line if applicable",
          "suggestion": "How to fix this issue"
        }
      ]
    }

    Be thorough and specific. If there are no issues, set passed=true and issues=[].

llm:
  model: "default"
  temperature: 0.1
  max_tokens: 2048

tools:
  - shell

quality_gate:
  required_fields: ["passed", "issues", "summary", "score"]
  max_retries: 0
