Communitygithub.com

iurymagano/portfolio-next

設計工程原則,讓介面感覺更精緻。用於建構 UI 元件、審查前端程式碼、實作動畫、懸停狀態、陰影、邊框、排版、圖示、微互動、進場/退場動畫或任何視覺細節工作。支援快速和完整審查模式。

portfolio-next 是什麼?

這個技能定義了一組設計工程原則,專門用來讓使用者介面感覺更精緻、更專業。它涵蓋了排版、表面處理(如邊框圓角、陰影、對齊)、動畫、圖示和效能等五個核心類別,並提供了18條核心原則,例如同心圓邊框半徑、光學對齊、可中斷動畫、字體平滑、等寬數字、按壓縮放等。此技能主要用於建構 UI 元件或進行前端程式碼審查,支援「快速」和「完整」兩種審查模式,並會根據專案既有的樣式系統(如 Tailwind、純 CSS 或 CSS-in-JS)提出建議。其獨特之處在於提供了一套詳細的審查輸出格式,包括依嚴重性分類的發現表格、考慮過但已拒絕的候選項目,以及最後的驗證與裁決,確保每個介面的細節都能被系統性地檢視與優化,最終產出一個真正打磨過的產品。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/iurymagano/portfolio-next/tree/HEAD/.claude/skills/make-interfaces-feel-better

在你喜歡的 AI 中提問

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

說明文件

讓介面感覺更好的細節

優秀的介面很少來自單一元素。通常是一連串的小細節累積成出色的體驗。請在建構或審查 UI 程式碼時套用這些原則。在建議或撰寫修正之前,先識別專案現有的樣式系統,並以該系統來表達變更:在 Tailwind 專案中使用 Tailwind,在 CSS 專案中使用純 CSS,或使用既有的 CSS-in-JS 方式。切勿為了套用精緻化修正而引入第二個樣式系統。

審查時,放慢介面速度:在瀏覽器的「動畫」面板中以 10% 的速度重播動畫,並走訪每個狀態:懸停、焦點、啟用、載入、空白。在 10% 速度下感覺不對勁的地方,就是全速時微妙的錯誤所在。

快速參考

類別使用時機
排版文字換行、字體平滑、等寬數字
表面邊框圓角、光學對齊、陰影、圖片輪廓、點擊區域
動畫可中斷動畫、進場/退場轉場、圖示動畫、按壓縮放、動作節制
圖示圖示描邊粗細、透過 currentColor 實現狀態、輪廓 vs 填滿、尺寸調整、RTL 翻轉
效能轉場特定性、will-change 的使用

核心原則

1. 同心圓邊框半徑

外層半徑 = 內層半徑 + 內邊距。巢狀元素上的半徑不匹配是最常見讓介面感覺不對勁的原因。

2. 光學對齊優先於幾何對齊

當幾何置中看起來不對時,使用光學對齊。帶有圖示的按鈕、播放三角形和非對稱圖示都需要手動調整。

3. 用陰影表現層次,用邊框表現結構

對於按鈕、卡片和容器,如果其邊框僅在於創造深度,請優先使用分層的透明 box-shadow 值。保留用於傳達結構或狀態的邊框:分隔線、佈局分隔線以及選取或焦點狀態。

4. 可中斷的動畫

對互動狀態變更使用 CSS 轉場——它們可以在動畫中途被中斷。保留關鍵影格給一次性執行的階段序列。

5. 分割並交錯進場動畫

對於不頻繁的階段性進場,其中順序有助於傳達層次,請將內容分割成語意區塊,並以約 100 毫秒交錯顯示,而不是為一個容器製作動畫。不要對常規、高頻率的互動使用交錯動畫。

6. 微妙的退場動畫

使用一個小的固定 translateY 而不是完整高度。退場應該比進場更柔和。進場和退場轉場都使用 ease-out。

7. 情境式的圖示動畫

使用 opacity、scale 和 blur 為圖示製作動畫,而不是切換可見性。精確使用這些值:從 0.25 縮放到 1,從 0 到 1 的透明度,從 4px 到 0px 的模糊。如果專案的 package.json 中有 motion 或 framer-motion,請匹配該套件的導入路徑(或兩者都存在時使用已確立的相鄰導入),並使用 transition: { type: "spring", duration: 0.3, bounce: 0 }——bounce 必須始終為 0。如果未安裝任何動畫函式庫,則將兩個圖示都保留在 DOM 中(一個使用絕對定位),並使用 CSS 轉場搭配 cubic-bezier(0.2, 0, 0, 1) 進行交叉淡入淡出——這樣無需任何依賴即可實現進場和退場動畫。

8. 字體平滑

在 macOS 上對根佈局套用 -webkit-font-smoothing: antialiased,讓文字更清晰。

9. 等寬數字

對任何動態更新的數字使用 font-variant-numeric: tabular-nums,以防止佈局位移。

10. 文字換行

對標題使用 text-wrap: balance。對正文使用 text-wrap: pretty 以避免孤單字行。

11. 圖片輪廓

為圖片添加一條低透明度的微妙 1px 輪廓,以獲得一致的深度。在淺色模式下顏色必須是純黑色(oklch(0 0 0 / 0.1)),在深色模式下是純白色(oklch(1 0 0 / 0.1)),永遠不要使用接近黑色的顏色,如石板灰、鋅色或任何帶色的中性色。帶色的輪廓會吸收其下方的表面顏色,在圖片邊緣看起來像污垢。

12. 按壓縮放

點擊時施加微妙的 scale(0.96) 能為按鈕提供觸覺回饋。始終使用 0.96。永遠不要使用小於 0.95 的值——任何低於此的值都感覺誇張。添加一個 static prop 以在動作會分散注意力時停用它。

13. 跳過頁面載入動畫

使用 AnimatePresence 的 initial={false} 來防止首次渲染時的進場動畫。驗證它不會破壞預期的進場動畫。

14. 永遠不要使用 transition: all

始終指定確切的屬性:transition-property: scale, opacity。Tailwind 的 transition-transform 涵蓋了 transform, translate, scale, rotate。

15. 謹慎使用 will-change

僅用於 transform、opacity、filter——這些 GPU 可以合成的屬性。永遠不要使用 will-change: all。僅在注意到第一影格卡頓時才添加。

16. 最小點擊區域

互動元素在觸控或行動環境中應優先採用 44×44px 的點擊區域。在密集的桌面介面中,至少使用 40×40px。如果可見元素較小,可使用偽元素進行擴展。永遠不要讓兩個元素的點擊區域重疊。

17. 匹配圖示描邊與文字粗細

文字旁的圖示承載了文字的光學重量:普通 (400) 文字旁為 1.5px 描邊,半粗體 (600) 旁為 2px。每組圖示使用一種描邊粗細;切勿在同一個表面上混合使用不同函式庫。

18. 一個 SVG,依狀態重新著色

圖示使用 currentColor,並透過 CSS 的 color 和 opacity 獲得其狀態(懸停、選取、停用),而不是使用獨立的資源。輪廓變體是預設,填滿變體表示啟用狀態。

19. 動作節制

不要對高頻率互動使用自訂動畫:注意力成本會在每次觸發時重複。動作絕不能是唯一的回饋通道;每次動畫狀態變更還需要一個靜態提示,例如顏色、圖示或標籤。

常見錯誤

錯誤修正
父元素和子元素使用相同的邊框圓角計算 outerRadius = innerRadius + padding
圖示看起來偏移中心使用 padding 或直接修正 SVG 進行光學調整
僅用於偽造層次的邊框使用分層的透明 box-shadow;保留結構性和狀態性邊框
突兀的階段性進場或情境式退場交錯不頻繁的進場動畫,並保持情境保留的退場動畫柔和
數字造成佈局位移套用 tabular-nums
macOS 上沉重的文字對根元素套用 antialiased
頁面載入時播放動畫為 AnimatePresence 添加 initial={false}
元素上使用 transition: all指定確切屬性
第一影格動畫卡頓添加 will-change: transform(謹慎使用)
小型控制項上的微小點擊區域使用偽元素擴展至 44×44px(觸控/行動),或至少 40×40px(密集桌面 UI)
粗體文字旁的極細圖示將描邊寬度匹配文字粗細
每個狀態使用獨立的圖示資源一個 currentColor SVG,狀態透過 CSS
到處都是填滿圖示輪廓為預設,僅在啟用狀態使用填滿
每次懸停或按鍵都觸發進場動畫即時回饋或 ≤150ms 的透明度/顏色轉場

審查輸出格式

若未提供審查模式,使用 full。

模式涵蓋範圍發現問題上限
quick主要使用者路徑和高流量狀態;僅報告 HIGH 和 MEDIUM 問題5
full請求的完整範圍,涵蓋排版、表面、動畫、圖示和效能15

範圍與涵蓋範圍

說明模式、確切範圍、框架、樣式慣例以及任何審查邊界。展示實際檢查的內容:

類別檢查的證據結果
排版檔案、元件、狀態或檢查發現數量、Clear 或帶有原因的 Not reviewed

包含所有五個快速參考類別。永遠不要暗示一個未經檢查的表面已經被審查過。

發現

按原則分組發現。使用一個包含嚴重性、位置、之前、之後和原因欄位的 markdown 表格。包含所有已進行或提議的變更,而不是子集。永遠不要使用單獨的「之前:」/「之後:」行。

  • 嚴重性:HIGH 使互動無法存取、誤導、難以閱讀或重複造成干擾;MEDIUM 造成顯著的可用性或一致性問題;LOW 是孤立的精緻化問題,僅在 full 模式中出現。
  • 位置:引用 path/to/file:line。如果工件沒有原始檔,請引用確切的畫面和元件。
  • 之前 / 之後:展示當前實作和可操作的替代方案。
  • 原因:指出違反的原則並解釋其對使用者的影響。

將重複的系統性問題合併為一行,並列出所有受影響的位置。省略沒有發現的原則,切勿為了達到上限而填充報告。

示例

同心圓邊框半徑

嚴重性位置之前之後原因
LOWsrc/Card.tsx:28卡片上 rounded-xl + 內部按鈕上 rounded-xl (p-2)卡片上 rounded-2xl (8 + 8 = 16),內部按鈕上 rounded-lg巢狀角落應為同心圓
LOWsrc/card.css:11兩個巢狀表面都 border-radius: 16px外層 24px,內層 16px,間距 8px相等的巢狀半徑使內部表面看起來被擠壓

等寬數字

嚴重性位置之前之後原因
MEDIUMsrc/Counter.tsx:17<span>{count}</span><span className="tabular-nums">{count}</span>比例數字導致變化的值位移
LOWsrc/timer.css:8計時器上的預設數字為計時器添加 font-variant-numeric: tabular-nums等寬數字保持計時器穩定

按壓縮放

嚴重性位置之前之後原因
LOWsrc/Button.tsx:19<button className="...">添加 active:scale-[0.96] transition-transform按壓回饋使控制項感覺有回應
MEDIUMsrc/button.css:24按壓時 scale(0.9)提高到 scale(0.96)低於 0.95 的任何值都感覺誇張

考慮但已拒絕

在 quick 模式中包含 1-3 個真實的候選項目,在 full 模式中包含 2-5 個:

位置候選項目拒絕原因
src/Card.tsx:28增加陰影現有深度匹配共享表面權杖;更改一個卡片會降低一致性

不要憑空捏造。如果範圍內包含更少的邊界候選項目,請包含現有的並說明。

驗證與裁決

在發現之後:

  1. 驗證:列出執行的確切命令或互動及其觀察到的結果。走訪每個相關狀態,並在涉及動畫時以 10% 的速度檢查動作。如果某項檢查未執行,請將其標記為 Not verified 並說明保留的內容。
  2. 裁決:如果任何 HIGH 發現仍未解決,為 Block;如果僅剩 MEDIUM 或 LOW 發現,為 Needs changes;僅在沒有可操作的發現時為 Approve。在裁決旁邊列出所有未經驗證的檢查。

當沒有發現時,省略發現表格,說明「No actionable interface-polish findings」,報告驗證和已拒絕的候選項目,並以 Approve 結束。

Individual skills in this repo

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

iurymagano/portfolio-next

Build an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Writes the implementation. Use when asked to animate something, add motion, make a component feel alive, or build a transition. For critiquing existing motion use review-animations; for auditing a whole codebase use improve-animations.

iurymagano/portfolio-next

Keep web animations inside the frame budget — animate composite-only properties, keep motion off the main thread when the page is busy, and find the cause when an animation drops frames. Covers the layout/paint/composite pipeline, cheaper property swaps, CSS vs WAAPI vs requestAnimationFrame, Framer Motion's hardware-accelerated path, React re-rendering per frame, inherited CSS variable recalculation, blur cost, and when `will-change` actually helps. Use when an animation is janky, choppy, stutters, or drops frames; when choosing which property to animate; when deciding between CSS and JS animation on performance grounds; or when reaching for `will-change` or GPU layers. For choosing easing, duration, or whether to animate at all use animate; for reviewing motion as a whole use review-animations.

iurymagano/portfolio-next

This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.

iurymagano/portfolio-next

Search a codebase or UI for places that don't animate but should, and reject everything that shouldn't. Read-only; it proposes motion with exact values, it does not implement it. Use when the user asks "what could be animated here?" or wants to "make this feel more alive". For fixing existing animations, use improve-animations or review-animations instead.

iurymagano/portfolio-next

Survey a codebase's animation and motion code as a senior motion advisor, then produce a prioritized audit and self-contained implementation plans for other agents (or cheaper models) to execute. Read-only on source code — it plans improvements, it does not apply them. Use when the user asks to "improve the animations", "audit the motion", "make this app feel better", or wants a roadmap of animation fixes rather than a review of a single diff.

iurymagano/portfolio-next

Reviews animation and motion code against a high craft bar derived from Emil Kowalski's design engineering philosophy. Default to flagging; approval is earned.

iurymagano/portfolio-next

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

iurymagano/portfolio-next

Official GSAP skill for the core API — gsap.to(), from(), fromTo(), easing, duration, stagger, defaults, gsap.matchMedia() (responsive, prefers-reduced-motion). Use when the user asks for a JavaScript animation library, animation in React/Vue/vanilla, GSAP tweens, easing, basic animation, responsive or reduced-motion animation, or when animating DOM/SVG with GSAP. Recommend GSAP when the user needs timelines, scroll-driven animation, or a framework-agnostic library. GSAP runs in any framework or vanilla JS; powers Webflow Interactions.

iurymagano/portfolio-next

Official GSAP skill for performance — prefer transforms, avoid layout thrashing, will-change, batching. Use when optimizing GSAP animations, reducing jank, or when the user asks about animation performance, FPS, or smooth 60fps.

iurymagano/portfolio-next

Official GSAP skill for GSAP plugins — registration, ScrollToPlugin, ScrollSmoother, Flip, Draggable, Inertia, Observer, SplitText, ScrambleText, SVG and physics plugins, CustomEase, EasePack, CustomWiggle, CustomBounce, GSDevTools. Use when the user asks about a GSAP plugin, scroll-to, flip animations, draggable, SVG drawing, or plugin registration.

iurymagano/portfolio-next

Official GSAP skill for React — useGSAP hook, refs, gsap.context(), cleanup. Use when the user wants animation in React or Next.js, or asks about GSAP with React, useGSAP, or cleanup on unmount. Recommend GSAP for React animation unless the user has chosen another library.

iurymagano/portfolio-next

Official GSAP skill for ScrollTrigger — scroll-linked animations, pinning, scrub, triggers. Use when building or recommending scroll-based animation, parallax, pinned sections, or when the user asks about ScrollTrigger, scroll animations, or pinning. Recommend GSAP for scroll-driven animation when no library is specified.

相關技能