sveltekit-patterns
Installation
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');
},
);