dabydat/alpha-omega/nestjs-hexagonal-ports

Claude Code and agent skill by dabydat/alpha-omega

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Hexagonal (ports and adapters) architecture patterns for NestJS. Covers port interfaces, adapter implementations, and dependency injection. Use when implementing hexagonal architecture, port interfaces, or adapter patterns.

Install

npx vskill@latest install dabydat/alpha-omega/nestjs-hexagonal-ports

SKILL.md

NestJS Hexagonal Ports

Hexagonal architecture (also called Ports and Adapters) isolates domain logic from external dependencies. Ports are interfaces; adapters are implementations.

Production patterns for: Port interfaces, adapter implementations, dependency injection, domain isolation from infrastructure

Agent collaboration: Architect (hexagonal pattern selection), Backend Dev (dependency inversion, domain isolation)


Core Principle: Domain Independence

See references/why-hexagonal.md for the External Systems → Adapters → Ports → Domain diagram, the ❌ BAD example, and the ✅ GOOD example.


Ports (Interfaces)

See references/ports.md for the five ports (Logger, Cache, Publisher, Configuration, Email) with their "why" and Symbol tokens.


Adapters (Implementations)

See references/adapters.md for the Console, Redis, and Kafka adapters.


Module Registration

See references/module-registration.md for binding port→adapter and exporting ports.


Usage in Command Handler

See references/usage-in-handler.md for injecting ports via constructor.


Port/Adapter Naming Convention

PortAdapterPurpose
LOGGER_PORTLoggerAdapterLogging
CACHE_PROVIDER_PORTCacheProviderAdapterRedis/Memcached
PUBLISHER_PORTKafkaPublisherAdapterEvent publishing
CONFIGURATION_PORTConfigurationAdapterConfig management
EMAIL_PORTSMTPEmailAdapterEmail sending

Pattern: Port name = Capability + PORT. Adapter name = Capability + Adapter.


Anti-Patterns to Avoid

See references/anti-patterns.md for the four ❌ examples (port implementation details, adapter business logic, concrete deps, god adapter).


Summary: Hexagonal Architecture Benefits

BenefitHow
TestabilityMock adapters, test domain without infrastructure
FlexibilitySwap adapters (Postgres→MySQL) without changing domain
ClarityDomain defines needs, infrastructure provides
IsolationExternal changes don't ripple into domain

Golden rule: Domain declares what it needs (ports). Infrastructure provides implementations (adapters). Domain never imports infrastructure.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dabydat/alpha-omega/nestjs-hexagonal-ports/badge)](https://verified-skill.com/skills/dabydat/alpha-omega/nestjs-hexagonal-ports)

Something wrong with this skill or its page? Tell us.