Motion
softmaple/softmaple
Animation skill for Motion (prev Framer Motion) and CSS animation.
Prevent layout/transition/reflow thrash in JS-driven CSS animations.
$ npx skills add swyxio/skills --skill web-animation-perf -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install swyxio/skills web-animation-perf --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/swyxio/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/web-animation-perf .claude/skills/web-animation-perf && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "web-animation-perf" agent skill from https://github.com/swyxio/skills/tree/main/web-animation-perf into .claude/skills/web-animation-perf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "web-animation-perf", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/swyxio/skills/tree/main/web-animation-perfType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add swyxio/skills --skill web-animation-perf -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install swyxio/skills web-animation-perf --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/swyxio/skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/web-animation-perf .agents/skills/web-animation-perf && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "web-animation-perf" agent skill from https://github.com/swyxio/skills/tree/main/web-animation-perf into .agents/skills/web-animation-perf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "web-animation-perf", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add swyxio/skills --skill web-animation-perf -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install swyxio/skills web-animation-perf --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/swyxio/skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/web-animation-perf .cursor/skills/web-animation-perf && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "web-animation-perf" agent skill from https://github.com/swyxio/skills/tree/main/web-animation-perf into .cursor/skills/web-animation-perf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "web-animation-perf", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/swyxio/skills.git --path web-animation-perf--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add swyxio/skills --skill web-animation-perf -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install swyxio/skills web-animation-perf --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/swyxio/skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/web-animation-perf .gemini/skills/web-animation-perf && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "web-animation-perf" agent skill from https://github.com/swyxio/skills/tree/main/web-animation-perf into .gemini/skills/web-animation-perf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "web-animation-perf", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install swyxio/skills web-animation-perfInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add swyxio/skills --skill web-animation-perf -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/swyxio/skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/web-animation-perf .github/skills/web-animation-perf && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "web-animation-perf" agent skill from https://github.com/swyxio/skills/tree/main/web-animation-perf into .github/skills/web-animation-perf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "web-animation-perf", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add swyxio/skills --skill web-animation-perf -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install swyxio/skills web-animation-perf --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/swyxio/skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/web-animation-perf .opencode/skills/web-animation-perf && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "web-animation-perf" agent skill from https://github.com/swyxio/skills/tree/main/web-animation-perf into .opencode/skills/web-animation-perf/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "web-animation-perf", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
web-animation-perfPrevent layout/transition/reflow thrash in JS-driven CSS animations.
Web Animation Perf is an agent skill from swyxio/skills. Prevent layout/transition/reflow thrash in JS-driven CSS animations. Use when building or debugging continuous motion (rotation, orbit, parallax, scroll-linked effects, marquee, carousels) and when symptoms appear like jank, stutter, lag, animation drift, ghosting, "elements collapsing toward center", "going slow", "should we use canvas?", or when mixing setInterval/React state with CSS transition.
Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Frontend & Design, covering Web animation and motion, Mobile performance and State management. The repository describes itself as: Agent skills for Claude Code and other AI agents. The licence is MIT.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 038ef34. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Web Animation Perf loads about 2.3k tokens when it runs. Until then it costs about 106 tokens; SKILL.md has 949 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from swyxio/skills at commit 038ef34, republished under its MIT licence (© swyxio). 949 words, ~2,336 tokens.
.claude/skills/web-animation-perf/SKILL.md (or your agent's skills folder).Guidance for writing smooth, GPU-accelerated animations on the web. Most jank comes from three avoidable mistakes; the rest is diagnostic technique.
transition: all <duration> with JS that updates the same property every frameThis is the single most common animation bug. If JS updates left/top/transform on every tick AND the element has transition-all duration-700 (or similar), CSS will linearly interpolate between every pair of successive JS values over the transition duration. For non-linear motion (orbit, arc, easing curve) the linear chord cuts across the intended path — e.g., rotating nodes appear to drift inward toward the center, parallax elements ghost-trail, scroll-linked effects lag noticeably behind the scroll.
Pick exactly one driver:
@keyframes + animation: spin 8s linear infinite and let the browser handle it.transition on that property. Use a separate, narrower transition only for state changes (e.g., active/inactive scale and color).If you want a transition on hover/active states but JS-driven continuous motion on position, scope the transition to the specific properties (transition: transform 300ms, background-color 300ms) and exclude the JS-driven property.
requestAnimationFrame, never setInterval, for continuous motion| Concern | setInterval(fn, 16) | requestAnimationFrame(fn) |
|---|---|---|
| Frame sync | Drifts; may fire 2× per frame or miss frames | Pinned to vsync |
| Backgrounded tab | Keeps running, wasting CPU/battery | Browser pauses |
| Timing precision | Wall clock, ±browser timer resolution | High-res performance.now() arg passed to callback |
| Jitter under load | Compounds | Skips frames cleanly |
Always integrate by elapsed time, not by fixed step-per-tick. Motion stays correct under dropped frames:
useEffect(() => {
let lastFrame = performance.now();
let id = 0;
const tick = (now) => {
const dt = Math.min(now - lastFrame, 100); // clamp to handle tab-switch gaps
lastFrame = now;
const degrees = SPEED_DEG_PER_SEC * (dt / 1000);
setRotation((prev) => (prev + degrees) % 360);
id = requestAnimationFrame(tick);
};
id = requestAnimationFrame(tick);
return () => cancelAnimationFrame(id);
}, []);transform and opacity. Avoid left/top/width/height/margin/paddingOnly transform and opacity skip layout & paint and run entirely on the GPU compositor. Anything else triggers reflow on every change — fine once on hover, catastrophic at 60Hz.
| Want to change… | Do this | Not this |
|---|---|---|
| Position | transform: translate3d(x, y, 0) | left, top, margin |
| Size | transform: scale(s) | width, height |
| Rotate | transform: rotate(a) | (no left/top equivalent — but use transform for compositor promotion) |
| Fade | opacity | visibility, display, color alpha |
For static positioning (rendered once and not animated), left/top is fine. The rule applies to continuously animated properties.
will-changestyle={{ willChange: 'transform, opacity' }}Only on elements that actually animate continuously. Overusing will-change consumes GPU memory.
If profiling shows React reconciliation is the bottleneck (rare for <50 elements), bypass React for the per-frame update:
const nodeRefs = useRef([]);
// in rAF tick:
nodeRefs.current[idx].style.transform = `translate3d(${x}px, ${y}px, 0)`;Re-render via React state only when a meaningful semantic change occurs (e.g., the highlighted node changes), not for every frame.
Use Playwright or DevTools to actually measure rendered geometry. For circular motion you can verify positions land on the orbit ring:
// In Playwright page.evaluate, sample every 200ms for ~1s
const nodes = Array.from(document.querySelectorAll('.orbital-node'));
const ratios = nodes.map((n) => {
const r = n.getBoundingClientRect();
const dx = r.left + r.width / 2 - centerX;
const dy = r.top + r.height / 2 - centerY;
return Math.hypot(dx, dy) / expectedOrbitRadius; // should be 1.00
});If ratios drift below 1.00 (toward center), rule 1 is broken: a CSS transition is fighting JS updates. If ratios are correct but the animation looks janky, suspect rule 2 (timer/rAF) or rule 3 (left/top reflow).
For ≤ ~100 DOM elements, GPU-composited transform animation is faster than canvas redraw and keeps accessibility, click targets, hover states, and inspectability for free. Reach for canvas only when (a) element count is in the thousands, (b) you need pixel-level rendering control (particles, fluid sim), or (c) the layout doesn't map to a DOM tree.
When the user reports "the animation is slow/janky/broken":
Reflect on the 5–7 typical causes, then narrow to the most likely 1–2 before changing code. Common culprits, in rough order:
transition-all racing JS updates (rule 1) — characteristic symptom: motion looks like an interpolated short-cut of the intended path (inward drift on circles, lag on parallax, ghost trails).left/top/width/height instead of transform (rule 3) — characteristic symptom: jank scales with element count or viewport size, DevTools Performance shows layout/paint columns.setInterval instead of rAF (rule 2) — characteristic symptom: stutter that gets worse when the tab is busy or backgrounded.display/visibility/height: auto — characteristic symptom: animation doesn't run at all or snaps instead of tweens.will-change — characteristic symptom: scrolling jank elsewhere on the page, GPU memory pressure.offsetWidth, getBoundingClientRect) interleaved with writes inside the same frame.Validate with logs/measurements before changing more than one thing at a time.
// ❌ ANTI-PATTERN
<div
className="absolute transition-all duration-700"
style={{ left: `${x}%`, top: `${y}%` }}
/>
useEffect(() => {
const id = setInterval(() => setAngle((a) => a + 0.6), 50);
return () => clearInterval(id);
}, []);
// ✅ FIX
<div
className="absolute"
style={{
left: `${x}%`, top: `${y}%`,
willChange: 'left, top',
}}
/>
useEffect(() => {
let last = performance.now(); let id = 0;
const tick = (now) => {
const dt = Math.min(now - last, 100); last = now;
setAngle((a) => (a + DEG_PER_SEC * dt / 1000) % 360);
id = requestAnimationFrame(tick);
};
id = requestAnimationFrame(tick);
return () => cancelAnimationFrame(id);
}, []);(For maximum perf, swap left/top for transform: translate3d(...) as well.)
OrbitalDiagram (AIE conference sites)apps/main/src/pages/worldsfair/index.jsx — a rotating orbital diagram with 11
role nodes. The original implementation hit all three cardinal anti-patterns:
transition-all duration-700 while a setInterval(50ms) updated left/top every tick. The CSS transition linearly interpolated between successive JS-set positions, cutting straight-line chords across the orbit. Visible symptom: under the post-release boost, nodes appeared to collapse inward toward the center logo instead of orbiting the ring. (rule 1)setInterval instead of requestAnimationFrame → stutter and unsynced timing. (rule 2)left/top instead of transform → reflow on every tick. (rule 3)The fix:
transition-all duration-700 from the rotating wrapper (kept transition-all duration-300 only on the inner circle for active-state scale/color, which is event-driven, not per-frame).requestAnimationFrame with delta-time integration (degPerSec × dt), so speed reads in degrees-per-second and motion stays correct under dropped frames.willChange: 'left, top, opacity'.getBoundingClientRect) and checking that distance-from-center ÷ expected orbit radius = 1.00 for every node across multiple frames.When verifying PRs that touch animation code in this repo, use Playwright to sample geometry over time and assert the expected invariant — don't rely on screenshots alone, since the artifact may be subtle (chord-vs-arc) or only appear during boost/peak motion.
© swyxio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in web-animation-perf of swyxio/skills.
Open the folder on GitHubat commit 038ef34
Web Animation Perf next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Web Animation Perf this skillswyxio/skills | 176 | — | ~2.3k | Automated safety check: Pass | MIT | |
| Motionsoftmaple/softmaple | 161 | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| Oil Frontend Rulesoil-oil/oil-frontend | 131 | — | ~1.4k | Automated safety check: Pass | MIT | |
| Cue AnimationsMilad-Akarie/cue | 119 | 1 repos | ~6.6k | Automated safety check: Pass | MIT | |
| Impeccablebestofjs/bestofjs | 3.1k | 26 repos | ~2.6k | Automated safety check: Pass | MIT | |
| GSAP ScrollTriggergreensock/gsap-skills | 16k | 4 repos | ~4.6k | Automated safety check: Pass | MIT |
softmaple/softmaple
Animation skill for Motion (prev Framer Motion) and CSS animation.
oil-oil/oil-frontend
Chinese-language rules for building, changing and reviewing product front ends, covering interface, interaction, state and data flow and component organization.
Milad-Akarie/cue
Flutter animation using the Cue package. An agent skill from Milad-Akarie/cue.
bestofjs/bestofjs
A skill your agent uses when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a…
greensock/gsap-skills
Teaches an agent how to wire up GSAP's ScrollTrigger plugin for scroll-linked animation, pinned sections and scrub, including the start and end position syntax.
greensock/gsap-skills
Covers the GSAP core API for tweens, easing, staggers, defaults and matchMedia, and when to choose GSAP over CSS animations or other JavaScript animation libraries.
swyxio/skills
Run a selected coding-agent CLI programmatically, with latency, error, usage, cost, and trace logging.
swyxio/skills
Design, implement, audit, or refresh protected username and handle namespaces for public products.
swyxio/skills
Fully automated new Mac setup for fullstack web developers and AI engineers.
swyxio/skills
Manage YouTube videos programmatically via the YouTube Data API v3 — upload video files, upload custom thumbnails, update video metadata (titles, descriptions, tags), and query video/channel info…
swyxio/skills
Batch YouTube Studio upload workflow for videos sourced from Airtable, Google Drive, Loom, YouTube, or local files.
swyxio/skills
Reconstruct and visually analyze paired agent, game, or policy trajectories to determine whether changed actions produced their intended effects.
Categories
Prevent layout/transition/reflow thrash in JS-driven CSS animations. Web Animation Perf is an agent skill from swyxio/skills. Prevent layout/transition/reflow thrash in JS-driven CSS animations.
Web Animation Perf fits situations like: debugging continuous motion (rotation; scroll-linked effects; carousels) and when symptoms appear like jank; animation drift.
Run `npx skills add swyxio/skills --skill web-animation-perf -a claude-code`. Or copy the skill folder (web-animation-perf in swyxio/skills) into .claude/skills/web-animation-perf in your project. Claude Code loads it when a task matches its description.
Run `npx skills add swyxio/skills --skill web-animation-perf -a codex`. Or copy the skill folder (web-animation-perf in swyxio/skills) into .agents/skills/web-animation-perf in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add swyxio/skills --skill web-animation-perf -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/web-animation-perf, .gemini/skills/web-animation-perf, .github/skills/web-animation-perf and .opencode/skills/web-animation-perf in your project.
SKILL.md names no scripts, command-line tools or credentials: Web Animation Perf is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Web Animation Perf is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.3k tokens (SKILL.md is roughly 9.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Web Animation Perf: Motion (softmaple/softmaple, 161 stars), Oil Frontend Rules (oil-oil/oil-frontend, 131 stars), Cue Animations (Milad-Akarie/cue, 119 stars) and Impeccable (bestofjs/bestofjs, 3.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
swyxio (a GitHub user) maintains it in swyxio/skills, which has 176 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 5, 2026.
Source: swyxio/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.