agentleFS
ViviBeriViviBeri/webcraft-pro/skills/gsap-fundamentals/SKILL.md

gsap-fundamentals

Skill11 starsChanged 12 days agoMITView on GitHub

Use when authoring or refactoring GSAP tweens, timelines, staggered sequences, reusable animation functions or component-scoped animation lifecycles.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

32 rules. About 0 are common, 28 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈28

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create intentional, deterministic animation sequences with clear ownership, predictable timing and reliable cleanup.

    line 10
  2. Distinctive:

    Check whether required plugins are installed and registered.

    line 16
  3. Distinctive:

    Follow the project's existing import and plugin-registration conventions.

    line 17
  4. Distinctive:

    Do not assume a plugin is available merely because it appears in an example.

    line 18
  5. Distinctive:

    Use CSS transitions or keyframes for simple state changes that do not need orchestration.

    line 20
  6. Distinctive:

    Use gsap.to(), gsap.from() or gsap.fromTo() for focused tween behavior.

    line 21
  7. Distinctive:

    Use a timeline when multiple animations need sequencing, overlap, labels, shared controls or coordinated playback.

    line 22
  8. Distinctive:

    Use stagger only when the elements form a meaningful group.

    line 23
  9. Distinctive:

    Use labels and position parameters to communicate sequence relationships.

    line 26
  10. Distinctive:

    Prefer timeline defaults for repeated duration/ease values.

    line 27
  11. Distinctive:

    Keep durations, delays and stagger values consistent with the motion system.

    line 28
  12. Distinctive:

    Avoid arbitrary delays that hide sequencing bugs.

    line 29
  13. Distinctive:

    Use gsap.context() for grouped animations and call revert() during teardown.

    line 33
  14. Distinctive:

    Use gsap.matchMedia() when responsive or preference-based conditions change the animation setup.

    line 34
  15. Distinctive:

    Remove event listeners, observers and timers created outside GSAP's context.

    line 35
  16. Distinctive:

    Avoid animating layout-affecting properties continuously when transform or opacity can achieve the same result.

    line 37
  17. Distinctive:

    Do not assume an element's initial inline style is the correct reset state.

    line 38
  18. Distinctive:

    Avoid global selectors that can animate another instance of the same component.

    line 40
  19. Distinctive:

    Test first render, replay, interruption, route changes and component teardown.

    line 42
  20. Distinctive:

    Check that animation does not block interaction or leave elements invisible.

    line 44
  21. Distinctive:

    Keep animation code near the component or interaction it owns.

    line 49
  22. Distinctive:

    Prefer explicit refs or scoped selectors over broad document-wide selectors.

    line 51
  23. Distinctive:

    Use gsap.set() for deliberate setup states, not as a substitute for understanding the underlying CSS.

    line 52
  24. Distinctive:

    Keep timelines controllable and avoid deeply nested callbacks when labels and timeline composition are clearer.

    line 53
  25. Distinctive:

    Do not create an animation merely to make an interface appear more sophisticated.

    line 54
  26. Very specific:

    Use gsap.context(callback, scope) to collect animations created for one component or page region, then call revert() when that owner is …

    line 73
  27. Very specific:

    Use gsap.matchMedia() when setup changes with media conditions.

    line 74
  28. Distinctive:

    Keep plugin registration at module or application initialization, not in render or mount callbacks that repeat.

    line 75
  29. Distinctive:

    Prefer timelines with labels and position parameters over chains of independent delays.

    line 76
  30. Very specific:

    When multiple from()/fromTo() tweens target the same property, review immediateRender behavior so a later tween does not overwrite an …

    line 77
  31. Very specific:

    Use overwrite deliberately for competing interactions.

    line 78
  32. Distinctive:

    Do not assume transform or opacity is automatically compositor-only or free.

    line 79

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

GSAP Fundamentals

Objective

Create intentional, deterministic animation sequences with clear ownership, predictable timing and reliable cleanup. Use GSAP only when it adds value beyond CSS transitions or keyframes.

Workflow

  1. Inspect the project
    • Confirm the installed GSAP version, package manager, bundler and framework integration.
    • Check whether required plugins are installed and registered.
    • Follow the project's existing import and plugin-registration conventions.
    • Do not assume a plugin is available merely because it appears in an example.
  2. Choose the simplest primitive
    • Use CSS transitions or keyframes for simple state changes that do not need orchestration.
    • Use gsap.to(), gsap.from() or gsap.fromTo() for focused tween behavior.
    • Use a timeline when multiple animations need sequencing, overlap, labels, shared controls or coordinated playback.
    • Use stagger only when the elements form a meaningful group; avoid animating every child by default.
  3. Design the timeline
    • Establish a clear visual start and end state.
    • Use labels and position parameters to communicate sequence relationships.
    • Prefer timeline defaults for repeated duration/ease values.
    • Keep durations, delays and stagger values consistent with the motion system.
    • Avoid arbitrary delays that hide sequencing bugs.
  4. Scope and clean up
    • Scope selector text to the component or page instance.
    • In component frameworks, create animations after the relevant elements exist and clean them up on unmount.
    • Use gsap.context() for grouped animations and call revert() during teardown.
    • Use gsap.matchMedia() when responsive or preference-based conditions change the animation setup; its recorded GSAP work is reverted when conditions stop matching.
    • Remove event listeners, observers and timers created outside GSAP's context.
  5. Make behavior robust
    • Avoid animating layout-affecting properties continuously when transform or opacity can achieve the same result.
    • Do not assume an element's initial inline style is the correct reset state.
    • Handle repeated triggers and interrupted timelines deliberately.
    • Avoid global selectors that can animate another instance of the same component.
  6. Verify
    • Test first render, replay, interruption, route changes and component teardown.
    • Resize across relevant breakpoints and change the reduced-motion preference.
    • Check that animation does not block interaction or leave elements invisible.
    • Confirm no duplicate timelines or ScrollTriggers accumulate after remounts.

Implementation guidance

  • Keep animation code near the component or interaction it owns.
  • Separate animation setup from business logic.
  • Prefer explicit refs or scoped selectors over broad document-wide selectors.
  • Use gsap.set() for deliberate setup states, not as a substitute for understanding the underlying CSS.
  • Keep timelines controllable and avoid deeply nested callbacks when labels and timeline composition are clearer.
  • Do not create an animation merely to make an interface appear more sophisticated.

Common failure modes

  • Creating animations during render.
  • Forgetting revert() or equivalent teardown.
  • Registering plugins repeatedly in component render paths.
  • Using global selectors in repeated components.
  • Leaving from() animations in a hidden or transformed state after an interrupted lifecycle.
  • Using a timeline for a simple CSS hover state.
  • Assuming zero duration alone makes a complex interaction accessible.

Completion criteria

The animation has a clear purpose, correct timing, scoped targets, lifecycle cleanup, responsive behavior and a verified non-animated or reduced-motion experience.

Lifecycle and API precision

  • Use gsap.context(callback, scope) to collect animations created for one component or page region, then call revert() when that owner is removed.
  • Use gsap.matchMedia() when setup changes with media conditions. It creates and manages its own context for each matching condition; call the returned object's revert() during teardown rather than redundantly wrapping the same setup in another context.
  • Keep plugin registration at module or application initialization, not in render or mount callbacks that repeat.
  • Prefer timelines with labels and position parameters over chains of independent delays. Store the timeline when controls need to pause, reverse, seek or kill it.
  • When multiple from()/fromTo() tweens target the same property, review immediateRender behavior so a later tween does not overwrite an earlier start state.
  • Use overwrite deliberately for competing interactions; do not use it to conceal unclear animation ownership.
  • Do not assume transform or opacity is automatically compositor-only or free. Profile the rendered result on representative devices.

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.