interaction-physics
БесплатноБез исполняемых скриптовНе проверенDesign and implement the motion layer of a UI — microinteractions, transitions, hover/press feedback, and animation timing/easing — as working CSS/JS plus a…
от sanky369★ 40 звёзд на GitHubОб этом скилле
Interaction Physics
Give every user action a physical response: consistent durations, meaningful easing, and feedback that arrives instantly. The prime directive: every animation must do a job — confirm an action, guide attention, or explain a state change. Motion that does none of these gets deleted, not tuned. Deliver two artifacts together: a project-wide animation spec (so future motion stays consistent) and the implemented code for the interactions in scope.
When to use / when not to
Use for: hover/press/focus feedback, enter/exit transitions (modals, toasts, pages, list items), form feedback animation, animation audits, choosing durations and easings, prefers-reduced-motion support.
Hand off instead when the real need is:
- Which loading indicator to show and when →
skills/frontend-design/loading-states(this skill animates it; that skill chooses it) - Optimistic UI, perceived latency, Core Web Vitals →
skills/frontend-design/performance-optimization - Rendering pipeline, layout thrashing, frame budgets →
skills/frontend-design/design-engineer-mindset - Non-motion visual polish (spacing, contrast, hierarchy) →
skills/frontend-design/visual-hierarchy-refactoring
Step 0 — Inspect the codebase, then ask only what's left
- Grep for existing motion:
transition,animation,@keyframes,framer-motion,motion.,react-spring,gsap, Tailwindtransition-*/animate-*classes. Record every duration and easing in use — inconsistency here (e.g. 150ms, 200ms, 250ms, 300ms all for hovers) is usually the first finding. - Check for
prefers-reduced-motionhandling anywhere. Absence is an automatic fix item. - Identify the animation vehicle: if the project already uses a motion library, implement with it; otherwise default to CSS transitions/keyframes. Never add a motion library for effects CSS can do.
- Find dead interactions: buttons without hover/active states, modals/toasts that appear with no transition, form errors that pop in.
Ask the user (one batch, only if not inferable): desired personality (calm/professional vs playful — infer from the product's domain if obvious) and scope (whole app pass vs specific flows). If the user said "the app feels janky", don't interrogate — audit, state assumptions, and proceed.
Workflow
1. Write the animation spec first
Fix the vocabulary before touching code. Standard duration classes:
| Class | Duration | Easing | Applies to |
|---|---|---|---|
| Micro feedback | 150–250ms | ease-out |
hover, press, focus, toggle, color/state change |
| Structural transition | 300–500ms | ease-out in, ease-in out |
modal, drawer, page, accordion, toast |
| Attention | 500–1000ms | ease-in-out |
alerts, pulses, one-shot emphasis |
| Continuous | ~1s loop | linear |
spinners, indeterminate progress |
Decision rules:
- Easing by direction: entering elements decelerate (
ease-out); exiting elements accelerate (ease-in); on-screen moves useease-in-out; only mechanical loops uselinear. Bouncy curves likecubic-bezier(0.34, 1.56, 0.64, 1)are reserved for deliberate playfulness — at most one or two places in an app. - Duration by size and distance: small elements moving short distances sit at the bottom of the range (hover tint: 150–200ms); large surfaces or long travel at the top (full-screen drawer: 400–500ms). A tooltip and a modal must not share a duration.
- Exits faster than entrances (~75% of the enter duration) — users have already decided to leave.
- Collapse whatever inconsistent values you found in Step 0 into at most 3–4 named tokens (e.g.
--duration-fast: 200ms; --duration-base: 300ms; --duration-slow: 450ms), defined as CSS variables or theme tokens.
2. Specify each microinteraction with the four-part anatomy
For every interaction in scope, state: Trigger (user action / system event) → Rules (what changes, duration, easing) → Feedback (what the user perceives) → Loops & modes (does it repeat, can it be interrupted). Interruptibility rule: state-driven transitions (CSS transition or a motion library) beat fire-and-forget keyframes for anything a user can toggle rapidly — a half-open menu must reverse smoothly, not restart.
3. Implement under the performance and accessibility constraints
- Animate only
transformandopacity(compositor-friendly). Never animatewidth,height,top,left, orbox-shadowdirectly; fake shadow animation by crossfading a pseudo-element's opacity. Animatingbackground-coloris acceptable for small controls only. - Ship the reduced-motion block in the same change — see the baseline in
references/patterns.md. Decorative motion disappears; informational motion (progress) may remain as opacity-only. - Feedback never rides on motion alone: pair every animated state change with a color/text/icon change so it survives reduced-motion.
- Keyboard parity: every
:hovereffect gets a:focus-visibleequivale
Установить interaction-physics в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл interaction-physics?
Design and implement the motion layer of a UI — microinteractions, transitions, hover/press feedback, and animation timing/easing — as working CSS/JS plus a written animation spec. Use when the user says 'the app feels janky', 'animations feel off', 'make it feel smoother/snappier', 'add a transition', 'the modal just pops in', 'buttons feel dead', 'add some polish/delight', or when interactions give no feedback. Also use to audit existing animations for timing, easing, performance (GPU properties), and reduced-motion support. Produces an animation spec (duration/easing per interaction class) and the implemented transitions.
Как установить скилл interaction-physics?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл interaction-physics запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic