Communitygithub.com

Asymmetric-al/core

Implemente animações suaves e acessíveis com motion/react (Framer Motion) em React. Use ao adicionar animações, gestos ou transições de layout com motion, AnimatePresence, useScroll e APIs relacionadas. Requer um limite 'use client'; não use para componentes estritamente renderizados no servidor ou quando nenhuma animação for necessária.

O que é core?

Este skill, Asymmetric-al/core, é um guia especializado para implementar animações suaves e acessíveis em React usando a biblioteca motion/react (anteriormente Framer Motion). Ele é útil para desenvolvedores que desejam adicionar animações, gestos, transições de entrada/saída ou animações de layout em seus componentes React, garantindo acessibilidade e performance. O skill suporta plataformas que utilizam React e motion/react, fornecendo regras claras, fluxos de trabalho e checklists para implementação correta. Ele enfatiza o uso de componentes como motion, AnimatePresence, useScroll e useReducedMotion, além de práticas como manter limites client-side pequenos, começar com animações simples (opacidade/translate) antes de física complexa, e usar LazyMotion para otimizar o tamanho do bundle. Exemplos práticos de código mostram como implementar animações de entrada/saída, transições de layout e como respeitar preferências de redução de movimento, ajudando a evitar erros comuns como animações sem AnimatePresence ou layout sem a propriedade layout.

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

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Motion (Framer Motion) — Skill

Nome: motion Propósito: Implementar animações suaves e acessíveis com motion/react em React. Use este skill sempre que adicionar animações, gestos ou transições de layout.

Aplicável quando: Usando motion/react (motion, AnimatePresence, useScroll, etc.). Não use quando: Nenhuma animação for necessária ou o componente for estritamente renderizado no servidor.

Regras

  • Limite client-only: Motion requer 'use client'; mantenha as ilhas client pequenas.
  • Comece simples: Comece com opacidade/translate antes de adicionar física spring.
  • Use a ferramenta certa: AnimatePresence para entrada/saída, layout para layout, whileHover/whileTap para gestos.
  • Respeite movimento reduzido: Use useReducedMotion().
  • Disciplina de bundle: Use LazyMotion para superfícies de animação maiores.

Fluxo de trabalho

  1. Identifique o propósito de UX (feedback, transição, foco).
  2. Adicione o menor limite 'use client'.
  3. Implemente transições de entrada/saída ou layout corretamente.
  4. Respeite as preferências de movimento reduzido.
  5. Verifique desempenho e tamanho do bundle.

Listas de verificação

Lista de verificação de implementação

  • 'use client' apenas onde necessário
  • Comportamento de movimento reduzido definido
  • AnimatePresence envolve UI condicional
  • Transições de layout usam layout

Lista de verificação de revisão

  • Animações não são executadas novamente a cada renderização
  • Código de animação não expande desnecessariamente a árvore client

Exemplos mínimos

Entrada/saída

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

Animação de layout

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

Movimento reduzido

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

Erros comuns / armadilhas

  • Desmontar sem AnimatePresence (animações de saída nunca são executadas)
  • Animar layout sem layout
  • Colocar Motion em uma árvore client enorme
  • Animar listas grandes sem virtualização

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.

Habilidades Relacionadas