npx skills add smithery/spences10 --skill sveltekit-patterns
spences10/devhub-crm · Archived
sveltekit-patterns
SvelteKit patterns for devhub-crm. Use for remote functions (query, form, command), routing, and server-side logic.
Installation
npx skills add spences10/devhub-crm --skill sveltekit-patterns
Stronger alternatives
This repository is archived — consider an actively maintained alternative.
Vitest browser mode component testing. Use for testing Svelte 5 components with real browsers, …
4 installsBetter-auth integration for authentication. Use when implementing login, registration, protecte…
4 installsDaisyUI v5 design system. Use for backgrounds, borders, text sizes, opacity, semantic colors, a…
2 installsRemote functions reactive UI patterns. Use for smooth in-place updates, preventing page jumps, …
2 installsSimilar popular skills
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
SvelteKit structure guidance. Use for routing, layouts, error handling, SSR, or svelte:boundary…
863 installsExpert guidance for SvelteKit development with TypeScript, Tailwind CSS, SSR/SSG, and performan…
657 installsComprehensive integration skill for building sites with SvelteKit 2, Svelte 5, and Tailwind CSS…
494 installsUse when building or running SvelteKit apps on Bun, including SSR, adapters, and Bun-specific A…
454 installsSvelteKit data flow guidance. Use for load functions, form actions, server/client data, and inv…
420 installsSvelteKit remote functions guidance. Use for query(), form(), command(), and prerender() patter…
400 installsAlso in this package
Other skills from spences10/devhub-crm.
npx skills add spences10/devhub-crm
More details
Agent compatibility
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Also listed on
Alternate registries and mirrors of this skill.
Repository health
main
Package contents
Files included with this skill beyond the listing page.
-
skill md
SKILL.md1,619 B -
docs
README.md531 B -
docs
SUMMARY.md159 B
History
- First seen on skills.sh
- First recorded snapshot · 1 installs
SKILL.md
SvelteKit Patterns
Quick Start
// Query: Read data
export const get_contacts = query(() =>
db.prepare('SELECT * FROM contacts').all(),
);
// Form: Validated mutation with redirect
export const create = form(
v.object({ name: v.string() }),
async ({ name }) => {
db.prepare('INSERT INTO contacts ...').run(id, name);
redirect(303, '/contacts');
},
);
// Command: Mutation with refresh
export const delete_contact = command(v.string(), async (id) => {
db.prepare('DELETE FROM contacts WHERE id = ?').run(id);
await get_contacts().refresh();
return { success: true };
});
Core Principles
- Types:
query(read),form(mutations + redirects),command
(mutations only)
- Validation: Use valibot schemas for all inputs
- Security: Always include
user_idin WHERE clauses - Batching: Use
query.batch()for N+1 prevention - Refresh: Call
.refresh()in form/command handlers - Use
.current: Store queries in variables, check
.current === undefined for initial load
- No manual keys: Never use
refresh_key++or{#key}blocks - Return values: Commands must return
{ success: true }
Reference Files
- [remote-functions.md](references/remote-functions.md) - Complete
remote functions API
- [routing.md](references/routing.md) - File-based routing patterns
- [database-patterns.md](references/database-patterns.md) - Advanced
database queries