{
  "canonical_name": "The-PR-Agent/pr-agent",
  "compilation_id": "pack_1d8c90599a8d41259877ab90e21736c1",
  "created_at": "2026-05-22T04:23:16.194154+00:00",
  "created_by": "project-pack-compiler",
  "feedback": {
    "carrier_selection_notes": [
      "viable_asset_types=skill, recipe, host_instruction, eval, preflight",
      "recommended_asset_types=skill, recipe, host_instruction, eval, preflight"
    ],
    "evidence_delta": {
      "confirmed_claims": [
        "identity_anchor_present",
        "capability_and_host_targets_present",
        "install_path_declared_or_better"
      ],
      "missing_required_fields": [],
      "must_verify_forwarded": [
        "Run or inspect `pip install pr-agent` in an isolated environment.",
        "Confirm the project exposes the claimed capability to at least one target host."
      ],
      "quickstart_execution_scope": "allowlisted_sandbox_smoke",
      "sandbox_command": "pip install pr-agent",
      "sandbox_container_image": "python:3.12-slim",
      "sandbox_execution_backend": "docker",
      "sandbox_planner_decision": "deterministic_isolated_install",
      "sandbox_validation_id": "sbx_0d0e7f6eaeae47e58331cac24f771116"
    },
    "feedback_event_type": "project_pack_compilation_feedback",
    "learning_candidate_reasons": [],
    "template_gaps": []
  },
  "identity": {
    "canonical_id": "project_8f6634d44f1e106247eda0d6044ba768",
    "canonical_name": "The-PR-Agent/pr-agent",
    "homepage_url": null,
    "license": "unknown",
    "repo_url": "https://github.com/The-PR-Agent/pr-agent",
    "slug": "pr-agent",
    "source_packet_id": "phit_dcee096b88b0475584b8a87860198e8f",
    "source_validation_id": "dval_f01005a3aa214a0dab63463c792358ed"
  },
  "merchandising": {
    "best_for": "需要软件开发与交付能力，并使用 chatgpt的用户",
    "github_forks": 1500,
    "github_stars": 11160,
    "one_liner_en": "🚀 PR Agent: The Original Open-Source PR Reviewer.",
    "one_liner_zh": "🚀 PR Agent: The Original Open-Source PR Reviewer.",
    "primary_category": {
      "category_id": "software-development",
      "confidence": "medium",
      "name_en": "Software Development",
      "name_zh": "软件开发与交付",
      "reason": "matched_keywords:review, git"
    },
    "target_user": "使用 chatgpt 等宿主 AI 的用户",
    "title_en": "pr-agent",
    "title_zh": "pr-agent 能力包",
    "visible_tags": [
      {
        "label_en": "Security & Permissions",
        "label_zh": "安全审查与权限治理",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "product_domain-security-permissions",
        "type": "product_domain"
      },
      {
        "label_en": "Knowledge Base Q&A",
        "label_zh": "知识库问答",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "user_job-knowledge-base-q-a",
        "type": "user_job"
      },
      {
        "label_en": "Code Review",
        "label_zh": "代码审查",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "core_capability-code-review",
        "type": "core_capability"
      },
      {
        "label_en": "Review Loop",
        "label_zh": "评审闭环",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "workflow_pattern-review-loop",
        "type": "workflow_pattern"
      },
      {
        "label_en": "Evaluation Suite",
        "label_zh": "评测体系",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "selection_signal-evaluation-suite",
        "type": "selection_signal"
      }
    ]
  },
  "packet_id": "phit_dcee096b88b0475584b8a87860198e8f",
  "page_model": {
    "artifacts": {
      "artifact_slug": "pr-agent",
      "files": [
        "PROJECT_PACK.json",
        "QUICK_START.md",
        "PROMPT_PREVIEW.md",
        "HUMAN_MANUAL.md",
        "AI_CONTEXT_PACK.md",
        "BOUNDARY_RISK_CARD.md",
        "PITFALL_LOG.md",
        "REPO_INSPECTION.json",
        "REPO_INSPECTION.md",
        "CAPABILITY_CONTRACT.json",
        "EVIDENCE_INDEX.json",
        "CLAIM_GRAPH.json"
      ],
      "required_files": [
        "PROJECT_PACK.json",
        "QUICK_START.md",
        "PROMPT_PREVIEW.md",
        "HUMAN_MANUAL.md",
        "AI_CONTEXT_PACK.md",
        "BOUNDARY_RISK_CARD.md",
        "PITFALL_LOG.md",
        "REPO_INSPECTION.json"
      ]
    },
    "detail": {
      "capability_source": "Project Hit Packet + DownstreamValidationResult",
      "commands": [
        {
          "command": "pip install pr-agent",
          "label": "Python / pip · 官方安装入口",
          "source": "https://github.com/The-PR-Agent/pr-agent#readme",
          "verified": true
        }
      ],
      "display_tags": [
        "安全审查与权限治理",
        "知识库问答",
        "代码审查",
        "评审闭环",
        "评测体系"
      ],
      "eyebrow": "软件开发与交付",
      "glance": [
        {
          "body": "判断自己是不是目标用户。",
          "label": "最适合谁",
          "value": "需要软件开发与交付能力，并使用 chatgpt的用户"
        },
        {
          "body": "先理解能力边界，再决定是否继续。",
          "label": "核心价值",
          "value": "🚀 PR Agent: The Original Open-Source PR Reviewer."
        },
        {
          "body": "未完成验证前保持审慎。",
          "label": "继续前",
          "value": "publish to Doramagic.ai project surfaces"
        }
      ],
      "guardrail_source": "Boundary & Risk Card",
      "guardrails": [
        {
          "body": "Prompt Preview 只展示流程，不证明项目已安装或运行。",
          "label": "Check 1",
          "value": "不要把试用当真实运行"
        },
        {
          "body": "chatgpt",
          "label": "Check 2",
          "value": "确认宿主兼容"
        },
        {
          "body": "publish to Doramagic.ai project surfaces",
          "label": "Check 3",
          "value": "先隔离验证"
        }
      ],
      "mode": "skill, recipe, host_instruction, eval, preflight",
      "pitfall_log": {
        "items": [
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Allow specifying a custom branch for locating `.pr_agent.toml`",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_6aa2027573564d778bdccf1c0e603a0f | https://github.com/The-PR-Agent/pr-agent/issues/1977 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "high",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：Allow specifying a custom branch for locating `.pr_agent.toml`",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "Developers should check this security_permissions risk before relying on the project: Add support for Databricks hosted models",
            "category": "安全/权限坑",
            "evidence": [
              "failure_mode_cluster:github_issue | fmev_63e7f7511bd7314419df2ded4a1a20e9 | https://github.com/The-PR-Agent/pr-agent/issues/2246 | Add support for Databricks hosted models"
            ],
            "severity": "high",
            "suggested_check": "Before packaging this project, run the relevant install/config/quickstart check for: Add support for Databricks hosted models. Context: Observed when using python, docker",
            "title": "失败模式：security_permissions: Add support for Databricks hosted models",
            "user_impact": "Developers may expose sensitive permissions or credentials: Add support for Databricks hosted models"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Add support for Databricks hosted models",
            "category": "安全/权限坑",
            "evidence": [
              "community_evidence:github | cevd_6b5b4692165240e5a79137dc9335bd50 | https://github.com/The-PR-Agent/pr-agent/issues/2246 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。"
            ],
            "severity": "high",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：Add support for Databricks hosted models",
            "user_impact": "可能影响授权、密钥配置或安全边界。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：GITLAB 404 project not found",
            "category": "安全/权限坑",
            "evidence": [
              "community_evidence:github | cevd_04774e9f24034b56b080d2af0875b7fd | https://github.com/The-PR-Agent/pr-agent/issues/2282 | 来源讨论提到 python 相关条件，需在安装/试用前复核。"
            ],
            "severity": "high",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：GITLAB 404 project not found",
            "user_impact": "可能影响授权、密钥配置或安全边界。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Incorrect Inline Code Suggestion Formatting in Azure DevOps",
            "category": "安全/权限坑",
            "evidence": [
              "community_evidence:github | cevd_d01349d41e8a48db89a80ebdb4ca9bde | https://github.com/The-PR-Agent/pr-agent/issues/2110 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。"
            ],
            "severity": "high",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：Incorrect Inline Code Suggestion Formatting in Azure DevOps",
            "user_impact": "可能影响升级、迁移或版本选择。"
          },
          {
            "body": "Developers should check this installation risk before relying on the project: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider",
            "category": "安装坑",
            "evidence": [
              "failure_mode_cluster:github_issue | fmev_f812843570a304cde8d165f9bd42e8dc | https://github.com/The-PR-Agent/pr-agent/issues/2379 | Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider"
            ],
            "severity": "medium",
            "suggested_check": "Before packaging this project, run the relevant install/config/quickstart check for: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider. Context: Observed when using python",
            "title": "失败模式：installation: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental supp...",
            "user_impact": "Developers may fail before the first successful local run: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider"
          },
          {
            "body": "Developers should check this installation risk before relying on the project: feat: support agent skills for context-aware review guidance",
            "category": "安装坑",
            "evidence": [
              "failure_mode_cluster:github_issue | fmev_6fae5a58920d170992e268f4837b86a9 | https://github.com/The-PR-Agent/pr-agent/issues/2384 | feat: support agent skills for context-aware review guidance"
            ],
            "severity": "medium",
            "suggested_check": "Before packaging this project, run the relevant install/config/quickstart check for: feat: support agent skills for context-aware review guidance. Context: Observed when using python",
            "title": "失败模式：installation: feat: support agent skills for context-aware review guidance",
            "user_impact": "Developers may fail before the first successful local run: feat: support agent skills for context-aware review guidance"
          },
          {
            "body": "Developers should check this installation risk before relying on the project: v0.35.0",
            "category": "安装坑",
            "evidence": [
              "failure_mode_cluster:github_release | fmev_c8b7b30719c4160c5c0104029f83e764 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.35.0 | v0.35.0"
            ],
            "severity": "medium",
            "suggested_check": "Before packaging this project, run the relevant install/config/quickstart check for: v0.35.0. Context: Observed when using python, docker, windows",
            "title": "失败模式：installation: v0.35.0",
            "user_impact": "Upgrade or migration may change expected behavior: v0.35.0"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_befb1a7b72d44beba27f8ffc0e2646ca | https://github.com/The-PR-Agent/pr-agent/issues/2223 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Publish linux/arm64 Docker image for github_app tag",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_8cb9e552d2e2452cbe958628f6e800b6 | https://github.com/The-PR-Agent/pr-agent/issues/2386 | 来源讨论提到 python 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：Publish linux/arm64 Docker image for github_app tag",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：[Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_52bd470b7b5e4be6858b290e41c93036 | https://github.com/The-PR-Agent/pr-agent/issues/2380 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：[Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering",
            "user_impact": "可能阻塞安装或首次运行。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：[Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_14856949ca534836a7f707e2c1333b17 | https://github.com/The-PR-Agent/pr-agent/issues/2400 | 来源讨论提到 python 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：[Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic",
            "user_impact": "可能影响升级、迁移或版本选择。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v0.34.2",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_4bc22335937e44c0b529ab84d1e69a60 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.34.2 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：v0.34.2",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "Developers should check this configuration risk before relying on the project: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply",
            "category": "配置坑",
            "evidence": [
              "failure_mode_cluster:github_issue | fmev_f4643954c8dbe2f730d31cefbeaa8c78 | https://github.com/The-PR-Agent/pr-agent/issues/2402 | /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply"
            ],
            "severity": "medium",
            "suggested_check": "Before packaging this project, run the relevant install/config/quickstart check for: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply. Context: Observed when using python",
            "title": "失败模式：configuration: /improve on GitLab duplicates the persistent suggestions thread on every push once the previo...",
            "user_impact": "Developers may misconfigure credentials, environment, or host setup: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply"
          },
          {
            "body": "Developers should check this configuration risk before relying on the project: Allow specifying a custom branch for locating `.pr_agent.toml`",
            "category": "配置坑",
            "evidence": [
              "failure_mode_cluster:github_issue | fmev_339ee91f6568996765e72eae51a899dd | https://github.com/The-PR-Agent/pr-agent/issues/1977 | Allow specifying a custom branch for locating `.pr_agent.toml`"
            ],
            "severity": "medium",
            "suggested_check": "Before packaging this project, run the relevant install/config/quickstart check for: Allow specifying a custom branch for locating `.pr_agent.toml`. Context: Source discussion did not expose a precise runtime context.",
            "title": "失败模式：configuration: Allow specifying a custom branch for locating `.pr_agent.toml`",
            "user_impact": "Developers may misconfigure credentials, environment, or host setup: Allow specifying a custom branch for locating `.pr_agent.toml`"
          },
          {
            "body": "Developers should check this configuration risk before relying on the project: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml",
            "category": "配置坑",
            "evidence": [
              "failure_mode_cluster:github_issue | fmev_08e02634b8266f9592093717f3fcb5ac | https://github.com/The-PR-Agent/pr-agent/issues/2376 | AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml"
            ],
            "severity": "medium",
            "suggested_check": "Before packaging this project, run the relevant install/config/quickstart check for: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml. Context: Observed when using python",
            "title": "失败模式：configuration: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_a...",
            "user_impact": "Developers may misconfigure credentials, environment, or host setup: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml"
          }
        ],
        "source": "ProjectPitfallLog + ProjectHitPacket + validation + community signals",
        "summary": "发现 38 个潜在踩坑项，其中 5 个为 high/blocking；最高优先级：安装坑 - 来源证据：Allow specifying a custom branch for locating `.pr_agent.toml`。",
        "title": "踩坑日志"
      },
      "snapshot": {
        "contributors": 228,
        "forks": 1500,
        "license": "unknown",
        "note": "站点快照，非实时质量证明；用于开工前背景判断。",
        "stars": 11160
      },
      "source_url": "https://github.com/The-PR-Agent/pr-agent",
      "steps": [
        {
          "body": "不安装项目，先体验能力节奏。",
          "code": "preview",
          "title": "先试 Prompt"
        },
        {
          "body": "理解输入、输出、失败模式和边界。",
          "code": "manual",
          "title": "读说明书"
        },
        {
          "body": "把上下文交给宿主 AI 继续工作。",
          "code": "context",
          "title": "带给 AI"
        },
        {
          "body": "进入主力环境前先完成安装入口与风险边界验证。",
          "code": "verify",
          "title": "沙箱验证"
        }
      ],
      "subtitle": "🚀 PR Agent: The Original Open-Source PR Reviewer.",
      "title": "pr-agent 能力包",
      "trial_prompt": "# pr-agent - Prompt Preview\n\n> Copy the prompt below into your AI host before installing anything.\n> Its purpose is to let you safely feel the project's workflow, not to claim the project has already run.\n\n## Copy this prompt\n\n```text\nYou are using an independent Doramagic capability pack for The-PR-Agent/pr-agent.\n\nProject:\n- Name: pr-agent\n- Repository: https://github.com/The-PR-Agent/pr-agent\n- Summary: 🚀 PR Agent: The Original Open-Source PR Reviewer.\n- Host target: chatgpt\n\nGoal:\nHelp me evaluate this project for the following task without installing it yet: 🚀 PR Agent: The Original Open-Source PR Reviewer.\n\nBefore taking action:\n1. Restate my task, success standard, and boundary.\n2. Identify whether the next step requires tools, browser access, network access, filesystem access, credentials, package installation, or host configuration.\n3. Use only the Doramagic Project Pack, the upstream repository, and the source-linked evidence listed below.\n4. If a real command, install step, API call, file write, or host integration is required, mark it as \"requires post-install verification\" and ask for approval first.\n5. If evidence is missing, say \"evidence is missing\" instead of filling the gap.\n\nPreviewable capabilities:\n- Capability 1: 🚀 PR Agent: The Original Open-Source PR Reviewer.\n\nCapabilities that require post-install verification:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n\nCore service flow:\n1. introduction: Introduction to PR-Agent. Produce one small intermediate artifact and wait for confirmation.\n2. quickstart: Quick Start Guide. Produce one small intermediate artifact and wait for confirmation.\n3. architecture: System Architecture. Produce one small intermediate artifact and wait for confirmation.\n4. git-providers: Git Providers System. Produce one small intermediate artifact and wait for confirmation.\n5. tools-overview: Tools Overview. Produce one small intermediate artifact and wait for confirmation.\n\nSource-backed evidence to keep in mind:\n- https://github.com/The-PR-Agent/pr-agent\n- https://github.com/The-PR-Agent/pr-agent#readme\n- README.md\n- pr_agent/agent/pr_agent.py\n- pr_agent/settings/configuration.toml\n- action.yaml\n- docker/Dockerfile\n- pr_agent/cli.py\n- docs/docs/installation/github.md\n- pr_agent/git_providers/__init__.py\n\nFirst response rules:\n1. Start Step 1 only.\n2. Explain the one service action you will perform first.\n3. Ask exactly three questions about my target workflow, success standard, and sandbox boundary.\n4. Stop and wait for my answers.\n\nStep 1 follow-up protocol:\n- After I answer the first three questions, stay in Step 1.\n- Produce six parts only: clarified task, success standard, boundary conditions, two or three options, tradeoffs for each option, and one recommendation.\n- End by asking whether I confirm the recommendation.\n- Do not move to Step 2 until I explicitly confirm.\n\nConversation rules:\n- Advance one step at a time and wait for confirmation after each small artifact.\n- Write outputs as recommendations or planned checks, not as completed execution.\n- Do not claim tests passed, files changed, commands ran, APIs were called, or the project was installed.\n- If the user asks for execution, first provide the sandbox setup, expected output, rollback, and approval checkpoint.\n```\n",
      "voices": [
        {
          "body": "来源平台：github。github/github_issue: AzureDevopsProvider.get_repo_settings drops chunks after the first, sile（https://github.com/The-PR-Agent/pr-agent/issues/2376）；github/github_issue: Incorrect Inline Code Suggestion Formatting in Azure DevOps（https://github.com/The-PR-Agent/pr-agent/issues/2110）；github/github_issue: /improve on GitLab duplicates the persistent suggestions thread on every（https://github.com/The-PR-Agent/pr-agent/issues/2402）；github/github_issue: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from An（https://github.com/The-PR-Agent/pr-agent/issues/2400）；github/github_issue: Allow specifying a custom branch for locating `.pr_agent.toml`（https://github.com/The-PR-Agent/pr-agent/issues/1977）；github/github_issue: Add support for Databricks hosted models（https://github.com/The-PR-Agent/pr-agent/issues/2246）；github/github_issue: GITLAB 404 project not found（https://github.com/The-PR-Agent/pr-agent/issues/2282）；github/github_issue: Publish linux/arm64 Docker image for github_app tag（https://github.com/The-PR-Agent/pr-agent/issues/2386）；github/github_issue: CORS error on Azure DevOps when displaying \"Work in progress\" loading GI（https://github.com/The-PR-Agent/pr-agent/issues/2223）；github/github_issue: Publish linux/arm64 Docker image for github_app tag（https://github.com/The-PR-Agent/pr-agent/issues/2386）；github/github_issue: feat: support agent skills for context-aware review guidance（https://github.com/The-PR-Agent/pr-agent/issues/2384）；github/github_issue: Ticket context not scoped per PR in long-lived deployments — stale ticke（https://github.com/The-PR-Agent/pr-agent/issues/2383）。这些是项目级外部声音，不作为单独质量证明。",
          "items": [
            {
              "kind": "github_issue",
              "source": "github",
              "title": "AzureDevopsProvider.get_repo_settings drops chunks after the first, sile",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2376"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Incorrect Inline Code Suggestion Formatting in Azure DevOps",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2110"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "/improve on GitLab duplicates the persistent suggestions thread on every",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2402"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "[Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from An",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2400"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Allow specifying a custom branch for locating `.pr_agent.toml`",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/1977"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Add support for Databricks hosted models",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2246"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "GITLAB 404 project not found",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2282"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Publish linux/arm64 Docker image for github_app tag",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2386"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "CORS error on Azure DevOps when displaying \"Work in progress\" loading GI",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2223"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Publish linux/arm64 Docker image for github_app tag",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2386"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "feat: support agent skills for context-aware review guidance",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2384"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Ticket context not scoped per PR in long-lived deployments — stale ticke",
              "url": "https://github.com/The-PR-Agent/pr-agent/issues/2383"
            }
          ],
          "status": "已收录 12 条来源",
          "title": "社区讨论"
        }
      ]
    },
    "homepage_card": {
      "category": "软件开发与交付",
      "desc": "🚀 PR Agent: The Original Open-Source PR Reviewer.",
      "effort": "安装已验证",
      "forks": 1500,
      "icon": "code",
      "name": "pr-agent 能力包",
      "risk": "可发布",
      "slug": "pr-agent",
      "stars": 11160,
      "tags": [
        "安全审查与权限治理",
        "知识库问答",
        "代码审查",
        "评审闭环",
        "评测体系"
      ],
      "thumb": "gray",
      "type": "Skill Pack"
    },
    "manual": {
      "markdown": "# https://github.com/The-PR-Agent/pr-agent 项目说明书\n\n生成时间：2026-05-15 20:09:06 UTC\n\n## 目录\n\n- [Introduction to PR-Agent](#introduction)\n- [Quick Start Guide](#quickstart)\n- [System Architecture](#architecture)\n- [Git Providers System](#git-providers)\n- [Command-to-Tool Mapping](#command-handling)\n- [Tools Overview](#tools-overview)\n- [/describe Tool](#describe-tool)\n- [/review Tool](#review-tool)\n- [/improve Tool](#improve-tool)\n- [Additional Tools](#additional-tools)\n\n<a id='introduction'></a>\n\n## Introduction to PR-Agent\n\n### 相关页面\n\n相关主题：[Quick Start Guide](#quickstart), [System Architecture](#architecture), [Tools Overview](#tools-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [README.md](https://github.com/The-PR-Agent/pr-agent/blob/main/README.md)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n- [pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n- [CONTRIBUTING.md](https://github.com/The-PR-Agent/pr-agent/blob/main/CONTRIBUTING.md)\n</details>\n\n# Introduction to PR-Agent\n\nPR-Agent is an open-source, AI-powered code review agent that provides automated analysis and feedback on pull requests. Originally developed by Qodo, the project was donated to the open-source community, making it a community-maintained legacy project distinct from Qodo's primary AI code review offering.\n\n## Overview\n\nPR-Agent serves as an intelligent assistant that scans pull request code changes and generates automated feedback, suggestions, and descriptions. It integrates seamlessly with major version control platforms including GitHub, GitLab, Bitbucket, and Azure DevOps.\n\nThe project provides a comprehensive suite of tools that can be triggered automatically on PR events (such as when a PR is opened or synchronized) or invoked manually through comments on pull requests. Each tool focuses on a specific aspect of the PR review process.\n\n## Architecture\n\nPR-Agent follows a modular architecture where each tool operates as an independent component. The core system consists of:\n\n1. **Agent Core** - The main orchestration layer that processes incoming requests and routes them to appropriate tools\n2. **Git Provider Integration** - Abstraction layer for different VCS platforms\n3. **Tool Suite** - Individual tools for description, review, improvement, and other operations\n4. **Configuration System** - TOML-based configuration with environment variable support\n\n### Component Flow\n\n```mermaid\ngraph TD\n    A[Pull Request Event] --> B[Git Provider]\n    B --> C[Agent Core]\n    C --> D[Tool Router]\n    D --> E[/describe]\n    D --> F[/review]\n    D --> G[/improve]\n    D --> H[/ask]\n    E --> I[AI Model]\n    F --> I\n    G --> I\n    H --> I\n    I --> J[PR Comment/Update]\n```\n\n## Available Tools\n\nPR-Agent provides multiple tools that can be invoked via slash commands in PR comments.\n\n### Describe Tool\n\nThe `/describe` tool scans PR code changes and generates a comprehensive description including:\n\n- **Title** - Auto-generated PR title in the format `<PR type>: <title>`\n- **Type** - Classification such as Bug fix, Tests, Enhancement, Documentation, or Other\n- **Summary** - Brief overview of changes\n- **Walkthrough** - File-by-file breakdown of modifications\n- **Labels** - Auto-assigned labels based on content\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n### Review Tool\n\nThe `/review` tool performs detailed code analysis and provides:\n\n- **Code quality assessment** - Evaluation of code structure and patterns\n- **Security analysis** - Potential vulnerability detection\n- **Performance considerations** - Optimization suggestions\n- **Recommended focus areas** - Specific files or lines requiring attention\n\n资料来源：[pr_agent/servers/help.py:1-100]()\n\n### Improve Tool (Code Suggestions)\n\nThe `/improve` tool automatically generates code improvement suggestions:\n\n- **Category classification** - Each suggestion is labeled and categorized\n- **Impact scoring** - Suggestions are scored by potential improvement impact\n- **Code examples** - Before/after code comparisons when relevant\n- **Automatic sorting** - Suggestions ordered by score within categories\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:1-80]()\n\n### Ask Tool\n\nThe `/ask` tool answers natural language questions about the PR:\n\n- Queries about the entire PR scope\n- Specific questions about code lines or files\n- Image-related questions when visual content is present\n\nNote that the tool does not retain memory between questions—each query is answered independently.\n\n资料来源：[pr_agent/servers/help.py:1-150]()\n\n### Help Docs Tool\n\nThe `/help_docs` tool retrieves documentation based on relative file paths, supporting both repository-local documentation and external sources.\n\n## Output Format\n\nPR-Agent generates output using GitHub Flavored Markdown (GFM) with enhanced formatting:\n\n```mermaid\ngraph LR\n    A[Code Analysis] --> B[GFM Table Format]\n    B --> C[Collapsible Sections]\n    C --> D[Code Blocks]\n    D --> E[Links & References]\n```\n\n### Markdown Table Structure\n\nPR-Agent uses structured HTML tables within Markdown for organized output:\n\n```html\n<table>\n  <thead>\n    <tr>\n      <td><strong>Category</strong></td>\n      <td><strong>Suggestion</strong></td>\n      <td><strong>Impact</strong></td>\n    </tr>\n  </thead>\n  <tbody>\n    <!-- Content rows -->\n  </tbody>\n</table>\n```\n\n资料来源：[pr_agent/algo/utils.py:1-100]()\n\n## Configuration\n\nPR-Agent uses a TOML-based configuration system with multiple configuration levels.\n\n### Configuration Sections\n\n| Section | Purpose | Key Settings |\n|---------|---------|--------------|\n| `pr_description` | Describe tool behavior | `enable_help_comment`, `use_description_markers`, `output_relevant_configurations` |\n| `pr_reviewer` | Review tool behavior | Various review-specific options |\n| `pr_code_suggestions` | Improve tool behavior | Suggestion filtering and scoring |\n| `config` | Global settings | `output_relevant_configurations` |\n\n资料来源：[pr_agent/tools/pr_config.py:1-50]()\n\n### Configuration Methods\n\n**Command-line invocation:**\n```bash\n/describe --pr_description.some_config1=... --pr_description.some_config2=...\n/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...\n```\n\n**Configuration file (TOML):**\n```toml\n[pr_description]\nsome_config1=...\nsome_config2=...\n\n[pr_code_suggestions]\nsome_config1=...\n```\n\n资料来源：[pr_agent/servers/help.py:1-200]()\n\n### Custom Labels\n\nThe describe tool supports custom labels defined in the repository's labels page or via configuration file. Examples:\n\n| Custom Label | Description |\n|--------------|-------------|\n| `Main topic:performance` | PR focuses on performance optimization |\n| `New endpoint` | New API endpoint added |\n| `SQL query` | Database query changes |\n| `Dockerfile changes` | Container configuration updates |\n\n## Installation and Deployment\n\n### Docker Installation\n\nDocker images are published to `pragent/pr-agent`. Recent releases (0.34.2+) are available at the new namespace. Legacy images up to v0.31 remain at `codiumai/pr-agent`.\n\n资料来源：[README.md:1-100]()\n\n### GitHub Action (Recommended)\n\n```yaml\nname: PR Agent\non:\n  pull_request:\n    types: [opened, synchronize]\njobs:\n  pr_agent_job:\n    runs-on: ubuntu-latest\n    steps:\n    - name: PR Agent action step\n      uses: the-pr-agent/pr-agent@main\n      env:\n        OPENAI_KEY: ${{ secrets.OPENAI_KEY }}\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### CLI Usage\n\n```bash\npip install pr-agent\nexport OPENAI_KEY=your_key_here\npr-agent --pr_url https://github.com/owner/repo/pull/123 review\n```\n\n## Automation Modes\n\nPR-Agent supports multiple automation configurations:\n\n1. **Automatic on PR events** - Tools run automatically when PR is opened or updated\n2. **Manual invocation** - Users trigger tools via slash commands in comments\n3. **Marker-based control** - Using `pr_agent:marker_name` markers for selective updates\n\nThe default automation mode for the describe tool uses:\n```python\npr_commands = [\"/describe\", ...]\n```\n\n资料来源：[pr_agent/servers/help.py:1-250]()\n\n## Development Guidelines\n\nContributors should follow these practices:\n\n- Use conventional commit messages (e.g., `fix: handle missing repo settings gracefully`)\n- Target branch names follow `feature/<name>` or `fix/<issue>` patterns\n- Keep PRs focused on single features or fixes\n- Include unit tests for new functionality using pytest\n- Update prompts and configuration files together when behavior changes\n\n资料来源：[CONTRIBUTING.md:1-80]()\n\n## Security Considerations\n\n- Secrets must be supplied through environment variables, not hardcoded\n- API keys and credentials should never be committed to the repository\n- Docker builds and e2e tests requiring external credentials need coordination before execution\n\n---\n\n<a id='quickstart'></a>\n\n## Quick Start Guide\n\n### 相关页面\n\n相关主题：[Introduction to PR-Agent](#introduction)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [README.md](https://github.com/The-PR-Agent/pr-agent/blob/main/README.md)\n- [pr_agent/cli.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/cli.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [SECURITY.md](https://github.com/The-PR-Agent/pr-agent/blob/main/SECURITY.md)\n- [AGENTS.md](https://github.com/The-PR-Agent/pr-agent/blob/main/AGENTS.md)\n</details>\n\n# Quick Start Guide\n\n## Overview\n\nThe Quick Start Guide provides developers with immediate access to automated PR review capabilities through PR-Agent. This guide covers installation methods, configuration options, and basic usage patterns to get started with AI-powered code review in minutes.\n\nPR-Agent is an open-source, AI-powered code review agent that integrates seamlessly with GitHub, GitLab, Bitbucket, and Azure DevOps. It offers automated reviews, descriptions, code suggestions, and more without requiring complex setup.\n\n## Installation Methods\n\nPR-Agent supports multiple installation methods to accommodate different development workflows and infrastructure requirements.\n\n### GitHub Action (Recommended)\n\nThe GitHub Action method is the recommended approach for automated PR reviews. It runs as part of your CI/CD pipeline and automatically reviews pull requests when they are opened or updated.\n\n```yaml\n# .github/workflows/pr-agent.yml\nname: PR Agent\non:\n  pull_request:\n    types: [opened, synchronize]\njobs:\n  pr_agent_job:\n    runs-on: ubuntu-latest\n    steps:\n    - name: PR Agent action step\n      uses: the-pr-agent/pr-agent@main\n      env:\n        OPENAI_KEY: ${{ secrets.OPENAI_KEY }}\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n资料来源：[README.md:1-25]()\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `OPENAI_KEY` | secret | Yes | OpenAI API key for AI capabilities |\n| `GITHUB_TOKEN` | secret | Yes | GitHub token for API access |\n| `GITLAB_TOKEN` | secret | No | Required for GitLab integration |\n| `AZURE_DEVOPS_TOKEN` | secret | No | Required for Azure DevOps integration |\n\n### CLI Usage (Local Development)\n\nFor local development and testing, use the Command Line Interface:\n\n```bash\npip install pr-agent\nexport OPENAI_KEY=your_key_here\npr-agent --pr_url https://github.com/owner/repo/pull/123 review\n```\n\n资料来源：[README.md:31-37]()\n\n| Command | Description |\n|---------|-------------|\n| `pr-agent --pr_url <URL> review` | Run a review on a PR |\n| `pr-agent --pr_url <URL> describe` | Generate PR description |\n| `pr-agent --pr_url <URL> improve` | Get code improvement suggestions |\n| `pr-agent --pr_url <URL> ask \"<question>\"` | Ask questions about the PR |\n\n### Docker Deployment\n\nDocker images are available for containerized deployments:\n\n| Image Tag | Description | Registry |\n|-----------|-------------|----------|\n| `pragent/pr-agent:0.34.2+` | Current releases | hub.docker.com |\n| `pragent/pr-agent:latest` | Latest stable | hub.docker.com |\n| `pragent/pr-agent:0.34.2-github_action` | GitHub Action variant | hub.docker.com |\n| `codiumai/pr-agent:v0.31` | Legacy (frozen) | hub.docker.com |\n\n版本 0.34.2 及之后发布在 `pragent/pr-agent` 命名空间，旧版本（直到 v0.31）仍可在 `codiumai/pr-agent` 获取但不会再更新。\n\n资料来源：[README.md:1-8]()\n\nFor enhanced security, specify Docker images using their digest:\n\n```yaml\nsteps:\n  - name: PR Agent action step\n    id: pragent\n    uses: docker://pragent/pr-agent@sha256:a0b36966ca3a197ca739fa1e65c16703076fc1c744cd423ca203b8c21707d71c\n```\n\n资料来源：[SECURITY.md:1-12]()\n\n## Architecture Overview\n\n```mermaid\ngraph TD\n    A[Pull Request Event] --> B[GitHub/GitLab/Bitbucket/Azure DevOps]\n    B --> C[PR-Agent Trigger]\n    C --> D{Installation Method}\n    D -->|GitHub Action| E[GitHub Actions Runner]\n    D -->|CLI| F[Local Environment]\n    D -->|Docker| G[Container Runtime]\n    E --> H[OpenAI API / LLM]\n    F --> H\n    G --> H\n    H --> I[Review Output]\n    I --> J[PR Comment]\n```\n\n## Configuration System\n\nPR-Agent uses a flexible configuration system that supports multiple levels of customization.\n\n### Configuration Hierarchy\n\n| Level | Location | Scope | Priority |\n|-------|----------|-------|----------|\n| 1 | Environment Variables | Global | Highest |\n| 2 | Configuration File | Project | Medium |\n| 3 | Inline Command Flags | Per-invocation | Lowest |\n\n### Configuration File Format\n\nCreate a `.pr_agent.toml` or use `pr_agent/settings/configuration.toml`:\n\n```toml\n[pr_description]\nextra_instructions=\"\"\"\\\n- The PR title should be in the format: '<PR type>: <title>'\n- The title should be short and concise (up to 10 words)\n\"\"\"\n```\n\n资料来源：[pr_agent/servers/help.py:1-15]()\n\n### Inline Configuration via Comments\n\nWhen commenting on a PR, use the following template to modify configurations:\n\n```\n/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...\n```\n\n资料来源：[pr_agent/servers/help.py:1-10]()\n\n## Available Commands\n\nPR-Agent provides several commands that can be invoked via PR comments:\n\n### Command Reference Table\n\n| Command | Purpose | Auto-trigger | Manual Trigger |\n|---------|---------|--------------|----------------|\n| `/describe` | Generate PR description | ✓ | ✓ |\n| `/review` | Perform code review | ✓ | ✓ |\n| `/improve` | Suggest code improvements | ✓ | ✓ |\n| `/ask \"...\"` | Answer questions about PR | ✗ | ✓ |\n| `/help_docs \"...\"` | Query documentation | ✗ | ✓ |\n| `/config` | Show configuration | ✗ | ✓ |\n\n### Command Usage Examples\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n#### Describe Command\n\n```\n/describe --pr_description.some_config1=value\n```\n\nGenerates a PR description including title, type, summary, walkthrough, and labels.\n\n#### Review Command\n\n```\n/review --pr_reviewer.some_config1=value --pr_reviewer.some_config2=value\n```\n\nPerforms an automated code review with configurable focus areas.\n\n#### Improve Command\n\n```\n/improve --pr_code_suggestions.some_config1=value\n```\n\nScans PR code changes and generates improvement suggestions.\n\n#### Ask Command\n\n```\n/ask \"What are the main changes in this PR?\"\n```\n\nAnswers questions about the PR without memory of previous interactions.\n\n## Security Best Practices\n\n### Environment Variables\n\nSecrets should be supplied through environment variables exclusively:\n\n```bash\nexport OPENAI_KEY=sk-...\nexport GITHUB_TOKEN=ghp_...\n```\n\nDo not persist credentials in code or configuration files that might be committed to version control.\n\n资料来源：[AGENTS.md:1-10]()\n\n### Docker Security\n\nFor production deployments, use pinned Docker image digests instead of floating tags:\n\n```yaml\nuses: docker://pragent/pr-agent@sha256:<digest>\n```\n\n资料来源：[SECURITY.md:1-12]()\n\n## Output Format\n\nPR-Agent generates formatted markdown output for PR comments with support for GitHub Flavored Markdown (GFM).\n\n### Output Structure\n\n```mermaid\ngraph LR\n    A[Review Output] --> B{GFM Supported?}\n    B -->|Yes| C[Rich Tables & Details]\n    B -->|No| D[Plain Markdown]\n    C --> E[Collapsible Sections]\n    D --> F[Basic Formatting]\n```\n\n### Example Output Features\n\n| Feature | GFM Support | Fallback |\n|---------|-------------|----------|\n| Code blocks | ✓ Syntax highlighting | ✓ Basic blocks |\n| Tables | ✓ Rich formatting | ✗ Text list |\n| Collapsible details | ✓ `<details>` tags | ✗ Flat text |\n| Line links | ✓ Clickable references | ✗ Line numbers only |\n\n资料来源：[pr_agent/algo/utils.py:1-30]()\n\n## Troubleshooting\n\n### Common Issues\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Bot doesn't respond | App not installed | Install GitHub App |\n| Empty review | No code changes | Ensure PR has diff |\n| Rate limit errors | API quota exceeded | Check OpenAI billing |\n| Authentication failed | Invalid token | Verify secret configuration |\n\n### Help Command\n\nUse the inline help feature for tool-specific guidance:\n\n```\n/help how to configure the review tool\n```\n\n资料来源：[pr_agent/tools/pr_description.py:1-15]()\n\n## Next Steps\n\nAfter setting up PR-Agent:\n\n1. **Customize prompts** - Modify extra instructions in configuration files\n2. **Enable auto-tools** - Configure automatic triggers for new PRs\n3. **Set up custom labels** - Define project-specific PR categories\n4. **Integrate with your workflow** - Add to existing CI/CD pipelines\n\n## Additional Resources\n\n| Resource | Link |\n|----------|------|\n| Documentation | https://qodo-merge-docs.qodo.ai/ |\n| GitHub Action Guide | https://docs.pr-agent.ai/installation/github/ |\n| CLI Setup Guide | https://docs.pr-agent.ai/usage-guide/automations_and_usage/#local-repo-cli |\n| Discord Community | https://discord.com/channels/1057273017547378788/ |\n\n---\n\n<a id='architecture'></a>\n\n## System Architecture\n\n### 相关页面\n\n相关主题：[Git Providers System](#git-providers), [Command-to-Tool Mapping](#command-handling)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/agent/pr_agent.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/agent/pr_agent.py)\n- [pr_agent/git_providers/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/__init__.py)\n- [pr_agent/tools/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/__init__.py)\n- [pr_agent/algo/types.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/types.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n- [pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n- [pr_agent/git_providers/bitbucket_server_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n</details>\n\n# System Architecture\n\n## Overview\n\nPR-Agent is an open-source AI-powered code review agent that provides automated PR analysis, review, and improvement suggestions. The system follows a modular architecture that separates concerns between agent orchestration, tool execution, git provider abstraction, and utility functions.\n\nThe primary goal of PR-Agent's architecture is to support multiple Git hosting platforms (GitHub, GitLab, Bitbucket, Azure DevOps) while providing consistent tooling for PR-related operations like description generation, code review, code suggestions, and documentation assistance.\n\n资料来源：[README.md](https://github.com/The-PR-Agent/pr-agent/blob/main/README.md)\n\n---\n\n## High-Level Architecture\n\n### System Components\n\nThe PR-Agent system consists of four main layers:\n\n| Layer | Purpose | Key Modules |\n|-------|---------|-------------|\n| **Agent Layer** | Orchestrates tool invocation and command processing | `pr_agent/agent/pr_agent.py` |\n| **Tool Layer** | Implements individual PR tools (describe, review, improve, etc.) | `pr_agent/tools/` |\n| **Provider Layer** | Abstracts Git platform differences | `pr_agent/git_providers/` |\n| **Utility Layer** | Shared algorithms, types, and formatting utilities | `pr_agent/algo/` |\n\n资料来源：[pr_agent/agent/pr_agent.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/agent/pr_agent.py)\n\n### Data Flow\n\n```mermaid\ngraph TD\n    A[Git Platform<br/>Webhook/CLI] --> B[Agent Entry Point<br/>pr_agent.py]\n    B --> C{Command Router}\n    C -->|/describe| D[PR Description Tool]\n    C -->|/review| E[PR Review Tool]\n    C -->|/improve| F[Code Suggestions Tool]\n    C -->|/ask| G[Ask Tool]\n    C -->|/help| H[Help Server]\n    \n    D --> I[Git Provider<br/>Abstraction]\n    E --> I\n    F --> I\n    G --> I\n    \n    I --> J[GitHub Provider]\n    I --> K[GitLab Provider]\n    I --> L[Bitbucket Provider]\n    I --> M[Azure DevOps Provider]\n    \n    J --> N[GitHub API]\n    K --> O[GitLab API]\n    L --> P[Bitbucket API]\n    M --> Q[Azure DevOps API]\n    \n    I --> R[Utility Functions<br/>algo/utils.py]\n    D --> R\n    E --> R\n    F --> R\n```\n\n---\n\n## Agent Layer\n\n### Core Agent Implementation\n\nThe agent layer is the central orchestrator that handles:\n\n1. **Command parsing and routing** - Interprets user commands (`/describe`, `/review`, `/improve`, `/ask`, `/help`)\n2. **Tool instantiation** - Creates appropriate tool instances based on commands\n3. **Execution coordination** - Manages the flow between tools and git providers\n4. **Response formatting** - Structures output for different platforms (GitHub vs GitLab vs Bitbucket)\n\n资料来源：[pr_agent/agent/pr_agent.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/agent/pr_agent.py)\n\n### Agent Initialization Flow\n\n```mermaid\nsequenceDiagram\n    participant Main as Main Entry Point\n    participant Agent as PRAgent Class\n    participant Provider as GitProvider Factory\n    participant Tool as Tool Instances\n    \n    Main->>Agent: Initialize PRAgent(pr_url, cli_mode)\n    Agent->>Provider: create_git_provider(pr_url)\n    Provider->>Provider: Detect platform type\n    Provider-->>Agent: Return Provider Instance\n    Agent->>Tool: Initialize Tools\n    Agent-->>Main: Ready to process commands\n```\n\n---\n\n## Git Provider Layer\n\n### Provider Abstraction Architecture\n\nThe git provider layer provides a unified interface for interacting with different Git hosting platforms. This abstraction allows tools to operate identically regardless of the underlying platform.\n\n```mermaid\ngraph LR\n    A[Tools Layer] --> B[GitProvider Interface<br/>__init__.py]\n    B --> C[GitHubProvider]\n    B --> D[GitLabProvider]\n    B --> D[BitbucketProvider]\n    B --> E[AzureDevOpsProvider]\n```\n\n资料来源：[pr_agent/git_providers/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/__init__.py)\n\n### Provider Interface Capabilities\n\nThe base `GitProvider` interface defines the following capabilities:\n\n| Capability | Description |\n|------------|-------------|\n| `get_diff_files()` | Retrieves list of changed files in the PR |\n| `get_comments()` | Fetches existing PR comments |\n| `publish_comment()` | Posts a comment to the PR |\n| `publish_code_suggestion()` | Publishes inline code suggestions |\n| `get_languages()` | Returns programming languages used in PR |\n| `get_repo_settings()` | Retrieves repository configuration |\n| `is_supported(feature)` | Checks if a specific feature is supported |\n\n资料来源：[pr_agent/git_providers/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/__init__.py)\n\n### Platform-Specific Implementations\n\nEach Git platform has a dedicated provider class that implements the interface:\n\n| Platform | Provider Class | Special Considerations |\n|----------|----------------|------------------------|\n| GitHub | `GithubProvider` | Full GFM markdown support, fine-grained permissions |\n| GitLab | `GitLabProvider` | Different markdown rendering, MR terminology |\n| Bitbucket | `BitbucketProvider` | No multi-line suggestions (uses code blocks instead) |\n| Azure DevOps | `AzureDevOpsProvider` | Work item integration |\n\n资料来源：[pr_agent/git_providers/bitbucket_server_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n\n#### Bitbucket Multi-Line Suggestion Limitation\n\nBitbucket Server does not support multi-line code suggestions natively. The implementation falls back to code blocks when handling suggestions:\n\n```python\n# Bitbucket does not support multi-line suggestions so use a code block instead\n# Reference: https://jira.atlassian.com/browse/BSERV-4553\nbody = body.replace(\"```suggestion\", \"```\")\n```\n\n资料来源：[pr_agent/git_providers/bitbucket_server_provider.py:45](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n\n---\n\n## Tool Layer\n\n### Available Tools\n\nThe tool layer contains modular implementations for each PR-Agent capability:\n\n| Tool | File | Primary Function |\n|------|------|------------------|\n| `describe` | `pr_description.py` | Generates PR title, type, summary, walkthrough |\n| `review` | `pr_reviewer.py` | Analyzes PR code for issues and concerns |\n| `improve` | `pr_code_suggestions.py` | Generates code improvement suggestions |\n| `ask` | `ask.py` | Answers questions about PR changes |\n| `help` | `help.py` | Provides usage guidance |\n| `config` | `pr_config.py` | Displays relevant configurations |\n\n资料来源：[pr_agent/tools/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/__init__.py)\n\n### Tool Structure Pattern\n\nEach tool follows a common structure pattern:\n\n```mermaid\ngraph TD\n    A[Tool Class] --> B[__init__<br/>Initialize git_provider]\n    A --> C[run<br/>Main entry point]\n    C --> D[get_deferred_reply]\n    C --> E[work|\n    D --> F[LLM Processing]\n    E --> G[Markdown Generation]\n    F --> G\n    G --> H[publish_output]\n```\n\n### Code Suggestions Tool Architecture\n\nThe code suggestions tool (`improve`) demonstrates the typical tool structure:\n\n```python\n# Language extension mapping for syntax highlighting\nlanguage_extension_map_org = get_settings().language_extension_map_org\nextension_to_language = {}\nfor language, extensions in language_extension_map_org.items():\n    for ext in extensions:\n        extension_to_language[ext] = language\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n\n#### Suggestion Output Format\n\nThe code suggestions tool outputs structured markdown tables:\n\n```\n┌──────────┬─────────────────────┬────────┐\n│ Category │ Suggestion          │ Impact │\n├──────────┼─────────────────────┼────────┤\n│ Security │ Input validation    │ High   │\n└──────────┴─────────────────────┴────────┘\n```\n\nSuggestions are grouped by label and sorted by score:\n\n```python\n# Sort suggestions_labels by the suggestion with the highest score\nsuggestions_labels = dict(\n    sorted(suggestions_labels.items(), key=lambda x: max([s['score'] for s in x[1]]), reverse=True))\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n\n### PR Description Tool\n\nThe description tool generates comprehensive PR descriptions including:\n\n| Component | Description |\n|-----------|-------------|\n| **Title** | Concise PR title (up to 10 words) |\n| **Type** | PR classification (bug fix, feature, etc.) |\n| **Summary** | Brief overview of changes |\n| **Walkthrough** | Line-by-line change explanation |\n| **Labels** | Auto-generated or custom labels |\n| **Diagram** | Optional sequence diagram (Mermaid) |\n\n资料来源：[pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n\n#### Description Output Structure\n\n```mermaid\ngraph TD\n    A[PR Description Request] --> B{Use Markers?}\n    B -->|Yes| C[Replace marker placeholders]\n    B -->|No| D[Generate full description]\n    D --> E[Add help comment if enabled]\n    E --> F[Output configurations if enabled]\n    C --> F\n    F --> G[Publish to PR]\n```\n\n---\n\n## Utility Layer\n\n### Types and Data Models\n\nThe `pr_agent/algo/types.py` module defines core data types used throughout the system:\n\n| Type | Purpose |\n|------|---------|\n| `ActionResult` | Encapsulates tool action results |\n| `ModelData` | LLM response container |\n| `CodeSuggestion` | Code suggestion data model |\n\n资料来源：[pr_agent/algo/types.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/types.py)\n\n### Utility Functions\n\nThe `pr_agent/algo/utils.py` module provides shared utilities:\n\n| Function | Purpose |\n|----------|---------|\n| `parse_code_suggestion()` | Converts suggestion dict to markdown |\n| `extract_relevant_lines_str()` | Extracts code lines from diff |\n| `convert_to_markdown()` | Generic dict-to-markdown converter |\n| `show_relevant_configurations()` | Renders config as markdown |\n\n资料来源：[pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n\n### Markdown Generation Utilities\n\nThe system supports both GitHub Flavored Markdown (GFM) and standard markdown:\n\n```python\ndef parse_code_suggestion(code_suggestion: dict, i: int = 0, gfm_supported: bool = True) -> str:\n    \"\"\"\n    Convert a dictionary of data into markdown format.\n    \n    Args:\n        code_suggestion (dict): A dictionary containing data to be converted to markdown format.\n        gfm_supported (bool): Whether GFM features are available for this provider.\n    \"\"\"\n```\n\nGFM features enable collapsible file lists, detailed code references, and rich table formatting. Non-GFM providers receive simplified output:\n\n| GFM Feature | GFM Output | Standard Output |\n|-------------|------------|------------------|\n| Code links | `<a href='...'>line</a>` | Plain text |\n| Collapsible sections | `<details>` tags | Full text |\n| Table formatting | `<table>` tags | Headers only |\n\n资料来源：[pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n\n---\n\n## Deployment Architecture\n\n### Supported Deployment Methods\n\nPR-Agent supports multiple deployment models:\n\n| Method | Use Case | Configuration |\n|--------|----------|---------------|\n| **GitHub App** | Automated reviews on PR open | GitHub App installation |\n| **GitHub Action** | CI/CD integration | Workflow YAML |\n| **CLI** | Local development | `pr-agent` command |\n| **Docker** | Self-hosted deployment | Docker container |\n\n资料来源：[README.md](https://github.com/The-PR-Agent/pr-agent/blob/main/README.md)\n\n### GitHub Action Workflow\n\n```yaml\nname: PR Agent\non:\n  pull_request:\n    types: [opened, synchronize]\njobs:\n  pr_agent_job:\n    runs-on: ubuntu-latest\n    steps:\n    - name: PR Agent action step\n      uses: the-pr-agent/pr-agent@main\n      env:\n        OPENAI_KEY: ${{ secrets.OPENAI_KEY }}\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n资料来源：[README.md](https://github.com/The-PR-Agent/pr-agent/blob/main/README.md)\n\n---\n\n## Configuration Architecture\n\n### Configuration Hierarchy\n\nPR-Agent uses a layered configuration system:\n\n1. **Default settings** - `pr_agent/settings/configuration.toml`\n2. **Environment variables** - Override defaults\n3. **Repository settings** - `.pr_agent.toml` or `pyproject.toml`\n4. **Runtime parameters** - Command-line arguments\n\n### Configuration Display\n\nThe `pr_config.py` tool can output relevant configurations as markdown:\n\n```python\nfor key, value in settings_dict.items():\n    if key in relevant_keys:\n        markdown_text += f\"\\n{header.lower()}.{key.lower()} = {repr(value) if isinstance(value, str) else value}\"\n```\n\n资料来源：[pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n\n---\n\n## Key Architectural Patterns\n\n### 1. Provider Pattern\n\nAll Git platform interactions go through a provider abstraction, enabling platform-agnostic tool implementations:\n\n```python\nclass SomeTool:\n    def __init__(self, git_provider: GitProvider):\n        self.git_provider = git_provider\n    \n    def work(self):\n        # Platform-agnostic code\n        diff_files = self.git_provider.get_diff_files()\n        # Same code works for GitHub, GitLab, Bitbucket\n```\n\n### 2. Factory Pattern\n\nGit providers are instantiated via a factory function that detects the platform:\n\n```python\ndef create_git_provider(pr_url: str, configuration: dict = None) -> GitProvider:\n    # Detect platform from pr_url\n    # Return appropriate provider instance\n```\n\n### 3. Deferred Execution Pattern\n\nTools support deferred execution for async operations:\n\n```python\ndef get_deferred_reply(self) -> dict:\n    \"\"\"Returns deferred response for async processing.\"\"\"\n    return {\"action\": \"defer\", \"tool\": self.__class__.__name__}\n```\n\n资料来源：[pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n\n---\n\n## Summary\n\nThe PR-Agent system architecture follows a clean, layered design:\n\n| Layer | Responsibility | Extensibility |\n|-------|----------------|---------------|\n| **Agent** | Command routing, orchestration | Add new commands |\n| **Tools** | PR operations (describe, review, improve) | Add new tools |\n| **Providers** | Git platform abstraction | Add new platforms |\n| **Algo** | Shared utilities, formatting | Reuse across tools |\n\nThis architecture enables:\n- **Platform independence**: Same tools work across GitHub, GitLab, Bitbucket, Azure DevOps\n- **Tool modularity**: Each tool can be independently developed and tested\n- **Flexible deployment**: Supports GitHub Apps, Actions, CLI, and Docker\n- **Consistent output**: Platform-appropriate markdown formatting\n\n资料来源：[pr_agent/agent/pr_agent.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/agent/pr_agent.py), [pr_agent/git_providers/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/__init__.py)\n\n---\n\n<a id='git-providers'></a>\n\n## Git Providers System\n\n### 相关页面\n\n相关主题：[System Architecture](#architecture)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/git_providers/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/__init__.py)\n- [pr_agent/git_providers/github_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/github_provider.py)\n- [pr_agent/git_providers/gitlab_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/gitlab_provider.py)\n- [pr_agent/git_providers/bitbucket_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_provider.py)\n- [pr_agent/git_providers/azuredevops_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/azuredevops_provider.py)\n- [pr_agent/git_providers/gitea_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/gititea_provider.py)\n- [pr_agent/git_providers/git_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/git_provider.py)\n</details>\n\n# Git Providers System\n\n## Overview\n\nThe Git Providers System is a core abstraction layer in PR-Agent that provides a unified interface for interacting with different Git hosting platforms. It abstracts the differences between GitHub, GitLab, Bitbucket, Azure DevOps, and Gitea, allowing PR-Agent tools to operate uniformly regardless of the underlying platform.\n\n## Architecture\n\nThe system follows a provider pattern with a base abstract class and platform-specific implementations. All providers inherit from a common `GitProvider` base class that defines the standard interface.\n\n```mermaid\ngraph TB\n    subgraph \"Git Providers System\"\n        GP[GitProvider<br/>Base Class]\n        GHP[GitHubProvider]\n        GLP[GitLabProvider]\n        BBP[BitbucketProvider]\n        ADP[AzureDevOpsProvider]\n        GTP[GiteaProvider]\n    end\n    \n    GP <|-- GHP\n    GP <|-- GLP\n    GP <|-- BBP\n    GP <|-- ADP\n    GP <|-- GTP\n    \n    Tools[PR-Agent Tools] --> GP\n```\n\n## Supported Platforms\n\n| Platform | Provider Class | Package Used |\n|----------|---------------|--------------|\n| GitHub | `GitHubProvider` | `PyGithub` |\n| GitLab | `GitLabProvider` | `python-gitlab` |\n| Bitbucket | `BitbucketProvider` | `atlassian-python-api` |\n| Azure DevOps | `AzureDevOpsProvider` | `ado_wit_client` |\n| Gitea | `GiteaProvider` | `giteapy` |\n\n资料来源：[pr_agent/git_providers/__init__.py]()\n\n## Base Class Interface\n\nThe `GitProvider` abstract base class defines the core interface that all platform-specific providers must implement:\n\n### Core PR Operations\n\n| Method | Purpose |\n|--------|---------|\n| `get_pr_description()` | Retrieve the PR/MR description text |\n| `get_pr_title()` | Get the title of the pull request |\n| `get_pr_branch()` | Get the source branch name |\n| `get_target_branch()` | Get the target/destination branch |\n| `get_user()` | Get the username of the PR author |\n| `get_pr_id()` | Get the internal PR identifier |\n\n### Diff and File Operations\n\n| Method | Purpose |\n|--------|---------|\n| `get_diff_files()` | Retrieve list of changed files with diff information |\n| `get_pr_file_content(filename)` | Get the content of a specific file in the PR |\n| `get_diff()[source_file, target_file, new_content]` | Get the raw diff content |\n\n资料来源：[pr_agent/git_providers/git_provider.py]()\n\n### Publishing Operations\n\n| Method | Purpose |\n|--------|---------|\n| `publish_comment(comment)` | Publish a general comment on the PR |\n| `publish_code_suggestion(code_suggestion)` | Publish inline code suggestions |\n| `create_inline_comment(file, line, body)` | Create an inline/review comment |\n| `remove_initial_comment()` | Remove the bot's initial comment |\n| `update_comment(comment_id, body)` | Update an existing comment |\n\n### Review Operations\n\n| Method | Purpose |\n|--------|---------|\n| `get_review_comments()` | Retrieve existing review comments |\n| `get_comments()` | Get all comments on the PR |\n| `get_issue_comments()` | Get issue-specific comments |\n\n### Labels and Status\n\n| Method | Purpose |\n|--------|---------|\n| `get_labels()` | Get current PR labels |\n| `add_label(label)` | Add a label to the PR |\n| `remove_label(label)` | Remove a label from the PR |\n| `get_pr_status()` | Get the current PR status/state |\n\n## Provider Implementation Details\n\n### GitHub Provider\n\nThe `GitHubProvider` uses the `PyGithub` library to interact with GitHub's REST API. It supports GitHub-specific features like:\n\n- Draft PR handling\n- Review request management\n- GitHub-specific markdown rendering (GFM)\n- Code suggestions with inline comments\n\n资料来源：[pr_agent/git_providers/github_provider.py]()\n\n### GitLab Provider\n\nThe `GitLabProvider` leverages the `python-gitlab` library for GitLab API interactions. It handles:\n\n- GitLab-flavored Markdown (GFM)\n- Merge request workflows\n- Different comment threading models\n\n资料来源：[pr_agent/git_providers/gitlab_provider.py]()\n\n### Bitbucket Provider\n\nThe `BitbucketProvider` utilizes the `atlassian-python-api` library to communicate with Bitbucket's APIs. It supports:\n\n- Bitbucket-specific diff formats\n- Pull request workflows\n\n资料来源：[pr_agent/git_providers/bitbucket_provider.py]()\n\n### Azure DevOps Provider\n\nThe `AzureDevOpsProvider` uses `ado_wit_client` for Azure DevOps integration. It handles:\n\n- Azure-specific PR structures\n- Work item linking\n- Azure DevOps review workflows\n\n资料来源：[pr_agent/git_providers/azuredevops_provider.py]()\n\n### Gitea Provider\n\nThe `GiteaProvider` uses the `giteapy` library for self-hosted Gitea instances. It provides:\n\n- Gitea API integration\n- Support for self-hosted GitHub-like platforms\n\n资料来源：[pr_agent/git_providers/gitea_provider.py]()\n\n## Feature Support Detection\n\nEach provider implements a capability detection system via the `is_supported(feature)` method. This allows tools to check whether a specific feature is available on the current platform:\n\n```python\ndef is_supported(self, feature: str) -> bool:\n    \"\"\"Check if a specific feature is supported by the current provider.\"\"\"\n```\n\nCommon features checked include:\n\n| Feature | Purpose |\n|---------|---------|\n| `gfm_markdown` | GitHub-flavored Markdown support |\n| `code_suggestions` | Inline code suggestion capability |\n| `review_comments` | Review comment functionality |\n| `labels` | Label management support |\n\n## Usage in PR-Agent Tools\n\n### Tool Integration Pattern\n\nPR-Agent tools interact with git providers through dependency injection:\n\n```python\nclass SomeTool:\n    def __init__(self, git_provider: GitProvider, ...):\n        self.git_provider = git_provider\n```\n\n### Example: PR Description Tool\n\nThe `pr_description.py` tool demonstrates typical provider usage:\n\n```python\n# Get diff files for analysis\ndiff_files = self.git_provider.get_diff_files()\n\n# Publish results\nself.git_provider.publish_comment(pr_body)\n\n# Check platform capabilities\nif self.git_provider.is_supported(\"gfm_markdown\"):\n    # Use GFM formatting\n```\n\n资料来源：[pr_agent/tools/pr_description.py]()\n\n### Example: Changelog Tool\n\nThe `pr_update_changelog.py` tool shows file operations:\n\n```python\n# Retrieve current changelog\nchangelog_content = self.git_provider.get_pr_file_content(\n    \"CHANGELOG.md\", \n    self.git_provider.get_pr_branch()\n)\n\n# Update changelog file\nself.git_provider.publish_comment(f\"**Changelog updates: 🔄**\\n\\n{answer}\")\n```\n\n资料来源：[pr_agent/tools/pr_update_changelog.py]()\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `GITHUB_TOKEN` | GitHub personal/access token |\n| `GITLAB_TOKEN` | GitLab personal access token |\n| `BITBUCKET_TOKEN` | Bitbucket app password |\n| `AZURE_DEVOPS_TOKEN` | Azure DevOps personal access token |\n| `GITEA_TOKEN` | Gitea API token |\n\n### Provider Selection\n\nThe provider is selected automatically based on the PR URL format or explicitly configured:\n\n```toml\n[config]\ngit_provider = \"github\"  # or \"gitlab\", \"bitbucket\", \"azure\", \"gitea\"\n```\n\n## Data Models\n\n### DiffFile Structure\n\nEach provider returns diff information with a consistent structure:\n\n```python\n@dataclass\nclass DiffFile:\n    filename: str\n    patch: str\n    num_plus_lines: int\n    num_minus_lines: int\n    status: str  # \"added\", \"modified\", \"deleted\", \"renamed\"\n```\n\n### CodeSuggestion Structure\n\n```python\n@dataclass\nclass CodeSuggestion:\n    relevant_file: str\n    relevant_lines: str\n    code_suggestion: dict  # Contains 'before' and 'after' code\n```\n\n## Error Handling\n\nProviders implement consistent error handling through:\n\n- Exception wrapping for platform-specific errors\n- Fallback mechanisms (e.g., extracting from patch when file content unavailable)\n- Logging integration via `get_logger()`\n\nExample fallback pattern from utils.py:\n\n```python\nif not file.head_file:\n    # Fallback: extract relevant lines directly from patch\n    patch = file.patch\n    _, selected_lines = extract_hunk_lines_from_patch(patch, ...)\n```\n\n资料来源：[pr_agent/algo/utils.py]()\n\n## Sequence Diagram: Comment Publishing\n\n```mermaid\nsequenceDiagram\n    participant Tool as PR-Agent Tool\n    participant Provider as GitProvider\n    participant API as Platform API\n    \n    Tool->>Provider: publish_comment(comment)\n    Provider->>API: POST comment request\n    API-->>Provider: Comment created\n    Provider-->>Tool: Success response\n    \n    Tool->>Provider: is_supported(\"gfm_markdown\")\n    Provider-->>Tool: Boolean support status\n```\n\n## Extending the Provider System\n\nTo add support for a new Git platform:\n\n1. Create a new provider class inheriting from `GitProvider`\n2. Implement all abstract methods from the base class\n3. Register the provider in `git_providers/__init__.py`\n4. Add provider selection logic based on PR URL patterns\n5. Implement feature detection via `is_supported()`\n\n### Required Abstract Methods\n\n| Category | Methods |\n|----------|---------|\n| PR Info | `get_pr_title()`, `get_pr_description()`, `get_user()` |\n| Diff | `get_diff_files()`, `get_diff()`, `get_pr_file_content()` |\n| Comments | `publish_comment()`, `get_comments()`, `remove_initial_comment()` |\n| Labels | `get_labels()`, `add_label()`, `remove_label()` |\n| Utils | `is_supported()`, `get_line_link()` |\n\n## Best Practices\n\n1. **Always check feature support** before using platform-specific features\n2. **Handle missing file content** by falling back to patch extraction\n3. **Use consistent error handling** with proper logging\n4. **Test across providers** when adding new provider-agnostic features\n\n---\n\n<a id='command-handling'></a>\n\n## Command-to-Tool Mapping\n\n### 相关页面\n\n相关主题：[System Architecture](#architecture), [Tools Overview](#tools-overview)\n\n<details>\n<summary>Relevant Source Files</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/agent/pr_agent.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/agent/pr_agent.py)\n- [pr_agent/cli.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/cli.py)\n- [pr_agent/algo/cli_args.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/cli_args.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n</details>\n\n# Command-to-Tool Mapping\n\n## Overview\n\nThe Command-to-Tool Mapping system in PR-Agent is the core routing mechanism that translates user-issued commands (such as `/review`, `/describe`, `/improve`) into corresponding tool invocations. This mapping enables the framework to dispatch requests to appropriate specialized tools while managing configuration, argument parsing, and execution flow.\n\nThe system serves as the entry point for all user interactions, whether they occur via GitHub/GitLab comments, CLI execution, or programmatic API calls.\n\n## Architecture\n\n```mermaid\ngraph TD\n    A[User Command] --> B[CLI / Comment Handler]\n    B --> C[Command Parser]\n    C --> D[Argument Extraction]\n    D --> E[Tool Router]\n    E --> F{Command Type}\n    F -->|/describe| G[pr_description.py]\n    F -->|/review| H[pr_reviewer.py]\n    F -->|/improve| I[pr_code_suggestions.py]\n    F -->|/ask| J[pr_ask.py]\n    F -->|/help| K[help.py]\n    G --> L[Git Provider]\n    H --> L\n    I --> L\n    J --> L\n    K --> M[Documentation]\n```\n\n## Core Components\n\n### Command Registry\n\nThe command registry maps slash commands to their corresponding tool implementations. Based on the help system and tool definitions, the following commands are registered:\n\n| Command | Tool Module | Purpose |\n|---------|-------------|---------|\n| `/describe` | `pr_description.py` | Generate PR description, title, type, summary, walkthrough |\n| `/review` | `pr_reviewer.py` | Perform automated code review |\n| `/improve` | `pr_code_suggestions.py` | Generate code improvement suggestions |\n| `/ask` | `pr_ask.py` | Answer questions about PR changes |\n| `/help_docs` | `help_docs.py` | Query repository documentation |\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n### Argument Parsing\n\nThe `cli_args.py` module handles command-line argument parsing and configuration overrides. Commands can accept configuration parameters in two formats:\n\n**Inline Configuration (GitHub Comment):**\n```\n/describe --pr_description.some_config1=value1 --pr_description.some_config2=value2\n```\n\n**Configuration File Format:**\n```toml\n[pr_description]\nsome_config1=value1\nsome_config2=value2\n```\n\n资料来源：[pr_agent/servers/help.py:30-45]()\n\n## Command Handlers\n\n### Describe Command\n\nThe `/describe` command triggers automatic PR description generation.\n\n```python\n@staticmethod\ndef get_describe_usage_guide():\n    output = \"**Overview:**\\n\"\n    output += \"The `describe` tool scans the PR code changes, and generates a description for the PR\"\n```\n\n**Configuration Section:** `pr_description`\n\n**Key Parameters:**\n- `enable_help_comment` - Show help links in PR body\n- `use_description_markers` - Use markers in PR description for selective updates\n- `output_relevant_configurations` - Display relevant config settings\n\n资料来源：[pr_agent/tools/pr_description.py:1-30]()\n\n### Review Command\n\nThe `/review` command initiates automated code review.\n\n```python\n# Configuration template from help message\n/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...\n```\n\n**Configuration Section:** `pr_reviewer`\n\n资料来源：[pr_agent/servers/help.py:50-70]()\n\n### Improve Command\n\nThe `/improve` command generates code improvement suggestions.\n\n```python\n@staticmethod\ndef get_improve_usage_guide():\n    output = \"**Overview:**\\n\"\n    output += \"The code suggestions tool, named `improve`, scans the PR code changes...\"\n```\n\n**Configuration Section:** `pr_code_suggestions`\n\n**Key Features:**\n- Automatic triggering on PR open\n- Manual invocation via comment\n- Configurable suggestion categories and scoring\n\n资料来源：[pr_agent/servers/help.py:50-100]()\n\n### Ask Command\n\nThe `/ask` command answers questions about the PR without maintaining conversation state.\n\n```\n/ask \"What changes were made to the authentication module?\"\n```\n\n```python\n@staticmethod\ndef get_ask_usage_guide():\n    output += \"\"\"\\\nThe `ask` tool answers questions about the PR, based on the PR code changes.\nNote that the tool does not have \"memory\" of previous questions,\nand answers each question independently.\nYou can ask questions about the entire PR, about specific code lines,\nor about an image related to the PR code changes.\n```\n\n资料来源：[pr_agent/servers/help.py:80-95]()\n\n### Help Docs Command\n\nThe `/help_docs` command queries repository documentation.\n\n```python\n@staticmethod\ndef get_help_docs_usage_guide():\n    output = \"**Overview:**\\n\"\n    output += \"\"\"\\\nThe help docs tool, named `help_docs`, answers a question based on\na given relative path of documentation.\"\"\"\n```\n\n资料来源：[pr_agent/servers/help.py:130-145]()\n\n## Execution Flow\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant CLI as Command Line\n    participant Parser as Argument Parser\n    participant Router as Tool Router\n    participant Tool as Selected Tool\n    participant Provider as Git Provider\n\n    User->>CLI: /command --config=value\n    CLI->>Parser: Parse arguments\n    Parser->>Router: Route to tool\n    Router->>Tool: Instantiate tool class\n    Tool->>Provider: Fetch PR data\n    Provider-->>Tool: Diff files, comments\n    Tool->>Tool: Process and analyze\n    Tool->>Provider: Post results\n    Provider-->>User: PR comment/response\n```\n\n## Configuration Integration\n\n### Configuration Precedence\n\nThe system follows a hierarchical configuration resolution:\n\n1. **Default values** - Defined in tool settings\n2. **Configuration file** - User-defined settings in `.pr_agent.toml` or `settings/configuration.toml`\n3. **Command arguments** - Inline overrides from command invocation\n4. **Environment variables** - System-level settings\n\n### Relevant Configurations Output\n\nWhen enabled, the system can output relevant configuration settings in the PR response:\n\n```python\nif get_settings().get('config', {}).get('output_relevant_configurations', False):\n    pr_body += show_relevant_configurations(relevant_section='pr_description')\n```\n\n资料来源：[pr_agent/tools/pr_description.py:25-27]()\n\n## CLI Integration\n\nThe CLI module (`cli.py`) provides command-line access to all tools:\n\n```bash\n# Local repository CLI usage\npr-agent --pr_url https://github.com/owner/repo/pull/123 review\n\n# Help text\npr-agent --help\n```\n\nThe CLI maps the `--pr_url` parameter and selected command to the appropriate tool implementation.\n\n资料来源：[README.md:30-40]()\n\n## Tool Output Formatting\n\nThe utility module (`algo/utils.py`) provides shared formatting functions used across all tools:\n\n| Function | Purpose |\n|----------|---------|\n| `parse_code_suggestion()` | Convert code suggestions to markdown |\n| `extract_relevant_lines_str()` | Extract relevant code lines from diff |\n| `render_issue()` | Format review findings as markdown |\n\n资料来源：[pr_agent/algo/utils.py:50-150]()\n\n## Summary\n\nThe Command-to-Tool Mapping system provides:\n\n- **Unified Interface**: Single entry point for all user interactions\n- **Flexible Configuration**: Per-command and global configuration options\n- **Extensible Architecture**: Easy addition of new commands and tools\n- **Consistent Output**: Standardized markdown formatting across tools\n- **Multi-Platform Support**: Works with GitHub, GitLab, Bitbucket, and Azure DevOps\n\nThis architecture enables PR-Agent to maintain a clean separation between command handling, tool implementation, and output rendering, facilitating maintainability and extensibility.\n\n---\n\n<a id='tools-overview'></a>\n\n## Tools Overview\n\n### 相关页面\n\n相关主题：[/describe Tool](#describe-tool), [/review Tool](#review-tool), [/improve Tool](#improve-tool), [Additional Tools](#additional-tools)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n- [pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n- [pr_agent/git_providers/bitbucket_server_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n</details>\n\n# Tools Overview\n\nPR-Agent provides a comprehensive suite of AI-powered tools for automated pull request analysis, review, and enhancement. These tools are designed to streamline the code review process by automating routine tasks and providing intelligent suggestions.\n\n## Architecture Overview\n\nThe tools system in PR-Agent follows a modular architecture where each tool is responsible for a specific aspect of PR management. Tools can be invoked automatically (on PR events) or manually via slash commands in PR comments.\n\n```mermaid\ngraph TD\n    A[GitHub/GitLab/Bitbucket Event] --> B[PR Agent Core]\n    B --> C[Tool Router]\n    C --> D[/describe]\n    C --> E[/review]\n    C --> F[/improve]\n    C --> G[/ask]\n    C --> H[/help_docs]\n    \n    D --> I[pr_description.py]\n    E --> J[pr_reviewer.py]\n    F --> K[pr_code_suggestions.py]\n    G --> L[pr_questions.py]\n    H --> M[Help System]\n    \n    I --> N[Markdown Output]\n    J --> N\n    K --> N\n    L --> N\n    M --> N\n```\n\n## Available Tools\n\nPR-Agent includes five core tools, each designed for specific PR workflow tasks:\n\n| Tool | Purpose | Invocation |\n|------|---------|------------|\n| `/describe` | Generates PR description (title, type, summary, walkthrough, labels) | Automatic or manual |\n| `/review` | Performs comprehensive code review with issue detection | Automatic or manual |\n| `/improve` | Provides code improvement suggestions | Automatic or manual |\n| `/ask` | Answers questions about the PR code changes | Manual only |\n| `/help_docs` | Retrieves documentation based on repository files | Manual only |\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n## Tool Invocation Patterns\n\n### Slash Command Invocation\n\nTools can be triggered by commenting directly on a PR using slash commands:\n\n```\n/describe --pr_description.some_config1=... --pr_description.some_config2=...\n/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...\n/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...\n/ask \"Your question here\"\n/help_docs \"path/to/documentation\"\n```\n\n资料来源：[pr_agent/servers/help.py:8-25]()\n\n### Configuration File Invocation\n\nFor persistent configuration, tools can be configured via a configuration file:\n\n```toml\n[pr_description]\nsome_config1=...\nsome_config2=...\n\n[pr_reviewer]\nsome_config1=...\nsome_config2=...\n\n[pr_code_suggestions]\nsome_config1=...\nsome_config2=...\n```\n\n## Describe Tool\n\nThe `describe` tool scans PR code changes and generates a comprehensive description including:\n\n- **Title**: Short, concise PR title (up to 10 words)\n- **Type**: PR classification (Bug fix, Enhancement, Documentation, etc.)\n- **Summary**: Brief overview of changes\n- **Walkthrough**: File-by-file change explanation\n- **Labels**: Relevant labels for the PR\n\n### Description Markers\n\nWhen `use_description_markers` is enabled, the tool replaces markers in the PR description:\n\n```markdown\npr_agent:type\npr_agent:summary\npr_agent:walkthrough\npr_agent:diagram\n```\n\n资料来源：[pr_agent/servers/help.py:85-105]()\n\n### Custom Labels\n\nThe describe tool supports custom labels defined in the repository's labels page or configuration:\n\n```toml\n[pr_description]\nextra_instructions=\"\"\"\\\n- The PR title should be in the format: '<PR type>: <title>'\n- The title should be short and concise (up to 10 words)\n\"\"\"\n```\n\nSupported custom label formats:\n- `Main topic:performance` - Marks performance-related PRs\n- `New endpoint` - Indicates new API endpoints\n- `SQL query` - Flags SQL changes\n- `Dockerfile changes` - Identifies container changes\n\n## Review Tool\n\nThe `/review` tool performs comprehensive code review by analyzing:\n\n- Code quality issues\n- Security vulnerabilities\n- Performance concerns\n- Test coverage gaps\n- Documentation completeness\n\n### Review Focus Areas\n\nThe review tool generates a table of recommended focus areas with links to relevant code sections:\n\n```python\n# From pr_description.py - Focus areas structure\nif gfm_supported:\n    issue_str = f\"<details><summary><a href='{reference_link}'><strong>{issue_header}</strong></a>\\n\\n{issue_content}\\n</summary>\\n\\n{relevant_lines_str}\\n\\n</details>\"\n```\n\n## Improve Tool (Code Suggestions)\n\nThe `improve` tool generates actionable code improvement suggestions, organized by category and impact score.\n\n### Suggestion Output Structure\n\n```mermaid\ngraph TD\n    A[Code Suggestions] --> B[Group by Label]\n    B --> C[Sort by Score]\n    C --> D[Category Column]\n    C --> E[Suggestion Column]\n    C --> F[Impact Column]\n```\n\n### Suggestion Table Format\n\nThe tool outputs suggestions in a structured table format:\n\n```html\n<table>\n<thead>\n<tr>\n<td><strong>Category</strong></td>\n<td align=left><strong>Suggestion</strong></td>\n<td align=center><strong>Impact</strong></td>\n</tr>\n</thead>\n<tbody>\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:30-45]()\n\n### Suggestion Processing\n\nSuggestions are processed through the following pipeline:\n\n1. **Label Grouping**: Suggestions are grouped by their category labels\n2. **Score Sorting**: Groups and suggestions within are sorted by score (descending)\n3. **Markdown Formatting**: Suggestions are formatted using GitHub Flavored Markdown\n\n```python\n# Group suggestions by label\nsuggestions_labels = dict()\nfor suggestion in data['code_suggestions']:\n    label = suggestion['label'].strip().strip(\"'\").strip('\"')\n    if label not in suggestions_labels:\n        suggestions_labels[label] = []\n    suggestions_labels[label].append(suggestion)\n\n# Sort by highest score\nsuggestions_labels = dict(\n    sorted(suggestions_labels.items(), \n           key=lambda x: max([s['score'] for s in x[1]]), \n           reverse=True))\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:50-70]()\n\n## Ask Tool\n\nThe `ask` tool provides conversational access to PR information:\n\n- Answers questions about the entire PR\n- Can reference specific code lines\n- Processes images related to PR changes\n- Independent question answering (no memory of previous questions)\n\n```\n/ask \"What is the purpose of the new authentication module?\"\n/ask \"Explain the changes in src/utils.py lines 50-100\"\n```\n\nNote: Each question is answered independently without context from previous questions.\n\n资料来源：[pr_agent/servers/help.py:115-130]()\n\n## Help Docs Tool\n\nThe `help_docs` tool retrieves and explains documentation based on repository files:\n\n```\n/help_docs \"How do I configure the CI pipeline?\"\n```\n\nThis tool searches documentation within the repository or a specified external repository.\n\n## Output Formatting\n\n### GitHub Flavored Markdown Support\n\nPR-Agent detects GFM support and adjusts output accordingly:\n\n```python\nif gfm_supported:\n    markdown_text += '<table>'\n    # Table-based formatting with collapsible sections\nelse:\n    # Standard markdown with headers\n    markdown_text += f\"### {emoji} {key_nice}: {value}\\n\\n\"\n```\n\n### Collapsible File Lists\n\nFor PRs with many changed files, the tools use collapsible sections:\n\n```html\n<details><summary>{filename}</summary>\n<hr>\n{file_content}\n</details>\n```\n\n资料来源：[pr_agent/tools/pr_description.py:100-130]()\n\n### Diff Statistics\n\nFile changes are displayed with diff statistics:\n\n```python\ndiff_plus_minus += f\"+{num_plus_lines}/-{num_minus_lines}\"\n```\n\n## Configuration System\n\n### Per-Tool Configuration\n\nEach tool has its own configuration section:\n\n| Tool | Configuration Section | Location |\n|------|----------------------|----------|\n| Describe | `pr_description` | pr_agent/settings/configuration.toml |\n| Review | `pr_reviewer` | pr_agent/settings/configuration.toml |\n| Improve | `pr_code_suggestions` | pr_agent/settings/configuration.toml |\n\n### Configuration Output\n\nWhen `output_relevant_configurations` is enabled, tools output relevant settings:\n\n```python\nif get_settings().get('config', {}).get('output_relevant_configurations', False):\n    pr_body += show_relevant_configurations(relevant_section='pr_description')\n```\n\n资料来源：[pr_agent/tools/pr_config.py:1-30]()\n\n## Help Comments\n\nTools can optionally add help comments to PR descriptions:\n\n```python\nif get_settings().pr_description.enable_help_comment and self.git_provider.is_supported(\"gfm_markdown\"):\n    pr_body += ('\\n\\n___\\n\\n> <details> <summary>  Need help?</summary><li>Type <code>/help how to ...</code> '\n                'in the comments thread for any questions about PR-Agent usage.</li><li>Check out the '\n                '<a href=\"https://qodo-merge-docs.qodo.ai/usage-guide/\">documentation</a> '\n                'for more information.</li></details>')\n```\n\n资料来源：[pr_agent/tools/pr_description.py:45-60]()\n\n## Multi-Platform Support\n\nPR-Agent tools adapt their output based on the Git provider:\n\n### GitHub\n\nUses full GFM support with table formatting and collapsible sections.\n\n### GitLab\n\nAdapted output for GitLab markdown compatibility:\n\n```python\nelse:  # gitlab\n    pr_body += (\"\\n\\n___\\n\\n<details><summary>Need help?</summary>- Type <code>/help how to ...</code> in the comments \"\n                \"thread for any questions about PR-Agent usage.<br>- Check out the \"\n                \"<a href='https://qodo-merge-docs.qodo.ai/usage-guide/'>documentation</a> for more information.</details>\")\n```\n\n### Bitbucket\n\nBitbucket Server has limited multi-line suggestion support, so code suggestions use code blocks instead:\n\n```python\n# Bitbucket does not support multi-line suggestions so use a code block instead\nbody = body.replace(\"```suggestion\", \"```\")\n```\n\n资料来源：[pr_agent/git_providers/bitbucket_server_provider.py:150-160]()\n\n## Workflow Integration\n\n### Automatic Triggers\n\nTools can be configured to run automatically on PR events:\n\n```yaml\npr_commands = [\"/describe\", \"/review\", \"/improve\"]\n```\n\nWith markers enabled:\n\n```yaml\npr_commands = [\"/describe --pr_description.use_description_markers=true\", ...]\n```\n\n### Manual Invocation\n\nFor interactive use, tools are invoked via PR comments:\n\n```bash\n# Review a specific aspect\n/review --pr_reviewer.extra_instructions=\"Focus on security issues only\"\n```\n\n## Summary\n\nThe PR-Agent tools system provides comprehensive automation for pull request workflows:\n\n- **Describe**: Automatic PR documentation\n- **Review**: Intelligent code analysis\n- **Improve**: Actionable suggestions\n- **Ask**: Conversational PR queries\n- **Help Docs**: Documentation retrieval\n\nEach tool is independently configurable, supports multiple Git providers, and can be integrated into CI/CD pipelines or used interactively.\n\n---\n\n<a id='describe-tool'></a>\n\n## /describe Tool\n\n### 相关页面\n\n相关主题：[Tools Overview](#tools-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n- [AGENTS.md](https://github.com/The-PR-Agent/pr-agent/blob/main/AGENTS.md)\n</details>\n\n# /describe Tool\n\nThe `/describe` tool is one of the core features of PR-Agent that automatically generates comprehensive descriptions for Pull Requests by analyzing code changes.\n\n## Overview\n\nThe `describe` tool scans PR code changes and automatically generates a structured description including:\n\n- **PR Title** - Concise summary of the changes\n- **PR Type** - Classification (Bug fix, Enhancement, Documentation, Tests, Other)\n- **Summary** - High-level overview of modifications\n- **Walkthrough** - File-by-file breakdown of changes\n- **Labels** - Automatically suggested labels based on content\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n## Architecture\n\n```mermaid\ngraph TD\n    A[PR Opened/Updated] --> B{Automation Triggered?}\n    B -->|Yes| C[Automatic Mode]\n    B -->|No| D[Manual Comment: /describe]\n    C --> E[PRDescriptionTool.run]\n    D --> E\n    E --> F[Analyze Diff Files]\n    F --> G[Generate Title & Type]\n    G --> H[Generate Summary]\n    H --> I[Generate Walkthrough Table]\n    I --> J[Apply Labels]\n    J --> K[Update PR Description]\n    K --> L[Optional: Add Help Comment]\n```\n\n## Usage Modes\n\n### Automatic Mode\n\nThe tool can run automatically when a PR is opened or updated, configured via GitHub App settings.\n\n```yaml\n# Default automation configuration\npr_commands = [\"/describe\", ...]\n```\n\n资料来源：[pr_agent/servers/help.py:70-85]()\n\n### Manual Mode\n\nInvoke manually by commenting on a PR:\n\n```\n/describe\n```\n\nWith custom configurations:\n\n```\n/describe --pr_description.some_config1=... --pr_description.some_config2=...\n```\n\n资料来源：[pr_agent/servers/help.py:45-60]()\n\n### Marker Mode\n\nAn alternative approach using markers in the PR description:\n\n```yaml\npr_commands = [\"/describe --pr_description.use_description_markers=true\", ...]\n```\n\nAvailable markers:\n- `pr_agent:type` - PR type\n- `pr_agent:summary` - PR summary\n- `pr_agent:walkthrough` - File walkthrough\n- `pr_agent:diagram` - Sequence diagram (if enabled)\n\n资料来源：[pr_agent/servers/help.py:80-100]()\n\n## Output Structure\n\nThe generated PR description follows this structure:\n\n| Section | Description |\n|---------|-------------|\n| Title | PR type prefix + concise title (max 10 words) |\n| Type | Classification of the change |\n| Summary | High-level description of modifications |\n| Walkthrough | Table of changed files with descriptions |\n| Labels | Suggested labels for categorization |\n\n## Configuration Options\n\n### Configuration File\n\n```toml\n[pr_description]\nextra_instructions=\"\"\"\\\n- The PR title should be in the format: '<PR type>: <title>'\n- The title should be short and concise (up to 10 words)\n- Use bullet points for clarity\n\"\"\"\n```\n\n### Key Configuration Parameters\n\n| Parameter | Description | Default |\n|-----------|-------------|---------|\n| `enable_help_comment` | Add help text to PR | `true` |\n| `use_description_markers` | Use markers in PR body | `false` |\n| `enable_generate_title` | Auto-generate title | `true` |\n| `enable.type` | Include PR type | `true` |\n| `enable.walkthrough` | Include file walkthrough | `true` |\n| `enable.labels` | Include labels | `true` |\n| `extra_instructions` | Custom instructions | `\"\"` |\n\n资料来源：[pr_agent/servers/help.py:46-55]()\n\n## Walkthrough Table Format\n\nThe file walkthrough is rendered as a markdown table with collapsible sections:\n\n```markdown\n| Theme | Files Changed |\n|-------|---------------|\n| **Core Logic** | <details><summary>2 files</summary>... |\n```\n\n### Table Components\n\n| Component | Description |\n|-----------|-------------|\n| `file_changes_title` | Category or component name |\n| `diff_plus_minus` | Lines added/removed (`+X/-Y`) |\n| `file_change_description` | Description of changes |\n| `link` | URL to file diff |\n\n资料来源：[pr_agent/tools/pr_description.py:100-150]()\n\n## Custom Labels\n\nThe tool supports custom labels defined in the repository's labels page:\n\n### Default Labels\n\n- `Bug fix`\n- `Tests`\n- `Enhancement`\n- `Documentation`\n- `Other`\n\n### Custom Label Format\n\n```\nMain topic:performance - pr_agent:The main topic of this PR is performance\nNew endpoint - pr_agent:A new endpoint was added in this PR\nSQL query - pr_agent:A new SQL query was added in this PR\nDockerfile changes - pr_agent:The PR contains changes in the Dockerfile\n```\n\n资料来源：[pr_agent/servers/help.py:105-130]()\n\n## Help Comment Integration\n\nWhen enabled, a help comment is appended to the PR:\n\n```html\n> <details> <summary> Need help?</summary>\n> <li>Type <code>/help how to ...</code> in the comments thread</li>\n> <li>Check out the <a href=\"...\">documentation</a></li>\n> </details>\n```\n\nThis is displayed conditionally based on:\n- `enable_help_comment` setting\n- Git provider support for GFM markdown\n- Provider type (GitHub vs GitLab)\n\n资料来源：[pr_agent/tools/pr_description.py:25-45]()\n\n## Implementation Flow\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant GitProvider\n    participant PRDescriptionTool\n    participant Model\n    \n    User->>GitProvider: Opens PR\n    GitProvider->>PRDescriptionTool: Trigger /describe\n    PRDescriptionTool->>GitProvider: Get diff files\n    GitProvider-->>PRDescriptionTool: Return diff\n    PRDescriptionTool->>Model: Request description\n    Model-->>PRDescriptionTool: Generated content\n    PRDescriptionTool->>PRDescriptionTool: Format markdown\n    PRDescriptionTool->>GitProvider: Update PR description\n    alt enable_help_comment\n        PRDescriptionTool->>GitProvider: Add help comment\n    end\n```\n\n## Code Suggestion Integration\n\nThe describe tool works alongside the `improve` tool for code suggestions:\n\n```python\n# From pr_description.py\nif get_settings().get('config', {}).get('output_relevant_configurations', False):\n    pr_body += show_relevant_configurations(relevant_section='pr_description')\n```\n\n资料来源：[pr_agent/tools/pr_description.py:50-52]()\n\n## Relevant Configuration Display\n\nWhen `output_relevant_configurations` is enabled, relevant settings are included in the output:\n\n```toml\n[pr_description]\nsome_config1=...\nsome_config2=...\n```\n\n资料来源：[pr_agent/tools/pr_config.py:1-20]()\n\n## Related Commands\n\n| Command | Purpose |\n|---------|---------|\n| `/review` | Analyze PR code and provide feedback |\n| `/improve` | Generate code improvement suggestions |\n| `/ask` | Answer questions about the PR |\n| `/help_docs` | Answer questions from documentation |\n\n## Best Practices\n\n1. **Custom Labels**: Define labels relevant to your repository's domain\n2. **Extra Instructions**: Use `extra_instructions` for project-specific formatting rules\n3. **Markers**: Use markers for incremental updates to PR descriptions\n4. **Automation**: Enable automatic triggering for consistent documentation\n\n资料来源：[AGENTS.md:1-30]()\n\n## Summary\n\nThe `/describe` tool is a powerful feature that transforms raw code changes into human-readable PR descriptions. It supports multiple invocation modes, customizable output formats, and integrates seamlessly with GitHub's workflow automation capabilities.\n\n---\n\n<a id='review-tool'></a>\n\n## /review Tool\n\n### 相关页面\n\n相关主题：[Tools Overview](#tools-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n- [pr_agent/git_providers/bitbucket_server_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n</details>\n\n# /review Tool\n\n## Overview\n\nThe `/review` tool is a core component of PR-Agent that performs automated code review of pull requests. It scans PR code changes and provides a comprehensive analysis including code quality assessment, potential bugs, security issues, testing gaps, and improvement suggestions.\n\nThe tool can be triggered automatically when a new PR is opened, or invoked manually by commenting on a PR with the `/review` command.\n\n## Architecture\n\n```mermaid\ngraph TD\n    A[User Trigger: /review] --> B[Git Provider Integration]\n    B --> C[Diff Files Extraction]\n    C --> D[PR Reviewer Engine]\n    D --> E[LLM Analysis]\n    E --> F[Review Output Generation]\n    F --> G[Publish to PR Comments]\n    \n    H[Configuration] --> D\n    I[Prompt Templates] --> E\n```\n\n## Invocation Methods\n\n### Manual Invocation\n\nTo invoke the review tool manually, comment on a PR with:\n\n```\n/review\n```\n\nTo customize behavior, pass configuration parameters:\n\n```\n/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...\n```\n\n### Configuration File\n\nAlternatively, configure via a configuration file:\n\n```toml\n[pr_reviewer]\nsome_config1=...\nsome_config2=...\n```\n\n## Configuration Options\n\nThe `pr_reviewer` section in `configuration.toml` controls the review tool behavior:\n\n| Parameter | Description | Default |\n|-----------|-------------|---------|\n| `enable_help_text` | Show help text in review output | `true` |\n| `enable_load_files` | Load file contents for deeper analysis | `false` |\n| `enable_intro` | Show introduction section | `true` |\n| `enable_final_comment` | Add final summary comment | `true` |\n| `enable_review_status` | Track review completion status | `false` |\n\n资料来源：[pr_agent/servers/help.py:1-30]()\n\n## Review Output Structure\n\nThe review output is generated in markdown format with collapsible sections. The output follows this structure:\n\n```markdown\n## PR Review Summary\n\n[Overview of changes]\n\n### Code Quality Assessment\n[Analysis of code structure and patterns]\n\n### Potential Issues\n[List of identified problems]\n\n### Suggestions\n[Improvement recommendations]\n\n### Security Considerations\n[Security-relevant findings]\n```\n\n## Integration with Code Suggestions\n\nThe review tool leverages the code suggestions subsystem to provide actionable improvement recommendations:\n\n```python\n# From pr_code_suggestions.py\nsuggestions_labels = dict()\nfor suggestion in data['code_suggestions']:\n    label = suggestion['label'].strip()\n    if label not in suggestions_labels:\n        suggestions_labels[label] = []\n    suggestions_labels[label].append(suggestion)\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:50-60]()\n\n## Code Suggestion Display Format\n\nWhen GFM (GitHub Flavored Markdown) is supported, suggestions are displayed in a structured table:\n\n```html\n<table>\n  <thead>\n    <tr>\n      <td><strong>Category</strong></td>\n      <td align=left><strong>Suggestion</strong></td>\n      <td align=center><strong>Impact</strong></td>\n    </tr>\n  </thead>\n  <tbody>\n    <!-- Suggestions rendered here -->\n  </tbody>\n</table>\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:40-50]()\n\n## Markdown Rendering Utilities\n\nThe tool uses utility functions to convert suggestion dictionaries to markdown:\n\n```python\ndef parse_code_suggestion(code_suggestion: dict, i: int = 0, gfm_supported: bool = True) -> str:\n    \"\"\"\n    Convert a dictionary of data into markdown format.\n    \"\"\"\n    markdown_text = \"\"\n    if gfm_supported and 'relevant_line' in code_suggestion:\n        markdown_text += '<table>'\n        # ... table rendering logic\n    markdown_text += \"</table>\\n\"\n    return markdown_text\n```\n\n资料来源：[pr_agent/algo/utils.py:100-120]()\n\n## Git Provider Integration\n\nThe review output can be published to different Git platforms. The `publish_code_suggestions` method in `bitbucket_server_provider.py` demonstrates platform-specific handling:\n\n```python\nif relevant_lines_end > relevant_lines_start:\n    # Bitbucket does not support multi-line suggestions\n    body = body.replace(\"```suggestion\", \"```\")\n    post_parameters = {\n        \"body\": body,\n        \"path\": relevant_file,\n        \"line\": relevant_lines_end,\n        # ...\n    }\n```\n\n资料来源：[pr_agent/git_providers/bitbucket_server_provider.py:1-30]()\n\n## Configuration Output\n\nThe tool can output relevant configurations in the review comment when enabled:\n\n```python\ndef show_relevant_configurations(relevant_section='pr_description') -> str:\n    # Returns formatted markdown of configuration settings\n```\n\n资料来源：[pr_agent/tools/pr_config.py:1-20]()\n\n## Workflow Diagram\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant GitProvider\n    participant ReviewTool\n    participant LLM\n    participant OutputFormatter\n    \n    User->>GitProvider: /review command\n    GitProvider->>ReviewTool: Fetch PR diff\n    ReviewTool->>LLM: Send for analysis\n    LLM->>OutputFormatter: Return structured review\n    OutputFormatter->>GitProvider: Format as markdown\n    GitProvider->>User: Publish review comment\n```\n\n## File Walkthrough Parsing\n\nThe review tool parses file walkthroughs from PR descriptions using regex patterns:\n\n```python\nregex_pattern = r'<details.*?>\\s*<summary>\\s*<h3>\\s*' + re.escape(PRDescriptionHeader.FILE_WALKTHROUGH.value) + r'\\s*</h3>\\s*</summary>'\ndescription_split = re.split(regex_pattern, description_full, maxsplit=1, flags=re.DOTALL)\n```\n\n资料来源：[pr_agent/algo/utils.py:150-160]()\n\n## Help Text Integration\n\nThe review tool includes contextual help text that can be displayed based on configuration:\n\n```python\nif get_settings().pr_reviewer.enable_help_text and self.git_provider.is_supported(\"gfm_markdown\"):\n    pr_body += HelpMessage.get_review_usage_guide()\n```\n\n资料来源：[pr_agent/servers/help.py:10-20]()\n\n## Automated Triggers\n\nThe review tool can be configured to run automatically on PR events:\n\n```yaml\npr_commands = [\"/review\", ...]  # Default mode\n# Or with specific configurations:\npr_commands = [\"/review --pr_reviewer.enable_intro=false\", ...]\n```\n\n资料来源：[pr_agent/servers/help.py:15-25]()\n\n## Best Practices\n\n1. **Use specific configurations** to focus review on relevant aspects (security, code quality, etc.)\n2. **Enable intro text** for new team members to understand review comments\n3. **Disable help text** in short-lived branches to reduce noise\n4. **Combine with `/improve`** for actionable code suggestions\n\n## External Documentation\n\nFor comprehensive usage guides and examples, see the official documentation:\n- [Review Tool Usage](https://pr-agent-docs.codium.ai/tools/review/)\n- [Configuration Options](https://pr-agent-docs.codium.ai/usage-guide/configuration_options/)\n- [Automations](https://pr-agent-docs.codium.ai/usage-guide/automations_and_usage/#github-app-automatic-tools-when-a-new-pr-is-opened)\n\n---\n\n<a id='improve-tool'></a>\n\n## /improve Tool\n\n### 相关页面\n\n相关主题：[Tools Overview](#tools-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/git_providers/bitbucket_server_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n- [pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n</details>\n\n# /improve Tool\n\n## Overview\n\nThe `/improve` tool is a PR-Agent module that automatically scans pull request code changes and generates actionable code suggestions for improving the PR. It serves as the core component behind the `pr_code_suggestions` feature, providing developers with intelligent recommendations to enhance code quality, performance, and maintainability.\n\nThe tool can be triggered automatically when a PR is opened or invoked manually by commenting `/improve` on any pull request.\n\n## Key Characteristics\n\n| Attribute | Description |\n|-----------|-------------|\n| Tool Name | `improve` |\n| Configuration Section | `pr_code_suggestions` |\n| Invocation Command | `/improve` |\n| Auto-trigger Support | Yes |\n| Manual Trigger | Via PR comment |\n| Output Format | Markdown table with collapsible code diffs |\n\n## Architecture\n\n```mermaid\ngraph TD\n    A[PR Opened / /improve Command] --> B[pr_code_suggestions.py]\n    B --> C[Get Diff Files from PR]\n    C --> D[Analyze Code Changes]\n    D --> E[Generate Suggestions via LLM]\n    E --> F[Parse & Format Suggestions]\n    F --> G[Render Markdown Output]\n    G --> H[Post to PR as Comment]\n    \n    F --> I[parse_code_suggestion function]\n    I --> J[Table Format with GFM]\n    I --> K[Diff Code Generation]\n    \n    H --> L[GitHub Provider]\n    H --> M[GitLab Provider]\n    H --> N[Bitbucket Provider]\n```\n\n## Data Flow\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant GitProvider\n    participant ImproveTool\n    participant LLM\n    participant MarkdownRenderer\n    \n    User->>GitProvider: Trigger /improve command\n    GitProvider->>ImproveTool: Pass PR diff files\n    ImproveTool->>LLM: Request code suggestions\n    LLM->>ImproveTool: Return structured suggestions\n    ImproveTool->>MarkdownRenderer: Parse suggestion data\n    MarkdownRenderer->>ImproveTool: Generate formatted markdown\n    ImproveTool->>GitProvider: Post comment to PR\n```\n\n## Configuration Options\n\nThe `/improve` tool is configured via the `pr_code_suggestions` section in the configuration file or through command-line arguments.\n\n### Configuration Parameters\n\n| Parameter | Type | Description | Default |\n|-----------|------|-------------|---------|\n| `enable_help_comment` | bool | Show help instructions in PR comment | Varies |\n| `num_code_suggestions` | int | Maximum number of suggestions to generate | Config dependent |\n\n### Command-Line Override\n\nWhen commenting on a PR, edit configurations using:\n\n```bash\n/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...\n```\n\n### Configuration File Format\n\n```toml\n[pr_code_suggestions]\nsome_config1=...\nsome_config2=...\n```\n\n资料来源：[pr_agent/servers/help.py:78-90]()\n\n## Output Format\n\n### Markdown Table Structure\n\nThe tool renders suggestions in a structured table format:\n\n```\nCategory | Suggestion Content | Impact\n---------|-------------------|--------\n```\n\n### Suggestion Component Model\n\nEach code suggestion contains:\n\n| Field | Description |\n|-------|-------------|\n| `label` | Category/label for the suggestion |\n| `score` | Priority score (used for sorting) |\n| `one_sentence_summary` | Brief description |\n| `existing_code` | Original code block |\n| `improved_code` | Suggested improved code |\n| `relevant_file` | Target file path |\n| `relevant_lines_start` | Start line number |\n| `relevant_lines_end` | End line number |\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:1-50]()\n\n### Rendering Logic\n\nThe rendering engine sorts suggestions by:\n\n1. **Primary sort**: Group by label, ordered by highest score within each group\n2. **Secondary sort**: Within each label group, suggestions are sorted by score descending\n\n```python\nsuggestions_labels = dict(\n    sorted(suggestions_labels.items(), key=lambda x: max([s['score'] for s in x[1]]), reverse=True))\nfor label, suggestions in suggestions_labels.items():\n    suggestions_labels[label] = sorted(suggestions, key=lambda x: x['score'], reverse=True)\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:30-40]()\n\n## Diff Generation\n\n### Unified Diff Format\n\nThe tool generates `unified_diff` output for comparing existing and improved code:\n\n```python\ndiff = difflib.unified_diff(\n    existing_code.split('\\n'),\n    improved_code.split('\\n'), \n    n=999\n)\npatch_orig = \"\\n\".join(diff)\npatch = \"\\n\".join(patch_orig.splitlines()[5:]).strip('\\n')\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:80-90]()\n\n### Output Wrapper\n\n```markdown\n```diff\n--- original\n+++ improved\n@@ ... @@\n...diff content...\n```\n```\n\n## Multi-Provider Support\n\n### GitHub Provider\n\nStandard markdown rendering with collapsible details:\n\n```html\n<details><summary>Suggestion Summary</summary>\n\n___\n\n**Suggestion Content**\n\n[file.py:10-25](link)\n\n```diff\n...code diff...\n```\n</details>\n```\n\n### GitLab Provider\n\nSimilar to GitHub with minor formatting adjustments.\n\n### Bitbucket Server Provider\n\nSpecial handling for multi-line suggestions:\n\n> Bitbucket does not support multi-line suggestions so use a code block instead\n\n资料来源：[pr_agent/git_providers/bitbucket_server_provider.py:200-210]()\n\n## Usage Examples\n\n### Manual Invocation\n\n```\n/improve\n/improve --pr_code_suggestions.num_code_suggestions=5\n/improve --pr_code_suggestions.some_config=value\n```\n\n### Automated Trigger\n\nConfigured via GitHub App automatic tools, the tool runs on PR open events when enabled in settings.\n\n## Related Utility Functions\n\n### parse_code_suggestion\n\nLocated in `pr_agent/algo/utils.py`, this function converts suggestion dictionaries to markdown:\n\n```python\ndef parse_code_suggestion(code_suggestion: dict, i: int = 0, gfm_supported: bool = True) -> str:\n    \"\"\"\n    Convert a dictionary of data into markdown format.\n    \"\"\"\n    markdown_text = \"\"\n    if gfm_supported and 'relevant_line' in code_suggestion:\n        markdown_text += '<table>'\n        # ... processing logic\n    return markdown_text\n```\n\n资料来源：[pr_agent/algo/utils.py:100-120]()\n\n### extract_relevant_lines_str\n\nExtracts relevant code lines from PR diff for context:\n\n```python\ndef extract_relevant_lines_str(end_line, files, relevant_file, start_line, dedent=False) -> str:\n    \"\"\"Finds 'relevant_file' in 'files', and extracts the lines from 'start_line' to 'end_line'\"\"\"\n```\n\n资料来源：[pr_agent/algo/utils.py:150-180]()\n\n## Integration Points\n\n```mermaid\ngraph LR\n    A[pr_code_suggestions.py] --> B[HelpMessage]\n    A --> C[get_settings]\n    A --> D[GitProvider]\n    A --> E[utils.py functions]\n    \n    B --> F[get_improve_usage_guide]\n    C --> G[Configuration Loading]\n    D --> H[Post Comments]\n    E --> I[parse_code_suggestion]\n    E --> J[render_*_markdown]\n```\n\n## See Also\n\n- [Review Tool](/tools/review/) - Code review functionality\n- [Describe Tool](/tools/describe/) - PR description generation\n- [Ask Tool](/tools/ask/) - Interactive PR questions\n- [Configuration Guide](https://pr-agent-docs.codium.ai/usage-guide/configuration_options/)\n\n---\n\n<a id='additional-tools'></a>\n\n## Additional Tools\n\n### 相关页面\n\n相关主题：[Tools Overview](#tools-overview), [/describe Tool](#describe-tool), [/review Tool](#review-tool)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/tools/pr_questions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_questions.py)\n- [pr_agent/tools/pr_help_docs.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_help_docs.py)\n- [pr_agent/tools/pr_update_changelog.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_update_changelog.py)\n- [pr_agent/tools/pr_generate_labels.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_generate_labels.py)\n- [pr_agent/tools/pr_similar_issue.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_similar_issue.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n</details>\n\n# Additional Tools\n\nPR-Agent provides several supplementary tools that extend beyond the core code review capabilities. These tools help developers with documentation lookup, changelog management, label generation, and finding related issues.\n\n## Overview\n\nThe Additional Tools module encompasses standalone utilities that can be invoked manually on pull requests. Unlike the core automated tools (describe, review, improve) that run automatically, these tools are typically triggered through comments on specific PRs.\n\n```mermaid\ngraph TD\n    A[PR Agent Tools] --> B[Core Automated Tools]\n    A --> C[Additional Tools]\n    \n    C --> D[ask]\n    C --> E[help_docs]\n    C --> F[update_changelog]\n    C --> G[generate_labels]\n    C --> H[similar_issue]\n    \n    style C fill:#f9f,stroke:#333,stroke-width:2px\n    style D fill:#bbf,stroke:#333,stroke-width:1px\n    style E fill:#bbf,stroke:#333,stroke-width:1px\n    style F fill:#bbf,stroke:#333,stroke-width:1px\n    style G fill:#bbf,stroke:#333,stroke-width:1px\n    style H fill:#bbf,stroke:#333,stroke-width:1px\n```\n\n## Ask Tool\n\nThe `ask` tool answers questions about the PR code changes using natural language.\n\n### Purpose\n\nThe ask tool provides a question-and-answer interface that allows developers to query information about a specific pull request. It analyzes the PR diff and code to provide contextual answers.\n\n### Invocation\n\n```bash\n/ask \"What changes were made to the authentication module?\"\n```\n\n### Key Characteristics\n\n| Characteristic | Description |\n|----------------|-------------|\n| **Memory** | No memory of previous questions |\n| **Independence** | Each question answered independently |\n| **Scope** | Entire PR, specific code lines, or images |\n| **Invocation** | Manual only via PR comments |\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n### Implementation\n\nThe ask functionality is implemented in `pr_agent/tools/pr_questions.py`. The tool:\n\n1. Parses the question from the PR comment\n2. Extracts relevant code changes from the PR diff\n3. Generates a contextual response using the LLM\n\n```mermaid\ngraph LR\n    A[User Comment: /ask \"...\"] --> B[Parse Question]\n    B --> C[Extract PR Diff]\n    C --> D[Generate Context]\n    D --> E[LLM Processing]\n    E --> F[Response Output]\n```\n\n## Help Docs Tool\n\nThe `help_docs` tool answers questions based on documentation files within the repository.\n\n### Purpose\n\nThis tool enables developers to ask questions about project documentation and receive accurate answers based on the actual documentation files.\n\n### Invocation\n\n```bash\n/help_docs \"How do I configure the webhook?\"\n```\n\n### Configuration\n\nThe tool supports documentation from:\n- The repository's own documentation files\n- External documentation sources specified in configuration\n\n### Key Features\n\n- Answers questions based on relative documentation paths\n- Supports both repository-local and external documentation sources\n- Provides accurate answers using RAG (Retrieval-Augmented Generation) techniques\n\n资料来源：[pr_agent/tools/pr_help_docs.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_help_docs.py)\n\n## Update Changelog Tool\n\nThe `update_changelog` tool automatically updates changelog files based on PR changes.\n\n### Purpose\n\nThis tool ensures that changelog entries are created or updated when new features, fixes, or changes are merged.\n\n### Key Workflow\n\n```mermaid\ngraph TD\n    A[PR Merged] --> B[Trigger update_changelog]\n    B --> C[Analyze PR Changes]\n    C --> D[Determine Changelog Category]\n    D --> E{Find Existing Changelog?}\n    E -->|Yes| F[Update Existing Entry]\n    E -->|No| G[Create New Entry]\n    F --> H[Format According to Standards]\n    G --> H\n    H --> I[Commit Changes]\n```\n\n### Changelog Categories\n\n| Category | Description |\n|----------|-------------|\n| Features | New functionality additions |\n| Bug Fixes | Resolution of bugs |\n| Breaking Changes | API or behavior changes |\n| Documentation | Documentation updates |\n\n资料来源：[pr_agent/tools/pr_update_changelog.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_update_changelog.py)\n\n## Generate Labels Tool\n\nThe `generate_labels` tool automatically creates or suggests labels for pull requests.\n\n### Purpose\n\nThis tool analyzes PR changes and generates appropriate labels based on the content, type, and impact of the changes.\n\n### Label Generation Process\n\n```mermaid\ngraph LR\n    A[Analyze PR Diff] --> B[Determine PR Type]\n    B --> C[Assess Impact Area]\n    C --> D[Match Against Existing Labels]\n    D --> E[Generate Label Suggestions]\n    E --> F[Apply or Present to User]\n```\n\n### Supported Label Types\n\n| Label Type | Example |\n|------------|---------|\n| **Type-based** | Bug fix, Enhancement, Documentation |\n| **Area-based** | Frontend, Backend, API, Database |\n| **Scope-based** | Performance, Security, Testing |\n| **Custom** | Repository-specific labels |\n\n资料来源：[pr_agent/tools/pr_generate_labels.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_generate_labels.py)\n\n## Similar Issue Tool\n\nThe `similar_issue` tool finds related issues or pull requests that address similar problems.\n\n### Purpose\n\nThis tool helps developers avoid duplicate work by identifying existing issues or PRs that may be related to the current issue being addressed.\n\n### Search Strategy\n\nThe tool uses multiple approaches to find similar issues:\n\n1. **Semantic Search**: Uses embeddings to find semantically similar text\n2. **Keyword Matching**: Identifies shared terminology\n3. **Historical Analysis**: Examines closed/resolved similar issues\n\n### Output Format\n\n| Field | Description |\n|-------|-------------|\n| Issue/PR Number | Reference identifier |\n| Title | Issue/PR title |\n| Similarity Score | Relevance indicator |\n| Status | Open/Closed/Resolved |\n| Resolution | How it was addressed (if closed) |\n\n资料来源：[pr_agent/tools/pr_similar_issue.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_similar_issue.py)\n\n## Common Configuration Options\n\nAdditional tools share several common configuration patterns.\n\n### Configuration via Comments\n\n```bash\n/tool_name --section.option=value\n```\n\n### Configuration via File\n\n```toml\n[section_name]\noption1 = value1\noption2 = value2\n```\n\n### Shared Settings\n\n| Setting | Description | Default |\n|---------|-------------|---------|\n| `enable_help_comment` | Show help links in output | Varies by tool |\n| `output_relevant_configurations` | Include config details in output | false |\n\n资料来源：[pr_agent/servers/help.py:1-100]()\n\n## Usage Patterns\n\n### Manual Invocation\n\nAll additional tools are invoked manually through PR comments:\n\n```bash\n/ask \"What does this function do?\"\n/help_docs \"How do I run tests?\"\n/generate_labels\n/similar_issue \"authentication bug\"\n```\n\n### Tool Comparison\n\n| Tool | Trigger Type | Automated | Primary Use Case |\n|------|-------------|-----------|------------------|\n| ask | Manual | No | Code understanding |\n| help_docs | Manual | No | Documentation lookup |\n| update_changelog | Manual/Auto | Optional | Release notes |\n| generate_labels | Manual | Optional | Organization |\n| similar_issue | Manual | No | Avoiding duplicates |\n\n## Help System Integration\n\nEach tool includes integrated help documentation accessible through the help system:\n\n```mermaid\ngraph TD\n    A[User] --> B[/help or /ask \"help\"]\n    B --> C[HelpMessage Class]\n    C --> D{Identify Tool}\n    D --> E[get_{tool}_usage_guide]\n    E --> F[Display Usage Info]\n    F --> G[Link to Full Documentation]\n```\n\nThe help system provides:\n- Usage examples for each tool\n- Configuration templates\n- Links to detailed documentation pages\n- GitHub App vs GitLab compatibility notes\n\n资料来源：[pr_agent/servers/help.py:50-150]()\n\n## Implementation Architecture\n\n### Tool Base Structure\n\n```mermaid\nclassDiagram\n    class BaseTool {\n        +run()\n        +get_settings()\n        +git_provider\n    }\n    class AskTool {\n        +answer_question()\n    }\n    class HelpDocsTool {\n        +find_documentation()\n    }\n    class UpdateChangelogTool {\n        +update_changelog()\n    }\n    class GenerateLabelsTool {\n        +generate_labels()\n    }\n    class SimilarIssueTool {\n        +find_similar()\n    }\n    \n    BaseTool <|-- AskTool\n    BaseTool <|-- HelpDocsTool\n    BaseTool <|-- UpdateChangelogTool\n    BaseTool <|-- GenerateLabelsTool\n    BaseTool <|-- SimilarIssueTool\n```\n\n### Utility Functions\n\nShared utilities in `pr_agent/algo/utils.py` provide common functionality:\n\n- `parse_code_suggestion()`: Converts code suggestion dictionaries to markdown\n- `extract_relevant_lines_str()`: Extracts specific code lines from diffs\n- `show_relevant_configurations()`: Displays configuration details\n\n资料来源：[pr_agent/algo/utils.py:1-100]()\n\n## Best Practices\n\n### When to Use Additional Tools\n\n| Scenario | Recommended Tool |\n|----------|-----------------|\n| Understanding complex code changes | `ask` |\n| Finding documentation information | `help_docs` |\n| Preparing release notes | `update_changelog` |\n| Organizing PRs with labels | `generate_labels` |\n| Checking for duplicate work | `similar_issue` |\n\n### Configuration Recommendations\n\n1. **Enable help comments** to guide users unfamiliar with tools\n2. **Set up custom label mappings** for the generate_labels tool\n3. **Configure changelog format** to match project standards\n4. **Use appropriate documentation paths** for help_docs tool\n\n## Documentation References\n\nFor detailed information about specific tools, refer to:\n\n- [Ask Tool Documentation](https://pr-agent-docs.codium.ai/tools/ask/)\n- [Help Docs Tool Documentation](https://pr-agent-docs.codium.ai/tools/help_docs/)\n- [Configuration Guide](https://pr-agent-docs.codium.ai/usage-guide/configuration_options/)\n\n资料来源：[pr_agent/servers/help.py:1-50](), [pr_agent/servers/help.py:50-100]()\n\n---\n\n---\n\n## Doramagic Pitfall Log\n\nProject: The-PR-Agent/pr-agent\n\nSummary: Found 38 potential pitfall items; 5 are high/blocking. Highest priority: installation - 来源证据：Allow specifying a custom branch for locating `.pr_agent.toml`.\n\n## 1. installation · 来源证据：Allow specifying a custom branch for locating `.pr_agent.toml`\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Allow specifying a custom branch for locating `.pr_agent.toml`\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_6aa2027573564d778bdccf1c0e603a0f | https://github.com/The-PR-Agent/pr-agent/issues/1977 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 2. security_permissions · 失败模式：security_permissions: Add support for Databricks hosted models\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: Developers should check this security_permissions risk before relying on the project: Add support for Databricks hosted models\n- User impact: Developers may expose sensitive permissions or credentials: Add support for Databricks hosted models\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Add support for Databricks hosted models. Context: Observed when using python, docker\n- Guardrail action: Do not recommend enabling privileged or credential-bearing paths until the source-backed risk is reviewed: https://github.com/The-PR-Agent/pr-agent/issues/2246\n- Evidence: failure_mode_cluster:github_issue | fmev_63e7f7511bd7314419df2ded4a1a20e9 | https://github.com/The-PR-Agent/pr-agent/issues/2246 | Add support for Databricks hosted models\n\n## 3. security_permissions · 来源证据：Add support for Databricks hosted models\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Add support for Databricks hosted models\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_6b5b4692165240e5a79137dc9335bd50 | https://github.com/The-PR-Agent/pr-agent/issues/2246 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 4. security_permissions · 来源证据：GITLAB 404 project not found\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：GITLAB 404 project not found\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_04774e9f24034b56b080d2af0875b7fd | https://github.com/The-PR-Agent/pr-agent/issues/2282 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 5. security_permissions · 来源证据：Incorrect Inline Code Suggestion Formatting in Azure DevOps\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Incorrect Inline Code Suggestion Formatting in Azure DevOps\n- User impact: 可能影响升级、迁移或版本选择。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_d01349d41e8a48db89a80ebdb4ca9bde | https://github.com/The-PR-Agent/pr-agent/issues/2110 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 6. installation · 失败模式：installation: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental supp...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this installation risk before relying on the project: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- User impact: Developers may fail before the first successful local run: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_f812843570a304cde8d165f9bd42e8dc | https://github.com/The-PR-Agent/pr-agent/issues/2379 | Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n\n## 7. installation · 失败模式：installation: feat: support agent skills for context-aware review guidance\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this installation risk before relying on the project: feat: support agent skills for context-aware review guidance\n- User impact: Developers may fail before the first successful local run: feat: support agent skills for context-aware review guidance\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: feat: support agent skills for context-aware review guidance. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_6fae5a58920d170992e268f4837b86a9 | https://github.com/The-PR-Agent/pr-agent/issues/2384 | feat: support agent skills for context-aware review guidance\n\n## 8. installation · 失败模式：installation: v0.35.0\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this installation risk before relying on the project: v0.35.0\n- User impact: Upgrade or migration may change expected behavior: v0.35.0\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: v0.35.0. Context: Observed when using python, docker, windows\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_release | fmev_c8b7b30719c4160c5c0104029f83e764 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.35.0 | v0.35.0\n\n## 9. installation · 来源证据：CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_befb1a7b72d44beba27f8ffc0e2646ca | https://github.com/The-PR-Agent/pr-agent/issues/2223 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 10. installation · 来源证据：Publish linux/arm64 Docker image for github_app tag\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Publish linux/arm64 Docker image for github_app tag\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8cb9e552d2e2452cbe958628f6e800b6 | https://github.com/The-PR-Agent/pr-agent/issues/2386 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 11. installation · 来源证据：[Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：[Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_52bd470b7b5e4be6858b290e41c93036 | https://github.com/The-PR-Agent/pr-agent/issues/2380 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 12. installation · 来源证据：[Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：[Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n- User impact: 可能影响升级、迁移或版本选择。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_14856949ca534836a7f707e2c1333b17 | https://github.com/The-PR-Agent/pr-agent/issues/2400 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 13. installation · 来源证据：v0.34.2\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v0.34.2\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_4bc22335937e44c0b529ab84d1e69a60 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.34.2 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 14. configuration · 失败模式：configuration: /improve on GitLab duplicates the persistent suggestions thread on every push once the previo...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n- User impact: Developers may misconfigure credentials, environment, or host setup: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_f4643954c8dbe2f730d31cefbeaa8c78 | https://github.com/The-PR-Agent/pr-agent/issues/2402 | /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n\n## 15. configuration · 失败模式：configuration: Allow specifying a custom branch for locating `.pr_agent.toml`\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: Allow specifying a custom branch for locating `.pr_agent.toml`\n- User impact: Developers may misconfigure credentials, environment, or host setup: Allow specifying a custom branch for locating `.pr_agent.toml`\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Allow specifying a custom branch for locating `.pr_agent.toml`. Context: Source discussion did not expose a precise runtime context.\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_339ee91f6568996765e72eae51a899dd | https://github.com/The-PR-Agent/pr-agent/issues/1977 | Allow specifying a custom branch for locating `.pr_agent.toml`\n\n## 16. configuration · 失败模式：configuration: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_a...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n- User impact: Developers may misconfigure credentials, environment, or host setup: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_08e02634b8266f9592093717f3fcb5ac | https://github.com/The-PR-Agent/pr-agent/issues/2376 | AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n\n## 17. configuration · 失败模式：configuration: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n- User impact: Developers may misconfigure credentials, environment, or host setup: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF. Context: Observed when using python, docker, linux\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_683820f79c6410463ae03829a7e5eb54 | https://github.com/The-PR-Agent/pr-agent/issues/2223 | CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n\n## 18. configuration · 失败模式：configuration: GITLAB 404 project not found\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: GITLAB 404 project not found\n- User impact: Developers may misconfigure credentials, environment, or host setup: GITLAB 404 project not found\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: GITLAB 404 project not found. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_b2e82742d50cf2a8c0c2c182eb4f3928 | https://github.com/The-PR-Agent/pr-agent/issues/2282 | GITLAB 404 project not found\n\n## 19. configuration · 失败模式：configuration: Incorrect Inline Code Suggestion Formatting in Azure DevOps\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: Incorrect Inline Code Suggestion Formatting in Azure DevOps\n- User impact: Developers may misconfigure credentials, environment, or host setup: Incorrect Inline Code Suggestion Formatting in Azure DevOps\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Incorrect Inline Code Suggestion Formatting in Azure DevOps. Context: Observed when using python, docker, linux\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_abf700a9dc4cdcc58a9bdae1a8ee37c0 | https://github.com/The-PR-Agent/pr-agent/issues/2110 | Incorrect Inline Code Suggestion Formatting in Azure DevOps\n\n## 20. configuration · 失败模式：configuration: OSS build silently ignores best_practices.md (currently SaaS-only)\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: OSS build silently ignores best_practices.md (currently SaaS-only)\n- User impact: Developers may misconfigure credentials, environment, or host setup: OSS build silently ignores best_practices.md (currently SaaS-only)\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: OSS build silently ignores best_practices.md (currently SaaS-only). Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_6490ac18c4cc673d33dcc567f7b6f466 | https://github.com/The-PR-Agent/pr-agent/issues/2377 | OSS build silently ignores best_practices.md (currently SaaS-only)\n\n## 21. configuration · 失败模式：configuration: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filt...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n- User impact: Developers may misconfigure credentials, environment, or host setup: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering. Context: Observed when using docker\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_e66caf8bd4ddcbc747835f854317ef45 | https://github.com/The-PR-Agent/pr-agent/issues/2380 | [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n\n## 22. configuration · 失败模式：configuration: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n- User impact: Developers may misconfigure credentials, environment, or host setup: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic. Context: Observed when using python, docker\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_48f61c9074aaf84acadaada17c3514fa | https://github.com/The-PR-Agent/pr-agent/issues/2400 | [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n\n## 23. configuration · 失败模式：configuration: v0.33\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: v0.33\n- User impact: Upgrade or migration may change expected behavior: v0.33\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: v0.33. Context: Source discussion did not expose a precise runtime context.\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_release | fmev_3a2819a8993abeddf308dd2a4c20c5d1 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.33 | v0.33\n\n## 24. configuration · 失败模式：configuration: v0.34\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: v0.34\n- User impact: Upgrade or migration may change expected behavior: v0.34\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: v0.34. Context: Source discussion did not expose a precise runtime context.\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_release | fmev_57bd9625e730f20342967abef2739c49 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.34 | v0.34\n\n## 25. configuration · 来源证据：AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_4ee2a84ba307469b9b329a043a70a224 | https://github.com/The-PR-Agent/pr-agent/issues/2376 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 26. configuration · 来源证据：Ticket context not scoped per PR in long-lived deployments — stale tickets leak between unrelated PRs\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Ticket context not scoped per PR in long-lived deployments — stale tickets leak between unrelated PRs\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_a9b90b0cfbbf4529b60d65f564f4592e | https://github.com/The-PR-Agent/pr-agent/issues/2383 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 27. capability · 能力判断依赖假设\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: README/documentation is current enough for a first validation pass.\n- User impact: 假设不成立时，用户拿不到承诺的能力。\n- Suggested check: 将假设转成下游验证清单。\n- Guardrail action: 假设必须转成验证项；没有验证结果前不能写成事实。\n- Evidence: capability.assumptions | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | README/documentation is current enough for a first validation pass.\n\n## 28. runtime · 失败模式：runtime: Publish linux/arm64 Docker image for github_app tag\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this runtime risk before relying on the project: Publish linux/arm64 Docker image for github_app tag\n- User impact: Developers may hit a documented source-backed failure mode: Publish linux/arm64 Docker image for github_app tag\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Publish linux/arm64 Docker image for github_app tag. Context: Observed when using python, docker, linux\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_0fdc283afd24a3b8b85d15520113c789 | https://github.com/The-PR-Agent/pr-agent/issues/2386 | Publish linux/arm64 Docker image for github_app tag, failure_mode_cluster:github_issue | fmev_5d0d8e693d605019991cbe932edb560a | https://github.com/The-PR-Agent/pr-agent/issues/2386 | Publish linux/arm64 Docker image for github_app tag\n\n## 29. maintenance · 维护活跃度未知\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: 未记录 last_activity_observed。\n- User impact: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- Suggested check: 补 GitHub 最近 commit、release、issue/PR 响应信号。\n- Guardrail action: 维护活跃度未知时，推荐强度不能标为高信任。\n- Evidence: evidence.maintainer_signals | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | last_activity_observed missing\n\n## 30. security_permissions · 下游验证发现风险项\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 下游已经要求复核，不能在页面中弱化。\n- Suggested check: 进入安全/权限治理复核队列。\n- Guardrail action: 下游风险存在时必须保持 review/recommendation 降级。\n- Evidence: downstream_validation.risk_items | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | no_demo; severity=medium\n\n## 31. security_permissions · 存在评分风险\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 风险会影响是否适合普通用户安装。\n- Suggested check: 把风险写入边界卡，并确认是否需要人工复核。\n- Guardrail action: 评分风险必须进入边界卡，不能只作为内部分数。\n- Evidence: risks.scoring_risks | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | no_demo; severity=medium\n\n## 32. security_permissions · 来源证据：/improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：/improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8bf58f5468884b5eab533349076803f3 | https://github.com/The-PR-Agent/pr-agent/issues/2402 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 33. security_permissions · 来源证据：Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_e65762126ba84855a8440bd9e5a685bb | https://github.com/The-PR-Agent/pr-agent/issues/2379 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 34. security_permissions · 来源证据：OSS build silently ignores best_practices.md (currently SaaS-only)\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：OSS build silently ignores best_practices.md (currently SaaS-only)\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_f51f28cf40b14b7ca80598af4527661a | https://github.com/The-PR-Agent/pr-agent/issues/2377 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 35. security_permissions · 来源证据：feat: support agent skills for context-aware review guidance\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：feat: support agent skills for context-aware review guidance\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_59ad4ca55ca248f989c91ce40068cc6d | https://github.com/The-PR-Agent/pr-agent/issues/2384 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 36. security_permissions · 来源证据：litellm success/cost callbacks never fire from pr-agent's async run loop\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：litellm success/cost callbacks never fire from pr-agent's async run loop\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_42f0b36e0c434c939c49c91fc7ccb82a | https://github.com/The-PR-Agent/pr-agent/issues/2378 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 37. maintenance · issue/PR 响应质量未知\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: issue_or_pr_quality=unknown。\n- User impact: 用户无法判断遇到问题后是否有人维护。\n- Suggested check: 抽样最近 issue/PR，判断是否长期无人处理。\n- Guardrail action: issue/PR 响应未知时，必须提示维护风险。\n- Evidence: evidence.maintainer_signals | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | issue_or_pr_quality=unknown\n\n## 38. maintenance · 发布节奏不明确\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: release_recency=unknown。\n- User impact: 安装命令和文档可能落后于代码，用户踩坑概率升高。\n- Suggested check: 确认最近 release/tag 和 README 安装命令是否一致。\n- Guardrail action: 发布节奏未知或过期时，安装说明必须标注可能漂移。\n- Evidence: evidence.maintainer_signals | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | release_recency=unknown\n\n<!-- canonical_name: The-PR-Agent/pr-agent; human_manual_source: deepwiki_human_wiki -->\n",
      "markdown_key": "pr-agent",
      "pages": "draft",
      "source_refs": [
        {
          "evidence_id": "github_repo:662766482",
          "kind": "repo",
          "supports_claim_ids": [
            "claim_identity",
            "claim_distribution",
            "claim_capability"
          ],
          "url": "https://github.com/The-PR-Agent/pr-agent"
        },
        {
          "evidence_id": "art_a8e355bcac8a4fbabe2b4be3d781cac3",
          "kind": "docs",
          "supports_claim_ids": [
            "claim_identity",
            "claim_distribution",
            "claim_capability"
          ],
          "url": "https://github.com/The-PR-Agent/pr-agent#readme"
        }
      ],
      "summary": "DeepWiki/Human Wiki output with a Doramagic pitfall appendix.",
      "title": "pr-agent 说明书",
      "toc": [
        "https://github.com/The-PR-Agent/pr-agent 项目说明书",
        "目录",
        "Introduction to PR-Agent",
        "Overview",
        "Architecture",
        "Available Tools",
        "Output Format",
        "Configuration",
        "Doramagic 踩坑日志"
      ]
    }
  },
  "quality_gate": {
    "blocking_gaps": [],
    "category_confidence": "medium",
    "compile_status": "ready_for_review",
    "five_assets_present": true,
    "install_sandbox_verified": true,
    "missing_evidence": [],
    "next_action": "publish to Doramagic.ai project surfaces",
    "prompt_preview_boundary_ok": true,
    "publish_status": "publishable",
    "quick_start_verified": true,
    "repo_clone_verified": true,
    "repo_commit": "e6ef3c0adfbe1c5ffc6818f8dd420c74c8dc6ea8",
    "repo_inspection_error": null,
    "repo_inspection_files": [
      "pyproject.toml",
      "README.md",
      "requirements.txt",
      "docs/mkdocs.yml",
      "docs/README.md",
      "docs/docs/summary.md",
      "docs/docs/index.md",
      "docs/docs/.gitbook.yaml",
      "docs/docs/installation/index.md",
      "docs/docs/installation/pr_agent.md",
      "docs/docs/installation/gitlab.md",
      "docs/docs/installation/azure.md",
      "docs/docs/installation/bitbucket.md",
      "docs/docs/installation/github.md",
      "docs/docs/installation/gitea.md",
      "docs/docs/installation/locally.md",
      "docs/docs/usage-guide/index.md",
      "docs/docs/usage-guide/EXAMPLE_BEST_PRACTICE.md",
      "docs/docs/usage-guide/changing_a_model.md",
      "docs/docs/usage-guide/introduction.md",
      "docs/docs/usage-guide/configuration_options.md",
      "docs/docs/usage-guide/mail_notifications.md",
      "docs/docs/usage-guide/automations_and_usage.md",
      "docs/docs/usage-guide/additional_configurations.md",
      "docs/docs/overview/data_privacy.md",
      "docs/docs/core-abilities/compression_strategy.md",
      "docs/docs/core-abilities/index.md",
      "docs/docs/core-abilities/fetching_ticket_context.md",
      "docs/docs/core-abilities/interactivity.md",
      "docs/docs/core-abilities/self_reflection.md",
      "docs/docs/core-abilities/dynamic_context.md",
      "docs/docs/core-abilities/metadata.md",
      "docs/docs/tools/add_docs.md",
      "docs/docs/tools/generate_labels.md",
      "docs/docs/tools/describe.md",
      "docs/docs/tools/review.md",
      "docs/docs/tools/index.md",
      "docs/docs/tools/similar_issues.md",
      "docs/docs/tools/improve.md",
      "docs/docs/tools/update_changelog.md"
    ],
    "repo_inspection_verified": true,
    "review_reasons": [],
    "tag_count_ok": true,
    "unsupported_claims": []
  },
  "schema_version": "0.1",
  "user_assets": {
    "ai_context_pack": {
      "asset_id": "ai_context_pack",
      "filename": "AI_CONTEXT_PACK.md",
      "markdown": "# pr-agent - Doramagic AI Context Pack\n\n> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。\n\n## 充分原则\n\n- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。\n- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。\n\n## 给宿主 AI 的使用方式\n\n你正在读取 Doramagic 为 pr-agent 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。\n\n## Claim 消费规则\n\n- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。\n- **事实最低状态**：`supported`\n- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。\n- `weak`：只能作为低置信度线索，必须要求用户继续核实。\n- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。\n- `unverified`：不得作为事实使用，应明确说证据不足。\n- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。\n\n## 它最适合谁\n\n- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0002` supported 0.86\n\n## 它能做什么\n\n- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0001` supported 0.86\n\n## 怎么开始\n\n- `pip install pr-agent` 证据：`README.md` Claim：`clm_0003` supported 0.86\n\n## 继续前判断卡\n\n- **当前建议**：需要管理员/安全审批\n- **为什么**：继续前可能涉及密钥、账号、外部服务或敏感上下文，建议先经过管理员或安全审批。\n\n### 30 秒判断\n\n- **现在怎么做**：需要管理员/安全审批\n- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装\n- **先别相信**：角色质量和任务匹配不能直接相信。\n- **继续会触碰**：角色选择偏差、命令执行、宿主 AI 配置\n\n### 现在可以相信\n\n- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0002` supported 0.86\n- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86\n- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0003` supported 0.86\n\n### 现在还不能相信\n\n- **角色质量和任务匹配不能直接相信。**（unverified）：角色库证明有很多角色，不证明每个角色都适合你的具体任务，也不证明角色能产生高质量结果。\n- **不能把角色文案当成真实执行能力。**（unverified）：安装前只能判断角色描述和任务画像是否匹配，不能证明它能在宿主 AI 里完成任务。\n- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。\n- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。\n- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`AGENTS.md`\n- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。\n- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。\n- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。\n\n### 继续会触碰什么\n\n- **角色选择偏差**：用户对任务应该由哪个专家角色处理的判断。 原因：选错角色会让 AI 从错误专业视角回答，浪费时间或误导决策。\n- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`\n- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`AGENTS.md`\n- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`\n- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`README.md`, `docs/docs/installation/github.md`, `docs/docs/tools/help_docs.md`, `docs/docs/usage-guide/automations_and_usage.md` 等\n- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。\n\n### 最小安全下一步\n\n- **先跑 Prompt Preview**：先用交互式试用验证任务画像和角色匹配，不要先导入整套角色库。（适用：任何项目都适用，尤其是输出质量未知时。）\n- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）\n- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）\n- **不要使用真实生产凭证**：环境变量/API key 一旦进入宿主或工具链，可能产生账号和合规风险。（适用：出现 API、TOKEN、KEY、SECRET 等环境线索时。）\n- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）\n\n### 退出方式\n\n- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。\n- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。\n- **保留原始角色选择记录**：如果输出偏题，可以回到任务画像阶段重新选择角色，而不是继续沿着错误角色推进。\n- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。\n- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。\n- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。\n\n## 哪些只能预览\n\n- 解释项目适合谁和能做什么\n- 基于项目文档演示典型对话流程\n- 帮助用户判断是否值得安装或继续研究\n\n## 哪些必须安装后验证\n\n- 真实安装 Skill、插件或 CLI\n- 执行脚本、修改本地文件或访问外部服务\n- 验证真实输出质量、性能和兼容性\n\n## 边界与风险判断卡\n\n- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0004` inferred 0.45\n- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0005` supported 0.86\n- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。\n- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。\n- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。\n\n## 开工前工作上下文\n\n### 加载顺序\n\n- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。\n- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。\n- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。\n- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。\n- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。\n\n### 任务路由\n\n- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86\n\n### 上下文规模\n\n- 文件总数：236\n- 重要文件覆盖：40/236\n- 证据索引条目：73\n- 角色 / Skill 条目：46\n\n### 证据不足时的处理\n\n- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。\n- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。\n- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。\n- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。\n\n## Prompt Recipes\n\n### 适配判断\n\n- 目标：判断这个项目是否适合用户当前任务。\n- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。\n\n```text\n请基于 pr-agent 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。\n```\n\n### 安装前体验\n\n- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。\n- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。\n\n```text\n请把 pr-agent 当作安装前体验资产，而不是已安装工具或真实运行环境。\n\n请严格输出四段：\n1. 先问我 3 个必要问题。\n2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。\n3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。\n4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。\n\n硬性边界：\n- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。\n- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。\n- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。\n- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。\n- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。\n- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。\n\n```\n\n### 角色 / Skill 选择\n\n- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。\n- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。\n\n```text\n请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。\n```\n\n### 风险预检\n\n- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。\n- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。\n\n```text\n请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。\n```\n\n### 宿主 AI 开工指令\n\n- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。\n- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。\n\n```text\n请基于 pr-agent 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。\n```\n\n\n## 角色 / Skill 索引\n\n- 共索引 46 个角色 / Skill / 项目文档条目。\n\n- **Visit Our Docs Portal https://qodo-merge-docs.qodo.ai/**（project_doc）：Visit Our Docs Portal https://qodo-merge-docs.qodo.ai/ 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/README.md`\n- **Repository Guidelines**（project_doc）：- Do match the interpreter requirement declared in pyproject.toml Python ≥ 3.12 and install requirements.txt plus requirements-dev.txt before running tools. - Do run tests with PYTHONPATH=. set to keep imports functional for example PYTHONPATH=. ./.venv/bin/pytest tests/unittest/test fix json escape char.py -q . - Do adjust configuration through .pr agent.toml or files under pr agent/settings/ instead of hard-coding… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`AGENTS.md`\n- **Big News for PR-Agent**（project_doc）：The Original Open-Source PR Reviewer 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`\n- **Contributing to PR-Agent**（project_doc）：Thank you for your interest in contributing to the PR-Agent project! 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CONTRIBUTING.md`\n- **Overview**（project_doc）：Supported Git Platforms: GitHub, GitLab, Bitbucket 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/core-abilities/compression_strategy.md`\n- **Introduction**（project_doc）：Supported Git Platforms: GitHub, GitLab, Bitbucket 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/core-abilities/dynamic_context.md`\n- **Fetching Ticket Context for PRs**（project_doc）：Supported Git Platforms: GitHub, GitLab, Bitbucket 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/core-abilities/fetching_ticket_context.md`\n- **Core Abilities**（project_doc）：PR-Agent utilizes a variety of core abilities to provide a comprehensive and efficient code review experience. These abilities include: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/core-abilities/index.md`\n- **Interactivity**（project_doc）：Supported Git Platforms: GitHub, GitLab 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/core-abilities/interactivity.md`\n- **Local and global metadata injection with multi-stage analysis**（project_doc）：Local and global metadata injection with multi-stage analysis 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/core-abilities/metadata.md`\n- **Introduction - Efficient Review with Hierarchical Presentation**（project_doc）：Supported Git Platforms: GitHub, GitLab, Bitbucket 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/core-abilities/self_reflection.md`\n- **FAQ**（project_doc）：??? note \"Q: Can PR-Agent serve as a substitute for a human reviewer?\" Answer: 1 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/faq/index.md`\n- **Overview**（project_doc）：PR-Agent https://github.com/the-pr-agent/pr-agent is an open-source, AI-powered code review agent and a community-maintained legacy project of Qodo. It is distinct from Qodo's primary AI code review offering, which provides a feature-rich, context-aware experience. Qodo now offers a free tier that integrates seamlessly with GitHub, GitLab, Bitbucket, and Azure DevOps for high-quality automated reviews. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/index.md`\n- **Azure DevOps Pipeline**（project_doc）：You can use a pre-built Action Docker image to run PR-Agent as an Azure DevOps pipeline. Add the following file to your repository under azure-pipelines.yml : 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/installation/azure.md`\n- **Run as a Bitbucket Pipeline**（project_doc）：You can use the Bitbucket Pipeline system to run PR-Agent on every pull request open or update. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/installation/bitbucket.md`\n- **Run a Gitea webhook server**（project_doc）：1. In Gitea create a new user and give it \"Reporter\" role for the intended group or project. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/installation/gitea.md`\n- **Run as a GitHub Action**（project_doc）：In this page we will cover how to install and run PR-Agent as a GitHub Action or GitHub App, and how to configure it for your needs. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/installation/github.md`\n- **Run as a GitLab Pipeline**（project_doc）：You can use a pre-built Action Docker image to run PR-Agent as a GitLab pipeline. This is a simple way to get started with PR-Agent without setting up your own server. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/installation/gitlab.md`\n- **Installation**（project_doc）：There are several ways to use PR-Agent: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/installation/index.md`\n- **Using Docker image**（project_doc）：To run PR-Agent locally, you first need to acquire two keys: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/installation/locally.md`\n- **PR-Agent Installation Guide**（project_doc）：PR-Agent can be deployed in various environments and platforms. Choose the installation method that best suits your needs: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/installation/pr_agent.md`\n- **Self-hosted PR-Agent**（project_doc）：- If you self-host PR-Agent with your OpenAI or other LLM provider API key, it is between you and the provider. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/overview/data_privacy.md`\n- **Table of contents**（project_doc）：Overview index.md Data Privacy overview/data privacy.md 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/summary.md`\n- **Overview**（project_doc）：The add docs tool scans the PR code changes and suggests documentation for any code components that are missing documentation, such as functions, classes, and methods. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/add_docs.md`\n- **Overview**（project_doc）：The ask tool answers questions about the PR, based on the PR code changes. Make sure to be specific and clear in your questions. It can be invoked manually by commenting on any PR: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/ask.md`\n- **Overview**（project_doc）：The describe tool scans the PR code changes, and generates a description for the PR - title, type, summary, walkthrough and labels. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/describe.md`\n- **Overview**（project_doc）：The generate labels tool scans the PR code changes and generates custom labels for the PR based on the content and context of the changes. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/generate_labels.md`\n- **Overview**（project_doc）：The help tool provides a list of all the available tools and their descriptions. For PR-Agent users, it also enables to trigger each tool by checking the relevant box. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/help.md`\n- **Overview**（project_doc）：The help docs tool can answer a free-text question based on a git documentation folder. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/help_docs.md`\n- **Overview**（project_doc）：The improve tool scans the PR code changes, and automatically generates meaningful suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened ../usage-guide/automations and usage.md github-app-automatic-tools-when-a-new-pr-is-opened , or it can be invoked manually by commenting on any PR: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/improve.md`\n- **Tools**（project_doc）：Here is a list of PR-Agent tools, each with a dedicated page that explains how to use it: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/index.md`\n- **Overview**（project_doc）：The review tool scans the PR code changes, and generates feedback about the PR, aiming to aid the reviewing process. The tool can be triggered automatically every time a new PR is opened ../usage-guide/automations and usage.md github-app-automatic-tools-when-a-new-pr-is-opened , or can be invoked manually by commenting on any PR: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/review.md`\n- **Overview**（project_doc）：The similar issue tool retrieves the most similar issues to the current issue. It can be invoked manually by commenting on any PR: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/similar_issues.md`\n- **Overview**（project_doc）：The update changelog tool automatically updates the CHANGELOG.md file with the PR changes. It can be invoked manually by commenting on any PR: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/tools/update_changelog.md`\n- **Recommend Python Best Practices**（project_doc）：This document outlines a series of recommended best practices for Python development. These guidelines aim to improve code quality, maintainability, and readability. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/usage-guide/EXAMPLE_BEST_PRACTICE.md`\n- **Show possible configurations**（project_doc）：The possible configurations of PR-Agent are stored in here https://github.com/the-pr-agent/pr-agent/blob/main/pr agent/settings/configuration.toml {:target=\" blank\"}. In the tools ../tools/index.md page you can find explanations on how to use these configurations for each tool. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/usage-guide/additional_configurations.md`\n- **Local repo CLI**（project_doc）：When running from your locally cloned PR-Agent repo CLI , your local configuration file will be used. Examples of invoking the different tools via the CLI: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/usage-guide/automations_and_usage.md`\n- **Changing a model in PR-Agent**（project_doc）：See here https://github.com/the-pr-agent/pr-agent/blob/main/pr agent/algo/ init .py for a list of supported models in PR-Agent. The default model of PR-Agent is GPT-5 from OpenAI. To use a different model than the default, you need to edit in the configuration file https://github.com/the-pr-agent/pr-agent/blob/main/pr agent/settings/configuration.toml L7 the fields: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/usage-guide/changing_a_model.md`\n- **Wiki configuration file**（project_doc）：The different tools and sub-tools used by PR-Agent are adjustable via a Git configuration file. There are three main ways to set persistent configurations: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/usage-guide/configuration_options.md`\n- **Usage guide**（project_doc）：This section provides a detailed guide on how to use PR-Agent. It includes information on how to adjust PR-Agent configurations, define which tools will run automatically, and other advanced configurations. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/usage-guide/index.md`\n- **Introduction**（project_doc）：After installation ../installation/index.md , there are three basic ways to invoke PR-Agent: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/usage-guide/introduction.md`\n- **Mail Notifications**（project_doc）：Unfortunately, it is not possible in GitHub to disable mail notifications from a specific user. If you are subscribed to notifications for a repo with PR-Agent, we recommend turning off notifications for PR comments, to avoid lengthy emails: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/docs/usage-guide/mail_notifications.md`\n- **2023-08-03**（project_doc）：- Optimized PR diff processing by introducing caching for diff files, reducing the number of API calls. - Refactored load large diff function to generate a patch only when necessary. - Fixed a bug in the GitLab provider where the new file was not retrieved correctly. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CHANGELOG.md`\n- **Contributor Code of Conduct**（project_doc）：As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CODE_OF_CONDUCT.md`\n- **Version 0.11 - 2023-12-07**（project_doc）：- codiumai/pr-agent:0.11 - codiumai/pr-agent:0.11-github app - codiumai/pr-agent:0.11-bitbucket-app - codiumai/pr-agent:0.11-gitlab webhook - codiumai/pr-agent:0.11-github polling - codiumai/pr-agent:0.11-github action 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`RELEASE_NOTES.md`\n- **Security Policy**（project_doc）：PR-Agent is an open-source tool to help efficiently review and handle pull requests. Qodo Merge is a paid version of PR-Agent, designed for companies and teams that require additional features and capabilities. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`SECURITY.md`\n\n## 证据索引\n\n- 共索引 73 条证据。\n\n- **Visit Our Docs Portal https://qodo-merge-docs.qodo.ai/**（documentation）：Visit Our Docs Portal https://qodo-merge-docs.qodo.ai/ 证据：`docs/README.md`\n- **Repository Guidelines**（documentation）：- Do match the interpreter requirement declared in pyproject.toml Python ≥ 3.12 and install requirements.txt plus requirements-dev.txt before running tools. - Do run tests with PYTHONPATH=. set to keep imports functional for example PYTHONPATH=. ./.venv/bin/pytest tests/unittest/test fix json escape char.py -q . - Do adjust configuration through .pr agent.toml or files under pr agent/settings/ instead of hard-coding values. - Don’t commit secrets or access tokens; rely on environment variables as shown in the health and e2e tests. - Don’t reformat or reorder files globally; match existing 120-character lines, import ordering, and docstring style. - Don’t delete or rename configuration, prom… 证据：`AGENTS.md`\n- **Big News for PR-Agent**（documentation）：The Original Open-Source PR Reviewer 证据：`README.md`\n- **Contributing to PR-Agent**（documentation）：Thank you for your interest in contributing to the PR-Agent project! 证据：`CONTRIBUTING.md`\n- **License**（source_file）：GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 证据：`LICENSE`\n- **Overview**（documentation）：Supported Git Platforms: GitHub, GitLab, Bitbucket 证据：`docs/docs/core-abilities/compression_strategy.md`\n- **Introduction**（documentation）：Supported Git Platforms: GitHub, GitLab, Bitbucket 证据：`docs/docs/core-abilities/dynamic_context.md`\n- **Fetching Ticket Context for PRs**（documentation）：Supported Git Platforms: GitHub, GitLab, Bitbucket 证据：`docs/docs/core-abilities/fetching_ticket_context.md`\n- **Core Abilities**（documentation）：PR-Agent utilizes a variety of core abilities to provide a comprehensive and efficient code review experience. These abilities include: 证据：`docs/docs/core-abilities/index.md`\n- **Interactivity**（documentation）：Supported Git Platforms: GitHub, GitLab 证据：`docs/docs/core-abilities/interactivity.md`\n- **Local and global metadata injection with multi-stage analysis**（documentation）：Local and global metadata injection with multi-stage analysis 证据：`docs/docs/core-abilities/metadata.md`\n- **Introduction - Efficient Review with Hierarchical Presentation**（documentation）：Supported Git Platforms: GitHub, GitLab, Bitbucket 证据：`docs/docs/core-abilities/self_reflection.md`\n- **FAQ**（documentation）：??? note \"Q: Can PR-Agent serve as a substitute for a human reviewer?\" Answer: 1 证据：`docs/docs/faq/index.md`\n- **Overview**（documentation）：PR-Agent https://github.com/the-pr-agent/pr-agent is an open-source, AI-powered code review agent and a community-maintained legacy project of Qodo. It is distinct from Qodo's primary AI code review offering, which provides a feature-rich, context-aware experience. Qodo now offers a free tier that integrates seamlessly with GitHub, GitLab, Bitbucket, and Azure DevOps for high-quality automated reviews. 证据：`docs/docs/index.md`\n- **Azure DevOps Pipeline**（documentation）：You can use a pre-built Action Docker image to run PR-Agent as an Azure DevOps pipeline. Add the following file to your repository under azure-pipelines.yml : 证据：`docs/docs/installation/azure.md`\n- **Run as a Bitbucket Pipeline**（documentation）：You can use the Bitbucket Pipeline system to run PR-Agent on every pull request open or update. 证据：`docs/docs/installation/bitbucket.md`\n- **Run a Gitea webhook server**（documentation）：1. In Gitea create a new user and give it \"Reporter\" role for the intended group or project. 证据：`docs/docs/installation/gitea.md`\n- **Run as a GitHub Action**（documentation）：In this page we will cover how to install and run PR-Agent as a GitHub Action or GitHub App, and how to configure it for your needs. 证据：`docs/docs/installation/github.md`\n- **Run as a GitLab Pipeline**（documentation）：You can use a pre-built Action Docker image to run PR-Agent as a GitLab pipeline. This is a simple way to get started with PR-Agent without setting up your own server. 证据：`docs/docs/installation/gitlab.md`\n- **Installation**（documentation）：There are several ways to use PR-Agent: 证据：`docs/docs/installation/index.md`\n- **Using Docker image**（documentation）：To run PR-Agent locally, you first need to acquire two keys: 证据：`docs/docs/installation/locally.md`\n- **PR-Agent Installation Guide**（documentation）：PR-Agent can be deployed in various environments and platforms. Choose the installation method that best suits your needs: 证据：`docs/docs/installation/pr_agent.md`\n- **Self-hosted PR-Agent**（documentation）：- If you self-host PR-Agent with your OpenAI or other LLM provider API key, it is between you and the provider. 证据：`docs/docs/overview/data_privacy.md`\n- **Table of contents**（documentation）：Overview index.md Data Privacy overview/data privacy.md 证据：`docs/docs/summary.md`\n- **Overview**（documentation）：The add docs tool scans the PR code changes and suggests documentation for any code components that are missing documentation, such as functions, classes, and methods. 证据：`docs/docs/tools/add_docs.md`\n- **Overview**（documentation）：The ask tool answers questions about the PR, based on the PR code changes. Make sure to be specific and clear in your questions. It can be invoked manually by commenting on any PR: 证据：`docs/docs/tools/ask.md`\n- **Overview**（documentation）：The describe tool scans the PR code changes, and generates a description for the PR - title, type, summary, walkthrough and labels. 证据：`docs/docs/tools/describe.md`\n- **Overview**（documentation）：The generate labels tool scans the PR code changes and generates custom labels for the PR based on the content and context of the changes. 证据：`docs/docs/tools/generate_labels.md`\n- **Overview**（documentation）：The help tool provides a list of all the available tools and their descriptions. For PR-Agent users, it also enables to trigger each tool by checking the relevant box. 证据：`docs/docs/tools/help.md`\n- **Overview**（documentation）：The help docs tool can answer a free-text question based on a git documentation folder. 证据：`docs/docs/tools/help_docs.md`\n- **Overview**（documentation）：The improve tool scans the PR code changes, and automatically generates meaningful suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened ../usage-guide/automations and usage.md github-app-automatic-tools-when-a-new-pr-is-opened , or it can be invoked manually by commenting on any PR: 证据：`docs/docs/tools/improve.md`\n- **Tools**（documentation）：Here is a list of PR-Agent tools, each with a dedicated page that explains how to use it: 证据：`docs/docs/tools/index.md`\n- **Overview**（documentation）：The review tool scans the PR code changes, and generates feedback about the PR, aiming to aid the reviewing process. The tool can be triggered automatically every time a new PR is opened ../usage-guide/automations and usage.md github-app-automatic-tools-when-a-new-pr-is-opened , or can be invoked manually by commenting on any PR: 证据：`docs/docs/tools/review.md`\n- **Overview**（documentation）：The similar issue tool retrieves the most similar issues to the current issue. It can be invoked manually by commenting on any PR: 证据：`docs/docs/tools/similar_issues.md`\n- **Overview**（documentation）：The update changelog tool automatically updates the CHANGELOG.md file with the PR changes. It can be invoked manually by commenting on any PR: 证据：`docs/docs/tools/update_changelog.md`\n- **Recommend Python Best Practices**（documentation）：This document outlines a series of recommended best practices for Python development. These guidelines aim to improve code quality, maintainability, and readability. 证据：`docs/docs/usage-guide/EXAMPLE_BEST_PRACTICE.md`\n- **Show possible configurations**（documentation）：The possible configurations of PR-Agent are stored in here https://github.com/the-pr-agent/pr-agent/blob/main/pr agent/settings/configuration.toml {:target=\" blank\"}. In the tools ../tools/index.md page you can find explanations on how to use these configurations for each tool. 证据：`docs/docs/usage-guide/additional_configurations.md`\n- **Local repo CLI**（documentation）：When running from your locally cloned PR-Agent repo CLI , your local configuration file will be used. Examples of invoking the different tools via the CLI: 证据：`docs/docs/usage-guide/automations_and_usage.md`\n- **Changing a model in PR-Agent**（documentation）：See here https://github.com/the-pr-agent/pr-agent/blob/main/pr agent/algo/ init .py for a list of supported models in PR-Agent. The default model of PR-Agent is GPT-5 from OpenAI. To use a different model than the default, you need to edit in the configuration file https://github.com/the-pr-agent/pr-agent/blob/main/pr agent/settings/configuration.toml L7 the fields: 证据：`docs/docs/usage-guide/changing_a_model.md`\n- **Wiki configuration file**（documentation）：The different tools and sub-tools used by PR-Agent are adjustable via a Git configuration file. There are three main ways to set persistent configurations: 证据：`docs/docs/usage-guide/configuration_options.md`\n- **Usage guide**（documentation）：This section provides a detailed guide on how to use PR-Agent. It includes information on how to adjust PR-Agent configurations, define which tools will run automatically, and other advanced configurations. 证据：`docs/docs/usage-guide/index.md`\n- **Introduction**（documentation）：After installation ../installation/index.md , there are three basic ways to invoke PR-Agent: 证据：`docs/docs/usage-guide/introduction.md`\n- **Mail Notifications**（documentation）：Unfortunately, it is not possible in GitHub to disable mail notifications from a specific user. If you are subscribed to notifications for a repo with PR-Agent, we recommend turning off notifications for PR comments, to avoid lengthy emails: 证据：`docs/docs/usage-guide/mail_notifications.md`\n- **2023-08-03**（documentation）：- Optimized PR diff processing by introducing caching for diff files, reducing the number of API calls. - Refactored load large diff function to generate a patch only when necessary. - Fixed a bug in the GitLab provider where the new file was not retrieved correctly. 证据：`CHANGELOG.md`\n- **Contributor Code of Conduct**（documentation）：As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 证据：`CODE_OF_CONDUCT.md`\n- **Version 0.11 - 2023-12-07**（documentation）：- codiumai/pr-agent:0.11 - codiumai/pr-agent:0.11-github app - codiumai/pr-agent:0.11-bitbucket-app - codiumai/pr-agent:0.11-gitlab webhook - codiumai/pr-agent:0.11-github polling - codiumai/pr-agent:0.11-github action 证据：`RELEASE_NOTES.md`\n- **Security Policy**（documentation）：PR-Agent is an open-source tool to help efficiently review and handle pull requests. Qodo Merge is a paid version of PR-Agent, designed for companies and teams that require additional features and capabilities. 证据：`SECURITY.md`\n- **Atlassian Connect Qodo Merge**（structured_config）：{ \"name\": \"Qodo Merge\", \"description\": \"Qodo Merge\", \"key\": \"app key\", \"vendor\": { \"name\": \"Qodo\", \"url\": \"https://qodo.ai\" }, \"authentication\": { \"type\": \"jwt\" }, \"baseUrl\": \"base url\", \"lifecycle\": { \"installed\": \"/installed\", \"uninstalled\": \"/uninstalled\" }, \"scopes\": \"account\", \"repository:write\", \"pullrequest:write\", \"wiki\" , \"contexts\": \"account\" , \"modules\": { \"webhooks\": { \"event\": \" \", \"url\": \"/webhook\" } }, \"links\": { \"privacy\": \"https://qodo.ai/privacy-policy\", \"terms\": \"https://qodo.ai/terms\" } } 证据：`pr_agent/servers/atlassian-connect-qodo-merge.json`\n- **Atlassian Connect**（structured_config）：{ \"name\": \"CodiumAI PR-Agent\", \"description\": \"CodiumAI PR-Agent\", \"key\": \"app key\", \"vendor\": { \"name\": \"CodiumAI\", \"url\": \"https://codium.ai\" }, \"authentication\": { \"type\": \"jwt\" }, \"baseUrl\": \"base url\", \"lifecycle\": { \"installed\": \"/installed\", \"uninstalled\": \"/uninstalled\" }, \"scopes\": \"account\", \"repository:write\", \"pullrequest:write\", \"wiki\" , \"contexts\": \"account\" , \"modules\": { \"webhooks\": { \"event\": \" \", \"url\": \"/webhook\" } }, \"links\": { \"privacy\": \"https://qodo.ai/privacy-policy\", \"terms\": \"https://qodo.ai/terms\" } } 证据：`pr_agent/servers/atlassian-connect.json`\n- **.dockerignore**（source_file）：.venv/ venv/ pr agent/settings/.secrets.toml pics/ pr agent.egg-info/ build/ 证据：`.dockerignore`\n- **What's Changed**（source_file）：name-template: 'v$RESOLVED VERSION' tag-template: 'v$RESOLVED VERSION' 证据：`.github/release-drafter.yml`\n- **.gitignore**（source_file）：.idea/ .lsp/ .vscode/ .env .venv/ venv/ pr agent/settings/.secrets.toml pycache dist/ .egg-info/ build/ .DS Store docs/.cache/ .qodo poetry.lock 证据：`.gitignore`\n- **.Pr Agent**（source_file）：pr reviewer enable review labels effort = true enable auto approval = true 证据：`.pr_agent.toml`\n- **See https://pre-commit.com for more information**（source_file）：See https://pre-commit.com for more information See https://pre-commit.com/hooks.html for more hooks 证据：`.pre-commit-config.yaml`\n- **Dockerfile**（source_file）：RUN apt-get update && apt-get install --no-install-recommends -y git curl && apt-get clean && rm -rf /var/lib/apt/lists/ 证据：`Dockerfile.github_action`\n- **Dockerfile**（source_file）：FROM pragent/pr-agent:github action 证据：`Dockerfile.github_action_dockerhub`\n- **Manifest**（source_file）：recursive-include pr agent .toml recursive-exclude pr agent .secrets.toml 证据：`MANIFEST.in`\n- **Action**（source_file）：name: 'The PR Agent' description: 'Summarize, review and suggest improvements for pull requests' branding: icon: 'award' color: 'green' runs: using: 'docker' image: 'Dockerfile.github action dockerhub' 证据：`action.yaml`\n- **Codecov**（source_file）：comment: false coverage: status: patch: false project: false 证据：`codecov.yml`\n- **Dockerfile**（source_file）：RUN apt update && apt install --no-install-recommends -y git curl && apt-get clean && rm -rf /var/lib/apt/lists/ 证据：`docker/Dockerfile`\n- 其余 13 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。\n\n## 宿主 AI 必须遵守的规则\n\n- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`docs/README.md`, `AGENTS.md`, `README.md`\n- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`docs/README.md`, `AGENTS.md`, `README.md`\n\n## 用户开工前应该回答的问题\n\n- 你准备在哪个宿主 AI 或本地环境中使用它？\n- 你只是想先体验工作流，还是准备真实安装？\n- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？\n\n## 验收标准\n\n- 所有能力声明都能回指到 evidence_refs 中的文件路径。\n- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。\n- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。\n\n---\n\n## Doramagic Context Augmentation\n\nThe following material strengthens the Repomix/AI Context Pack body. Human Manual is only a reading skeleton; pitfall logs become hard operating constraints for the host AI.\n\n## Human Manual Skeleton\n\nUsage rule: this is only a reading path and salience signal, not factual authority. Concrete facts must still come from repo evidence / Claim Graph.\n\nHard rules for the host AI:\n- Do not treat page titles, order, summaries, or importance as project facts.\n- When explaining the Human Manual skeleton, state that it is only a reading path / salience signal.\n- Capability, installation, compatibility, runtime status, and risk judgments must cite repo evidence, source paths, or Claim Graph.\n\n- **Introduction to PR-Agent**：importance `high`\n  - source_paths: README.md, pr_agent/agent/pr_agent.py, pr_agent/settings/configuration.toml\n- **Quick Start Guide**：importance `high`\n  - source_paths: action.yaml, docker/Dockerfile, pr_agent/cli.py, docs/docs/installation/github.md\n- **System Architecture**：importance `high`\n  - source_paths: pr_agent/agent/pr_agent.py, pr_agent/git_providers/__init__.py, pr_agent/tools/__init__.py, pr_agent/algo/types.py\n- **Git Providers System**：importance `high`\n  - source_paths: pr_agent/git_providers/__init__.py, pr_agent/git_providers/github_provider.py, pr_agent/git_providers/gitlab_provider.py, pr_agent/git_providers/bitbucket_provider.py, pr_agent/git_providers/azuredevops_provider.py\n- **Command-to-Tool Mapping**：importance `medium`\n  - source_paths: pr_agent/agent/pr_agent.py, pr_agent/cli.py, pr_agent/algo/cli_args.py\n- **Tools Overview**：importance `high`\n  - source_paths: pr_agent/tools/pr_description.py, pr_agent/tools/pr_reviewer.py, pr_agent/tools/pr_code_suggestions.py, pr_agent/tools/pr_questions.py, docs/docs/tools/index.md\n- **/describe Tool**：importance `high`\n  - source_paths: pr_agent/tools/pr_description.py, pr_agent/settings/pr_description_prompts.toml, docs/docs/tools/describe.md\n- **/review Tool**：importance `high`\n  - source_paths: pr_agent/tools/pr_reviewer.py, pr_agent/settings/pr_reviewer_prompts.toml, docs/docs/tools/review.md\n\n## Repo Inspection Evidence\n\n- repo_clone_verified: true\n- repo_inspection_verified: true\n- repo_commit: `e6ef3c0adfbe1c5ffc6818f8dd420c74c8dc6ea8`\n- inspected_files: `pyproject.toml`, `README.md`, `requirements.txt`, `docs/mkdocs.yml`, `docs/README.md`, `docs/docs/summary.md`, `docs/docs/index.md`, `docs/docs/.gitbook.yaml`, `docs/docs/installation/index.md`, `docs/docs/installation/pr_agent.md`, `docs/docs/installation/gitlab.md`, `docs/docs/installation/azure.md`, `docs/docs/installation/bitbucket.md`, `docs/docs/installation/github.md`, `docs/docs/installation/gitea.md`, `docs/docs/installation/locally.md`, `docs/docs/usage-guide/index.md`, `docs/docs/usage-guide/EXAMPLE_BEST_PRACTICE.md`, `docs/docs/usage-guide/changing_a_model.md`, `docs/docs/usage-guide/introduction.md`\n\nHard rules for the host AI:\n- Without repo_clone_verified=true, do not claim the source code has been read.\n- Without repo_inspection_verified=true, do not turn README/docs/package observations into facts.\n- Without quick_start_verified=true, do not claim the Quick Start has been successfully run.\n\n## Doramagic Pitfall Constraints\n\nThese rules come from Doramagic discovery, validation, or compilation pitfalls. The host AI must treat them as operating constraints, not general background notes.\n\n### Constraint 1: 来源证据：Allow specifying a custom branch for locating `.pr_agent.toml`\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Allow specifying a custom branch for locating `.pr_agent.toml`\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_6aa2027573564d778bdccf1c0e603a0f | https://github.com/The-PR-Agent/pr-agent/issues/1977 | 来源类型 github_issue 暴露的待验证使用条件。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 2: 失败模式：security_permissions: Add support for Databricks hosted models\n\n- Trigger: Developers should check this security_permissions risk before relying on the project: Add support for Databricks hosted models\n- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Add support for Databricks hosted models. Context: Observed when using python, docker\n- Why it matters: Developers may expose sensitive permissions or credentials: Add support for Databricks hosted models\n- Evidence: failure_mode_cluster:github_issue | fmev_63e7f7511bd7314419df2ded4a1a20e9 | https://github.com/The-PR-Agent/pr-agent/issues/2246 | Add support for Databricks hosted models\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 3: 来源证据：Add support for Databricks hosted models\n\n- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Add support for Databricks hosted models\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能影响授权、密钥配置或安全边界。\n- Evidence: community_evidence:github | cevd_6b5b4692165240e5a79137dc9335bd50 | https://github.com/The-PR-Agent/pr-agent/issues/2246 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 4: 来源证据：GITLAB 404 project not found\n\n- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：GITLAB 404 project not found\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能影响授权、密钥配置或安全边界。\n- Evidence: community_evidence:github | cevd_04774e9f24034b56b080d2af0875b7fd | https://github.com/The-PR-Agent/pr-agent/issues/2282 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 5: 来源证据：Incorrect Inline Code Suggestion Formatting in Azure DevOps\n\n- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Incorrect Inline Code Suggestion Formatting in Azure DevOps\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能影响升级、迁移或版本选择。\n- Evidence: community_evidence:github | cevd_d01349d41e8a48db89a80ebdb4ca9bde | https://github.com/The-PR-Agent/pr-agent/issues/2110 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 6: 失败模式：installation: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental supp...\n\n- Trigger: Developers should check this installation risk before relying on the project: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider. Context: Observed when using python\n- Why it matters: Developers may fail before the first successful local run: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- Evidence: failure_mode_cluster:github_issue | fmev_f812843570a304cde8d165f9bd42e8dc | https://github.com/The-PR-Agent/pr-agent/issues/2379 | Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 7: 失败模式：installation: feat: support agent skills for context-aware review guidance\n\n- Trigger: Developers should check this installation risk before relying on the project: feat: support agent skills for context-aware review guidance\n- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: feat: support agent skills for context-aware review guidance. Context: Observed when using python\n- Why it matters: Developers may fail before the first successful local run: feat: support agent skills for context-aware review guidance\n- Evidence: failure_mode_cluster:github_issue | fmev_6fae5a58920d170992e268f4837b86a9 | https://github.com/The-PR-Agent/pr-agent/issues/2384 | feat: support agent skills for context-aware review guidance\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 8: 失败模式：installation: v0.35.0\n\n- Trigger: Developers should check this installation risk before relying on the project: v0.35.0\n- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.35.0. Context: Observed when using python, docker, windows\n- Why it matters: Upgrade or migration may change expected behavior: v0.35.0\n- Evidence: failure_mode_cluster:github_release | fmev_c8b7b30719c4160c5c0104029f83e764 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.35.0 | v0.35.0\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 9: 来源证据：CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_befb1a7b72d44beba27f8ffc0e2646ca | https://github.com/The-PR-Agent/pr-agent/issues/2223 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n\n### Constraint 10: 来源证据：Publish linux/arm64 Docker image for github_app tag\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Publish linux/arm64 Docker image for github_app tag\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_8cb9e552d2e2452cbe958628f6e800b6 | https://github.com/The-PR-Agent/pr-agent/issues/2386 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n- Hard boundary: do not present this pitfall as solved, verified, or safe to ignore unless later validation evidence explicitly closes it.\n",
      "summary": "Context and operating boundaries for host AI agents.",
      "title": "AI Context Pack"
    },
    "boundary_risk_card": {
      "asset_id": "boundary_risk_card",
      "filename": "BOUNDARY_RISK_CARD.md",
      "markdown": "# Boundary & Risk Card\n\nProject: The-PR-Agent/pr-agent\n\n## Doramagic Trial Decision\n\nCurrent decision: it can enter pre-publication recommendation checks. First use should still start with least privilege, a temporary directory, and reversible configuration.\n\n## What The User Can Do Now\n\n- Read the Human Manual first to understand the project purpose and main workflows.\n- Use Prompt Preview for pre-install exploration; it validates interaction shape, not real execution.\n- Run official Quick Start commands only inside an isolated environment, not a primary setup.\n\n## Do Not Do Yet\n\n- Do not treat Prompt Preview as a real project execution result.\n- Do not treat metadata-only validation as sandbox installation validation.\n- Do not describe unverified capabilities as supported, working, or safe to install.\n- Do not provide production data, private files, real secrets, or primary host configuration on first trial.\n\n## Pre-Install Checklist\n\n- Host AI match: chatgpt\n- Official installation entry status: official entry point found\n- Isolated temporary directory, temporary host, or container validation: required\n- Configuration rollback path: required\n- API keys, network access, file access, or host configuration changes: treat as high risk until confirmed\n- Installation command, actual output, and failure logs: must be recorded\n\n## Current Blockers\n\n- No blockers.\n\n## Project-Specific Pitfalls\n\n- 来源证据：Allow specifying a custom branch for locating `.pr_agent.toml` (high): 可能增加新用户试用和生产接入成本。 Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 失败模式：security_permissions: Add support for Databricks hosted models (high): Developers may expose sensitive permissions or credentials: Add support for Databricks hosted models Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Add support for Databricks hosted models. Context: Observed when using python, docker\n- 来源证据：Add support for Databricks hosted models (high): 可能影响授权、密钥配置或安全边界。 Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 来源证据：GITLAB 404 project not found (high): 可能影响授权、密钥配置或安全边界。 Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 来源证据：Incorrect Inline Code Suggestion Formatting in Azure DevOps (high): 可能影响升级、迁移或版本选择。 Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n\n## Risk And Permission Notes\n\n- no_demo: medium\n\n## Evidence Gaps\n\n- No structured evidence gaps are currently visible.\n",
      "summary": "Installation, permission, validation, and pre-recommendation risks.",
      "title": "Boundary & Risk Card"
    },
    "human_manual": {
      "asset_id": "human_manual",
      "filename": "HUMAN_MANUAL.md",
      "markdown": "# https://github.com/The-PR-Agent/pr-agent 项目说明书\n\n生成时间：2026-05-15 20:09:06 UTC\n\n## 目录\n\n- [Introduction to PR-Agent](#introduction)\n- [Quick Start Guide](#quickstart)\n- [System Architecture](#architecture)\n- [Git Providers System](#git-providers)\n- [Command-to-Tool Mapping](#command-handling)\n- [Tools Overview](#tools-overview)\n- [/describe Tool](#describe-tool)\n- [/review Tool](#review-tool)\n- [/improve Tool](#improve-tool)\n- [Additional Tools](#additional-tools)\n\n<a id='introduction'></a>\n\n## Introduction to PR-Agent\n\n### 相关页面\n\n相关主题：[Quick Start Guide](#quickstart), [System Architecture](#architecture), [Tools Overview](#tools-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [README.md](https://github.com/The-PR-Agent/pr-agent/blob/main/README.md)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n- [pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n- [CONTRIBUTING.md](https://github.com/The-PR-Agent/pr-agent/blob/main/CONTRIBUTING.md)\n</details>\n\n# Introduction to PR-Agent\n\nPR-Agent is an open-source, AI-powered code review agent that provides automated analysis and feedback on pull requests. Originally developed by Qodo, the project was donated to the open-source community, making it a community-maintained legacy project distinct from Qodo's primary AI code review offering.\n\n## Overview\n\nPR-Agent serves as an intelligent assistant that scans pull request code changes and generates automated feedback, suggestions, and descriptions. It integrates seamlessly with major version control platforms including GitHub, GitLab, Bitbucket, and Azure DevOps.\n\nThe project provides a comprehensive suite of tools that can be triggered automatically on PR events (such as when a PR is opened or synchronized) or invoked manually through comments on pull requests. Each tool focuses on a specific aspect of the PR review process.\n\n## Architecture\n\nPR-Agent follows a modular architecture where each tool operates as an independent component. The core system consists of:\n\n1. **Agent Core** - The main orchestration layer that processes incoming requests and routes them to appropriate tools\n2. **Git Provider Integration** - Abstraction layer for different VCS platforms\n3. **Tool Suite** - Individual tools for description, review, improvement, and other operations\n4. **Configuration System** - TOML-based configuration with environment variable support\n\n### Component Flow\n\n```mermaid\ngraph TD\n    A[Pull Request Event] --> B[Git Provider]\n    B --> C[Agent Core]\n    C --> D[Tool Router]\n    D --> E[/describe]\n    D --> F[/review]\n    D --> G[/improve]\n    D --> H[/ask]\n    E --> I[AI Model]\n    F --> I\n    G --> I\n    H --> I\n    I --> J[PR Comment/Update]\n```\n\n## Available Tools\n\nPR-Agent provides multiple tools that can be invoked via slash commands in PR comments.\n\n### Describe Tool\n\nThe `/describe` tool scans PR code changes and generates a comprehensive description including:\n\n- **Title** - Auto-generated PR title in the format `<PR type>: <title>`\n- **Type** - Classification such as Bug fix, Tests, Enhancement, Documentation, or Other\n- **Summary** - Brief overview of changes\n- **Walkthrough** - File-by-file breakdown of modifications\n- **Labels** - Auto-assigned labels based on content\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n### Review Tool\n\nThe `/review` tool performs detailed code analysis and provides:\n\n- **Code quality assessment** - Evaluation of code structure and patterns\n- **Security analysis** - Potential vulnerability detection\n- **Performance considerations** - Optimization suggestions\n- **Recommended focus areas** - Specific files or lines requiring attention\n\n资料来源：[pr_agent/servers/help.py:1-100]()\n\n### Improve Tool (Code Suggestions)\n\nThe `/improve` tool automatically generates code improvement suggestions:\n\n- **Category classification** - Each suggestion is labeled and categorized\n- **Impact scoring** - Suggestions are scored by potential improvement impact\n- **Code examples** - Before/after code comparisons when relevant\n- **Automatic sorting** - Suggestions ordered by score within categories\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:1-80]()\n\n### Ask Tool\n\nThe `/ask` tool answers natural language questions about the PR:\n\n- Queries about the entire PR scope\n- Specific questions about code lines or files\n- Image-related questions when visual content is present\n\nNote that the tool does not retain memory between questions—each query is answered independently.\n\n资料来源：[pr_agent/servers/help.py:1-150]()\n\n### Help Docs Tool\n\nThe `/help_docs` tool retrieves documentation based on relative file paths, supporting both repository-local documentation and external sources.\n\n## Output Format\n\nPR-Agent generates output using GitHub Flavored Markdown (GFM) with enhanced formatting:\n\n```mermaid\ngraph LR\n    A[Code Analysis] --> B[GFM Table Format]\n    B --> C[Collapsible Sections]\n    C --> D[Code Blocks]\n    D --> E[Links & References]\n```\n\n### Markdown Table Structure\n\nPR-Agent uses structured HTML tables within Markdown for organized output:\n\n```html\n<table>\n  <thead>\n    <tr>\n      <td><strong>Category</strong></td>\n      <td><strong>Suggestion</strong></td>\n      <td><strong>Impact</strong></td>\n    </tr>\n  </thead>\n  <tbody>\n    <!-- Content rows -->\n  </tbody>\n</table>\n```\n\n资料来源：[pr_agent/algo/utils.py:1-100]()\n\n## Configuration\n\nPR-Agent uses a TOML-based configuration system with multiple configuration levels.\n\n### Configuration Sections\n\n| Section | Purpose | Key Settings |\n|---------|---------|--------------|\n| `pr_description` | Describe tool behavior | `enable_help_comment`, `use_description_markers`, `output_relevant_configurations` |\n| `pr_reviewer` | Review tool behavior | Various review-specific options |\n| `pr_code_suggestions` | Improve tool behavior | Suggestion filtering and scoring |\n| `config` | Global settings | `output_relevant_configurations` |\n\n资料来源：[pr_agent/tools/pr_config.py:1-50]()\n\n### Configuration Methods\n\n**Command-line invocation:**\n```bash\n/describe --pr_description.some_config1=... --pr_description.some_config2=...\n/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...\n```\n\n**Configuration file (TOML):**\n```toml\n[pr_description]\nsome_config1=...\nsome_config2=...\n\n[pr_code_suggestions]\nsome_config1=...\n```\n\n资料来源：[pr_agent/servers/help.py:1-200]()\n\n### Custom Labels\n\nThe describe tool supports custom labels defined in the repository's labels page or via configuration file. Examples:\n\n| Custom Label | Description |\n|--------------|-------------|\n| `Main topic:performance` | PR focuses on performance optimization |\n| `New endpoint` | New API endpoint added |\n| `SQL query` | Database query changes |\n| `Dockerfile changes` | Container configuration updates |\n\n## Installation and Deployment\n\n### Docker Installation\n\nDocker images are published to `pragent/pr-agent`. Recent releases (0.34.2+) are available at the new namespace. Legacy images up to v0.31 remain at `codiumai/pr-agent`.\n\n资料来源：[README.md:1-100]()\n\n### GitHub Action (Recommended)\n\n```yaml\nname: PR Agent\non:\n  pull_request:\n    types: [opened, synchronize]\njobs:\n  pr_agent_job:\n    runs-on: ubuntu-latest\n    steps:\n    - name: PR Agent action step\n      uses: the-pr-agent/pr-agent@main\n      env:\n        OPENAI_KEY: ${{ secrets.OPENAI_KEY }}\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### CLI Usage\n\n```bash\npip install pr-agent\nexport OPENAI_KEY=your_key_here\npr-agent --pr_url https://github.com/owner/repo/pull/123 review\n```\n\n## Automation Modes\n\nPR-Agent supports multiple automation configurations:\n\n1. **Automatic on PR events** - Tools run automatically when PR is opened or updated\n2. **Manual invocation** - Users trigger tools via slash commands in comments\n3. **Marker-based control** - Using `pr_agent:marker_name` markers for selective updates\n\nThe default automation mode for the describe tool uses:\n```python\npr_commands = [\"/describe\", ...]\n```\n\n资料来源：[pr_agent/servers/help.py:1-250]()\n\n## Development Guidelines\n\nContributors should follow these practices:\n\n- Use conventional commit messages (e.g., `fix: handle missing repo settings gracefully`)\n- Target branch names follow `feature/<name>` or `fix/<issue>` patterns\n- Keep PRs focused on single features or fixes\n- Include unit tests for new functionality using pytest\n- Update prompts and configuration files together when behavior changes\n\n资料来源：[CONTRIBUTING.md:1-80]()\n\n## Security Considerations\n\n- Secrets must be supplied through environment variables, not hardcoded\n- API keys and credentials should never be committed to the repository\n- Docker builds and e2e tests requiring external credentials need coordination before execution\n\n---\n\n<a id='quickstart'></a>\n\n## Quick Start Guide\n\n### 相关页面\n\n相关主题：[Introduction to PR-Agent](#introduction)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [README.md](https://github.com/The-PR-Agent/pr-agent/blob/main/README.md)\n- [pr_agent/cli.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/cli.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [SECURITY.md](https://github.com/The-PR-Agent/pr-agent/blob/main/SECURITY.md)\n- [AGENTS.md](https://github.com/The-PR-Agent/pr-agent/blob/main/AGENTS.md)\n</details>\n\n# Quick Start Guide\n\n## Overview\n\nThe Quick Start Guide provides developers with immediate access to automated PR review capabilities through PR-Agent. This guide covers installation methods, configuration options, and basic usage patterns to get started with AI-powered code review in minutes.\n\nPR-Agent is an open-source, AI-powered code review agent that integrates seamlessly with GitHub, GitLab, Bitbucket, and Azure DevOps. It offers automated reviews, descriptions, code suggestions, and more without requiring complex setup.\n\n## Installation Methods\n\nPR-Agent supports multiple installation methods to accommodate different development workflows and infrastructure requirements.\n\n### GitHub Action (Recommended)\n\nThe GitHub Action method is the recommended approach for automated PR reviews. It runs as part of your CI/CD pipeline and automatically reviews pull requests when they are opened or updated.\n\n```yaml\n# .github/workflows/pr-agent.yml\nname: PR Agent\non:\n  pull_request:\n    types: [opened, synchronize]\njobs:\n  pr_agent_job:\n    runs-on: ubuntu-latest\n    steps:\n    - name: PR Agent action step\n      uses: the-pr-agent/pr-agent@main\n      env:\n        OPENAI_KEY: ${{ secrets.OPENAI_KEY }}\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n资料来源：[README.md:1-25]()\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `OPENAI_KEY` | secret | Yes | OpenAI API key for AI capabilities |\n| `GITHUB_TOKEN` | secret | Yes | GitHub token for API access |\n| `GITLAB_TOKEN` | secret | No | Required for GitLab integration |\n| `AZURE_DEVOPS_TOKEN` | secret | No | Required for Azure DevOps integration |\n\n### CLI Usage (Local Development)\n\nFor local development and testing, use the Command Line Interface:\n\n```bash\npip install pr-agent\nexport OPENAI_KEY=your_key_here\npr-agent --pr_url https://github.com/owner/repo/pull/123 review\n```\n\n资料来源：[README.md:31-37]()\n\n| Command | Description |\n|---------|-------------|\n| `pr-agent --pr_url <URL> review` | Run a review on a PR |\n| `pr-agent --pr_url <URL> describe` | Generate PR description |\n| `pr-agent --pr_url <URL> improve` | Get code improvement suggestions |\n| `pr-agent --pr_url <URL> ask \"<question>\"` | Ask questions about the PR |\n\n### Docker Deployment\n\nDocker images are available for containerized deployments:\n\n| Image Tag | Description | Registry |\n|-----------|-------------|----------|\n| `pragent/pr-agent:0.34.2+` | Current releases | hub.docker.com |\n| `pragent/pr-agent:latest` | Latest stable | hub.docker.com |\n| `pragent/pr-agent:0.34.2-github_action` | GitHub Action variant | hub.docker.com |\n| `codiumai/pr-agent:v0.31` | Legacy (frozen) | hub.docker.com |\n\n版本 0.34.2 及之后发布在 `pragent/pr-agent` 命名空间，旧版本（直到 v0.31）仍可在 `codiumai/pr-agent` 获取但不会再更新。\n\n资料来源：[README.md:1-8]()\n\nFor enhanced security, specify Docker images using their digest:\n\n```yaml\nsteps:\n  - name: PR Agent action step\n    id: pragent\n    uses: docker://pragent/pr-agent@sha256:a0b36966ca3a197ca739fa1e65c16703076fc1c744cd423ca203b8c21707d71c\n```\n\n资料来源：[SECURITY.md:1-12]()\n\n## Architecture Overview\n\n```mermaid\ngraph TD\n    A[Pull Request Event] --> B[GitHub/GitLab/Bitbucket/Azure DevOps]\n    B --> C[PR-Agent Trigger]\n    C --> D{Installation Method}\n    D -->|GitHub Action| E[GitHub Actions Runner]\n    D -->|CLI| F[Local Environment]\n    D -->|Docker| G[Container Runtime]\n    E --> H[OpenAI API / LLM]\n    F --> H\n    G --> H\n    H --> I[Review Output]\n    I --> J[PR Comment]\n```\n\n## Configuration System\n\nPR-Agent uses a flexible configuration system that supports multiple levels of customization.\n\n### Configuration Hierarchy\n\n| Level | Location | Scope | Priority |\n|-------|----------|-------|----------|\n| 1 | Environment Variables | Global | Highest |\n| 2 | Configuration File | Project | Medium |\n| 3 | Inline Command Flags | Per-invocation | Lowest |\n\n### Configuration File Format\n\nCreate a `.pr_agent.toml` or use `pr_agent/settings/configuration.toml`:\n\n```toml\n[pr_description]\nextra_instructions=\"\"\"\\\n- The PR title should be in the format: '<PR type>: <title>'\n- The title should be short and concise (up to 10 words)\n\"\"\"\n```\n\n资料来源：[pr_agent/servers/help.py:1-15]()\n\n### Inline Configuration via Comments\n\nWhen commenting on a PR, use the following template to modify configurations:\n\n```\n/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...\n```\n\n资料来源：[pr_agent/servers/help.py:1-10]()\n\n## Available Commands\n\nPR-Agent provides several commands that can be invoked via PR comments:\n\n### Command Reference Table\n\n| Command | Purpose | Auto-trigger | Manual Trigger |\n|---------|---------|--------------|----------------|\n| `/describe` | Generate PR description | ✓ | ✓ |\n| `/review` | Perform code review | ✓ | ✓ |\n| `/improve` | Suggest code improvements | ✓ | ✓ |\n| `/ask \"...\"` | Answer questions about PR | ✗ | ✓ |\n| `/help_docs \"...\"` | Query documentation | ✗ | ✓ |\n| `/config` | Show configuration | ✗ | ✓ |\n\n### Command Usage Examples\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n#### Describe Command\n\n```\n/describe --pr_description.some_config1=value\n```\n\nGenerates a PR description including title, type, summary, walkthrough, and labels.\n\n#### Review Command\n\n```\n/review --pr_reviewer.some_config1=value --pr_reviewer.some_config2=value\n```\n\nPerforms an automated code review with configurable focus areas.\n\n#### Improve Command\n\n```\n/improve --pr_code_suggestions.some_config1=value\n```\n\nScans PR code changes and generates improvement suggestions.\n\n#### Ask Command\n\n```\n/ask \"What are the main changes in this PR?\"\n```\n\nAnswers questions about the PR without memory of previous interactions.\n\n## Security Best Practices\n\n### Environment Variables\n\nSecrets should be supplied through environment variables exclusively:\n\n```bash\nexport OPENAI_KEY=sk-...\nexport GITHUB_TOKEN=ghp_...\n```\n\nDo not persist credentials in code or configuration files that might be committed to version control.\n\n资料来源：[AGENTS.md:1-10]()\n\n### Docker Security\n\nFor production deployments, use pinned Docker image digests instead of floating tags:\n\n```yaml\nuses: docker://pragent/pr-agent@sha256:<digest>\n```\n\n资料来源：[SECURITY.md:1-12]()\n\n## Output Format\n\nPR-Agent generates formatted markdown output for PR comments with support for GitHub Flavored Markdown (GFM).\n\n### Output Structure\n\n```mermaid\ngraph LR\n    A[Review Output] --> B{GFM Supported?}\n    B -->|Yes| C[Rich Tables & Details]\n    B -->|No| D[Plain Markdown]\n    C --> E[Collapsible Sections]\n    D --> F[Basic Formatting]\n```\n\n### Example Output Features\n\n| Feature | GFM Support | Fallback |\n|---------|-------------|----------|\n| Code blocks | ✓ Syntax highlighting | ✓ Basic blocks |\n| Tables | ✓ Rich formatting | ✗ Text list |\n| Collapsible details | ✓ `<details>` tags | ✗ Flat text |\n| Line links | ✓ Clickable references | ✗ Line numbers only |\n\n资料来源：[pr_agent/algo/utils.py:1-30]()\n\n## Troubleshooting\n\n### Common Issues\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Bot doesn't respond | App not installed | Install GitHub App |\n| Empty review | No code changes | Ensure PR has diff |\n| Rate limit errors | API quota exceeded | Check OpenAI billing |\n| Authentication failed | Invalid token | Verify secret configuration |\n\n### Help Command\n\nUse the inline help feature for tool-specific guidance:\n\n```\n/help how to configure the review tool\n```\n\n资料来源：[pr_agent/tools/pr_description.py:1-15]()\n\n## Next Steps\n\nAfter setting up PR-Agent:\n\n1. **Customize prompts** - Modify extra instructions in configuration files\n2. **Enable auto-tools** - Configure automatic triggers for new PRs\n3. **Set up custom labels** - Define project-specific PR categories\n4. **Integrate with your workflow** - Add to existing CI/CD pipelines\n\n## Additional Resources\n\n| Resource | Link |\n|----------|------|\n| Documentation | https://qodo-merge-docs.qodo.ai/ |\n| GitHub Action Guide | https://docs.pr-agent.ai/installation/github/ |\n| CLI Setup Guide | https://docs.pr-agent.ai/usage-guide/automations_and_usage/#local-repo-cli |\n| Discord Community | https://discord.com/channels/1057273017547378788/ |\n\n---\n\n<a id='architecture'></a>\n\n## System Architecture\n\n### 相关页面\n\n相关主题：[Git Providers System](#git-providers), [Command-to-Tool Mapping](#command-handling)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/agent/pr_agent.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/agent/pr_agent.py)\n- [pr_agent/git_providers/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/__init__.py)\n- [pr_agent/tools/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/__init__.py)\n- [pr_agent/algo/types.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/types.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n- [pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n- [pr_agent/git_providers/bitbucket_server_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n</details>\n\n# System Architecture\n\n## Overview\n\nPR-Agent is an open-source AI-powered code review agent that provides automated PR analysis, review, and improvement suggestions. The system follows a modular architecture that separates concerns between agent orchestration, tool execution, git provider abstraction, and utility functions.\n\nThe primary goal of PR-Agent's architecture is to support multiple Git hosting platforms (GitHub, GitLab, Bitbucket, Azure DevOps) while providing consistent tooling for PR-related operations like description generation, code review, code suggestions, and documentation assistance.\n\n资料来源：[README.md](https://github.com/The-PR-Agent/pr-agent/blob/main/README.md)\n\n---\n\n## High-Level Architecture\n\n### System Components\n\nThe PR-Agent system consists of four main layers:\n\n| Layer | Purpose | Key Modules |\n|-------|---------|-------------|\n| **Agent Layer** | Orchestrates tool invocation and command processing | `pr_agent/agent/pr_agent.py` |\n| **Tool Layer** | Implements individual PR tools (describe, review, improve, etc.) | `pr_agent/tools/` |\n| **Provider Layer** | Abstracts Git platform differences | `pr_agent/git_providers/` |\n| **Utility Layer** | Shared algorithms, types, and formatting utilities | `pr_agent/algo/` |\n\n资料来源：[pr_agent/agent/pr_agent.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/agent/pr_agent.py)\n\n### Data Flow\n\n```mermaid\ngraph TD\n    A[Git Platform<br/>Webhook/CLI] --> B[Agent Entry Point<br/>pr_agent.py]\n    B --> C{Command Router}\n    C -->|/describe| D[PR Description Tool]\n    C -->|/review| E[PR Review Tool]\n    C -->|/improve| F[Code Suggestions Tool]\n    C -->|/ask| G[Ask Tool]\n    C -->|/help| H[Help Server]\n    \n    D --> I[Git Provider<br/>Abstraction]\n    E --> I\n    F --> I\n    G --> I\n    \n    I --> J[GitHub Provider]\n    I --> K[GitLab Provider]\n    I --> L[Bitbucket Provider]\n    I --> M[Azure DevOps Provider]\n    \n    J --> N[GitHub API]\n    K --> O[GitLab API]\n    L --> P[Bitbucket API]\n    M --> Q[Azure DevOps API]\n    \n    I --> R[Utility Functions<br/>algo/utils.py]\n    D --> R\n    E --> R\n    F --> R\n```\n\n---\n\n## Agent Layer\n\n### Core Agent Implementation\n\nThe agent layer is the central orchestrator that handles:\n\n1. **Command parsing and routing** - Interprets user commands (`/describe`, `/review`, `/improve`, `/ask`, `/help`)\n2. **Tool instantiation** - Creates appropriate tool instances based on commands\n3. **Execution coordination** - Manages the flow between tools and git providers\n4. **Response formatting** - Structures output for different platforms (GitHub vs GitLab vs Bitbucket)\n\n资料来源：[pr_agent/agent/pr_agent.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/agent/pr_agent.py)\n\n### Agent Initialization Flow\n\n```mermaid\nsequenceDiagram\n    participant Main as Main Entry Point\n    participant Agent as PRAgent Class\n    participant Provider as GitProvider Factory\n    participant Tool as Tool Instances\n    \n    Main->>Agent: Initialize PRAgent(pr_url, cli_mode)\n    Agent->>Provider: create_git_provider(pr_url)\n    Provider->>Provider: Detect platform type\n    Provider-->>Agent: Return Provider Instance\n    Agent->>Tool: Initialize Tools\n    Agent-->>Main: Ready to process commands\n```\n\n---\n\n## Git Provider Layer\n\n### Provider Abstraction Architecture\n\nThe git provider layer provides a unified interface for interacting with different Git hosting platforms. This abstraction allows tools to operate identically regardless of the underlying platform.\n\n```mermaid\ngraph LR\n    A[Tools Layer] --> B[GitProvider Interface<br/>__init__.py]\n    B --> C[GitHubProvider]\n    B --> D[GitLabProvider]\n    B --> D[BitbucketProvider]\n    B --> E[AzureDevOpsProvider]\n```\n\n资料来源：[pr_agent/git_providers/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/__init__.py)\n\n### Provider Interface Capabilities\n\nThe base `GitProvider` interface defines the following capabilities:\n\n| Capability | Description |\n|------------|-------------|\n| `get_diff_files()` | Retrieves list of changed files in the PR |\n| `get_comments()` | Fetches existing PR comments |\n| `publish_comment()` | Posts a comment to the PR |\n| `publish_code_suggestion()` | Publishes inline code suggestions |\n| `get_languages()` | Returns programming languages used in PR |\n| `get_repo_settings()` | Retrieves repository configuration |\n| `is_supported(feature)` | Checks if a specific feature is supported |\n\n资料来源：[pr_agent/git_providers/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/__init__.py)\n\n### Platform-Specific Implementations\n\nEach Git platform has a dedicated provider class that implements the interface:\n\n| Platform | Provider Class | Special Considerations |\n|----------|----------------|------------------------|\n| GitHub | `GithubProvider` | Full GFM markdown support, fine-grained permissions |\n| GitLab | `GitLabProvider` | Different markdown rendering, MR terminology |\n| Bitbucket | `BitbucketProvider` | No multi-line suggestions (uses code blocks instead) |\n| Azure DevOps | `AzureDevOpsProvider` | Work item integration |\n\n资料来源：[pr_agent/git_providers/bitbucket_server_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n\n#### Bitbucket Multi-Line Suggestion Limitation\n\nBitbucket Server does not support multi-line code suggestions natively. The implementation falls back to code blocks when handling suggestions:\n\n```python\n# Bitbucket does not support multi-line suggestions so use a code block instead\n# Reference: https://jira.atlassian.com/browse/BSERV-4553\nbody = body.replace(\"```suggestion\", \"```\")\n```\n\n资料来源：[pr_agent/git_providers/bitbucket_server_provider.py:45](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n\n---\n\n## Tool Layer\n\n### Available Tools\n\nThe tool layer contains modular implementations for each PR-Agent capability:\n\n| Tool | File | Primary Function |\n|------|------|------------------|\n| `describe` | `pr_description.py` | Generates PR title, type, summary, walkthrough |\n| `review` | `pr_reviewer.py` | Analyzes PR code for issues and concerns |\n| `improve` | `pr_code_suggestions.py` | Generates code improvement suggestions |\n| `ask` | `ask.py` | Answers questions about PR changes |\n| `help` | `help.py` | Provides usage guidance |\n| `config` | `pr_config.py` | Displays relevant configurations |\n\n资料来源：[pr_agent/tools/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/__init__.py)\n\n### Tool Structure Pattern\n\nEach tool follows a common structure pattern:\n\n```mermaid\ngraph TD\n    A[Tool Class] --> B[__init__<br/>Initialize git_provider]\n    A --> C[run<br/>Main entry point]\n    C --> D[get_deferred_reply]\n    C --> E[work|\n    D --> F[LLM Processing]\n    E --> G[Markdown Generation]\n    F --> G\n    G --> H[publish_output]\n```\n\n### Code Suggestions Tool Architecture\n\nThe code suggestions tool (`improve`) demonstrates the typical tool structure:\n\n```python\n# Language extension mapping for syntax highlighting\nlanguage_extension_map_org = get_settings().language_extension_map_org\nextension_to_language = {}\nfor language, extensions in language_extension_map_org.items():\n    for ext in extensions:\n        extension_to_language[ext] = language\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n\n#### Suggestion Output Format\n\nThe code suggestions tool outputs structured markdown tables:\n\n```\n┌──────────┬─────────────────────┬────────┐\n│ Category │ Suggestion          │ Impact │\n├──────────┼─────────────────────┼────────┤\n│ Security │ Input validation    │ High   │\n└──────────┴─────────────────────┴────────┘\n```\n\nSuggestions are grouped by label and sorted by score:\n\n```python\n# Sort suggestions_labels by the suggestion with the highest score\nsuggestions_labels = dict(\n    sorted(suggestions_labels.items(), key=lambda x: max([s['score'] for s in x[1]]), reverse=True))\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n\n### PR Description Tool\n\nThe description tool generates comprehensive PR descriptions including:\n\n| Component | Description |\n|-----------|-------------|\n| **Title** | Concise PR title (up to 10 words) |\n| **Type** | PR classification (bug fix, feature, etc.) |\n| **Summary** | Brief overview of changes |\n| **Walkthrough** | Line-by-line change explanation |\n| **Labels** | Auto-generated or custom labels |\n| **Diagram** | Optional sequence diagram (Mermaid) |\n\n资料来源：[pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n\n#### Description Output Structure\n\n```mermaid\ngraph TD\n    A[PR Description Request] --> B{Use Markers?}\n    B -->|Yes| C[Replace marker placeholders]\n    B -->|No| D[Generate full description]\n    D --> E[Add help comment if enabled]\n    E --> F[Output configurations if enabled]\n    C --> F\n    F --> G[Publish to PR]\n```\n\n---\n\n## Utility Layer\n\n### Types and Data Models\n\nThe `pr_agent/algo/types.py` module defines core data types used throughout the system:\n\n| Type | Purpose |\n|------|---------|\n| `ActionResult` | Encapsulates tool action results |\n| `ModelData` | LLM response container |\n| `CodeSuggestion` | Code suggestion data model |\n\n资料来源：[pr_agent/algo/types.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/types.py)\n\n### Utility Functions\n\nThe `pr_agent/algo/utils.py` module provides shared utilities:\n\n| Function | Purpose |\n|----------|---------|\n| `parse_code_suggestion()` | Converts suggestion dict to markdown |\n| `extract_relevant_lines_str()` | Extracts code lines from diff |\n| `convert_to_markdown()` | Generic dict-to-markdown converter |\n| `show_relevant_configurations()` | Renders config as markdown |\n\n资料来源：[pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n\n### Markdown Generation Utilities\n\nThe system supports both GitHub Flavored Markdown (GFM) and standard markdown:\n\n```python\ndef parse_code_suggestion(code_suggestion: dict, i: int = 0, gfm_supported: bool = True) -> str:\n    \"\"\"\n    Convert a dictionary of data into markdown format.\n    \n    Args:\n        code_suggestion (dict): A dictionary containing data to be converted to markdown format.\n        gfm_supported (bool): Whether GFM features are available for this provider.\n    \"\"\"\n```\n\nGFM features enable collapsible file lists, detailed code references, and rich table formatting. Non-GFM providers receive simplified output:\n\n| GFM Feature | GFM Output | Standard Output |\n|-------------|------------|------------------|\n| Code links | `<a href='...'>line</a>` | Plain text |\n| Collapsible sections | `<details>` tags | Full text |\n| Table formatting | `<table>` tags | Headers only |\n\n资料来源：[pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n\n---\n\n## Deployment Architecture\n\n### Supported Deployment Methods\n\nPR-Agent supports multiple deployment models:\n\n| Method | Use Case | Configuration |\n|--------|----------|---------------|\n| **GitHub App** | Automated reviews on PR open | GitHub App installation |\n| **GitHub Action** | CI/CD integration | Workflow YAML |\n| **CLI** | Local development | `pr-agent` command |\n| **Docker** | Self-hosted deployment | Docker container |\n\n资料来源：[README.md](https://github.com/The-PR-Agent/pr-agent/blob/main/README.md)\n\n### GitHub Action Workflow\n\n```yaml\nname: PR Agent\non:\n  pull_request:\n    types: [opened, synchronize]\njobs:\n  pr_agent_job:\n    runs-on: ubuntu-latest\n    steps:\n    - name: PR Agent action step\n      uses: the-pr-agent/pr-agent@main\n      env:\n        OPENAI_KEY: ${{ secrets.OPENAI_KEY }}\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n资料来源：[README.md](https://github.com/The-PR-Agent/pr-agent/blob/main/README.md)\n\n---\n\n## Configuration Architecture\n\n### Configuration Hierarchy\n\nPR-Agent uses a layered configuration system:\n\n1. **Default settings** - `pr_agent/settings/configuration.toml`\n2. **Environment variables** - Override defaults\n3. **Repository settings** - `.pr_agent.toml` or `pyproject.toml`\n4. **Runtime parameters** - Command-line arguments\n\n### Configuration Display\n\nThe `pr_config.py` tool can output relevant configurations as markdown:\n\n```python\nfor key, value in settings_dict.items():\n    if key in relevant_keys:\n        markdown_text += f\"\\n{header.lower()}.{key.lower()} = {repr(value) if isinstance(value, str) else value}\"\n```\n\n资料来源：[pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n\n---\n\n## Key Architectural Patterns\n\n### 1. Provider Pattern\n\nAll Git platform interactions go through a provider abstraction, enabling platform-agnostic tool implementations:\n\n```python\nclass SomeTool:\n    def __init__(self, git_provider: GitProvider):\n        self.git_provider = git_provider\n    \n    def work(self):\n        # Platform-agnostic code\n        diff_files = self.git_provider.get_diff_files()\n        # Same code works for GitHub, GitLab, Bitbucket\n```\n\n### 2. Factory Pattern\n\nGit providers are instantiated via a factory function that detects the platform:\n\n```python\ndef create_git_provider(pr_url: str, configuration: dict = None) -> GitProvider:\n    # Detect platform from pr_url\n    # Return appropriate provider instance\n```\n\n### 3. Deferred Execution Pattern\n\nTools support deferred execution for async operations:\n\n```python\ndef get_deferred_reply(self) -> dict:\n    \"\"\"Returns deferred response for async processing.\"\"\"\n    return {\"action\": \"defer\", \"tool\": self.__class__.__name__}\n```\n\n资料来源：[pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n\n---\n\n## Summary\n\nThe PR-Agent system architecture follows a clean, layered design:\n\n| Layer | Responsibility | Extensibility |\n|-------|----------------|---------------|\n| **Agent** | Command routing, orchestration | Add new commands |\n| **Tools** | PR operations (describe, review, improve) | Add new tools |\n| **Providers** | Git platform abstraction | Add new platforms |\n| **Algo** | Shared utilities, formatting | Reuse across tools |\n\nThis architecture enables:\n- **Platform independence**: Same tools work across GitHub, GitLab, Bitbucket, Azure DevOps\n- **Tool modularity**: Each tool can be independently developed and tested\n- **Flexible deployment**: Supports GitHub Apps, Actions, CLI, and Docker\n- **Consistent output**: Platform-appropriate markdown formatting\n\n资料来源：[pr_agent/agent/pr_agent.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/agent/pr_agent.py), [pr_agent/git_providers/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/__init__.py)\n\n---\n\n<a id='git-providers'></a>\n\n## Git Providers System\n\n### 相关页面\n\n相关主题：[System Architecture](#architecture)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/git_providers/__init__.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/__init__.py)\n- [pr_agent/git_providers/github_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/github_provider.py)\n- [pr_agent/git_providers/gitlab_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/gitlab_provider.py)\n- [pr_agent/git_providers/bitbucket_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_provider.py)\n- [pr_agent/git_providers/azuredevops_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/azuredevops_provider.py)\n- [pr_agent/git_providers/gitea_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/gititea_provider.py)\n- [pr_agent/git_providers/git_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/git_provider.py)\n</details>\n\n# Git Providers System\n\n## Overview\n\nThe Git Providers System is a core abstraction layer in PR-Agent that provides a unified interface for interacting with different Git hosting platforms. It abstracts the differences between GitHub, GitLab, Bitbucket, Azure DevOps, and Gitea, allowing PR-Agent tools to operate uniformly regardless of the underlying platform.\n\n## Architecture\n\nThe system follows a provider pattern with a base abstract class and platform-specific implementations. All providers inherit from a common `GitProvider` base class that defines the standard interface.\n\n```mermaid\ngraph TB\n    subgraph \"Git Providers System\"\n        GP[GitProvider<br/>Base Class]\n        GHP[GitHubProvider]\n        GLP[GitLabProvider]\n        BBP[BitbucketProvider]\n        ADP[AzureDevOpsProvider]\n        GTP[GiteaProvider]\n    end\n    \n    GP <|-- GHP\n    GP <|-- GLP\n    GP <|-- BBP\n    GP <|-- ADP\n    GP <|-- GTP\n    \n    Tools[PR-Agent Tools] --> GP\n```\n\n## Supported Platforms\n\n| Platform | Provider Class | Package Used |\n|----------|---------------|--------------|\n| GitHub | `GitHubProvider` | `PyGithub` |\n| GitLab | `GitLabProvider` | `python-gitlab` |\n| Bitbucket | `BitbucketProvider` | `atlassian-python-api` |\n| Azure DevOps | `AzureDevOpsProvider` | `ado_wit_client` |\n| Gitea | `GiteaProvider` | `giteapy` |\n\n资料来源：[pr_agent/git_providers/__init__.py]()\n\n## Base Class Interface\n\nThe `GitProvider` abstract base class defines the core interface that all platform-specific providers must implement:\n\n### Core PR Operations\n\n| Method | Purpose |\n|--------|---------|\n| `get_pr_description()` | Retrieve the PR/MR description text |\n| `get_pr_title()` | Get the title of the pull request |\n| `get_pr_branch()` | Get the source branch name |\n| `get_target_branch()` | Get the target/destination branch |\n| `get_user()` | Get the username of the PR author |\n| `get_pr_id()` | Get the internal PR identifier |\n\n### Diff and File Operations\n\n| Method | Purpose |\n|--------|---------|\n| `get_diff_files()` | Retrieve list of changed files with diff information |\n| `get_pr_file_content(filename)` | Get the content of a specific file in the PR |\n| `get_diff()[source_file, target_file, new_content]` | Get the raw diff content |\n\n资料来源：[pr_agent/git_providers/git_provider.py]()\n\n### Publishing Operations\n\n| Method | Purpose |\n|--------|---------|\n| `publish_comment(comment)` | Publish a general comment on the PR |\n| `publish_code_suggestion(code_suggestion)` | Publish inline code suggestions |\n| `create_inline_comment(file, line, body)` | Create an inline/review comment |\n| `remove_initial_comment()` | Remove the bot's initial comment |\n| `update_comment(comment_id, body)` | Update an existing comment |\n\n### Review Operations\n\n| Method | Purpose |\n|--------|---------|\n| `get_review_comments()` | Retrieve existing review comments |\n| `get_comments()` | Get all comments on the PR |\n| `get_issue_comments()` | Get issue-specific comments |\n\n### Labels and Status\n\n| Method | Purpose |\n|--------|---------|\n| `get_labels()` | Get current PR labels |\n| `add_label(label)` | Add a label to the PR |\n| `remove_label(label)` | Remove a label from the PR |\n| `get_pr_status()` | Get the current PR status/state |\n\n## Provider Implementation Details\n\n### GitHub Provider\n\nThe `GitHubProvider` uses the `PyGithub` library to interact with GitHub's REST API. It supports GitHub-specific features like:\n\n- Draft PR handling\n- Review request management\n- GitHub-specific markdown rendering (GFM)\n- Code suggestions with inline comments\n\n资料来源：[pr_agent/git_providers/github_provider.py]()\n\n### GitLab Provider\n\nThe `GitLabProvider` leverages the `python-gitlab` library for GitLab API interactions. It handles:\n\n- GitLab-flavored Markdown (GFM)\n- Merge request workflows\n- Different comment threading models\n\n资料来源：[pr_agent/git_providers/gitlab_provider.py]()\n\n### Bitbucket Provider\n\nThe `BitbucketProvider` utilizes the `atlassian-python-api` library to communicate with Bitbucket's APIs. It supports:\n\n- Bitbucket-specific diff formats\n- Pull request workflows\n\n资料来源：[pr_agent/git_providers/bitbucket_provider.py]()\n\n### Azure DevOps Provider\n\nThe `AzureDevOpsProvider` uses `ado_wit_client` for Azure DevOps integration. It handles:\n\n- Azure-specific PR structures\n- Work item linking\n- Azure DevOps review workflows\n\n资料来源：[pr_agent/git_providers/azuredevops_provider.py]()\n\n### Gitea Provider\n\nThe `GiteaProvider` uses the `giteapy` library for self-hosted Gitea instances. It provides:\n\n- Gitea API integration\n- Support for self-hosted GitHub-like platforms\n\n资料来源：[pr_agent/git_providers/gitea_provider.py]()\n\n## Feature Support Detection\n\nEach provider implements a capability detection system via the `is_supported(feature)` method. This allows tools to check whether a specific feature is available on the current platform:\n\n```python\ndef is_supported(self, feature: str) -> bool:\n    \"\"\"Check if a specific feature is supported by the current provider.\"\"\"\n```\n\nCommon features checked include:\n\n| Feature | Purpose |\n|---------|---------|\n| `gfm_markdown` | GitHub-flavored Markdown support |\n| `code_suggestions` | Inline code suggestion capability |\n| `review_comments` | Review comment functionality |\n| `labels` | Label management support |\n\n## Usage in PR-Agent Tools\n\n### Tool Integration Pattern\n\nPR-Agent tools interact with git providers through dependency injection:\n\n```python\nclass SomeTool:\n    def __init__(self, git_provider: GitProvider, ...):\n        self.git_provider = git_provider\n```\n\n### Example: PR Description Tool\n\nThe `pr_description.py` tool demonstrates typical provider usage:\n\n```python\n# Get diff files for analysis\ndiff_files = self.git_provider.get_diff_files()\n\n# Publish results\nself.git_provider.publish_comment(pr_body)\n\n# Check platform capabilities\nif self.git_provider.is_supported(\"gfm_markdown\"):\n    # Use GFM formatting\n```\n\n资料来源：[pr_agent/tools/pr_description.py]()\n\n### Example: Changelog Tool\n\nThe `pr_update_changelog.py` tool shows file operations:\n\n```python\n# Retrieve current changelog\nchangelog_content = self.git_provider.get_pr_file_content(\n    \"CHANGELOG.md\", \n    self.git_provider.get_pr_branch()\n)\n\n# Update changelog file\nself.git_provider.publish_comment(f\"**Changelog updates: 🔄**\\n\\n{answer}\")\n```\n\n资料来源：[pr_agent/tools/pr_update_changelog.py]()\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `GITHUB_TOKEN` | GitHub personal/access token |\n| `GITLAB_TOKEN` | GitLab personal access token |\n| `BITBUCKET_TOKEN` | Bitbucket app password |\n| `AZURE_DEVOPS_TOKEN` | Azure DevOps personal access token |\n| `GITEA_TOKEN` | Gitea API token |\n\n### Provider Selection\n\nThe provider is selected automatically based on the PR URL format or explicitly configured:\n\n```toml\n[config]\ngit_provider = \"github\"  # or \"gitlab\", \"bitbucket\", \"azure\", \"gitea\"\n```\n\n## Data Models\n\n### DiffFile Structure\n\nEach provider returns diff information with a consistent structure:\n\n```python\n@dataclass\nclass DiffFile:\n    filename: str\n    patch: str\n    num_plus_lines: int\n    num_minus_lines: int\n    status: str  # \"added\", \"modified\", \"deleted\", \"renamed\"\n```\n\n### CodeSuggestion Structure\n\n```python\n@dataclass\nclass CodeSuggestion:\n    relevant_file: str\n    relevant_lines: str\n    code_suggestion: dict  # Contains 'before' and 'after' code\n```\n\n## Error Handling\n\nProviders implement consistent error handling through:\n\n- Exception wrapping for platform-specific errors\n- Fallback mechanisms (e.g., extracting from patch when file content unavailable)\n- Logging integration via `get_logger()`\n\nExample fallback pattern from utils.py:\n\n```python\nif not file.head_file:\n    # Fallback: extract relevant lines directly from patch\n    patch = file.patch\n    _, selected_lines = extract_hunk_lines_from_patch(patch, ...)\n```\n\n资料来源：[pr_agent/algo/utils.py]()\n\n## Sequence Diagram: Comment Publishing\n\n```mermaid\nsequenceDiagram\n    participant Tool as PR-Agent Tool\n    participant Provider as GitProvider\n    participant API as Platform API\n    \n    Tool->>Provider: publish_comment(comment)\n    Provider->>API: POST comment request\n    API-->>Provider: Comment created\n    Provider-->>Tool: Success response\n    \n    Tool->>Provider: is_supported(\"gfm_markdown\")\n    Provider-->>Tool: Boolean support status\n```\n\n## Extending the Provider System\n\nTo add support for a new Git platform:\n\n1. Create a new provider class inheriting from `GitProvider`\n2. Implement all abstract methods from the base class\n3. Register the provider in `git_providers/__init__.py`\n4. Add provider selection logic based on PR URL patterns\n5. Implement feature detection via `is_supported()`\n\n### Required Abstract Methods\n\n| Category | Methods |\n|----------|---------|\n| PR Info | `get_pr_title()`, `get_pr_description()`, `get_user()` |\n| Diff | `get_diff_files()`, `get_diff()`, `get_pr_file_content()` |\n| Comments | `publish_comment()`, `get_comments()`, `remove_initial_comment()` |\n| Labels | `get_labels()`, `add_label()`, `remove_label()` |\n| Utils | `is_supported()`, `get_line_link()` |\n\n## Best Practices\n\n1. **Always check feature support** before using platform-specific features\n2. **Handle missing file content** by falling back to patch extraction\n3. **Use consistent error handling** with proper logging\n4. **Test across providers** when adding new provider-agnostic features\n\n---\n\n<a id='command-handling'></a>\n\n## Command-to-Tool Mapping\n\n### 相关页面\n\n相关主题：[System Architecture](#architecture), [Tools Overview](#tools-overview)\n\n<details>\n<summary>Relevant Source Files</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/agent/pr_agent.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/agent/pr_agent.py)\n- [pr_agent/cli.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/cli.py)\n- [pr_agent/algo/cli_args.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/cli_args.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n</details>\n\n# Command-to-Tool Mapping\n\n## Overview\n\nThe Command-to-Tool Mapping system in PR-Agent is the core routing mechanism that translates user-issued commands (such as `/review`, `/describe`, `/improve`) into corresponding tool invocations. This mapping enables the framework to dispatch requests to appropriate specialized tools while managing configuration, argument parsing, and execution flow.\n\nThe system serves as the entry point for all user interactions, whether they occur via GitHub/GitLab comments, CLI execution, or programmatic API calls.\n\n## Architecture\n\n```mermaid\ngraph TD\n    A[User Command] --> B[CLI / Comment Handler]\n    B --> C[Command Parser]\n    C --> D[Argument Extraction]\n    D --> E[Tool Router]\n    E --> F{Command Type}\n    F -->|/describe| G[pr_description.py]\n    F -->|/review| H[pr_reviewer.py]\n    F -->|/improve| I[pr_code_suggestions.py]\n    F -->|/ask| J[pr_ask.py]\n    F -->|/help| K[help.py]\n    G --> L[Git Provider]\n    H --> L\n    I --> L\n    J --> L\n    K --> M[Documentation]\n```\n\n## Core Components\n\n### Command Registry\n\nThe command registry maps slash commands to their corresponding tool implementations. Based on the help system and tool definitions, the following commands are registered:\n\n| Command | Tool Module | Purpose |\n|---------|-------------|---------|\n| `/describe` | `pr_description.py` | Generate PR description, title, type, summary, walkthrough |\n| `/review` | `pr_reviewer.py` | Perform automated code review |\n| `/improve` | `pr_code_suggestions.py` | Generate code improvement suggestions |\n| `/ask` | `pr_ask.py` | Answer questions about PR changes |\n| `/help_docs` | `help_docs.py` | Query repository documentation |\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n### Argument Parsing\n\nThe `cli_args.py` module handles command-line argument parsing and configuration overrides. Commands can accept configuration parameters in two formats:\n\n**Inline Configuration (GitHub Comment):**\n```\n/describe --pr_description.some_config1=value1 --pr_description.some_config2=value2\n```\n\n**Configuration File Format:**\n```toml\n[pr_description]\nsome_config1=value1\nsome_config2=value2\n```\n\n资料来源：[pr_agent/servers/help.py:30-45]()\n\n## Command Handlers\n\n### Describe Command\n\nThe `/describe` command triggers automatic PR description generation.\n\n```python\n@staticmethod\ndef get_describe_usage_guide():\n    output = \"**Overview:**\\n\"\n    output += \"The `describe` tool scans the PR code changes, and generates a description for the PR\"\n```\n\n**Configuration Section:** `pr_description`\n\n**Key Parameters:**\n- `enable_help_comment` - Show help links in PR body\n- `use_description_markers` - Use markers in PR description for selective updates\n- `output_relevant_configurations` - Display relevant config settings\n\n资料来源：[pr_agent/tools/pr_description.py:1-30]()\n\n### Review Command\n\nThe `/review` command initiates automated code review.\n\n```python\n# Configuration template from help message\n/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...\n```\n\n**Configuration Section:** `pr_reviewer`\n\n资料来源：[pr_agent/servers/help.py:50-70]()\n\n### Improve Command\n\nThe `/improve` command generates code improvement suggestions.\n\n```python\n@staticmethod\ndef get_improve_usage_guide():\n    output = \"**Overview:**\\n\"\n    output += \"The code suggestions tool, named `improve`, scans the PR code changes...\"\n```\n\n**Configuration Section:** `pr_code_suggestions`\n\n**Key Features:**\n- Automatic triggering on PR open\n- Manual invocation via comment\n- Configurable suggestion categories and scoring\n\n资料来源：[pr_agent/servers/help.py:50-100]()\n\n### Ask Command\n\nThe `/ask` command answers questions about the PR without maintaining conversation state.\n\n```\n/ask \"What changes were made to the authentication module?\"\n```\n\n```python\n@staticmethod\ndef get_ask_usage_guide():\n    output += \"\"\"\\\nThe `ask` tool answers questions about the PR, based on the PR code changes.\nNote that the tool does not have \"memory\" of previous questions,\nand answers each question independently.\nYou can ask questions about the entire PR, about specific code lines,\nor about an image related to the PR code changes.\n```\n\n资料来源：[pr_agent/servers/help.py:80-95]()\n\n### Help Docs Command\n\nThe `/help_docs` command queries repository documentation.\n\n```python\n@staticmethod\ndef get_help_docs_usage_guide():\n    output = \"**Overview:**\\n\"\n    output += \"\"\"\\\nThe help docs tool, named `help_docs`, answers a question based on\na given relative path of documentation.\"\"\"\n```\n\n资料来源：[pr_agent/servers/help.py:130-145]()\n\n## Execution Flow\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant CLI as Command Line\n    participant Parser as Argument Parser\n    participant Router as Tool Router\n    participant Tool as Selected Tool\n    participant Provider as Git Provider\n\n    User->>CLI: /command --config=value\n    CLI->>Parser: Parse arguments\n    Parser->>Router: Route to tool\n    Router->>Tool: Instantiate tool class\n    Tool->>Provider: Fetch PR data\n    Provider-->>Tool: Diff files, comments\n    Tool->>Tool: Process and analyze\n    Tool->>Provider: Post results\n    Provider-->>User: PR comment/response\n```\n\n## Configuration Integration\n\n### Configuration Precedence\n\nThe system follows a hierarchical configuration resolution:\n\n1. **Default values** - Defined in tool settings\n2. **Configuration file** - User-defined settings in `.pr_agent.toml` or `settings/configuration.toml`\n3. **Command arguments** - Inline overrides from command invocation\n4. **Environment variables** - System-level settings\n\n### Relevant Configurations Output\n\nWhen enabled, the system can output relevant configuration settings in the PR response:\n\n```python\nif get_settings().get('config', {}).get('output_relevant_configurations', False):\n    pr_body += show_relevant_configurations(relevant_section='pr_description')\n```\n\n资料来源：[pr_agent/tools/pr_description.py:25-27]()\n\n## CLI Integration\n\nThe CLI module (`cli.py`) provides command-line access to all tools:\n\n```bash\n# Local repository CLI usage\npr-agent --pr_url https://github.com/owner/repo/pull/123 review\n\n# Help text\npr-agent --help\n```\n\nThe CLI maps the `--pr_url` parameter and selected command to the appropriate tool implementation.\n\n资料来源：[README.md:30-40]()\n\n## Tool Output Formatting\n\nThe utility module (`algo/utils.py`) provides shared formatting functions used across all tools:\n\n| Function | Purpose |\n|----------|---------|\n| `parse_code_suggestion()` | Convert code suggestions to markdown |\n| `extract_relevant_lines_str()` | Extract relevant code lines from diff |\n| `render_issue()` | Format review findings as markdown |\n\n资料来源：[pr_agent/algo/utils.py:50-150]()\n\n## Summary\n\nThe Command-to-Tool Mapping system provides:\n\n- **Unified Interface**: Single entry point for all user interactions\n- **Flexible Configuration**: Per-command and global configuration options\n- **Extensible Architecture**: Easy addition of new commands and tools\n- **Consistent Output**: Standardized markdown formatting across tools\n- **Multi-Platform Support**: Works with GitHub, GitLab, Bitbucket, and Azure DevOps\n\nThis architecture enables PR-Agent to maintain a clean separation between command handling, tool implementation, and output rendering, facilitating maintainability and extensibility.\n\n---\n\n<a id='tools-overview'></a>\n\n## Tools Overview\n\n### 相关页面\n\n相关主题：[/describe Tool](#describe-tool), [/review Tool](#review-tool), [/improve Tool](#improve-tool), [Additional Tools](#additional-tools)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n- [pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n- [pr_agent/git_providers/bitbucket_server_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n</details>\n\n# Tools Overview\n\nPR-Agent provides a comprehensive suite of AI-powered tools for automated pull request analysis, review, and enhancement. These tools are designed to streamline the code review process by automating routine tasks and providing intelligent suggestions.\n\n## Architecture Overview\n\nThe tools system in PR-Agent follows a modular architecture where each tool is responsible for a specific aspect of PR management. Tools can be invoked automatically (on PR events) or manually via slash commands in PR comments.\n\n```mermaid\ngraph TD\n    A[GitHub/GitLab/Bitbucket Event] --> B[PR Agent Core]\n    B --> C[Tool Router]\n    C --> D[/describe]\n    C --> E[/review]\n    C --> F[/improve]\n    C --> G[/ask]\n    C --> H[/help_docs]\n    \n    D --> I[pr_description.py]\n    E --> J[pr_reviewer.py]\n    F --> K[pr_code_suggestions.py]\n    G --> L[pr_questions.py]\n    H --> M[Help System]\n    \n    I --> N[Markdown Output]\n    J --> N\n    K --> N\n    L --> N\n    M --> N\n```\n\n## Available Tools\n\nPR-Agent includes five core tools, each designed for specific PR workflow tasks:\n\n| Tool | Purpose | Invocation |\n|------|---------|------------|\n| `/describe` | Generates PR description (title, type, summary, walkthrough, labels) | Automatic or manual |\n| `/review` | Performs comprehensive code review with issue detection | Automatic or manual |\n| `/improve` | Provides code improvement suggestions | Automatic or manual |\n| `/ask` | Answers questions about the PR code changes | Manual only |\n| `/help_docs` | Retrieves documentation based on repository files | Manual only |\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n## Tool Invocation Patterns\n\n### Slash Command Invocation\n\nTools can be triggered by commenting directly on a PR using slash commands:\n\n```\n/describe --pr_description.some_config1=... --pr_description.some_config2=...\n/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...\n/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...\n/ask \"Your question here\"\n/help_docs \"path/to/documentation\"\n```\n\n资料来源：[pr_agent/servers/help.py:8-25]()\n\n### Configuration File Invocation\n\nFor persistent configuration, tools can be configured via a configuration file:\n\n```toml\n[pr_description]\nsome_config1=...\nsome_config2=...\n\n[pr_reviewer]\nsome_config1=...\nsome_config2=...\n\n[pr_code_suggestions]\nsome_config1=...\nsome_config2=...\n```\n\n## Describe Tool\n\nThe `describe` tool scans PR code changes and generates a comprehensive description including:\n\n- **Title**: Short, concise PR title (up to 10 words)\n- **Type**: PR classification (Bug fix, Enhancement, Documentation, etc.)\n- **Summary**: Brief overview of changes\n- **Walkthrough**: File-by-file change explanation\n- **Labels**: Relevant labels for the PR\n\n### Description Markers\n\nWhen `use_description_markers` is enabled, the tool replaces markers in the PR description:\n\n```markdown\npr_agent:type\npr_agent:summary\npr_agent:walkthrough\npr_agent:diagram\n```\n\n资料来源：[pr_agent/servers/help.py:85-105]()\n\n### Custom Labels\n\nThe describe tool supports custom labels defined in the repository's labels page or configuration:\n\n```toml\n[pr_description]\nextra_instructions=\"\"\"\\\n- The PR title should be in the format: '<PR type>: <title>'\n- The title should be short and concise (up to 10 words)\n\"\"\"\n```\n\nSupported custom label formats:\n- `Main topic:performance` - Marks performance-related PRs\n- `New endpoint` - Indicates new API endpoints\n- `SQL query` - Flags SQL changes\n- `Dockerfile changes` - Identifies container changes\n\n## Review Tool\n\nThe `/review` tool performs comprehensive code review by analyzing:\n\n- Code quality issues\n- Security vulnerabilities\n- Performance concerns\n- Test coverage gaps\n- Documentation completeness\n\n### Review Focus Areas\n\nThe review tool generates a table of recommended focus areas with links to relevant code sections:\n\n```python\n# From pr_description.py - Focus areas structure\nif gfm_supported:\n    issue_str = f\"<details><summary><a href='{reference_link}'><strong>{issue_header}</strong></a>\\n\\n{issue_content}\\n</summary>\\n\\n{relevant_lines_str}\\n\\n</details>\"\n```\n\n## Improve Tool (Code Suggestions)\n\nThe `improve` tool generates actionable code improvement suggestions, organized by category and impact score.\n\n### Suggestion Output Structure\n\n```mermaid\ngraph TD\n    A[Code Suggestions] --> B[Group by Label]\n    B --> C[Sort by Score]\n    C --> D[Category Column]\n    C --> E[Suggestion Column]\n    C --> F[Impact Column]\n```\n\n### Suggestion Table Format\n\nThe tool outputs suggestions in a structured table format:\n\n```html\n<table>\n<thead>\n<tr>\n<td><strong>Category</strong></td>\n<td align=left><strong>Suggestion</strong></td>\n<td align=center><strong>Impact</strong></td>\n</tr>\n</thead>\n<tbody>\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:30-45]()\n\n### Suggestion Processing\n\nSuggestions are processed through the following pipeline:\n\n1. **Label Grouping**: Suggestions are grouped by their category labels\n2. **Score Sorting**: Groups and suggestions within are sorted by score (descending)\n3. **Markdown Formatting**: Suggestions are formatted using GitHub Flavored Markdown\n\n```python\n# Group suggestions by label\nsuggestions_labels = dict()\nfor suggestion in data['code_suggestions']:\n    label = suggestion['label'].strip().strip(\"'\").strip('\"')\n    if label not in suggestions_labels:\n        suggestions_labels[label] = []\n    suggestions_labels[label].append(suggestion)\n\n# Sort by highest score\nsuggestions_labels = dict(\n    sorted(suggestions_labels.items(), \n           key=lambda x: max([s['score'] for s in x[1]]), \n           reverse=True))\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:50-70]()\n\n## Ask Tool\n\nThe `ask` tool provides conversational access to PR information:\n\n- Answers questions about the entire PR\n- Can reference specific code lines\n- Processes images related to PR changes\n- Independent question answering (no memory of previous questions)\n\n```\n/ask \"What is the purpose of the new authentication module?\"\n/ask \"Explain the changes in src/utils.py lines 50-100\"\n```\n\nNote: Each question is answered independently without context from previous questions.\n\n资料来源：[pr_agent/servers/help.py:115-130]()\n\n## Help Docs Tool\n\nThe `help_docs` tool retrieves and explains documentation based on repository files:\n\n```\n/help_docs \"How do I configure the CI pipeline?\"\n```\n\nThis tool searches documentation within the repository or a specified external repository.\n\n## Output Formatting\n\n### GitHub Flavored Markdown Support\n\nPR-Agent detects GFM support and adjusts output accordingly:\n\n```python\nif gfm_supported:\n    markdown_text += '<table>'\n    # Table-based formatting with collapsible sections\nelse:\n    # Standard markdown with headers\n    markdown_text += f\"### {emoji} {key_nice}: {value}\\n\\n\"\n```\n\n### Collapsible File Lists\n\nFor PRs with many changed files, the tools use collapsible sections:\n\n```html\n<details><summary>{filename}</summary>\n<hr>\n{file_content}\n</details>\n```\n\n资料来源：[pr_agent/tools/pr_description.py:100-130]()\n\n### Diff Statistics\n\nFile changes are displayed with diff statistics:\n\n```python\ndiff_plus_minus += f\"+{num_plus_lines}/-{num_minus_lines}\"\n```\n\n## Configuration System\n\n### Per-Tool Configuration\n\nEach tool has its own configuration section:\n\n| Tool | Configuration Section | Location |\n|------|----------------------|----------|\n| Describe | `pr_description` | pr_agent/settings/configuration.toml |\n| Review | `pr_reviewer` | pr_agent/settings/configuration.toml |\n| Improve | `pr_code_suggestions` | pr_agent/settings/configuration.toml |\n\n### Configuration Output\n\nWhen `output_relevant_configurations` is enabled, tools output relevant settings:\n\n```python\nif get_settings().get('config', {}).get('output_relevant_configurations', False):\n    pr_body += show_relevant_configurations(relevant_section='pr_description')\n```\n\n资料来源：[pr_agent/tools/pr_config.py:1-30]()\n\n## Help Comments\n\nTools can optionally add help comments to PR descriptions:\n\n```python\nif get_settings().pr_description.enable_help_comment and self.git_provider.is_supported(\"gfm_markdown\"):\n    pr_body += ('\\n\\n___\\n\\n> <details> <summary>  Need help?</summary><li>Type <code>/help how to ...</code> '\n                'in the comments thread for any questions about PR-Agent usage.</li><li>Check out the '\n                '<a href=\"https://qodo-merge-docs.qodo.ai/usage-guide/\">documentation</a> '\n                'for more information.</li></details>')\n```\n\n资料来源：[pr_agent/tools/pr_description.py:45-60]()\n\n## Multi-Platform Support\n\nPR-Agent tools adapt their output based on the Git provider:\n\n### GitHub\n\nUses full GFM support with table formatting and collapsible sections.\n\n### GitLab\n\nAdapted output for GitLab markdown compatibility:\n\n```python\nelse:  # gitlab\n    pr_body += (\"\\n\\n___\\n\\n<details><summary>Need help?</summary>- Type <code>/help how to ...</code> in the comments \"\n                \"thread for any questions about PR-Agent usage.<br>- Check out the \"\n                \"<a href='https://qodo-merge-docs.qodo.ai/usage-guide/'>documentation</a> for more information.</details>\")\n```\n\n### Bitbucket\n\nBitbucket Server has limited multi-line suggestion support, so code suggestions use code blocks instead:\n\n```python\n# Bitbucket does not support multi-line suggestions so use a code block instead\nbody = body.replace(\"```suggestion\", \"```\")\n```\n\n资料来源：[pr_agent/git_providers/bitbucket_server_provider.py:150-160]()\n\n## Workflow Integration\n\n### Automatic Triggers\n\nTools can be configured to run automatically on PR events:\n\n```yaml\npr_commands = [\"/describe\", \"/review\", \"/improve\"]\n```\n\nWith markers enabled:\n\n```yaml\npr_commands = [\"/describe --pr_description.use_description_markers=true\", ...]\n```\n\n### Manual Invocation\n\nFor interactive use, tools are invoked via PR comments:\n\n```bash\n# Review a specific aspect\n/review --pr_reviewer.extra_instructions=\"Focus on security issues only\"\n```\n\n## Summary\n\nThe PR-Agent tools system provides comprehensive automation for pull request workflows:\n\n- **Describe**: Automatic PR documentation\n- **Review**: Intelligent code analysis\n- **Improve**: Actionable suggestions\n- **Ask**: Conversational PR queries\n- **Help Docs**: Documentation retrieval\n\nEach tool is independently configurable, supports multiple Git providers, and can be integrated into CI/CD pipelines or used interactively.\n\n---\n\n<a id='describe-tool'></a>\n\n## /describe Tool\n\n### 相关页面\n\n相关主题：[Tools Overview](#tools-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/tools/pr_description.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_description.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n- [AGENTS.md](https://github.com/The-PR-Agent/pr-agent/blob/main/AGENTS.md)\n</details>\n\n# /describe Tool\n\nThe `/describe` tool is one of the core features of PR-Agent that automatically generates comprehensive descriptions for Pull Requests by analyzing code changes.\n\n## Overview\n\nThe `describe` tool scans PR code changes and automatically generates a structured description including:\n\n- **PR Title** - Concise summary of the changes\n- **PR Type** - Classification (Bug fix, Enhancement, Documentation, Tests, Other)\n- **Summary** - High-level overview of modifications\n- **Walkthrough** - File-by-file breakdown of changes\n- **Labels** - Automatically suggested labels based on content\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n## Architecture\n\n```mermaid\ngraph TD\n    A[PR Opened/Updated] --> B{Automation Triggered?}\n    B -->|Yes| C[Automatic Mode]\n    B -->|No| D[Manual Comment: /describe]\n    C --> E[PRDescriptionTool.run]\n    D --> E\n    E --> F[Analyze Diff Files]\n    F --> G[Generate Title & Type]\n    G --> H[Generate Summary]\n    H --> I[Generate Walkthrough Table]\n    I --> J[Apply Labels]\n    J --> K[Update PR Description]\n    K --> L[Optional: Add Help Comment]\n```\n\n## Usage Modes\n\n### Automatic Mode\n\nThe tool can run automatically when a PR is opened or updated, configured via GitHub App settings.\n\n```yaml\n# Default automation configuration\npr_commands = [\"/describe\", ...]\n```\n\n资料来源：[pr_agent/servers/help.py:70-85]()\n\n### Manual Mode\n\nInvoke manually by commenting on a PR:\n\n```\n/describe\n```\n\nWith custom configurations:\n\n```\n/describe --pr_description.some_config1=... --pr_description.some_config2=...\n```\n\n资料来源：[pr_agent/servers/help.py:45-60]()\n\n### Marker Mode\n\nAn alternative approach using markers in the PR description:\n\n```yaml\npr_commands = [\"/describe --pr_description.use_description_markers=true\", ...]\n```\n\nAvailable markers:\n- `pr_agent:type` - PR type\n- `pr_agent:summary` - PR summary\n- `pr_agent:walkthrough` - File walkthrough\n- `pr_agent:diagram` - Sequence diagram (if enabled)\n\n资料来源：[pr_agent/servers/help.py:80-100]()\n\n## Output Structure\n\nThe generated PR description follows this structure:\n\n| Section | Description |\n|---------|-------------|\n| Title | PR type prefix + concise title (max 10 words) |\n| Type | Classification of the change |\n| Summary | High-level description of modifications |\n| Walkthrough | Table of changed files with descriptions |\n| Labels | Suggested labels for categorization |\n\n## Configuration Options\n\n### Configuration File\n\n```toml\n[pr_description]\nextra_instructions=\"\"\"\\\n- The PR title should be in the format: '<PR type>: <title>'\n- The title should be short and concise (up to 10 words)\n- Use bullet points for clarity\n\"\"\"\n```\n\n### Key Configuration Parameters\n\n| Parameter | Description | Default |\n|-----------|-------------|---------|\n| `enable_help_comment` | Add help text to PR | `true` |\n| `use_description_markers` | Use markers in PR body | `false` |\n| `enable_generate_title` | Auto-generate title | `true` |\n| `enable.type` | Include PR type | `true` |\n| `enable.walkthrough` | Include file walkthrough | `true` |\n| `enable.labels` | Include labels | `true` |\n| `extra_instructions` | Custom instructions | `\"\"` |\n\n资料来源：[pr_agent/servers/help.py:46-55]()\n\n## Walkthrough Table Format\n\nThe file walkthrough is rendered as a markdown table with collapsible sections:\n\n```markdown\n| Theme | Files Changed |\n|-------|---------------|\n| **Core Logic** | <details><summary>2 files</summary>... |\n```\n\n### Table Components\n\n| Component | Description |\n|-----------|-------------|\n| `file_changes_title` | Category or component name |\n| `diff_plus_minus` | Lines added/removed (`+X/-Y`) |\n| `file_change_description` | Description of changes |\n| `link` | URL to file diff |\n\n资料来源：[pr_agent/tools/pr_description.py:100-150]()\n\n## Custom Labels\n\nThe tool supports custom labels defined in the repository's labels page:\n\n### Default Labels\n\n- `Bug fix`\n- `Tests`\n- `Enhancement`\n- `Documentation`\n- `Other`\n\n### Custom Label Format\n\n```\nMain topic:performance - pr_agent:The main topic of this PR is performance\nNew endpoint - pr_agent:A new endpoint was added in this PR\nSQL query - pr_agent:A new SQL query was added in this PR\nDockerfile changes - pr_agent:The PR contains changes in the Dockerfile\n```\n\n资料来源：[pr_agent/servers/help.py:105-130]()\n\n## Help Comment Integration\n\nWhen enabled, a help comment is appended to the PR:\n\n```html\n> <details> <summary> Need help?</summary>\n> <li>Type <code>/help how to ...</code> in the comments thread</li>\n> <li>Check out the <a href=\"...\">documentation</a></li>\n> </details>\n```\n\nThis is displayed conditionally based on:\n- `enable_help_comment` setting\n- Git provider support for GFM markdown\n- Provider type (GitHub vs GitLab)\n\n资料来源：[pr_agent/tools/pr_description.py:25-45]()\n\n## Implementation Flow\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant GitProvider\n    participant PRDescriptionTool\n    participant Model\n    \n    User->>GitProvider: Opens PR\n    GitProvider->>PRDescriptionTool: Trigger /describe\n    PRDescriptionTool->>GitProvider: Get diff files\n    GitProvider-->>PRDescriptionTool: Return diff\n    PRDescriptionTool->>Model: Request description\n    Model-->>PRDescriptionTool: Generated content\n    PRDescriptionTool->>PRDescriptionTool: Format markdown\n    PRDescriptionTool->>GitProvider: Update PR description\n    alt enable_help_comment\n        PRDescriptionTool->>GitProvider: Add help comment\n    end\n```\n\n## Code Suggestion Integration\n\nThe describe tool works alongside the `improve` tool for code suggestions:\n\n```python\n# From pr_description.py\nif get_settings().get('config', {}).get('output_relevant_configurations', False):\n    pr_body += show_relevant_configurations(relevant_section='pr_description')\n```\n\n资料来源：[pr_agent/tools/pr_description.py:50-52]()\n\n## Relevant Configuration Display\n\nWhen `output_relevant_configurations` is enabled, relevant settings are included in the output:\n\n```toml\n[pr_description]\nsome_config1=...\nsome_config2=...\n```\n\n资料来源：[pr_agent/tools/pr_config.py:1-20]()\n\n## Related Commands\n\n| Command | Purpose |\n|---------|---------|\n| `/review` | Analyze PR code and provide feedback |\n| `/improve` | Generate code improvement suggestions |\n| `/ask` | Answer questions about the PR |\n| `/help_docs` | Answer questions from documentation |\n\n## Best Practices\n\n1. **Custom Labels**: Define labels relevant to your repository's domain\n2. **Extra Instructions**: Use `extra_instructions` for project-specific formatting rules\n3. **Markers**: Use markers for incremental updates to PR descriptions\n4. **Automation**: Enable automatic triggering for consistent documentation\n\n资料来源：[AGENTS.md:1-30]()\n\n## Summary\n\nThe `/describe` tool is a powerful feature that transforms raw code changes into human-readable PR descriptions. It supports multiple invocation modes, customizable output formats, and integrates seamlessly with GitHub's workflow automation capabilities.\n\n---\n\n<a id='review-tool'></a>\n\n## /review Tool\n\n### 相关页面\n\n相关主题：[Tools Overview](#tools-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n- [pr_agent/git_providers/bitbucket_server_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n</details>\n\n# /review Tool\n\n## Overview\n\nThe `/review` tool is a core component of PR-Agent that performs automated code review of pull requests. It scans PR code changes and provides a comprehensive analysis including code quality assessment, potential bugs, security issues, testing gaps, and improvement suggestions.\n\nThe tool can be triggered automatically when a new PR is opened, or invoked manually by commenting on a PR with the `/review` command.\n\n## Architecture\n\n```mermaid\ngraph TD\n    A[User Trigger: /review] --> B[Git Provider Integration]\n    B --> C[Diff Files Extraction]\n    C --> D[PR Reviewer Engine]\n    D --> E[LLM Analysis]\n    E --> F[Review Output Generation]\n    F --> G[Publish to PR Comments]\n    \n    H[Configuration] --> D\n    I[Prompt Templates] --> E\n```\n\n## Invocation Methods\n\n### Manual Invocation\n\nTo invoke the review tool manually, comment on a PR with:\n\n```\n/review\n```\n\nTo customize behavior, pass configuration parameters:\n\n```\n/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...\n```\n\n### Configuration File\n\nAlternatively, configure via a configuration file:\n\n```toml\n[pr_reviewer]\nsome_config1=...\nsome_config2=...\n```\n\n## Configuration Options\n\nThe `pr_reviewer` section in `configuration.toml` controls the review tool behavior:\n\n| Parameter | Description | Default |\n|-----------|-------------|---------|\n| `enable_help_text` | Show help text in review output | `true` |\n| `enable_load_files` | Load file contents for deeper analysis | `false` |\n| `enable_intro` | Show introduction section | `true` |\n| `enable_final_comment` | Add final summary comment | `true` |\n| `enable_review_status` | Track review completion status | `false` |\n\n资料来源：[pr_agent/servers/help.py:1-30]()\n\n## Review Output Structure\n\nThe review output is generated in markdown format with collapsible sections. The output follows this structure:\n\n```markdown\n## PR Review Summary\n\n[Overview of changes]\n\n### Code Quality Assessment\n[Analysis of code structure and patterns]\n\n### Potential Issues\n[List of identified problems]\n\n### Suggestions\n[Improvement recommendations]\n\n### Security Considerations\n[Security-relevant findings]\n```\n\n## Integration with Code Suggestions\n\nThe review tool leverages the code suggestions subsystem to provide actionable improvement recommendations:\n\n```python\n# From pr_code_suggestions.py\nsuggestions_labels = dict()\nfor suggestion in data['code_suggestions']:\n    label = suggestion['label'].strip()\n    if label not in suggestions_labels:\n        suggestions_labels[label] = []\n    suggestions_labels[label].append(suggestion)\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:50-60]()\n\n## Code Suggestion Display Format\n\nWhen GFM (GitHub Flavored Markdown) is supported, suggestions are displayed in a structured table:\n\n```html\n<table>\n  <thead>\n    <tr>\n      <td><strong>Category</strong></td>\n      <td align=left><strong>Suggestion</strong></td>\n      <td align=center><strong>Impact</strong></td>\n    </tr>\n  </thead>\n  <tbody>\n    <!-- Suggestions rendered here -->\n  </tbody>\n</table>\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:40-50]()\n\n## Markdown Rendering Utilities\n\nThe tool uses utility functions to convert suggestion dictionaries to markdown:\n\n```python\ndef parse_code_suggestion(code_suggestion: dict, i: int = 0, gfm_supported: bool = True) -> str:\n    \"\"\"\n    Convert a dictionary of data into markdown format.\n    \"\"\"\n    markdown_text = \"\"\n    if gfm_supported and 'relevant_line' in code_suggestion:\n        markdown_text += '<table>'\n        # ... table rendering logic\n    markdown_text += \"</table>\\n\"\n    return markdown_text\n```\n\n资料来源：[pr_agent/algo/utils.py:100-120]()\n\n## Git Provider Integration\n\nThe review output can be published to different Git platforms. The `publish_code_suggestions` method in `bitbucket_server_provider.py` demonstrates platform-specific handling:\n\n```python\nif relevant_lines_end > relevant_lines_start:\n    # Bitbucket does not support multi-line suggestions\n    body = body.replace(\"```suggestion\", \"```\")\n    post_parameters = {\n        \"body\": body,\n        \"path\": relevant_file,\n        \"line\": relevant_lines_end,\n        # ...\n    }\n```\n\n资料来源：[pr_agent/git_providers/bitbucket_server_provider.py:1-30]()\n\n## Configuration Output\n\nThe tool can output relevant configurations in the review comment when enabled:\n\n```python\ndef show_relevant_configurations(relevant_section='pr_description') -> str:\n    # Returns formatted markdown of configuration settings\n```\n\n资料来源：[pr_agent/tools/pr_config.py:1-20]()\n\n## Workflow Diagram\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant GitProvider\n    participant ReviewTool\n    participant LLM\n    participant OutputFormatter\n    \n    User->>GitProvider: /review command\n    GitProvider->>ReviewTool: Fetch PR diff\n    ReviewTool->>LLM: Send for analysis\n    LLM->>OutputFormatter: Return structured review\n    OutputFormatter->>GitProvider: Format as markdown\n    GitProvider->>User: Publish review comment\n```\n\n## File Walkthrough Parsing\n\nThe review tool parses file walkthroughs from PR descriptions using regex patterns:\n\n```python\nregex_pattern = r'<details.*?>\\s*<summary>\\s*<h3>\\s*' + re.escape(PRDescriptionHeader.FILE_WALKTHROUGH.value) + r'\\s*</h3>\\s*</summary>'\ndescription_split = re.split(regex_pattern, description_full, maxsplit=1, flags=re.DOTALL)\n```\n\n资料来源：[pr_agent/algo/utils.py:150-160]()\n\n## Help Text Integration\n\nThe review tool includes contextual help text that can be displayed based on configuration:\n\n```python\nif get_settings().pr_reviewer.enable_help_text and self.git_provider.is_supported(\"gfm_markdown\"):\n    pr_body += HelpMessage.get_review_usage_guide()\n```\n\n资料来源：[pr_agent/servers/help.py:10-20]()\n\n## Automated Triggers\n\nThe review tool can be configured to run automatically on PR events:\n\n```yaml\npr_commands = [\"/review\", ...]  # Default mode\n# Or with specific configurations:\npr_commands = [\"/review --pr_reviewer.enable_intro=false\", ...]\n```\n\n资料来源：[pr_agent/servers/help.py:15-25]()\n\n## Best Practices\n\n1. **Use specific configurations** to focus review on relevant aspects (security, code quality, etc.)\n2. **Enable intro text** for new team members to understand review comments\n3. **Disable help text** in short-lived branches to reduce noise\n4. **Combine with `/improve`** for actionable code suggestions\n\n## External Documentation\n\nFor comprehensive usage guides and examples, see the official documentation:\n- [Review Tool Usage](https://pr-agent-docs.codium.ai/tools/review/)\n- [Configuration Options](https://pr-agent-docs.codium.ai/usage-guide/configuration_options/)\n- [Automations](https://pr-agent-docs.codium.ai/usage-guide/automations_and_usage/#github-app-automatic-tools-when-a-new-pr-is-opened)\n\n---\n\n<a id='improve-tool'></a>\n\n## /improve Tool\n\n### 相关页面\n\n相关主题：[Tools Overview](#tools-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/tools/pr_code_suggestions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n- [pr_agent/git_providers/bitbucket_server_provider.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/git_providers/bitbucket_server_provider.py)\n- [pr_agent/tools/pr_config.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_config.py)\n</details>\n\n# /improve Tool\n\n## Overview\n\nThe `/improve` tool is a PR-Agent module that automatically scans pull request code changes and generates actionable code suggestions for improving the PR. It serves as the core component behind the `pr_code_suggestions` feature, providing developers with intelligent recommendations to enhance code quality, performance, and maintainability.\n\nThe tool can be triggered automatically when a PR is opened or invoked manually by commenting `/improve` on any pull request.\n\n## Key Characteristics\n\n| Attribute | Description |\n|-----------|-------------|\n| Tool Name | `improve` |\n| Configuration Section | `pr_code_suggestions` |\n| Invocation Command | `/improve` |\n| Auto-trigger Support | Yes |\n| Manual Trigger | Via PR comment |\n| Output Format | Markdown table with collapsible code diffs |\n\n## Architecture\n\n```mermaid\ngraph TD\n    A[PR Opened / /improve Command] --> B[pr_code_suggestions.py]\n    B --> C[Get Diff Files from PR]\n    C --> D[Analyze Code Changes]\n    D --> E[Generate Suggestions via LLM]\n    E --> F[Parse & Format Suggestions]\n    F --> G[Render Markdown Output]\n    G --> H[Post to PR as Comment]\n    \n    F --> I[parse_code_suggestion function]\n    I --> J[Table Format with GFM]\n    I --> K[Diff Code Generation]\n    \n    H --> L[GitHub Provider]\n    H --> M[GitLab Provider]\n    H --> N[Bitbucket Provider]\n```\n\n## Data Flow\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant GitProvider\n    participant ImproveTool\n    participant LLM\n    participant MarkdownRenderer\n    \n    User->>GitProvider: Trigger /improve command\n    GitProvider->>ImproveTool: Pass PR diff files\n    ImproveTool->>LLM: Request code suggestions\n    LLM->>ImproveTool: Return structured suggestions\n    ImproveTool->>MarkdownRenderer: Parse suggestion data\n    MarkdownRenderer->>ImproveTool: Generate formatted markdown\n    ImproveTool->>GitProvider: Post comment to PR\n```\n\n## Configuration Options\n\nThe `/improve` tool is configured via the `pr_code_suggestions` section in the configuration file or through command-line arguments.\n\n### Configuration Parameters\n\n| Parameter | Type | Description | Default |\n|-----------|------|-------------|---------|\n| `enable_help_comment` | bool | Show help instructions in PR comment | Varies |\n| `num_code_suggestions` | int | Maximum number of suggestions to generate | Config dependent |\n\n### Command-Line Override\n\nWhen commenting on a PR, edit configurations using:\n\n```bash\n/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...\n```\n\n### Configuration File Format\n\n```toml\n[pr_code_suggestions]\nsome_config1=...\nsome_config2=...\n```\n\n资料来源：[pr_agent/servers/help.py:78-90]()\n\n## Output Format\n\n### Markdown Table Structure\n\nThe tool renders suggestions in a structured table format:\n\n```\nCategory | Suggestion Content | Impact\n---------|-------------------|--------\n```\n\n### Suggestion Component Model\n\nEach code suggestion contains:\n\n| Field | Description |\n|-------|-------------|\n| `label` | Category/label for the suggestion |\n| `score` | Priority score (used for sorting) |\n| `one_sentence_summary` | Brief description |\n| `existing_code` | Original code block |\n| `improved_code` | Suggested improved code |\n| `relevant_file` | Target file path |\n| `relevant_lines_start` | Start line number |\n| `relevant_lines_end` | End line number |\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:1-50]()\n\n### Rendering Logic\n\nThe rendering engine sorts suggestions by:\n\n1. **Primary sort**: Group by label, ordered by highest score within each group\n2. **Secondary sort**: Within each label group, suggestions are sorted by score descending\n\n```python\nsuggestions_labels = dict(\n    sorted(suggestions_labels.items(), key=lambda x: max([s['score'] for s in x[1]]), reverse=True))\nfor label, suggestions in suggestions_labels.items():\n    suggestions_labels[label] = sorted(suggestions, key=lambda x: x['score'], reverse=True)\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:30-40]()\n\n## Diff Generation\n\n### Unified Diff Format\n\nThe tool generates `unified_diff` output for comparing existing and improved code:\n\n```python\ndiff = difflib.unified_diff(\n    existing_code.split('\\n'),\n    improved_code.split('\\n'), \n    n=999\n)\npatch_orig = \"\\n\".join(diff)\npatch = \"\\n\".join(patch_orig.splitlines()[5:]).strip('\\n')\n```\n\n资料来源：[pr_agent/tools/pr_code_suggestions.py:80-90]()\n\n### Output Wrapper\n\n```markdown\n```diff\n--- original\n+++ improved\n@@ ... @@\n...diff content...\n```\n```\n\n## Multi-Provider Support\n\n### GitHub Provider\n\nStandard markdown rendering with collapsible details:\n\n```html\n<details><summary>Suggestion Summary</summary>\n\n___\n\n**Suggestion Content**\n\n[file.py:10-25](link)\n\n```diff\n...code diff...\n```\n</details>\n```\n\n### GitLab Provider\n\nSimilar to GitHub with minor formatting adjustments.\n\n### Bitbucket Server Provider\n\nSpecial handling for multi-line suggestions:\n\n> Bitbucket does not support multi-line suggestions so use a code block instead\n\n资料来源：[pr_agent/git_providers/bitbucket_server_provider.py:200-210]()\n\n## Usage Examples\n\n### Manual Invocation\n\n```\n/improve\n/improve --pr_code_suggestions.num_code_suggestions=5\n/improve --pr_code_suggestions.some_config=value\n```\n\n### Automated Trigger\n\nConfigured via GitHub App automatic tools, the tool runs on PR open events when enabled in settings.\n\n## Related Utility Functions\n\n### parse_code_suggestion\n\nLocated in `pr_agent/algo/utils.py`, this function converts suggestion dictionaries to markdown:\n\n```python\ndef parse_code_suggestion(code_suggestion: dict, i: int = 0, gfm_supported: bool = True) -> str:\n    \"\"\"\n    Convert a dictionary of data into markdown format.\n    \"\"\"\n    markdown_text = \"\"\n    if gfm_supported and 'relevant_line' in code_suggestion:\n        markdown_text += '<table>'\n        # ... processing logic\n    return markdown_text\n```\n\n资料来源：[pr_agent/algo/utils.py:100-120]()\n\n### extract_relevant_lines_str\n\nExtracts relevant code lines from PR diff for context:\n\n```python\ndef extract_relevant_lines_str(end_line, files, relevant_file, start_line, dedent=False) -> str:\n    \"\"\"Finds 'relevant_file' in 'files', and extracts the lines from 'start_line' to 'end_line'\"\"\"\n```\n\n资料来源：[pr_agent/algo/utils.py:150-180]()\n\n## Integration Points\n\n```mermaid\ngraph LR\n    A[pr_code_suggestions.py] --> B[HelpMessage]\n    A --> C[get_settings]\n    A --> D[GitProvider]\n    A --> E[utils.py functions]\n    \n    B --> F[get_improve_usage_guide]\n    C --> G[Configuration Loading]\n    D --> H[Post Comments]\n    E --> I[parse_code_suggestion]\n    E --> J[render_*_markdown]\n```\n\n## See Also\n\n- [Review Tool](/tools/review/) - Code review functionality\n- [Describe Tool](/tools/describe/) - PR description generation\n- [Ask Tool](/tools/ask/) - Interactive PR questions\n- [Configuration Guide](https://pr-agent-docs.codium.ai/usage-guide/configuration_options/)\n\n---\n\n<a id='additional-tools'></a>\n\n## Additional Tools\n\n### 相关页面\n\n相关主题：[Tools Overview](#tools-overview), [/describe Tool](#describe-tool), [/review Tool](#review-tool)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [pr_agent/tools/pr_questions.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_questions.py)\n- [pr_agent/tools/pr_help_docs.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_help_docs.py)\n- [pr_agent/tools/pr_update_changelog.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_update_changelog.py)\n- [pr_agent/tools/pr_generate_labels.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_generate_labels.py)\n- [pr_agent/tools/pr_similar_issue.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_similar_issue.py)\n- [pr_agent/servers/help.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/servers/help.py)\n- [pr_agent/algo/utils.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/algo/utils.py)\n</details>\n\n# Additional Tools\n\nPR-Agent provides several supplementary tools that extend beyond the core code review capabilities. These tools help developers with documentation lookup, changelog management, label generation, and finding related issues.\n\n## Overview\n\nThe Additional Tools module encompasses standalone utilities that can be invoked manually on pull requests. Unlike the core automated tools (describe, review, improve) that run automatically, these tools are typically triggered through comments on specific PRs.\n\n```mermaid\ngraph TD\n    A[PR Agent Tools] --> B[Core Automated Tools]\n    A --> C[Additional Tools]\n    \n    C --> D[ask]\n    C --> E[help_docs]\n    C --> F[update_changelog]\n    C --> G[generate_labels]\n    C --> H[similar_issue]\n    \n    style C fill:#f9f,stroke:#333,stroke-width:2px\n    style D fill:#bbf,stroke:#333,stroke-width:1px\n    style E fill:#bbf,stroke:#333,stroke-width:1px\n    style F fill:#bbf,stroke:#333,stroke-width:1px\n    style G fill:#bbf,stroke:#333,stroke-width:1px\n    style H fill:#bbf,stroke:#333,stroke-width:1px\n```\n\n## Ask Tool\n\nThe `ask` tool answers questions about the PR code changes using natural language.\n\n### Purpose\n\nThe ask tool provides a question-and-answer interface that allows developers to query information about a specific pull request. It analyzes the PR diff and code to provide contextual answers.\n\n### Invocation\n\n```bash\n/ask \"What changes were made to the authentication module?\"\n```\n\n### Key Characteristics\n\n| Characteristic | Description |\n|----------------|-------------|\n| **Memory** | No memory of previous questions |\n| **Independence** | Each question answered independently |\n| **Scope** | Entire PR, specific code lines, or images |\n| **Invocation** | Manual only via PR comments |\n\n资料来源：[pr_agent/servers/help.py:1-50]()\n\n### Implementation\n\nThe ask functionality is implemented in `pr_agent/tools/pr_questions.py`. The tool:\n\n1. Parses the question from the PR comment\n2. Extracts relevant code changes from the PR diff\n3. Generates a contextual response using the LLM\n\n```mermaid\ngraph LR\n    A[User Comment: /ask \"...\"] --> B[Parse Question]\n    B --> C[Extract PR Diff]\n    C --> D[Generate Context]\n    D --> E[LLM Processing]\n    E --> F[Response Output]\n```\n\n## Help Docs Tool\n\nThe `help_docs` tool answers questions based on documentation files within the repository.\n\n### Purpose\n\nThis tool enables developers to ask questions about project documentation and receive accurate answers based on the actual documentation files.\n\n### Invocation\n\n```bash\n/help_docs \"How do I configure the webhook?\"\n```\n\n### Configuration\n\nThe tool supports documentation from:\n- The repository's own documentation files\n- External documentation sources specified in configuration\n\n### Key Features\n\n- Answers questions based on relative documentation paths\n- Supports both repository-local and external documentation sources\n- Provides accurate answers using RAG (Retrieval-Augmented Generation) techniques\n\n资料来源：[pr_agent/tools/pr_help_docs.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_help_docs.py)\n\n## Update Changelog Tool\n\nThe `update_changelog` tool automatically updates changelog files based on PR changes.\n\n### Purpose\n\nThis tool ensures that changelog entries are created or updated when new features, fixes, or changes are merged.\n\n### Key Workflow\n\n```mermaid\ngraph TD\n    A[PR Merged] --> B[Trigger update_changelog]\n    B --> C[Analyze PR Changes]\n    C --> D[Determine Changelog Category]\n    D --> E{Find Existing Changelog?}\n    E -->|Yes| F[Update Existing Entry]\n    E -->|No| G[Create New Entry]\n    F --> H[Format According to Standards]\n    G --> H\n    H --> I[Commit Changes]\n```\n\n### Changelog Categories\n\n| Category | Description |\n|----------|-------------|\n| Features | New functionality additions |\n| Bug Fixes | Resolution of bugs |\n| Breaking Changes | API or behavior changes |\n| Documentation | Documentation updates |\n\n资料来源：[pr_agent/tools/pr_update_changelog.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_update_changelog.py)\n\n## Generate Labels Tool\n\nThe `generate_labels` tool automatically creates or suggests labels for pull requests.\n\n### Purpose\n\nThis tool analyzes PR changes and generates appropriate labels based on the content, type, and impact of the changes.\n\n### Label Generation Process\n\n```mermaid\ngraph LR\n    A[Analyze PR Diff] --> B[Determine PR Type]\n    B --> C[Assess Impact Area]\n    C --> D[Match Against Existing Labels]\n    D --> E[Generate Label Suggestions]\n    E --> F[Apply or Present to User]\n```\n\n### Supported Label Types\n\n| Label Type | Example |\n|------------|---------|\n| **Type-based** | Bug fix, Enhancement, Documentation |\n| **Area-based** | Frontend, Backend, API, Database |\n| **Scope-based** | Performance, Security, Testing |\n| **Custom** | Repository-specific labels |\n\n资料来源：[pr_agent/tools/pr_generate_labels.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_generate_labels.py)\n\n## Similar Issue Tool\n\nThe `similar_issue` tool finds related issues or pull requests that address similar problems.\n\n### Purpose\n\nThis tool helps developers avoid duplicate work by identifying existing issues or PRs that may be related to the current issue being addressed.\n\n### Search Strategy\n\nThe tool uses multiple approaches to find similar issues:\n\n1. **Semantic Search**: Uses embeddings to find semantically similar text\n2. **Keyword Matching**: Identifies shared terminology\n3. **Historical Analysis**: Examines closed/resolved similar issues\n\n### Output Format\n\n| Field | Description |\n|-------|-------------|\n| Issue/PR Number | Reference identifier |\n| Title | Issue/PR title |\n| Similarity Score | Relevance indicator |\n| Status | Open/Closed/Resolved |\n| Resolution | How it was addressed (if closed) |\n\n资料来源：[pr_agent/tools/pr_similar_issue.py](https://github.com/The-PR-Agent/pr-agent/blob/main/pr_agent/tools/pr_similar_issue.py)\n\n## Common Configuration Options\n\nAdditional tools share several common configuration patterns.\n\n### Configuration via Comments\n\n```bash\n/tool_name --section.option=value\n```\n\n### Configuration via File\n\n```toml\n[section_name]\noption1 = value1\noption2 = value2\n```\n\n### Shared Settings\n\n| Setting | Description | Default |\n|---------|-------------|---------|\n| `enable_help_comment` | Show help links in output | Varies by tool |\n| `output_relevant_configurations` | Include config details in output | false |\n\n资料来源：[pr_agent/servers/help.py:1-100]()\n\n## Usage Patterns\n\n### Manual Invocation\n\nAll additional tools are invoked manually through PR comments:\n\n```bash\n/ask \"What does this function do?\"\n/help_docs \"How do I run tests?\"\n/generate_labels\n/similar_issue \"authentication bug\"\n```\n\n### Tool Comparison\n\n| Tool | Trigger Type | Automated | Primary Use Case |\n|------|-------------|-----------|------------------|\n| ask | Manual | No | Code understanding |\n| help_docs | Manual | No | Documentation lookup |\n| update_changelog | Manual/Auto | Optional | Release notes |\n| generate_labels | Manual | Optional | Organization |\n| similar_issue | Manual | No | Avoiding duplicates |\n\n## Help System Integration\n\nEach tool includes integrated help documentation accessible through the help system:\n\n```mermaid\ngraph TD\n    A[User] --> B[/help or /ask \"help\"]\n    B --> C[HelpMessage Class]\n    C --> D{Identify Tool}\n    D --> E[get_{tool}_usage_guide]\n    E --> F[Display Usage Info]\n    F --> G[Link to Full Documentation]\n```\n\nThe help system provides:\n- Usage examples for each tool\n- Configuration templates\n- Links to detailed documentation pages\n- GitHub App vs GitLab compatibility notes\n\n资料来源：[pr_agent/servers/help.py:50-150]()\n\n## Implementation Architecture\n\n### Tool Base Structure\n\n```mermaid\nclassDiagram\n    class BaseTool {\n        +run()\n        +get_settings()\n        +git_provider\n    }\n    class AskTool {\n        +answer_question()\n    }\n    class HelpDocsTool {\n        +find_documentation()\n    }\n    class UpdateChangelogTool {\n        +update_changelog()\n    }\n    class GenerateLabelsTool {\n        +generate_labels()\n    }\n    class SimilarIssueTool {\n        +find_similar()\n    }\n    \n    BaseTool <|-- AskTool\n    BaseTool <|-- HelpDocsTool\n    BaseTool <|-- UpdateChangelogTool\n    BaseTool <|-- GenerateLabelsTool\n    BaseTool <|-- SimilarIssueTool\n```\n\n### Utility Functions\n\nShared utilities in `pr_agent/algo/utils.py` provide common functionality:\n\n- `parse_code_suggestion()`: Converts code suggestion dictionaries to markdown\n- `extract_relevant_lines_str()`: Extracts specific code lines from diffs\n- `show_relevant_configurations()`: Displays configuration details\n\n资料来源：[pr_agent/algo/utils.py:1-100]()\n\n## Best Practices\n\n### When to Use Additional Tools\n\n| Scenario | Recommended Tool |\n|----------|-----------------|\n| Understanding complex code changes | `ask` |\n| Finding documentation information | `help_docs` |\n| Preparing release notes | `update_changelog` |\n| Organizing PRs with labels | `generate_labels` |\n| Checking for duplicate work | `similar_issue` |\n\n### Configuration Recommendations\n\n1. **Enable help comments** to guide users unfamiliar with tools\n2. **Set up custom label mappings** for the generate_labels tool\n3. **Configure changelog format** to match project standards\n4. **Use appropriate documentation paths** for help_docs tool\n\n## Documentation References\n\nFor detailed information about specific tools, refer to:\n\n- [Ask Tool Documentation](https://pr-agent-docs.codium.ai/tools/ask/)\n- [Help Docs Tool Documentation](https://pr-agent-docs.codium.ai/tools/help_docs/)\n- [Configuration Guide](https://pr-agent-docs.codium.ai/usage-guide/configuration_options/)\n\n资料来源：[pr_agent/servers/help.py:1-50](), [pr_agent/servers/help.py:50-100]()\n\n---\n\n---\n\n## Doramagic Pitfall Log\n\nProject: The-PR-Agent/pr-agent\n\nSummary: Found 38 potential pitfall items; 5 are high/blocking. Highest priority: installation - 来源证据：Allow specifying a custom branch for locating `.pr_agent.toml`.\n\n## 1. installation · 来源证据：Allow specifying a custom branch for locating `.pr_agent.toml`\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Allow specifying a custom branch for locating `.pr_agent.toml`\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_6aa2027573564d778bdccf1c0e603a0f | https://github.com/The-PR-Agent/pr-agent/issues/1977 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 2. security_permissions · 失败模式：security_permissions: Add support for Databricks hosted models\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: Developers should check this security_permissions risk before relying on the project: Add support for Databricks hosted models\n- User impact: Developers may expose sensitive permissions or credentials: Add support for Databricks hosted models\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Add support for Databricks hosted models. Context: Observed when using python, docker\n- Guardrail action: Do not recommend enabling privileged or credential-bearing paths until the source-backed risk is reviewed: https://github.com/The-PR-Agent/pr-agent/issues/2246\n- Evidence: failure_mode_cluster:github_issue | fmev_63e7f7511bd7314419df2ded4a1a20e9 | https://github.com/The-PR-Agent/pr-agent/issues/2246 | Add support for Databricks hosted models\n\n## 3. security_permissions · 来源证据：Add support for Databricks hosted models\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Add support for Databricks hosted models\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_6b5b4692165240e5a79137dc9335bd50 | https://github.com/The-PR-Agent/pr-agent/issues/2246 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 4. security_permissions · 来源证据：GITLAB 404 project not found\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：GITLAB 404 project not found\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_04774e9f24034b56b080d2af0875b7fd | https://github.com/The-PR-Agent/pr-agent/issues/2282 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 5. security_permissions · 来源证据：Incorrect Inline Code Suggestion Formatting in Azure DevOps\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Incorrect Inline Code Suggestion Formatting in Azure DevOps\n- User impact: 可能影响升级、迁移或版本选择。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_d01349d41e8a48db89a80ebdb4ca9bde | https://github.com/The-PR-Agent/pr-agent/issues/2110 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 6. installation · 失败模式：installation: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental supp...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this installation risk before relying on the project: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- User impact: Developers may fail before the first successful local run: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_f812843570a304cde8d165f9bd42e8dc | https://github.com/The-PR-Agent/pr-agent/issues/2379 | Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n\n## 7. installation · 失败模式：installation: feat: support agent skills for context-aware review guidance\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this installation risk before relying on the project: feat: support agent skills for context-aware review guidance\n- User impact: Developers may fail before the first successful local run: feat: support agent skills for context-aware review guidance\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: feat: support agent skills for context-aware review guidance. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_6fae5a58920d170992e268f4837b86a9 | https://github.com/The-PR-Agent/pr-agent/issues/2384 | feat: support agent skills for context-aware review guidance\n\n## 8. installation · 失败模式：installation: v0.35.0\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this installation risk before relying on the project: v0.35.0\n- User impact: Upgrade or migration may change expected behavior: v0.35.0\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: v0.35.0. Context: Observed when using python, docker, windows\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_release | fmev_c8b7b30719c4160c5c0104029f83e764 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.35.0 | v0.35.0\n\n## 9. installation · 来源证据：CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_befb1a7b72d44beba27f8ffc0e2646ca | https://github.com/The-PR-Agent/pr-agent/issues/2223 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 10. installation · 来源证据：Publish linux/arm64 Docker image for github_app tag\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Publish linux/arm64 Docker image for github_app tag\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8cb9e552d2e2452cbe958628f6e800b6 | https://github.com/The-PR-Agent/pr-agent/issues/2386 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 11. installation · 来源证据：[Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：[Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_52bd470b7b5e4be6858b290e41c93036 | https://github.com/The-PR-Agent/pr-agent/issues/2380 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 12. installation · 来源证据：[Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：[Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n- User impact: 可能影响升级、迁移或版本选择。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_14856949ca534836a7f707e2c1333b17 | https://github.com/The-PR-Agent/pr-agent/issues/2400 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 13. installation · 来源证据：v0.34.2\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v0.34.2\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_4bc22335937e44c0b529ab84d1e69a60 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.34.2 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 14. configuration · 失败模式：configuration: /improve on GitLab duplicates the persistent suggestions thread on every push once the previo...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n- User impact: Developers may misconfigure credentials, environment, or host setup: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_f4643954c8dbe2f730d31cefbeaa8c78 | https://github.com/The-PR-Agent/pr-agent/issues/2402 | /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n\n## 15. configuration · 失败模式：configuration: Allow specifying a custom branch for locating `.pr_agent.toml`\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: Allow specifying a custom branch for locating `.pr_agent.toml`\n- User impact: Developers may misconfigure credentials, environment, or host setup: Allow specifying a custom branch for locating `.pr_agent.toml`\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Allow specifying a custom branch for locating `.pr_agent.toml`. Context: Source discussion did not expose a precise runtime context.\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_339ee91f6568996765e72eae51a899dd | https://github.com/The-PR-Agent/pr-agent/issues/1977 | Allow specifying a custom branch for locating `.pr_agent.toml`\n\n## 16. configuration · 失败模式：configuration: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_a...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n- User impact: Developers may misconfigure credentials, environment, or host setup: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_08e02634b8266f9592093717f3fcb5ac | https://github.com/The-PR-Agent/pr-agent/issues/2376 | AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n\n## 17. configuration · 失败模式：configuration: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n- User impact: Developers may misconfigure credentials, environment, or host setup: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF. Context: Observed when using python, docker, linux\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_683820f79c6410463ae03829a7e5eb54 | https://github.com/The-PR-Agent/pr-agent/issues/2223 | CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n\n## 18. configuration · 失败模式：configuration: GITLAB 404 project not found\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: GITLAB 404 project not found\n- User impact: Developers may misconfigure credentials, environment, or host setup: GITLAB 404 project not found\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: GITLAB 404 project not found. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_b2e82742d50cf2a8c0c2c182eb4f3928 | https://github.com/The-PR-Agent/pr-agent/issues/2282 | GITLAB 404 project not found\n\n## 19. configuration · 失败模式：configuration: Incorrect Inline Code Suggestion Formatting in Azure DevOps\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: Incorrect Inline Code Suggestion Formatting in Azure DevOps\n- User impact: Developers may misconfigure credentials, environment, or host setup: Incorrect Inline Code Suggestion Formatting in Azure DevOps\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Incorrect Inline Code Suggestion Formatting in Azure DevOps. Context: Observed when using python, docker, linux\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_abf700a9dc4cdcc58a9bdae1a8ee37c0 | https://github.com/The-PR-Agent/pr-agent/issues/2110 | Incorrect Inline Code Suggestion Formatting in Azure DevOps\n\n## 20. configuration · 失败模式：configuration: OSS build silently ignores best_practices.md (currently SaaS-only)\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: OSS build silently ignores best_practices.md (currently SaaS-only)\n- User impact: Developers may misconfigure credentials, environment, or host setup: OSS build silently ignores best_practices.md (currently SaaS-only)\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: OSS build silently ignores best_practices.md (currently SaaS-only). Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_6490ac18c4cc673d33dcc567f7b6f466 | https://github.com/The-PR-Agent/pr-agent/issues/2377 | OSS build silently ignores best_practices.md (currently SaaS-only)\n\n## 21. configuration · 失败模式：configuration: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filt...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n- User impact: Developers may misconfigure credentials, environment, or host setup: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering. Context: Observed when using docker\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_e66caf8bd4ddcbc747835f854317ef45 | https://github.com/The-PR-Agent/pr-agent/issues/2380 | [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n\n## 22. configuration · 失败模式：configuration: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n- User impact: Developers may misconfigure credentials, environment, or host setup: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic. Context: Observed when using python, docker\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_48f61c9074aaf84acadaada17c3514fa | https://github.com/The-PR-Agent/pr-agent/issues/2400 | [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n\n## 23. configuration · 失败模式：configuration: v0.33\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: v0.33\n- User impact: Upgrade or migration may change expected behavior: v0.33\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: v0.33. Context: Source discussion did not expose a precise runtime context.\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_release | fmev_3a2819a8993abeddf308dd2a4c20c5d1 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.33 | v0.33\n\n## 24. configuration · 失败模式：configuration: v0.34\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: v0.34\n- User impact: Upgrade or migration may change expected behavior: v0.34\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: v0.34. Context: Source discussion did not expose a precise runtime context.\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_release | fmev_57bd9625e730f20342967abef2739c49 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.34 | v0.34\n\n## 25. configuration · 来源证据：AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_4ee2a84ba307469b9b329a043a70a224 | https://github.com/The-PR-Agent/pr-agent/issues/2376 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 26. configuration · 来源证据：Ticket context not scoped per PR in long-lived deployments — stale tickets leak between unrelated PRs\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Ticket context not scoped per PR in long-lived deployments — stale tickets leak between unrelated PRs\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_a9b90b0cfbbf4529b60d65f564f4592e | https://github.com/The-PR-Agent/pr-agent/issues/2383 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 27. capability · 能力判断依赖假设\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: README/documentation is current enough for a first validation pass.\n- User impact: 假设不成立时，用户拿不到承诺的能力。\n- Suggested check: 将假设转成下游验证清单。\n- Guardrail action: 假设必须转成验证项；没有验证结果前不能写成事实。\n- Evidence: capability.assumptions | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | README/documentation is current enough for a first validation pass.\n\n## 28. runtime · 失败模式：runtime: Publish linux/arm64 Docker image for github_app tag\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this runtime risk before relying on the project: Publish linux/arm64 Docker image for github_app tag\n- User impact: Developers may hit a documented source-backed failure mode: Publish linux/arm64 Docker image for github_app tag\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Publish linux/arm64 Docker image for github_app tag. Context: Observed when using python, docker, linux\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_0fdc283afd24a3b8b85d15520113c789 | https://github.com/The-PR-Agent/pr-agent/issues/2386 | Publish linux/arm64 Docker image for github_app tag, failure_mode_cluster:github_issue | fmev_5d0d8e693d605019991cbe932edb560a | https://github.com/The-PR-Agent/pr-agent/issues/2386 | Publish linux/arm64 Docker image for github_app tag\n\n## 29. maintenance · 维护活跃度未知\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: 未记录 last_activity_observed。\n- User impact: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- Suggested check: 补 GitHub 最近 commit、release、issue/PR 响应信号。\n- Guardrail action: 维护活跃度未知时，推荐强度不能标为高信任。\n- Evidence: evidence.maintainer_signals | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | last_activity_observed missing\n\n## 30. security_permissions · 下游验证发现风险项\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 下游已经要求复核，不能在页面中弱化。\n- Suggested check: 进入安全/权限治理复核队列。\n- Guardrail action: 下游风险存在时必须保持 review/recommendation 降级。\n- Evidence: downstream_validation.risk_items | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | no_demo; severity=medium\n\n## 31. security_permissions · 存在评分风险\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 风险会影响是否适合普通用户安装。\n- Suggested check: 把风险写入边界卡，并确认是否需要人工复核。\n- Guardrail action: 评分风险必须进入边界卡，不能只作为内部分数。\n- Evidence: risks.scoring_risks | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | no_demo; severity=medium\n\n## 32. security_permissions · 来源证据：/improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：/improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8bf58f5468884b5eab533349076803f3 | https://github.com/The-PR-Agent/pr-agent/issues/2402 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 33. security_permissions · 来源证据：Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_e65762126ba84855a8440bd9e5a685bb | https://github.com/The-PR-Agent/pr-agent/issues/2379 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 34. security_permissions · 来源证据：OSS build silently ignores best_practices.md (currently SaaS-only)\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：OSS build silently ignores best_practices.md (currently SaaS-only)\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_f51f28cf40b14b7ca80598af4527661a | https://github.com/The-PR-Agent/pr-agent/issues/2377 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 35. security_permissions · 来源证据：feat: support agent skills for context-aware review guidance\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：feat: support agent skills for context-aware review guidance\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_59ad4ca55ca248f989c91ce40068cc6d | https://github.com/The-PR-Agent/pr-agent/issues/2384 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 36. security_permissions · 来源证据：litellm success/cost callbacks never fire from pr-agent's async run loop\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：litellm success/cost callbacks never fire from pr-agent's async run loop\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_42f0b36e0c434c939c49c91fc7ccb82a | https://github.com/The-PR-Agent/pr-agent/issues/2378 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 37. maintenance · issue/PR 响应质量未知\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: issue_or_pr_quality=unknown。\n- User impact: 用户无法判断遇到问题后是否有人维护。\n- Suggested check: 抽样最近 issue/PR，判断是否长期无人处理。\n- Guardrail action: issue/PR 响应未知时，必须提示维护风险。\n- Evidence: evidence.maintainer_signals | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | issue_or_pr_quality=unknown\n\n## 38. maintenance · 发布节奏不明确\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: release_recency=unknown。\n- User impact: 安装命令和文档可能落后于代码，用户踩坑概率升高。\n- Suggested check: 确认最近 release/tag 和 README 安装命令是否一致。\n- Guardrail action: 发布节奏未知或过期时，安装说明必须标注可能漂移。\n- Evidence: evidence.maintainer_signals | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | release_recency=unknown\n\n<!-- canonical_name: The-PR-Agent/pr-agent; human_manual_source: deepwiki_human_wiki -->\n",
      "summary": "DeepWiki/Human Wiki output with a Doramagic pitfall appendix.",
      "title": "Human Manual"
    },
    "pitfall_log": {
      "asset_id": "pitfall_log",
      "filename": "PITFALL_LOG.md",
      "markdown": "# Pitfall Log\n\nProject: The-PR-Agent/pr-agent\n\nSummary: Found 38 potential pitfall items; 5 are high/blocking. Highest priority: installation - 来源证据：Allow specifying a custom branch for locating `.pr_agent.toml`.\n\n## 1. installation · 来源证据：Allow specifying a custom branch for locating `.pr_agent.toml`\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Allow specifying a custom branch for locating `.pr_agent.toml`\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_6aa2027573564d778bdccf1c0e603a0f | https://github.com/The-PR-Agent/pr-agent/issues/1977 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 2. security_permissions · 失败模式：security_permissions: Add support for Databricks hosted models\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: Developers should check this security_permissions risk before relying on the project: Add support for Databricks hosted models\n- User impact: Developers may expose sensitive permissions or credentials: Add support for Databricks hosted models\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Add support for Databricks hosted models. Context: Observed when using python, docker\n- Guardrail action: Do not recommend enabling privileged or credential-bearing paths until the source-backed risk is reviewed: https://github.com/The-PR-Agent/pr-agent/issues/2246\n- Evidence: failure_mode_cluster:github_issue | fmev_63e7f7511bd7314419df2ded4a1a20e9 | https://github.com/The-PR-Agent/pr-agent/issues/2246 | Add support for Databricks hosted models\n\n## 3. security_permissions · 来源证据：Add support for Databricks hosted models\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Add support for Databricks hosted models\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_6b5b4692165240e5a79137dc9335bd50 | https://github.com/The-PR-Agent/pr-agent/issues/2246 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 4. security_permissions · 来源证据：GITLAB 404 project not found\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：GITLAB 404 project not found\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_04774e9f24034b56b080d2af0875b7fd | https://github.com/The-PR-Agent/pr-agent/issues/2282 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 5. security_permissions · 来源证据：Incorrect Inline Code Suggestion Formatting in Azure DevOps\n\n- Severity: high\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Incorrect Inline Code Suggestion Formatting in Azure DevOps\n- User impact: 可能影响升级、迁移或版本选择。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_d01349d41e8a48db89a80ebdb4ca9bde | https://github.com/The-PR-Agent/pr-agent/issues/2110 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 6. installation · 失败模式：installation: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental supp...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this installation risk before relying on the project: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- User impact: Developers may fail before the first successful local run: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_f812843570a304cde8d165f9bd42e8dc | https://github.com/The-PR-Agent/pr-agent/issues/2379 | Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n\n## 7. installation · 失败模式：installation: feat: support agent skills for context-aware review guidance\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this installation risk before relying on the project: feat: support agent skills for context-aware review guidance\n- User impact: Developers may fail before the first successful local run: feat: support agent skills for context-aware review guidance\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: feat: support agent skills for context-aware review guidance. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_6fae5a58920d170992e268f4837b86a9 | https://github.com/The-PR-Agent/pr-agent/issues/2384 | feat: support agent skills for context-aware review guidance\n\n## 8. installation · 失败模式：installation: v0.35.0\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this installation risk before relying on the project: v0.35.0\n- User impact: Upgrade or migration may change expected behavior: v0.35.0\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: v0.35.0. Context: Observed when using python, docker, windows\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_release | fmev_c8b7b30719c4160c5c0104029f83e764 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.35.0 | v0.35.0\n\n## 9. installation · 来源证据：CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_befb1a7b72d44beba27f8ffc0e2646ca | https://github.com/The-PR-Agent/pr-agent/issues/2223 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 10. installation · 来源证据：Publish linux/arm64 Docker image for github_app tag\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Publish linux/arm64 Docker image for github_app tag\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8cb9e552d2e2452cbe958628f6e800b6 | https://github.com/The-PR-Agent/pr-agent/issues/2386 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 11. installation · 来源证据：[Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：[Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_52bd470b7b5e4be6858b290e41c93036 | https://github.com/The-PR-Agent/pr-agent/issues/2380 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 12. installation · 来源证据：[Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：[Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n- User impact: 可能影响升级、迁移或版本选择。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_14856949ca534836a7f707e2c1333b17 | https://github.com/The-PR-Agent/pr-agent/issues/2400 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 13. installation · 来源证据：v0.34.2\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v0.34.2\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_4bc22335937e44c0b529ab84d1e69a60 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.34.2 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。\n\n## 14. configuration · 失败模式：configuration: /improve on GitLab duplicates the persistent suggestions thread on every push once the previo...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n- User impact: Developers may misconfigure credentials, environment, or host setup: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_f4643954c8dbe2f730d31cefbeaa8c78 | https://github.com/The-PR-Agent/pr-agent/issues/2402 | /improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n\n## 15. configuration · 失败模式：configuration: Allow specifying a custom branch for locating `.pr_agent.toml`\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: Allow specifying a custom branch for locating `.pr_agent.toml`\n- User impact: Developers may misconfigure credentials, environment, or host setup: Allow specifying a custom branch for locating `.pr_agent.toml`\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Allow specifying a custom branch for locating `.pr_agent.toml`. Context: Source discussion did not expose a precise runtime context.\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_339ee91f6568996765e72eae51a899dd | https://github.com/The-PR-Agent/pr-agent/issues/1977 | Allow specifying a custom branch for locating `.pr_agent.toml`\n\n## 16. configuration · 失败模式：configuration: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_a...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n- User impact: Developers may misconfigure credentials, environment, or host setup: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_08e02634b8266f9592093717f3fcb5ac | https://github.com/The-PR-Agent/pr-agent/issues/2376 | AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n\n## 17. configuration · 失败模式：configuration: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n- User impact: Developers may misconfigure credentials, environment, or host setup: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF. Context: Observed when using python, docker, linux\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_683820f79c6410463ae03829a7e5eb54 | https://github.com/The-PR-Agent/pr-agent/issues/2223 | CORS error on Azure DevOps when displaying \"Work in progress\" loading GIF\n\n## 18. configuration · 失败模式：configuration: GITLAB 404 project not found\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: GITLAB 404 project not found\n- User impact: Developers may misconfigure credentials, environment, or host setup: GITLAB 404 project not found\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: GITLAB 404 project not found. Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_b2e82742d50cf2a8c0c2c182eb4f3928 | https://github.com/The-PR-Agent/pr-agent/issues/2282 | GITLAB 404 project not found\n\n## 19. configuration · 失败模式：configuration: Incorrect Inline Code Suggestion Formatting in Azure DevOps\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: Incorrect Inline Code Suggestion Formatting in Azure DevOps\n- User impact: Developers may misconfigure credentials, environment, or host setup: Incorrect Inline Code Suggestion Formatting in Azure DevOps\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Incorrect Inline Code Suggestion Formatting in Azure DevOps. Context: Observed when using python, docker, linux\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_abf700a9dc4cdcc58a9bdae1a8ee37c0 | https://github.com/The-PR-Agent/pr-agent/issues/2110 | Incorrect Inline Code Suggestion Formatting in Azure DevOps\n\n## 20. configuration · 失败模式：configuration: OSS build silently ignores best_practices.md (currently SaaS-only)\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: OSS build silently ignores best_practices.md (currently SaaS-only)\n- User impact: Developers may misconfigure credentials, environment, or host setup: OSS build silently ignores best_practices.md (currently SaaS-only)\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: OSS build silently ignores best_practices.md (currently SaaS-only). Context: Observed when using python\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_6490ac18c4cc673d33dcc567f7b6f466 | https://github.com/The-PR-Agent/pr-agent/issues/2377 | OSS build silently ignores best_practices.md (currently SaaS-only)\n\n## 21. configuration · 失败模式：configuration: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filt...\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n- User impact: Developers may misconfigure credentials, environment, or host setup: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering. Context: Observed when using docker\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_e66caf8bd4ddcbc747835f854317ef45 | https://github.com/The-PR-Agent/pr-agent/issues/2380 | [Bug] UnicodeDecodeError in gitea_provider.py when parsing binary files before extension filtering\n\n## 22. configuration · 失败模式：configuration: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n- User impact: Developers may misconfigure credentials, environment, or host setup: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic. Context: Observed when using python, docker\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_48f61c9074aaf84acadaada17c3514fa | https://github.com/The-PR-Agent/pr-agent/issues/2400 | [Bug] `temperature` parameter sent to claude-opus-4-7 causes 400 from Anthropic\n\n## 23. configuration · 失败模式：configuration: v0.33\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: v0.33\n- User impact: Upgrade or migration may change expected behavior: v0.33\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: v0.33. Context: Source discussion did not expose a precise runtime context.\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_release | fmev_3a2819a8993abeddf308dd2a4c20c5d1 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.33 | v0.33\n\n## 24. configuration · 失败模式：configuration: v0.34\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this configuration risk before relying on the project: v0.34\n- User impact: Upgrade or migration may change expected behavior: v0.34\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: v0.34. Context: Source discussion did not expose a precise runtime context.\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_release | fmev_57bd9625e730f20342967abef2739c49 | https://github.com/The-PR-Agent/pr-agent/releases/tag/v0.34 | v0.34\n\n## 25. configuration · 来源证据：AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：AzureDevopsProvider.get_repo_settings drops chunks after the first, silently truncating .pr_agent.toml\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_4ee2a84ba307469b9b329a043a70a224 | https://github.com/The-PR-Agent/pr-agent/issues/2376 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 26. configuration · 来源证据：Ticket context not scoped per PR in long-lived deployments — stale tickets leak between unrelated PRs\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Ticket context not scoped per PR in long-lived deployments — stale tickets leak between unrelated PRs\n- User impact: 可能增加新用户试用和生产接入成本。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_a9b90b0cfbbf4529b60d65f564f4592e | https://github.com/The-PR-Agent/pr-agent/issues/2383 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 27. capability · 能力判断依赖假设\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: README/documentation is current enough for a first validation pass.\n- User impact: 假设不成立时，用户拿不到承诺的能力。\n- Suggested check: 将假设转成下游验证清单。\n- Guardrail action: 假设必须转成验证项；没有验证结果前不能写成事实。\n- Evidence: capability.assumptions | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | README/documentation is current enough for a first validation pass.\n\n## 28. runtime · 失败模式：runtime: Publish linux/arm64 Docker image for github_app tag\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: Developers should check this runtime risk before relying on the project: Publish linux/arm64 Docker image for github_app tag\n- User impact: Developers may hit a documented source-backed failure mode: Publish linux/arm64 Docker image for github_app tag\n- Suggested check: Before packaging this project, run the relevant install/config/quickstart check for: Publish linux/arm64 Docker image for github_app tag. Context: Observed when using python, docker, linux\n- Guardrail action: State this as source-backed community evidence, not as Doramagic reproduction.\n- Evidence: failure_mode_cluster:github_issue | fmev_0fdc283afd24a3b8b85d15520113c789 | https://github.com/The-PR-Agent/pr-agent/issues/2386 | Publish linux/arm64 Docker image for github_app tag, failure_mode_cluster:github_issue | fmev_5d0d8e693d605019991cbe932edb560a | https://github.com/The-PR-Agent/pr-agent/issues/2386 | Publish linux/arm64 Docker image for github_app tag\n\n## 29. maintenance · 维护活跃度未知\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: 未记录 last_activity_observed。\n- User impact: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- Suggested check: 补 GitHub 最近 commit、release、issue/PR 响应信号。\n- Guardrail action: 维护活跃度未知时，推荐强度不能标为高信任。\n- Evidence: evidence.maintainer_signals | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | last_activity_observed missing\n\n## 30. security_permissions · 下游验证发现风险项\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 下游已经要求复核，不能在页面中弱化。\n- Suggested check: 进入安全/权限治理复核队列。\n- Guardrail action: 下游风险存在时必须保持 review/recommendation 降级。\n- Evidence: downstream_validation.risk_items | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | no_demo; severity=medium\n\n## 31. security_permissions · 存在评分风险\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: no_demo\n- User impact: 风险会影响是否适合普通用户安装。\n- Suggested check: 把风险写入边界卡，并确认是否需要人工复核。\n- Guardrail action: 评分风险必须进入边界卡，不能只作为内部分数。\n- Evidence: risks.scoring_risks | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | no_demo; severity=medium\n\n## 32. security_permissions · 来源证据：/improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：/improve on GitLab duplicates the persistent suggestions thread on every push once the previous one has any reply\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_8bf58f5468884b5eab533349076803f3 | https://github.com/The-PR-Agent/pr-agent/issues/2402 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 33. security_permissions · 来源证据：Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Bug + feature: `-i` (incremental review) crashes on Azure DevOps; needs full incremental support in AzureDevopsProvider\n- User impact: 可能阻塞安装或首次运行。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_e65762126ba84855a8440bd9e5a685bb | https://github.com/The-PR-Agent/pr-agent/issues/2379 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 34. security_permissions · 来源证据：OSS build silently ignores best_practices.md (currently SaaS-only)\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：OSS build silently ignores best_practices.md (currently SaaS-only)\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_f51f28cf40b14b7ca80598af4527661a | https://github.com/The-PR-Agent/pr-agent/issues/2377 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 35. security_permissions · 来源证据：feat: support agent skills for context-aware review guidance\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：feat: support agent skills for context-aware review guidance\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_59ad4ca55ca248f989c91ce40068cc6d | https://github.com/The-PR-Agent/pr-agent/issues/2384 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 36. security_permissions · 来源证据：litellm success/cost callbacks never fire from pr-agent's async run loop\n\n- Severity: medium\n- Evidence strength: source_linked\n- Finding: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：litellm success/cost callbacks never fire from pr-agent's async run loop\n- User impact: 可能影响授权、密钥配置或安全边界。\n- Suggested check: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Guardrail action: 不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- Evidence: community_evidence:github | cevd_42f0b36e0c434c939c49c91fc7ccb82a | https://github.com/The-PR-Agent/pr-agent/issues/2378 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 37. maintenance · issue/PR 响应质量未知\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: issue_or_pr_quality=unknown。\n- User impact: 用户无法判断遇到问题后是否有人维护。\n- Suggested check: 抽样最近 issue/PR，判断是否长期无人处理。\n- Guardrail action: issue/PR 响应未知时，必须提示维护风险。\n- Evidence: evidence.maintainer_signals | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | issue_or_pr_quality=unknown\n\n## 38. maintenance · 发布节奏不明确\n\n- Severity: low\n- Evidence strength: source_linked\n- Finding: release_recency=unknown。\n- User impact: 安装命令和文档可能落后于代码，用户踩坑概率升高。\n- Suggested check: 确认最近 release/tag 和 README 安装命令是否一致。\n- Guardrail action: 发布节奏未知或过期时，安装说明必须标注可能漂移。\n- Evidence: evidence.maintainer_signals | github_repo:662766482 | https://github.com/The-PR-Agent/pr-agent | release_recency=unknown\n",
      "summary": "Identity, installation, configuration, runtime, and safety pitfalls before user trial.",
      "title": "Pitfall Log"
    },
    "prompt_preview": {
      "asset_id": "prompt_preview",
      "filename": "PROMPT_PREVIEW.md",
      "markdown": "# pr-agent - Prompt Preview\n\n> Copy the prompt below into your AI host before installing anything.\n> Its purpose is to let you safely feel the project's workflow, not to claim the project has already run.\n\n## Copy this prompt\n\n```text\nYou are using an independent Doramagic capability pack for The-PR-Agent/pr-agent.\n\nProject:\n- Name: pr-agent\n- Repository: https://github.com/The-PR-Agent/pr-agent\n- Summary: 🚀 PR Agent: The Original Open-Source PR Reviewer.\n- Host target: chatgpt\n\nGoal:\nHelp me evaluate this project for the following task without installing it yet: 🚀 PR Agent: The Original Open-Source PR Reviewer.\n\nBefore taking action:\n1. Restate my task, success standard, and boundary.\n2. Identify whether the next step requires tools, browser access, network access, filesystem access, credentials, package installation, or host configuration.\n3. Use only the Doramagic Project Pack, the upstream repository, and the source-linked evidence listed below.\n4. If a real command, install step, API call, file write, or host integration is required, mark it as \"requires post-install verification\" and ask for approval first.\n5. If evidence is missing, say \"evidence is missing\" instead of filling the gap.\n\nPreviewable capabilities:\n- Capability 1: 🚀 PR Agent: The Original Open-Source PR Reviewer.\n\nCapabilities that require post-install verification:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n\nCore service flow:\n1. introduction: Introduction to PR-Agent. Produce one small intermediate artifact and wait for confirmation.\n2. quickstart: Quick Start Guide. Produce one small intermediate artifact and wait for confirmation.\n3. architecture: System Architecture. Produce one small intermediate artifact and wait for confirmation.\n4. git-providers: Git Providers System. Produce one small intermediate artifact and wait for confirmation.\n5. tools-overview: Tools Overview. Produce one small intermediate artifact and wait for confirmation.\n\nSource-backed evidence to keep in mind:\n- https://github.com/The-PR-Agent/pr-agent\n- https://github.com/The-PR-Agent/pr-agent#readme\n- README.md\n- pr_agent/agent/pr_agent.py\n- pr_agent/settings/configuration.toml\n- action.yaml\n- docker/Dockerfile\n- pr_agent/cli.py\n- docs/docs/installation/github.md\n- pr_agent/git_providers/__init__.py\n\nFirst response rules:\n1. Start Step 1 only.\n2. Explain the one service action you will perform first.\n3. Ask exactly three questions about my target workflow, success standard, and sandbox boundary.\n4. Stop and wait for my answers.\n\nStep 1 follow-up protocol:\n- After I answer the first three questions, stay in Step 1.\n- Produce six parts only: clarified task, success standard, boundary conditions, two or three options, tradeoffs for each option, and one recommendation.\n- End by asking whether I confirm the recommendation.\n- Do not move to Step 2 until I explicitly confirm.\n\nConversation rules:\n- Advance one step at a time and wait for confirmation after each small artifact.\n- Write outputs as recommendations or planned checks, not as completed execution.\n- Do not claim tests passed, files changed, commands ran, APIs were called, or the project was installed.\n- If the user asks for execution, first provide the sandbox setup, expected output, rollback, and approval checkpoint.\n```\n",
      "summary": "不安装项目也能感受能力节奏的安全试用 Prompt。",
      "title": "Prompt Preview / 安装前试用 Prompt"
    },
    "quick_start": {
      "asset_id": "quick_start",
      "filename": "QUICK_START.md",
      "markdown": "# Quick Start\n\nProject: The-PR-Agent/pr-agent\n\n## Official Entry Points\n\n### Python / pip · 官方安装入口\n\n```bash\npip install pr-agent\n```\n\nSource：https://github.com/The-PR-Agent/pr-agent#readme\n\n## Sources\n\n- repo: https://github.com/The-PR-Agent/pr-agent\n- docs: https://github.com/The-PR-Agent/pr-agent#readme\n",
      "summary": "Entry points extracted from official README or installation documentation.",
      "title": "Quick Start"
    }
  },
  "validation_id": "dval_f01005a3aa214a0dab63463c792358ed"
}
