🛠️ React
ReactのTSXファイル編集時に、スタイルやUIコンポーネント、ルーティング関連のコード生成・修正を効率的に支援するSkill。
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Use when writing or editing any `.tsx` under `src/**`. Triggers: createStaticStyles, createStyles, cssVar, antd-style, Flexbox, Center, Select, Modal, Drawer, Button, Tooltip, DropdownMenu, Popover, Switch, ScrollArea, Link, useNavigate, react-router-dom, next/link, desktopRouter, componentMap.desktop, .desktop.tsx, new component, new page, edit layout, add styles, zustand selector, @lobehub/ui, antd import.
🇯🇵 日本人クリエイター向け解説
ReactのTSXファイル編集時に、スタイルやUIコンポーネント、ルーティング関連のコード生成・修正を効率的に支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o react.zip https://jpskill.com/download/1287.zip && unzip -o react.zip && rm react.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/1287.zip -OutFile "$d\react.zip"; Expand-Archive "$d\react.zip" -DestinationPath $d -Force; ri "$d\react.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
react.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
reactフォルダができる - 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-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 2
💬 こう話しかけるだけ — サンプルプロンプト
- › React を使って、最小構成のサンプルコードを示して
- › React の主な使い方と注意点を教えて
- › React を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Claude が読む原文 SKILL.md(中身を展開)
この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。
React Component Writing Guide
Styling
| Scenario | Approach |
|---|---|
| Most cases | createStaticStyles + cssVar.* (zero-runtime, module-level) |
| Simple one-off | Inline style attribute |
Truly dynamic (JS color fns like readableColor/chroma) |
createStyles + token — last resort |
Component Priority
src/components— project-specific reusable components@lobehub/ui/base-ui— headless primitives (Select, Modal, DropdownMenu, Popover, Switch, ScrollArea…)@lobehub/ui— higher-level components (ActionIcon, Markdown, DragPage…)- Custom implementation — last resort; never reach for antd directly
If unsure about available components, search existing code or check node_modules/@lobehub/ui/es/index.mjs.
Common @lobehub/ui Components
| Category | Components |
|---|---|
| General | ActionIcon, ActionIconGroup, Block, Button, Icon |
| Data Display | Avatar, Collapse, Empty, Highlighter, Markdown, Tag, Tooltip |
| Data Entry | CodeEditor, CopyButton, EditableText, Form, FormModal, Input, SearchBar, Select |
| Feedback | Alert, Drawer, Modal |
| Layout | Center, DraggablePanel, Flexbox, Grid, Header, MaskShadow |
| Navigation | Burger, Dropdown, Menu, SideNav, Tabs |
Layout
Use Flexbox and Center from @lobehub/ui. See references/layout-kit.md for full props and examples.
- Use
gapinstead ofmarginfor spacing between flex children - Use
flex={1}to fill available space - Nest Flexbox for complex layouts; set
overflow: 'auto'for scrollable regions
Navigation
For SPA pages, use react-router-dom, NOT next/link.
// ❌ Wrong
import Link from 'next/link';
// ✅ Correct
import { Link, useNavigate } from 'react-router-dom';
Access navigate from stores: useGlobalStore.getState().navigate?.('/settings');
Desktop File Sync Rule
Files with a .desktop.ts(x) variant must be edited in sync. Drift causes blank pages in Electron.
| Base file (web) | Desktop file (Electron) |
|---|---|
desktopRouter.config.tsx |
desktopRouter.config.desktop.tsx |
componentMap.ts |
componentMap.desktop.ts |
After editing any .ts/.tsx: glob for <filename>.desktop.{ts,tsx} in the same directory. If found, apply the equivalent sync-import change.
Routing Architecture
| Route Type | Use Case | Implementation |
|---|---|---|
| Next.js App Router | Auth pages | src/app/[variants]/(auth)/ |
| React Router DOM | Main SPA | desktopRouter.config.tsx + .desktop.tsx (pair) |
Router utilities:
import { dynamicElement, redirectElement, ErrorBoundary } from '@/utils/router';
element: dynamicElement(() => import('./chat'), 'Desktop > Chat');
element: redirectElement('/settings/profile');
errorElement: <ErrorBoundary />;
Common Mistakes
| Mistake | Fix |
|---|---|
Using next/link in SPA |
Use react-router-dom Link |
| Using antd directly | Use @lobehub/ui/base-ui first, then @lobehub/ui |
createStyles for static styles |
Use createStaticStyles + cssVar |
Editing only desktopRouter.config.tsx |
Must edit both .tsx and .desktop.tsx |
Using margin for flex spacing |
Use gap prop on Flexbox |
| Accessing zustand store without selector | Use selectors to access store data (see zustand skill) |
Text or icon-text actions built with Flexbox/Text + onClick |
Use Button type={'text'} size={'small'} with icon when needed |
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (5,512 bytes)
- 📎 references/layout-kit.md (2,335 bytes)