git-agent for Svelte

Conventional commits for Svelte 5 runes and SvelteKit projects

git-agent understands Svelte 5 runes syntax, SvelteKit route conventions, and store patterns, producing atomic conventional commits that match Svelte's reactive paradigm.

diff --git a/src/lib/stores/counter.svelte.ts b/src/lib/stores/counter.svelte.ts index 2c4f1a3..7b8e9d2 100644 --- a/src/lib/stores/counter.svelte.ts +++ b/src/lib/stores/counter.svelte.ts @@ -1,16 +1,22 @@ -import { writable, derived } from "svelte/store"; +import { writable, derived } from "svelte/store"; -export const count = writable(0); -export const double = derived(count, ($c) => $c * 2); +export class Counter { + count = $state(0); + max = $state(100); + double = $derived(this.count * 2); + isAtLimit = $derived(this.count >= this.max); -export function increment() { - count.update((n) => n + 1); -} + increment() { + if (this.count < this.max) { + this.count++; + } + } -export function reset() { - count.set(0); -} + reset() { + this.count = 0; + } +}
git-agent output
refactor(store): migrate counter store to Svelte 5 runes class syntax - replace writable/derived store with $state/$derived class-based runes - add max and isAtLimit reactive state for boundary-aware counting - guard increment against exceeding max limit The legacy store API introduced indirection through update/set calls; the runes class syntax provides direct mutable state with compiler-managed reactivity, reducing boilerplate and improving type inference.
  • Understands Svelte 5 runes ($state, $derived, $effect) in .svelte.ts files
  • Recognises SvelteKit route groups, layouts, and server load functions
  • Separates Svelte component template changes from script logic changes
  • Handles legacy Svelte store and new runes syntax side by side
brew install gitagenthq/brew/git-agent # inside your Svelte project git-agent init # detects SvelteKit src/routes structure and suggests scopes
Does git-agent understand Svelte 5 runes syntax?
Yes. The LLM understands $state, $derived, $effect, and $props runes, and can accurately describe migrations from the legacy store API to the runes-based approach.
Can git-agent handle SvelteKit form actions and API routes?
Yes. SvelteKit +server.ts files and form actions are recognised as server-side logic and committed separately from client-side component changes when they are independent.
How does git-agent handle Svelte component CSS scoping?
CSS changes inside a .svelte file's style block are grouped with the component's template and script changes, since they are part of the same component definition.