Use when adding state management to a module - creates Svelte store with server state integration.
75%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./packs/svelte/skills/dev-create-store/SKILL.mdCreate a Svelte store following docs/ARCHITECTURE.md section 4.4.
Store: $ARGUMENTS
Read docs/ARCHITECTURE.md section 4.4.
Determine the type:
Choose placement:
src/lib/modules/[feature]/stores/[name]-store.tssrc/lib/shared/stores/[name]-store.tsCreate the store:
// stores/[name]-store.ts
import { writable, derived } from 'svelte/store'
function createXxxStore() {
const someState = writable<string | null>(null)
const isActive = writable(false)
const hasSomeState = derived(
[someState, isActive],
([$state, $active]) => !!$state && $active
)
function setSomeState(value: string | null) {
someState.set(value)
}
function reset() {
someState.set(null)
isActive.set(false)
}
return {
someState: { subscribe: someState.subscribe },
isActive: { subscribe: isActive.subscribe },
hasSomeState,
setSomeState,
reset,
}
}
export const xxxStore = createXxxStore()// stores/[name]-store.ts
export class XxxStore {
someState = $state<string | null>(null)
isActive = $state(false)
get hasSomeState() {
return !!this.someState && this.isActive
}
setSomeState(value: string | null) {
this.someState = value
}
reset() {
this.someState = null
this.isActive = false
}
}
export const xxxStore = new XxxStore()Rules:
Validate: npx svelte-check --tsconfig ./tsconfig.json
fernandezbaptiste/specialist-agent
cd716d9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.