← ClaudeAtlas

hex-domain-portslisted

Use when defining a `typing.Protocol` port in the domain — the `I`-prefixed interface adapters satisfy structurally, `IFooRepository` for one aggregate root's data access or `ICan<Verb>` for a single external action. The interface, not its implementation — that is `hex-persistence`, `hex-store-repository` or `hex-capability-adapter`.
wntic/pyhouse · ★ 3 · AI & Automation · score 79
Install: claude install-skill wntic/pyhouse
# Hex — Domain Ports The domain's outbound interfaces. Both are `typing.Protocol` modules holding method signatures and nothing else; infrastructure satisfies them **structurally** (`hex-architecture` rule 7). ## When to use vs. neighbours - Aggregate-root data access — CRUD plus aggregate-specific reads → **repository protocol** (`IFooRepository`), in this skill. - A single action that does IO or talks to an external system — file rendering, token verification, blob storage, a third-party gateway call → **capability protocol** (`ICan<Verb>`), in this skill. - A pure-CPU operation a third-party library performs — JWT signature verification, rendering bytes through a document library → **capability protocol**, with a sync method instead of async; the domain cannot import the library, and the port is how it uses one. - Pure-CPU logic the standard library can do — trimming, case-folding, a stdlib URL normalization → no port; a value object's construction (`hex-domain-model`) or a module-level domain function (`hex-domain-service`). - The entity, value object, enum or filter record the signatures mention → `hex-domain-model`. `FooKind`, which the capability port below returns, is an enum of that skill's `StrEnum` form, in `domain/foos/foo_kind.py`. - A rule needing cross-aggregate state, which *consumes* these protocols → `hex-domain-service`. - A concrete repository implementation → `hex-persistence` (a relational store) or `hex-store-repository` (a client-style store). The p