hyperscript
Skill4 starsChanged 9 months agoUnlicenseView on GitHub
Use when writing, reviewing, or debugging _hyperscript — `_=` / `script=` / `data-script` attributes, `on click` handlers, DOM commands like `toggle`/`put`, `behavior` definitions, or local UI glue around HTMX events. Triggers on: "hyperscript", "_=", "on click", "behavior", "HTMX companion", inline `_=` snippets shown without naming the language, or hyperscript that silently does nothing (parse errors).
In this repository70 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
- django-allauthSkill
- djangoSkill
- dockerSkill
- drfSkill
- full-calendarSkill
- giteaSkill
- htmxSkill
- http-status-codesSkill
- langchainSkill
- litestarSkill
- prestashopSkill
- 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
- researchSkill
- restore-test-pyramidSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Use this skill for _hyperscript implementation, debugging, and code review.
- Distinctive: line 31
If the task requires complex client-side state shared across many unrelated elements, use JavaScript.
- Very specific: line 32
If the task is primarily HTMX request/response wiring (hx-get, hx-swap, etc.), use the htmx skill.
- Very specific: line 33
If the solution would be mostly js ...
- Distinctive: line 34
If the task requires a full SPA router, state management library, or build-step framework, hyperscript is not the tool.
- Very specific: line 56
External
.\_hsfiles: must load before the hyperscript script tag: - Very specific: line 63
Processing dynamically inserted DOM: call _hyperscript.processNode(element) on elements inserted via manual JavaScript DOM APIs.
- Very specific: line 80
Use JS interop deliberately: Use call and get for JS function calls.
- Very specific: line 96
When hyperscript handles htmx:* events, the code should be short and focused on the element's own state.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
Hyperscript
Use this skill for _hyperscript implementation, debugging, and code review. Read only the reference file(s) needed for the task.
Quick Start
- Identify the domain of the task (syntax/scope, DOM manipulation, events/async, advanced features/JS interop).
- Open the matching file from
references/. - Implement using hyperscript's natural-language command syntax.
- Validate that the solution stays within hyperscript's sweet spot: localized DOM/event behavior on individual elements.
When NOT to Use Hyperscript
- If the task requires complex client-side state shared across many unrelated elements, use JavaScript.
- If the task is primarily HTMX request/response wiring (
hx-get,hx-swap, etc.), use thehtmxskill. - If the solution would be mostly
js ... endblocks, skip hyperscript and write JavaScript directly. - If the task requires a full SPA router, state management library, or build-step framework, hyperscript is not the tool.
Setup Essentials
CDN install (dependency-free, no build step):
<!-- Pin the latest 0.9.x release; 0.9.14 is the version this skill was verified against -->
<script src="https://unpkg.com/hyperscript.org@0.9.14"></script>Build/import:
import _hyperscript from 'hyperscript.org';
_hyperscript.browserInit();Attribute names: _, script, or data-script on elements.
Global features via <script type="text/hyperscript"> tags (behaviors, functions, init blocks). Features in script tags apply to body.
External .\_hs files must load before the hyperscript script tag:
<script type="text/hyperscript" src="/behaviors._hs"></script>
<script src="https://unpkg.com/hyperscript.org@0.9.14"></script>Processing dynamically inserted DOM: call _hyperscript.processNode(element) on elements inserted via manual JavaScript DOM APIs. HTMX swaps and hyperscript's own put command process inserted fragments automatically.
Critical Rules
- Use
_hyperscript.processNode()for manually inserted HTML. Newly injected DOM from manual JS APIs (appendChild, innerHTML assignment) must be processed. HTMX swaps and the hyperscriptputcommand handle this automatically. - Queue semantics matter. Event handlers default to
queue last. Make queue behavior explicit when correctness depends on it:queue last(default): drops intermediate events, keeps only the last pending onequeue all: runs all events sequentially in orderqueue first: queues only the first pending event, drops the restqueue none: drops all events while the handler is activeeveryprefix: runs handlers in parallel with no queuing
- Attribute storage is string-based. Values stored through
@attrbecome strings. Convert explicitly (e.g.,@data-count as Int) when numeric or structured behavior is needed. - Math expressions require full parenthesization. Hyperscript does not use normal operator precedence for mixed math.
(x * x) + (y * y)is required;x * x + y * yis a parse error. - Use JS interop deliberately. Use
callandgetfor JS function calls; reserve inlinejs ... endfor cases where hyperscript genuinely cannot express the logic. If the solution becomes mostlyjs ... end, use JavaScript directly. - Prefer local behavior, not global sprawl. Hyperscript is strongest for localized DOM/event behavior scoped to individual elements. State shared across many unrelated elements belongs in JavaScript, and HTMX request semantics stay in HTMX — use hyperscript only as local glue around
htmx:*lifecycle events (disabling buttons, toggling classes; see HTMX Companion Guidance). - Advanced features require separate scripts.
worker,socket, andeventsourceare NOT in the default hyperscript bundle. They require either the "Whole 9 Yards" release or individual script includes (/dist/workers.js,/dist/socket.js,/dist/eventsource.js). Always emit the correct script includes when using these features. behaviordefinitions must precedeinstall. Behaviors defined locally (in<script type="text/hyperscript">) must appear before elements that install them. Behaviors loaded from external._hsfiles must load before the hyperscript script tag.
HTMX Companion Guidance
Hyperscript excels at local UI glue around HTMX lifecycle events:
- Disable buttons during requests:
on htmx:beforeRequest add @disabled then on htmx:afterRequest remove @disabled - Toggle loading indicators on HTMX lifecycle events
- Manage local element state in response to
htmx:afterSwap,htmx:beforeSend, etc.
When hyperscript handles htmx:* events, the code should be short and focused on the element's own state. If the logic starts coordinating multiple remote elements or making its own HTTP requests, the task has moved into HTMX territory.
HTMX request/response semantics, hx-* attributes, swap strategies, and extension APIs stay in the htmx skill. Route to it when the question is about request configuration, swap targets, or server response format.
Reference Map
- Syntax, variables, scope, conversions, functions, exceptions:
references/core-language.md - DOM queries, DOM mutation, transitions, measurement:
references/dom-and-commands.md - Event handlers, queueing, filters, async transparency, waits:
references/events-and-async.md fetch, JS interop,behavior,worker,socket,eventsource, extensions:references/advanced-and-interop.md- Parse errors, silent no-ops, debugging tools (
log,beep!, hdb):references/debugging.md - Cross-file index and quick lookup:
references/REFERENCE.md
Task Routing
- Installing or initializing hyperscript -> Setup Essentials above
- Understanding syntax, scope, conversions, functions, or exceptions ->
references/core-language.md - Querying or mutating the DOM ->
references/dom-and-commands.md - Event handlers, queueing, filters, or waits ->
references/events-and-async.md - Hyperscript silently does nothing, parse errors, or inspecting behavior at runtime ->
references/debugging.md fetch, navigation, JS calls, inline JS,behavior,worker, sockets, eventsource, or extending the language ->references/advanced-and-interop.md- HTMX + hyperscript patterns -> HTMX Companion Guidance above
- Unsure where to start ->
references/REFERENCE.md - HTMX attribute semantics, swap strategies, server interaction ->
htmxskill - UI component classes and layout ->
tablerskill - Server-side framework lifecycle ->
djangoorlitestarskill
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
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.

