Communitygithub.com

iurymagano/portfolio-next

用于使界面看起来更精致的设计工程原则。在构建 UI 组件、审查前端代码、实现动画、悬停状态、阴影、边框、排版、图标、微交互、进入/退出动画或任何视觉细节工作时使用。支持快速和完整审查两种模式。

portfolio-next 是什么?

该技能基于一套结构化的设计工程原则,旨在帮助开发者在构建或审查 UI 时,通过微小的细节累积,打造出更高级、更精致的用户界面。它涵盖了排版、表面、动画、图标和性能五大类别,并提供了如同心圆角、视觉对齐、可中断动画、字体平滑等 19 条核心原则作为具体指导。该技能专为 Claude Code、Cursor 等 AI 编码助手设计,能根据上下文自动切换 Tailwind、纯 CSS 或 CSS-in-JS 等现有样式系统。当用户提出“让界面感觉更好”、“感觉不对劲”或涉及特定 UI 细节(如动画、阴影、图标)时,该技能会被激活。它支持两种审查模式:快速模式(覆盖主要用户路径和最高流量状态,最多 5 项发现)和完整模式(全面覆盖所有类别,最多 15 项发现)。审查结果会以清晰的表格输出,包括原则违反、位置、前后对比、严重程度和用户影响,并附带验证步骤和最终裁决(通过/需修改/阻止)。

兼容平台~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 实现状态、轮廓与填充、尺寸、RTL 翻转
性能过渡特异性、will-change 的使用

核心原则

1. 同心圆角

外部圆角 = 内部圆角 + 内边距。嵌套元素上的圆角不匹配是让界面感觉不协调的最常见原因。

2. 视觉对齐优先于几何对齐

当几何居中对齐看起来不对时,使用视觉对齐。带有图标的按钮、播放三角形和非对称图标都需要手动调整。

3. 阴影用于层级,边框用于结构

对于仅为了营造深度而存在边框的按钮、卡片和容器,优先使用带有透明度的分层 box-shadow 值。保留用于传达结构或状态的边框:分隔线、布局分割线以及选中或聚焦状态。

4. 可中断动画

对交互式状态变化使用 CSS 过渡——它们可以在动画中途被中断。将关键帧动画保留用于一次性执行的阶段性序列。

5. 拆分并交错进入动画

对于不常见的、序列有助于传达层级关系的阶段性进入动画,将内容拆分成语义块,并以约 100ms 的间隔交错执行,而不是整体动画化。不要对常规的高频交互使用交错动画。

6. 微妙的退出动画

使用一个小的固定 translateY 值,而不是完整高度。退出动画应比进入动画更柔和。进入和退出过渡都应使用 ease-out。

7. 上下文相关的图标动画

使用 opacity、scale 和 blur 来制作图标动画,而不是切换可见性。请使用精确的数值:scale 从 0.25 到 1,opacity 从 0 到 1,blur 从 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. 图标描边匹配文字粗细

图标旁边的文本承载了文本的视觉重量:1.5px 描边对应常规(400)文本,2px 描边对应半粗(600)。一个图标集使用一种描边粗细;切勿在同一表面混合使用不同图标库。

18. 一个 SVG,通过颜色区分状态

图标使用 currentColor,其状态(悬停、选中、禁用)通过 CSS 颜色和不透明度实现,而不是使用单独的图标资产。轮廓变体为默认状态,填充变体标记激活状态。

19. 运动约束

不要为高频交互添加自定义动画:每次触发都会重复消耗注意成本。运动绝不能是唯一的反馈渠道;每个动画状态变化都需要一个静态提示,例如颜色、图标或标签。

常见错误

错误修复
父级和子级使用相同的圆角计算 outerRadius = innerRadius + padding
图标看起来居中偏差使用内边距或直接修复 SVG 进行视觉调整
仅用于伪造层级的边框使用带有透明度的分层 box-shadow;保留结构性和状态边框
突兀的阶段式进入或上下文退出交错不频繁的进入动画并保持上下文保留的退出动画柔和
数字导致布局偏移应用 tabular-nums
macOS 上文本粗重对根元素应用 antialiased
页面加载时播放动画在 AnimatePresence 上添加 initial={false}
元素上使用 transition: all指定精确属性
首帧动画卡顿添加 will-change: transform(谨慎使用)
小型控件上过小的点击区域在触摸/移动设备上使用伪元素扩展到 44×44px,或在密集桌面 UI 中至少 40×40px
粗体文本旁的极细图标将描边宽度与文字粗细匹配
每个状态使用独立的图标资产一个 currentColor SVG,通过 CSS 实现状态
到处都使用填充图标轮廓作为默认,填充仅用于激活状态
每次悬停或按键都出现进入动画即时反馈或 ≤150ms 的不透明度/颜色过渡

审查输出格式

当未提供审查模式时,使用 full。

模式覆盖范围发现数量上限
quick主要用户路径和最高流量状态;仅报告 HIGH 和 MEDIUM 问题5
full跨排版、表面、动画、图标和性能的完整请求范围15

范围和覆盖

说明模式、确切范围、框架、样式约定和任何审查边界。展示实际检查的内容:

类别检查的证据结果
排版文件、组件、状态或检查项发现数量、Clear 或带理由的 Not reviewed

包含所有五个快速参考类别。切勿暗示未检查的表面已被审查。

发现

按原则对发现进行分组。使用带有 严重性、位置、之前、之后 和 原因 列的 Markdown 表格。包括所做或提议的每一项更改,而不是子集。切勿使用单独的“之前:”/“之后:”行。

  • 严重性:HIGH 使交互无法访问、具有误导性、不可读或反复造成干扰;MEDIUM 造成明显的可用性或一致性问题;LOW 是孤立的优化,仅在 full 模式中出现。
  • 位置:引用 路径/到/文件:行号。如果工件没有源文件,请引用确切的屏幕和组件。
  • 之前 / 之后:显示当前实现和可操作的替换方案。
  • 原因:指出违反的原则并解释其用户影响。

将重复的系统性问题合并为一行,并列出所有受影响的位点。省略没有发现的原理,切勿填充报告以达到上限。

示例

同心圆角

严重性位置之前之后原因
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% 的速度检查运动。如果某个检查未运行,则标记为 未验证 并说明未完成的内容。
  2. 裁决:如果存在任何 HIGH 发现,则为 Block;如果仅存在 MEDIUM 或 LOW 发现,则为 Needs changes;仅当没有可操作的发现时才为 Approve。在裁决旁边列出每个未验证的检查。

当没有发现时,省略发现表格,声明“没有可操作的界面优化发现”,报告验证和已拒绝的候选,并以 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.

相关技能