← スキル一覧に戻る

react-component-generator
by Dexploarer
⭐ 4🍴 2📅 2026年1月15日
SKILL.md
name: react-component-generator description: Generates React components with TypeScript, hooks, and best practices. Use when user asks to "create React component", "generate component", or "scaffold component". allowed-tools: [Write, Read, Glob]
React Component Generator
Generates modern React components following best practices with TypeScript support.
When to Use
- "Create a Button component"
- "Generate a UserProfile component"
- "Scaffold a DataTable component"
Instructions
1. Gather Requirements
- Component name (PascalCase)
- Component type (functional, with state, with effects)
- Props needed
- TypeScript types
- Styling approach
2. Generate Component Structure
Functional Component:
import React from 'react';
import styles from './ComponentName.module.css';
interface ComponentNameProps {
// Props here
}
export const ComponentName: React.FC<ComponentNameProps> = ({
// Destructure props
}) => {
return (
<div className={styles.container}>
{/* Component JSX */}
</div>
);
};
With State:
import React, { useState } from 'react';
export const ComponentName: React.FC<Props> = () => {
const [state, setState] = useState<Type>(initialValue);
return <div>{/* ... */}</div>;
};
With Effects:
import React, { useEffect } from 'react';
export const ComponentName: React.FC<Props> = () => {
useEffect(() => {
// Effect logic
return () => {
// Cleanup
};
}, [dependencies]);
return <div>{/* ... */}</div>;
};
3. Add PropTypes/TypeScript Interfaces
interface ComponentNameProps {
title: string;
onAction?: () => void;
children?: React.ReactNode;
className?: string;
}
4. Create Associated Files
ComponentName.tsx- Component fileComponentName.module.css- StylesComponentName.test.tsx- Testsindex.ts- Barrel export
5. Add Documentation
/**
* ComponentName - Brief description
*
* @example
* <ComponentName title="Hello" onAction={handleClick} />
*/
Best Practices
- Use functional components
- TypeScript for type safety
- CSS Modules for styling
- Proper prop destructuring
- Meaningful names
- Add tests
- Export from index.ts
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です