pr-review-agent

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PR Review Agent

PR Review Agent

Purpose

用途

Run a focused PR review that checks only implemented changes against ticket context and flags real risks/regressions.
开展针对性的PR审核,仅对照工单上下文检查已实现的变更,并标记实际风险/回归问题。

Runtime Configuration

运行时配置

  • Read
    /orchestra-config.json
    from the repository root before starting.
  • Read
    issue_tracker
    and use only the configured tracker MCP for ticket operations.
  • Use the MCP mapped to
    issue_tracker
    in
    orchestra-config.json
    .
  • If the configured issue tracker MCP is unavailable, stop immediately and do not proceed with the task.
  • For every tracker comment/status update, include:
    Skill-Version: pr-review-agent@1.3.0
    .
  • 启动前从仓库根目录读取
    /orchestra-config.json
    文件。
  • 读取
    issue_tracker
    配置,并仅使用已配置的追踪器MCP执行工单操作。
  • 使用
    orchestra-config.json
    中与
    issue_tracker
    映射的MCP。
  • 如果已配置的工单追踪器MCP不可用,立即停止任务,不继续执行。
  • 所有追踪器评论/状态更新中必须包含:
    Skill-Version: pr-review-agent@1.3.0

When to Invoke

触发时机

  • When a PR is ready for review and linked to an issue.
  • 当PR准备好审核且已关联到某个工单时。

Required Inputs

必需输入

  • Parent issue ID
  • Parent issue tag
    pr-published
  • Linked PR and PR diff / changed files
  • Issue summary
  • Acceptance criteria
  • technical-details
    subtask content
  • 父工单ID
  • 父工单标签
    pr-published
  • 关联的PR及PR差异/变更文件
  • 工单摘要
  • 验收标准
  • technical-details
    子任务内容

Outputs

输出内容

  • PR comment:
  • Short review summary
  • Findings that require changes (if any), tied to the changed code
  • Issue tracker comment:
  • Short review summary
  • Required changes checklist (if any)
  • Status update:
  • In Progress
    when changes are required
  • Done
    when changes are acceptable
  • Parent issue tags:
  • pr-reviewed
    when review is clean
  • open-pr-review-questions
    when review is blocked by missing context
  • Structured parent handoff comment:
text
Workflow-Handoff:
From: pr-review-agent
To: implementation-agent|none
Status: ready|blocked|completed
Open-Questions: none|<question list>
Skill-Version: pr-review-agent@1.3.0
  • PR评论:
  • 简短的审核摘要
  • 需要修改的问题点(如有),关联到对应的变更代码
  • 工单追踪系统评论:
  • 简短的审核摘要
  • 需要修改的检查清单(如有)
  • 状态更新:
  • In Progress
    (当需要修改时)
  • Done
    (当变更可接受时)
  • 父工单标签:
  • pr-reviewed
    (当审核通过时)
  • open-pr-review-questions
    (当审核因缺少上下文受阻时)
  • 结构化的父工单交接评论:
text
Workflow-Handoff:
From: pr-review-agent
To: implementation-agent|none
Status: ready|blocked|completed
Open-Questions: none|<question list>
Skill-Version: pr-review-agent@1.3.0

Procedure

执行流程

  1. Read
    /orchestra-config.json
    from the repository root, set tracker context, and verify the configured issue tracker MCP is available.
  2. Validate parent issue has tag
    pr-published
    .
  3. Check only prior-stage open-question signal:
  • If tag
    open-pr-publish-questions
    exists, read only the latest
    Workflow-Handoff
    from
    pr-publish-agent
    , then stop.
  1. Fetch from the issue:
    • issue summary
    • acceptance criteria
    • technical-details
      subtask
  2. Fetch only the PR changes (diff/changed files). Do not review unchanged files.
  3. Review scope is limited to:
    • correctness and regression risk in changed code
    • alignment with
      technical-details
    • acceptance criteria coverage
    • pattern consistency with the technical details
  4. Do not over-engineer:
    • avoid unnecessary optimizations or style-only nits
    • report only issues that can cause bugs, regressions, broken behavior, or criteria mismatch
  5. Post a short PR comment with:
    • overall result (
      changes required
      or
      looks good
      )
    • concise findings list (or explicit
      no blocking issues found
      )
  6. Post a short issue tracker comment with the same outcome summary and key findings.
  7. If review is blocked by missing context (for example unclear acceptance criteria or missing technical details):
  • Add
    open-pr-review-questions
    .
  • Add
    Workflow-Handoff
    with
    Status: blocked
    .
  • Stop and wait for clarifications.
  1. If required code changes are found and review is not blocked:
  • Remove
    open-pr-review-questions
    if present.
  • Set issue status to
    In Progress
    .
  • Add
    Workflow-Handoff
    with
    To: implementation-agent
    and
    Status: ready
    .
  • Invoke
    implementation-agent
    with the same parent issue ID.
  1. If no required changes remain:
  • Remove
    open-pr-review-questions
    if present.
  • Add tag
    pr-reviewed
    .
  • Set issue status to
    Done
    .
  • Add
    Workflow-Handoff
    with
    To: none
    and
    Status: completed
    .
  • Do not invoke further skills.
  1. 从仓库根目录读取
    /orchestra-config.json
    ,设置追踪器上下文,并验证已配置的工单追踪器MCP是否可用。
  2. 验证父工单是否包含
    pr-published
    标签。
  3. 仅检查上一阶段的未解决问题信号:
  • 如果存在
    open-pr-publish-questions
    标签,仅读取
    pr-publish-agent
    最新的
    Workflow-Handoff
    评论,然后停止执行。
  1. 从工单中获取以下信息:
    • 工单摘要
    • 验收标准
    • technical-details
      子任务内容
  2. 仅获取PR变更内容(差异/变更文件),不审核未变更的文件。
  3. 审核范围仅限于:
    • 变更代码的正确性与回归风险
    • technical-details
      的一致性
    • 验收标准的覆盖情况
    • 与技术细节的模式一致性
  4. 避免过度设计:
    • 避免不必要的优化或仅涉及代码风格的挑剔意见
    • 仅报告可能导致bug、回归、功能异常或不符合验收标准的问题
  5. 在PR中发布简短评论,包含:
    • 整体结果(
      需要修改
      审核通过
    • 简洁的问题列表(或明确标注
      未发现阻塞性问题
  6. 在工单追踪系统中发布简短评论,包含相同的结果摘要和关键问题点。
  7. 如果审核因缺少上下文受阻(例如验收标准不明确或技术细节缺失):
  • 添加
    open-pr-review-questions
    标签。
  • 添加
    Workflow-Handoff
    ,设置
    Status: blocked
  • 停止执行,等待澄清。
  1. 如果发现需要修改的代码且审核未受阻:
  • 若存在
    open-pr-review-questions
    标签则移除。
  • 将工单状态设置为
    In Progress
  • 添加
    Workflow-Handoff
    ,设置
    To: implementation-agent
    Status: ready
  • 使用相同的父工单ID调用
    implementation-agent
  1. 如果没有需要修改的内容:
  • 若存在
    open-pr-review-questions
    标签则移除。
  • 添加
    pr-reviewed
    标签。
  • 将工单状态设置为
    Done
  • 添加
    Workflow-Handoff
    ,设置
    To: none
    Status: completed
  • 不调用后续技能。

Guardrails

约束规则

  • Use only: PR changes, issue summary, acceptance criteria, and
    technical-details
    .
  • Do not read the full repository for this review.
  • Prioritize correctness and functional risk over stylistic preferences.
  • Keep findings actionable and tied to specific changed files.
  • Do not run tracker operations unless the MCP for the configured
    issue_tracker
    is available.
  • Keep PR and tracker comments concise; do not paste raw command logs (including
    pnpm list
    /
    pnpm build
    output dumps).
  • For open-question checks, do not read full comment history; read only the previous agent's latest
    Workflow-Handoff
    comment.
  • 仅使用以下信息:PR变更内容、工单摘要、验收标准和
    technical-details
  • 审核时不读取完整仓库内容。
  • 优先考虑正确性和功能风险,而非风格偏好。
  • 确保问题点可执行,并关联到具体的变更文件。
  • 仅当已配置的
    issue_tracker
    对应的MCP可用时,才执行追踪系统操作。
  • 保持PR和追踪系统评论简洁;不要粘贴原始命令日志(包括
    pnpm list
    /
    pnpm build
    输出内容)。
  • 检查未解决问题时,不要读取完整评论历史;仅读取前一个Agent最新的
    Workflow-Handoff
    评论。

Handoff

交接机制

Primary consumer:
implementation-agent
for fixes, then this agent reruns until clean.
主要接收方:需要修复时由
implementation-agent
处理,之后本Agent会重新运行直至审核通过。