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 synthesisAgent Sequence
Agent 执行序列
| # | Agent | Focus | Execution |
|---|---|---|---|
| 1 | critic | Code quality, patterns, readability | Parallel |
| 1 | plan-reviewer | Architecture, plan adherence | Parallel |
| 1 | plan-reviewer | Change impact, risk assessment | Parallel |
| 2 | review-agent | Synthesize all reviews, final verdict | After 1 |
| # | Agent | 关注重点 | 执行方式 |
|---|---|---|---|
| 1 | critic | 代码质量、设计模式、可读性 | 并行 |
| 1 | plan-reviewer | 架构、计划符合性 | 并行 |
| 1 | plan-reviewer | 变更影响、风险评估 | 并行 |
| 2 | review-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:并行审查
undefinedundefinedCode 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]
undefinedPhase 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 reviewUser: /review
→ 调用全部4个Agent,进行全面审查Quick Review
快速审查
User: /review --quick
→ critic only, fast feedbackUser: /review --quick
→ 仅调用critic,快速反馈Security Focus
安全聚焦审查
User: /review --security
→ Add aegis (security agent) to parallel phaseUser: /review --security
→ 在并行阶段添加aegis(安全Agent)PR Review
PR审查
User: /review PR #123
→ Fetch PR diff, review changesUser: /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:架构决策需要进一步讨论