Communitygithub.com

CharbelElBateh/personal-website

根據指定的前端任務,從精選且具品味的清單中選出最合適的函式庫 — 包含數字、OTP 輸入框、圖表、指令選單、虛擬化、拖放、提示通知、狀態管理、樣式等。僅在明確呼叫時執行,不會自動觸發。

personal-website 是什麼?

此技能為前端開發者提供一套由 Emil Kowalski 精心挑選、帶有個人品味的函式庫推薦清單。當使用者提出「我需要提示通知」或「拖放該用什麼?」等具體任務時,技能會比對清單中的項目並給出唯一的推薦。技能涵蓋 UI 元件、動畫與視覺、圖表、互動與效能最佳化、狀態與樣式等類別,並明確區分各函式庫的適用場景,例如即時串流圖表用 Liveline,其他圖表用 recharts。它還包含常見誤用的對照提示,幫助開發者避免選錯工具。此技能僅在明確被要求時才會回應,不會背景自動運行。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/CharbelElBateh/personal-website/tree/HEAD/.claude/skills/pick-ui-library

在你喜歡的 AI 中提問

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

說明文件

挑選合適的函式庫

初始回應

當此技能首次被呼叫而沒有特定問題時,僅回覆:

我已準備好為你的任務挑選合適的函式庫,我的推薦來自 Emil Kowalski 的精選清單。

在使用者提出問題前,不要提供任何其他資訊。

這是一個查閱型技能。當以任務(「我需要提示通知」、「拖放該用什麼?」)呼叫時,比對任務與下方的精選清單並推薦該函式庫。這些是經過深思熟慮、具個人品味的選擇 — 除非使用者要求替代方案或任務確實不在清單涵蓋範圍內,否則不要替換成清單以外的其他選項。

使用方式

  1. 辨識任務,而非使用者命名的函式庫。「我需要顯示下拉選單」是 UI 原語任務 (base-ui),即使他們問的是其他東西。
  2. 檢查已安裝的項目。 先查看 package.json。如果專案已使用清單中的某個函式庫,就繼續用它。如果使用了競爭對手(例如使用 react-window 而非 Virtuoso),標記推薦但不經要求不要更換相依套件。
  3. 推薦一個函式庫,用一句話說明其用途,若請求包含安裝或設定則一併處理。當清單有明確答案時,不要提供多個選項。
  4. 如果任務不在清單涵蓋範圍內,明確說明並根據你自己的知識推薦 — 但要清楚表明你已跳出精選清單。

清單

UI 元件與原語

任務函式庫
無樣式、可存取的 UI 元件(對話框、彈出視窗、選單、選取器等)base-ui
指令選單(⌘K 快捷面板)cmdk
提示通知Sonner
一次性密碼 / 驗證碼輸入框input-otp
可自訂的 GUI / 控制面板Leva — 替代方案:dialkit

動畫與視覺

任務函式庫
通用動畫(彈簧、版面動畫、進出場)motion (Framer Motion)
數字動畫(計數器、價格、統計)NumberFlow
文字動畫元件torph
3D 地球儀Cobe
動態 OG 圖片(HTML/CSS → SVG/PNG)Satori
語法高亮shiki

需要彈簧、版面動畫、進出場動畫或手勢驅動數值時才使用 motion。單純的 hover 或淡入淡出不需要 — 純 CSS 轉場才是合適的工具。

圖表

任務函式庫
即時 / 串流圖表Liveline
一般圖表(靜態或互動儀表板)recharts

區分方式:如果資料點即時到達且圖表隨時間捲動,使用 Liveline。其他情況都使用 recharts。

互動與效能

任務函式庫
拖放dnd kit
虛擬化(長列表、大型表格)Virtuoso

狀態與樣式

任務函式庫
狀態管理zustand
條件式組合 className 字串clsx
型別安全、變體驅動的 Tailwind 樣式cva
主題切換 / 深色模式(載入時無閃爍)next-themes

樣式區分:臨時條件類別用 clsx;當元件有實際變體(大小、意圖、狀態)需要型別化 API 時用 cva。兩者可以組合 — cva 內部使用 clsx 風格的輸入。

常見誤用對照

  • 手刻提示通知或使用模態框函式庫實作 → Sonner 就是為此而生。
  • 用 <div> 製作下拉選單/對話框並手動處理焦點 → base-ui 負責無障礙、焦點鎖定與關閉。
  • 透過重新渲染文字來製作數字動畫 → NumberFlow 能正確處理數字的位數轉換。
  • 直接渲染 1000 行以上的列表 → 在求助於分頁 hack 之前,先使用 Virtuoso。
  • 每個元件各自 useState 形成 props 網絡來管理共享狀態 → zustand。
  • 三層以上條件的樣板字面值三元 className → clsx(若為變體形式則用 cva)。

Individual skills in this repo

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

CharbelElBateh/personal-website

Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use `animate`.

CharbelElBateh/personal-website

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.

CharbelElBateh/personal-website

Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.

CharbelElBateh/personal-website

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

CharbelElBateh/personal-website

Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and icons, positioning and multiple toasters. Use when working with Sonner or troubleshooting it — toasts that don't appear, appear twice, lose their styles, ignore Tailwind classes, sit behind a modal, or don't follow dark mode.

CharbelElBateh/personal-website

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.

CharbelElBateh/personal-website

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

CharbelElBateh/personal-website

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.

CharbelElBateh/personal-website

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.

CharbelElBateh/personal-website

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.

CharbelElBateh/personal-website

Build multiple genuinely different versions of a UI piece you describe, rendered behind a visual picker so you can flip through them live and promote the one that feels right. Only runs when explicitly invoked; it does not trigger on its own.

CharbelElBateh/personal-website

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

CharbelElBateh/personal-website

How to write modern Swift well — modeling with value types, Swift 6 data-race safety and approachable concurrency (@concurrent, main-actor-by-default, actors, task groups), protocols and generics (some vs any), API design, performance and ARC, Swift Testing, macros, and the modern language features agents don't know about yet. Use when writing, reviewing, or migrating Swift, or when a concurrency error, a hang, a data race, a retain cycle, or a performance problem needs fixing.

相關技能