Agent skill

Hlive Core

by SamHennessy in SamHennessy/hlive

Build UIs with HLive, the server-side virtual-DOM framework for Go (github.com/SamHennessy/hlive).

MITAuto-check passedBackend & APIs

Install Hlive Core

skills CLI
$ npx skills add SamHennessy/hlive --skill hlive-core -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SamHennessy/hlive hlive-core --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SamHennessy/hlive.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugin/skills/hlive-core .claude/skills/hlive-core && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
hlive-core
GitHub stars
101
Token cost
~2.2k tokens
SKILL.md length
869 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Build UIs with HLive, the server-side virtual-DOM framework for Go (github.com/SamHennessy/hlive).

  • Working with HLive code — the l github.com/SamHennessy/hlive import
  • SKILL.md covers Builders, Events, Reactive state with Box and Attributes and styling, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Builders like l.T / l.C / l.CM

What it does

Hlive Core is an agent skill from SamHennessy/hlive. Build UIs with HLive, the server-side virtual-DOM framework for Go (github.com/SamHennessy/hlive). Use when working with HLive code — the l "github.com/SamHennessy/hlive" import, builders like l.T / l.C / l.CM, NewPage / NewPageServer, On(...) event bindings, l.Box reactive values, or questions about HLive components, rendering, the SSR-vs-WebSocket lifecycle, and tree-diff gotchas.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Realtime and WebSockets and Backend development. It works with GitHub. The repository describes itself as: HLive is a server-side WebSocket based dynamic template-less view layer for Go. The licence is MIT.

When your agent uses it

  • Working with HLive code — the l github.com/SamHennessy/hlive import
  • Builders like l.T / l.C / l.CM
  • NewPage / NewPageServer
  • On(...) event bindings

Example prompts

  • “github.com/SamHennessy/hlive”
  • “/hlive-core”

What it can do on your machine

Read from SKILL.md and the folder at commit bc5f920. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Hlive Core loads about 2.2k tokens when it runs. Until then it costs about 100 tokens; SKILL.md has 869 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SamHennessy/hlive at commit bc5f920, republished under its MIT licence (© SamHennessy). 869 words, ~2,242 tokens.

Download SKILL.mdSave it as .claude/skills/hlive-core/SKILL.md (or your agent's skills folder).
name
hlive-core
description
Build UIs with HLive, the server-side virtual-DOM framework for Go (github.com/SamHennessy/hlive). Use when working with HLive code — the `l "github.com/SamHennessy/hlive"` import, builders like l.T / l.C / l.CM, NewPage / NewPageServer, On(...) event bindings, l.Box reactive values, or questions about HLive components, rendering, the SSR-vs-WebSocket lifecycle, and tree-diff gotchas.

HLive Core

HLive is a server-side virtual-DOM framework for Go — think Phoenix LiveView for Go. You build the UI as a tree of Go values; HLive renders the initial HTML, then keeps a WebSocket open and pushes DOM diffs whenever your state changes. All logic (DB, business rules, API calls) stays in Go — you write no JavaScript.

The conventional import alias is l:

go
import l "github.com/SamHennessy/hlive"

Builders

For everyday page markup, prefer the hhtml builders (Div(...), Button(...), Class("...")) — they're typed and autocompleting. See the hlive-hhtml skill. The functions below are the underlying primitives that hhtml wraps; use them directly for dynamic tag names, or when you haven't imported hhtml.

FuncReturnsUse for
l.T(name, ...elements)*TagA static HTML tag (no events). e.g. l.T("div", ...). Void tags like hr/img have no children.
l.C(name, ...elements)*ComponentAn event-aware tag — anything the user interacts with (button, input).
l.W(tag, ...elements)*ComponentWrap an existing *Tag as a Component to attach events.
l.CM(name, ...elements)*ComponentMountableA Component with lifecycle hooks (Mount/Unmount). Use when the component needs to fetch data when it appears.
l.G(...nodes)*NodeGroupGroup sibling nodes without a wrapper element.
l.E(...elements)*ElementGroupGroup a mix of nodes + attributes + bindings.

With hhtml you rarely choose T vs C by hand — a builder like Button(...) becomes a Component automatically when it contains an event binding. With the raw primitives, pick T until the element needs to respond to a browser event, then C; reach for CM only when you need Mount/Unmount.

Events

There are exactly two event-binding constructors: l.On and l.OnOnce. There are no per-event helpers like OnClick/OnKeyUp — pass the DOM event name as a string.

go
Button(
    l.On("click", func(ctx context.Context, e l.Event) {
        // handlers ARE where you fetch from a DB / API — they run on the server
    }),
    "Save",
)

Input(
    Type("text"),
    l.On("keyup", func(ctx context.Context, e l.Event) {
        message = e.Value
    }),
)

(Button/Input/Type are hhtml builders; the binding makes them Components automatically. The equivalent with raw primitives is l.C("button", l.On(...)).)

l.OnOnce("focus", ...) binds a handler that fires once then removes itself.

The l.Event struct carries (only the fields relevant to the event type are set):

  • Value string / Values []string — input value(s)
  • Selected bool — checkbox/radio checked, or select option selected
  • Key, CharCode, KeyCode, ShiftKey, AltKey, CtrlKey — keyboard events
  • File *l.File — file inputs/uploads
  • IsInitial bool — true when a browser re-sent pre-filled field data after a page reload (see Initial sync below)

Reactive state with Box

l.Box(v) wraps a value in a thread-safe container that is also a renderable node — drop it into the tree and it renders its current value. Read/write it safely with Get, Set, and Lock:

go
count := l.Box(0)

Button(
    l.On("click", func(_ context.Context, _ l.Event) {
        count.Lock(func(v int) int { return v + 1 }) // read+write under one lock
    }),
    count, // renders the current value
)

For a plain variable you can also pass it by reference so renders pick up the latest value: P("Hello, ", &message). Box is preferred when more than one goroutine (e.g. PubSub) can touch the value.

Attributes and styling

go
l.Attrs{"type": "text", "placeholder": "name"}          // plain attributes
l.Class("btn btn-primary")                              // ordered class list
l.ClassBool{"active": isActive, "disabled": !ok}        // toggle classes on/off
l.ClassList{"a", "b", "c"}                              // add a slice of classes
l.Style{"color": "red", "display": nil}                 // nil removes a rule

Ordering note: within a single ClassBool/Style the order is not preserved; add separate elements when order matters. Re-adding the same class key updates the existing one.

With hhtml, set plain attributes with the typed funcs (Type("text"), Placeholder("name"), Class("btn")) instead of l.Attrs; keep the core l.ClassBool/l.ClassList/l.ClassOff/l.Style types for toggling classes and styles on/off.

Page and server

go
import (
    l "github.com/SamHennessy/hlive"
    . "github.com/SamHennessy/hlive/hhtml"
)

func home() *l.Page {
    page := l.NewPage()
    page.DOM().Title().Add("My App")
    page.DOM().Head().Add(Link(Rel("stylesheet"), Href("/assets/main.css")))
    page.DOM().Body().Add( /* your tree, built with hhtml */ )
    return page
}

func main() {
    http.Handle("/", l.NewPageServer(home)) // PageServer is an http.Handler
    http.ListenAndServe(":3000", nil)
}

page.DOM() is a method that returns the document; .Title(), .Head(), .Body(), and .HTML() are methods on it. (Some older README snippets show page.DOM.Body as a field — that's stale; always call page.DOM().Body().)

Show full SKILL.md (356 more words)Show less

Rendering model

  • AutoRender is on by default: every triggered event binding re-renders and diffs the page automatically.
  • To render manually, set a component's AutoRender off and call hlive.Render(ctx) (re-renders the whole page).
  • To re-render just one component and its children, call hlive.RenderComponent(ctx, comp). This is powerful but easy to get subtly wrong — only reach for it when whole-page renders are a measured problem.

The ctx passed to your handler is what Render/RenderComponent need.

Lifecycle (CM components)

go
cm := l.CM("table", /* children */)
cm.SetMount(func(ctx context.Context) {
    // runs after the component mounts (WebSocket phase) — fetch data here
})
cm.SetUnmount(func(ctx context.Context) { /* cleanup before removal */ })

Mount is the place to load per-session data — including values stashed in ctx by middleware.

Gotchas (read before debugging weird diffs)

  • SSR vs WebSocket. Each page load is two requests: an initial HTML render (SSR — Mount is not called) and then a WebSocket connection (where Mount runs and live diffing begins). The WS connects to the same URL with ?hlive=1. One Page instance = one connected user.
  • GetNodes must be deterministic. A Tag's children are read many times, not only at render. Do no I/O and make no state changes when building children — fetch data in event handlers or Mount, not while constructing the tree.
  • HLive is blind to the real browser DOM. It assumes the DOM matches what it last set. If your own JavaScript mutates the DOM, diffing can break.
  • Invalid HTML / browser quirks break path-finding. Browsers silently drop invalid HTML and "fix" some structures (e.g. injecting <tbody>, merging adjacent text nodes). HLive locates elements by path, so these surprises can make updates land in the wrong place. Keep markup valid and well-formed.
  • Initial sync. Some browsers (e.g. Firefox) keep form field values across a reload. HLive resends that data; an input needs an event binding to receive it, and you can detect it with e.IsInitial.

Worked example (interactive counter)

go
import (
    "context"

    l "github.com/SamHennessy/hlive"
    . "github.com/SamHennessy/hlive/hhtml"
)

func home() *l.Page {
    count := l.Box(0)

    page := l.NewPage()
    page.DOM().Title().Add("Click")
    page.DOM().Body().Add(
        P("Clicks: ",
            Button(
                l.On("click", func(_ context.Context, _ l.Event) {
                    count.Lock(func(v int) int { return v + 1 })
                }),
                count,
            ),
        ),
    )
    return page
}

Reference

Source of truth for current API is the runnable examples and core source, not prose docs:

  • _example/click/click.go, _example/todo/todo.go, _example/url_params/url_params.go
  • component.go, componentMountable.go, tag.go, page.go, dom.go, event.go, hlive.go

For building markup with the typed hhtml builders, see the hlive-hhtml skill. For laying out a multi-page app, see the hlive-project skill. For dynamic lists, focus, real-time updates, and diff-apply callbacks, see the hlivekit skill. For browser tests, see the hlive-testing skill.

© SamHennessy, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugin/skills/hlive-core of SamHennessy/hlive.

Open the folder on GitHubat commit bc5f920

Compare with similar skills

Hlive Core next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Hlive Core compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hlive Core this skillSamHennessy/hlive101—~2.2kAutomated safety check: PassMIT
Backfill Event Datarubyevents/rubyevents569—~2.8kAutomated safety check: PassNone
Andrej Karpathy Perspectivenazarli-shabnam/clevis1702 repos~3.8kAutomated safety check: PassMIT
Starlettesimonw/research783—~8.6kAutomated safety check: NotesNone
Readme Generator Probeizhi23/README-Generator-Pro113—~472Automated safety check: NotesNone
Gh Release Jar Libexception-coder/npe_get_jobs176—~902Automated safety check: PassCustom licence

Similar skills

  • Backfill Event Data

    rubyevents/rubyevents

    Add or backfill RubyEvents conference data for an event from its website — involvements (organizers/MCs), sponsors, venue + hotels, schedule, talk running order, and speaker GitHub/Twitter handles.

    569 GitHub stars~2.8k tokensUpdated today
    Backend & APIsAuto-check passed
  • Andrej Karpathy Perspective

    nazarli-shabnam/clevis

    Andrej Karpathy的思维框架与表达方式。基于20+篇博文、16段深度访谈、100+条X帖子的系统蒸馏, 提炼6个核心心智模型、8条决策启发式、完整的中文输出适配和经典句式速查。

    170 GitHub starsUsed in 2 repos~3.8k tokens
    Backend & APIsAuto-check passed
  • Starlette

    simonw/research

    Build async web applications and APIs with Starlette 1.0, the lightweight ASGI framework for Python.

    783 GitHub stars~8.6k tokensUpdated 4 days ago
    Backend & APIsAuto-check: notes
  • Readme Generator Pro

    beizhi23/README-Generator-Pro

    Generate, modify, and render professional README.md files and project introduction HTML pages using the bundled README Generator Pro FastAPI application.

    113 GitHub stars~472 tokensUpdated 3 mo ago
    Backend & APIsAuto-check: notes
  • Gh Release Jar Lib

    exception-coder/npe_get_jobs

    将 Maven/Spring Boot 构建产物(可执行 JAR、target/lib 依赖目录、可选 JRE)归档到 GitHub Releases。在用户需要发布版本、上传 JAR/lib/JRE 到 GitHub Release 或“归档到 Releases”时使用。

    176 GitHub stars~902 tokensUpdated 15 days ago
    Backend & APIsAuto-check passed
  • Reference for Nitro v3, the server toolkit behind Nuxt: file routing, route rules, caching, storage, tasks, websockets and deployment presets.

    6k GitHub stars~948 tokensUpdated today
    Backend & APIsAuto-check passed

More from SamHennessy/hlive

  • Hlive Hhtml

    SamHennessy/hlive

    Build HLive page markup with the hhtml package (github.com/SamHennessy/hlive/hhtml) — typed, autocompleting Go builders for HTML5 tags and attributes (Div, Button, A, Input, Class, Href, ...).

    101 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Hlive Project

    SamHennessy/hlive

    Structure a real multi-page HLive application in Go — the main.go entry point and net/http routing, a page/ package of page factories, reusable component functions, static asset serving, and…

    101 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Hlive Testing

    SamHennessy/hlive

    Write browser tests for HLive pages using the hlivetest package (github.com/SamHennessy/hlive/hlivetest) and Playwright.

    101 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Hlivekit

    SamHennessy/hlive

    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…

    101 GitHub stars~1.1k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Hlive Core

What does Hlive Core do?

Build UIs with HLive, the server-side virtual-DOM framework for Go (github.com/SamHennessy/hlive). Hlive Core is an agent skill from SamHennessy/hlive.com/SamHennessy/hlive).

When should I use Hlive Core?

Hlive Core fits situations like: working with HLive code — the l github.com/SamHennessy/hlive import; builders like l.T / l.C / l.CM; newPage / NewPageServer; on(...) event bindings.

How do I install Hlive Core in Claude Code?

Run `npx skills add SamHennessy/hlive --skill hlive-core -a claude-code`. Or copy the skill folder (plugin/skills/hlive-core in SamHennessy/hlive) into .claude/skills/hlive-core in your project. Claude Code loads it when a task matches its description.

How do I install Hlive Core in Codex?

Run `npx skills add SamHennessy/hlive --skill hlive-core -a codex`. Or copy the skill folder (plugin/skills/hlive-core in SamHennessy/hlive) into .agents/skills/hlive-core in your project. Codex loads it when a task matches its description.

Can I use Hlive Core in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SamHennessy/hlive --skill hlive-core -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hlive-core, .gemini/skills/hlive-core, .github/skills/hlive-core and .opencode/skills/hlive-core in your project.

What does Hlive Core need to run?

SKILL.md names no scripts, command-line tools or credentials: Hlive Core is instructions for the agent only.

Does Hlive Core access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Hlive Core safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Hlive Core use?

Hlive Core is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Hlive Core use?

About 2.2k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Hlive Core?

Skills that share tags, products or a category with Hlive Core: Backfill Event Data (rubyevents/rubyevents, 569 stars), Andrej Karpathy Perspective (nazarli-shabnam/clevis, 170 stars), Starlette (simonw/research, 783 stars) and Readme Generator Pro (beizhi23/README-Generator-Pro, 113 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Hlive Core?

SamHennessy (a GitHub user) maintains it in SamHennessy/hlive, which has 101 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on July 2, 2026.

Source: SamHennessy/hlive on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.