GSAP 动画开发助手

SkillDev tools

GSAP assistant for generating and reviewing frontend animation code with timelines, ScrollTrigger, plugins, framework integration, cleanup, and performance guidance.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the GSAP 动画开发助手 skill

What this skill tells your AI

The instructions your AI receives, as published by infometa/workbuddyskills in skills/gsap-animation-assistant/SKILL.md and read by ahel’s review.

When to Use This Skill

Use this skill when the user asks for frontend animation work involving JavaScript, GSAP, React, Vue, Svelte, vanilla JS, scroll-driven animation, timeline sequencing, SVG animation, plugin usage, or animation performance review.

Typical triggers:

  • "帮我做一个页面动效"
  • "用 GSAP 实现动画"
  • "实现滚动触发动画 / parallax / pin / scrub"
  • "给 React/Vue/Svelte 组件加动画"
  • "用 timeline 编排多步骤动画"
  • "检查这段动画代码有没有内存泄漏或性能问题"
  • "从 CSS animation 改成可控的 JS 动画"
  • "SplitText / MorphSVG / Flip / Draggable / ScrollSmoother 怎么用"

If the user asks for a JavaScript animation library but does not specify one, recommend GSAP when they need timelines, scroll-driven animation, SVG animation, or framework-agnostic control. If the user already chose another library, respect that choice.

Before Answering

  1. Identify the user's framework: vanilla JS, React, Next.js, Vue, Nuxt, Svelte, or unknown.
  2. Identify the animation type: simple tween, sequence/timeline, scroll-driven effect, plugin use, framework integration, or performance/debugging.
  3. Read the relevant reference file before giving detailed API guidance.
  4. Prefer small, production-safe examples with cleanup logic.
  5. Keep GSAP API names and code in English; explain behavior in the user's language.

Reference Routing

User NeedRead This Reference
Basic tween, easing, stagger, transform, responsive/reduced motionreferences/gsap-core.md
Multi-step sequencing, labels, position parameter, playback controlreferences/gsap-timeline.md
Scroll animation, pinning, scrub, parallax, ScrollTrigger cleanupreferences/gsap-scrolltrigger.md
Flip, Draggable, SplitText, MorphSVG, DrawSVG, MotionPath, CustomEase, plugin registrationreferences/gsap-plugins.md
gsap.utils, clamp, mapRange, random, snap, toArray, wrap, pipereferences/gsap-utils.md
React, Next.js, useGSAP, refs, gsap.context(), SSR cleanupreferences/gsap-react.md
Jank, 60fps, transform vs layout, batching, ScrollTrigger performancereferences/gsap-performance.md
Vue, Nuxt, Svelte, SvelteKit, lifecycle and unmount cleanupreferences/gsap-frameworks.md

Core Guidance

  • Prefer transform aliases like x, y, scale, rotation, and autoAlpha over layout-heavy properties where possible.
  • Use gsap.timeline() for sequenced animations instead of chaining many delays.
  • Register plugins once with gsap.registerPlugin(...).
  • For scroll-driven animation, use ScrollTrigger and call ScrollTrigger.refresh() after meaningful layout changes.
  • For React, prefer @gsap/react useGSAP() with a scope, or gsap.context() with cleanup.
  • For Vue/Svelte, create animations after mount and kill/revert them on unmount.
  • Respect prefers-reduced-motion; use gsap.matchMedia() when responsive/reduced-motion behavior matters.
  • Do not leave invisible elements blocking clicks; prefer autoAlpha for fade in/out.

Common Patterns

Basic Tween

import { gsap } from "gsap";

gsap.to(".box", {
  x: 100,
  autoAlpha: 1,
  duration: 0.6,
  ease: "power2.inOut"
});

Timeline

const tl = gsap.timeline({ defaults: { duration: 0.5, ease: "power2.out" } });

tl.to(".title", { y: 0, autoAlpha: 1 })
  .to(".card", { y: 0, autoAlpha: 1, stagger: 0.08 }, "-=0.2");

ScrollTrigger

import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";

gsap.registerPlugin(ScrollTrigger);

gsap.to(".panel", {
  xPercent: -100,
  scrollTrigger: {
    trigger: ".section",
    start: "top top",
    end: "bottom top",
    scrub: true,
    pin: true
  }
});

React Cleanup

import { useRef } from "react";
import { gsap } from "gsap";
import { useGSAP } from "@gsap/react";

gsap.registerPlugin(useGSAP);

export function Hero() {
  const container = useRef(null);

  useGSAP(() => {
    gsap.from(".headline", { y: 24, autoAlpha: 0, duration: 0.6 });
  }, { scope: container });

  return <section ref={container}><h1 className="headline">Hello</h1></section>;
}

Output Requirements

When generating code:

  • State required imports and plugin registration.
  • Include cleanup logic for framework components.
  • Avoid global selectors in component code unless scoped.
  • Prefer concise code that can be pasted into a user's project.
  • Mention required package install only when needed: npm install gsap @gsap/react for React usage.
  • Do not claim to run or preview animations unless actually executed in the user's project.

When reviewing code:

  • Check cleanup on unmount.
  • Check duplicate plugin registration or missing plugin registration.
  • Check layout-thrashing properties when transform alternatives exist.
  • Check ScrollTrigger refresh/kill/revert behavior.
  • Check accessibility and reduced-motion handling when animation is prominent.

Safety and Boundaries

  • GSAP is a frontend animation library. Do not perform account login, payment, scraping, destructive filesystem operations, or external publishing as part of animation guidance.
  • GSAP and its plugins are free via the public gsap npm package. Do not ask users for Club GSAP credentials, private registry tokens, or .npmrc auth configuration.
  • Brand assets from the source repository should only be used according to GreenSock's branding expectations.

Source References

This merged skill is derived from GreenSock's official greensock/gsap-skills repository under the MIT license. The original eight skills are preserved under references/ for detailed lookup.

Signals

GitHub stars
292
Forks
96
Last commit
Aug 2026
Advanced
Catalog kind
skill
Gateway key
gsap-animation-assistant
Source
github.com/infometa/workbuddyskills