hexagonal-architecture

Implement hexagonal architecture patterns in TypeScript with ports and adapters.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires typescript, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps developers implement hexagonal architecture in TypeScript, enhancing code isolation, maintainability, and testability. It solves the issue of tangled business logic with infrastructure, leading to more robust and flexible codebases.

Core Features & Use Cases

  • Isolation: Facilitates separation of concerns by defining ports and implementing adapters, ensuring the domain logic is independent of external dependencies.
  • Testability: Enables comprehensive testing by decoupling the domain logic from external services and data sources.
  • Use Case: For a project that needs to integrate with various payment gateways, this Skill can help define clear interfaces for payment operations, allowing for easy swapping and testing of different payment methods.

Quick Start

Run the hexagonal-architecture skill in your TypeScript project to initialize the required directories and interfaces.

Frequently Asked Questions about hexagonal-architecture

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

FAQPage Schema
How do I isolate business logic from infrastructure in TypeScript?

Hexagonal architecture in TypeScript isolates business logic by defining ports and implementing adapters, decoupling the domain from external infrastructure like databases or APIs. This separation ensures your core logic remains independent and maintainable.

Why does tangled domain logic make testing difficult in TypeScript projects?

Tangled domain logic couples business rules directly to external services, making testing difficult. Hexagonal architecture solves this by decoupling the domain through ports and adapters, enabling comprehensive testing without relying on external data sources or frameworks.

What's the best way to structure a TypeScript project for multiple payment gateways?

The best way to support multiple payment gateways is implementing hexagonal architecture to define clear interfaces for payment operations. This approach allows easy swapping and testing of different payment methods without altering core domain logic.

How do I set up ports and adapters in an existing TypeScript codebase?

To set up ports and adapters, run the hexagonal-architecture skill in your TypeScript project to initialize required directories and interfaces. You must adhere to port and adapter design principles to ensure proper code isolation and testability.

Do I need dependency injection to use hexagonal architecture in TypeScript?

Dependency injection is a key mechanism for implementing hexagonal architecture in TypeScript, facilitating the separation of concerns by injecting adapters into defined ports. This ensures the domain logic remains independent of external dependencies.

When should I not use hexagonal architecture for my TypeScript application?

You should avoid hexagonal architecture for simple TypeScript scripts or prototypes where defining ports and adapters adds unnecessary overhead. It is best suited for robust projects requiring multiple technologies, frameworks, and strict code isolation.