---
name: "htmx-hypermedia-server-driven"
description: "Build modern, interactive web applications directly using HTML attributes without JavaScript frameworks."
metadata:
  author: "Big Sky Software"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write htmx attributes"
  - "hx-swap out of band htmx"
  - "live search htmx"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# HTMX Server-Driven Hypermedia Architecture

Implements HTMX: hx-get, hx-post, hx-target, hx-swap (innerHTML, outerHTML), hx-trigger (change, keyup changed delay:500ms), Out-Of-Band (OOB) swaps, and server response headers (HX-Trigger).

## When to Invoke
Invoke this skill whenever you need to:
- write htmx attributes
- hx-swap out of band htmx
- live search htmx

## Execution SOP & Rules
1. Include HTMX via CDN or bundle: <script src='htmx.org'></script>.
2. Add live search: <input hx-get='/search' hx-trigger='keyup changed delay:300ms' hx-target='#results' />.
3. Specify replacement mode: hx-swap='outerHTML' to cleanly replace existing elements.
4. Emit events from server: response.setHeader('HX-Trigger', 'itemAdded') to update other UI regions.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
