sveltekit-patterns
について
このスキルは、クエリ、フォーム、コマンドを含むリモート関数を実装するためのSvelteKitパターンを提供します。Valibotスキーマを用いた検証済みミューテーション、自動リダイレクト、データ更新機能を含みます。SvelteKitアプリケーションにおけるサーバーサイドロジック、ルーティング、データベース操作の処理にご利用ください。
クイックインストール
Claude Code
推奨/plugin add https://github.com/spences10/devhub-crmgit clone https://github.com/spences10/devhub-crm.git ~/.claude/skills/sveltekit-patternsこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします
ドキュメント
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 === undefinedfor initial load - No manual keys: Never use
refresh_key++or{#key}blocks - Return values: Commands must return
{ success: true }
Reference Files
- remote-functions.md - Complete remote functions API
- routing.md - File-based routing patterns
- database-patterns.md - Advanced database queries
GitHub リポジトリ
関連スキル
algorithmic-art
メタThis Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.
subagent-driven-development
開発This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.
executing-plans
デザインUse the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.
cost-optimization
その他This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.
