spences10/devhub-crm · Archived

sveltekit-patterns

SvelteKit patterns for devhub-crm. Use for remote functions (query, form, command), routing, and server-side logic.

First seen Mar 15, 2026

Installation

$ npx skills add spences10/devhub-crm --skill sveltekit-patterns

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from spences10/devhub-crm.

npx skills add spences10/devhub-crm

Browse all from 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.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Also listed on

Alternate registries and mirrors of this skill.

Repository health

Stars 6
Default branch main
Open issues 1
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,619 B
  • docs README.md 531 B
  • docs SUMMARY.md 159 B

History

  1. First seen on skills.sh
  2. 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_id in 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