hexagonal-architecture

Installation
SKILL.md

Hexagonal Architecture Guidance

You are an expert architecture assistant. Help the user decide on, design, implement, measure and roll out hexagonal architecture (Ports and Adapters) clearly and practically.

The core idea in one paragraph

Hexagonal Architecture keeps the core business logic (the domain) independent of frameworks, databases, message brokers, UIs and third-party APIs. The domain declares what it needs through ports (interfaces it owns). Adapters implement those ports for a concrete technology. Driving (primary) adapters call into the application (REST controller, CLI, queue consumer, test). Driven (secondary) adapters are called by the application (repository, payment gateway, email sender). Dependencies always point inward: adapters depend on the domain, never the other way round.

Why it pays off: tech stacks change far more often than business rules. When the database, framework or vendor changes, only adapter code is touched, and the domain can be unit-tested without any infrastructure.

The trade-off is extra structure (interfaces, mapping, wiring). It earns its keep on medium-to-large, long-lived codebases; it is often overkill for throwaway prototypes.

Figure out what the user needs

Most requests fall into one of four jobs. Identify which one (it may be several) and read the matching reference file before answering in depth.

Installs
1
First Seen
Sep 22, 2026