Agent skill Web motion
GSAP Performance
Design, implement or review motion on the web.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add greensock/gsap-skills --skill gsap-performance --agent claude-code --yesCheck this file in your project.claude/skills/gsap-performance/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add greensock/gsap-skills --skill gsap-performanceSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. An existing pointer-following interaction, GSAP, and a browser with a performance recorder.
View operation manualWhat this skill helps with
- Design, implement or review motion on the web.
Good for
- Web motion and transitions
- Publisher
- GreenSock
- Installed content
- SKILL.md with workflow guidance
- Result
- Reusable motion tweens and paired traces of the same interaction.
- Skill name
gsap-performance- Repository
greensock/gsap-skills
Common pitfall
Avoid this prompt
Add will-change to every animated element and assume the stutter is fixed.
A layer hint leaves the per-event work in place and can consume additional memory. A trace helps locate the actual bottleneck.
Use these steps
- Locate event work and capture a reproducible pointer sweep.
- Use quickTo() setters to retarget the same x and y tweens.
- Repeat the sweep and verify retargeting, performance, and cleanup.
Hands-on walkthrough
Profile one pointer-following decoration that creates tweens on every event, reuse its tweens, and compare equivalent browser traces.
Profile one pointer-following decoration that creates tweens on every event, reuse its tweens, and compare equivalent browser traces.
Record the baseline interaction
Locate event work and capture a reproducible pointer sweep.
Prompt · Step 1Use gsap-performance to inspect [pointer-following component]. Locate its pointer handlers, record a short sweep with browser Performance tools, and identify any tween allocations, layout reads, and rendering work you observe. Record the viewport, device or throttling settings, and sweep path so the trace can be repeated.Reuse one tween per axis
Use quickTo() setters to retarget the same x and y tweens.
Prompt · Step 2For the identified decoration, create one gsap.quickTo() function per required transform axis during setup. Feed each function numbers from the existing coordinate system inside the pointer handler. Remove the listener and kill the reusable tweens via their .tween handles in cleanup. Keep the decoration static when reduced motion is preferred.Compare equivalent traces
Repeat the sweep and verify retargeting, performance, and cleanup.
- The beginning and ending recordings use matching conditions.
- The decoration ends at the latest target and teardown removes the listener and tweens.
Prompt · Step 3Replay the same pointer sweep with the baseline viewport and throttling settings. Compare handler work and rendering activity in the recordings. Check that the decoration reaches the latest target, remains static with reduced motion, and stops after teardown. Report the observed trace differences and attach or name both recordings.
API lookup
Use these calls when adapting the walkthrough to your component.
Retarget a numeric propertyGSAP
- Command or reference
gsap.quickTo(target, "x", vars)- Examples
- Create during setup and call the returned function with the next x value.
Stop a reusable tweenGSAP
- Command or reference
moveX.tween.kill()- Examples
- Release each reusable tween and remove the pointer listener.
FAQ
What proves the change improved browser performance?
Compare script and rendering work in matching performance captures. A successful retargeting check confirms the final position, while the recordings show the cost of the browser interaction.
What does installing the skill add?
The project skill folder contains the publisher’s SKILL.md. Your application still needs its own GSAP dependency and a page to run the animation.