performance-optimization · dylantarre — Claude Code skill: setup and features
Diagnoses and resolves janky UI animations and frame drops using core animation principles.
npx skills add dylantarre/animation-principles --skill performance-optimization -a claude-codeWhat performance-optimization does
This skill inspects UI animations to fix frame rate drops below 60fps, stuttering, and mobile battery drain. It applies Disney's animation principles to code issues. The skill converts frame-by-frame JS calculations to CSS keyframes and staggers simultaneous motions by 50-100ms.
The skill enforces GPU-accelerated rendering rules. It flags costly properties like top, left, width, and height because they trigger layout recalculations. Instead, it rewrites styles to use transform and opacity, sparingly applies will-change, and stops off-screen elements with Intersection Observer. Direct layout animation triggers forced reflows, making GPU transforms mandatory.
What it helps with
- fix UI stutter and frame rate drops below 60fps
- replace layout-heavy properties with GPU-accelerated transforms
- stagger simultaneous element animations by 50-100ms
- pause off-screen animations using Intersection Observer
Example prompts for the agent
- Audit the hover animation in this card component to fix frame drops
- Optimize the modal transition so it does not trigger layout recalculations
- Stagger these list item animations to prevent simultaneous execution
How to install performance-optimization
1Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill performance-optimization -a claude-code2Manually: put the files in place
~/.claude/skills/performance-optimization/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/performance-optimization/
1Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill performance-optimization -a codex2Manually: put the files in place
.agents/skills/performance-optimization/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill performance-optimization -a cursor2Manually: put the files in place
.cursor/skills/performance-optimization/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dylantarre/animation-principles performance-optimization2Manually: put the files in place
.github/skills/performance-optimization/SKILL.md1Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill performance-optimization -a gemini-cli2Platform CLI
gemini skills install https://github.com/dylantarre/animation-principles --path skills/12-by-problem-type/performance-optimizationManually: put the files in place
.devin/skills/performance-optimization/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dylantarre/animation-principles --skill performance-optimization -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about performance-optimization
How to install performance-optimization in Claude Code?
Run npx skills add dylantarre/animation-principles --skill performance-optimization -a claude-code. The skill file is placed in ~/.claude/skills/performance-optimization/SKILL.md.
What does performance-optimization do?
It identifies bottlenecks in UI animations and converts heavy layout properties to GPU-friendly transform and opacity.
How many simultaneous animations does the skill recommend?
Its troubleshooting checklist advises keeping concurrent animations under 3-4 to prevent performance drops.
Source text
SKILL.md · MIT
---
name: performance-optimization
description: Use when animation runs slow, janky, or causes frame drops
---
# Performance Optimization
Diagnose and fix slow or janky animations using Disney's 12 principles.
## Problem Indicators
- Frame rate drops below 60fps
- Stuttering or choppy motion
- UI feels sluggish
- Battery drain on mobile
- Layout thrashing
## Diagnosis by Principle
### Straight Ahead vs Pose-to-Pose
**Issue**: Calculating every frame in real-time
**Fix**: Use pose-to-pose (keyframe) animation. Let the browser interpolate between states using CSS transitions or `will-change`.
### Timing
**Issue**: Too many simultaneous animations
**Fix**: Stagger animations. Offset start times by 50-100ms to reduce concurrent calculations.
### Secondary Action
**Issue**: Too many secondary effects
**Fix**: Remove non-essential secondary animations on low-power devices. Use `prefers-reduced-motion` query.
### Solid Drawing
**Issue**: Animating expensive properties (width, height, top, left)
**Fix**: Only animate `transform` and `opacity`. These are GPU-accelerated and skip layout/paint.
### Staging
**Issue**: Animating off-screen elements
**Fix**: Only animate what's visible. Use Intersection Observer to pause off-screen animations.
## Quick Fixes
1. **Replace JS animations with CSS** - Browser-optimized
2. **Use `transform` instead of position properties** - GPU layer
3. **Add `will-change` sparingly** - Hints to browser
4. **Reduce simultaneous animations** - Stagger or sequence
5. **Lower animation complexity on mobile** - Detect device capability
## Troubleshooting Checklist
- [ ] Check DevTools Performance tab for long frames
- [ ] Verify animations use transform/opacity only
- [ ] Count simultaneous animations (keep under 3-4)
- [ ] Test on lowest-spec target device
- [ ] Check for layout thrashing (forced reflows)
- [ ] Verify `will-change` isn't overused
- [ ] Test with CPU throttling enabled
- [ ] Check if animations pause when tab is hidden
## Code Pattern
```css
/* Fast */
.element {
will-change: transform;
transition: transform 200ms ease-out;
}
.element:hover {
transform: translateY(-4px);
}
/* Slow - avoid */
.element:hover {
top: -4px; /* Triggers layout */
}
```
© dylantarre · MIT · dylantarre/animation-principles
Similar skills
Everything for Frontend and UI →performance-optimization by other authors comes first.