hierarchical

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Hierarchical Code Review

分层代码评审

Context

上下文信息

  • Current branch: !
    git branch --show-current
  • Git status: !
    git status --porcelain
  • Base branch: !
    (git show-branch | grep '*' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -1 | sed 's/.*\[\([^]]*\)\].*/\1/' | sed 's/\^.*//' 2>/dev/null) || echo "develop"
  • Changes since base: !
    BASE=$(git merge-base HEAD develop 2>/dev/null || git merge-base HEAD main 2>/dev/null) && git log --oneline $BASE..HEAD
  • Files changed since base: !
    BASE=$(git merge-base HEAD develop 2>/dev/null || git merge-base HEAD main 2>/dev/null) && git diff --name-only $BASE..HEAD
  • Test commands available: !
    ([ -f package.json ] && echo "npm/pnpm/yarn test") || ([ -f Cargo.toml ] && echo "cargo test") || ([ -f pyproject.toml ] && echo "pytest/uv run pytest") || ([ -f go.mod ] && echo "go test") || echo "no standard test framework detected"
  • 当前分支:!
    git branch --show-current
  • Git状态:!
    git status --porcelain
  • 基准分支:!
    (git show-branch | grep '*' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -1 | sed 's/.*\[\([^]]*\)\].*/\1/' | sed 's/\^.*//' 2>/dev/null) || echo "develop"
  • 相对基准分支的变更:!
    BASE=$(git merge-base HEAD develop 2>/dev/null || git merge-base HEAD main 2>/dev/null) && git log --oneline $BASE..HEAD
  • 相对基准分支修改的文件:!
    BASE=$(git merge-base HEAD develop 2>/dev/null || git merge-base HEAD main 2>/dev/null) && git diff --name-only $BASE..HEAD
  • 可用测试命令:!
    ([ -f package.json ] && echo "npm/pnpm/yarn test") || ([ -f Cargo.toml ] && echo "cargo test") || ([ -f pyproject.toml ] && echo "pytest/uv run pytest") || ([ -f go.mod ] && echo "go test") || echo "no standard test framework detected"

Requirements

要求

  • Use @tech-lead-reviewer — architectural impact assessment — to scope architectural risk before launching specialized reviews.
  • Run parallel reviews with:
    • @code-reviewer — logic correctness, tests, error handling.
    • @security-reviewer — authentication, data protection, validation.
    • @ux-reviewer — usability and accessibility (skip if purely backend/CLI).
  • Consolidate findings by priority (Critical → High → Medium → Low) and confidence (High → Medium → Low).
  • Offer optional implementation support and ensure commits follow Git conventions (See
    ${CLAUDE_PLUGIN_ROOT}/skills/references/git-commit-conventions.md
    for details).
  • 使用**@tech-lead-reviewer**(架构影响评估)在启动专项评审前确定架构风险范围。
  • 并行运行以下专项评审:
    • @code-reviewer(逻辑正确性、测试、错误处理)
    • @security-reviewer(身份验证、数据保护、校验机制)
    • @ux-reviewer(可用性与可访问性,若为纯后端/CLI项目则跳过)
  • 按优先级(严重→高→中→低)和可信度(高→中→低)整合评审结果。
  • 提供可选的实现支持,并确保提交遵循Git规范(详情见
    ${CLAUDE_PLUGIN_ROOT}/skills/references/git-commit-conventions.md
    )。

Your Task

你的任务

IMPORTANT: You MUST use the Task tool to complete ALL tasks.
  1. Perform a leadership assessment with @tech-lead-reviewer — architectural impact assessment — to map risk areas and determine which specialized agents to involve.
  2. Launch the required specialized reviews in parallel via the Task tool, collect outcomes, and resolve conflicting feedback.
  3. Present a consolidated report with prioritized recommendations, ask whether the user wants fixes implemented, and if so, execute optimizations and testing before summarizing results.
重要提示:你必须使用Task工具完成所有任务。
  1. 与**@tech-lead-reviewer**(架构影响评估)协作进行领导力评估,梳理风险领域并确定需要参与的专业Agent。
  2. 通过Task工具并行启动所需的专项评审,收集结果并解决反馈中的冲突。
  3. 提交包含优先级建议的整合报告,询问用户是否需要修复问题;若需要,则在执行优化和测试后总结结果。

Review Flow

评审流程

  • Technical Leadership Assessment: Evaluate architecture, technical debt, scalability, and maintainability impact.
  • Parallel Specialized Reviews:
    • @code-reviewer — logic correctness, tests, error handling.
    • @security-reviewer — authentication, data protection, validation.
    • @ux-reviewer — usability and accessibility (skip if purely backend/CLI).
  • Consolidated Analysis: Merge findings, prioritize by impact/confidence, and produce actionable improvements.
  • Optional Implementation: Address security, quality, or UX issues as requested, then run tests and validations.
  • Final Optimization: Engage @code-simplifier — code simplification and optimization — to refactor implemented fixes, remove redundancy, and verify compliance with SOLID principles before finalizing the summary.
  • 技术领导力评估:评估架构、技术债务、可扩展性和可维护性影响。
  • 并行专项评审
    • @code-reviewer(逻辑正确性、测试、错误处理)
    • @security-reviewer(身份验证、数据保护、校验机制)
    • @ux-reviewer(可用性与可访问性,若为纯后端/CLI项目则跳过)
  • 整合分析:合并评审结果,按影响/可信度排序,生成可执行的改进建议。
  • 可选实现支持:根据用户要求解决安全、质量或UX问题,然后运行测试和验证。
  • 最终优化:与**@code-simplifier**(代码简化与优化)协作重构已修复的代码,消除冗余,并在最终总结前验证是否符合SOLID原则。