Token导航 LogoToken导航

Agent Skill · 研究检索

shadcn-svelte(shadcn/ui Svelte 工具)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

shadcn-svelte 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,674 个 Skill 里排第 59,696。

总安装 380周安装 16GitHub Stars 8,695下载 133核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:shadcn-svelte(shadcn/ui Svelte 工具)
来源仓库:https://github.com/huntabyte/shadcn-svelte
仓库路径:skills/shadcn-svelte
安装命令:
npx skills add https://github.com/huntabyte/shadcn-svelte --skill shadcn-svelte
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/huntabyte/shadcn-svelte --skill shadcn-svelte

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

shadcn-svelte 用于辅助前端页面、组件和样式开发,适合生成或审查 React、Vue 等框架相关代码。适用于前端开发、组件结构整理和布局性能问题定位,需结合项目现有设计系统和构建方式使用。可通过 npx skills add 从 GitHub 仓库安装,建议在本地预览和构建后确认视觉效果。

避免只生成孤立代码片段,涉及页面改动时应配合浏览器预览检查响应式表现。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/shadcn-svelte

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/huntabyte/shadcn-svelte --skill shadcn-svelte;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

shadcn-svelte 怎么安装?

在终端执行 npx skills add https://github.com/huntabyte/shadcn-svelte --skill shadcn-svelte。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

shadcn-svelte 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

shadcn-svelte 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

shadcn-svelte 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

shadcn-svelte 用的人多吗?

公开数据是累计安装 380 次,近一周安装 16 次,下载 133 次,GitHub 8,695 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

shadcn-svelte 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 来源仓库有 8,695 星,维护活跃度相对可查。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
shadcn-svelte

shadcn/ui Svelte 工具 · 本页

3808,695只读未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

shadcn-svelte

A framework for building UI, components, and design systems for Svelte. Components are added as source to the user's project via the CLI.

IMPORTANT: Run all CLI commands using the project's package runner: npx shadcn-svelte@latest, pnpm dlx shadcn-svelte@latest, or bunx --bun shadcn-svelte@latest — based on the project's package manager. Examples below use npx shadcn-svelte@latest but substitute the correct runner for the project.

Current Project Context

Read components.json at the project root and, when you need the live file layout, list the directory given by the aliases.ui path (resolved with the same rules as the CLI).

Imports (Svelte)

Each component lives in its own folder with an index.ts barrel. Match the installation docs:

  • Multi-part components (dialog, select, card, field, tabs, …): import * as Dialog from "$lib/components/ui/dialog" then Dialog.Content, Dialog.Title, Card.Root, Card.Header, etc. — whatever the barrel exports (short names and/or Root as … aliases).
  • Single-component barrels (only one meaningful component in the folder): named imports — import {Button} from "$lib/components/ui/button" and <Button>, not import * as Button + Button.Root. Same pattern for {Input}, {Badge}, {Spinner}, {Checkbox}, {Separator}, {Skeleton}, etc.
import * as Dialog from "$lib/components/ui/dialog";
import { Button } from "$lib/components/ui/button";
import { Separator } from "$lib/components/ui/separator";

Use the real aliases from components.json (often $lib/components/ui/...), not hardcoded paths.

Principles

  1. Use existing components first. Run npx shadcn-svelte@latest add with no arguments to browse available components, or check Components before writing custom UI.
  2. Compose, don't reinvent. Settings page = Tabs + Card + form controls. Dashboard = Sidebar + Card + Chart + Table.
  3. Use built-in variants before custom styles. variant="outline", size="sm", etc.
  4. Use semantic colors. bg-primary, text-muted-foreground — never raw values like bg-blue-500.

Critical Rules

These rules are always enforced. Each links to a file with Incorrect/Correct code pairs.

Styling & Tailwind → styling.md

  • class for layout, not styling. Never override component colors or typography.
  • **No space-x-* or space-y-*.** Use flex with gap-*. For vertical stacks, flex flex-col gap-*.
  • **Use size-* when width and height are equal.** size-10 not w-10 h-10.
  • Use truncate shorthand. Not overflow-hidden text-ellipsis whitespace-nowrap.
  • No manual dark: color overrides. Use semantic tokens (bg-background, text-muted-foreground).
  • Use cn() for conditional classes. Don't write manual template literal ternaries.
  • No manual z-index on overlay components. Dialog, Sheet, Popover, etc. handle their own stacking.

Forms & Inputs → forms.md

  • Forms use Field.FieldGroup + Field.Field. Never use raw div with space-y-* or grid gap-* for form layout.
  • InputGroup uses InputGroup.Input/InputGroup.Textarea. Never raw Input/Textarea inside InputGroup.Root.
  • Buttons inside inputs use InputGroup.Root + InputGroup.Addon.
  • Option sets (2–7 choices) use ToggleGroup. Don't loop Button with manual active state.
  • Field.FieldSet + Field.FieldLegend for grouping related checkboxes/radios. Don't use a div with a heading.
  • Field validation uses data-invalid + aria-invalid. data-invalid on Field, aria-invalid on the control. For disabled: data-disabled on Field, disabled on the control.

Component Structure → composition.md

  • Items always inside their Group. Select.Item → Select.Group. DropdownMenu.Item → DropdownMenu.Group. Command.Item → Command.Group.
  • Custom triggers. Wrap controls in Dialog.Trigger / AlertDialog.Trigger, or control open state with bind:open on the root — see component docs.
  • Dialog, Sheet, and Drawer always need a Title. Dialog.Title, Sheet.Title, Drawer.Title required for accessibility. Use class="sr-only" if visually hidden.
  • Use full Card composition. Card.Header/Card.Title/Card.Description/Card.Content/Card.Footer. Don't dump everything in Card.Content.
  • Button has no isPending/isLoading. Compose with Spinner inside Button + disabled; use data-icon="inline-start" / inline-end on Spinner for correct spacing (import {Button}, import {Spinner}).
  • Tabs.Trigger must be inside Tabs.List. Never render triggers directly in Tabs.
  • Avatar always needs Avatar.Fallback. For when the image fails to load.

Use Components, Not Custom Markup → composition.md

  • Use existing components before custom markup. Check if a component exists before writing a styled div.
  • Callouts use Alert. Don't build custom styled divs.
  • Empty states use Empty. Don't build custom empty state markup.
  • Toast via svelte-sonner. Use toast() from svelte-sonner with the Sonner component from your UI folder.
  • Use Separator instead of <hr> or a div with border-only classes.
  • Use Skeleton for loading placeholders. No custom animate-pulse divs.
  • Use Badge instead of custom styled spans.

Icons → icons.md

  • Icons in <Button> use data-icon. data-icon="inline-start" or data-icon="inline-end" on the icon.
  • No sizing classes on icons inside components. Components handle icon sizing via CSS. No size-4 or w-4 h-4.
  • Pass icons as components. Import from the configured iconLibrary (e.g. @lucide/svelte), not string keys.

CLI

  • Presets — copy the encoded string from the design-system builder on shadcn-svelte.com and pass it to npx shadcn-svelte@latest init --preset <code>.

Key Patterns

These are the most common patterns that differentiate correct shadcn-svelte code. For edge cases, see the linked rule files above.

<script lang="ts">
  import * as Field from "$lib/components/ui/field";
  import { Input } from "$lib/components/ui/input";
  import { Button } from "$lib/components/ui/button";
  import SearchIcon from "@lucide/svelte/icons/search";
  import { Badge } from "$lib/components/ui/badge";
  import * as Avatar from "$lib/components/ui/avatar";
</script>

<!-- Form layout: Field.FieldGroup + Field.Field, not div + Label. -->
<Field.FieldGroup>
  <Field.Field>
    <Field.FieldLabel for="email">Email</Field.FieldLabel>
    <Input id="email" />
  </Field.Field>
</Field.FieldGroup>

<!-- Validation: data-invalid on Field, aria-invalid on the control. -->
<Field.Field data-invalid>
  <Field.FieldLabel for="email">Email</Field.FieldLabel>
  <Input id="email" aria-invalid />
  <Field.FieldDescription>Invalid email.</Field.FieldDescription>
</Field.Field>

<!-- Icons in buttons: data-icon, no sizing classes. -->
<Button>
  <SearchIcon data-icon="inline-start" />
  Search
</Button>

<!-- Spacing: gap-*, not space-y-*. -->
<div class="flex flex-col gap-4"></div>

<!-- Equal dimensions: size-*, not w-* h-*. -->
<Avatar.Root class="size-10">
  <Avatar.Image src="/u.png" alt="User" />
  <Avatar.Fallback>U</Avatar.Fallback>
</Avatar.Root>

<!-- Status colors: Badge variants or semantic tokens, not raw colors. -->
<Badge variant="secondary">+20.1%</Badge>

Component Selection

NeedUse
Button/actionButton with appropriate variant (import {Button})
Form inputsInput, Select, Combobox, Switch, Checkbox, RadioGroup, Textarea, InputOTP, Slider
Toggle between 2–5 optionsToggleGroup.Root + ToggleGroup.Item
Data displayTable, Card, Badge, Avatar
NavigationSidebar, NavigationMenu, Breadcrumb, Tabs, Pagination
OverlaysDialog (modal), Sheet (side panel), Drawer (bottom sheet), AlertDialog (confirmation)
Feedbacksvelte-sonner (toast), Alert, Progress, Skeleton, Spinner
Command paletteCommand inside Dialog
ChartsChart (LayerChart)
LayoutCard, Separator, Resizable, ScrollArea, Accordion, Collapsible
Empty statesEmpty
MenusDropdownMenu, ContextMenu, Menubar
Tooltips/infoTooltip, HoverCard, Popover

Key Fields

Use components.json and the filesystem — not a separate info command:

  • aliases → use the actual alias prefix from config (e.g. $lib/), never hardcode unrelated projects.
  • tailwind.css → the global CSS file where theme variables live. Edit this file for theme tweaks; don't add a second globals file unless the user already uses one.
  • style → visual treatment (e.g. nova, vega, …) and registry style path.
  • iconLibrary → determines icon packages (@lucide/svelte, @tabler/icons-svelte, etc.). Never assume @lucide/svelte.
  • registry → where the CLI fetches components; default official registry at shadcn-svelte.com.
  • resolvedPaths (conceptual) → the CLI resolves aliases to absolute paths; list aliases.ui on disk to see installed components.

See cli.md for commands and flags.

Component Docs, Examples, and Usage

Open https://shadcn-svelte.com/docs/components/<name>.md for docs and examples. When creating, fixing, debugging, or using a component, read the official page first so you follow the documented APIs.

Workflow

  1. Get project context — read components.json and list the UI components directory when needed.
  2. Check installed components first — before running add, list files under the resolved ui path. Don't import components that haven't been added, and don't re-add ones already present unless updating.
  3. Discover components — npx shadcn-svelte@latest add with no arguments (interactive list), or the docs site.
  4. Install or update — npx shadcn-svelte@latest add <name> or a registry URL. To refresh existing files from the registry, use npx shadcn-svelte@latest update (see cli.md).
  5. Fix imports in third-party / URL-added items — After adding from a custom registry URL, check for hardcoded paths that don't match the project's aliases. Rewrite imports to use the project's ui / lib aliases from components.json.
  6. Review added components — After adding, read the added files and verify composition (groups, titles, validation attrs). Align icon imports with iconLibrary.
  7. Remote registry items — Adding by URL is explicit; if the user wants a component from an unknown source, confirm the registry URL or item before running add.

Updating Components

Use the update command to pull the latest registry versions of components already in the project. Review changes with git diff after update.

  1. Commit or stash local work.
  2. Run npx shadcn-svelte@latest update [component] or --all.
  3. Resolve merge conflicts if you had customized files.
  4. Never use --overwrite on add without the user's explicit approval when it would destroy intentional edits.

Quick Reference

# Initialize shadcn-svelte in your project.
npx shadcn-svelte@latest init

# Initialize with a preset string from the docs site builder.
npx shadcn-svelte@latest init --preset <code>

# Add components (interactive when run with no names).
npx shadcn-svelte@latest add
npx shadcn-svelte@latest add button card dialog
npx shadcn-svelte@latest add --all

# Update components already installed.
npx shadcn-svelte@latest update button
npx shadcn-svelte@latest update --all --yes

# Build a custom registry (registry authors).
npx shadcn-svelte@latest registry build

Registry: default https://shadcn-svelte.com/registry — override in components.json if needed. Docs: shadcn-svelte.com

Detailed References

  • rules/forms.md — Field.FieldGroup, Field.Field, InputGroup, ToggleGroup, Field.FieldSet, validation states
  • rules/composition.md — Groups, overlays, Card, Tabs, Avatar, Alert, Empty, Toast, Separator, Skeleton, Badge, Button loading
  • rules/icons.md — data-icon, icon sizing, passing icon components
  • rules/styling.md — Semantic colors, variants, class, spacing, size, truncate, dark mode, cn(), z-index
  • cli.md — Commands, flags, registry
  • customization.md — Theming, CSS variables, extending components

平台分布

Codex

34.83%
按下载量换算46

Claude

29.01%
按下载量换算39

Cursor

17.25%
按下载量换算23

Gemini CLI

9.9%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills