agentleFS
jwuthri-cloudjwuthri-cloud/Tracely-ai/.agents/skills/motion-principles/SKILL.md

motion-principles

Skill1.2k starsChanged 20 days agoMITView on GitHub

Motion design foundation - timing, easing, enter/exit patterns, accessibility, performance.

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every animated component must respect the user's reduced-motion preference.

    line 57
  2. Very specific:

    Only animate transform and opacity (composite-only properties)

    line 256
  3. Very specific:

    Use will-change sparingly and remove it after animation completes

    line 257
  4. Very specific:

    Prefer requestAnimationFrame over setTimeout/setInterval for JS animations

    line 258
  5. Distinctive:

    Test on low-end devices (throttle CPU 4x in DevTools)

    line 260

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Motion Principles

The foundation. Loaded by every creative skill invocation. Concise rules here. Deep-dive in references/.


Timing Rules

ContextDurationWhy
Micro-interaction (toggle, hover, focus)100-150msInstant feedback, no perceived delay
UI transition (modal, drawer, tab switch)200-300msSmooth but never sluggish
Page/route transition300-500msEstablishes spatial narrative
Scroll-driven / 3DFree (progress-based)Tied to user input, no fixed duration

Frequency rule: The more often an animation plays, the shorter and subtler it must be. A button hover (1000x/day) = 100ms opacity. An onboarding reveal (1x ever) = 600ms+ full choreography.


Easing Cheat Sheet

ActionEasingWhy
Element entersease-out / springDecelerates into resting position (natural arrival)
Element exitsease-inAccelerates away (gets out of the way)
Element moves between statesease-in-outSmooth start and stop
Scroll-syncedlinear / noneMatches 1:1 with input, no lag perception
Bouncy/playfulspring (underdamped)Overshoot creates life
Snappy UIcubic-bezier(0.2, 0, 0, 1)Fast start, smooth land

Exit is always more subtle than enter. Enter: 300ms ease-out, full choreography. Exit: 200ms ease-in, opacity only.

Native easing equivalents (cross-platform)

Web (CSS / JS)SwiftUICompose
cubic-bezier(0.2, 0, 0, 1).spring(response: 0.4, dampingFraction: 0.85) or .snappyspring(stiffness = Spring.StiffnessMedium, dampingRatio = 0.85f)
ease-out.easeOut(duration: 0.3)tween(durationMillis = 300, easing = LinearOutSlowInEasing)
ease-in.easeIn(duration: 0.2)tween(durationMillis = 200, easing = FastOutLinearInEasing)
spring (bouncy).bouncy (iOS 17+)spring(stiffness = Spring.StiffnessLow, dampingRatio = Spring.DampingRatioMediumBouncy)
spring (smooth).smooth (iOS 17+)spring(stiffness = Spring.StiffnessMedium, dampingRatio = Spring.DampingRatioNoBouncy)

Accessibility (Non-Negotiable)

Reduced motion - MANDATORY

Every animated component must respect the user's reduced-motion preference. No exceptions, regardless of platform.

PlatformAPI
Web CSS@media (prefers-reduced-motion: reduce)
Web JSwindow.matchMedia('(prefers-reduced-motion: reduce)')
SwiftUI@Environment(\.accessibilityReduceMotion) var reduceMotion
UIKitUIAccessibility.isReduceMotionEnabled (+ reduceMotionStatusDidChangeNotification)
ComposeCustom helper using Settings.Global.ANIMATOR_DURATION_SCALE (deep-dive in mobile-principles/references/accessibility-mobile.md)

CSS:

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

SwiftUI:

struct AnimatedView: View {
    @Environment(\.accessibilityReduceMotion) var reduceMotion
    @State var visible = false

    var body: some View {
        Text("Hello")
            .opacity(visible ? 1 : 0)
            .animation(reduceMotion ? .none : .spring(response: 0.4, dampingFraction: 0.85), value: visible)
    }
}

Compose:

@Composable
fun rememberReduceMotion(): Boolean {
    val context = LocalContext.current
    return remember {
        Settings.Global.getFloat(context.contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE, 1f) == 0f
    }
}

@Composable
fun AnimatedComponent(visible: Boolean) {
    val reduce = rememberReduceMotion()
    val alpha by animateFloatAsState(
        targetValue = if (visible) 1f else 0f,
        animationSpec = if (reduce) snap() else spring(stiffness = Spring.StiffnessMedium)
    )
}

Other a11y requirements

  • Focus indicators must never be hidden by animations
  • Animated content must meet WCAG contrast ratios at every frame (no mid-transition fading to invisible text)
  • Looping animations: provide a pause mechanism

Universal "Do Not" Rules

1. Never animate width/height/top/left

Triggers layout recalculation every frame = jank.

/* BAD */
.drawer { transition: height 0.3s ease; }
.drawer.open { height: 400px; }

/* GOOD */
.drawer { transition: transform 0.3s ease-out; transform: translateY(100%); }
.drawer.open { transform: translateY(0); }

SwiftUI equivalent (BAD vs GOOD):

// BAD - animates frame (causes layout pass)
.frame(height: open ? 400 : 0)
.animation(.easeInOut, value: open)

// GOOD - animates transform via offset
.offset(y: open ? 0 : 400)
.animation(.spring(), value: open)

Compose equivalent (BAD vs GOOD):

// BAD - animates size (full layout pass)
val height by animateDpAsState(if (open) 400.dp else 0.dp)

// GOOD - animates Y offset via graphicsLayer
val translation by animateFloatAsState(if (open) 0f else 400f)
Box(modifier = Modifier.graphicsLayer { translationY = translation })

2. Never scale to 0

scale(0) causes elements to vanish in a black hole. Always keep a minimum.

/* BAD */
.modal-exit { transform: scale(0); }

/* GOOD */
.modal-exit { transform: scale(0.95); opacity: 0; }

SwiftUI equivalent:

// BAD
.scaleEffect(visible ? 1.0 : 0.0)

// GOOD
.scaleEffect(visible ? 1.0 : 0.95)
.opacity(visible ? 1.0 : 0.0)

Compose equivalent:

// BAD
Modifier.graphicsLayer { scaleX = if (visible) 1f else 0f; scaleY = if (visible) 1f else 0f }

// GOOD
Modifier.graphicsLayer {
    scaleX = if (visible) 1f else 0.95f
    scaleY = if (visible) 1f else 0.95f
    alpha = if (visible) 1f else 0f
}

3. Never ease-in on an entry

Ease-in = slow start. An entering element that hesitates feels broken.

/* BAD */
.card-enter { animation: fadeIn 0.3s ease-in; }

/* GOOD */
.card-enter { animation: fadeIn 0.3s ease-out; }
/* OR spring via JS for natural feel */

4. Never exceed 500ms on a UI interaction

Modals, dropdowns, tooltips, tabs -- users are waiting. Respect their time.

// BAD
gsap.to(modal, { opacity: 1, y: 0, duration: 0.8 });

// GOOD
gsap.to(modal, { opacity: 1, y: 0, duration: 0.25, ease: "power2.out" });

SwiftUI:

// BAD
.animation(.easeInOut(duration: 0.8), value: state)

// GOOD
.animation(.spring(response: 0.25, dampingFraction: 0.85), value: state)

Compose:

// BAD
animateContentSize(animationSpec = tween(800))

// GOOD
animateContentSize(animationSpec = spring(stiffness = Spring.StiffnessMediumLow))

5. Never skip prefers-reduced-motion

This is an accessibility requirement, not a nice-to-have.

// BAD
gsap.from('.hero-title', { opacity: 0, y: 40, duration: 0.6 });

// GOOD
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (!prefersReduced) {
  gsap.from('.hero-title', { opacity: 0, y: 40, duration: 0.6 });
}

See the cross-platform Reduced Motion section above for SwiftUI / Compose equivalents.


Performance Checklist

  • Only animate transform and opacity (composite-only properties)
  • Use will-change sparingly and remove it after animation completes
  • Prefer requestAnimationFrame over setTimeout/setInterval for JS animations
  • For scroll-driven: CSS animation-timeline > JS IntersectionObserver > scroll listeners
  • Test on low-end devices (throttle CPU 4x in DevTools)

Quick Reference: Loading Sub-skills

NeedLoad
Easing deep-dive, spring configsreferences/easing-guide.md
Copy-paste enter/exit patternsreferences/enter-exit-recipes.md
Designer-weighted style choicereferences/designers.md
Mobile UX context../mobile-principles/SKILL.md
Desktop UX context../desktop-principles/SKILL.md
GSAP specifics../gsap/SKILL.md
Framer Motion specifics../framer-motion/SKILL.md
CSS-only animations../css-native/SKILL.md
Three.js / R3F../threejs-r3f/SKILL.md
Canvas / generative../canvas-generative/SKILL.md
Compose Android animations../compose-motion/SKILL.md
Compose Multiplatform../compose-multiplatform/SKILL.md
SwiftUI iOS/macOS animations../swiftui-motion/SKILL.md
Compose advanced graphics../compose-graphics/SKILL.md
SwiftUI advanced graphics../swiftui-graphics/SKILL.md
Visual / motion / a11y audit../design-audit/SKILL.md
UI/UX intelligence (50 styles, 21 palettes)../ui-ux-pro-max/SKILL.md

Download now (ZIP)

Trending

More talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the jwuthri-cloud/Tracely-ai repository that our weekly crawl found: only 1 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about jwuthri-cloud/Tracely-ai

The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.