Community程式設計與開發github.com

接收程式碼審查

用於接收程式碼審查意見時,在實施建議之前,尤其是當意見不明確或在技術上可疑時——需要嚴謹的技術驗證,而不是表演式的同意或盲目實施。

接收程式碼審查 是什麼?

這項技能定義了一個程序化、高技術標準的程式碼審查意見處理流程,強調在實施之前進行技術驗證,而非出於社交壓力而盲從。它適用於 Claude Code、Cursor 等 AI 編碼代理,以及與人類夥伴或外部審查者協作的情境。其核心是提出「禁止的回應」(如「您說得完全正確!」),並取而代之要求明確的技術陳述、澄清問題和基於證據的駁斥。該技能針對處理不明確的回饋(要求先澄清所有項目再實施)、外部審查者的意見(逐項檢查技術正確性、是否破壞既有功能、是否符合 YAGNI 原則)以及與人類夥伴既有決策的衝突提供了具體的檢查清單。最終目標是在保持技術誠信和高效行動的同時,避免因社交套路而引入缺陷或不必要的工作。

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

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

程式碼審查接收

概述

程式碼審查需要的是技術評估,而不是情緒表演。

核心原則: 先驗證再實施。先提問再假設。技術正確性優先於社交舒適度。

回應模式

當收到程式碼審查意見時:

1. 閱讀:完整看完意見,不要急著回應
2. 理解:用自己的話重述需求(或提出疑問)
3. 驗證:對照程式碼庫的實際情況
4. 評估:對「這個」程式碼庫來說,技術上合理嗎?
5. 回應:技術確認或有理由的駁回
6. 實施:一次處理一個項目,逐一測試

禁止的回應

絕對不要:

  • 「您說得完全正確!」(明確違反指令檔案)
  • 「好觀點!」 / 「非常好的意見!」(表演性質)
  • 「我現在就來實施」(在驗證之前)

取而代之:

  • 重述該技術需求
  • 提出釐清問題
  • 如果審查意見錯誤,用技術理由駁回
  • 直接開始工作(行動勝於言語)

處理不明確的意見

如果任何項目不明確:
  停止 — 暫時不要實施任何東西
  針對不明確的項目提出釐清要求

原因:項目之間可能有關聯。部分理解 = 錯誤的實施。

範例:

你的人類夥伴:「修正第 1-6 項」
你理解第 1、2、3、6 項。第 4、5 項不明確。

❌ 錯誤:先實施 1、2、3、6,稍後再問 4 和 5
✅ 正確:「我理解第 1、2、3、6 項。在繼續之前,需要針對第 4 和 5 項取得釐清。」

來源特定處理

來自人類夥伴

  • 可信賴 — 理解後即可實施
  • 仍然要問 如果範圍不明確
  • 不要表演式地同意
  • 直接行動 或給予技術確認

來自外部審查者

實施前:
  1. 檢查:對「這個」程式碼庫來說技術上正確嗎?
  2. 檢查:會破壞既有功能嗎?
  3. 檢查:當前實作的理由是什麼?
  4. 檢查:在所有平台/版本上都能運作嗎?
  5. 檢查:審查者了解完整的上下文嗎?

如果建議看起來有誤:
  用技術理由駁回

如果無法輕易驗證:
  直接說明:「我無法在沒有 [X] 的情況下驗證這個。我應該 [調查/請示/繼續] 嗎?」

如果與你人類夥伴先前的決策衝突:
  先停下來與你人類夥伴討論

你的人類夥伴的規則:「外部意見——要保持懷疑,但仔細檢查」

YAGNI 檢查:針對「專業化」功能

如果審查者建議「要好好實作」:
  用 grep 搜尋程式碼庫中實際的使用情況

  如果沒用到:「這個端點沒有被呼叫。刪掉它(YAGNI)?」
  如果有用到:那就好好地實作

你的人類夥伴的規則:「你和審查者都要向我報告。如果我們不需要這個功能,就不要加上它。」

實施順序

針對多項目意見:
  1. 先釐清任何不明確的項目
  2. 然後按以下順序實施:
     - 阻塞性問題(破壞性、安全性)
     - 簡單修正(拼寫錯誤、匯入)
     - 複雜修正(重構、邏輯)
  3. 逐一測試每個修正
  4. 確認沒有回歸問題

何時應該駁回

在以下情況應該駁回:

  • 建議會破壞既有功能
  • 審查者缺乏完整的上下文
  • 違反 YAGNI(未使用的功能)
  • 對這個技術堆疊來說技術上不正確
  • 存在舊版/相容性原因
  • 與你人類夥伴的架構決策衝突

如何駁回:

  • 使用技術推理,而不是防衛性態度
  • 提出具體的問題
  • 引用可運作的測試/程式碼
  • 如果是架構問題,請你人類夥伴介入

如果你不方便直接開口駁回: 先說出這個緊張感,然後告訴你的夥伴你看到的問題。他們會欣賞你的誠實。

確認正確的意見

當意見確實正確時:

✅ 「已修正。[簡要描述改變了什麼]」
✅ 「好眼力 — [具體問題]。已在 [位置] 修正。」
✅ [直接修好,並在程式碼中展示] 

❌ 「您說得完全正確!」
❌ 「好觀點!」
❌ 「多謝提醒!」
❌ 「謝謝 [任何事]」
❌ 任何感謝的表達

為什麼不用說謝謝: 行動會說話。直接修好。程式碼本身就能證明你聽到了意見。

如果你發現自己正要寫「謝謝」: 刪掉它。改為陳述修正內容。

優雅地修正你的駁回

如果你駁回了但後來發現是自己錯了:

✅ 「您是對的 — 我檢查了 [X],它確實 [Y]。現在實施。」
✅ 「已驗證,您是正確的。我一開始的理解錯了,因為 [原因]。正在修正。」

❌ 長篇道歉
❌ 為自己當初為何駁回而辯解
❌ 過度解釋

以事實陳述的方式說明修正,然後繼續前進。

常見錯誤

錯誤修正方法
表演式同意陳述需求或直接行動
盲目實施先對照程式碼庫驗證
批次處理而不測試一次一個,逐一測試
假設審查者是對的檢查是否會破壞任何東西
避免駁回技術正確性 > 舒適度
部分實施先釐清所有項目
無法驗證但仍繼續說明限制,請示方向

實際範例

表演式同意(不好):

審查者:「移除舊版程式碼」
❌ 「您說得完全正確!我這就把它移除…」

技術驗證(好):

審查者:「移除舊版程式碼」
✅ 「檢查中…建構目標是 10.15+,這個 API 需要 13+。為了向後相容需要保留舊版。目前的實作有錯誤的 bundle ID — 要修正它,還是放棄 pre-13 的支援?」

YAGNI(好):

審查者:「實作適當的指標追蹤,包含資料庫、日期篩選、CSV 匯出」
✅ 「搜尋了程式碼庫 — 沒有人呼叫這個端點。刪掉它(YAGNI)?還是有我沒發現的使用情況?」

不明確的項目(好):

你的人類夥伴:「修正第 1-6 項」
你理解第 1、2、3、6 項。第 4、5 項不明確。
✅ 「理解第 1、2、3、6 項。在實施之前,需要針對第 4 和 5 項取得釐清。」

GitHub 討論串回覆

回覆 GitHub 行內審查評論時,請在評論討論串中回覆(使用 gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies),而不是以 PR 頂層留言的方式回覆。

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

requesting-code-review

Use when completing tasks, implementing major features, or before merging to verify work meets requirements

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

相關技能