Skip to main content
skill CX Codex

universal-patterns — Claude Code skill: animation timing and easing

Sets baseline durations, easing curves and the 12 animation principles for any motion in an interface. Useful when your agent writes CSS transitions and guesses the timing wrong.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dylantarre/animation-principles --skill universal-patterns -a claude-code
Open on GitHub

What universal-patterns does

The skill hands your agent a duration scale: 100-150ms for hovers and micro-states, up to 600-1000ms for dramatic reveals. Alongside it sits an easing library as CSS variables — --ease-out for entrances, --ease-in for exits, --ease-in-out for state changes, plus springy --ease-spring and --ease-bounce.

A quick reference covers the 12 Disney principles with actual numbers: squash & stretch in the 0.95-1.05 range, overshoot of 2-5%, a 2-3px reverse movement before an action. There are base classes .animate-in, .animate-out and .animate-state with fade-in and fade-out keyframes, a prefers-reduced-motion block, and a decision tree for entering, exiting, state-changing or gesture-driven elements.

The rules are strict. A user action must produce visible change within 100ms, functional animation stays under 400ms, exits run 20-30% faster than entrances. Only transform and opacity are allowed for smooth 60fps — animate width or top and the skill will tell you no. When in doubt, the author suggests starting from 250ms cubic-bezier(0.4, 0, 0.2, 1).

Install with npx skills add dylantarre/animation-principles --skill universal-patterns -a claude-code; the file lands at ~/.claude/skills/universal-patterns/SKILL.md.

What it helps with

  • pick a hover duration that does not feel sluggish
  • choose an easing curve for a modal entrance
  • add prefers-reduced-motion support without rewriting styles by hand
  • explain to the agent why animating width stutters
  • keep entrance and exit timings consistent across one interface

Example prompts for the agent

  • Animate this card entrance using the universal-patterns skill
  • Check my CSS transitions against the rules in universal-patterns
  • Add a reduced-motion fallback for these animations as the skill describes

How to install universal-patterns

1Skills CLI (Vercel)

npx skills add dylantarre/animation-principles --skill universal-patterns -a claude-code

2Manually: put the files in place

~/.claude/skills/universal-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/universal-patterns/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about universal-patterns

How do I install universal-patterns in Claude?

Run npx skills add dylantarre/animation-principles --skill universal-patterns -a claude-code. The skill ends up at ~/.claude/skills/universal-patterns/SKILL.md.

What does universal-patterns do?

It gives the agent baseline timings, an easing library and the 12 animation principles so interface motion stays predictable. It applies to any animation type.

What defaults does the skill enforce?

Visible response to a user action within 100ms, functional animation under 400ms, exits 20-30% faster than entrances. Only transform and opacity are allowed for smooth 60fps.

Source text

SKILL.md · MIT
---
name: universal-patterns
description: Use when creating any animation type - provides foundational timing, easing, and principle application that applies to all motion in interfaces.
---

# Universal Animation Patterns

Apply Disney's 12 principles as baseline defaults for any animation.

## Core Timing Scale

| Category | Duration | Use For |
|----------|----------|---------|
| Instant | 100-150ms | Hovers, toggles, micro-states |
| Fast | 150-250ms | Feedback, small transitions |
| Standard | 250-400ms | Modals, reveals, state changes |
| Slow | 400-600ms | Page transitions, sequences |
| Deliberate | 600-1000ms | Dramatic reveals, celebrations |

## Universal Easing Library

```css
:root {
  /* Standard easings */
  --ease-out: cubic-bezier(0, 0, 0.2, 1);        /* Entrances */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);         /* Exits */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);   /* State changes */

  /* Spring easings */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);  /* Overshoot */
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Playful */
}
```

## The 12 Principles Quick Reference

1. **Squash & Stretch**: Scale 0.95-1.05 range for organic feel
2. **Anticipation**: 2-3px reverse movement or 50ms pause before action
3. **Staging**: Animate toward user attention, clear visual hierarchy
4. **Straight Ahead vs Pose-to-Pose**: Define keyframes, plan states
5. **Follow Through**: Overshoot by 2-5%, settle back
6. **Slow In/Slow Out**: Always ease, never linear (except spinners)
7. **Arcs**: Combine X+Y movement, natural paths
8. **Secondary Action**: Layer 2-3 properties max (opacity + transform + shadow)
9. **Timing**: Match duration to distance/importance
10. **Exaggeration**: Subtle for UI (under 10% deviation)
11. **Solid Drawing**: Maintain visual consistency during motion
12. **Appeal**: Motion should feel helpful, not performative

## Base Animation Classes

```css
/* Standard entrance */
.animate-in {
  animation: fade-in 250ms var(--ease-out) forwards;
}

/* Standard exit */
.animate-out {
  animation: fade-out 200ms var(--ease-in) forwards;
}

/* State transition */
.animate-state {
  transition: all 200ms var(--ease-in-out);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}
```

## Universal Rules

1. **100ms Response Time**: User actions must trigger visible change within 100ms
2. **Under 400ms for UI**: Functional animations shouldn't exceed 400ms
3. **Reduce Motion**: Always provide `prefers-reduced-motion` alternative
4. **GPU Properties**: Use only `transform` and `opacity` for smooth 60fps
5. **Exit < Enter**: Exits 20-30% faster than entrances

## Accessibility Default

```css
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
```

## Decision Tree

1. Is element entering? → Use ease-out, 200-300ms
2. Is element exiting? → Use ease-in, 150-250ms
3. Is element changing state? → Use ease-in-out, 150-250ms
4. Is it continuous? → Use linear (rotation) or ease-in-out (pulse)
5. Is it responding to gesture? → Use ease-out with overshoot, under 200ms

When uncertain, start with: `250ms cubic-bezier(0.4, 0, 0.2, 1)`

© dylantarre · MIT · dylantarre/animation-principles

Similar skills

Everything for Frontend and UI →

From the same set86

timing-calibration A skill that diagnoses animations that feel too fast, too slow or inconsistent, then hands back concrete durations and easing. CX Codex +1 497installs Animation Principles - Teaching Others Walks you through teaching the 12 animation principles to students, mentees or teammates: what to show first and where they usually get stuck. CX Codex +1 495installs user-feedback-clarity A skill that helps your coding agent work out why users miss interface feedback and what to change. CX Codex +1 496installs power-confidence A skill that spells out how to animate strength and authority: heavy movement, sudden stops, almost no bounce. Useful for hero sections and premium product showcases. CX Codex +1 495installs secondary-action-mastery A skill for adding secondary motion that supports the primary action instead of fighting it. Useful for UI animation and game feel. CX Codex +1 494installs feedback-indicators A skill for confirmation animations: success checkmarks, error shakes, form validation and toasts. Useful when the UI has to answer back clearly. CX Codex +1 493installs Animation Principles - Troubleshooting A skill that diagnoses why an animation feels wrong and points to the principle being misapplied. Useful when the motion reads badly but the cause is unclear. CX Codex +1 490installs Animation Principles - Advanced A skill for animators who already know the fundamentals and want the nuances: invisible squash/stretch, missing anticipation, deliberately broken arcs. CX Codex +1 489installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor