review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/review - Code Review Workflow

/review - 代码审查工作流

Multi-perspective code review with parallel specialists.
多视角并行专项代码审查。

When to Use

适用场景

  • "Review this code"
  • "Review my PR"
  • "Check this before I merge"
  • "Get feedback on implementation"
  • Before merging significant changes
  • Quality gates
  • "审查这段代码"
  • "审查我的PR"
  • "合并前帮我检查一下"
  • "获取实现方案的反馈"
  • 重大变更合并前
  • 质量门禁

Workflow Overview

工作流概述

         ┌──────────┐
         │  critic  │ ─┐
         │ (code)   │  │
         └──────────┘  │
         ┌──────────┐  │      ┌──────────────┐
         │plan-reviewer│ ─┼────▶ │ review-agent │
         │ (plan)   │  │      │ (synthesis)  │
         └──────────┘  │      └──────────────┘
         ┌──────────┐  │
         │plan-reviewer│ ─┘
         │ (change) │
         └──────────┘

         Parallel                Sequential
         perspectives            synthesis
         ┌──────────┐
         │  critic  │ ─┐
         │ (code)   │  │
         └──────────┘  │
         ┌──────────┐  │      ┌──────────────┐
         │plan-reviewer│ ─┼────▶ │ review-agent │
         │ (plan)   │  │      │ (synthesis)  │
         └──────────┘  │      └──────────────┘
         ┌──────────┐  │
         │plan-reviewer│ ─┘
         │ (change) │
         └──────────┘

         Parallel                Sequential
         perspectives            synthesis

Agent Sequence

Agent 执行序列

#AgentFocusExecution
1criticCode quality, patterns, readabilityParallel
1plan-reviewerArchitecture, plan adherenceParallel
1plan-reviewerChange impact, risk assessmentParallel
2review-agentSynthesize all reviews, final verdictAfter 1
#Agent关注重点执行方式
1critic代码质量、设计模式、可读性并行
1plan-reviewer架构、计划符合性并行
1plan-reviewer变更影响、风险评估并行
2review-agent汇总所有审查结果,给出最终结论阶段1完成后执行

Review Perspectives

审查视角

  • critic: Is this good code? (Style, patterns, readability)
  • plan-reviewer: Does this match the design? (Architecture, plan)
  • plan-reviewer: Is this change safe? (Risk, impact, regressions)
  • review-agent: Overall assessment and recommendations
  • critic:代码质量是否达标?(风格、模式、可读性)
  • plan-reviewer:是否符合设计方案?(架构、计划)
  • plan-reviewer:变更是否安全?(风险、影响、回归问题)
  • review-agent:整体评估与建议

Execution

执行流程

Phase 1: Parallel Reviews

阶段1:并行审查

undefined
undefined

Code quality review

Code quality review

Task( subagent_type="critic", prompt=""" Review code quality: [SCOPE]
Evaluate:
  • Code style and consistency
  • Design patterns used
  • Readability and maintainability
  • Error handling
  • Test coverage
Output: List of issues with severity (critical/major/minor) """, run_in_background=true )
Task( subagent_type="critic", prompt=""" Review code quality: [SCOPE]
Evaluate:
  • Code style and consistency
  • Design patterns used
  • Readability and maintainability
  • Error handling
  • Test coverage
Output: List of issues with severity (critical/major/minor) """, run_in_background=true )

Architecture review

Architecture review

Task( subagent_type="plan-reviewer", prompt=""" Review architecture alignment: [SCOPE]
Check:
  • Follows established patterns
  • Matches implementation plan (if exists)
  • Consistent with system design
  • No architectural violations
Output: Alignment assessment with concerns """, run_in_background=true )
Task( subagent_type="plan-reviewer", prompt=""" Review architecture alignment: [SCOPE]
Check:
  • Follows established patterns
  • Matches implementation plan (if exists)
  • Consistent with system design
  • No architectural violations
Output: Alignment assessment with concerns """, run_in_background=true )

Change impact review

Change impact review

Task( subagent_type="plan-reviewer", prompt=""" Review change impact: [SCOPE]
Assess:
  • Risk level of changes
  • Affected systems/components
  • Backward compatibility
  • Potential regressions
  • Security implications
Output: Risk assessment with recommendations """, run_in_background=true )
Task( subagent_type="plan-reviewer", prompt=""" Review change impact: [SCOPE]
Assess:
  • Risk level of changes
  • Affected systems/components
  • Backward compatibility
  • Potential regressions
  • Security implications
Output: Risk assessment with recommendations """, run_in_background=true )

Wait for all parallel reviews

Wait for all parallel reviews

[Check TaskOutput for all three]
undefined
[Check TaskOutput for all three]
undefined

Phase 2: Synthesis

阶段2:结果汇总

Task(
  subagent_type="review-agent",
  prompt="""
  Synthesize reviews for: [SCOPE]

  Reviews:
  - critic: [code quality findings]
  - plan-reviewer: [architecture findings]
  - plan-reviewer: [change impact findings]

  Create final review:
  - Overall verdict (APPROVE / REQUEST_CHANGES / NEEDS_DISCUSSION)
  - Prioritized action items
  - Blocking vs non-blocking issues
  - Summary for PR description
  """
)
Task(
  subagent_type="review-agent",
  prompt="""
  Synthesize reviews for: [SCOPE]

  Reviews:
  - critic: [code quality findings]
  - plan-reviewer: [architecture findings]
  - plan-reviewer: [change impact findings]

  Create final review:
  - Overall verdict (APPROVE / REQUEST_CHANGES / NEEDS_DISCUSSION)
  - Prioritized action items
  - Blocking vs non-blocking issues
  - Summary for PR description
  """
)

Review Modes

审查模式

Full Review

全面审查

User: /review
→ All four agents, comprehensive review
User: /review
→ 调用全部4个Agent,进行全面审查

Quick Review

快速审查

User: /review --quick
→ critic only, fast feedback
User: /review --quick
→ 仅调用critic,快速反馈

Security Focus

安全聚焦审查

User: /review --security
→ Add aegis (security agent) to parallel phase
User: /review --security
→ 在并行阶段添加aegis(安全Agent)

PR Review

PR审查

User: /review PR #123
→ Fetch PR diff, review changes
User: /review PR #123
→ 获取PR差异,审查变更内容

Example

示例

User: /review the authentication changes

Claude: Starting /review workflow...

Phase 1: Running parallel reviews...
┌────────────────────────────────────────────┐
│ critic: Reviewing code quality...          │
│ plan-reviewer: Checking architecture...         │
│ plan-reviewer: Assessing change impact...         │
└────────────────────────────────────────────┘

critic: Found 2 issues
- [minor] Inconsistent error messages in auth.ts
- [major] Missing input validation in login()

plan-reviewer: ✅ Matches authentication plan

plan-reviewer: Medium risk
- Affects: login, signup, password reset
- Breaking change: session token format

Phase 2: Synthesizing...

┌─────────────────────────────────────────────┐
│ Review Summary                              │
├─────────────────────────────────────────────┤
│ Verdict: REQUEST_CHANGES                    │
│                                             │
│ Blocking:                                   │
│ 1. Add input validation to login()          │
│                                             │
│ Non-blocking:                               │
│ 2. Standardize error messages               │
│                                             │
│ Notes:                                      │
│ - Document session token format change      │
│ - Consider migration path for existing      │
│   sessions                                  │
└─────────────────────────────────────────────┘
User: /review the authentication changes

Claude: Starting /review workflow...

Phase 1: Running parallel reviews...
┌────────────────────────────────────────────┐
│ critic: Reviewing code quality...          │
│ plan-reviewer: Checking architecture...         │
│ plan-reviewer: Assessing change impact...         │
└────────────────────────────────────────────┘

critic: Found 2 issues
- [minor] Inconsistent error messages in auth.ts
- [major] Missing input validation in login()

plan-reviewer: ✅ Matches authentication plan

plan-reviewer: Medium risk
- Affects: login, signup, password reset
- Breaking change: session token format

Phase 2: Synthesizing...

┌─────────────────────────────────────────────┐
│ Review Summary                              │
├─────────────────────────────────────────────┤
│ Verdict: REQUEST_CHANGES                    │
│                                             │
│ Blocking:                                   │
│ 1. Add input validation to login()          │
│                                             │
│ Non-blocking:                               │
│ 2. Standardize error messages               │
│                                             │
│ Notes:                                      │
│ - Document session token format change      │
│ - Consider migration path for existing      │
│   sessions                                  │
└─────────────────────────────────────────────┘

Verdicts

审查结论

  • APPROVE: Ready to merge, all issues are minor
  • REQUEST_CHANGES: Blocking issues must be fixed
  • NEEDS_DISCUSSION: Architectural decisions need input
  • APPROVE:可合并,所有问题均为次要问题
  • REQUEST_CHANGES:存在阻塞性问题,必须修复
  • NEEDS_DISCUSSION:架构决策需要进一步讨论