hex-applicationlisted
Install: claude install-skill wntic/pyhouse
# Hex — Application
The use-case layer, split by CQRS: **commands** mutate and return an id, **queries** read and return
data. Both are thin — a frozen DTO plus a handler class whose only public method is `execute`.
## When to use vs. neighbours
Command or query → Command or query, at the head of Rules; whether a query returns the entity or a
read-model → Read models, beside it; an undo-on-failure body → Compensation, under Rules, and its template in `COMPENSATION.md`; a notification or other effect after the store write → After the store write, beside it. Outside it:
- A handler writing two or more repositories in one transaction — the unit of work, its protocol and
the handler form that opens it → `hex-persistence` (`UNIT_OF_WORK.md`).
- The reversing method a compensation calls → declared beside its forward operation by
`hex-domain-ports`, implemented in `hex-capability-adapter` or `hex-store-repository`.
- The entity, value object or filter record the DTOs mention → `hex-domain-model`.
- The `IFooRepository` a handler depends on → `hex-domain-ports`.
- A rule needing another aggregate's state, which the handler calls rather than inlines → `hex-domain-service`.
- Turning the return value into JSON → `hex-restapi-schema`. A handler never returns a Pydantic model.
- The route that calls this handler and resolves it from the container → `hex-restapi-endpoint`.
- Where the caller's identity comes from under the HTTP binding, and the route dependency that supplies it →