Communitygithub.com

anubhavg-icpl/vibe

React、Next.js、TypeScript、Tailwind CSS アプリケーションのフロントエンド開発スキル。React コンポーネントの構築、Next.js のパフォーマンス最適化、バンドルサイズ分析、フロントエンドプロジェクトのスキャフォールディング、アクセシビリティの実装、コード品質のレビューに使用します。

vibe とは?

このスキルは、React/Next.js アプリケーションのフロントエンド開発において、プロジェクトのスキャフォールディング、コンポーネント生成、バンドル分析、パフォーマンス最適化、アクセシビリティ対応、テスト戦略などを包括的に支援します。開発者は、Next.js や React の新規プロジェクトを、TypeScript、Tailwind CSS、およびベストプラクティス設定で素早く生成できます。コンポーネント生成機能では、テストやStorybookストーリーを含む、型安全なReactコンポーネントやカスタムフックを自動生成できます。バンドル分析では、`package.json`を解析して重い依存関係を特定し、代替案を提案します。Next.jsに特化した最適化ガイドでは、Server/Client Componentsの使い分け、画像最適化、データフェッチングパターンなどを詳述しています。このスキルは、Claude Code、Cursor、CodexなどのAIエージェントと連携し、一貫性のある高品質なフロントエンドコードを生成するための強力なツールセットを提供します。

対応~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/anubhavg-icpl/vibe/tree/HEAD/skills/rezvani-senior-frontend

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

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

ドキュメント

シニアフロントエンド

React/Next.js アプリケーションのためのフロントエンド開発パターン、パフォーマンス最適化、自動化ツール。

目次


プロジェクトスキャフォールディング

TypeScript、Tailwind CSS、ベストプラクティス設定を備えた新しい Next.js または React プロジェクトを生成します。

ワークフロー: 新しいフロントエンドプロジェクトの作成

  1. プロジェクト名とテンプレートを指定してスキャフォルダーを実行します:

    python scripts/frontend_scaffolder.py my-app --template nextjs
    
  2. オプション機能(認証、API、フォーム、テスト、Storybook)を追加します:

    python scripts/frontend_scaffolder.py dashboard --template nextjs --features auth,api
    
  3. プロジェクトディレクトリに移動して依存関係をインストールします:

    cd my-app && npm install
    
  4. 開発サーバーを起動します:

    npm run dev
    

スキャフォルダーオプション

オプション説明
--template nextjsApp Router と Server Components を備えた Next.js 14+
--template reactReact + Vite with TypeScript
--features authNextAuth.js 認証を追加
--features apiReact Query + API クライアントを追加
--features formsReact Hook Form + Zod バリデーションを追加
--features testingVitest + Testing Library を追加
--dry-runファイルを作成せずにプレビュー

生成される構造(Next.js)

my-app/
├── app/
│   ├── layout.tsx        # フォントを含むルートレイアウト
│   ├── page.tsx          # ホームページ
│   ├── globals.css       # Tailwind + CSS 変数
│   └── api/health/route.ts
├── components/
│   ├── ui/               # Button, Input, Card
│   └── layout/           # Header, Footer, Sidebar
├── hooks/                # useDebounce, useLocalStorage
├── lib/                  # utils (cn), constants
├── types/                # TypeScript インターフェース
├── tailwind.config.ts
├── next.config.js
└── package.json

コンポーネント生成

TypeScript、テスト、Storybook ストーリーを備えた React コンポーネントを生成します。

ワークフロー: 新しいコンポーネントの作成

  1. クライアントコンポーネントを生成します:

    python scripts/component_generator.py Button --dir src/components/ui
    
  2. サーバーコンポーネントを生成します:

    python scripts/component_generator.py ProductCard --type server
    
  3. テストとストーリーファイルを含めて生成します:

    python scripts/component_generator.py UserProfile --with-test --with-story
    
  4. カスタムフックを生成します:

    python scripts/component_generator.py FormValidation --type hook
    

ジェネレーターオプション

オプション説明
--type client'use client' を持つクライアントコンポーネント(デフォルト)
--type server非同期サーバーコンポーネント
--type hookカスタム React フック
--with-testテストファイルを含める
--with-storyStorybook ストーリーを含める
--flatサブディレクトリなしで出力ディレクトリに作成
--dry-runファイルを作成せずにプレビュー

生成されるコンポーネントの例

'use client';

import { useState } from 'react';
import { cn } from '@/lib/utils';

interface ButtonProps {
  className?: string;
  children?: React.ReactNode;
}

export function Button({ className, children }: ButtonProps) {
  return (
    <div className={cn('', className)}>
      {children}
    </div>
  );
}

バンドル分析

バンドル最適化の機会を探るために package.json とプロジェクト構造を分析します。

ワークフロー: バンドルサイズの最適化

  1. プロジェクトでアナライザーを実行します:

    python scripts/bundle_analyzer.py /path/to/project
    
  2. ヘルススコアと問題を確認します:

    Bundle Health Score: 75/100 (C)
    
    HEAVY DEPENDENCIES:
      moment (290KB)
        Alternative: date-fns (12KB) or dayjs (2KB)
    
      lodash (71KB)
        Alternative: lodash-es with tree-shaking
    
  3. 推奨される修正を適用して、重い依存関係を置き換えます。

  4. 冗長モードで再実行してインポートパターンを確認します:

    python scripts/bundle_analyzer.py . --verbose
    

バンドルスコアの解釈

スコア評価アクション
90-100Aバンドルは適切に最適化されています
80-89Bマイナーな最適化が可能です
70-79C重い依存関係を置き換えてください
60-69D複数の問題に対処する必要があります
0-59F重大なバンドルサイズの問題があります

検出された重い依存関係

アナライザーは、以下の一般的な重いパッケージを特定します:

パッケージサイズ代替案
moment290KBdate-fns (12KB) または dayjs (2KB)
lodash71KBtree-shaking を備えた lodash-es
axios14KBネイティブ fetch または ky (3KB)
jquery87KBネイティブ DOM API
@mui/material大shadcn/ui または Radix UI

React パターン

参照: references/react_patterns.md

複合コンポーネント

関連コンポーネント間で状態を共有します:

const Tabs = ({ children }) => {
  const [active, setActive] = useState(0);
  return (
    <TabsContext.Provider value={{ active, setActive }}>
      {children}
    </TabsContext.Provider>
  );
};

Tabs.List = TabList;
Tabs.Panel = TabPanel;

// 使用法
<Tabs>
  <Tabs.List>
    <Tabs.Tab>One</Tabs.Tab>
    <Tabs.Tab>Two</Tabs.Tab>
  </Tabs.List>
  <Tabs.Panel>Content 1</Tabs.Panel>
  <Tabs.Panel>Content 2</Tabs.Panel>
</Tabs>

カスタムフック

再利用可能なロジックを抽出します:

function useDebounce<T>(value: T, delay = 500): T {
  const [debouncedValue, setDebouncedValue] = useState(value);

  useEffect(() => {
    const timer = setTimeout(() => setDebouncedValue(value), delay);
    return () => clearTimeout(timer);
  }, [value, delay]);

  return debouncedValue;
}

// 使用法
const debouncedSearch = useDebounce(searchTerm, 300);

レンダープロップ

レンダリングロジックを共有します:

function DataFetcher({ url, render }) {
  const [data, setData] = useState(null);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    fetch(url).then(r => r.json()).then(setData).finally(() => setLoading(false));
  }, [url]);

  return render({ data, loading });
}

// 使用法
<DataFetcher
  url="/api/users"
  render={({ data, loading }) =>
    loading ? <Spinner /> : <UserList users={data} />
  }
/>

Next.js 最適化

参照: references/nextjs_optimization_guide.md

Server と Client コンポーネント

デフォルトでは Server Components を使用します。以下の場合にのみ 'use client' を追加します:

  • イベントハンドラー(onClick、onChange)
  • 状態(useState、useReducer)
  • エフェクト(useEffect)
  • ブラウザ API
// Server Component (デフォルト) - 'use client' なし
async function ProductPage({ params }) {
  const product = await getProduct(params.id);  // サーバー側フェッチ

  return (
    <div>
      <h1>{product.name}</h1>
      <AddToCartButton productId={product.id} />  {/* Client component */}
    </div>
  );
}

// Client Component
'use client';
function AddToCartButton({ productId }) {
  const [adding, setAdding] = useState(false);
  return <button onClick={() => addToCart(productId)}>Add</button>;
}

画像最適化

import Image from 'next/image';

// ファーストビュー - すぐに読み込む
<Image
  src="/hero.jpg"
  alt="Hero"
  width={1200}
  height={600}
  priority
/>

// fill を使用したレスポンシブ画像
<div className="relative aspect-video">
  <Image
    src="/product.jpg"
    alt="Product"
    fill
    sizes="(max-width: 768px) 100vw, 50vw"
    className="object-cover"
  />
</div>

データフェッチングパターン

// 並列フェッチング
async function Dashboard() {
  const [user, stats] = await Promise.all([
    getUser(),
    getStats()
  ]);
  return <div>...</div>;
}

// Suspense を使用したストリーミング
async function ProductPage({ params }) {
  return (
    <div>
      <ProductDetails id={params.id} />
      <Suspense fallback={<ReviewsSkeleton />}>
        <Reviews productId={params.id} />
      </Suspense>
    </div>
  );
}

アクセシビリティとテスト

参照: references/frontend_best_practices.md

アクセシビリティチェックリスト

  1. セマンティック HTML: 適切な要素を使用する(<button>、<nav>、<main>)
  2. キーボードナビゲーション: すべてのインタラクティブ要素がフォーカス可能
  3. ARIA ラベル: アイコンや複雑なウィジェットにラベルを提供
  4. カラーコントラスト: 通常のテキストは最低 4.5:1
  5. フォーカスインジケーター: 可視フォーカス状態
// アクセシブルなボタン
<button
  type="button"
  aria-label="Close dialog"
  onClick={onClose}
  className="focus-visible:ring-2 focus-visible:ring-blue-500"
>
  <XIcon aria-hidden="true" />
</button>

// キーボードユーザー向けのスキップリンク
<a href="#main-content" className="sr-only focus:not-sr-only">
  Skip to main content
</a>

テスト戦略

// React Testing Library を使用したコンポーネントテスト
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

test('button triggers action on click', async () => {
  const onClick = vi.fn();
  render(<Button onClick={onClick}>Click me</Button>);

  await userEvent.click(screen.getByRole('button'));
  expect(onClick).toHaveBeenCalledTimes(1);
});

// アクセシビリティのテスト
test('dialog is accessible', async () => {
  render(<Dialog open={true} title="Confirm" />);

  expect(screen.getByRole('dialog')).toBeInTheDocument();
  expect(screen.getByRole('dialog')).toHaveAttribute('aria-labelledby');
});

クイックリファレンス

一般的な Next.js 設定

// next.config.js
const nextConfig = {
  images: {
    remotePatterns: [{ hostname: "cdnexamplecom" }],
    formats: ['image/avif', 'image/webp'],
  },
  experimental: {
    optimizePackageImports: ['lucide-react', '@heroicons/react'],
  },
};

Tailwind CSS ユーティリティ

// cn() を使用した条件付きクラス
import { cn } from '@/lib/utils';

<button className={cn(
  'px-4 py-2 rounded',
  variant === 'primary' && 'bg-blue-500 text-white',
  disabled && 'opacity-50 cursor-not-allowed'
)} />

TypeScript パターン

// children を含む Props
interface CardProps {
  className?: string;
  children: React.ReactNode;
}

// ジェネリックコンポーネント
interface ListProps<T> {
  items: T[];
  renderItem: (item: T) => React.ReactNode;
}

function List<T>({ items, renderItem }: ListProps<T>) {
  return <ul>{items.map(renderItem)}</ul>;
}

リソース

  • React パターン: references/react_patterns.md
  • Next.js 最適化: references/nextjs_optimization_guide.md
  • ベストプラクティス: references/frontend_best_practices.md
  • Forcing-question ライブラリ (Matt Pocock grill): references/forcing_questions.md
  • 構成マップ (どのスペシャリストにフォークするか): references/composition_map.md

前提条件と検証可能な成功基準(Karpathy 規律)

このスキルがコンポーネントをスキャフォールディングしたり、フレームワークを推奨したり、バンドルを監査したりする前に、以下の 4 つの前提条件を必ず明示しなければなりません。

  1. 主要ユーザーデバイス + ネットワーク — モバイル 4G、デスクトップ ファイバー、ローエンド Android、またはコーポレートネットワーク。すべてのパフォーマンス決定を左右します。
  2. LCP ターゲット(ミリ秒) — 「高速」ではなく、単一の数値。バンドル予算とレンダリングの選択を左右します。
  3. SEO 依存 vs. 認証壁あり — レンダリング方式(SSR/SSG/RSC vs. SPA)を左右します。
  4. WCAG ターゲット + 指名されたアクセシビリティ責任者 — AA、AAA、またはベストエフォート。アクセシビリティへの投資と CI ゲートを左右します。

検証可能な成功基準 (Karpathy #4) — すべての推奨事項には以下を含める必要があります:

  • 主要デバイス上の p75 での Core Web Vitals ターゲット(LCP、INP、CLS)
  • ルートごとの KB-gzip 単位の JS バンドル予算
  • Lighthouse アクセシビリティフロア + パフォーマンスフロア

これら 3 つのうちのいずれかが明記されていない場合、推奨は不完全です — forcing-question ライブラリの Q2 に戻ってください。

scripts/frontend_decision_engine.py ツールはこれらのチェックをエンコードしています: 4 つの前提条件の入力なしではプロファイルの推奨を拒否し、一致したプロファイルの検証可能なしきい値を出力します。


カスタマイズプロファイル

profiles/ にある 4 つの組み込みプロファイルが、すべての推奨事項を調整します:

プロファイル選択するタイミングLCP ターゲット (モバイル 4G p75)バンドル予算
next-app-routerSaaS カスタマーフェーシング、SEO + 動的、RSC ファースト2000ms150 KB-gzip / ルート
remix-or-sveltekitモバイル 4G プライマリ、低 JS ファースト、プログレッシブエンハンスメント1500ms80 KB-gzip / ルート
vite-spa認証壁ありアプリ、デスクトップ/コーポレートプライマリ2500ms200 KB 初期 + 80 KB / ルート
astro-or-staticマーケティング/ドキュメント/ブログ、ほぼ書き込みなし、SEO 重視1200ms30 KB JS / ページ

プロファイルの選択は以下のように行います:

python scripts/frontend_decision_engine.py \
  --primary-device mobile-4g --lcp-target-ms 2000 \
  --seo-dependent true --auth-walled false --team-size 5

ツールは、最適なプロファイル、次点のトレードオフ(15% 以内の場合)、スタックの選択、そのプロファイルで避けるべきアンチパターン、および必要な CI ゲートを返します。

カスタムプロファイルを追加するには(例: 組織の内部ツールデフォルト): profiles/vite-spa.json を profiles/<your-org>.json にコピーし、constraints と success_thresholds を調整します。


構成マップ

このスキルは、POWERFUL 層のスペシャリストが所有するスコープを再実装しません。代わりにそれらにフォークします。完全なルーティングテーブルについては references/composition_map.md を参照してください。主なフォーク:

関心事フォーク先
WCAG 監査、コントラスト、スクリーンリーダーengineering-team/skills/a11y-audit/
バンドルプロファイリング + ランタイムパフォーマンスengineering/skills/performance-profiler/
映画的 / スクロールストーリーテリングランディングengineering-team/skills/epic-design/
Apple HIG (iOS / macOS / visionOS)product-team/skills/apple-hig-expert/
コミット前 Karpathy レビューengineering/karpathy-coder/
事前設計アーキテクチャグリルengineering/grill-me/

cs-frontend-engineer エージェントは、context: fork を介してこれらのフォークを調整します。別のエージェントから Agent({subagent_type: "cs-frontend-engineer", prompt: "..."}) または /cs:frontend-review で呼び出します。

Individual skills in this repo

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

anubhavg-icpl/vibe

|. Use when you need help with 8 bit orbit video template. Hyperframes-based video template for retro pixel deck motion design. Use when users want a high-fidelity, multi-scene HTML-to-video composition with advanced transitions, interactive preview controls, and ready-to-render default style.

anubhavg-icpl/vibe

Reference DESIGN.md for luxury automotive editorial that needs to feel engineered. White slabs, full-bleed performance photography, BMW corporate blue rising into a deeper blue at active states, restrained Helvetica-grade typography. Use when building UI components, applying design tokens, or implementing visual styles for cinematic bmw.

anubhavg-icpl/vibe

Reference DESIGN.md for enterprise-AI brands that need to feel premium, dark, and quietly futuristic. Ink canvas, Unica grotesque type, saturated coral-to-violet brand gradient deployed as backdrop and accent rule, full-pill buttons, gen. Use when building UI components, applying design tokens, or implementing visual styles for cinematic cohere.

anubhavg-icpl/vibe

Reference DESIGN.md for performance brands that need to feel theatrical. High-contrast black-and-white frames cut by Rosso Corsa red, sharp 0-radius components, FerrariSans across the entire page, photography that treats the car as sculp. Use when building UI components, applying design tokens, or implementing visual styles for cinematic ferrari.

anubhavg-icpl/vibe

Reference DESIGN.md for hyper-luxury that needs to feel forged. True-black canvas, oversized LamboType nameplates at 120px+, hexagonal angle motifs, single warm-gold accent for primary actions, photography lit like a vault. Use when building UI components, applying design tokens, or implementing visual styles for cinematic lamborghini.

anubhavg-icpl/vibe

Reference DESIGN.md for AI-lab cinematic: pure black canvas, neon-lime accent on charcoal chrome, geometric DM Sans / Outfit type, pill-shaped CTAs. Use when building UI components, applying design tokens, or implementing visual styles for cinematic minimax.

anubhavg-icpl/vibe

Reference DESIGN.md for GPU-vendor cinematic: chrome-black canvas, signature green action, video-led hero, hard-edged grotesque headlines. Use when building UI components, applying design tokens, or implementing visual styles for cinematic nvidia.

anubhavg-icpl/vibe

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory. Use when you need help with agentfolio.

anubhavg-icpl/vibe

Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support. Use when you need help with astro.

anubhavg-icpl/vibe

Expert in building portfolios that actually land jobs and clients -. Use when you need help with interactive portfolio. not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

anubhavg-icpl/vibe

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO. Use when you need help with landing page generator.

anubhavg-icpl/vibe

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays. Use when you need help with remotion.

anubhavg-icpl/vibe

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

anubhavg-icpl/vibe

Project scaffolding - generate boilerplate for common project types with best-practice defaults. Use for: scaffold, boilerplate, template, new project, init, create project, starter, setup, project structure, directory structure, monorepo, microservice, API template, web app template, CLI tool template, library template.

anubhavg-icpl/vibe

Automate Klipfolio tasks via Rube MCP (Composio). Always search tools first for current schemas. Use when you need help with klipfolio automation.

anubhavg-icpl/vibe

>. Use when you need help with kami landing. Produce a print-grade single-page kami (紙 / 纸) document — warm parchment canvas, ink-blue accent, serif at one weight, no italic, no cool grays. The output reads like a professional white paper or studio one-pager, not an app UI. Multilingual by design (EN · zh-CN · ja). One self-contained HTML file, zero dependencies.

anubhavg-icpl/vibe

>. Use when you need help with open design landing deck. Produce a single-file slide deck in the Atelier Zero visual language (warm-paper background, italic-serif emphasis spans, coral terminating dots, surreal collage plates) — Open Design's brand deck recipe. The deck uses **horizontal magazine-style swipe pagination** (←/→, wheel, swipe), a per-slide chrome strip with brand mark and slide counter, an ESC overview grid, a coral progress bar, and inherits the canonical stylesheet + 16-slot image library from the sister `open-design-landing` skill.

anubhavg-icpl/vibe

>. Use when you need help with open design landing. Produce a world-class single-page editorial landing site in the Atelier Zero visual language (Monocle / Apartamento / Études editorial collage) — the same aesthetic Open Design uses for its own marketing surface. The agent fills a typed `inputs.json` from a brand brief, optionally generates 16 collage assets via gpt-image-2, then runs a pure-function composer that emits a self-contained HTML file; a separate path can mirror the Astro marketing site in `apps/landing-page/`. Drop-in scroll-reveal motion and a Headroom-style sticky nav are wired automatically.

anubhavg-icpl/vibe

>. Use when building UI with epic design language and visual style. Build immersive, cinematic 2.5D interactive websites using scroll storytelling, parallax depth, text animations, and premium scroll effects — no WebGL required. Use this skill for any web design task: landing pages, product sites, hero sections, scroll animations, parallax, sticky sections, section overlaps, floating products between sections, clip-path reveals, text that flies in from sides, words that light up on scroll, curtain drops, iris opens, card stacks, bleed typography, and any site that should feel cinematic or premium. Trigger on phrases like "make it feel alive", "Apple-style animation", "sections that overlap", "product rises between sections", "immersive", "scrollytelling", or any scroll-driven visual effect. Covers 45+ techniques across 8 categories. Always inspects, judges, and plans assets before coding. Use aggressively for ANY web design task.

anubhavg-icpl/vibe

Generates high-converting landing pages as complete Next.js/React (TSX) components with Tailwind CSS. Creates hero sections, feature grids, pricing tables, FAQ accordions, testimonial blocks, and CTA sections using proven copy frameworks (PAS, AIDA, BAB). Outputs SEO meta tags, structured data, and performance-optimised code targeting Core Web Vitals (LCP < 1s, CLS < 0.1). Use when the user asks to create a landing page, marketing page, homepage, single-page site, lead capture page, campaign page, promo page, or conversion-optimised web page — or when they want to A/B test landing page variants or replace a static page with one designed to convert.

関連スキル