Community编程与开发github.com

请求代码审查

在完成任务、实现主要功能或合并之前使用,以验证工作是否符合要求。

请求代码审查 是什么?

该技能“请求代码审查”旨在通过派遣一个代码审查子代理,在问题变得严重之前发现并修复它们。它特别适用于子代理驱动的开发流程中,要求在每项任务后、完成主要功能后以及合并到主分支之前强制进行审查。其核心原则是“尽早审查,经常审查”。技能的核心机制是:用户获取当前基准提交(BASE_SHA)和最新提交(HEAD_SHA)的 Git SHA,然后派遣一个通用子代理,并填充一个预定义的审查模板(code-reviewer.md)。该模板需要提供变更描述、需求或计划以及代码范围。审查结果返回后,用户必须立即修复关键问题,在继续之前修复重要问题,并记录次要问题。该技能适用于任何支持子代理的 AI 开发平台(如 Claude Code、Cursor、Codex 等)。它的关键设计是:审查者只获得精确构造的上下文,而不是用户完整的会话历史,从而有效节省上下文窗口并保持审查的客观性。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/obra/superpowers/tree/main/skills/requesting-code-review

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

请求代码审查 是做什么的?

派遣一个代码审查子代理,在问题级联之前发现它们。审查者获得精确构建的评估上下文——绝不包含你的会话历史。

**核心原则:**尽早审查,经常审查。

何时请求审查

强制性:

  • 在子代理驱动的开发中每项任务之后
  • 完成主要功能后
  • 合并到主分支之前

可选但有价值:

  • 卡住时(获得新视角)
  • 重构之前(基线检查)
  • 修复复杂错误后

如何请求

1. 获取 Git SHA:

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

2. 派遣代码审查子代理:

派遣一个 general-purpose 子代理,填写 code-reviewer.md 中的模板

占位符:

  • {DESCRIPTION} - 你构建内容的简要总结
  • {PLAN_OR_REQUIREMENTS} - 它应该做什么
  • {BASE_SHA} - 起始提交
  • {HEAD_SHA} - 结束提交

3. 根据反馈行动:

  • 立即修复严重问题
  • 在继续之前修复重要问题
  • 记录次要问题以备后用
  • 如果审查者错了则反驳(附上理由)

示例

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

你:让我在继续之前请求代码审查。

BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | cut -d' ' -f1)
HEAD_SHA=$(git rev-parse HEAD)

[派遣代码审查子代理]
  DESCRIPTION:添加了 verifyIndex() 和 repairIndex(),包含4种问题类型
  PLAN_OR_REQUIREMENTS:来自 docs/superpowers/plans/deployment-plan.md 的任务2
  BASE_SHA:a7981ec
  HEAD_SHA:3df7661

[子代理返回]:
  优点:清晰的架构,真实的测试
  问题:
    重要:缺少进度指示器
    次要:报告间隔的魔法数字(100)
  评估:可以继续

你:[修复进度指示器]
[继续到任务3]

常见借口

借口现实
“我会自己审查差异而非派遣审查者”你是协调者——内联审查差异会消耗你需要继续推动工作的上下文窗口。派遣审查子代理:差异和评估存在于它的上下文中,只有结果返回给你。
“审查者需要我的整个会话历史才能理解变更”交给它精确构建的上下文,绝不给予你的会话历史。这能让审查者专注于工作成果,而非你的思考过程。

红旗警报

绝对不要:

  • 因为“太简单”而跳过审查
  • 忽略严重问题
  • 在未修复重要问题的情况下继续
  • 与有效的技术反馈争论

如果审查者错了:

  • 用技术理由反驳
  • 展示证明其工作的代码/测试
  • 请求澄清

参见模板:code-reviewer.md

Individual skills in this repo

This repo contains 14 individual skills — each has its own dedicated page.

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

diagnosing-superpowers

Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

dispatching-parallel-agents

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

executing-plans

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

finishing-a-development-branch

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

receiving-code-review

Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation

subagent-driven-development

Use when executing implementation plans with independent tasks in the current session

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code

using-git-worktrees

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback

using-superpowers

Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions

verification-before-completion

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

writing-plans

Use when you have a spec or requirements for a multi-step task, before touching code

writing-skills

Use when creating new skills, editing existing skills, or verifying skills work before deployment

相关技能