hexagonal-architecture

Enforce dependency direction with ports and adapters for hexagonal architecture.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/cescrafli/compyrasion --skill hexagonal-architecture-cescrafli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hexagonal-architecture
Source: https://github.com/cescrafli/compyrasion/tree/main/skills/hexagonal-architecture
Command: npx skills add https://github.com/cescrafli/compyrasion --skill hexagonal-architecture-cescrafli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hexagonal architecture helps teams keep core business logic independent from frameworks, IO concerns, and infrastructure details by using ports and adapters to isolate boundaries.

Core Features & Use Cases

  • Domain model as the center with pure logic
  • Inbound/outbound ports define contracts for adapters
  • Stepwise guidance for modeling use cases, wiring adapters, and composing the system
  • Use cases orchestrate workflows across components to enable testability and maintainability.

Quick Start

Provide a minimal wiring example that binds a use-case to fake ports and runs a simple scenario.

Frequently Asked Questions about hexagonal-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does hexagonal architecture isolate domain logic from infrastructure?

Hexagonal architecture isolates domain logic by defining ports and adapters, ensuring the core business model remains independent from frameworks, IO concerns, and infrastructure details.

How do I structure use cases and ports for testable service orchestration?

Structure use cases by modeling them as pure orchestration workflows across inbound and outbound ports, binding fake adapters during testing to verify service orchestration without external dependencies.

Can I apply ports and adapters to support HTTP, CLI, and worker delivery mechanisms?

Ports and adapters support multiple delivery mechanisms by defining inbound ports for HTTP, CLI, and workers, allowing the same domain logic and use cases to be triggered across different delivery contexts.

What is the best way to wire a composition root for domain-driven design?

Wire the composition root explicitly by binding concrete adapter implementations to their corresponding outbound ports, ensuring dependency direction always points inward toward the isolated domain model.

When should I use hexagonal architecture for my application boundaries?

Use hexagonal architecture when your project requires testable orchestration across services and multiple delivery mechanisms, seeking strict domain isolation and clear boundary enforcement through ports and adapters.

Why does domain isolation matter for testing use cases?

Domain isolation matters for testing because it allows use cases to orchestrate workflows through abstract ports, enabling you to inject fake adapters and verify pure business logic without infrastructure setup.