Communitygithub.com

非対称コア

Reactでmotion/react(Framer Motion)を使い、スムーズでアクセシブルなアニメーションを実装します。アニメーション、ジェスチャー、レイアウトトランジションを追加する際に使用します。'use client'バウンダリが必要で、厳密にサーバーサイドレンダリングされたコンポーネントやアニメーションが不要な場合には使用しません。

非対称コア とは?

このスキルは、Reactアプリケーションにおいてmotion/react(Framer Motion)を使用したアニメーション実装を支援します。UI要素のフェードイン/アウト、レイアウトトランジション、ジェスチャー(ホバー、タップ)などのアニメーションをアクセシブルかつパフォーマンス良く追加できます。主にClaude CodeなどのAIエージェントで利用され、motion/reactのベストプラクティスに沿ったコード生成を促進します。“use client”バウンダリの適切な設定、AnimatePresenceによるEnter/Exitアニメーション、useReducedMotion()によるユーザーの動きの抑制設定への対応、LazyMotionによるバンドルサイズ最適化など、実践的なルールを提供します。また、よくある落とし穴(AnimatePresenceなしでのアンマウント、レイアウトアニメーションでのlayoutプロパティ欠如、大きなクライアントツリー内でのMotion使用)を回避するためのチェックリストも含まれています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Asymmetric-al/core/tree/HEAD/.agents/skills/motion

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Motion(Framer Motion) — スキル

名前: motion 目的: Reactでmotion/reactを使用して、スムーズでアクセシブルなアニメーションを実装します。 アニメーション、ジェスチャー、またはレイアウトトランジションを追加するたびにこのスキルを使用してください。

適用する場合: motion/react(motion、AnimatePresence、useScrollなど)を使用している場合。 使用しない場合: アニメーションが不要な場合、またはコンポーネントが厳密にサーバーレンダリングされる場合。

ルール

  • クライアントのみのバウンダリ: Motionは'use client'を必要とします。クライアントアイランドは小さく保ってください。
  • シンプルに始める: スプリング物理演算を追加する前に、不透明度/移動から始めてください。
  • 適切なツールを使用: Enter/ExitにはAnimatePresence、レイアウトにはlayout、ジェスチャーにはwhileHover/whileTapを使用してください。
  • 動きの抑制に対応: useReducedMotion()を使用してください。
  • バンドルサイズ規律: 大規模なモーションサーフェスにはLazyMotionを使用してください。

ワークフロー

  1. UXの目的(フィードバック、トランジション、フォーカス)を特定する。
  2. 最小の'use client'バウンダリを追加する。
  3. Enter/Exitまたはレイアウトトランジションを正しく実装する。
  4. 動きの抑制設定に対応する。
  5. パフォーマンスとバンドルサイズを確認する。

チェックリスト

実装チェックリスト

  • 'use client'は必要な場所にのみ配置されている
  • 動きの抑制時の動作が定義されている
  • AnimatePresenceが条件付きUIをラップしている
  • レイアウトトランジションにはlayoutを使用している

レビューチェックリスト

  • アニメーションがレンダリングのたびに再実行されない
  • モーションコードが不必要にクライアントツリーを拡大していない

最小限の例

Enter/Exit

"use client";

import { AnimatePresence, motion } from "motion/react";

export function Toast({
  open,
  children,
}: {
  open: boolean;
  children: React.ReactNode;
}) {
  return (
    <AnimatePresence>
      {open ? (
        <motion.div
          initial={{ opacity: 0, y: 8 }}
          animate={{ opacity: 1, y: 0 }}
          exit={{ opacity: 0, y: 8 }}
          transition={{ duration: 0.18 }}
        >
          {children}
        </motion.div>
      ) : null}
    </AnimatePresence>
  );
}

レイアウトアニメーション

"use client";

import { motion } from "motion/react";

export function Expander({ open }: { open: boolean }) {
  return (
    <motion.div layout className="overflow-hidden rounded-md border p-3">
      <div className="font-medium">Title</div>
      {open ? <div className="mt-2 text-sm">More content...</div> : null}
    </motion.div>
  );
}

動きの抑制

"use client";

import { motion, useReducedMotion } from "motion/react";

export function FadeIn({ children }: { children: React.ReactNode }) {
  const reduce = useReducedMotion();
  return (
    <motion.div
      initial={reduce ? false : { opacity: 0, y: 6 }}
      animate={reduce ? { opacity: 1 } : { opacity: 1, y: 0 }}
      transition={{ duration: 0.2 }}
    >
      {children}
    </motion.div>
  );
}

よくある間違い/落とし穴

  • AnimatePresenceなしでアンマウントする(Exitアニメーションが決して実行されない)
  • layoutなしでレイアウトをアニメーションする
  • Motionを巨大なクライアントツリー内に配置する
  • 仮想化せずに大規模なリストをアニメーションする

Individual skills in this repo

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

Asymmetric-al/core

Build animations for Expo and React Native only, using Reanimated, Gesture Handler, Expo Router, and expo-haptics. Use when the target runtime is an Expo or React Native app. Do not use it for Core Next.js web motion; use `animate` for web. Only runs when explicitly invoked; it does not trigger on its own.

Asymmetric-al/core

Build an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Writes the implementation. Use when asked to animate something, add motion, make a component feel alive, or build a transition. For critiquing existing motion use review-animations; for auditing a whole codebase use improve-animations. Only runs when explicitly invoked; it does not trigger on its own.

Asymmetric-al/core

Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.

Asymmetric-al/core

Inspect a Core UI or code surface for a small number of justified motion opportunities and explicitly identify what should remain static. Use when asked what should animate, where motion would improve feedback or comprehension, how to make an interface feel more alive without over-animating it, or whether a proposed animation is worth adding. Read-only; do not use to review or fix existing motion code or to implement animations.

Asymmetric-al/core

Survey a codebase's animation and motion code as a senior motion advisor, then produce a prioritized audit and self-contained implementation plans for other agents (or cheaper models) to execute. Read-only on source code — it plans improvements, it does not apply them. Use when the user asks to "improve the animations", "audit the motion", "make this app feel better", or wants a roadmap of animation fixes rather than a review of a single diff.

Asymmetric-al/core

Best practices for Remotion - Video creation in React

Asymmetric-al/core

Reviews animation and motion code against a high craft bar derived from Emil Kowalski's design engineering philosophy. Default to flagging; approval is earned.

関連スキル