SuperAPI AI Directory

spec-requesting-code-review

Testing & quality

View repository

Updated 10-16 08:49

About this skill

Requesting Code Review

Dispatch a code-reviewer subagent to catch issues before they spread.

Core principles: Review early, review often.

Announce at the start:"I am using the spec-requesting-code-review skill to request a code review and dispatch a review subagent."

When to request a review

Must:

  • after each task in subagent-driven development
  • after completing major features
  • before merging to main

Optional but valuable:

  • when stuck (fresh perspective)
  • before refactoring (baseline check)
  • after fixing a complex bug

How to request

1. Get git SHAs:

BASE_SHA=$(git rev-parse HEAD~1)  # 或 origin/main
HEAD_SHA=$(git rev-parse HEAD)

2. Dispatch a code-reviewer subagent:

Use the Task tool, with type code-reviewer, fill in references/code-reviewer.md the template in

Placeholders:

  • {WHAT_WAS_IMPLEMENTED} - what you just implemented
  • {PLAN_OR_REQUIREMENTS} - what should be implemented
  • {BASE_SHA} - starting commit
  • {HEAD_SHA} - ending commit
  • {DESCRIPTION} - brief summary

3. Act on feedback:

  • Fix Critical issues immediately
  • Fix Important issues before continuing
  • Record Minor issues for later handling
  • Push back if the reviewer is wrong (with reasons)

Example

[刚完成 Task 2:添加验证函数]

你:先请求代码审查再继续。

BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
HEAD_SHA=$(git rev-parse HEAD)

[派发 code-reviewer 子智能体]
  WHAT_WAS_IMPLEMENTED: 会话索引的验证和修复函数
  PLAN_OR_REQUIREMENTS: docs/plans/deployment-plan.md 的 Task 2
  BASE_SHA: a7981ec
  HEAD_SHA: 3df7661
  DESCRIPTION: 添加 verifyIndex() 和 repairIndex(),含 4 种问题类型

[子智能体返回]:
  优点:架构清晰、有真实测试
  问题:
    Important:缺少进度指示
    Minor:报告间隔的魔法数字 (100)
  评估:可以继续

你:[修复进度指示]
[继续 Task 3]

Integrating with the workflow

Subagent-Driven Development:

  • Review after each task
  • Catch issues before they accumulate
  • Fix before moving on to the next task

Executing Plans:

  • Review after each batch (3 tasks)
  • Get feedback, apply, continue

Ad-hoc development:

  • Review before merging
  • Review when stuck

Red flags

Never:

  • Skip review because it's "too simple"
  • Ignore Critical issues
  • Continue with unfixed Important issues
  • Argue with valid technical feedback

If the reviewer is wrong:

  • Push back with technical reasoning
  • Show code/tests proving it works
  • Request clarification

See template at:skills/requesting-code-review/references/code-reviewer.md