Communitygithub.com

Asymmetric-al/core

Implementieren Sie flüssige, barrierefreie Animationen mit motion/react (Framer Motion) in React. Verwenden Sie dies beim Hinzufügen von Animationen, Gesten oder Layout-Übergängen mit motion, AnimatePresence, useScroll und verwandten APIs. Erfordert eine 'use client'-Grenze; nicht für rein serverseitig gerenderte Komponenten oder wenn keine Animation benötigt wird.

Was ist core?

Diese Fähigkeit (Skill) namens „motion“ dient der Implementierung flüssiger und barrierefreier Animationen in React unter Verwendung der Bibliothek motion/react (ehemals Framer Motion). Sie wird immer dann eingesetzt, wenn Animationen, Gesten oder Layout-Übergänge mit Komponenten wie motion, AnimatePresence, useScroll oder whileHover realisiert werden sollen. Ein zentraler Punkt ist die strikte Trennung von Client- und Server-Code: Motion-Komponenten benötigen die 'use client'-Direktive und sollten möglichst kleine Client-Bereiche erzeugen. Der Skill betont den respektvollen Umgang mit reduzierten Bewegungseinstellungen (useReducedMotion), die Wahl der richtigen API für den jeweiligen Anwendungsfall (AnimatePresence für Ein-/Ausblendungen, layout für Layout-Animationen) sowie die Disziplin hinsichtlich Bundle-Größe durch den Einsatz von LazyMotion. Typische Fallstricke wie das Ausblenden ohne AnimatePresence oder das Animieren großer Listen ohne Virtualisierung werden ebenso thematisiert wie konkrete Implementierungs- und Review-Checklisten. Der Skill ist für Entwickler gedacht, die in React-Anwendungen hochwertige, performante und benutzerfreundliche Animationen umsetzen möchten.

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

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Motion (Framer Motion) — Skill

Name: motion Zweck: Implementieren Sie flüssige, barrierefreie Animationen mit motion/react in React. Verwenden Sie diesen Skill, wenn Sie Animationen, Gesten oder Layout-Übergänge hinzufügen.

Anwendbar bei: Verwendung von motion/react (motion, AnimatePresence, useScroll usw.). Nicht anwenden, wenn: Keine Animationen benötigt werden oder die Komponente strikt serverseitig gerendert wird.

Regeln

  • Nur-Client-Grenze: Motion erfordert 'use client'; halten Sie Client-Insellösungen klein.
  • Einfach beginnen: Beginnen Sie mit Deckkraft/Verschiebung, bevor Sie Federphysik hinzufügen.
  • Das richtige Werkzeug verwenden: AnimatePresence für Ein-/Ausblendungen, layout für Layout, whileHover/whileTap für Gesten.
  • Reduzierte Bewegung respektieren: Verwenden Sie useReducedMotion().
  • Bundle-Disziplin: Verwenden Sie LazyMotion für größere Motion-Oberflächen.

Arbeitsablauf

  1. Identifizieren Sie den UX-Zweck (Feedback, Übergang, Fokus).
  2. Fügen Sie die kleinste 'use client'-Grenze hinzu.
  3. Implementieren Sie Ein-/Ausblendungen oder Layout-Übergänge korrekt.
  4. Respektieren Sie Präferenzen für reduzierte Bewegung.
  5. Überprüfen Sie Leistung und Bundle-Größe.

Checklisten

Implementierungs-Checkliste

  • 'use client' nur dort, wo es benötigt wird
  • Verhalten bei reduzierter Bewegung definiert
  • AnimatePresence umschließt bedingte UI
  • Layout-Übergänge verwenden layout

Review-Checkliste

  • Animationen werden nicht bei jedem Rendern erneut ausgeführt
  • Motion-Code erweitert den Client-Baum nicht unnötig

Minimalbeispiele

Ein-/Ausblenden

"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>
  );
}

Layout-Animation

"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">Titel</div>
      {open ? <div className="mt-2 text-sm">Mehr Inhalt...</div> : null}
    </motion.div>
  );
}

Reduzierte Bewegung

"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>
  );
}

Häufige Fehler / Fallstricke

  • Ausblenden ohne AnimatePresence (Ausblend-Animationen werden nie ausgeführt)
  • Layout animieren ohne layout
  • Motion in einen riesigen Client-Baum einfügen
  • Große Listen ohne Virtualisierung animieren

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.

Verwandte Skills