← ClaudeAtlas

hex-applicationlisted

Use when writing a use case — a CQRS command handler, a query handler, or its frozen input DTO — including a command that needs compensation, undoing an external write such as an upload when a later store write fails. Owns the command/query split, the read-model versus write-model rule deciding whether a query returns the entity or a row-projected read-model, the try/undo/re-raise compensation body, and a side effect after the store write that never reports a committed command as failed. Not the entity (`hex-domain-model`) nor the wire model (`hex-restapi-schema`); a unit of work making two repositories commit together is `hex-persistence`.
wntic/pyhouse · ★ 3 · AI & Automation · score 79
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 →