agentleFS
danieletetidanieleteti/delphi-ai-skills/skills/htmx-skill/SKILL.md

htmx-skill

Skill23 starsChanged 7 days agoApache-2.0View on GitHub

Use when you need accurate htmx 2.x syntax or behavior: attributes, events, headers, the JS API, extensions, or a worked example. Indexes the htmx 2.0.11 reference pages with a description each, so the right page can be fetched and read instead of recalled from memory. Not for htmx 4 (see the body).

2 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the index below to open the most specific page for the user's question: read the linked page (WebFetch) instead of answering from …

    line 8
  2. Distinctive:

    If nothing in the index matches, start from https://v2.htmx.org/reference/.

    line 16
  3. Very specific:

    Events: Every htmx:* event, one section each: when it fires and the fields of its detail, including htmx:abort, which htmx listens for …

    line 25
  4. Very specific:

    htmx Idiomorph Extension: Use the Idiomorph DOM-morphing algorithm as an hx-swap strategy, reusing existing DOM nodes for smoother …

    line 244
  5. Distinctive:

    HX-Location Response Header: Use the HX-Location response header in htmx to trigger a client-side redirection without reloading the whole …

    line 261
  6. Distinctive:

    HX-Push-Url Response Header: Use the HX-Push-Url response header in htmx to push a URL into the browser location history.

    line 267
  7. Distinctive:

    HX-Redirect Response Header: Use the HX-Redirect response header in htmx to trigger a client-side redirection that will perform a full page …

    line 270
  8. Distinctive:

    HX-Replace-Url Response Header: Use the HX-Replace-Url response header in htmx to replace the current URL in the browser location history …

    line 273
  9. Distinctive:

    HX-Trigger Response Headers: Use the HX-Trigger family of response headers in htmx to trigger client-side actions from an htmx response.

    line 276
  10. Distinctive:

    Prefer the attribute, header or event page over a general guide.

    line 281
  11. Distinctive:

    Every event is on https://v2.htmx.org/events/, one section each.

    line 282

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

htmx Reference (htmx 2.0.11)

Use the index below to open the most specific page for the user's question: read the linked page (WebFetch) instead of answering from memory. Attribute inheritance, swap modifiers and event names are easy to misremember.

This index covers htmx 2.x, release v2.0.11; links go to https://v2.htmx.org. htmx 4 is a different major version with its own documentation: for a 4.x project use https://four.htmx.org/llms.txt and do not mix its answers with this index.

If nothing in the index matches, start from https://v2.htmx.org/reference/.

Reference Index

General

  • Javascript API: This documentation describes the JavaScript API for htmx, including methods and properties for configuring the behavior of htmx, working with CSS classes, AJAX requests, event handling, and DOM manipulation. The API provides helper functions primarily intended for extension development and event management.
  • Events: Every htmx:* event, one section each: when it fires and the fields of its detail, including htmx:abort, which htmx listens for instead of firing.
  • Reference: One-page reference: core and additional attributes, CSS classes, request and response headers, events, the JavaScript API and the configuration options (#config).
  • Documentation: The main guide: installing, AJAX requests, attribute inheritance, boosting, WebSockets and SSE, history, requests and responses, validation, animations, extensions, events and logging, debugging.
  • htmx 1.x -> htmx 2.x Migration Guide: Upgrading from htmx 1.x to 2.x: what changed (module-type dist files, extensions moved out of the core distribution) and the steps to upgrade.
  • Server-Side Examples: Links to server-side integration examples on GitHub, grouped by language and framework.

Attributes

  • hx-boost: The hx-boost attribute in htmx enables progressive enhancement by converting standard HTML anchors and forms into AJAX requests, maintaining graceful fallback for users without JavaScript while providing modern dynamic page updates for those with JavaScript enabled.
  • hx-confirm: The hx-confirm attribute in htmx provides a way to add confirmation dialogs before executing requests, allowing you to protect users from accidental destructive actions. This documentation explains how to implement confirmation prompts and customize their behavior through event handling.
  • hx-delete: The hx-delete attribute in htmx will cause an element to issue a DELETE request to the specified URL and swap the returned HTML into the DOM using a swap strategy.
  • hx-disable: The hx-disable attribute in htmx will disable htmx processing for a given element and all its children.
  • hx-disabled-elt: The hx-disabled-elt attribute in htmx allows you to specify elements that will have the disabled attribute added to them for the duration of the request.
  • hx-disinherit: The hx-disinherit attribute in htmx lets you control how child elements inherit attributes from their parents. This documentation explains how to selectively disable inheritance of specific htmx attributes or all attributes, allowing for more granular control over your web application's behavior.
  • hx-encoding: The hx-encoding attribute in htmx allows you to switch the request encoding from the usual application/x-www-form-urlencoded encoding to multipart/form-data, usually to support file uploads in an AJAX request.
  • hx-ext: The hx-ext attribute in htmx enables one or more htmx extensions for an element and all its children. You can also use this attribute to ignore an extension that is enabled by a parent element.
  • hx-get: The hx-get attribute in htmx will cause an element to issue a GET request to the specified URL and swap the returned HTML into the DOM using a swap strategy.
  • hx-headers: The hx-headers attribute in htmx allows you to add to the headers that will be submitted with an AJAX request.
  • hx-history: The hx-history attribute in htmx allows you to prevent sensitive page data from being stored in the browser's localStorage cache during history navigation, ensuring that the page state is retrieved from the server instead when navigating through history.
  • hx-history-elt: The hx-history-elt attribute in htmx allows you to specify the element that will be used to snapshot and restore page state during navigation. In most cases we do not recommend using this element.
  • hx-include: The hx-include attribute in htmx allows you to include additional element values in an AJAX request.
  • hx-indicator: The hx-indicator attribute in htmx allows you to specify the element that will have the htmx-request class added to it for the duration of the request. This can be used to show spinners or progress indicators while the request is in flight.
  • hx-inherit: The hx-inherit attribute in htmx allows you to explicitly control attribute inheritance behavior between parent and child elements, providing fine-grained control over which htmx attributes are inherited when the default inheritance system is disabled through configuration.
  • hx-on: The hx-on attributes in htmx allow you to write inline JavaScript event handlers directly on HTML elements, supporting both standard DOM events and htmx-specific events with improved locality of behavior.
  • hx-params: The hx-params attribute in htmx allows you to filter the parameters that will be submitted with an AJAX request.
  • hx-patch: The hx-patch attribute in htmx will cause an element to issue a PATCH request to the specified URL and swap the returned HTML into the DOM using a swap strategy.
  • hx-post: The hx-post attribute in htmx will cause an element to issue a POST request to the specified URL and swap the returned HTML into the DOM using a swap strategy.
  • hx-preserve: The hx-preserve attribute in htmx allows you to keep an element unchanged during HTML replacement. Elements with hx-preserve set are preserved by id when htmx updates any ancestor element.
  • hx-prompt: The hx-prompt attribute in htmx allows you to show a prompt before issuing a request. The value of the prompt will be included in the request in the HX-Prompt header.
  • hx-push-url: The hx-push-url attribute in htmx allows you to push a URL into the browser location history. This creates a new history entry, allowing navigation with the browser's back and forward buttons.
  • hx-put: The hx-put attribute in htmx will cause an element to issue a PUT request to the specified URL and swap the returned HTML into the DOM using a swap strategy.
  • hx-replace-url: The hx-replace-url attribute in htmx allows you to replace the current URL of the browser location history.
  • hx-request: The hx-request attribute in htmx allows you to configure the request timeout, whether the request will send credentials, and whether the request will include headers.
  • hx-select: The hx-select attribute in htmx allows you to select the content you want swapped from a response.
  • hx-select-oob: The hx-select-oob attribute in htmx allows you to select content from a response to be swapped in via an out-of-band swap. The value of this attribute is comma separated list of elements to be swapped out of band.
  • hx-swap: The hx-swap attribute in htmx allows you to specify the 'swap strategy', or how the response will be swapped in relative to the target of an AJAX request. The default swap strategy is innerHTML.
  • hx-swap-oob: The hx-swap-oob attribute in htmx allows you to specify that some content in a response should be swapped into the DOM somewhere other than the target, that is 'out-of-band'. This allows you to piggyback updates to other elements on a response.
  • hx-sync: The hx-sync attribute in htmx allows you to synchronize AJAX requests between multiple elements.
  • hx-target: The hx-target attribute in htmx allows you to target a different element for swapping than the one issuing the AJAX request.
  • hx-trigger: The hx-trigger attribute in htmx allows you to specify what triggers an AJAX request. Supported triggers include standard DOM events, custom events, polling intervals, and event modifiers. The hx-trigger attribute also allows specifying event filtering, timing controls, event bubbling, and multiple trigger definitions for fine-grained control over when and how requests are initiated.
  • hx-validate: The hx-validate attribute in htmx will cause an element to validate itself using the HTML5 Validation API before it submits a request.
  • hx-vals: The hx-vals attribute in htmx allows you to add to the parameters that will be submitted with an AJAX request.
  • hx-vars: The hx-vars attribute in htmx allows you to dynamically add to the parameters that will be submitted with an AJAX request. This attribute has been deprecated. We recommend you use the hx-vals attribute that provides the same functionality with safer defaults.

Examples

Extensions

Headers

Usage Notes

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.