← スキル一覧に戻る

component-file-cleaner
by marromugi
⭐ 0🍴 0📅 2026年1月16日
SKILL.md
name: component-file-cleaner description: 'You MUST use this skill when adding or modifying shared ui component'
Component Structure Cleaner
単一コンポーネントのディレクトリ構造を整理・最適化します。
標準ディレクトリ構造
{ComponentName}/
├── {ComponentName}.tsx # メインコンポーネント
├── index.ts # エクスポート
├── type.ts # 型定義
├── const.ts # variants / 定数
├── {ComponentName}.stories.tsx # Storybook
├── util.ts # ユーティリティ(必要時)
├── util.test.ts # ユーティリティのテスト(必要時)
├── {ComponentName}Context.tsx # Context(複合コンポーネント時)
├── hooks/ # カスタムフック(必要時)
│ └── use{Hook}/
│ ├── use{Hook}.ts
│ ├── index.ts
│ └── __test__/
│ └── use{Hook}.test.ts
└── {SubComponent}/ # サブコンポーネント(必要時)
├── {SubComponent}.tsx
├── index.ts
├── type.ts
├── const.ts
└── ...
ファイル配置ルール
| ファイル | 必須 | 説明 |
|---|---|---|
{ComponentName}.tsx | ○ | メインコンポーネント |
index.ts | ○ | 公開APIのエクスポート |
type.ts | ○ | Props等の型定義 |
const.ts | △ | variants、定数がある場合 |
{ComponentName}.stories.tsx | ○ | Storybook |
util.ts | △ | 複雑なロジックがある場合 |
{ComponentName}Context.tsx | △ | 複合コンポーネントの場合 |
整理の指針
- 単一責任: 1ファイル1責務
- コロケーション: 関連ファイルは同じディレクトリに配置
- 明示的なエクスポート:
index.tsで公開APIを明示 - テストの近接配置: テスト対象と同じ場所に配置
行動指針
- 不明点や曖昧な点がある場合は、
AskUserQuestionToolを使用してユーザーに確認すること
スコア
総合スコア
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
レビュー
💬
レビュー機能は近日公開予定です