agentleFS
jhonatan-oliveiradevjhonatan-oliveiradev/agent-skills/skills/engineering-gsap-animations/SKILL.md

engineering-gsap-animations

Skill1 starsChanged 3 months agoMITView on GitHub

Use when GSAP has been selected for React or Next.js animation, especially timelines, ScrollTrigger, pinning, scrub, SplitText, Flip, SVG, responsive animation, plugin lifecycle, cleanup, or animation-related integration bugs.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    REQUIRED ROUTING: Use craft-premium-motion first when the technology or motion direction is still undecided.

    line 12
  2. Distinctive:

    Verify production behavior through resize, font/media load, route changes, Fast Refresh, repeated mount/unmount, rapid scrolling, and …

    line 21
  3. Distinctive:

    Prefer refs or selectors scoped to the component root.

    line 34
  4. Distinctive:

    Use timelines for choreography.

    line 35
  5. Very specific:

    Use function-based measurement plus invalidateOnRefresh when geometry can change.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Engineering GSAP Animations

Overview

Implement GSAP as a scoped, interruptible subsystem. Let product direction choose the effect; let this skill own API correctness, React lifecycle, plugin behavior, cleanup, and verification.

REQUIRED ROUTING: Use craft-premium-motion first when the technology or motion direction is still undecided. Use optimizing-frontend-motion-performance when runtime profiling or long-session degradation is the main problem.

Workflow

  1. Inspect the installed gsap and @gsap/react versions, existing animation engines, Client Component boundaries, DOM ownership, fonts, media, scroller, and reduced-motion policy.
  2. Assign one animation owner per property and node. Put Motion state/layout effects on a child wrapper when GSAP owns a parent transform.
  3. Select the smallest GSAP surface: tween, timeline, ScrollTrigger, or a specific plugin.
  4. Implement inside a scoped useGSAP() context. Register only used plugins, make delayed callbacks context-safe, and rebuild measurement-dependent effects when their inputs change.
  5. Provide a non-pinned, readable reduced-motion state. Treat mobile/coarse-pointer behavior as a deliberate variant.
  6. Verify production behavior through resize, font/media load, route changes, Fast Refresh, repeated mount/unmount, rapid scrolling, and preference changes.

Reference routing

NeedRead
Tweens, eases, timelines, labels, positionscore-and-timelines.md
React 19, Next.js App Router, useGSAP, SSRreact-nextjs.md
ScrollTrigger, pin, scrub, SplitText and pluginsscrolltrigger-and-plugins.md
FPS, will-change, reduced motion, cleanupperformance-accessibility.md

Implementation contract

  • Prefer refs or selectors scoped to the component root.
  • Use timelines for choreography; do not chain unrelated delays.
  • Use function-based measurement plus invalidateOnRefresh when geometry can change.
  • Choose one SplitText lifecycle: return the animation from onSplit when using autoSplit, or rebuild the entire dependent timeline after a manual re-split. Never let an external timeline keep stale character nodes.
  • Revert SplitText and GSAP contexts; kill observers/listeners created outside the context.
  • Preserve the project's package manager and compatible versions. Add or upgrade GSAP only when the requested API is missing or the project has an evidenced compatibility problem; never replace a working version with latest by default.
  • Confirm current plugin imports and licensing from official GSAP documentation before changing dependencies.

Common mistakes

  • Animating the same transform with Motion and GSAP.
  • Creating ScrollTrigger before fonts, images, or layout settle.
  • Using permanent will-change across many elements.
  • Calling ScrollTrigger.refresh() repeatedly without coalescing layout changes.
  • Treating build success as proof that pinning, cleanup, and reduced motion work.

Technical basis: official GreenSock GSAP skills, adapted for this stack.

Download now (ZIP)

Does it work?

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

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.