Communitygithub.com

hanimaru1121/animation-implementer

このスキルは、`ui-microinteraction-designer` で定義されたインタラクション仕様を、実際の実装にアニメーションとして組み込むためのブリッジです。各仕様に最適なライブラリ(簡易ホバーにはVanilla CSS、複雑なスクロール連携にはGSAP、ビューポート表示時にはAOS、ReactにはFramer Motion)を選択し、`prefers-reduced-motion` を常に尊重、かつ `transform`/`opacity` のみに制限して60fpsを達成します。

animation-implementer とは?

animation-implementerは、UIデザインで定義されたインタラクション(ホバー、スクロールリビール、パララックス、カウンター、スタガー、マグネティックボタン、マーキー等)を、実際のコードベースにアニメーションとして実装するためのスキルです。このスキルは、HTML/Next.jsの両方の実装パスをサポートし、各インタラクションタイプに最適なライブラリを自動選択します(例:シンプルなホバーにはVanilla CSS、ビューポートインリビールにはAOS、複雑なスクロール連携にはGSAP、ReactコンポーネントにはFramer Motion)。 このスキルの重要な特徴は、パフォーマンスとアクセシビリティに対する厳格な要件です。すべてのアニメーションは `transform` と `opacity` のみを使用し(GPUコンポジット可能なプロパティ)、60fpsを保証します。また、`prefers-reduced-motion` メディアクエリを全面的に尊重し、前庭障害を持つユーザーへの害を防止します。 入力として `interactions.json`(各インタラクションの仕様)、実装ファイル(HTMLまたはNext.js)、およびオプションでデザイントークンと情報アーキテクチャを受け取ります。処理後は、実装ログとパフォーマンス情報を含む `animation-report.json` を出力します。このスキルは `lp-maker` オーケストレーターのTier 4で使用され、アニメーションの実装が完了すると、`performance-optimizer`、`a11y-auditor`、`cross-browser-tester` などの後続スキルに引き継がれます。

対応✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/hanimaru1121/claude-skills/tree/HEAD/plugins/lp-maker/skills/animation-implementer

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

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

ドキュメント

animation-implementer は何をしますか?

このスキルは、意図とモーションの間の橋渡しを行います。ui-microinteraction-designer は、すべてのインタラクション(ホバーリフト、スクロールリビール、パララックス、カウンター、スタガー、マグネティックボタン、マーキーなど)の仕様を、モーションパラメータ(duration、easing、distance、trigger)と共に生成しました。lp-coder-html / lp-coder-nextjs はベースラインのJS実装を提供しましたが、最も単純なインタラクションのみであり、複雑な連携には本格的なライブラリが必要です。このスキルは、各仕様に適したライブラリを選び、実装し、ページが prefers-reduced-motion を尊重し、transform/opacity(GPUがレイアウトの再計算なしにコンポジットできる唯一のCSSプロパティであり、width、height、top、left、margin のアニメーションはフレームごとにリフローを引き起こしfpsを低下させます)のみをアニメーション化することを確認します。

ライブラリの選定:

  • Vanilla CSS: ホバー/フォーカスおよび単純なトランジション向け(依存関係ゼロ、最速)
  • AOS: シンプルな「セクションがビューポートに入ったときにフェードアップ」向け(約3KB、簡単導入)
  • GSAP: 複雑なスクロール連携やタイムラインオーケストレーション向け(最も強力、約30KBだが、必要な場合には価値がある)
  • Framer Motion: Next.jsパスでのReact Client Components向け(宣言的、React状態と統合、約50KBだが、コンポーネントライフサイクルを尊重するReactアニメーションには必須)

このスキルを使用するタイミング

以下の場合にこのスキルを実行します:

  • lp-workspace/03-design/interactions.json が存在する
  • lp-workspace/04-implementation/html/ または nextjs/ に実装が存在する
  • オーケストレーターが lp-coder-* の後、Tier 4 に到達した
  • ユーザーが「アニメーション実装して」/「wire up animations」/「GSAP入れて」/「scroll reveal を動かして」と言った

以下の場合にはこのスキルを使用しません:

  • interactions.json が存在しない — 先に ui-microinteraction-designer にルーティング
  • 実装が存在しない — 先に lp-coder-* にルーティング
  • ユーザーが新しいインタラクションをデザインしたい場合(それは ui-microinteraction-designer の役割)
  • ユーザーがアクセシビリティ監査のみを希望する場合(a11y-auditor にルーティング)

入力

必須:

  1. lp-workspace/03-design/interactions.json — インタラクションごとの仕様。各項目には id、target(セレクタまたはセクションID)、type(例:"fade-up"、"parallax"、"hover-lift"、"counter"、"stagger")、library(推奨)、モーションパラメータ(duration、easing、distance、delay、trigger)を含める必要があります。理由:このスキルは実装を行い、モーションを再設計しません。
  2. lp-workspace/04-implementation/html/ または nextjs/ — 編集するファイル。

オプション: 3. lp-workspace/03-design/design-tokens.json — モーショントークン(イージングカーブ、durationスケール)用。 4. lp-workspace/02-strategy/ia.json — ターゲットを解決するためのセクションID。

必須入力のいずれかが欠落している場合は、処理を中断します:

アニメーション実装には以下が必要です:
- lp-workspace/03-design/interactions.json [✓ または 不足 → ui-microinteraction-designer]
- lp-workspace/04-implementation/html/ or nextjs/ [✓ または 不足 → lp-coder-html or lp-coder-nextjs]

プロセス

ステップ1. 上流を検証し、ターゲットを検出

interactions.json を読み取ります。実装がHTML(04-implementation/html/index.html が存在する)かNext.js(04-implementation/nextjs/app/page.tsx が存在する)かを検出します。対応するコードパスを選択します。

ステップ2. インタラクションごとにライブラリを決定

interactions.json の各インタラクションについて、以下の表に従ってライブラリを選択します:

インタラクションタイプHTMLターゲット → ライブラリNext.jsターゲット → ライブラリ
hover-lift、hover-tilt、focus-glow、button-pressVanilla CSS(:hover、:focus-visible)Tailwindユーティリティを使用したVanilla CSS
ビューポート進入時の fade-up、fade-in、slide-upAOS(data-aos="fade-up")Framer Motion whileInView
ビューポート進入時の stagger-childrenGSAP ScrollTriggerFramer Motion variants + stagger
parallax、scrub、pin(スクロール駆動の連携)GSAP ScrollTriggerGSAP ScrollTrigger(Client Component)
counter(0 → 目標数値)Vanilla JS IntersectionObserver + rAFVanilla JS または Framer Motion animate()
marquee、infinite-scrollVanilla CSS @keyframes(低負荷)Vanilla CSS
magnetic-button、カーソルエフェクトVanilla JS(小規模)Vanilla JS
page-load entranceVanilla CSS + 小規模なJSクラス切り替えレイアウトレベルのFramer Motion
複雑なタイムライン(シーケンシャル、連携)GSAP タイムラインGSAP タイムライン(Client Component)

仕様に既に library が指定されている場合は、プラットフォームと競合しない限りそれを使用します(例:ReactでのAOS — Framer Motion相当に置き換え、レポートに記載)。

理由: すべてのライブラリはバイト数と学習曲線を増加させます。ホバーエフェクトにライブラリは不要です。リビールは小さなライブラリ1つで実行できます。複雑な連携だけがGSAPを正当化します。

ステップ3. ライブラリのインストールまたは配線

HTMLパス:

  • AOS: CDN経由で <head> に追加:
    <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/aos.css">
    <script src="https://unpkg.com/[email protected]/dist/aos.js" defer></script>
    
    scripts/main.js の最後で初期化:
    AOS.init({
      duration: 600,
      easing: 'ease-out',
      once: true,
      disable: () => window.matchMedia('(prefers-reduced-motion: reduce)').matches,
    });
    
  • GSAP: CDN経由:
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js" defer></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ScrollTrigger.min.js" defer></script>
    
    scripts/main.js で登録して使用:
    if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
      gsap.registerPlugin(ScrollTrigger);
      // ...タイムライン
    }
    

Next.jsパス:

  • Framer Motion: lp-coder-nextjs により package.json に既に存在します。インタラクションプリミティブを components/interactions/ にラップします。
  • GSAP: package.json に追加(gsap)、Client Components('use client')内で使用し、useEffect 内でScrollTriggerを登録してクライアントサイドでのみ実行されるようにします。
  • AOS: Next.jsでは避けます — 代わりにFramer Motion whileInView を使用します。

ステップ4. 各仕様を実装

各インタラクションについて、適切なファイルを編集します。例:

カードのホバーリフト(HTML、Vanilla CSS):

<!-- 変更前 -->
<article class="bg-white rounded-lg shadow-md p-6">
<!-- 変更後 -->
<article class="bg-white rounded-lg shadow-md p-6 transition-transform transition-shadow duration-200 ease-out hover:-translate-y-1 hover:shadow-lg motion-reduce:hover:transform-none motion-reduce:hover:shadow-md">

理由 motion-reduce: バリアント: Tailwindには標準でこれらが含まれており、ユーザーが動きの低減を希望する場合にモーションを無効にします。個別のCSSのメディアクエリよりもクリーンです。

ビューポート進入時のフェードアップ(HTML、AOS):

<section id="benefits" data-aos="fade-up" data-aos-delay="0">
  <div data-aos="fade-up" data-aos-delay="100">...</div>
  <div data-aos="fade-up" data-aos-delay="200">...</div>
</section>

スタガーリビール(HTML、GSAP):

if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
  gsap.from('#benefits .benefit-card', {
    scrollTrigger: { trigger: '#benefits', start: 'top 80%' },
    opacity: 0,
    y: 24,
    duration: 0.6,
    stagger: 0.08,
    ease: 'power2.out',
  });
}

ヒーロー画像のパララックス(HTML、GSAP):

if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
  gsap.to('#hero img', {
    scrollTrigger: {
      trigger: '#hero',
      start: 'top top',
      end: 'bottom top',
      scrub: true,
    },
    yPercent: 30,
    ease: 'none',
  });
}

カウンター(HTML、Vanilla):

function animateCounter(el, target, duration = 1200) {
  if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
    el.textContent = String(target);
    return;
  }
  const start = performance.now();
  function tick(now) {
    const t = Math.min(1, (now - start) / duration);
    el.textContent = Math.round(target * (1 - Math.pow(1 - t, 3))).toString();
    if (t < 1) requestAnimationFrame(tick);
  }
  requestAnimationFrame(tick);
}
const io = new IntersectionObserver((entries) => {
  for (const e of entries) {
    if (e.isIntersecting) {
      animateCounter(e.target, parseInt(e.target.dataset.counter || '0'));
      io.unobserve(e.target);
    }
  }
});
document.querySelectorAll('[data-counter]').forEach((el) => io.observe(el));

リビールラッパー(Next.js、Framer Motion):

'use client';
import { motion, useReducedMotion } from 'framer-motion';
import { ReactNode } from 'react';

export function Reveal({ children, delay = 0 }: { children: ReactNode; delay?: number }) {
  const reduced = useReducedMotion();
  if (reduced) return <>{children}</>;
  return (
    <motion.div
      initial={{ opacity: 0, y: 24 }}
      whileInView={{ opacity: 1, y: 0 }}
      viewport={{ once: true, margin: '-10%' }}
      transition={{ duration: 0.5, delay, ease: [0.2, 0.8, 0.2, 1] }}
    >
      {children}
    </motion.div>
  );
}

ステップ5. 60fpsの規律を徹底

すべてのアニメーションについて、以下を確認します:

  • アニメーション化されるCSSプロパティは transform(translate、scale、rotate、skew)または opacity のみ であること。width、height、top、left、right、bottom、margin、padding、font-size、border-radius は絶対に使用しない。理由:transform と opacity のみが、レイアウトやペイントを再実行せずにGPUでコンポジットできます。その他のプロパティはフレームごとにリフローを引き起こします。
  • will-change: transform, opacity は、激しいアニメーションが実行される場所にのみ追加し、完了後に削除する(will-change は要素ごとにレイヤーを割り当てるため、ページ全体に乱用しない)。
  • スクロール駆動アニメーションに scroll イベントリスナーを使用しない — IntersectionObserver または GSAP ScrollTrigger を使用する。
  • フレームアニメーションに setInterval を使用しない — requestAnimationFrame を使用する。

仕様でコンポジット不可能なプロパティのアニメーションが必要な場合(例:アコーディオン展開のための height のアニメーション)、代わりに transform: scaleY() + transform-origin: top を使用し、外側のレイアウトを調整するか、コストを受け入れてフラグを立てます。

ステップ6. すべての場所で prefers-reduced-motion を尊重

これは譲歩できません:

  • WCAG 2.3.3:ユーザーのモーション設定は尊重されなければなりません。
  • CSS駆動のアニメーションにはTailwindの motion-reduce: バリアント。
  • JSアニメーションの周りに window.matchMedia('(prefers-reduced-motion: reduce)') ガード。
  • AOS の disable コールバックをメディアクエリに設定。
  • Framer Motion の useReducedMotion() フック。
  • GSAP:タイムラインをメディアクエリガードでラップ。

理由(ゼロトレランス): 前庭障害を持つユーザーは、パララックスや激しい動きによって物理的に吐き気を催す可能性があります。これは洗練項目ではなく、危害の軽減です。

ステップ7. リグレッションがないことを確認

編集後毎に:

  • console.error が新たに導入されていないことを確認(例:GSAPプラグイン未登録)。
  • JSなしでもページが機能することを確認(静的HTMLが同じペイントに到達する)。
  • フォーカス、FAQ、フォーム、ナビゲーションが引き続き機能することを確認。
  • 重要なCSSパスが大幅に増加していないことを確認。

ステップ8. アニケーションレポートを作成

lp-workspace/05-optimization/animation-report.json を作成:

{
  "implementedAt": "2026-05-29T..",
  "platform": "html",
  "interactionsImplemented": 12,
  "librariesUsed": {
    "vanilla-css": 5,
    "aos": 4,
    "gsap": 3,
    "framer-motion": 0
  },
  "items": [
    {
      "id": "hero-headline-fade",
      "type": "fade-up",
      "target": "#hero h1",
      "library": "aos",
      "params": { "duration": 600, "easing": "ease-out", "delay": 0 },
      "status": "implemented",
      "compositableOnly": true,
      "reducedMotionRespected": true
    }
    // ...インタラクションごとに1エントリ
  ],
  "warnings": [
    {
      "id": "accordion-expand",
      "issue": "仕様で height アニメーションが要求されましたが、60fpsのために scaleY に置き換えました",
      "decision": "自動置き換え"
    }
  ]
}

lp-workspace/05-optimization/ が存在することを確認します。以前のレポートは .backup にバックアップします。

ステップ9. 報告

アニメーション実装が完了しました:
実装件数: [N] 件
使用ライブラリ:
- Vanilla CSS: [N] 件 (hover, focus)
- AOS: [N] 件 (in-view fade)
- GSAP ScrollTrigger: [N] 件 (parallax, stagger choreography)
- (Next.jsの場合) Framer Motion: [N] 件
prefers-reduced-motion: 全件で尊重
60fpsチェック: transform/opacity のみで構成

修正ファイル: lp-workspace/04-implementation/{html or nextjs}/
レポート: lp-workspace/05-optimization/animation-report.json

次のステップ: performance-optimizer / a11y-auditor / cross-browser-tester

出力

変更されたファイル: lp-workspace/04-implementation/html/* または lp-workspace/04-implementation/nextjs/**/*(アニメーションを配線するための直接編集)。

作成されたファイル: lp-workspace/05-optimization/animation-report.json — 仕様ごとの実装ログ。

品質チェック

完了と宣言する前に:

  • interactions.json のすべてのインタラクションが実装されているか、理由とともにフラグが立てられている
  • すべてのアニメーションが transform および/または opacity のみをターゲットにしている(width、height、top、left などは不可)
  • prefers-reduced-motion: reduce が、すべてのJSアニメーション、AOS初期化、GSAPタイムライン、Framer Motionコンポーネント(またはTailwind motion-reduce: バリアント経由)で尊重されている
  • scroll イベントリスナーがない(IntersectionObserverまたはScrollTriggerを使用)
  • アニメーションに setInterval がない(requestAnimationFrame を使用)
  • will-change が控えめに設定されている(アクティブにアニメーションしている要素のみ、完了時に削除)
  • 新しいコンソールエラーが導入されていない
  • FAQ、フォーム、ナビゲーション、フォーカスリングが引き続き機能する
  • ライブラリスクリプトが遅延ロードされている(HTMLでは defer 属性、Reactでは 'use client')
  • レポートJSONが有効で、仕様ごとに1エントリある

いずれかのチェックが失敗した場合、成功を報告せず、修正してください。

リファレンス

  • ${CLAUDE_PLUGIN_ROOT}/skills/lp-maker/references/workspace-schema.md
  • skills/ui-microinteraction-designer/SKILL.md — 上流;仕様のソース
  • skills/lp-coder-html/SKILL.md、skills/lp-coder-nextjs/SKILL.md — 上流;変更されるコード
  • skills/responsive-optimizer/SKILL.md — 兄弟スキル
  • skills/a11y-auditor/SKILL.md — 兄弟スキル;動きの低減の尊重を検証
  • skills/performance-optimizer/SKILL.md — 下流;Core Web Vitalsへの影響を測定

Individual skills in this repo

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

hanimaru1121/image-asset-generator

This skill should be used when the user wants the actual image files for the landing page generated and placed in the implementation folder — based on the specs from `image-asset-planner`. If the user has an image generation MCP (DALL-E, Imagen, Stable Diffusion, Midjourney bridge) it calls that; otherwise produces a usable placeholder (labeled SVG with correct dimensions, or a CSS gradient with text). Triggers include "画像生成して", "画像を作って", "ヒーロー画像", "OG画像作成", "generate images", "create hero image", "make placeholder images", "image assets", "画像アセット", or when the orchestrator (`lp-maker`) reaches Tier 4. Note that founder/customer/real-person portraits MUST NOT be AI-generated and are flagged for the user to provide real photos. Make sure to use this skill whenever the LP has image slots that need files, so `lp-coder-*` can reference real paths.

hanimaru1121/image-asset-planner

This skill should be used when the user wants a complete spec list of every image, illustration, and icon the LP needs — file names, exact dimensions (1x/2x/3x), formats, purposes, alt text, and ready-to-paste generative-AI prompts for Midjourney/DALL·E/Imagen/Adobe Firefly. Triggers include "画像仕様", "image plan", "画像リスト", "画像プロンプト", "AI画像", "Midjourneyプロンプト", "image spec", "what images do we need", "ヒーロー画像どうする", "アイコン仕様", or when the orchestrator (`lp-maker`) reaches Tier 3 Step 4. It reads `02-strategy/ia.json`, `02-strategy/copy.json`, and `03-design/design-tokens.json`, and writes `03-design/image-spec.json`. Make sure to use this skill BEFORE `image-asset-generator` in Tier 4 — without specs, generation is random and brand-inconsistent. Every needed image is enumerated so generation can be batched.

hanimaru1121/visual-mockup-designer

This skill should be used when the user wants a high-fidelity, openable HTML+Tailwind mockup of the entire landing page — colors applied from design tokens, real copy from `copy.json`, placeholder images sized correctly, and all sections from IA visible end-to-end. Triggers include "モックアップ", "mockup", "モックアップ作って", "プレビュー", "preview", "high-fidelity comp", "デザインカンプ", "デザイン案", "ビジュアル案見せて", or when the orchestrator (`lp-maker`) reaches Tier 3 Step 3. It reads `03-design/design-tokens.json`, `03-design/wireframe.svg`, `02-strategy/copy.json`, and `02-strategy/ia.json`, and writes a single-file `03-design/mockup.html` (CDN Tailwind, no build step) the user can open in any browser. This is NOT the final shippable code — it's a designed comp. Animations and interactions are marked with HTML comments for `ui-microinteraction-designer` and `animation-implementer` downstream. Make sure to use this skill whenever the user wants to "see what the LP would look like" BEFORE committing to production

関連スキル