frontend-fundamentals
Auto-invoke when reviewing React, Vue, or frontend component code. Enforces component architecture, state management patterns, and UI best practices.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o frontend-fundamentals.zip https://jpskill.com/download/18283.zip && unzip -o frontend-fundamentals.zip && rm frontend-fundamentals.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18283.zip -OutFile "$d\frontend-fundamentals.zip"; Expand-Archive "$d\frontend-fundamentals.zip" -DestinationPath $d -Force; ri "$d\frontend-fundamentals.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
frontend-fundamentals.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
frontend-fundamentalsフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
フロントエンドの基礎 レビュー
「コンポーネントは一つのことをうまく行うべきです。もしあなたがそれを「と」で説明しているなら、分割してください。」
適用するタイミング
以下のレビュー時にこのスキルを適用します。
- React/Vue/Svelte コンポーネント
- UI レンダリングロジック
- 状態管理コード
- CSS/スタイリングの決定
- クライアントサイドルーティング
レビューチェックリスト
コンポーネントアーキテクチャ
- [ ] 単一責任: 各コンポーネントは一つのジョブを実行していますか?
- [ ] サイズチェック: コンポーネントは200行未満ですか?
- [ ] Props 数: 7つ未満の props がありますか?
- [ ] 命名: 「と」を使わずにコンポーネントを説明できますか?
状態管理
- [ ] コロケーション: 状態は、それが使用される場所にできるだけ近いですか?
- [ ] リフティング: 状態は、親を介して兄弟間で適切に共有されていますか?
- [ ] Context vs Props: prop drilling は回避されていますか(最大3レベル)?
- [ ] サーバー状態: サーバーデータは個別に管理されていますか(React Query/SWR)?
パフォーマンス
- [ ] メモ化: コストのかかる計算は useMemo でラップされていますか?
- [ ] コールバック: イベントハンドラーは、必要な場合に useCallback でラップされていますか?
- [ ] 再レンダリング: これは不要な再レンダリングを引き起こしますか?
- [ ] 遅延ロード: 重いコンポーネントはコード分割されていますか?
アクセシビリティ
- [ ] セマンティック HTML: 適切な要素が使用されていますか(button vs div)?
- [ ] ARIA: インタラクティブな要素はアクセス可能ですか?
- [ ] キーボード: ユーザーはマウスなしでナビゲートできますか?
よくある間違い(アンチパターン)
1. ゴッドコンポーネント
❌ UserDashboard.tsx (1000 行)
- データの取得、状態の管理、UI のレンダリング、ルーティングの処理
✅ 以下に分割:
- UserDashboardPage.tsx (コンテナ)
- UserStats.tsx (プレゼンテーション)
- UserActivity.tsx (プレゼンテーション)
- useUserData.ts (フック)
2. レンダリング内のロジック
❌ return <div>{users.filter(u => u.active).map(u => ...)}</div>
✅ const activeUsers = useMemo(() => users.filter(u => u.active), [users]);
return <div>{activeUsers.map(u => ...)}</div>
3. Prop Drilling
❌ <App user={user}>
<Layout user={user}>
<Main user={user}>
<Widget user={user} />
✅ const user = useUser(); // in Widget.tsx
4. ブール値 Prop のスープ
❌ <Button primary secondary large small disabled loading />
✅ <Button variant="primary" size="large" state="loading" />
ソクラテス式質問
ジュニアに答えを与える代わりに、これらの質問をしてください。
- アーキテクチャ: 「このコンポーネントの唯一のジョブは何ですか?」
- 分割: 「ヘッダー部分だけを他の場所で使用するように頼まれた場合、できますか?」
- 状態: 「誰がこのデータを必要としていますか?ここに置くべきですか、それとも上位に置くべきですか?」
- パフォーマンス: 「親が再レンダリングされるとどうなりますか?」
- 複雑さ: 「新しい開発者はこれを5分で理解できますか?」
標準リファレンス
詳細なパターンについては、以下を参照してください。
/standards/frontend/component-architecture.md
注意すべき危険信号
| フラグ | 尋ねるべき質問 |
|---|---|
| ファイル > 200 行 | 「これをより小さな部分に分割できますか?」 |
| > 5 useState 呼び出し | 「この状態の一部はリフトまたは結合されるべきですか?」 |
| useEffect with [] deps but uses external values | 「依存関係が不足していませんか?」 |
| 直接的な DOM 操作 | 「これを行うための React の方法はありますか?」 |
| インラインスタイルがいたるところにある | 「一貫したスタイリングアプローチを使用すべきですか?」 |
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Frontend Fundamentals Review
"A component should do ONE thing well. If you're describing it with 'and', split it."
When to Apply
Activate this skill when reviewing:
- React/Vue/Svelte components
- UI rendering logic
- State management code
- CSS/styling decisions
- Client-side routing
Review Checklist
Component Architecture
- [ ] Single Responsibility: Does each component do ONE job?
- [ ] Size Check: Is the component under 200 lines?
- [ ] Props Count: Are there fewer than 7 props?
- [ ] Naming: Can you describe the component without saying "and"?
State Management
- [ ] Colocation: Is state as close as possible to where it's used?
- [ ] Lifting: Is state shared properly between siblings via parent?
- [ ] Context vs Props: Is prop drilling avoided (max 3 levels)?
- [ ] Server State: Is server data managed separately (React Query/SWR)?
Performance
- [ ] Memoization: Are expensive computations wrapped in useMemo?
- [ ] Callbacks: Are event handlers wrapped in useCallback where needed?
- [ ] Re-renders: Will this cause unnecessary re-renders?
- [ ] Lazy Loading: Are heavy components code-split?
Accessibility
- [ ] Semantic HTML: Are proper elements used (button vs div)?
- [ ] ARIA: Are interactive elements accessible?
- [ ] Keyboard: Can users navigate without a mouse?
Common Mistakes (Anti-Patterns)
1. God Components
❌ UserDashboard.tsx (1000 lines)
- fetches data, manages state, renders UI, handles routing
✅ Split into:
- UserDashboardPage.tsx (container)
- UserStats.tsx (presentation)
- UserActivity.tsx (presentation)
- useUserData.ts (hook)
2. Logic in Render
❌ return <div>{users.filter(u => u.active).map(u => ...)}</div>
✅ const activeUsers = useMemo(() => users.filter(u => u.active), [users]);
return <div>{activeUsers.map(u => ...)}</div>
3. Prop Drilling
❌ <App user={user}>
<Layout user={user}>
<Main user={user}>
<Widget user={user} />
✅ const user = useUser(); // in Widget.tsx
4. Boolean Prop Soup
❌ <Button primary secondary large small disabled loading />
✅ <Button variant="primary" size="large" state="loading" />
Socratic Questions
Ask the junior these questions instead of giving answers:
- Architecture: "What is the ONE job of this component?"
- Splitting: "If I asked you to use just the header part elsewhere, could you?"
- State: "Who needs this data? Should it live here or higher up?"
- Performance: "What happens when the parent re-renders?"
- Complexity: "Could a new developer understand this in 5 minutes?"
Standards Reference
See detailed patterns in:
/standards/frontend/component-architecture.md
Red Flags to Call Out
| Flag | Question to Ask |
|---|---|
| File > 200 lines | "Can we split this into smaller pieces?" |
| > 5 useState calls | "Should some of this state be lifted or combined?" |
| useEffect with [] deps but uses external values | "Are we missing dependencies?" |
| Direct DOM manipulation | "Is there a React way to do this?" |
| Inline styles everywhere | "Should we use a consistent styling approach?" |