Communitygithub.com

CharbelElBateh/personal-website

根据策划好的精选列表,为前端任务选择合适的库——涵盖数字、OTP 输入、图表、命令菜单、虚拟化、拖放、Toast、状态、样式等。仅在显式调用时运行,不会自动触发。

personal-website 是什么?

该技能基于 Emil Kowalski 的精心策划列表,为前端工程任务提供有针对性的库推荐。当开发者提出诸如“我需要 Toast”或“拖放用什么?”之类的任务时,技能会匹配任务到预定义的类别(如 UI 组件、动画、图表、状态管理等),并推荐单一最佳库,避免呈现多个选项。它还指导工程师在提出推荐前首先检查项目当前的依赖项(package.json),并在必要时标记冲突的现有库以最小化依赖变更。此技能在被显式调用时激活,不会自动运行。支持的平台包括 Claude Code 和类似 AI 编码代理环境。它通过系统化的决策树——先识别任务而非命名的库,检查现有依赖,然后从列表中推荐单一库——帮助避免常见的陷阱(如手动实现 Toast 或状态自管理)。对于列表未覆盖的任务,它会如实说明并回退到自身的通用知识。

兼容平台~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 的精选列表。

在用户提出问题之前,不要提供任何其他信息。

这是一个查询技能。当被赋予一个任务(例如“我需要 Toast”、“拖放用什么?”)时,将任务与下面的精选列表匹配并推荐对应的库。这些推荐是有品味倾向性的选择——除非用户要求替代方案,或任务确实不在列表覆盖范围内,否则不要替换为列表之外的替代库。

如何使用

  1. 识别任务,而不是用户提到的库名。“我需要一个下拉菜单”是 UI 原语任务(base-ui),即使他们问的是其他东西。
  2. 检查已安装的依赖。 先查看 package.json。如果项目已使用列表中的某个库,就使用它。如果使用了竞品(例如用 react-window 代替 Virtuoso),则需要在推荐中标明,但未经询问不要随意更换依赖。
  3. 推荐一个库,用一句话说明其用途,如果请求中包含安装或配置步骤,则执行安装或集成。当列表中有明确答案时,不要提供多个选项。
  4. 如果任务不在列表覆盖范围内,要明确说明,并根据自己的知识进行推荐——但需清楚说明已超出精选列表范围。

列表

UI 组件与基础组件

任务库
无样式、无障碍的 UI 组件(对话框、弹出框、菜单、选择器等)base-ui
命令菜单(⌘K 面板)cmdk
Toast / 通知Sonner
一次性密码 / 验证码输入框input-otp
可定制的 GUI / 控制面板Leva — dialkit 为替代方案

动效与视觉

任务库
通用动画(弹簧动效、布局动画、进入/退出)motion (Framer Motion)
数字动画(计数器、价格、统计数字)NumberFlow
动画文本组件torph
3D 地球Cobe
动态 OG 图像(HTML/CSS → SVG/PNG)Satori
语法高亮shiki

当你需要弹簧动效、布局动画、退出动画或手势驱动的值时,才使用 motion。简单的悬停或淡出效果不需要它——纯 CSS 过渡才是正确的工具。

图表

任务库
实时 / 流式图表Liveline
通用图表(静态或交互式仪表盘)recharts

划分原则:如果数据点实时到达且图表随时间滚动,使用 Liveline。其他所有情况使用 recharts。

交互与性能

任务库
拖放dnd kit
虚拟化(长列表、大表格)Virtuoso

状态与样式

任务库
状态管理zustand
条件式构建 className 字符串clsx
针对 Tailwind 的类型安全、变体驱动的样式cva
主题切换 / 暗黑模式(加载时不闪烁)next-themes

样式划分:clsx 用于临时性的条件类;cva 用于组件有真正变体(大小、意图、状态)且需要类型化 API 的情况。它们可以组合使用——cva 内部使用 clsx 风格的输入。

常见误匹配需注意

  • 手动实现 Toast 或使用模态框库处理通知 → Sonner 正是为此而生。
  • 用 <div> 实现下拉菜单/对话框并手动处理焦点 → base-ui 能处理无障碍、焦点锁定和关闭。
  • 通过重新渲染文本来实现数字动画 → NumberFlow 能正确处理数字过渡。
  • 直接渲染超过 1000 行的列表 → 在寻求分页技巧之前,先使用 Virtuoso。
  • 为共享状态使用每组件一个 useState 的属性传递网络 → 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.

相关技能