SuperAPI AI Directory

requesting-code-review

Coding & development

View repository

Updated 10-16 10:06

About this skill

Requesting Code Review

Dispatch a superpowers:code-reviewer subagent to catch problems before they spread.

Core principles: Review early, review often.

When to Request Review

Must:

  • subagent-driven development: review after each completed task
  • After completing a major feature
  • Before merging to main

Optional but very worthwhile:

  • When stuck (need a fresh perspective)
  • Before refactoring (confirm the baseline first)
  • After fixing a complex bug

How to Request Review

1) Get the git SHA:

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

2) Dispatch the code-reviewer subagent:

Use the Task tool, select type superpowers:code-reviewer, and fill in the code-reviewer.md template.

Placeholders:

  • {WHAT_WAS_IMPLEMENTED}: what you just implemented
  • {PLAN_OR_REQUIREMENTS}: what the requirements/plan are
  • {BASE_SHA}: starting commit
  • {HEAD_SHA}: ending commit
  • {DESCRIPTION}: brief description

3) Handle feedback:

  • Critical: fix immediately
  • Important: fix before continuing
  • Minor: note it and handle later
  • If the reviewer's judgment is wrong: rebut with clear technical reasoning (provide evidence)

Example

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

你:在继续之前先做一次 code review。

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

[派发 superpowers:code-reviewer subagent]
  WHAT_WAS_IMPLEMENTED: 对话索引的验证与修复函数
  PLAN_OR_REQUIREMENTS: docs/plans/deployment-plan.md 中的 Task 2
  BASE_SHA: a7981ec
  HEAD_SHA: 3df7661
  DESCRIPTION: 新增 verifyIndex() 和 repairIndex(),覆盖 4 类问题

[Subagent 返回]
  优点:架构清晰、测试真实
  问题:
    重要:缺少进度提示
    次要:报告间隔的 magic number(100)
  结论:可以继续

你:[补上进度提示]
[继续 Task 3]

Integration with Other Workflows

Subagent-Driven Development:

  • Review after each task
  • Catch it before problems compound
  • Fix it before moving on to the next task

Executing Plans:

  • Review after each batch (e.g., 3 tasks)
  • Get feedback → fix → continue

Ad-Hoc development:

  • Review before merging
  • Review when stuck

Red Flags

Never:

  • Skip review because it's "simple"
  • Ignore Critical
  • Continue pushing forward without fixing Important
  • Stubbornly argue against reasonable technical feedback

If the reviewer is wrong:

  • Fight back with technical reasoning
  • Show code/tests that prove correctness
  • Ask the other party to clarify the specific point

Template location:requesting-code-review/code-reviewer.md