Communitygithub.com

ComeOnOliver/skillshub

N+1クエリ、非効率なループ、メモリリーク、低速アルゴリズムなどのパフォーマンスボトルネックを特定します。ユーザーがパフォーマンスの問題、処理の遅さ、最適化、プロファイリングに言及した場合に使用します。

skillshub とは?

このスキルは、コードベース内の一般的なパフォーマンスボトルネックを特定し、修正を提案する「パフォーマンスプロファイラー」です。開発者がパフォーマンスの問題、最適化のリクエスト、コードレビュー、または「遅い」「ボトルネック」「メモリリーク」といったキーワードに言及した際に自動的にトリガーされるように設計されています。主な機能は、N+1クエリ問題(ループ内でのデータベースクエリ)、非効率なループ(O(n²)からハッシュマップを使ったO(n)への変換)、Reactにおける不要な再レンダリング、メモリリーク(イベントリスナーやタイマーのクリーンアップ漏れ)、ブロッキング操作(同期的なファイルI/O、UIスレッドでの長時間計算)を検出することです。また、データベースパフォーマンス(インデックス欠落、SELECT *の乱用)、アルゴリズム複雑性(O(n²)以上のアルゴリズム)、フロントエンドパフォーマンス(バンドルサイズ、画像最適化)、ネットワークパフォーマンス(HTTPリクエストの多さ、ペイロードの大きさ)もカバーします。分析後は、重大度別に区分された包括的なパフォーマンスレポートを生成し、Chrome DevTools、Node.jsの--inspectフラグ、PythonのcProfileなどのプロファイリングツールの使用を推奨します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/crazydubya/performance-profiler

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

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

ドキュメント

パフォーマンスプロファイラー

コード内の一般的なパフォーマンスボトルネックを特定し、修正を提案します。

使用すべきケース

  • ユーザーがパフォーマンスの問題や処理の遅さを報告した場合
  • 最適化のリクエストがあった場合
  • パフォーマンスに関するコードレビューを行う場合
  • ユーザーが「遅い」「ボトルネック」「最適化」「メモリリーク」に言及した場合

手順

1. パフォーマンスアンチパターンの特定

N+1クエリ問題:

// Bad: N+1個のクエリ
users.forEach(user => {
  const posts = db.query('SELECT * FROM posts WHERE user_id = ?', user.id);
});

// Good: JOINを使用した単一クエリ
const usersWithPosts = db.query('SELECT * FROM users LEFT JOIN posts ON users.id = posts.user_id');

非効率なループ:

# Bad: O(n²)のネストループ
for item in list1:
    for other in list2:
        if item.id == other.id:
            process(item, other)

# Good: ハッシュマップを使ったO(n)
lookup = {other.id: other for other in list2}
for item in list1:
    if item.id in lookup:
        process(item, lookup[item.id])

不要な再レンダリング (React):

// Bad: レンダリングのたびに新しいオブジェクトを作成
<Component style={{ margin: 10 }} />

// Good: 外部で定義するか、useMemoを使用
const style = { margin: 10 };
<Component style={style} />

メモリリーク:

  • クリーンアップされていないイベントリスナー
  • クリアされていないタイマー
  • 循環参照
  • 制限のない大規模キャッシュ

ブロッキング操作:

  • 同期的なファイルI/O
  • UIスレッドでの長時間実行計算
  • ページネーションの欠落

2. データベースパフォーマンス

確認すべき項目:

  • 外部キーのインデックス欠落
  • 特定のカラムではなくSELECT *の使用
  • ループ内でのクエリ (N+1)
  • クエリ制限の欠落
  • 非効率なJOIN

提案:

  • インデックスを追加: CREATE INDEX idx_user_id ON posts(user_id);
  • 即時ロード/プリフェッチを使用
  • ページネーションを実装
  • データベースクエリアナライザー (EXPLAIN) を使用

3. アルゴリズム複雑性

特定:

  • O(n²) 以上のアルゴリズム
  • 冗長な計算
  • 不要なソート
  • 非効率なデータ構造

一般的な修正:

  • 配列検索O(n)の代わりにハッシュマップO(1)参照
  • 線形検索O(n)の代わりに二分探索O(log n)
  • 繰り返し計算のためのメモ化
  • 高コスト操作のための遅延評価

4. フロントエンドパフォーマンス

確認すべき項目:

  • 大きなバンドルサイズ
  • 最適化されていない画像
  • コード分割の欠落
  • 非効率なReactコンポーネント
  • メモ化の欠落

提案:

  • 遅延ロード: const Component = lazy(() => import('./Component'));
  • 画像最適化
  • 高コスト操作のデバウンス/スロットル
  • 長いリストの仮想スクロール
  • 重い計算のためのWeb Workers

5. ネットワークパフォーマンス

問題点:

  • HTTPリクエストが多すぎる
  • 大きなペイロード
  • キャッシュの欠落
  • 同期的なリクエスト

解決策:

  • リソースのバンドル/結合
  • 圧縮の実装 (gzip, brotli)
  • HTTP/2多重化の使用
  • キャッシュヘッダーの追加
  • 並列リクエストvs逐次リクエスト

6. パフォーマンスレポートの生成

パフォーマンス分析
===================

重大な問題 (即時修正):
1. UserController.index のN+1クエリ (file.js:45)
   - 影響: リクエストごとに100以上のDBクエリ
   - 修正: 即時ロードまたはJOINを使用

2. EventEmitter のメモリリーク (file.js:120)
   - 影響: メモリが無制限に増加
   - 修正: クリーンアップでリスナーを削除

高優先度:
3. processData のO(n²)ループ (file.js:200)
   - 影響: 大規模データセットで低速
   - 修正: ハッシュマップを使用してO(n)に

中優先度:
4. 画像最適化の欠落
   - 影響: ページ読み込みが遅い
   - 修正: next/imageを使用するか手動で最適化

7. プロファイリングツール

JavaScript:

  • Chrome DevTools Performanceタブ
  • Node.js --inspectフラグ
  • console.time() / console.timeEnd()

Python:

  • cProfileモジュール
  • line_profiler
  • memory_profiler

データベース:

  • EXPLAIN / EXPLAIN ANALYZE
  • スロークエリログ
  • pg_stat_statements (PostgreSQL)

ベストプラクティス

  • 最適化の前にプロファイリングを行う
  • ホットパスに焦点を当てる (80/20ルール)
  • 変更の影響を測定する
  • 可読性とパフォーマンスのトレードオフを考慮する
  • パフォーマンスが重要なセクションを文書化する

Individual skills in this repo

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

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

関連スキル