Skills DirectoryCurated open-source Skills from GitHub

hexagonal-architecturecommit d29cf65SKILL.md · Architecture

Hexagonal Architecture

Designs, implements and refactors Ports & Adapters systems so business logic stays independent of frameworks, transport and persistence.

npx skills add affaan-m/ECC --skill hexagonal-architecture
Permissions
  • read-repo
  • write-files
  • shell
  • network
Compatible with
Claude Code, Codex, Cursor, Copilot, OpenCode
GitHub
294.3k
Source
Community · Affaan Mustafa
Status
Scan passed
License
MIT
Category
Architecture

Core rule

Dependencies always point inward: the domain depends on nothing external, and adapters implement ports at the edges.

Execution Phases

  1. Phase 01Model a use case boundary

    Define one use case with clear input and output DTOs, keeping transport details like req or GraphQL context outside.

  2. Phase 02Define outbound ports first

    Model every side effect, such as persistence, external calls, logging or clock, as a port that describes a capability, not a technology.

  3. Phase 03Orchestrate the use case

    The use case receives ports via constructor or arguments, validates invariants, coordinates domain rules and returns plain data.

  4. Phase 04Adapters and wiring

    Build inbound and outbound adapters at the edge with mapping kept inside them, and wire everything in a single composition root.

  5. Phase 05Test per boundary

    Unit test use cases with fake ports and adapters against real infrastructure; migrate existing systems slice by slice, never as a big-bang rewrite.

Permissions (summarised from SKILL.md)

CapabilityNeededDetails
File writesRequiredCreates or refactors domain, use case, port, adapter, composition root and test code.
Command executionNot requiredThe skill does not call for running commands.
Network outboundNot requiredNo network access.

SKILL.md frontmatter (YAML)

SKILL.md frontmatter (YAML)commit d29cf65
---
name: hexagonal-architecture
description: Design, implement, and refactor Ports & Adapters systems with clear domain boundaries, dependency inversion, and testable use-case orchestration across TypeScript, Java, Kotlin, and Go services. Use when introducing or refactoring toward Ports and Adapters, or when domain logic has become entangled with I/O.
metadata:
  origin: ECC
---

Related skills

A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.