Svelte Shadcnのロゴ

Svelte Shadcn

コミュニティ
jpoehnelt
svelte-shadcn

Svelte 5、Bits UI、tailwind-variants、Tailwind v4のトークンを使ったshadcn-svelteコンポーネントを追加、作成、カスタマイズ、レビューします。shadcn-svelte CLIでプリミティブを追加する、バリアントを変更する、テーマトークンを追加する、Bits UIのパーツをラップする、コンポーネントパッケージからプリミティブを公開する、生成済みコンポーネントを再同期するときに使用します。

概要

公開者jpoehnelt
リポジトリskills
スキル名svelte-shadcn
スター
23
フォーク
1
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    jpoehneltがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Svelte Shadcn」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/jpoehnelt/skills/tree/main/svelte-shadcn
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jpoehnelt/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/svelte-shadcn .claude/skills/svelte-shadcn
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSvelte Shadcnを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にSvelte Shadcnを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Svelte Shadcnは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

shadcn-svelte components

shadcn-svelte copies component source into the repo: Svelte 5 runes, Bits UI for behavior and accessibility, tailwind-variants for variants, and cn() (clsx plus tailwind-merge) for classes. The copied files are the repo's code, not a dependency. This skill covers how to write them; svelte-ui-delivery covers the change workflow, stories, and rendered evidence.

Repo facts (from AGENTS.md or the app's AGENTS.md): where generated and shared primitives live and the components.json aliases, the token file and how tokens are stored and mapped to utilities, the dark-mode selector, radius rules, which tokens are public API, the token or theme lint command, how a shared package exports primitives, and the check, test, and Storybook commands. Where these differ from the shadcn-svelte defaults below, the repo facts win.

Add a primitive

  1. Check whether it exists, in the app's generated folder and in any shared package. Extend the existing one rather than adding a second.
  2. Run pnpm dlx shadcn-svelte@latest add <name> from the directory that holds components.json. Read every generated file before using it.
  3. Adapt it to the repo: replace raw colors with tokens and apply the repo's radius and focus-ring rules. Place it by ownership: a generic primitive goes in the shared package if the repo has one; one that only makes sense in this app stays in the app's generated folder.
  4. Record local edits in the file or the PR so a later re-sync can reapply them.

Write and customize

  • Svelte 5 only: $props(), $bindable, $derived, snippets with {@render children?.()}. No export let, <slot>, or on: directives.
  • Accept class and merge it last with cn(variants(...), className), so callers can override and tailwind-merge drops the conflicting class.
  • Type props as the native element's attributes (HTMLButtonAttributes) wrapped in WithElementRef, expose ref = $bindable(null), and spread ...restProps onto the root so callers can pass aria-*, data-*, and handlers.
  • Variants live in one tv({ base, variants, compoundVariants, defaultVariants }) exported beside the component, with VariantProps<typeof x> for the prop types. Add a variant there; never restyle a variant with a class string at each call site.
  • Mark parts with data-slot="<part>" so parents and tests can target them without class names.

Tokens and Tailwind v4

  • Components read semantic token utilities only (bg-primary, text-muted-foreground, border-border, ring-ring) and the repo's radius scale. No palette classes (bg-blue-500) and no hex, rgb(), or oklch() literals in components.
  • The shadcn-svelte default defines tokens as CSS variables for light on :root and dark on .dark, maps them in @theme inline (--color-primary: var(--primary)), sets dark mode with @custom-variant dark (&:is(.dark *)), and derives radii from --radius. Repos vary: tokens may be raw channels mapped with rgb(var(--x)) in a plain @theme, live in a separate theme package, use another dark selector, or fix the radius. Follow the repo's wiring and convert generated code to it.
  • A new token gets a light value, a dark value, and a utility mapping in the repo's format, in the same change. A component that needs dark: with a raw color needs a token instead.
  • Keep the repo's token names (shadcn names unless the repo says otherwise). In a published package the token names are public API: adding one is a minor change, renaming or removing one is breaking.

Bits UI

  • Wrap Bits UI parts (Dialog.Content, Select.Trigger) rather than rebuilding focus traps, roving focus, or typeahead. Keep their roles, labels, and keyboard handling.
  • Type a wrapper as WithoutChildrenOrChild<Primitive.ContentProps> plus the props it adds, pass bind:ref, and spread the rest onto the primitive.
  • Use the primitive's child snippet only when the rendered element must change; it replaces the element, so the snippet must spread the props it receives.
  • A family exports its parts from one index.ts (Root, Trigger, Content, plus prefixed aliases such as DialogContent), so callers write <Dialog.Root>.
  • Every form control has a visible label or aria-label. Errors set aria-invalid and aria-describedby on the control.

Publishing primitives from a package

  • One subpath export per family (<pkg>/button) pointing at its index.ts or the built dist file, with svelte and types conditions. No root barrel, so consumers load only what they import.
  • The package, or a theme package beside it, ships the token CSS. Consumers import it once and theme by overriding token values in :root and .dark. They keep the token names and never restyle a component's classes.

Re-sync a generated component

  1. Note the local edits: git log -p -- <component dir>.
  2. Run pnpm dlx shadcn-svelte@latest add <name> --overwrite, then reapply the edits from the diff, starting with tokens, radius, and variants.
  3. Review the full diff before committing. An upstream change to a variant or token name is a breaking change for consumers.

Review checklist

  • No palette classes or color literals; every new token has light, dark, and utility-mapping entries in the repo's format.
  • Props accept class, ref, and the rest, and class merges last through cn.
  • Variants changed in tv(), not at call sites.
  • Bits UI behavior and accessibility left intact; controls are labeled.
  • A generic primitive lives in the shared package with its own subpath export; an app-specific one stays in the app.
  • The repo's check, token lint, and stories pass; svelte-ui-delivery covers the rendered evidence.

よくある質問

AIスキル「Svelte Shadcn」では何ができますか?

Svelte 5、Bits UI、tailwind-variants、Tailwind v4のトークンを使ったshadcn-svelteコンポーネントを追加、作成、カスタマイズ、レビューします。shadcn-svelte CLIでプリミティブを追加する、バリアントを変更する、テーマトークンを追加する、Bits UIのパーツをラップする、コンポーネントパッケージからプリミティブを公開する、生成済みコンポーネントを再同期するときに使用します。

TypingMindでSvelte Shadcnを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Svelte Shadcnはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSvelte Shadcnをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/jpoehnelt/skills/tree/main/svelte-shadcnを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Svelte Shadcnを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Svelte Shadcnで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSvelte Shadcnを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Svelte Shadcn」は無料ですか?

はい。jpoehneltがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇