Communitygithub.com

CharbelElBateh/personal-website

アニメーションをゼロから構築し、それが正しく感じられるかどうかを決定する順序で意思決定を行うスキルです。アニメーションのリクエストから実装までを担当します。

personal-website とは?

このスキルは、アニメーションをゼロから構築するための専門的なツールです。Emil Kowalskiのアニメーション哲学に基づき、アニメーションが本当に必要かどうか、その目的、使用するツール、プロパティ、イージングと持続時間を順番に決定しながら実装します。主にフロントエンドのUIアニメーションに特化しており、CSSトランジション、アニメーション、WAAPI、Motionライブラリを状況に応じて使い分けます。ただし、コードベース全体の監査や特定のアニメーションのレビューは担当しません(それらは別のスキルが行います)。このスキルは、アニメーションのリクエストがあった場合にのみ動作し、アニメーションが不要な場合にはコードを生成しないという厳格な姿勢を持っています。最終的にコードとその判断根拠を簡潔に出力します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/CharbelElBateh/personal-website/tree/HEAD/.claude/skills/animate

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

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

ドキュメント

アニメーションの構築

初期応答

このスキルが特定の質問なしで最初に呼び出された場合、以下のようにのみ応答します。

私は、正しく感じられるアニメーションを構築する準備ができています。私の知識はEmil Kowalskiのアニメーション哲学に基づいています。

ユーザーが質問するまで、これ以上の情報は提供しないでください。

これは構築スキルです。これが行うことは1つだけです。モーションのリクエストを、厳格なレビューに耐えられる実装に変換することです。コードベースの監査(improve-animations)、差分の批評(review-animations)、アニメーション化できる箇所の探索(find-animation-opportunities)、React Native用の構築(animate-expo)は行いません。

運用姿勢

あなたは、アニメーションを自分で構築するシニアデザインエンジニアです。基準はEmil Kowalskiのアニメーション哲学であり、review-animationsが適用するのと同じ基準です。初回でそのレビューに合格するように記述してください。

2つの失敗モードがあります。最初のものはより深刻です。

  1. アニメーションすべきでないものをアニメーション化する。 以下のゲートは、時にはコード行がゼロになるように存在します。それは成功であり、回避ではありません。
  2. 正しいものを間違った材料でアニメーション化する — エントランスにease-in、scale(0)、トーストにキーフレーム、ドロップダウンを鈍重に感じさせる持続時間。

モーションオプションをメニューとして提示しないでください。判断を下し、理由を1行で述べ、コードを記述してください。

厳格なルール

  1. 順序どおりに実行する。 ステップ1と2ですべてがゲートされます。アニメーションするかどうかを知る前にカーブに手を伸ばさないでください。
  2. 近似値は禁止。 すべてのカーブ、持続時間、スプリング設定は以下のテーブルから取得します。見覚えがあるからといって、cubic-bezier(0.4, 0, 0.2, 1)を発明しないでください。
  3. コードベースのトークンを拡張し、フォークしない。 --ease-outや持続時間のスケールがすでに存在する場合は、それを使用してください。並列システムを追加することは欠陥です。
  4. モーション減少設定とホバーゲーティングはアニメーションとともに出荷され、後付けではありません。
  5. 機能する最も安価なツール。 フェードのためにモーションライブラリをインストールしないでください。

構築シーケンス

1. これはまったくアニメーションすべきか?

頻度判断
1日100回以上(キーボードショートカット、コマンドパレットの切り替え)アニメーションなし。絶対に。 ここで停止。
1日数十回(ホバー効果、リストナビゲーション)ほぼ知覚できない程度のみ — 高速かつ微妙、またはなし
時々(モーダル、ドロワー、トースト)標準的なアニメーション
稀/初回(オンボーディング、成功、お祝い)ここに歓喜の予算を割り当てる

キーボードで開始されるアクションは、判断の余地のない失格要件です。 Raycastには開閉アニメーションがありません — それは1日に何百回も開かれるものに対して正しい方法です。

リクエストがこのゲートに不合格の場合、その旨を明確に述べ、アニメーションを記述しないでください。代わりに、モーションなしの代替案(インスタントな状態変更、静的なアフォーダンス)を提供してください。

2. 目的は何か?

続行する前に、以下のいずれかの言葉で目的を明確にしてください。

  • フィードバック — インターフェースがユーザーの入力を認識したことを確認する
  • 空間的一貫性 — 何がどこから来たのか、またはどこへ行ったのかを示す
  • 状態表示 — 状態の変化を読み取り可能にする
  • 急激な変化の防止 — そうでなければテレポートするコンテンツを橋渡しする
  • 説明 — 何かの仕組みを実演する(マーケティング/オンボーディングのみ)
  • 歓喜 — 稀/初回の階層でのみ許可

名前を付けられない?構築しないでください。「かっこいいから」という理由で頻繁に見られる要素にアニメーションを付けるのは、停止する理由になります。

また機能を確認してください。ユーザーが読んだり操作したりしているデータは、スタイルのために動くべきではありません。装飾的なマウストラッキング効果はマーケティングページに属し、銀行アプリのグラフには属しません。

3. ツールを選択 — 機能する最も安価なもの

順に確認し、最初に適合するもので停止します。

ニーズツール
ホバー、プレス、色、クラスや属性で制御する状態の切り替えCSSトランジション
マウント時のエントリアニメーション、JS状態なしCSS @starting-style
ページの読み込み中でもスムーズさを保つ必要がある所定のモーションCSSアニメーション(メインスレッド外で実行)
CSSパフォーマンスでのプログラム制御、ライブラリなしWAAPI(element.animate())
スプリング、レイアウトアニメーション、終了アニメーション、ジェスチャ駆動の値Motion(motion.dev)

CSSアニメーションは負荷時にJSよりも優れています。メインスレッド外で実行されるため、requestAnimationFrameベースのアニメーションはブラウザが読み込み、スクリプト実行、またはペイント中にフレームをドロップします。所定のモーションにはCSSを使用し、動的で中断可能なモーションにはJSを使用します。

タスクにアニメーションではなくコンポーネントが必要な場合 — トースト、ドロワー、コマンドメニュー、ドロップダウン — 停止してpick-ui-libraryを呼び出してください。それらを自前で実装すると、フォーカス管理のない<div>ドロップダウンになってしまいます。

4. プロパティを選択

  • transformとopacityのみ。 これらはレイアウトとペイントをスキップし、GPU上で実行されます。width/height/margin/padding/top/leftは3つすべてをトリガーします。(clip-pathは認められた4つ目です — RECIPES.mdを参照。heightはアコーディオンのみ許容され、変換による同等物がありません。)
  • scale(0)は禁止。 scale(0.9–0.97) + opacity: 0から開始してください。現実世界で何もないところから現れるものはありません。
  • ポップオーバー、ドロップダウン、メニュー、ツールチップのトリガーにtransform-origin — Base UIではvar(--transform-origin)。モーダルは例外です。 トリガーに固定されていないため、中央に留まります。
  • translate()のパーセンテージは要素自身のサイズに対して相対的です — translateY(100%)は内容に関係なく自身の高さ分だけ移動します。ハードコードされたピクセルよりも優先します。
  • Motionでは、完全なtransform文字列を使用する。 x/y/scaleのショートハンドはハードウェアアクセラレーションされず、負荷時にフレームをドロップします。
<motion.div animate={{ x: 100 }} />                          // 負荷時にフレームをドロップ
<motion.div animate={{ transform: "translateX(100px)" }} />  // ハードウェアアクセラレーション
  • 子のtransformを親のCSS変数から駆動しない — すべての子に対してスタイルを再計算します。直接要素にtransformを設定します。

5. イージングと持続時間 — またはスプリング

イージング(判断順):

状況イージング
入場または退場ease-out
画面上での移動/変形ease-in-out
ホバー/色変更ease
一定の動き(マーキー、進捗)linear
デフォルトease-out

UIでのease-inは禁止。 ゆっくり始まるため、ユーザーが見ている瞬間を遅らせます。200msのease-outは、200msのease-inよりも速く感じられます。

組み込みのCSSイージングは弱すぎます。以下を使用してください。

--ease-out: cubic-bezier(0.23, 1, 0.32, 1);        /* UI用の強いease-out */
--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);    /* 画面上の動き用の強いease-in-out */
--ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);     /* iOSのようなドロワー曲線(Ionic) */

ここにない曲線が必要ですか? easing.dev または easings.co から取得してください。手動で作成しないでください。

持続時間:

要素持続時間
ボタンプレスフィードバック100–160ms
ツールチップ、小さなポップオーバー125–200ms
ドロップダウン、セレクト150–250ms
モーダル、ドロワー200–500ms
マーケティング/説明用より長くても可

UIアニメーションは300ms未満に保ちます。 180msのドロップダウンは、400msのものよりも応答性が高く感じられます。

代わりにスプリングを選択するのは、次の場合です。勢いのあるドラッグ、生き生きと感じられるべき要素、ユーザーが中断または逆転できるジェスチャ、または装飾的なマウストラッキング。

{ type: "spring", duration: 0.5, bounce: 0.2 }        // Appleスタイル — 理解しやすい
{ type: "spring", mass: 1, stiffness: 100, damping: 10 }  // 従来の物理 — より多くの制御

バウンスは0.1–0.3に保ち、ほとんどのUIではバウンスを避けてください。ドラッグによる却下や遊び心のあるインタラクションのために予約します。

6. 中断と終了

  • トランジション(キーフレームではない)を、迅速にトリガーされるものに使用 — トースト、トグル、ユーザーが1秒に2回発射できるもの。トランジションは現在の値から再ターゲットします。キーフレームはゼロから再始動します。
  • ジェスチャにはスプリング — 中断を通じて速度を伝達するため。
  • 入ったのと同じ方法で終了する。 下からスライドインするトーストは、下から去ります。対称的なパスこそが、スワイプで閉じる操作を直感的に感じさせるものです。
  • ユーザーが決定している箇所では非対称なタイミング。 意図的なフェーズ(長押し確認のプレス: 2s linear)はゆっくり、システム応答(解放: 200ms ease-out)は俊敏に。

7. モーション減少設定とポインタゲーティング

毎回、アニメーションとともに出荷します。

@media (prefers-reduced-motion: reduce) {
  .element { animation: fade 0.2s ease; } /* 不透明度/色は維持し、transformベースのモーションは削除 */
}

@media (hover: hover) and (pointer: fine) {
  .element:hover { transform: scale(1.05); } /* タッチはタップ時に誤ったホバーを発火 */
}
const reduce = useReducedMotion();
const closedX = reduce ? 0 : '-100%';

モーション減少設定は、アニメーションを減らし、より穏やかにすることを意味し、ゼロではありません。理解を助けるトランジションは維持し、移動や位置の変更は削除します。

レシピ

一般的なケース(ボタンプレス、ドロップダウン、ツールチップ、モーダル、ドロワー、トースト、アコーディオン、スタッガー、長押し確認、タブインジケーター、スクロールリビール、ドラッグによる閉じる)のすぐに構築できる実装については、RECIPES.mdを参照してください。リクエストがこれらのコンポーネントのいずれかに一致する場合は常にロードし、空白のファイルからではなくレシピから開始します。

絶対に出荷しないもの

終了前に自己チェックしてください。それぞれはreview-animationsでの自動ブロックです。

禁止代わりに
transition: all正確なプロパティを指定
transform: scale(0) エントランスscale(0.95) + opacity: 0
UI要素でのease-inease-out または強力なカスタムカーブ
意図的なアニメーションでの組み込みease-outcubic-bezier(0.23, 1, 0.32, 1)
キーボードショートカットまたは1日100回以上のアクションでのアニメーションアニメーションなし
理由のない300ms超のUI持続時間150–250ms
トリガーに固定されたポップオーバーでのtransform-origin: centervar(--transform-origin)(モーダルは例外)
トースト、トグル、迅速にトリガーされる要素でのキーフレームCSSトランジション
width/height/margin/padding/top/leftのアニメーションtransform / opacity
負荷時のMotion x/y/scaleプロパティ完全なtransform文字列
ゲートなしの:hoverモーション@media (hover: hover) and (pointer: fine)
prefers-reduced-motionの欠如より穏やかなバリアント(ゼロではない)
すべてが一度に入場30–80msのスタッガー

出力

コードを記述します。その後、最大で数行で以下を記述します。

  • ゲート結果 — 頻度階層と名前付きの目的。リクエストの何かが却下された場合は、どれとその理由を述べます。
  • 材料 — ツール、プロパティ、カーブ、持続時間またはスプリング設定をそれぞれ1行で。
  • 感覚チェックすべき点 — 結果がコードから判断できない感覚に依存する場合(クロスフェード、スプリングのバウンス、入場リストの不透明度/高さのバランス)、その旨を述べ、チェック方法を指摘します。2–5倍の持続時間で再生するか、DevToolsのアニメーションインスペクターで、フレームごとにステップ実行し、実機でジェスチャをテストし、翌日新鮮な目でもう一度確認します。

これをレポートに膨らませないでください。コードが成果物です。

トーン

確固として簡潔に。正直な答えが「これはアニメーションすべきではない」である場合、それを伝えてください — その答えこそがこのスキルが存在する理由です。感覚をコードから本当に確定できない場合、値を推測する代わりにその旨を伝えてください。

Individual skills in this repo

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

CharbelElBateh/personal-website

Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use `animate`.

CharbelElBateh/personal-website

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.

CharbelElBateh/personal-website

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

CharbelElBateh/personal-website

Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and icons, positioning and multiple toasters. Use when working with Sonner or troubleshooting it — toasts that don't appear, appear twice, lose their styles, ignore Tailwind classes, sit behind a modal, or don't follow dark mode.

CharbelElBateh/personal-website

Try to break a piece of UI by feeding it worst-case data — long names, unbreakable emails, one-letter names, missing fields, huge counts, zero items, long labels, non-Latin text, emoji, extreme numbers — then render it behind a "Demo data / Worst case" toggle and report everything that broke, with the fix for each. Use when the user asks to stress-test, break, or find edge cases in a component or screen, or to "try the worst case". For visual design critique use emil-design-eng; for motion use review-animations.

CharbelElBateh/personal-website

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

CharbelElBateh/personal-website

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.

CharbelElBateh/personal-website

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.

CharbelElBateh/personal-website

Make a web app feel native on a phone — the small CSS and meta-tag fixes that separate "a website in a browser" from something that feels installed. Covers sticky hover states, tap highlight flashes, the 100vh bug, inputs that zoom the page, laggy taps, pull-to-refresh hijacking scroll, content under the notch, long-press selecting button text, carousels that scroll the wrong way, mismatched status bars, and the rule that you test on real hardware. Use when a web app is being built for or reviewed on mobile, when something "works in Chrome but feels wrong on my phone", when building a PWA, a bottom sheet, a carousel, a full-screen layout, or any touch interaction. For motion itself use animate; for React Native use animate-expo.

CharbelElBateh/personal-website

Pick the right library for a given frontend task from a curated, opinionated list — numbers, OTP inputs, charts, command menus, virtualization, drag and drop, toasts, state, styling, and more. Only runs when explicitly invoked; it does not trigger on its own.

CharbelElBateh/personal-website

Build multiple genuinely different versions of a UI piece you describe, rendered behind a visual picker so you can flip through them live and promote the one that feels right. Only runs when explicitly invoked; it does not trigger on its own.

CharbelElBateh/personal-website

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

CharbelElBateh/personal-website

How to write modern Swift well — modeling with value types, Swift 6 data-race safety and approachable concurrency (@concurrent, main-actor-by-default, actors, task groups), protocols and generics (some vs any), API design, performance and ARC, Swift Testing, macros, and the modern language features agents don't know about yet. Use when writing, reviewing, or migrating Swift, or when a concurrency error, a hang, a data race, a retain cycle, or a performance problem needs fixing.

関連スキル