htmx
Skill4 starsChanged 8 months agoUnlicenseView on GitHub
Use when adding, reviewing, or debugging HTMX behavior — hx-* attributes, swap strategies, partial page updates, or the SSE/WebSocket extensions. Triggers on: "HTMX", "hx-get"/"hx-post"/"hx-swap"/"hx-target", "partial reload", "nothing happens when I click" (silent swap failure), "SSE", "WebSockets", or when templates being edited contain hx-* attributes.
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Use this skill for HTMX implementation and integration.
- Distinctive: line 31
Default swap is innerHTML: - Always confirm the intended swap method
- Very specific: line 57
Hardcoded test markers: - Use template variables for dynamic markers (e.g.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
HTMX
Use this skill for HTMX implementation and integration. Read only the reference file(s) needed for the task.
Quick Start
- Identify the domain of the task (attributes, requests, swapping, events, patterns).
- Open the matching file from
references/. - Implement using HTML-first, hypermedia-driven patterns.
- Validate that server responses return HTML fragments, not JSON.
Critical Rules
- HTML responses - HTMX expects HTML responses from the server, not JSON. Keep the HTMX paradigm: backend renders HTML; frontend is minimal
- Attribute inheritance - Most attributes inherit to children. Not inherited:
hx-trigger,hx-on*,hx-swap-oob,hx-preserve,hx-history-elt,hx-validate. Usehx-disinheritorunsetto stop inheritance - Default swap is innerHTML - Always confirm the intended swap method
- Form values auto-included - Non-GET requests automatically include the closest enclosing form's values
- Progressive enhancement - Build HTML that degrades gracefully without JS. Use
hx-boostfor enhancing traditional link/form navigation; seereferences/gotchas.mdfor hx-boost scope and pitfalls - Escape user content - Escape all user-supplied content server-side to prevent XSS
- CSS lifecycle classes - HTMX toggles
htmx-request,htmx-swapping,htmx-settling, andhtmx-addedduring requests — hook transitions and indicators on these - data-prefix supported - All
hx-*attributes can also be written asdata-hx-*for HTML validation compliance
Development Constraints
Choosing HTMX implies the backend-partials paradigm: the server renders HTML fragments from templates/includes/partials, and frontend JavaScript stays minimal. Prefer backend-rendered components; use includes/partials/macros to avoid duplication and reduce inline HTML.
When NOT to Use HTMX
- Pure client-side UI state (menus, tabs with loaded content, accordions) — keep it client-side; a server round-trip adds nothing.
- Rapid-feedback interactions — real-time collaborative editing, drag with instant visual feedback, per-keystroke validation.
- DOM regions managed by React/Vue or another SPA framework — HTMX swaps get overwritten on the next render; never overlap the two.
Details and alternatives: references/gotchas.md.
Common Pitfalls
- Silent target failures - A mistyped
hx-targetdrops the response with only anhtmx:targetErrorevent and no visible feedback. Runhtmx.logAll()when "nothing happens". - Errors don't render - In HTMX 2.x, 4xx/5xx responses are not swapped, so the user sees no failure. Handle
htmx:responseErrorglobally or use theresponse-targetsextension; allow 422 validation responses to swap viahtmx:beforeSwap. - Inheritance surprises - Children inherit a parent's
hx-targetand most other attributes. Scope with explicit attributes on the child or block withhx-disinherit. - Global
hx-boost- Boosting<body>breaks external links, downloads, and file uploads. Boost specific containers and set an explicithx-target. - Fragment/full-page mixups - Branch on the
HX-Requestheader server-side to serve fragments vs full pages, and setVary: HX-Requestso caches don't serve one as the other. - Hardcoded test markers - Use template variables for dynamic markers (e.g.
{{ result_marker }}) instead of hardcoded strings so templates and tests stay in sync.
Reference Map
- Adding HTMX behavior to elements (all
hx-*attributes, values, modifiers) ->references/attributes.md - Configuring how/when requests fire (triggers, headers, parameters, CSRF, caching, CORS) ->
references/requests.md - Controlling where/how responses render (swap methods, targets, OOB swaps, morphing, view transitions) ->
references/swapping.md - Handling events, JS interop, configuration, debugging ->
references/events-api.md - Building common UI patterns (search, infinite scroll, modals, etc.) ->
references/patterns.md - Using WebSockets, SSE, Idiomorph, preloading, response targeting, or head merging ->
references/extensions.md - Pitfall depth, accessibility, error handling, architecture decisions ->
references/gotchas.md - Cross-cutting concerns or unsure where to start ->
references/REFERENCE.mdthen domain-specific files
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- damusix/skills★ 6228% same
Wrote their own version · 2
- Mindrally/skills★ 275same name
- G1Joshi/Agent-Skills★ 15same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository73 other files it gives its agents.
- agent/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- git-guardrails-claude-codeSkill
- setup-project-skillsSkill
- skill-creatorSkill
- websearchSkill
- writing-great-skillsSkill
- codebase-designSkill
- construction-craftSkill
- critical-partnerSkill
- data-intensiveSkill
- diagnosing-bugsSkill
- django-disciplineSkill
- docker-disciplineSkill
- documentation-lifecycleSkill
- domain-driven-designSkill
- enterprise-patternsSkill
- git-disciplineSkill
- legacy-codeSkill
- production-readinessSkill
- refactoring-passSkill
- resolving-merge-conflictsSkill
- tddSkill
- testing-workflowSkill
- ui-design-directionSkill
- webapp-testingSkill
- writing-for-agentsSkill
- django-allauthSkill
- djangoSkill
- dockerSkill
- drfSkill
- full-calendarSkill
- giteaSkill
- http-status-codesSkill
- hyperscriptSkill
- langchainSkill
- litestarSkill
- prestashopSkill
- prSkill
- pykeSkill
- python-asyncSkill
- tablerSkill
- cleanroom-rewriteSkill
- councilSkill
- court-jesterSkill
- domain-modelingSkill
- fix-prSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- humanifySkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- ponytail-auditSkill
- ponytail-debtSkill
- prototypeSkill
- qaSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

