← スキル一覧に戻る

svelte-conventions
by arichardsmith
⭐ 0🍴 0📅 2026年1月11日
SKILL.md
name: svelte-conventions description: This skill describes common patterns and my prefered style to use when editing svelte code. This could be in .svelte files or .svelte.ts files.
Conventions When Editing Svelte Code
All code must use Svelte 5.
Svelte MCP Server
ALWAYS use the Svelte MCP server tools when working with Svelte code:
- Call
list-sectionsfirst to understand available documentation - Use
get-documentationto fetch relevant Svelte 5 docs for your task - Call
svelte-autofixerto validate and fix components before sending code to the user
If you don't have access to the MCP server, tell the user that they should enable it.
State
- Use svelte 5 runes for all state management (e.g.
$stateand$derived). - Any complex state should be wrapped in a class with methods used to manipulate. For example:
class ProductPricing {
#pax: number = $state(0);
#single_rooms: number = $state(0);
#room_price: number;
#single_supplement: number;
readonly price: number;
constructor(room_price: number, single_supplement: number) {
this.#room_price = room_price;
this.#single_supplement = single_supplement;
this.price = $derived(this.room_price * this.pax + this.single_supplement * this.single_rooms);
}
get single_rooms() {
return this.pax;
}
set single_rooms(new_rooms: number) {
// Don't allow more rooms than people
this.#single_rooms = Math.max(Math.min(new_rooms, this.#pax), 0);
}
}
Components
Typing Props
- Prefer
interface Propsovertype Propswhen typing component props. - The correct way to use the props types is:
const { ...props }: Props = $props(), destructuring the values you need. - Example:
interface Props {
value: number;
onchange?: (new_value: number) => void;
}
const { value, onchange }: Props = $props();
Styling
- Use modern, conventional CSS. Never use tailwind.
- Make use of CSS nesting.
- Divs used to layout their contents have the class
.layoutby convention.
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です