Communitygithub.com

介面審查

審查分支、Pull Request 或未提交的變更,找出其在無障礙性、版面、文案、排版、色彩與 UI 方面引入或退化的介面問題。

介面審查 是什麼?

此技能專注於審查程式碼變更對使用者介面的影響,而非審查整個畫面或程式碼庫。它能自動解析範圍、展開受影響的頁面或元件表面,並讀取 diff 的兩側來分類每個發現。技能支援多種平台,如 GitHub Pull Request、本機分支或未提交的變更,並可與 `better-interface` 等領域技能整合,提供嚴重性分級、收斂與最終裁決。其核心原則包括:不審查無變更的狀態、區分引入(Introduced)、退化(Regression)與既有(Pre-existing)問題、將變更的影響範圍擴展到一個或兩個跳接層級(設計 Token 可達兩個跳接),並最終將審查結果移交給 `better-interface` 形成完整的報告。它還特別注意絕不改變工作目錄(不允許 checkout 或 stash),並指導如何處理無變更時的互動流程。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/LIKELION-CAPSULE/Landing_Page/tree/HEAD/.agents/skills/interface-review

在你喜歡的 AI 中提問

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

說明文件

介面審查 是做什麼的?

此技能審查的是變更,而非整個畫面。它會解析變更範圍、將變更過的檔案展開至其所影響的介面表面、讀取 diff 的兩側,並對每個發現進行分類。

它負責範圍、分類以及以變更為範圍的報告。領域規則歸屬於 better-* 系列技能。嚴重性、收斂、涵蓋範圍、上限與裁決則歸屬於 better-interface,此技能會將審查結果移交給它。

正確性、測試、安全性與效能歸屬於專案的一般程式碼審查。這類問題只需提及一次,指向該審查後即可放下。

審查的是變更,不是程式碼庫

提交者問的是「我是否讓它變得更糟了?」。報告變更所導致的問題,對於它只是觸及到的部分則盡量保持沉默。提供三項既有的發現是禮貌;提供三十項則是不同的審查,而且沒人要求這樣做。

在對 diff 形成意見之前,請先完整閱讀整個 diff。倉促瀏覽 diff 所產生的發現,往往在下一個 diff 區塊中就已經被修正了。

核心原則

1. 先解析變更範圍

整個調用就是目標,所以 /interface-review pr 482 就是審查 Pull Request 482。範圍解析 中說明了接受的目標以及各自的解析方式。

若未提供目標,則依以下順序解析,並在找到第一個相符項目時停止:

  1. HEAD 領先於 git merge-base origin/<預設分支> HEAD。審查該範圍加上任何未提交的變更,並分別陳述提交數量與未提交檔案數量。
  2. 工作目錄有髒資料。審查未提交的變更。
  3. 兩者皆無。沒有可審查的變更,因此依照無變更時,要求使用者提供,而非自行發明的原則處理。

將已解析範圍的基礎提交記錄為 $BASE,並在範圍區塊中命名它。此技能及其參考文件中的所有命令都會使用它。

依照排除路徑排除鎖定檔、快照、產生輸出、廠商程式碼與二進位檔,並說明排除了哪些項目。如果排除後沒有任何檔案剩下,則視為無變更。

2. 無變更時,要求使用者提供,而非自行發明

乾淨的工作樹且沒有任何提交領先合併基礎,表示沒有可審查的變更。絕不能自行退回到 HEAD~1..HEAD。最後一個提交可能是剛好合併進來的東西,或根本是別人的工作。

在無可審查的項目中收集事實,陳述它們,然後提供以下途徑並等待回應:

  • 當前分支上的開放 Pull Request,如果有的話優先。一個分支的提交如果已經合併,會解析為無變更,但其 Pull Request 仍然正是使用者想要的。
  • 最後一個提交 HEAD~1..HEAD,以簡短的 SHA 與主旨命名,讓使用者看到他們會得到什麼。
  • 他們指定的目標,例如 pr <n>、一個分支、一個引用或一個範圍。
  • 整個儲存庫的介面審計,這不是變更審查。將其作為儲存庫範圍的審查移交給 better-interface,不包含此技能的範圍區塊、狀態或既有發現區段。

當排除項目清空了範圍時,在選項中列出被排除的檔案名稱。絕對不能將對「無」的審查報告為「核准」。

3. diff 不是介面表面

變更的檔案是證據,不是審查的主體。它的影響範圍是它會渲染的介面表面集合;審查那些表面。

預設展開一個跳接層級,到直接匯入者與呼叫者。只有在設計 Token、主題值與共享基本元件時,才展開到第二個跳接層級,因為這一行變更會影響整個產品。

總共最多審查五個消費者(跨兩個跳接層級),並依照範圍解析中的規則排序。說明有多少消費者你沒有展開,因為未說明的截斷會被視為完整性。

4. 閱讀被刪除的行

退化問題在變更後的狀態中是看不見的。針對已移除的訊號閱讀每個 diff 區塊的 - 側。

訊號是一條線索,不是一個發現。只有當變更中沒有任何東西取代該移除時,該移除才是退化,而這個判斷屬於領域技能。將每個未匹配的移除路由給它的擁有者,只報告該技能確認的項目,並將其狀態設為 Regression。

5. 分類每個發現

每個發現都賦予一個狀態:

  • Introduced:變更創造了它。
  • Regression:變更削弱了先前正確的東西。
  • Pre-existing:在變更之前就已存在,且未被變更惡化。

根據原因而不是位置來分類。由變更行導致的發現,無論它在哪裡出現(包括一個未受觸動的消費者使用了被變更的 Token),都應標記為 Introduced 或 Regression。變更既未創造也未惡化的發現,即使距離 diff 區塊只有三行,也應標記為 Pre-existing。

若要檢查某一行是否早於此次變更,請 blame 被審查的範圍。^ 前綴表示該行自基礎以來未變更:

git blame -L <行號>,<行號> "$BASE"..<head-ref> -- path/to/file

對於未提交的工作,省略範圍。標記為 Not Committed Yet 或 blame 為 $BASE..HEAD 範圍內提交的行,都屬於此次變更。

6. 將變更與其陳述的意圖進行比較

閱讀 Pull Request 的標題與內文、關聯的 Issue 以及提交訊息,然後審查介面是否達到了它們所宣稱的目標。

這就是你如何找到不完整的變更的方法,這是表面審查會遺漏的,因為它只檢查存在狀態。尋找那些不存在的狀態:

  • 一個新的變體、尺寸或主題套用到了某些狀態,但沒有套用到 hover、focus、active、disabled、loading 與 selected 的所有狀態。
  • 一個新的使用者面向字串,但沒有在專案維護的翻譯目錄中建立條目。
  • 一個新的元件沒有 empty、loading、error、disabled 或窄寬度狀態。
  • 一個控制項被添加到一個表面,但沒有添加到已經帶有同類控制項的兄弟表面。

不要報告範圍蔓延。變更是否做得太多是流程問題,不是介面問題。

7. 將審查移交給 better-interface

將範圍區塊、受影響的表面以及每個發現的狀態移交給 better-interface,並使用下列格式報告。

如果 better-interface 不可用,則報告已解析的範圍和檔案清單,將其命名為缺失的技能,然後停止。不要自行發明嚴重性分級、上限或裁決。

8. 絕不改變工作目錄

變更審查是唯讀的,包括 checkout。git fetch 只寫入 .git,是允許的。gh pr checkout、git checkout、git switch 和 git stash 會改寫作者打開的檔案,因此絕不允許。擷取 Pull Request 引用並就地讀取它們。

此處的渲染驗證是選擇加入的,用來代替 better-interface 的驗證可驗證的項目。將視覺與執行時期的主張標記為 未驗證,除非專案提供了便宜的預覽,或者使用者要求進行渲染審查。對於 working 和 branch 目標,目前 checkout 的就是 head,因此就地渲染即可。對於任何其他目標,在隔離的工作樹中渲染,例如 git worktree add /tmp/review-<n> refs/remotes/pr/<n>,並在完成後移除它。

完成前檢查

錯誤修復方式
範圍區塊只計算了未提交的檔案,而 HEAD 領先於合併基礎同時審查分支範圍與未提交的變更,並分別提供兩個計數
報告了使用者從未選擇的 HEAD~1..HEAD陳述事實,並在無變更時,要求使用者提供,而非自行發明中提供選項
變更了一個共享元件,但在「展開的表面」下沒有消費者展開到它的消費者,並說明你跳過了哪些
刪除了 aria-label、outline 或 prefers-reduced-motion,但沒有發現也沒有註解透過已移除的訊號將其路由給擁有者
一個 Regression,其被移除的屬性在 diff 的其他地方重新出現了先檢查等效替代
對一個未受觸動的消費者使用了被變更的 Token,其發現狀態被標為 Pre-existing是變更導致的,所以應該是 Introduced 或 Regression
某行在所有 diff 區塊之外,卻被標為 Introduced,且未說明導致此變更的程式碼針對審查範圍進行 blame
命令記錄中出現了 gh pr checkout 或 git switch擷取引用並使用 git show 讀取檔案
引用的行與 git show <head-ref>:path 的內容不符根據範圍區塊中命名的 head 引用進行引用

審查輸出格式

以範圍區塊開頭:

欄位值
目標branch、working、staged、pr 482 或輸入的範圍
基礎引用origin/main 位於 a1b2c3d
Head 引用refs/remotes/pr/482 位於 e4f5g6h
提交7 個已提交,2 個檔案未提交
範圍內檔案排除後共 12 個
已排除pnpm-lock.yaml、src/__snapshots__/、鎖定檔與快照
展開的表面CheckoutPage、SettingsPanel;另有 3 個 Button 的消費者未展開

接著是來自 better-interface 的涵蓋範圍表格。變更範圍內沒有證據的領域標記為「未審查:變更範圍內無證據」,這是一個涵蓋範圍陳述,而非缺口。

然後是發現,其中包含一個 Status 欄位,依據分類每個發現:

嚴重性領域狀態位置變更前變更後原因
高無障礙性退化src/Dialog.tsx:42在此變更中移除了 aria-label="Close"還原僅含圖示控制項上的 aria-label="Close"關閉控制項在本次變更前具有可存取名稱,現已失去

若沒有 Introduced 或 Regression 的發現,則省略該表格,並陳述「此變更中沒有可處理的介面發現。」

然後是 Pre-existing 發現,最多三項,以最嚴重的優先,簡明陳述這並非本次變更的責任。若無則省略該區段。

嚴重性領域位置問題
中排版src/Toolbar.tsx:7數值徽章使用了比例數字;此問題早於本次變更

驗證與裁決則以 better-interface 的格式呈現。

Individual skills in this repo

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

LIKELION-CAPSULE/Landing_Page

Reviews and fixes keyboard and focus behavior, ARIA, accessible names, forms, screen-reader announcements, motion and zoom in your project against WCAG 2.2.

LIKELION-CAPSULE/Landing_Page

Helps you build and check a color system for your project. It generates palettes, names semantic tokens, converts between formats and measures contrast.

LIKELION-CAPSULE/Landing_Page

Combines all of the `better-*` skills into a single review across accessibility, layout, writing, typography, color and UI polish.

LIKELION-CAPSULE/Landing_Page

Helps with grouping, alignment, reading order, responsive structure and room for translated text, so a layout holds up when it is resized, translated or mirrored.

LIKELION-CAPSULE/Landing_Page

Sets and reviews how text renders in your product, from the type scale and spacing to font features, wrapping, truncation and punctuation.

LIKELION-CAPSULE/Landing_Page

Polishes the surfaces, icons and motion in your project with exact values for border radius, optical alignment, shadows, icon states and animation.

LIKELION-CAPSULE/Landing_Page

Writes and reviews your interface copy, from labels and errors to empty states and confirmations, so it matches your product's voice and tells people what to do next.

LIKELION-CAPSULE/Landing_Page

Renders a component you choose under every scenario that can reach it on a temporary page and stress tests it.

LIKELION-CAPSULE/Landing_Page

Try to break a piece of UI by feeding it worst-case data — long names, unbreakable emails, one-letter names, missing fields, huge counts, zero items, long labels, non-Latin text, emoji, extreme numbers — then render it behind a "Demo data / Worst case" toggle and report everything that broke, with the fix for each. Use when the user asks to stress-test, break, or find edge cases in a component or screen, or to "try the worst case". For visual design critique use emil-design-eng; for motion use review-animations.

LIKELION-CAPSULE/Landing_Page

Builds UI from a Figma file or a design image so it matches the design, using your project's existing tokens and components.

LIKELION-CAPSULE/Landing_Page

Explains how a website, a visual effect or an animation was built, from a live URL or a screenshot.

LIKELION-CAPSULE/Landing_Page

Make a web app feel native on a phone — the small CSS and meta-tag fixes that separate "a website in a browser" from something that feels installed. Covers sticky hover states, tap highlight flashes, the 100vh bug, inputs that zoom the page, laggy taps, pull-to-refresh hijacking scroll, content under the notch, long-press selecting button text, carousels that scroll the wrong way, mismatched status bars, and the rule that you test on real hardware. Use when a web app is being built for or reviewed on mobile, when something "works in Chrome but feels wrong on my phone", when building a PWA, a bottom sheet, a carousel, a full-screen layout, or any touch interaction. For motion itself use animate; for React Native use animate-expo.

LIKELION-CAPSULE/Landing_Page

Renders every state of a component you choose on a throwaway page, with mock data and a switcher, so you can work on each state.

LIKELION-CAPSULE/Landing_Page

Builds multiple variants of a component you're working on and helps you iterate and pick one.

相關技能