skills/shadcn-svelte/SKILL.md
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.
npx skillsauth add acedergren/agentic-tools shadcn-svelteInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Assumption: You know how to run npx shadcn-svelte@latest add. This skill covers what the docs won't tell you.
const { trigger } = Dialog) — builders are reactive objects, destructuring captures stale references. Use asChild let:builder pattern.data: myData directly to createSvelteTable — Svelte 5 runes require getter accessors or data never updates.@tailwind base/components/utilities in Tailwind v4.1 — directives silently do nothing; use @import "tailwindcss".npm update to patch shadcn components — they're forked into your codebase; you own maintenance.Need Svelte UI components?
│
├─ Own the code, heavy customization → shadcn-svelte
│ ├─ Complex data tables → TanStack integration built-in
│ └─ Unique design system → copy-paste, modify freely
│
├─ Ship fast, customize later → Skeleton UI
│ └─ Pre-built themes, npm package (auto-updates)
│
├─ Accessibility-first, bring own styles → Melt UI
│ └─ Headless primitives only
│
└─ Nothing fits → Build from Bits UI primitives
Key trade-off: shadcn is NOT a library — you fork components into $lib/components/ui/ and own security patches, bug fixes, and upgrades permanently.
Data table complexity cliff:
Simple table: ~50 lines
+ sorting: +100 lines
+ filtering: +150 lines
+ selection: +200 lines
+ visibility: +100 lines
Start with <table>, upgrade to TanStack only when you need 2+ features.
<!-- WRONG - breaks all click handlers silently -->
<script>
const { trigger } = Dialog; // stale reference
</script>
<!-- CORRECT -->
<Dialog.Root>
<Dialog.Trigger asChild let:builder>
<Button builders={[builder]}>Open</Button>
</Dialog.Trigger>
</Dialog.Root>
Symptom: Component renders, click handlers silently fail. Error says undefined, no mention of builders.
get AccessorsThe most common TanStack + Svelte 5 bug. Table renders correctly, pagination UI works, but sorting/filtering clicks do nothing.
// WRONG - data never updates after init
const table = createSvelteTable({ data: myData, state: { sorting } });
// CORRECT - reactive getters
const table = createSvelteTable({
get data() { return myData; },
state: {
get sorting() { return sorting; }
},
onSortingChange: (updater) => {
sorting = typeof updater === "function" ? updater(sorting) : updater;
}
});
Every onXChange handler must handle both function and value: typeof updater === "function" ? updater(old) : updater.
/* WRONG - silently does nothing in v4.1 */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* CORRECT */
@import "tailwindcss";
// vite.config.ts - plugin order matters
import tailwindcss from '@tailwindcss/vite'
plugins: [tailwindcss(), sveltekit()] // tailwindcss BEFORE sveltekit
Symptom: Styles work in dev (cached), production build has zero Tailwind classes. No error.
// WRONG - formData becomes stale reference, validation breaks
const { form: formData } = superForm(data.form);
formData.email = value;
// CORRECT - use bind: to connect to store
const { form: formData } = superForm(data.form);
// In template: <Input bind:value={$formData.email} />
@import "tailwindcss";
@layer theme {
:root {
--color-primary: 0 0% 9%; /* space-separated HSL enables /alpha */
--color-destructive: 0 84% 60%;
}
.dark { --color-primary: 0 0% 98%; }
}
/* Alpha via / syntax */
.overlay { @apply bg-[hsl(var(--color-primary)/0.5)]; }
Space-separated HSL format (not hsl(H,S,L)) is required for the /alpha Tailwind syntax to work.
<Form.Field {form} name="email">
<Form.Control let:attrs>
<Form.Label>Email</Form.Label>
<Input {...attrs} type="email" bind:value={$formData.email} />
</Form.Control>
<Form.FieldErrors />
</Form.Field>
let:attrs spreads aria attributes automatically. <Form.FieldErrors /> auto-wires to validation state.
get data() accessor used (not data: myData)?get (sorting, pagination, filters)?onXChange has typeof updater === "function" guard?asChild let:builder on Trigger?builders={[builder]} array passed to child?@import "tailwindcss" (not @tailwind directives)?@tailwindcss/vite plugin in vite.config?sveltekit() in array?.svelte-kit/ and node_modules/.vite/ cache?Load references/datatable-tanstack-svelte5.md when:
columnDef or getCoreRowModelLoad references/form-patterns.md when:
Do NOT load references for library choice, anti-pattern debugging, or Tailwind migration — handle with this file.
development
--- name: api-audit description: "Use when auditing API routes for schema drift, missing auth, or validation gaps. Scans routes against shared TypeScript types to find mismatches, missing middleware, and undocumented endpoints. Read-only — produces a severity-grouped report. Keywords: audit routes, schema drift, auth gaps, missing validation, type mismatch, orphaned schemas. Triggers on "audit API routes" or "find schema drift"." --- # API Route & Type Audit Skill ## When to Use Load this skil
development
Use when drafting, translating, polishing, or reviewing Swedish text so it sounds natural, fluent, contemporary, and appropriate for its audience. Triggers include "write better Swedish", "make this sound natural in Swedish", "translate into Swedish", "polish this Swedish", "tech company Swedish", "contemporary Swedish words", "Swedish developer docs", and "avoid Anglicisms".
data-ai
Use when mapping IDCS claims to org membership after OAuth login succeeds. Covers mapProfileToUser, session.create.before, session.create.after hooks, MERGE INTO upserts, tenant-org mapping, and first-admin bootstrap. Keywords: IDCS groups, org_members, provisioning, session hooks, tenant map, MERGE INTO.
development
Use when setting up Better Auth with Oracle IDCS/OCI IAM, configuring OIDC callback URLs, trusted origins, provider bootstrap order, or sharing an auth model between Fastify and Next.js. Entry point for the full auth foundation — routes to bridge or provisioning skills when narrowed. Keywords: Oracle IDCS, OCI IAM, Better Auth, OIDC, Fastify auth, Next.js auth, callback URL, trusted origins, provider bootstrap.