Community程式設計與開發github.com

請求程式碼審查

在完成任務、實作主要功能或合併前使用,以驗證工作是否符合需求。

請求程式碼審查 是什麼?

這個技能讓你能夠在開發過程中,派遣一個程式碼審查子代理來及早發現問題,避免問題蔓延。審查者會收到精確建構的上下文進行評估,絕不會看到你的會話歷史。它特別適合用於子代理驅動開發中的每個任務、重大功能完成後以及合併到主分支之前。使用方式包括取得 git SHA、派遣填寫特定模板的子代理,並根據回饋採取行動。支援的平台包括任何可以執行子代理的開發環境,例如 Claude Code 或 Cursor。

相容平台~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 "任務 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]

常見的合理化藉口

藉口現實
「我自己審閱 diff 就好,不必派遣審查者」你是協調者——內聯審閱 diff 會耗盡你需要用來繼續推動工作的上下文視窗。派遣一個審查子代理:diff 和評估存在於它的上下文中,只有結果會回傳給你。
「審查者需要我的完整會話歷史才能理解變更」給它精確建構的上下文,絕不要你的會話歷史。這樣能讓審查者專注在工作成果上,而不是你的思考過程。

紅旗警示

絕不:

  • 因為「它很簡單」而跳過審查
  • 忽略嚴重問題
  • 在未修復重要問題的情況下繼續
  • 與有效的技術回饋爭論

如果審查者錯了:

  • 用技術推理提出異議
  • 展示證明程式碼/測試能正常運作
  • 請求釐清

請參閱模板: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

相關技能