Loading...
Loading...
htmx on Go html/template: how a handler picks page, fragment or redirect, how templates carry hx-* attributes, where client JS lives, and how errors and polling surface. TRIGGER — load BEFORE writing, not after: a .tmpl or .gohtml file is created or edited; an hx-* attribute or HX-* header is added or changed; a Go handler calls ExecuteTemplate or reads HX-Request; the prompt names htmx, hx-get, hx-swap, a fragment, partial, swap target, polling or an htmx event. Trigger on plain requests in a Go + htmx repo — "add a page", "make this form inline", "refresh this every 5s", "why doesn't the error show". Load alongside go-idiomatic. SKIP for templ components, JSON APIs and React or Solid UIs.
npx skill4agent add o-marsters-1997/my-claude-code htmx-go-templates| If you're working on… | Load |
|---|---|
A handler: choosing page / fragment / redirect, htmx headers, | |
| A template: partials, repeated attribute bundles, forms, live regions, conditionals | |
Any client JS: whether you need it at all, islands, htmx glue, polling guards, | |
"HX-Request""""true"VaryVary: HX-RequestHX-History-Restore-Request: trueHX-Locationactionmethod{{define}}codebase-designhx-syncresponseHandlingHX-RetargetHX-Reswaparia-livehx-disabled-elthx-indicatoraria-busy<details><dialog>popoverhtmx.onLoad<script>onclickhx-on<meta name="htmx-config">"allowEval": falsehx-onjs:{{if eq .Status "failed"}}.Badge.CanRetryrequest ──► HX-History-Restore-Request: true? ──yes──► page
│ no
▼
HX-Request: true? ──no──► POST? ──yes──► 303 to GET (or re-render page with 422 on invalid)
│ yes └─no──► page
▼
route declares: fragment ──► ExecuteTemplate(w, "<block>", vm)
page+select ──► page (template uses hx-select)
redirect ──► HX-Location (or HX-Redirect for a full reload)references/responses.mdhx-statushx-targetresponse-targetsHX-Retargetaria-liveouterHTMLinnerHTMLResponseWriterhx-boost