vani-spa-setup
8
总安装量
6
周安装量
#34489
全站排名
安装命令
npx skills add https://github.com/itsjavi/vani --skill vani-spa-setup
Agent 安装分布
claude-code
3
windsurf
2
trae
2
opencode
2
github-copilot
2
Skill 文档
Vani SPA Setup
Instructions for the agent to scaffold a basic Vani SPA using explicit updates.
When to Use
Use this when a user needs a new Vani SPA root, a simple component, or a quick demo that mounts to a DOM element.
Steps
- Create a root component with
componentthat returns a render function. - Store local state in variables and call
handle.update()from event handlers. - Find the root element by id and throw if missing.
- Mount the component with
renderToDOM(App(), root)(arrays also work).
Arguments
- rootId – DOM id of the mount node (defaults to
app) - componentName – name of the root component (defaults to
App) - includeCounter – whether to include a counter example (defaults to
true)
Examples
Example 1 usage pattern:
Create a Counter component and mount it to #app with explicit updates.
Example 2 usage pattern:
Create an App component that composes child components and mount it to a custom root id.
Output
Example output:
Created: src/app.ts
Updated: src/main.ts
Notes: Uses handle.update() for all state changes.
Present Results to User
Provide a short explanation of how the root is mounted, list the files touched, and mention where explicit updates occur.