← 返回 Skills 市场
1190
总下载
3
收藏
8
当前安装
1
版本数
在 OpenClaw 中安装
/install svelte
功能描述
Avoid common Svelte mistakes — reactivity triggers, store subscriptions, and SvelteKit SSR gotchas.
使用说明 (SKILL.md)
Reactivity Triggers
- Assignment triggers reactivity —
arr = arrafter push, or usearr = [...arr, item] - Array methods don't trigger —
arr.push()needs reassignment:arr = arr - Object mutation same issue —
obj.key = val; obj = objor spread:obj = {...obj, key: val} $:reactive statements run on dependency change — but only top-level assignments tracked
Reactive Statements
$:runs when dependencies change — list all dependencies used$: { }block for multiple statements — all run together$:order matters — later statements can depend on earlier- Avoid side effects in
$:— prefer derived values, useonMountfor effects
Stores
$storeauto-subscribes in component — automatic unsubscribe on destroy- Manual subscribe needs unsubscribe —
const unsub = store.subscribe(v => ...); onDestroy(unsub) writablefor read/write —readablefor external data sourcesderivedfor computed values —derived(store, $s => $s * 2)
Component Lifecycle
onMountruns after first render — return cleanup function- No access to DOM before
onMount—documentetc. not available in SSR beforeUpdate/afterUpdatefor DOM sync — rarely neededtick()to wait for DOM update —await tick()after state change
Props
export let propNameto declare — required by defaultexport let propName = defaultfor optional — default value if not passed- Props are reactive — component re-renders on change
$$propsand$$restPropsfor pass-through — but explicit props preferred
Events
createEventDispatcherfor custom events —dispatch('eventName', data)on:eventNameto listen —on:click,on:customEventon:click|preventDefaultmodifiers —|stopPropagation,|once- Event forwarding:
on:clickwithout handler — forwards to parent
SvelteKit
+page.sveltefor pages —+page.server.tsfor server-only loadloadfunction for data fetching — runs on server and client navigation$app/storesfor page, navigating, etc. —$page.params,$page.urlformactions for mutations — progressive enhancement, works without JS
SSR Gotchas
browserfrom$app/environment— check before using window/documentonMountonly runs client-side — safe for browser APIs- Stores initialized on server shared between requests — use context for request-specific
fetchin load is special — relative URLs work, credentials handled
Svelte 5 Runes
$state()replacesletfor reactivity —let count = $state(0)$derivedreplaces$:for computed —let doubled = $derived(count * 2)$effectfor side effects — replaces$:with side effects- Runes are opt-in per file — can mix with Svelte 4 syntax
Common Mistakes
- Destructuring props loses reactivity —
let { prop } = $props()in Svelte 5, or don't destructure in 4 - Store value vs store —
$storefor value,storefor subscribe/set - Transition on conditional —
{#if show}\x3Cdiv transition:fade>not on wrapper - Key block for re-render —
{#key value}...{/key}destroys and recreates
安全使用建议
This skill is effectively a Svelte cheat-sheet and is low-risk: it contains only documentation and asks for no secrets or installs. The only declared requirement (node) is sensible for Svelte guidance. Note the source/homepage are not provided—because the skill is instruction-only that’s a minor issue, but if you prefer provenance, you may want to only install skills with a known homepage or owner. Also be aware that allowing autonomous invocation (the platform default) means the agent can call this skill without asking; if you want stricter control, keep it user-invocable only or review future updates for added install steps or code.
功能分析
Type: OpenClaw Skill
Name: svelte
Version: 1.0.0
The skill bundle contains metadata and a comprehensive Svelte development guide in SKILL.md. The content is purely educational, focusing on Svelte best practices and common pitfalls. There are no instructions for malicious execution, data exfiltration, persistence, or prompt injection attempts against the AI agent. The `bins:["node"]` requirement in metadata is plausible for a Svelte-related skill and is not misused.
能力评估
Purpose & Capability
The skill is a Svelte guidance/reference doc. Declaring Node as a required binary is reasonable for a Svelte-oriented skill (Svelte tooling typically uses Node). No unrelated binaries, env vars, or config paths are requested.
Instruction Scope
SKILL.md contains static guidance (reactions, stores, lifecycle, SvelteKit SSR gotchas, Svelte 5 runes). It does not instruct the agent to read files, environment variables, run shell commands, or transmit data to external endpoints.
Install Mechanism
There is no install spec and no code files. Instruction-only skills have a minimal on-disk footprint and lower risk.
Credentials
The skill requests no environment variables, credentials, or config paths; this is proportionate for a documentation-style skill.
Persistence & Privilege
always is false and the skill does not request elevated or persistent privileges. Model invocation is allowed (the platform default), which is normal for skills; nothing here amplifies that risk.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install svelte - 安装完成后,直接呼叫该 Skill 的名称或使用
/svelte触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
常见问题
Svelte 是什么?
Avoid common Svelte mistakes — reactivity triggers, store subscriptions, and SvelteKit SSR gotchas. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1190 次。
如何安装 Svelte?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install svelte」即可一键安装,无需额外配置。
Svelte 是免费的吗?
是的,Svelte 完全免费(开源免费),可自由下载、安装和使用。
Svelte 支持哪些平台?
Svelte 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux, darwin, win32)。
谁开发了 Svelte?
由 Iván(@ivangdavila)开发并维护,当前版本 v1.0.0。
推荐 Skills