π¦ ClawHub
Nm Archetypes Architecture Paradigm Hexagonal
by @athola
Applies hexagonal architecture isolating domain from infrastructure
TERMINAL
clawhub install nm-archetypes-architecture-paradigm-hexagonalπ About This Skill
name: architecture-paradigm-hexagonal description: | Hexagonal (Ports and Adapters) architecture isolating domain logic from infrastructure version: 1.9.4 triggers: - architecture - hexagonal - ports-adapters - infrastructure-independence - testability metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/archetypes", "emoji": "\ud83c\udfd7\ufe0f"}} source: claude-night-market source_plugin: archetypes
> Night Market Skill β ported from claude-night-market/archetypes. For the full experience with agents, hooks, and commands, install the Claude Code plugin.
The Hexagonal (Ports & Adapters) Paradigm
When To Use
When NOT To Use
When to Employ This Paradigm
Adoption Steps
1. Define Domain Ports: Identify all interactions with the core domain. Define inbound "driver ports" for actors that initiate actions (e.g., UI, CLI, automated jobs) and outbound "driven ports" for services the application consumes (e.g., database, message bus, external APIs). Express these ports as formal interfaces. 2. Implement Adapters at the Edge: For each external technology, create an "adapter" that implements a port's interface. Keep the core domain entirely ignorant of the specific frameworks or libraries used in the adapters. 3. Aggregate Use Cases: Organize the application's functionality into services that are built around business capabilities. These services orchestrate calls to the domain through the defined ports. 4. Implement Contract Testing: validate that each adapter correctly honors the expectations of the port it implements. Use contract tests or consumer-driven contract tests to validate this behavior. 5. Enforce Dependency Rules: The most critical rule is that only adapters may have dependencies on external frameworks. Enforce this with automated architecture tests or static analysis rules.Key Deliverables
Risks & Mitigations
Troubleshooting
Common Issues
Command not found Ensure all dependencies are installed and in PATH
Permission errors Check file permissions and run with appropriate privileges
Unexpected behavior
Enable verbose logging with --verbose flag
β‘ When to Use
π Tips & Best Practices
Common Issues
Command not found Ensure all dependencies are installed and in PATH
Permission errors Check file permissions and run with appropriate privileges
Unexpected behavior
Enable verbose logging with --verbose flag