{"enrichment":{"faq":[{"a":"Hexagonal-architecture structures applications by isolating business logic at the core, surrounded by ports (interfaces defining contracts) and adapters (implementations connecting to external systems). Start by identifying your domain use cases, define inbound ports for incoming requests and outbound ports for external dependencies, then implement adapters that translate between your domain and frameworks like HTTP, databases, or message queues. This separation ensures your core logic remains testable and framework-agnostic.","q":"How do you implement hexagonal architecture with ports and adapters?"},{"a":"In hexagonal-architecture, inbound ports expose your application's use cases to the outside world\u2014they define how external actors trigger business logic. Outbound ports define contracts for external resources your domain needs, like databases or APIs. Inbound adapters (controllers, CLI handlers) call inbound ports; outbound adapters (repositories, HTTP clients) implement outbound ports. This bidirectional structure keeps dependencies pointing inward toward your domain.","q":"What is the difference between inbound and outbound ports in hexagonal architecture?"},{"a":"Hexagonal-architecture enables decoupling by extracting business logic into a framework-independent core. Identify tightly-coupled code, move it into use-case classes that depend only on domain objects and port interfaces, then create adapters wrapping your existing framework calls. Use dependency injection at a composition root to wire ports to adapters. This approach works across TypeScript, Java, Kotlin, and Go, allowing gradual migration without rewriting everything at once.","q":"How can you refactor existing services to decouple business logic from framework dependencies?"},{"a":"Hexagonal-architecture improves testability by isolating business logic from external dependencies. Since your use cases depend only on port interfaces, you can inject mock adapters during tests without touching real databases, APIs, or frameworks. Test boundaries align with clear domain separation, letting you verify use-case logic in isolation. This design eliminates the need for complex test infrastructure and makes tests faster, more reliable, and easier to maintain.","q":"Why is hexagonal architecture beneficial for testing?"},{"a":"Hexagonal-architecture principles remain consistent across languages, though implementation details vary. In TypeScript, use interfaces and dependency injection frameworks; in Java/Kotlin, leverage annotations and Spring; in Go, use interfaces and struct composition. The core pattern\u2014domain core, inbound/outbound ports, adapters\u2014translates directly. Language-specific tooling differs, but the architectural intent of isolating business logic and managing dependencies through ports stays the same.","q":"How do you apply hexagonal architecture patterns across TypeScript, Java, Kotlin, and Go?"},{"a":"The composition root in hexagonal-architecture is where you wire all dependencies together\u2014instantiating adapters, injecting them into ports, and configuring the application for startup. It's the single place where your framework and infrastructure concerns live, keeping them out of your domain core. By centralizing composition, you maintain clean separation of concerns and make it easy to swap adapters or change configurations without touching business logic.","q":"What role does the composition root play in hexagonal architecture?"}],"shadow_tags":["domain-centric-design","infrastructure-agnostic","boundary-driven-development","protocol-independent","anti-corruption-layer","vertical-slice-architecture","contract-based-integration","testability-first"],"summary_rewrite":"Master the Ports & Adapters pattern to isolate business logic from frameworks and infrastructure. This skill covers domain modeling, use-case orchestration, inbound and outbound port design, adapter implementation, and composition wiring across multiple languages."},"files":[{"bytes":11405,"path":"skills/hexagonal-architecture/SKILL.md","sha256":"53a76ce2255051df5c538b5a690517b7987d1a1c0d3ef57f30d2ddc35258e7f8","url":"https://skillfed.io/files/affaan-m/ECC/hexagonal-architecture/878e1891/SKILL.md"}],"id":"affaan-m/ECC/hexagonal-architecture","links":{"html":"https://skillfed.io/affaan-m/ECC/hexagonal-architecture","md":"https://skillfed.io/affaan-m/ECC/hexagonal-architecture.md","repo":"https://github.com/affaan-m/ECC"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":35692,"language":"JavaScript","last_updated":"2026-07-27","license":"MIT","name":"hexagonal-architecture","publisher":"affaan-m","stars":234207},"relations":{"similar":[{"id":"Gentleman-Programming/Gentleman-Skills/hexagonal-architecture-layers-java"},{"id":"jabrena/plinth/707-technologies-hexagonal-architecture"},{"id":"athola/claude-night-market/architecture-paradigm-hexagonal"},{"id":"giuseppe-trisciuoglio/developer-kit/clean-architecture"},{"id":"connorads/dotfiles/architecture"},{"id":"nWave-ai/nWave/nw-fp-hexagonal-architecture"},{"id":"foryourhealth111-pixel/Vibe-Skills/architecture-patterns"},{"id":"HermeticOrmus/LibreUIUX-Claude-Code/architecture-patterns"},{"id":"iii-hq/iii/iii-engine-config"},{"id":"curiositech/some_claude_skills/code-architecture"}]},"slug":{"owner":"affaan-m","repo":"ECC","skill":"hexagonal-architecture"},"version":"878e1891"}
