返回 Skill 列表
extension
分类: 开发与工程无需 API Key

gsap-best-practices

在使用JavaScript/TypeScript编写、审查或重构GSAP动画代码(补间动画、时间线、ScrollTrigger、matchMedia、插件使用和性能调优)时,采用这种规则可以确保遵循生产安全的动画模式。

person作者: jakexiaohubgithub

GSAP Best Practices

Rule routing

Load the smallest relevant set:

  • Read AGENTS.md for broad GSAP reviews, unclear tasks, or when you need the compact checklist.
  • Read rules/gsap-core.md for tweens, eases, staggers, transform aliases, matchMedia, defaults, or immediateRender.
  • Read rules/gsap-timelines.md for sequencing, labels, position parameters, nested timelines, or playback control.
  • Read rules/gsap-scrolltrigger.md for scroll animation, ScrollTrigger, pinning, scrub, snap, batch, scroller proxies, refresh, or horizontal scroll.
  • Read rules/gsap-plugins.md for plugin registration or plugin APIs such as Flip, Draggable, Observer, SplitText, ScrambleText, DrawSVG, MorphSVG, MotionPath, ScrollTo, ScrollSmoother, or GSDevTools.
  • Read rules/gsap-utils.md for gsap.utils, value mapping, clamp, mapRange, normalize, random, snap, distribute, toArray, selector, pipe, wrap, or units.
  • Read rules/gsap-performance.md for jank, FPS, layout thrashing, many elements, quickTo, quickSetter, will-change, reduced motion, or animation cleanup/performance.

For React or Next.js, load the smallest matching React rules:

  • rules/react-gsap-setup.md for package setup and useGSAP.
  • rules/react-gsap-lifecycle.md for cleanup and contextSafe.
  • rules/react-gsap-dependency-bugs.md for dependency-driven updates.
  • rules/react-gsap-scrolltrigger.md for React ScrollTrigger integration.
  • rules/react-gsap-ssr-strictmode.md for SSR and Strict Mode.

Read REACT.md only for a broad React GSAP review.

Use strict language only for correctness, stability, and accessibility. Prefer official GSAP docs when resolving conflicts.