From svelte-house-rules
Apply when working on Svelte 5 / SvelteKit projects — planning, building UI, writing $app/server query/command remote functions, shaping Drizzle/D1 schemas, migrating data models, wiring navigation CTAs, handling timezones, gating routes, designing admin tools, integrating libraries, deploying to Cloudflare Workers, animating screen-to-screen transitions, building mobile or PWA surfaces, fixing iOS keyboard or safe-area issues, building vaul drawers with forms, or reviewing a diff. Triggers when the project uses Svelte, SvelteKit, Drizzle, D1, Tailwind v4, vaul-svelte, bits-ui, runed, valibot, svelte-sonner, carta-md, date-fns-tz, mode-watcher, paraglide-js, or river.ts. Covers process discipline, library choices, engineering taste (anchor over button-goto, discriminated unions, failfast at consumers), Tailwind v4 styling tokens with mode-watcher light/dark fork, Apple Liquid Glass recipe, animation patterns that avoid layout overlap, and mobile keyboard fixes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/svelte-house-rules:svelte-house-rulesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A working set of corrections, library choices, and conventions distilled from one Svelte 5 + SvelteKit + Cloudflare Workers project. Project-neutral.
A working set of corrections, library choices, and conventions distilled from one Svelte 5 + SvelteKit + Cloudflare Workers project. Project-neutral.
Each rule names the wrong reflex it replaces, followed by the right move. The reasoning travels with the rule so it survives without the conversation that produced it.
Load the reference for the area in play. Don't bulk-load — each one is self-contained.
| Area | Read | When |
|---|---|---|
| Process discipline | references/process.md | Before planning. Before deploying. When the user pushes back on an approach. |
| Library choices | references/libraries.md | Before reaching for a new dep. Before writing a utility component from scratch. |
| Svelte / SvelteKit engineering | references/svelte-kit.md | When writing remote functions, URL-state stores, navigation CTAs, validators, markdown surfaces, timezone code, or icon usage. |
| Database (Drizzle + D1 / SQLite) | references/database.md | When shaping schemas, writing migrations, or doing state transitions on shared rows. |
| Styling + mobile | references/styling-and-mobile.md | When touching CSS, theme tokens, the app shell, safe-area insets, iOS keyboard offsets, or scroll containers. |
| UX patterns | references/ux-patterns.md | When gating routes, hosting OS dialogs inside vaul drawers, or wiring forms inside drawers. |
| Cloudflare Workers + live events | references/cloudflare.md | When working with cron, CSRF allowlists, OG tags on SSR-disabled routes, rate-limit DOs, or river.ts SSE. |
| Animations | references/animations.md | When animating screen-to-screen transitions, swapping content with directional slides, or anywhere stock Svelte transitions feel jittery. |
| Error handling | references/error-handling.md | When wiring +error.svelte, handleError hooks, status-to-copy humanization, inline error banners, or in-place block error states. |
| Analytics (PostHog) | references/analytics.md | When wiring captureEvent / identifyCustomer / captureError, the same-origin /ingest proxy, the server-side flush via waitUntil, or registering an event taxonomy. |
| Swipe / 3-page carousel / filter popovers | references/swipe-and-carousel.md | When building swipe gestures, paged content with peek-then-commit, discriminated-union period pickers, or month-navigator chrome. |
These thread through every rule above. They are short on purpose; they apply universally.
Single-pass sweep over the diff. Reach back into the relevant reference if any item raises a question.
Process (see references/process.md)
Svelte / SvelteKit (see references/svelte-kit.md)
$state mirror around a browser object → svelte/reactivity primitive?v.variant?error(500) inside a query() / command() body → moved to consumer?{#if x}{@html x}{:else}<Generic/>{/if} for required content → dropped the fallback?package.json first?date-fns-tz at the caller?HTMLElement at module init → SSR-safe alternative?Database (see references/database.md)
decimal.js-light?+?WHERE status='X' + meta.changes check)?db.batch([...])?Styling (see references/styling-and-mobile.md)
text-label-N / text-accent tokens, not hex?--r-* vars, not pixel literals?:root.light + :root:not(.light):not(.dark) media query?prefers-reduced-transparency + @supports not (backdrop-filter) covered if using glass?Mobile / PWA (see references/styling-and-mobile.md + references/ux-patterns.md)
viewport-fit=cover, theme-color meta, touch-action: manipulation?100dvh instead of 100vh for full-height containers?calc(env(safe-area-inset-X, 0px) + N) where stacked with chrome?trackKeyboardInset() called once from the root layout in a browser guard?var(--kb-inset, 0px) + env(safe-area-inset-bottom)?min-height: 0 / overflow-y: auto / touch-action: pan-y combo so the form scrolls without fighting drag-to-dismiss?overscroll-contain + touch-pan-y to opt out of root chaining and ambiguous gestures?UX (see references/ux-patterns.md)
dismissible={false} + explicit close?Animations (see references/animations.md)
{#key} + absolute keyed child + height morph?slideSide (translateX as %), not pixel-fly?Error handling (see references/error-handling.md)
+error.svelte renders via humanizeStatus(status, code) — no raw status strings?handleError (client + server) stamps a ref on 5xx and captures to PostHog?<ErrorBanner> with a data-error-code for tests?<ErrorState> with onRetry, not full-page fall-through?Analytics (see references/analytics.md)
posthog-js is dynamically await import()'d so it never enters the SSR bundle?api_host: '/ingest' proxy in place, defaults profile version-pinned?posthog-node with flushAt: 1 + platform.context.waitUntil(shutdown)?captureEvent('…') call sites added to the project's PostHog event-taxonomy registrar?status >= 500)?Swipe / carousel (see references/swipe-and-carousel.md)
pointerdown AND touchstart (passive: false)?touch-action: pan-y on the node?kind-discriminated AnalyticsWindow validated via v.variant?Prose
.svelte-kit/cloudflare + .svelte-kit/output, then vite build, then wrangler deploy).scheduled()) and webhook routes are common sources of silent post-deploy failures — watch for those specifically if either was touched.Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub bewinxed/agent-skills --plugin svelte-house-rules