Communitygithub.com

Motion Foundations

모션 토큰, 스프링 프리셋, 성능 규칙, 기기 적응, 접근성 적용 및 React/Next.js 애니메이션을 위한 SSR 안전성을 제공합니다. 다른 모든 모션 스킬의 기반 계층입니다.

Motion Foundations란 무엇인가요?

이 스킬은 React 및 Next.js 애플리케이션에서 motion/react 라이브러리를 사용하여 일관되고 접근 가능하며 성능이 최적화된 애니메이션 시스템을 구축하기 위한 기초 계층을 정의합니다. `motionTokens` 객체와 `springs` 프리셋 맵을 통해 지속 시간, 이징, 거리, 스케일 등 모든 애니메이션 값을 중앙에서 관리하며, `shouldAnimate()` 게이트 함수를 통해 접근성(`prefers-reduced-motion`) 및 저사양 기기 감지를 처리합니다. 또한 SSR 환경에서 `initial` prop이 서버 출력과 일치하도록 강제하여 하이드레이션 불일치를 방지하며, `useReducedMotion` 훅을 통해 모든 애니메이션이 접근성 규칙을 준수하도록 합니다. 이 스킬은 `motion-patterns`, `motion-advanced`와 같은 하위 스킬들이 의존하는 기본 계층으로, 모든 애니메이션 작업을 시작하기 전에 반드시 로드되어야 합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Cody-W-Tucker/skills/tree/HEAD/skills/motion-foundations

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Motion Foundations은(는) 무엇을 하나요?

모션 시스템의 기본 계층입니다. 하위 스킬(motion-patterns, motion-advanced)이 상속하는 모든 값, 제약 조건 및 규칙을 정의합니다. 애니메이션 작업을 시작하기 전에 이 스킬을 로드하세요.

활성화 시점

  • 애니메이션 컴포넌트를 처음부터 새로 만들 때
  • 토큰, 스프링 프리셋 또는 이징 값을 설정할 때
  • prefers-reduced-motion 지원을 구현할 때
  • 애니메이션 초기 상태로 인한 하이드레이션 불일치를 디버깅할 때
  • 애니메이션의 존재 필요성을 평가할 때

산출물

이 스킬은 다음을 생성합니다:

  • 공유 motionTokens 객체 (지속 시간, 이징, 거리, 스케일)
  • 공유 springs 프리셋 맵 (5개의 명명된 구성)
  • 모든 컴포넌트에서 사용되는 shouldAnimate() 게이트
  • useReducedMotion을 통한 접근성 준수 애니메이션 기본값
  • 하이드레이션 경고가 없는 SSR-safe 초기 상태

원칙

모션은 다음 중 하나 이상을 충족해야 합니다. 그렇지 않으면 제거되어야 합니다:

  • 주의를 유도
  • 상태를 전달
  • 공간적 연속성을 유지

반응성은 항상 부드러움보다 우선합니다. 입력 지연을 유발하는 60fps 애니메이션은 애니메이션이 없는 것보다 나쁩니다.

규칙

다음 규칙은 절대 타협할 수 없습니다. 시스템의 모든 컴포넌트에 적용됩니다.

  1. motion/react만 사용합니다. framer-motion에서 임포트하지 마세요. 동일한 트리에서 둘을 혼용하지 마세요.
  2. initial은 서버 출력과 일치해야 합니다. 서버가 opacity: 1을 렌더링하면 initial prop도 opacity: 1이어야 합니다. 예외는 없습니다.
  3. Reduced motion이 모든 것을 재정의합니다. useReducedMotion()이 true를 반환하거나 prefersReduced가 true인 경우 모든 변환이 비활성화됩니다. 0.2초 이하의 불투명도 페이드만 허용되는 대체 수단입니다.
  4. 레이아웃 속성에 애니메이션을 적용하지 마세요. width, height, top, left, margin, padding은 animate에서 금지됩니다. transform과 opacity만 사용하세요.
  5. 모든 토큰 값은 motionTokens에서 가져옵니다. 컴포넌트 파일에 하드코딩된 지속 시간과 이징은 금지됩니다.
  6. 모든 스프링 구성은 springs 맵에서 가져옵니다. 인라인 stiffness/damping 값은 금지됩니다.
  7. "use client"는 motion/react를 임포트하는 모든 파일에 필수입니다.
  8. 모듈 레벨에서 window 또는 navigator를 읽지 마세요. 항상 typeof window !== "undefined"로 가드하세요.

결정 가이드

지속 시간 선택

토큰사용 시점
instant툴팁 표시/숨김, 포커스 링, 배지 업데이트
fast버튼 피드백, 아이콘 교체, 칩 토글
normal모달 열기, 카드 확장, 페이지 요소 진입
slow히어로 등장, 전체 페이지 전환
crawl신중한 스토리텔링; 절약해서 사용

스프링 선택

프리셋사용 시점
snappy기본 UI — 버튼, 칩, 네비게이션 항목
gentle부드럽게 안착하는 카드, 모달, 패널
bouncy장난스러운 순간 — 빈 상태, 온보딩
instant툴팁, 팝오버, 드롭다운
release드래그 해제 — 자연스러운 물리 효과

애니메이션 완전 비활성화 시점

다음의 경우 shouldAnimate()가 false를 반환하도록 비활성화합니다:

  • prefersReduced가 true인 경우
  • isLowEnd가 true이고 애니메이션이 필수가 아닌 경우
  • 요소가 화면 밖에 있고 뷰포트에 진입하지 않을 경우
  • 애니메이션이 순수 장식용이며 UX 목적이 없는 경우

핵심 개념

토큰 시스템

// lib/motion-tokens.ts
export const motionTokens = {
  duration: {
    instant: 0.08,
    fast:    0.18,
    normal:  0.35,
    slow:    0.6,
    crawl:   1.0,
  },
  easing: {
    smooth: [0.22, 1, 0.36, 1],
    sharp:  [0.4, 0, 0.2, 1],
    bounce: [0.34, 1.56, 0.64, 1],
    linear: [0, 0, 1, 1],
  },
  distance: {
    xs: 4,
    sm: 8,
    md: 16,
    lg: 24,
    xl: 48,
  },
  scale: {
    subtle: 0.98,
    press:  0.95,
    pop:    1.04,
  },
}

export const springs = {
  snappy:  { type: "spring", stiffness: 300, damping: 30 },
  gentle:  { type: "spring", stiffness: 120, damping: 14 },
  bouncy:  { type: "spring", stiffness: 400, damping: 10 },
  instant: { type: "spring", stiffness: 600, damping: 35 },
  release: { type: "spring", stiffness: 200, damping: 20, restDelta: 0.001 },
}

런타임 플래그

// lib/motion-config.ts
export const motionConfig = {
  isLowEnd() {
    return (
      typeof navigator !== "undefined" &&
      navigator.hardwareConcurrency <= 4
    )
  },

  prefersReduced() {
    return (
      typeof window !== "undefined" &&
      window.matchMedia("(prefers-reduced-motion: reduce)").matches
    )
  },

  shouldAnimate({ essential = false } = {}) {
    if (this.prefersReduced()) return false
    if (!essential && this.isLowEnd()) return false
    return true
  },

  duration() {
    return this.isLowEnd() || this.prefersReduced()
      ? motionTokens.duration.instant
      : motionTokens.duration.normal
  },
}

접근성

우선 순위 (높음에서 낮음 순):

  1. prefers-reduced-motion: reduce — 모든 변환을 비활성화하고, 불투명도 전환을 0.2초 이하로 제한
  2. 저사양 기기 감지 — 지속 시간을 줄이고, 필수적이지 않은 애니메이션 제거
  3. 디자인 선호도 — 그 외 모든 것

모션은 우아하게 저하되어야 합니다. 레이아웃 이동을 유발하거나 방향 감각을 혼란스럽게 하는 방식으로 갑자기 사라져서는 안 됩니다.

// hooks/use-reduced-motion.tsx
"use client"
import { useReducedMotion } from "motion/react"

export function useSafeMotion(fullY: number = 16) {
  const reduce = useReducedMotion()
  return {
    initial: { opacity: 0, y: reduce ? 0 : fullY },
    animate: { opacity: 1, y: 0 },
    exit:    { opacity: 0, y: reduce ? 0 : -fullY },
  }
}
/* globals.css */
@media (prefers-reduced-motion: reduce) {
  .motion-safe-transition  { transition: opacity 0.15s; }
  .motion-reduce-transform { transform: none !important; }
}
<!-- Tailwind -->
<div class="motion-safe:animate-fade motion-reduce:opacity-100"></div>

SSR / 하이드레이션 안전성

규칙: initial은 항상 서버가 렌더링하는 것과 일치해야 합니다.

// 잘못된 예 — 서버는 opacity:1을 렌더링하지만 initial은 0이라고 말함 → 하이드레이션 불일치
<motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} />

// 올바른 예 — AnimatePresence를 사용하거나 클라이언트 마운트로 지연
"use client"
const [mounted, setMounted] = useState(false)
useEffect(() => setMounted(true), [])

<motion.div
  initial={{ opacity: mounted ? 0 : 1 }}
  animate={{ opacity: 1 }}
/>

코드 예제

종합 예제: 토큰 + 스프링 + 접근성 + SSR 가드

// components/fade-in-card.tsx
"use client"

import { useState, useEffect } from "react"
import { motion } from "motion/react"
import { motionTokens, springs } from "@/lib/motion-tokens"
import { useSafeMotion } from "@/hooks/use-reduced-motion"
import { motionConfig } from "@/lib/motion-config"

interface FadeInCardProps {
  children: React.ReactNode
  delay?: number
}

export function FadeInCard({ children, delay = 0 }: FadeInCardProps) {
  // SSR 가드 — initial은 서버 출력(opacity: 1)과 일치해야 함
  const [mounted, setMounted] = useState(false)
  useEffect(() => setMounted(true), [])

  // 접근성 — reduced motion이 선호되면 변환 비활성화
  const safeMotion = useSafeMotion(motionTokens.distance.md)

  // 기기 게이트 — 저사양 하드웨어에서 애니메이션 건너뛰기
  if (!motionConfig.shouldAnimate() || !mounted) {
    return <div>{children}</div>
  }

  return (
    <motion.div
      initial={safeMotion.initial}
      animate={safeMotion.animate}
      exit={safeMotion.exit}
      transition={{
        ...springs.gentle,
        delay,
      }}
      whileHover={{ scale: motionTokens.scale.pop }}
      whileTap={{ scale: motionTokens.scale.press }}
    >
      {children}
    </motion.div>
  )
}

제약 사항 / 비목표

이 스킬은 다음을 다루지 않습니다:

  • UI 컴포넌트 패턴 (버튼, 모달, 스태거) → motion-patterns 참조
  • 드래그, 제스처, SVG, 텍스트 애니메이션, 커스텀 훅 → motion-advanced 참조
  • CSS 전용 애니메이션 또는 motion/react 없이 Tailwind animate-* 클래스
  • 타사 애니메이션 라이브러리 (GSAP, anime.js 등)
  • 모션 디자인 결정 (애니메이션 시점, 강조할 대상) — 이는 코드 제약이 아닌 디자인 문제

안티 패턴

안티 패턴위반 규칙수정 방법
import { motion } from "framer-motion"규칙 1motion/react 사용
SSR 컴포넌트에서 initial={{ opacity: 0 }}규칙 2마운트 가드 추가
useReducedMotion 검사 생략규칙 3useSafeMotion 훅 사용
animate={{ width: "100%" }}규칙 4대신 scaleX 변환 사용
인라인 transition={{ duration: 0.4 }}규칙 5motionTokens.duration.normal 사용
인라인 { stiffness: 300, damping: 30 }규칙 6springs.snappy 사용
"use client" 지시문 누락규칙 7파일 상단에 추가
모듈 레벨에서 navigator.hardwareConcurrency규칙 8typeof navigator !== "undefined"로 감싸기

관련 스킬

  • motion-patterns — 여기에 정의된 토큰과 스프링을 사용하여 버튼, 모달, 스태거, 페이지 전환 및 스크롤 패턴을 구축합니다. 값을 재정의하지 않습니다.
  • motion-advanced — 여기에 정의된 토큰과 스프링을 사용하여 드래그, SVG, 텍스트 및 제스처 패턴을 구축합니다. 이 기반 위에 useAnimate 시퀀스와 커스텀 훅을 추가합니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Cody-W-Tucker/skills

Landing page quality assessment for paid advertising campaigns. Evaluates message match, page speed, mobile experience, trust signals, form optimization, and conversion rate potential. Use when user says landing page, post-click experience, landing page audit, conversion rate, or landing page optimization.

Cody-W-Tucker/skills

TikTok Ads deep analysis covering creative quality, tracking, bidding, campaign structure, and TikTok Shop. Evaluates 28 checks with emphasis on creative-first strategy, safe zone compliance, and Smart+ campaigns. Use when user says TikTok Ads, TikTok marketing, TikTok Shop, Spark Ads, Smart+, or TikTok campaign.

Cody-W-Tucker/skills

YouTube Ads specific analysis covering campaign types, creative quality, audience targeting, and measurement. Evaluates video ad performance across skippable, non-skippable, bumper, Shorts, Demand Gen, and Connected TV formats. Covers VAC→Demand Gen migration, Shorts creative requirements, and CTV shoppable ads. Use when user says YouTube Ads, video ads, pre-roll, bumper ads, YouTube campaign, Shorts ads, or CTV ads.

Cody-W-Tucker/skills

Craft the story that makes investors say \"I want in.\" Master the narrative structure that Reid Hoffman, Sequoia, and top founders use to raise capital. Use when: **Preparing to fundraise** to develop your story before the deck; **Investor meetings** to structure conversations that convert; **Pitch practice** to refine your narrative arc; **Cold outreach** to write compelling investor emails; **Pivoting** to reframe your story after a change

Cody-W-Tucker/skills

Identify the best GTM motions and tools across 7 motion types: Inbound, Outbound, Paid Digital, Community, Partners, ABM, and PLG. Use when selecting marketing channels, choosing between inbound and outbound strategy, or planning cross-channel campaigns.

Cody-W-Tucker/skills

Produce a print-grade single-page kami (紙 / 纸) document — warm parchment canvas, ink-blue accent, serif at one weight, no italic, no cool grays. The output reads like a professional white paper or studio one-pager, not an app UI. Multilingual by design (EN · zh-CN · ja). One self-contained HTML file, zero dependencies.

Cody-W-Tucker/skills

Optimize landing pages for maximum conversions using proven frameworks from Unbounce and Oli Gardner—apply the \"one goal, one message, one action\" principle with data-driven design, copy, and CTA best practices. Use when: **Create a new landing page** for a campaign; **Optimize an existing landing page** that isn't converting; **Review landing page design** before launch; **Improve form conversion rates** on lead gen pages; **A/B test landing page elements** systematically

Cody-W-Tucker/skills

Advanced motion patterns for React / Next.js — drag & drop, gestures, text animations, SVG path drawing, custom hooks, imperative sequences (useAnimate), loaders, and the full API decision tree. Requires motion-foundations.

Cody-W-Tucker/skills

A single-frame motion-design composition with looping CSS animations — rotating type ring, animated globe, ticking timer, parallax labels. Renders as a hero video poster you can hand straight to HyperFrames or any keyframe-based exporter. Use when the brief asks for "motion design", "animated hero", "loop", "video poster", "title card", or pairs Open Claude Design with HyperFrames for a kinetic export.

Cody-W-Tucker/skills

Production-ready animation patterns for React / Next.js — button, modal, toast, stagger, page transitions, exit animations, scroll, and layout — built on motion-foundations tokens and springs.

Cody-W-Tucker/skills

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

Cody-W-Tucker/skills

Produce a single-file slide deck in the Atelier Zero visual language (warm-paper background, italic-serif emphasis spans, coral terminating dots, surreal collage plates) — Open Design's brand deck recipe. The deck uses **horizontal magazine-style swipe pagination** (←/→, wheel, swipe), a per-slide chrome strip with brand mark and slide counter, an ESC overview grid, a coral progress bar, and inherits the canonical stylesheet + 16-slot image library from the sister `open-design-landing` skill.

Cody-W-Tucker/skills

Produce a world-class single-page editorial landing site in the Atelier Zero visual language (Monocle / Apartamento / Études editorial collage) — the same aesthetic Open Design uses for its own marketing surface. The agent fills a typed `inputs.json` from a brand brief, optionally generates 16 collage assets via gpt-image-2, then runs a pure-function composer that emits a self-contained HTML file; a separate path can mirror the Astro marketing site in `apps/landing-page/`. Drop-in scroll-reveal motion and a Headroom-style sticky nav are wired automatically.

Cody-W-Tucker/skills

Best practices for Remotion - Video creation in React. 29 domain-specific rules covering 3D, animations, audio, captions, charts, transitions, and more.

Cody-W-Tucker/skills

Single-page SaaS landing with hero, features, social proof, pricing, and CTA. Respects the active DESIGN.md color/typography/layout tokens. Trigger keywords: "saas landing", "marketing page", "product landing".

Cody-W-Tucker/skills

Single-page SaaS landing with hero, features, social proof, pricing, and CTA. Respects the active DESIGN.md color/typography/layout tokens. Trigger keywords: "saas landing", "marketing page", "product landing".

Cody-W-Tucker/skills

Master April Dunford's 8-step sales narrative from \"Sales Pitch\" (2023). Transform your positioning into a compelling story that wins enterprise deals. Use when: Structuring B2B sales presentations and demos; Creating pitch decks for complex products; Training sales teams on narrative-driven selling; Converting positioning strategy into sales conversations; Winning against entrenched competitors

Cody-W-Tucker/skills

Swiss-style user-research narrative template in warm-paper editorial aesthetics. Use when users ask for a premium research deck or story-first live artifact with minimalist typography, high-clarity layout, subtle motion, donut breakdowns, and keyboard/click navigation across slides in a single HTML file.

Cody-W-Tucker/skills

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

Cody-W-Tucker/skills

Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.

관련 스킬