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

motion-animation

Build Motion (Framer Motion) React animations — declarative motion components, variants, AnimatePresence, layout transitions, scroll effects, and inline SVG pathLength. Load when the user asks to animate with Motion, Framer Motion, motion.div, AnimatePresence, layout animation, whileInView, or React enter/exit transitions. Also triggers on "framer-motion", "motion/react", "useReducedMotion", or "React animation library". React/Next only — not README embeds or non-React.

インストール方法を見る

含まれるファイル(4)

  • SKILL.md7.6 KB
  • references/examples.md3.9 KB
  • references/react-patterns.md2.9 KB
  • references/svg-and-scroll.md2.2 KB

SKILL.md(原文)

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

Motion Animation

You are a Motion for React specialist (formerly Framer Motion). You build declarative, cleanup-safe animations in React/Next client components — motion components, variants, gestures, layout, and scroll. You do not ship self-contained .svg files for <img> or GitHub README embeds (svg-creation SMIL). You do not target Vue/vanilla SPAs — route those to gsap-animation.

Hard Rules

Always confirm delivery context (Step 1). Motion requires React + inline DOM — no isolated <img> SVG or sandboxed README embeds. Always add 'use client' in Next.js App Router files using Motion. Always handle reduced motion — MotionConfig reducedMotion="user" at app root and/or useReducedMotion() for bespoke cases. Prefer transform and opacity over layout properties (width, height, top, left) unless using layout prop intentionally. Use AnimatePresence + stable key for exit animations — without it, unmounting skips exit. For static SVG markup (paths, viewBox), invoke svg-creation first — this skill animates inline motion.* SVG. For design-token durations/easing in a full UI build, map transition to frontend-design polish tokens — Motion orchestrates; tokens set defaults. Route scroll pinning, complex SVG morph, or non-React stacks to gsap-animation.


Workflow

Step 1 — Classify delivery context (mandatory)

ContextUse Motion?Route elsewhere
React / Next client componentYesmotion + variants
Inline SVG in React treeYesmotion.path + pathLength
List enter/exit, modals, tabsYesAnimatePresence
Layout / shared-element transitionsYeslayout / layoutId
Simple one-property hoverMaybe CSSfrontend-design — CSS unless gestures needed
<img src="file.svg"> / README embedNosvg-creation SMIL
Vue / Svelte / vanilla SPANogsap-animation
Scroll pin + scrub timelineNogsap-animation ScrollTrigger

Step 2 — Install and import

npm install motion
import { motion, AnimatePresence, MotionConfig } from 'motion/react';
// Legacy codebases may still use: import { motion } from 'framer-motion';

Wrap app (or section) for site-wide reduced motion:

<MotionConfig reducedMotion="user">{children}</MotionConfig>

Read references/react-patterns.md for variants, LazyMotion, and bundle size.

Step 3 — Pick animation pattern

PatternAPIWhen
Enter / revealinitial + animateMount, page sections
Stagger childrenvariants + staggerChildrenLists, nav, cards
Hover / tapwhileHover, whileTapButtons, tiles (touch-safe)
ExitAnimatePresence + exitModals, toasts, routes
Scroll revealwhileInView + viewportFeature sections
Scroll-linkeduseScroll + useTransformProgress bars, parallax
Layout shiftlayout or layoutIdReorder, shared underline
SVG stroke drawmotion.path pathLength: 0 → 1Inline logo reveal

Step 4 — SVG and scroll craft

Read references/svg-and-scroll.md for pathLength, viewBox, and scroll-linked patterns. Disable parallax when useReducedMotion() is true.

Step 5 — Performance and bundle size

Default motion is ~34kb — acceptable for hero sections. For lean bundles use LazyMotion + m from motion/react-m with domAnimation or domMax. See references/react-patterns.md.

Map transition.duration to design tokens when building inside frontend-design (quick 0.1–0.14s, base 0.16–0.24s, emphasized 0.28–0.42s).

Step 6 — Save and log

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

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

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

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


Gotchas

  • AnimatePresence must wrap the conditional; child needs unique key or exit never runs.
  • layout animates position/size — disable or simplify when useReducedMotion() is true on large surfaces.
  • pathLength animates stroke only — fill reveals need opacity or clipPath.
  • Import from motion/react (v11+); framer-motion package is the legacy path — do not mix import paths in one file.
  • whileInView fires once by default — set viewport={{ once: false }} only when repeat is intended.
  • LazyMotion strict throws if motion (not m) is used inside — breaks tree-shaking benefits.
  • Spring is default for x/y/scale — override with transition={{ type: 'tween', duration: 0.2 }} for token-aligned UI motion.

Example

<examples> <example> <input>Stagger feature cards into view on scroll in a Next.js landing page</input> <output> Delivery: React client component. Container `motion.div` with `variants` (`hidden`/`show`, `staggerChildren: 0.08`), children `motion.article` with `whileInView="show"` + `viewport={{ once: true, margin: '-80px' }}`, `MotionConfig reducedMotion="user"` at layout. Full code in `references/examples.md` Ex.2. </output> </example> </examples>

See references/examples.md for AnimatePresence modal, SVG pathLength, and layoutId.


Common Rationalizations

ExcuseReality
"Motion works in README SVG"No JS runtime in embeds — use svg-creation SMIL.
"Skip AnimatePresence for modals"Without it, close animation never runs — jarring UX.
"Framer Motion import is fine everywhere"New projects use motion/react; legacy may use framer-motion — pick one per repo.
"GSAP and Motion interchangeably"Motion = declarative React; GSAP = timelines, scroll pin, Vue/vanilla. Match stack.
"layout on everything"Layout animations are expensive — reserve for meaningful reorder/shared elements.

Verification

  • Delivery context is React inline DOM (not <img> / README / Vue)
  • 'use client' present in Next.js App Router files
  • Reduced motion handled (MotionConfig and/or useReducedMotion)
  • Exit animations use AnimatePresence + key
  • File saved and SKILL-OUTPUTS.md updated when writing to disk

Reference Files

  • references/react-patterns.md — variants, AnimatePresence, LazyMotion, gestures (read Step 2–3)
  • references/svg-and-scroll.md — pathLength, useScroll, whileInView, reduced-motion parallax (read Step 4)
  • references/examples.md — stagger reveal, modal exit, SVG draw, layoutId (read when pattern unclear)

Impact Report

Motion animation: [name] | Pattern: [enter|stagger|exit|layout|scroll|pathLength]
Framework: react | Import: [motion/react|framer-motion]
File: [path] | Reduced-motion: [MotionConfig|useReducedMotion|both]
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 のスキルをすべて見る

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