| name | code-review |
| description (EN) | Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/spec asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to \"review since X\". |
| 說明 (繁中) | 沿兩軸審查自某個固定點(commit、分支、標籤或合併基點)以來的變更——規範(軸)(程式碼是否符合此 repo 記錄的編碼規範?)與規格(軸)(程式碼是否符合原始 issue/規格的要求?)。以平行子代理執行兩種審查並排呈現。當使用者想審查分支、PR、進行中的變更,或說「review since X」時使用。 |
Two-axis review of the diff between HEAD and a fixed point the user supplies:
對 HEAD 與使用者提供的固定點之間的 diff 做雙軸審查:
Both axes run as parallel sub-agents so they don't pollute each other's context, then this skill aggregates their findings.
兩個軸都以平行子代理執行,讓它們不污染彼此的上下文,然後本技能匯總它們的發現。
The issue tracker should have been provided to you. If docs/agents/issue-tracker.md is missing, tell the user to run /setup-matt-pocock-skills.
Issue 追蹤器應該已經提供給你——如果 docs/agents/issue-tracker.md 缺失,執行 /setup-matt-pocock-skills。
Whatever the user said is the fixed point (a commit SHA, branch name, tag, main, HEAD~5, etc.). If they didn't specify one, ask for it.
無論使用者說的固定點是什麼——一個 commit SHA、分支名稱、標籤、main、HEAD~5 等。如果他們沒指定,就問。
Capture the diff command once: git diff <fixed-point>...HEAD (three-dot, so the comparison is against the merge-base). Also note the list of commits via git log <fixed-point>..HEAD --oneline.
把 diff 指令記下來一次:git diff <fixed-point>...HEAD(三點,這樣比較對象是合併基點)。也要用 git log <fixed-point>..HEAD --oneline 記下 commit 清單。
Before going further, confirm the fixed point resolves (git rev-parse <fixed-point>) and the diff is non-empty. A bad ref or empty diff should fail here, not inside two parallel sub-agents.
進一步之前,確認固定點能解析(git rev-parse <fixed-point>)而且 diff 非空。壞的 ref 或空的 diff 應該在這裡失敗——而不是在兩個平行子代理內部。
Look for the originating spec, in this order:
依此順序尋找原始規格:
#123, Closes #45, GitLab !67, etc.), fetched via the workflow in docs/agents/issue-tracker.md.docs/, specs/, or .scratch/ matching the branch name or feature.#123、Closes #45、GitLab !67 等)——透過 docs/agents/issue-tracker.md 中的工作流程擷取。docs/、specs/ 或 .scratch/ 下符合分支名稱或功能的規格檔。Anything in the repo that documents how code should be written, such as CODING_STANDARDS.md or CONTRIBUTING.md.
repo 中任何記錄程式碼應如何撰寫的東西,例如 CODING_STANDARDS.md 或 CONTRIBUTING.md。
On top of whatever the repo documents, the Standards axis always carries the smell baseline below: a fixed set of Fowler code smells (Refactoring, ch.3) that applies even when a repo documents nothing. Two rules bind it:
在 repo 記錄的任何東西之上,規範軸永遠攜帶下面這份壞味道基線——一組固定的 Fowler 壞味道(Refactoring,第 3 章),即使 repo 什麼都沒記錄也適用。兩條規則綁定它:
Each smell reads what it is → how to fix; match it against the diff:
每個壞味道讀成它是什麼 → 如何修;把它對上 diff:
switch/if-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.a.b().c().d() navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.switch / if 級聯在變更中重複出現。→ 用多型取代,或一個兩處共享的 map。a.b().c().d() 導覽,呼叫者不該依賴它。→ 把這趟走訪藏到第一個物件上的單一方法後面。Standards sub-agent prompt should include:
發送單一訊息、兩個 Agent 工具呼叫。兩者都用 general-purpose 子代理。
規範子代理提示——包含:
Spec sub-agent prompt should include:
規格子代理提示——包含:
If the spec is missing, skip the Spec sub-agent and note this in the final report.
如果規格缺失,跳過規格子代理並在最終報告中註明。
Present the two reports under ## Standards and ## Spec headings, verbatim or lightly cleaned. Do not merge or rerank findings, because the two axes are deliberately separate (see Why two axes).
End with a one-line summary: total findings per axis, and the worst issue within each axis (if any). Don't pick a single winner across axes: that's the reranking the separation exists to prevent.
在 ## Standards 與 ## Spec 標題下呈現兩份報告,原樣或輕度清理。不要合併或重新排序發現——兩個軸刻意分開(見《為什麼兩軸》)。
以一行摘要結尾:每個軸的發現總數,以及每個軸內最嚴重的問題(如果有的話)。不要跨軸選一個總冠軍——那正是分離所要防止的重新排序。
A change can pass one axis and fail the other:
一個變更可以過一軸而掛另一軸:
Reporting them separately stops one axis from masking the other.
(無英文對照)
分開回報能阻止一個軸掩蓋另一個。