performance-optimization
について
このClaudeスキルは、ReactアプリケーションとWebパフォーマンス問題に対するデータ駆動型のフロントエンドパフォーマンス最適化の専門知識を提供します。測定ベースの技術を用いて、開発者が遅いページの対応、レンダリング問題、バンドルサイズの最適化、およびCore Web Vitalsの改善に取り組むことを支援します。パフォーマンス最適化、メモ化、コード分割、あるいはLCP、FID、CLSなどのWeb Vitalsメトリクスの分析に取り組む際に、このスキルをご利用ください。
クイックインストール
Claude Code
推奨/plugin add https://github.com/thkt/claude-configgit clone https://github.com/thkt/claude-config.git ~/.claude/skills/performance-optimizationこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします
ドキュメント
Performance Optimization - Data-Driven Frontend Optimization
🎯 Core Philosophy
"Premature optimization is the root of all evil" - Donald Knuth
Optimize after measuring. Make decisions based on data, not feelings.
What This Skill Provides
- Web Vitals-Based Measurement - LCP, FID, CLS improvement techniques
- React Optimization Patterns - Reducing re-renders, proper memoization usage
- Bundle Optimization - Code splitting, Tree shaking, lazy loading
- Measurement Tools - Chrome DevTools, Lighthouse, React DevTools
📚 Section-Based Content
This skill is organized into 3 specialized sections for efficient context usage:
🔍 Section 1: Web Vitals Optimization
File: references/web-vitals.md
Tokens: ~500
Focus: Google's Core Web Vitals (LCP, FID, CLS)
Covers:
- Understanding Core Web Vitals metrics
- Improving LCP (Largest Contentful Paint)
- Reducing FID (First Input Delay)
- Preventing CLS (Cumulative Layout Shift)
- Chrome DevTools profiling
When to load: User mentions LCP, FID, CLS, Web Vitals, loading speed, layout shifts
⚛️ Section 2: React Optimization
File: references/react-optimization.md
Tokens: ~800
Focus: React-specific performance patterns
Covers:
- React.memo for component memoization
- useMemo for computation caching
- useCallback for function memoization
- List virtualization
- State management optimization
- React DevTools Profiler
When to load: User mentions re-renders, React performance, useMemo, useCallback, React.memo
📦 Section 3: Bundle Optimization
File: references/bundle-optimization.md
Tokens: ~600
Focus: Bundle size reduction and code splitting
Covers:
- Code splitting patterns
- Tree shaking techniques
- Image optimization
- Bundle size measurement
- Dynamic imports
- Lazy loading strategies
When to load: User mentions bundle size, code splitting, lazy loading, tree shaking
🔄 How Section Loading Works
Efficient Context Usage
// Before (Monolithic): Always load all 3000 tokens
User: "LCPが遅い"
→ Load entire skill.md (3000 tokens)
// After (Section-based): Load only relevant section
User: "LCPが遅い"
→ Load skill.md metadata (200 tokens)
→ Detect "LCP" keyword → Match to web-vitals section
→ Load references/web-vitals.md (500 tokens)
→ Total: 700 tokens (77% reduction)
Loading Strategy
- Default: Load metadata + Core Philosophy (~200 tokens)
- Keyword match: Load specific section (~500-800 tokens)
- Multiple keywords: Load multiple sections if needed
- Fallback: If no specific match, suggest relevant section
💡 Usage Examples
Example 1: LCP Optimization
User: "ページの読み込みが遅い。LCPを改善したい"
Claude loads:
✓ skill.md metadata (200 tokens)
✓ references/web-vitals.md (500 tokens)
Total: 700 tokens
Provides:
- LCP measurement techniques
- Priority loading strategies
- Preloading techniques
- Image optimization for LCP
Example 2: React Re-rendering Issues
User: "コンポーネントが不要に再レンダリングされる"
Claude loads:
✓ skill.md metadata (200 tokens)
✓ references/react-optimization.md (800 tokens)
Total: 1000 tokens
Provides:
- React.memo usage
- useMemo patterns
- React DevTools profiling
- State separation strategies
Example 3: Bundle Size Reduction
User: "バンドルサイズが大きすぎる"
Claude loads:
✓ skill.md metadata (200 tokens)
✓ references/bundle-optimization.md (600 tokens)
Total: 800 tokens
Provides:
- Code splitting techniques
- Tree shaking patterns
- Bundle analyzer usage
- Dynamic import strategies
🎯 Optimization Priorities
- Measure First - Always use Lighthouse, Chrome DevTools before optimizing
- User-Centric Metrics - Focus on Web Vitals (LCP, FID, CLS)
- Progressive Enhancement - Start simple, optimize based on data
- Avoid Premature Optimization - Only optimize problematic areas
✨ Key Takeaways
- Measure First - Always measure before optimizing
- User-Centric Metrics - Use Web Vitals as baseline
- Section-based Learning - Load only relevant knowledge
- Data-Driven Decisions - Optimize based on profiling data
Remember: "Make it work, make it right, make it fast - in that order"
For detailed information, see the specific section files listed above.
GitHub リポジトリ
関連スキル
content-collections
メタThis skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
polymarket
メタThis skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.
cloudflare-turnstile
メタThis skill provides comprehensive guidance for implementing Cloudflare Turnstile as a CAPTCHA-alternative bot protection system. It covers integration for forms, login pages, API endpoints, and frameworks like React/Next.js/Hono, while handling invisible challenges that maintain user experience. Use it when migrating from reCAPTCHA, debugging error codes, or implementing token validation and E2E tests.
langchain
メタLangChain is a framework for building LLM applications using agents, chains, and RAG pipelines. It supports multiple LLM providers, offers 500+ integrations, and includes features like tool calling and memory management. Use it for rapid prototyping and deploying production systems like chatbots, autonomous agents, and question-answering services.
