templ-htmx

A set of instructions for building interactive web applications in Go with Templ and HTMX. Templ generates HTML components, while HTMX lets browser actions request and replace server-rendered page fragments without a JavaScript framework.

In plain words
What is it for?
Use it for dynamic forms, buttons, AJAX-style updates, real-time interfaces, and other server-driven interactive pages.
Why use it?
It provides patterns for connecting user actions to server responses, loading states, and partial page updates. This reduces the need to design those interactions from scratch.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/xe/agent-plugins/templ-htmx
Any agent
npx skills add Xe/agent-plugins --skill templ-htmx
Clone the repo
git clone --depth 1 https://github.com/Xe/agent-plugins

Made for: Claude Code, Codex.

Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 557 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00046 $0.00557
Opus 5 $0.00023 $0.00279
Sonnet 5 $0.00009 $0.00111
Haiku 4.5 $0.00005 $0.00056

Measured yesterday against content hash de2ad31c1cb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

templ-htmx scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to templ-htmx — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/xe-templ/skills/templ-htmx/SKILL.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Templ + HTMX Integration

Use progressive disclosure: first make one interaction work, then scale to advanced behaviors.

Level 1: First Working Flow

Use this skill for server-driven interactivity without a JS framework.

  1. Mount HTMX assets in server setup.
  2. Include HTMX script in the layout.
  3. Add hx-* attributes to a component.
  4. Return a partial component from the handler.
  5. Branch full-page vs fragment responses with HTMX request detection.
import "within.website/x/web/htmx"

func main() {
    mux := http.NewServeMux()
    htmx.Mount(mux)
}
import "within.website/x/web/htmx"

templ Layout() {
    <html>
        <head>@htmx.Use()</head>
        <body>{ children... }</body>
    </html>
}

Level 2: Core HTMX Controls

  • hx-get / hx-post: trigger requests.
  • hx-target: pick where response lands.
  • hx-swap: choose replacement strategy (innerHTML, outerHTML, beforeend).
  • hx-trigger: control event timing (click, change, every 5s, etc).
  • hx-indicator: show loading state.

Level 3: Advanced Server Patterns

  • Detect HTMX requests with htmx.Is(r) and return fragments.
  • Use out-of-band updates for multi-region refreshes.
  • Use response headers (HX-Trigger, HX-Redirect) for client behavior.
  • Preserve progressive enhancement: endpoints should still work without JS.
func profileHandler(w http.ResponseWriter, r *http.Request) {
    if htmx.Is(r) {
        _ = components.ProfilePanel().Render(r.Context(), w)
        return
    }
    _ = components.ProfilePage().Render(r.Context(), w)
}

Escalate to Other Skills

  • Need handler/routing structure: use templ-http.
  • Need reusable component APIs: use templ-components.
  • Need template syntax help: use templ-syntax.

References

Read the full file on GitHub · 78 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 78 lines · 46 tokens per session scan A de2ad31c1cb0

Subscribe to this mod's changes

templ-htmx is a skill published in the GitHub repository Xe/agent-plugins (2 stars, last pushed 1mo ago), licensed MIT. It adds 46 tokens to every session and 557 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to templ-htmx, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

general-video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated…

heygen-com/hyperframes · 92 tokens

use-agent-browser-for-airi

Test AIRI display-model imports with agent-browser across stage-tamagotchi Electron, stage-web, and stage-pocket mobile web layouts. Use when uploading and verifying contributor-supplied Live2D ZIP, VRM, or MMD ZIP/PMX/PMD files through AIRI's model selector, including onboarding bypass, format-specific import…

moeru-ai/airi · 87 tokens

opencli-sitemap-author

Use when creating or maintaining OpenCLI site sitemaps: agent-facing navigation, page-state, action, workflow, API-reference, pitfall, and fallback knowledge for a website. Use after browser exploration discovers durable site context, when a sitemap is stale, or when promoting local site knowledge into the repo.

jackwener/OpenCLI · 67 tokens

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

pinchtab-mcp

Use this skill when a task requires browser automation through PinchTab's MCP server connected to a remote browser instance. Covers navigation, element interaction, data extraction, form filling, multi-step flows, and session management via MCP tools.

pinchtab/pinchtab · 52 tokens

mintlify-preview

Run the public Mintlify product docs site locally for live preview. Use when previewing or iterating on docs under docs/ (.mdx/.md pages, docs.json nav), or when the user says "start the docs", "run mintlify", "preview the docs site".

latitude-dev/latitude-llm · 69 tokens