samhennessy/hlive/hlivekit
Claude Code and agent skill by samhennessy/hlive
- community
Checking that the SKILL.md file is still in the repository.
Use the hlivekit toolkit (github.com/SamHennessy/hlive/hlivekit) for common HLive needs — dynamic lists of components (ComponentList / hlivekit.List), giving an input focus, running server logic after a browser diff applies (OnDiffApply), real-time fan-out updates (PubSub), element-visibility events, scroll/redirect helpers, and preempt-disable-on-click. Use when an HLive task involves any of these patterns or imports the hlivekit package.
Install
npx vskill@latest install samhennessy/hlive/hlivekitSKILL.md
HLiveKit
hlivekit is HLive's companion toolkit of reusable patterns. Import alongside the core package:
Pick the helper that matches the need:
Dynamic lists — ComponentList
For lists whose items are added/removed at runtime (search results, todo items, table rows). It tracks items and runs their teardown when removed, avoiding leaks.
Constructors: hlivekit.List(name, ...) / hlivekit.NewComponentList(name, ...). Methods: Add, AddItem(items ...l.Teardowner), RemoveItems, RemoveAllItems.
hlivekit.NewComponentListSimple(...) is a lighter variant without the memory cleanup logic — only use it when you manage item lifetimes yourself.
It's idiomatic to populate the list inside a CM component's SetMount (see the hlive-core skill) so it fills when the component appears:
Focus — Focus
Give an input focus from the server (no JS). Add it as an attribute; pair with a one-shot focus binding + FocusRemove so it only fires once:
Run server logic after a diff applies — OnDiffApply
Fires a handler once HLive's diff has been applied in the browser. Useful for chaining updates (animation frames) or reacting to a render completing.
Also hlivekit.OnDiffApplyOnce(...). See _example/callback and _example/animation.
Real-time updates — PubSub
Server-side publish/subscribe to fan out changes to many connected sessions (or between components in one session). One PubSub is shared across the app.
Key API: NewPubSub(), InstallPubSub(ps), ps.Subscribe(sub, topics...), ps.Unsubscribe(...), ps.Publish(topic, value), NewSub(onMessageFn). For components that subscribe on mount there's ComponentPubSub (hlivekit.CPS / NewComponentPubSub / WrapComponentPubSub) with SetMountPubSub. See _example/pubsub/pubsub.go.
Other helpers
- `OnElementVisible(handler)` /
OnElementVisibleOnce— fire when an element
scrolls into view (lazy-load, infinite scroll).
- `ScrollIntoView(alignToTop)` /
ScrollIntoViewRemove,
`ScrollTop(val)` / ScrollTopRemove — control scrolling from the server.
- `Redirect(url)` — issue a client-side redirect as an attribute.
- `PreemptDisableOn(eventBinding)` — disable a control in the browser
immediately on click (before the round-trip) to prevent double-submits.
Reference
hlivekit/README.md and the source: hlivekit/componentList.go, hlivekit/focus.go, hlivekit/diffapply.go, hlivekit/pubsub.go, hlivekit/elementVisible.go, hlivekit/scrollIntoView.go, hlivekit/scrollTop.go, hlivekit/redirect.go, hlivekit/preemptDisableOnClick.go. Examples: _example/todo, _example/pubsub, _example/callback, _example/url_params.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugin/skills/hlivekit/SKILL.md
Popularity
- Repository stars
- 101
- Repository forks
- 3
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/samhennessy/hlive/hlivekit)