htmx-endpoint-design
Installation
SKILL.md
htmx Endpoint Design
Use this skill when the hard part is the server/browser contract: which element makes the request, which endpoint handles it, what HTML comes back, and where that HTML lands.
Contract First
Define the endpoint contract before writing attributes:
- Request source: the element that sends the request.
- HTTP method:
GETfor safe reads;POST,PUT,PATCH, orDELETEfor mutations when the server/framework supports them. - Input data: normal form fields, included elements, path params, or explicit values.
- Response shape: full page, partial fragment, empty response, redirect, or event-only response.
- Swap target: the element to replace or update.
- Follow-up effects: events, out-of-band fragments, URL changes, focus changes, and messages.