agentleFS
Discriminative-shoji607Discriminative-shoji607/ui-skills/skills/fixing-motion-performance/SKILL.md

fixing-motion-performance

Skill3 starsChanged 5 months agoMITView on GitHub

Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.

We split this skill into the rules it gives an agent

32 rules. 18 are common, 14 are distinctive, and 0 are very specific to this project.

  • 18

    Common

    Most of the 7 edited versions we read keep these.

  • 14

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Common:

    Do not migrate animation libraries unless explicitly requested.

    line 21
  2. Common:

    do not interleave layout reads and writes in the same frame

    line 56
  3. Common:

    do not animate layout continuously on large or meaningful surfaces

    line 57
  4. Common:

    do not drive animation from scrollTop, scrollY, or scroll events

    line 58
  5. Distinctive:

    no requestAnimationFrame loops without a stop condition

    line 59
  6. Common:

    do not mix multiple animation systems that each measure or mutate layout

    line 60
  7. Distinctive:

    default to transform and opacity for motion

    line 64
  8. Common:

    use JS-driven animation only when interaction requires it

    line 65
  9. Common:

    prefer downgrading technique over removing motion entirely

    line 68
  10. Common:

    do not read layout repeatedly during an animation

    line 74
  11. Common:

    prefer FLIP-style transitions for layout-like effects

    line 75
  12. Distinctive:

    prefer approaches that batch measurement and writes

    line 76
  13. Distinctive:

    prefer Scroll or View Timelines for scroll-linked motion when available

    line 80
  14. Distinctive:

    use IntersectionObserver for visibility and pausing

    line 81
  15. Distinctive:

    do not poll scroll position for animation

    line 82
  16. Common:

    do not animate paint-heavy properties on large containers

    line 89
  17. Distinctive:

    do not animate CSS variables for transform, opacity, or position

    line 90
  18. Distinctive:

    do not animate inherited CSS variables

    line 91
  19. Distinctive:

    use will-change temporarily and surgically

    line 97
  20. Common:

    avoid many or large promoted layers

    line 98
  21. Distinctive:

    keep blur animation small (<=8px)

    line 103
  22. Distinctive:

    use blur only for short, one-time effects

    line 104
  23. Distinctive:

    never animate blur continuously

    line 105
  24. Common:

    never animate blur on large surfaces

    line 106
  25. Distinctive:

    prefer opacity and translate before blur

    line 107
  26. Common:

    use view transitions only for navigation-level changes

    line 111
  27. Common:

    avoid view transitions for interaction-heavy UI

    line 112
  28. Common:

    avoid view transitions when interruption or cancellation is required

    line 113
  29. Common:

    treat size changes as potentially layout-triggering

    line 114
  30. Common:

    do not migrate or rewrite animation libraries unless explicitly requested

    line 118
  31. Distinctive:

    never partially migrate APIs or mix styles within the same component

    line 120
  32. Common:

    when reviewing, prefer actionable notes and concrete alternatives over theory

    line 151

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “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

fixing-motion-performance

Fix animation performance issues.

how to use

  • /fixing-motion-performance Apply these constraints to any UI animation work in this conversation.
  • /fixing-motion-performance <file> Review the file against all rules below and report:
    • violations (quote the exact line or snippet)
    • why it matters (one short sentence)
    • a concrete fix (code-level suggestion)

Do not migrate animation libraries unless explicitly requested. Apply rules within the existing stack.

when to apply

Reference these guidelines when:

  • adding or changing UI animations (CSS, WAAPI, Motion, rAF, GSAP)
  • refactoring janky interactions or transitions
  • implementing scroll-linked motion or reveal-on-scroll
  • animating layout, filters, masks, gradients, or CSS variables
  • reviewing components that use will-change, transforms, or measurement

rendering steps glossary

  • composite: transform, opacity
  • paint: color, borders, gradients, masks, images, filters
  • layout: size, position, flow, grid, flex

rule categories by priority

prioritycategoryimpact
1never patternscritical
2choose the mechanismcritical
3measurementhigh
4scrollhigh
5paintmedium-high
6layersmedium
7blur and filtersmedium
8view transitionslow
9tool boundariescritical

quick reference

1. never patterns (critical)

  • do not interleave layout reads and writes in the same frame
  • do not animate layout continuously on large or meaningful surfaces
  • do not drive animation from scrollTop, scrollY, or scroll events
  • no requestAnimationFrame loops without a stop condition
  • do not mix multiple animation systems that each measure or mutate layout

2. choose the mechanism (critical)

  • default to transform and opacity for motion
  • use JS-driven animation only when interaction requires it
  • paint or layout animation is acceptable only on small, isolated surfaces
  • one-shot effects are acceptable more often than continuous motion
  • prefer downgrading technique over removing motion entirely

3. measurement (high)

  • measure once, then animate via transform or opacity
  • batch all DOM reads before writes
  • do not read layout repeatedly during an animation
  • prefer FLIP-style transitions for layout-like effects
  • prefer approaches that batch measurement and writes

4. scroll (high)

  • prefer Scroll or View Timelines for scroll-linked motion when available
  • use IntersectionObserver for visibility and pausing
  • do not poll scroll position for animation
  • pause or stop animations when off-screen
  • scroll-linked motion must not trigger continuous layout or paint on large surfaces

5. paint (medium-high)

  • paint-triggering animation is allowed only on small, isolated elements
  • do not animate paint-heavy properties on large containers
  • do not animate CSS variables for transform, opacity, or position
  • do not animate inherited CSS variables
  • scope animated CSS variables locally and avoid inheritance

6. layers (medium)

  • compositor motion requires layer promotion, never assume it
  • use will-change temporarily and surgically
  • avoid many or large promoted layers
  • validate layer behavior with tooling when performance matters

7. blur and filters (medium)

  • keep blur animation small (<=8px)
  • use blur only for short, one-time effects
  • never animate blur continuously
  • never animate blur on large surfaces
  • prefer opacity and translate before blur

8. view transitions (low)

  • use view transitions only for navigation-level changes
  • avoid view transitions for interaction-heavy UI
  • avoid view transitions when interruption or cancellation is required
  • treat size changes as potentially layout-triggering

9. tool boundaries (critical)

  • do not migrate or rewrite animation libraries unless explicitly requested
  • apply these rules within the existing animation system
  • never partially migrate APIs or mix styles within the same component

common fixes

/* layout thrashing: animate transform instead of width */
/* before */ .panel { transition: width 0.3s; }
/* after */  .panel { transition: transform 0.3s; }

/* scroll-linked: use scroll-timeline instead of JS */
/* before */ window.addEventListener('scroll', () => el.style.opacity = scrollY / 500)
/* after */  .reveal { animation: fade-in linear; animation-timeline: view(); }
// measurement: batch reads before writes (FLIP)
// before — layout thrash
el.style.left = el.getBoundingClientRect().left + 10 + 'px';
// after — measure once, animate via transform
const first = el.getBoundingClientRect();
el.classList.add('moved');
const last = el.getBoundingClientRect();
el.style.transform = `translateX(${first.left - last.left}px)`;
requestAnimationFrame(() => { el.style.transition = 'transform 0.3s'; el.style.transform = ''; });

review guidance

  • enforce critical rules first (never patterns, tool boundaries)
  • choose the least expensive rendering work that matches the intent
  • for any non-default choice, state the constraint that justifies it (surface size, duration, or interaction requirement)
  • when reviewing, prefer actionable notes and concrete alternatives over theory

Download now (ZIP)

Trending

Surging: 1 new project took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Aug 30: 0 new projectsWeek of Sep 6: 0 new projectsWeek of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 1 new projectWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projects
Aug 2026Sep 2026Oct 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 1 in all, so this is a hint, not a trend.
  • Other versions10 projects use a version of this.

    Word for word · 3

    1. ibelick/ui-skills★ 10k100% same
    2. master5d/claude-design-skills★ 26100% same
    3. ClaireAll/skills★ 2100% same

    Edited · 5

    1. nolly-studio/cult-ui★ 6.6k98% same
    2. kapishdima/soundcn★ 86498% same
    3. kumaran-is/claude-code-onboarding★ 3522% same
    4. FelipeAngeli/skills★ 298% same
    5. sanmidable/skills★ 297% same

    Wrote their own version · 2

    1. hsynozdamar-byte/claude-skills-edited★ 4same name
    2. hebertzhu/agent-foundry★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use create-design-md, emil-design-eng and 1 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • ItamarZand88Skill

      create-design-md

      Create a new DESIGN.md file for any website, app, or custom design system. Use when the user wants to document a design system in DESIGN.md format, extract design tokens from a URL or existing CSS, create a custom design system from scratch, author a DESIGN.md for their own project, or contribute a new design to the awesome-design-md collection. Also trigger when user mentions "design system documentation", wants to formalize their app's visual language, or asks to create or generate a DESIGN.md file.

      Also in 3 projects that use this

    • VercelSkill

      emil-design-eng

      This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.

      Also in 3 projects that use this

    • VercelSkill

      find-skills

      Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

      Also in 3 projects that use this

  • In this repository5 other files it gives its agents.

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.