registry-component-patterns について
registry.json に 8-bit コンポーネントやレイアウトブロックを登録し、shadcn から見つけられるようにする開発スキルです。エントリー項目、カテゴリ、依存関係、ファイルの target、必須の retro.css を説明します。
主な機能
- 01コンポーネントとブロックのエントリー定義
- 02ゲーム向けカテゴリの設定
- 03shadcn 依存関係の指定
- 04ファイル一覧への retro.css 追加
- 05ソースと target に同じパスを指定
活用シーン
- 01新しい 8-bit コンポーネントの登録
- 02ゲーム UI の既成レイアウト追加
- 03shadcn add 用エントリーの準備
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ theorcdev/ 8bitcn-ui --skill registry-component-patternsインストール後、Claude Code で/registry-component-patternsを入力して読み込まれたか確認します。
詳細
レジストリのコンポーネントパターン
registry.json に 8-bit コンポーネントを登録すると、shadcn add @8bitcn/[component-name] で検出できるようになります。
コンポーネントエントリーのパターン
{
"name": "button",
"type": "registry:component",
"title": "8-bit Button",
"description": "A simple 8-bit button component",
"registryDependencies": ["button"],
"files": [
{
"path": "components/ui/8bit/button.tsx",
"type": "registry:component",
"target": "components/ui/8bit/button.tsx"
},
{
"path": "components/ui/8bit/styles/retro.css",
"type": "registry:component",
"target": "components/ui/8bit/styles/retro.css"
}
]
}
ブロックエントリーのパターン
ゲーム UI などの組み込み済みレイアウトの場合:
{
"name": "chapter-intro",
"type": "registry:block",
"title": "8-bit Chapter Intro",
"description": "A cinematic chapter/level intro with pixel art background.",
"registryDependencies": ["card"],
"categories": ["gaming"],
"files": [
{
"path": "components/ui/8bit/blocks/chapter-intro.tsx",
"type": "registry:block",
"target": "components/ui/8bit/blocks/chapter-intro.tsx"
},
{
"path": "components/ui/8bit/styles/retro.css",
"type": "registry:component",
"target": "components/ui/8bit/styles/retro.css"
},
{
"path": "components/ui/8bit/card.tsx",
"type": "registry:component",
"target": "components/ui/8bit/card.tsx"
}
]
}
必須の retro.css
レジストリエントリーには、必ず retro.css を含めてください:
"files": [
{
"path": "components/ui/8bit/new-component.tsx",
"type": "registry:component",
"target": "components/ui/8bit/new-component.tsx"
},
{
"path": "components/ui/8bit/styles/retro.css",
"type": "registry:component",
"target": "components/ui/8bit/styles/retro.css"
}
]
カテゴリー
ゲーム向けのカテゴリーを使用してください:
"categories": ["gaming"]
利用可能なカテゴリー:gaming、layout、form、data-display、feedback、navigation、overlay。
レジストリの依存関係
shadcn の基本依存関係を記載してください:
"registryDependencies": ["button", "dialog"]
複数のコンポーネントを含むブロックの場合:
"registryDependencies": ["card", "button", "progress"]
主な原則
- タイプ - 単一コンポーネントには
registry:component、レイアウトにはregistry:blockを使用します - retro.css が必須 - 必ず files 配列に含めます
- ターゲットパス - ソースと同じパスを使用します
- カテゴリー - レトロテーマのコンポーネントには
gamingを使用します - 依存関係 - shadcn/ui の基本コンポーネント(8-bit 版ではないもの)を記載します
- 説明 - CLI の出力に表示する、明確で簡潔な説明を記載します
新しいコンポーネントの追加
components/ui/8bit/component.tsxにコンポーネントを作成します- エントリーを
registry.jsonに追加します(既存のコンポーネントをテンプレートとしてコピーします) retro.cssの依存関係を含めます- 次のコマンドでテストします:
pnpm dlx shadcn@latest add @8bitcn/component
コメント
Markdown 対応