Communitygithub.com

iurymagano/portfolio-next

Skill oficial de performance GSAP — prefira transforms, evite layout thrashing, use will-change e batching. Utilize ao otimizar animações GSAP, reduzindo jank, ou quando o usuário perguntar sobre performance de animação, FPS ou 60fps suaves.

O que é portfolio-next?

Este skill fornece as melhores práticas de performance para animações GSAP, com foco em atingir 60fps suaves e evitar jank (travamentos). A abordagem central é animar apenas as propriedades de transform (x, y, scale, rotation) e opacity, que são processadas no compositor, evitando layout e pintura desnecessária. O skill recomenda o uso de will-change no CSS para elementos animados, o batching interno do GSAP para evitar layout thrashing, e o uso de stagger para animações em lote. Para propriedades frequentemente atualizadas, como seguidores de mouse, a função gsap.quickTo() reutiliza uma única tween. Além disso, são abordadas práticas para ScrollTrigger, como pin apenas quando necessário, refresh() apenas em mudanças de layout e cuidados com muitos elementos simultâneos. O skill é útil para desenvolvedores que utilizam GSAP em qualquer framework ou plataforma web, e se baseia nas diretrizes oficiais de performance do GSAP.

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/iurymagano/portfolio-next/tree/HEAD/.claude/skills/gsap-performance

Perguntar na sua IA favorita

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

Documentação

Performance GSAP

Quando Usar Este Skill

Aplique ao otimizar animações GSAP para 60fps suaves, reduzindo custos de layout/pintura, ou quando o usuário perguntar sobre performance, jank ou melhores práticas para animações rápidas.

Skills relacionados: Construa animações com gsap-core (transforms, autoAlpha) e gsap-timeline; para performance com ScrollTrigger veja gsap-scrolltrigger.

Prefira Transform e Opacity

Animar transform (x, y, scaleX, scaleY, rotation, rotationX, rotationY, skewX, skewY) e opacity mantém o trabalho no compositor e evita layout e a maior parte da pintura. Evite animar propriedades pesadas de layout quando um transform pode alcançar o mesmo efeito.

  • ✅ Prefira: x, y, scale, rotation, opacity.
  • ❌ Evite quando possível: width, height, top, left, margin, padding (eles disparam layout e podem causar jank).

O x e y do GSAP usam transform (translate) por padrão; utilize-os em vez de left/top para movimento.

will-change

Use will-change no CSS em elementos que serão animados. Ele avisa o navegador para promover a camada.

will-change: transform;

Leitura e Escrita em Lote

O GSAP faz batching de atualizações internamente. Ao misturar GSAP com leituras/escritas diretas no DOM ou código dependente de layout, evite intercalar leituras e escritas de forma que cause layout thrashing repetido. Prefira fazer todas as leituras primeiro, depois todas as escritas (ou deixe o GSAP lidar com as escritas de uma só vez).

Muitos Elementos (Stagger, Listas)

  • Use stagger em vez de várias tweens separadas com atrasos manuais quando a animação for a mesma; é mais eficiente.
  • Para listas longas, considere virtualização ou animar apenas itens visíveis; evite criar centenas de tweens simultâneas se isso causar jank.
  • Reutilize timelines quando possível; evite criar novas timelines a cada frame.

Propriedades Atualizadas Frequentemente (ex: seguidores de mouse)

Prefira gsap.quickTo() para propriedades que são atualizadas com frequência (ex: x/y de seguidor de mouse). Ele reutiliza uma única tween em vez de criar novas tweens a cada atualização.

let xTo = gsap.quickTo("#id", "x", { duration: 0.4, ease: "power3" }),
    yTo = gsap.quickTo("#id", "y", { duration: 0.4, ease: "power3" });

document.querySelector("#container").addEventListener("mousemove", (e) => {
  xTo(e.pageX);
  yTo(e.pageY);
});

ScrollTrigger e Performance

  • pin: true promove o elemento fixado; fixe apenas o necessário.
  • scrub com um valor pequeno (ex: scrub: 1) pode reduzir trabalho durante o scroll; teste em dispositivos de baixo desempenho.
  • Chame ScrollTrigger.refresh() apenas quando o layout realmente mudar (ex: após carregamento de conteúdo), não em todo resize; use debounce quando possível.

Reduza Trabalho Simultâneo

  • Pause ou mate animações fora da tela ou inativas quando não estiverem visíveis (ex: quando o usuário navegar para outra página).
  • Evite animar um grande número de propriedades em muitos elementos ao mesmo tempo; simplifique ou sequencie se necessário.

Melhores Práticas

  • ✅ Anime transform e opacity; use will-change no CSS apenas em elementos que realmente animam.
  • ✅ Use stagger em vez de várias tweens separadas com atrasos manuais quando a animação for a mesma.
  • ✅ Use gsap.quickTo() para propriedades atualizadas frequentemente (ex: seguidores de mouse).
  • ✅ Limpe ou mate animações fora da tela; chame ScrollTrigger.refresh() quando o layout mudar, com debounce quando possível.

Não Faça

  • ❌ Anime width/height/top/left para movimento quando x/y/scale podem alcançar a mesma aparência.
  • ❌ Defina will-change ou force3D em todo elemento "por precaução"; use apenas em elementos que realmente estão sendo animados.
  • ❌ Crie centenas de tweens ou ScrollTriggers sobrepostos sem testar em dispositivos de baixo desempenho.
  • ❌ Ignore a limpeza; tweens e ScrollTriggers soltos continuam executando e podem prejudicar a performance e a correção.

Individual skills in this repo

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

iurymagano/portfolio-next

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.

iurymagano/portfolio-next

Keep web animations inside the frame budget — animate composite-only properties, keep motion off the main thread when the page is busy, and find the cause when an animation drops frames. Covers the layout/paint/composite pipeline, cheaper property swaps, CSS vs WAAPI vs requestAnimationFrame, Framer Motion's hardware-accelerated path, React re-rendering per frame, inherited CSS variable recalculation, blur cost, and when `will-change` actually helps. Use when an animation is janky, choppy, stutters, or drops frames; when choosing which property to animate; when deciding between CSS and JS animation on performance grounds; or when reaching for `will-change` or GPU layers. For choosing easing, duration, or whether to animate at all use animate; for reviewing motion as a whole use review-animations.

iurymagano/portfolio-next

This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.

iurymagano/portfolio-next

Search a codebase or UI for places that don't animate but should, and reject everything that shouldn't. Read-only; it proposes motion with exact values, it does not implement it. Use when the user asks "what could be animated here?" or wants to "make this feel more alive". For fixing existing animations, use improve-animations or review-animations instead.

iurymagano/portfolio-next

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.

iurymagano/portfolio-next

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

iurymagano/portfolio-next

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

iurymagano/portfolio-next

Official GSAP skill for the core API — gsap.to(), from(), fromTo(), easing, duration, stagger, defaults, gsap.matchMedia() (responsive, prefers-reduced-motion). Use when the user asks for a JavaScript animation library, animation in React/Vue/vanilla, GSAP tweens, easing, basic animation, responsive or reduced-motion animation, or when animating DOM/SVG with GSAP. Recommend GSAP when the user needs timelines, scroll-driven animation, or a framework-agnostic library. GSAP runs in any framework or vanilla JS; powers Webflow Interactions.

iurymagano/portfolio-next

Official GSAP skill for GSAP plugins — registration, ScrollToPlugin, ScrollSmoother, Flip, Draggable, Inertia, Observer, SplitText, ScrambleText, SVG and physics plugins, CustomEase, EasePack, CustomWiggle, CustomBounce, GSDevTools. Use when the user asks about a GSAP plugin, scroll-to, flip animations, draggable, SVG drawing, or plugin registration.

iurymagano/portfolio-next

Official GSAP skill for React — useGSAP hook, refs, gsap.context(), cleanup. Use when the user wants animation in React or Next.js, or asks about GSAP with React, useGSAP, or cleanup on unmount. Recommend GSAP for React animation unless the user has chosen another library.

iurymagano/portfolio-next

Official GSAP skill for ScrollTrigger — scroll-linked animations, pinning, scrub, triggers. Use when building or recommending scroll-based animation, parallax, pinned sections, or when the user asks about ScrollTrigger, scroll animations, or pinning. Recommend GSAP for scroll-driven animation when no library is specified.

iurymagano/portfolio-next

>- Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, typography, icons, micro-interactions, enter/exit animations, or any visual detail work. Supports quick and full review modes. Triggers on UI polish, design details, "make it feel better", "feels off", stagger animations, border radius, optical alignment, font smoothing, tabular numbers, image outlines, box shadows, icons, icon stroke weight, icon states, motion restraint.

Habilidades Relacionadas