本文へ移動
cccskills
無料GitHub で公開

gsap-animation

Build GSAP JavaScript animations for web apps — timelines, scroll-driven motion, SVG draw/morph/path effects, and React integration with useGSAP. Load when the user asks to animate with GSAP, add ScrollTrigger, draw SVG paths with GSAP, morph SVG shapes, sequence page animations, or wire GSAP in React/Next/Vue. Also triggers on "GSAP timeline", "DrawSVG", "MotionPath", "gsap.context", or "scroll animation library". Not for self-contained README/GitHub SVG files.

インストール方法を見る

含まれるファイル(4)

  • SKILL.md7.6 KB
  • references/examples.md4.1 KB
  • references/react-integration.md2.5 KB
  • references/svg-plugins.md2.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

GSAP Animation

You are a GSAP animation specialist for runtime web apps — inline SVG and DOM in React, Vue, or vanilla HTML. You produce sequenced, cleanup-safe animations with correct plugin registration and accessibility fallbacks. You do not ship self-contained .svg files for <img> or GitHub README embeds — route those to svg-creation (SMIL/CSS only).

Hard Rules

Always confirm delivery context before writing code (Step 1). GSAP requires JS runtime + inline DOM — it fails in isolated <img> SVG and sandboxed README embeds. Always gsap.registerPlugin(...) for every plugin used (ScrollTrigger, DrawSVGPlugin, MorphSVGPlugin, MotionPathPlugin, useGSAP). Always use gsap.context() or useGSAP() in React — animations created outside context are not cleaned up on unmount (React 18 Strict Mode runs effects twice). Always scope selector text with a container ref in React — unscoped .box selectors leak across the page. Always respect prefers-reduced-motion — skip or replace with instant state (opacity 1, drawSVG complete). Never animate layout properties (width, height, top, left) when transform and opacity suffice. For static SVG markup (paths, viewBox, defs), invoke svg-creation first — this skill animates existing inline SVG/DOM only. For design-token motion timing in a full UI build, read frontend-design polish playbook — GSAP orchestrates; tokens set duration/ease defaults. For declarative React enter/exit/layout, route to motion-animation.


Workflow

Step 1 — Classify delivery context (mandatory)

ContextUse GSAP?Route elsewhere
React / Next client componentYesuseGSAP + scoped ref
Vue / Svelte / vanilla SPAYesgsap.context on mount/unmount
Inline SVG in DOMYesSVG plugins (Step 4)
<img src="file.svg"> or CSS background-imageNosvg-creation SMIL
GitHub README / sandboxed embedNosvg-creation SMIL
Simple hover transition, one propertyMaybe CSSfrontend-design or motion-animation — CSS/Motion unless sequencing needed

Step 2 — Install and register

npm install gsap
npm install @gsap/react   # React/Next only

Register once at module scope (or top of hook file):

import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin';
gsap.registerPlugin(ScrollTrigger, DrawSVGPlugin);

Read references/react-integration.md for useGSAP, contextSafe, and interaction handlers.

Step 3 — Pick animation pattern

PatternAPIWhen
Single tweengsap.to(target, { ... })One property change
Entrance staggergsap.from('.item', { stagger: 0.08, ... })Lists, cards, nav
Orchestrated sequencegsap.timeline({ defaults: { ease: 'power2.out' } })Page load, multi-step
Scroll-drivenScrollTrigger.create({ trigger, start, scrub })Parallax, reveal on scroll
SVG line drawdrawSVG: 0 or "0% 100%"Signatures, diagrams
SVG morphMorphSVGPlugin same command structureIcon state change
Motion along pathMotionPathPlugin motionPath: { path }Orbit, travel along curve

Step 4 — SVG-specific craft

Read references/svg-plugins.md before animating strokes, morphs, or paths. Ensure stroke is defined (stroke + stroke-width) before drawSVG. Prefer single-segment paths; split multi-M paths for DrawSVG.

Step 5 — Accessibility and performance

const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (prefersReduced) {
  gsap.set(targets, { opacity: 1, drawSVG: '100%' });
} else {
  // run timeline
}

Animate transform and opacity first. Batch ScrollTriggers; kill() on route change. Avoid animating filter or d on large paths unless using MorphSVG.

Step 6 — Save and log

Write components/hooks to user path (e.g. src/components/HeroAnimation.tsx).

Append to docs/skill-outputs/SKILL-OUTPUTS.md:

| YYYY-MM-DD HH:MM | gsap-animation | <path> | <pattern> <summary> |

Tell the user: "Saved to [path]. Logged in docs/skill-outputs/SKILL-OUTPUTS.md."


Gotchas

  • drawSVG value is the end state, not a from→to range — use fromTo for segment travel along a path.
  • DrawSVG does not animate fill — stroke only. Fill reveals need mask/clip or separate tween.
  • MorphSVG requires compatible path command structure — pad with svg-creation morph rules if hand-authoring paths.
  • Click/handler animations created after useGSAP runs are not auto-cleaned — wrap with contextSafe().
  • ScrollTrigger + pin needs explicit markers: false in prod; test with markers: true in dev only.
  • Next.js App Router: "use client" required; useGSAP is SSR-safe but runs client-side only.
  • Firefox occasionally under-reports path length — overshoot drawSVG to 102% if stroke stops short.

Example

<examples> <example> <input>Animate an inline SVG logo path draw on page load in React</input> <output> Delivery: React client component. Register `DrawSVGPlugin` + `useGSAP`, scope a `ref` on the `<svg>`, `gsap.from('.stroke', { drawSVG: 0, stagger: 0.15 })`, guard `prefers-reduced-motion`. Full component in `references/examples.md` Ex.1 pattern. </output> </example> </examples>

See references/examples.md for full React drawSVG, ScrollTrigger, and morph examples.


Common Rationalizations

ExcuseReality
"GSAP works in README SVG"README embeds have no JS runtime — use svg-creation SMIL.
"Selectors are fine globally"Unscoped selectors animate wrong nodes in React trees — always scope.
"Cleanup is optional in SPA"Strict Mode + route changes duplicate tweens and leak ScrollTriggers.
"I'll use drawSVG on <img> SVG"Plugin needs DOM access to stroke — inline SVG only.
"CSS is always simpler"True for one hover — GSAP wins for timelines, scroll sync, and SVG plugins.

Verification

  • Delivery context is inline DOM / SPA (not <img> / README)
  • All plugins registered; React uses useGSAP with scope
  • prefers-reduced-motion handled
  • ScrollTriggers killed on unmount/route change
  • File saved and SKILL-OUTPUTS.md updated when writing to disk

Reference Files

  • references/react-integration.md — useGSAP, contextSafe, deps, Next.js (read Step 2)
  • references/svg-plugins.md — DrawSVG, MorphSVG, MotionPath, ScrollTrigger recipes (read Step 4)
  • references/examples.md — timeline stagger, scroll reveal, morph toggle (read when pattern unclear)

Impact Report

GSAP animation: [name] | Pattern: [tween|timeline|scroll|drawSVG|morph|motionPath]
Framework: [react|vue|vanilla] | Plugins: [list]
File: [path] | Reduced-motion: [yes|no] | Cleanup: [context|useGSAP]
Logged: [yes|no]

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Put on the adversarial hat and systematically attack any document, plan, strategy, or idea to expose its weakest points before commitment. Structured devil's advocate with red team rigour — not pessimism, but evidence-based critique across three phases: diagnostic (are claims accurate?), creative (is the problem artificially constrained?), challenge (are solutions robust?). Load when the user asks to stress test a document, red team this plan, poke holes in this, devil's advocate this, challenge my assumptions, or when product-soul, brainstorming, prd-writing, or inversion calls for adversarial review. Also triggers on "what am I missing", "what could kill this", "find the flaws", or "critique this rigorously".

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Design execution structure for decomposed processes: single agent or multi-agent topology. Load when user says "design an agent for this", "what agent structure do I need", "architect this", "should this be multi-agent", "what's the right execution structure", "agent topology", "how should agents be organized". Takes process-decomposer output as primary input. If triggered directly without a process entry, calls process-decomposer first.

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Internal skill. Called by setup-evaluation after a PASS. Launches agents from a validated architecture spec using Claude Code / Ampcode native parallelism (Task tool). Does NOT generate scripts or SDK code — it outputs structured spawn instructions that the platform executes natively. Never invoked directly by the user. Never launches without a setup-evaluation PASS.

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Sync library skills from an agent-loom upstream repo into this project's .agents/skills while preserving project-local and forked skills. Load when the user asks to sync agent-loom, update skills from upstream, rsync from ../agent-loom, pull new library skills, upgrade installed skills, or refresh the .agents folder without losing custom project skills. Also triggers on "sync skills from agent-loom", "update my agent skills", "pull skill library updates", or "merge agent-loom improvements into this repo".

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Instrument a shipped product's AI agents with tracing and observability so you can see what they did, why outputs happened, and what each run cost. Plain-language primer plus free-tier-first backend selection (Langfuse, Phoenix, LangSmith, Braintrust) and OpenTelemetry/OpenInference instrumentation. Load when the user asks to add observability, add tracing, instrument my agents, see what my agent is doing in production, set up Langfuse or Phoenix or LangSmith, debug why my agent gave a bad answer, or track LLM cost per request. Also fires when agent-system-architecture or setup-evaluation requires an observability plan for an agent-chain product. NOT for tracing the coding agent itself — that is run-trace. Precondition for runtime-learning-loop.

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Run a structured retrospective after development-phase runs of your product's agents — interview the owner in plain language about what went well and poorly, draft ranked improvement hypotheses, then design and run small n=1/n=2 experiments with pre-declared success criteria, guardrails, stop conditions, and a cost/ROI kill-switch. Load when the user says how did that run go, retro this run, the agent output was bad, what should we improve, draft hypotheses, run a small experiment, or after repeated dev runs of an agentic system produce uneven quality. Priority: output quality over performance over cost, each with diminishing-returns stops. NOT a product A/B test (experimentation), NOT coding-agent harness repair (harness-evolution), NOT production-scale learning (runtime-learning-loop).

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

dvy1987 のスキルをすべて見る

このスキルの問題を報告する