port-adapter-designer

Design port traits and adapters for Rust hexagonal architecture components.

2|1|Updated Oct 31, 2025
One-click install
npx skills add https://github.com/EmilLindfors/claude-marketplace --skill port-adapter-designer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: port-adapter-designer
Source: https://github.com/EmilLindfors/claude-marketplace/tree/main/plugins/rust-hexagonal/skills/port-adapter-designer
Command: npx skills add https://github.com/EmilLindfors/claude-marketplace --skill port-adapter-designer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides designers to create clear port traits and adapters, enabling testable, framework-agnostic core logic.

Core Features & Use Cases

  • Port patterns: Repository ports, service ports, and external service ports.
  • Adapter patterns: Concrete adapters (e.g., Postgres, HTTP clients) implementing ports.
  • Testability: Improves testability by swapping adapters.

Quick Start

Define a domain service with ports, then implement adapters behind those ports.

Frequently Asked Questions about port-adapter-designer

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

FAQPage Schema
How do I decouple my Rust application from database and external service dependencies?

Hexagonal architecture decouples core logic from external systems using ports—trait abstractions defining what your domain needs—and adapters implementing those traits for specific technologies like PostgreSQL or HTTP clients. This separation enables testing with mock adapters and swapping implementations without changing core code.

What are ports and adapters in Rust hexagonal architecture?

Ports are domain-typed traits defining boundaries between your core logic and external systems; adapters are concrete implementations of those ports for specific technologies. Repository ports abstract database access, service ports handle external APIs, and notification ports manage outbound communication, each with sync and async variants supporting dependency injection and testing.

How do I implement repository, service, and notification ports in Rust?

Define trait boundaries for each integration point: repository ports for data access, external service ports for API calls, notification ports for outbound events. Implement concrete adapters—PostgreSQL repositories, HTTP client services, in-memory implementations—behind those traits, mapping external errors to domain types and ensuring Send + Sync safety for async-first designs.

Can I use hexagonal architecture ports and adapters with async Rust code?

Yes; ports are async-by-default, with trait methods supporting async operations natively. Adapters like HTTP clients and database drivers work seamlessly with async runtimes, and in-memory test implementations maintain the same async interface, enabling consistent testing across sync and asynchronous integration boundaries.

Why should I use ports and adapters instead of directly calling external libraries?

Ports and adapters isolate core domain logic from framework and library details, making code testable by swapping real adapters for mocks, maintainable by centralizing integration points, and flexible by supporting multiple implementations—PostgreSQL, file systems, or in-memory stores—without touching business logic.

What error handling patterns work with hexagonal ports in Rust?

Map external system errors to domain-typed errors at adapter boundaries, translating database or HTTP failures into application-specific result types. This preserves domain semantics, enables meaningful error recovery in core logic, and prevents framework-specific error types from leaking into business code.