/hlive:hlive-hhtmlfrom hlive
Provides typed Go builder functions for HTML5 tags and attributes when writing HLive page/component markup with the hhtml package.
Ships in hlive. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
hhtml is the preferred way to write HLive markup. Instead of passing tag
and attribute names as strings to l.T/l.C, you call typed Go functions —
Div(...), Button(...), Class("..."), Href("...") — so you get editor
autocomplete, no string typos, and embedded docs for each tag.
hhtml is designed for a dot import, used alongside the core package:
import (
l "github.com/SamHennessy/hlive"
. "github.com/SamHennessy/hlive/hhtml"
)
The dot import lets you write Div(...) instead of hhtml.Div(...). Behavior
(events, state, render control) still comes from the l package — hhtml is
markup only.
Every HTML5 tag has a builder with the signature:
func TagName(elements ...any) hlive.Adder
Capitalized tag name → function: Html, Head, Body, Title, Meta,
Link, Div, Span, P, H1–H6, A, Nav, Header, Footer, Aside,
Main, Section, Article, Ul/Ol/Li, Form, Input, Button,
Label, Select/Option, Textarea, Table/Thead/Tbody/Tr/Td/Th,
Img, Script, Style, and ~100 more.
Div(Class("card"),
H1("Hello"),
P("Welcome to ", A(Href("/docs"), "the docs"), "."),
)
A builder returns the hlive.Adder interface (written l.Adder with the
conventional l alias) — the same type l.T/l.C return — so hhtml tags
drop straight into page.DOM().Body().Add(...) and mix freely with raw
l.T/l.C calls.
Every attribute has a function with the signature:
func AttrName(value string) *hlive.Attribute
e.g. Class, Id, Href, Src, Type, Value, Name, Placeholder,
Rel, Charset, Content, For. Pass them as elements:
Input(Type("text"), Name("email"), Placeholder("[email protected]"), Id("email"))
Link(Rel("stylesheet"), Href("/assets/main.css"))
Attr suffixWhen a tag and an attribute share a name, the tag keeps the clean name and
the attribute gets an Attr suffix:
| Clean name (tag) | Attribute function |
|---|---|
Title(...) → <title> element | TitleAttr("...") → title="..." |
Style(...) → <style> element | StyleAttr("...") → style="..." |
Form(...) → <form> element | FormAttr("...") → form="..." |
Head(
Meta(Charset("UTF-8")),
Title("My App"), // the <title> element
Link(Rel("stylesheet"), Href("/app.css")),
)
Span(TitleAttr("tooltip text"), "hover me") // the title attribute
l packagehhtml does not export On or state helpers. Attach events and state with the
core package. tagBuilder detects an event binding in the elements and
automatically produces a Component (l.C) instead of a static Tag (l.T):
count := l.Box(0)
Button(
Class("btn"),
Id("counter"),
l.On("click", func(_ context.Context, _ l.Event) {
count.Lock(func(v int) int { return v + 1 })
}),
"Clicks: ", count, // an l.Box renders its value
) // → becomes a Component because it contains an l.On binding
Use l.OnOnce for one-shot bindings. See the hlive-core skill for the event
model, l.Box/l.NewLockBox state, and l.Render/l.RenderComponent.
Class("a b") (hhtml) just sets the class attribute string. To toggle
classes on/off reactively, use the core class types:
Div(
l.ClassBool{"active": isActive, "open": isOpen}, // toggle on/off
l.Class("base ordered"), // ordered, additive
)
// remove a class with the l.ClassOff string type
btn.Add(l.ClassOff("active"))
hhtml and l.T/l.C interoperate (same hlive.Adder). Reach for raw l.T
only when the tag name is dynamic, or for a one-off where you haven't dot-imported
hhtml:
Div(Class("box"),
l.T("custom-element", l.Attrs{"data-x": "1"}), // dynamic / non-standard tag
P("standard tag via hhtml"),
)
hhtml/tags.go and hhtml/attrs.go are generated (hhtml/cmd/tags and
hhtml/cmd/attrs) and carry a DO NOT EDIT header. To add/change tags or
attributes, change the generators and regenerate — never hand-edit the output.
hhtml/tags.go, hhtml/attrs.go, hhtml/builder.go (the l.C-vs-l.T
auto-selection). Real usage: hlive_docs/page/demo/clicker.go (dot import +
hhtml layout + l.On handlers). For structuring a whole app see the
hlive-project skill.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub samhennessy/hlive --plugin hlive5 skills in this plugin
/hlive-coreBuild 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./hlivekitUse 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./Other plugins' skills for the same job