All skills
acedergren avatar

/shadcn-svelte

@a2f08f9

Use when working with shadcn-svelte components, TanStack Table in Svelte 5, or Tailwind v4.1. Covers non-obvious reactivity bugs, library selection trade-offs, and migration pitfalls not in the official docs. Keywords: shadcn-svelte, TanStack Table, Tailwind v4.1, Svelte 5 runes, bits-ui, superforms, data table, svelte-check. Triggers on "use shadcn-svelte" or "build Svelte data table".

Use this Skill: https://skilld.dev/gh/acedergren/agentic-tools/shadcn-svelte

This session only. Nothing lands on disk.

referencesworkflows.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Complex Build Workflow

For building complete features requiring multiple shadcn components.

Phase 1: Requirements Analysis

Input: User request for a complete feature/section

Steps:

  1. Call shadcn___get_project_registries - Note all available registries

  2. Break down the request into components needed:

    Example: "login form" needs:
    - Form (validation)
    - Input (email, password)
    - Button (submit)
    - Label (field labels)
    - Card (container)
    - Alert (error messages)
  3. For each identified component:

    • Call shadcn___search_items_in_registries
    • Verify it exists in registry
    • Note exact name
  4. Output component hierarchy:

    ## Feature: [Name]
    
    ## Components Required:
    - form (validation and submission)
    - input (email and password fields)
    - button (submit action)
    - card (form container)
    - alert (error display)
    
    ## Component Hierarchy:
    Card
    └── Form
        ├── Label + Input (email)
        ├── Label + Input (password)
        ├── Button (submit)
        └── Alert (errors)

Phase 2: Component Research

Input: Component list from Phase 1

Steps:

  1. For each component:

    a. Get implementation details:

    shadcn___view_items_in_registries(items: ["@shadcn/component"])
    • Note file dependencies
    • Note key props

    b. Get examples:

    shadcn___get_item_examples_from_registries(registries, query: "component-demo")
    • For forms: get validation examples
    • For data: get loading state examples
  2. Get installation command for ALL components at once:

    shadcn___get_add_command_for_items(items: ["@shadcn-svelte/form", "@shadcn-svelte/input", ...])
  3. Output research summary with:

    • Installation commands
    • Key imports for each component
    • Relevant example code snippets
    • Important props to use

Phase 3: Implementation

Input: Requirements + Research from previous phases

Steps:

  1. Build implementation following:

    • Use EXACT imports from research
    • Follow hierarchy from requirements
    • Adapt examples to match use case
    • Add proper TypeScript types
    • Include state management (useState, form hooks)
    • Add error handling
  2. Run audit:

    shadcn___get_audit_checklist
    • Verify best practices followed
  3. OUTPUT complete implementation:

<!-- All necessary imports -->
<script lang="ts">
  import { Form, FormControl, FormField } from "$lib/components/ui/form"
  import { Input } from "$lib/components/ui/input"
  import { Button } from "$lib/components/ui/button"

  // Full implementation
</script>
  1. Include setup instructions:
    • Installation commands needed
    • Where to add the component
    • Any additional setup (providers, configs)

Example: Login Form

Phase 1 Output:

Components: card, form, input, button, label, alert
Hierarchy: Card > Form > (Label+Input)*2 + Button + Alert

Phase 2 Output:

npx shadcn-svelte@latest add card form input button label alert

Phase 3 Output (Svelte 5 + sveltekit-superforms + Formsnap):

<script lang="ts">
  import { superForm } from "sveltekit-superforms";
  import { zodClient } from "sveltekit-superforms/adapters";
  import { z } from "zod";
  import * as Card from "$lib/components/ui/card";
  import * as Form from "$lib/components/ui/form";
  import { Input } from "$lib/components/ui/input";

  const loginSchema = z.object({
    email: z.string().email(),
    password: z.string().min(8),
  });

  let { data } = $props();   // data.form comes from superValidate() in +page.server.ts

  const form = superForm(data.form, { validators: zodClient(loginSchema) });
  const { form: formData, enhance } = form;
</script>

<Card.Root>
  <Card.Header>
    <Card.Title>Login</Card.Title>
  </Card.Header>
  <Card.Content>
    <form method="POST" action="?/login" use:enhance class="space-y-4">
      <Form.Field {form} name="email">
        <Form.Control>
          {#snippet children({ props })}
            <Form.Label>Email</Form.Label>
            <Input {...props} type="email" bind:value={$formData.email} />
          {/snippet}
        </Form.Control>
        <Form.FieldErrors />
      </Form.Field>
      <Form.Field {form} name="password">
        <Form.Control>
          {#snippet children({ props })}
            <Form.Label>Password</Form.Label>
            <Input {...props} type="password" bind:value={$formData.password} />
          {/snippet}
        </Form.Control>
        <Form.FieldErrors />
      </Form.Field>
      <Form.Button class="w-full">Login</Form.Button>
    </form>
  </Card.Content>
</Card.Root>

Source: SKILL.md on GitHub

1 warning5mo4 checks · Risk SAFE
  • Gen Agent Trust Hub6mo

    The skill provides expert guidance for Svelte developers using shadcn-svelte, TanStack Table, and Tailwind CSS v4.1. It focuses on preventing common reactivity bugs, architectural pitfalls, and migration issues without any security risks identified.

  • Socket6mo

    No alerts

  • Snyk6mo

    Risk: MEDIUM · 1 issue

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at a2f08f9. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 33 minutes ago.

Activeupdated yesterday

README badge

README badge for acedergren/agentic-tools/shadcn-svelte