nw-fp-hexagonal-architecture

Define hexagonal architecture patterns for functional codebases with pure core and side-effect shell.

Updated Mar 18, 2024
One-click install
npx skills add https://github.com/v1bh0r/precise-ledger-pro --skill nw-fp-hexagonal-architecture-v1bh0r
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nw-fp-hexagonal-architecture
Source: https://github.com/v1bh0r/precise-ledger-pro/tree/main/nWave/skills/nw-fp-hexagonal-architecture
Command: npx skills add https://github.com/v1bh0r/precise-ledger-pro --skill nw-fp-hexagonal-architecture-v1bh0r

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Functional programming teams often struggle to keep domain logic pure and independent from IO, configuration, and infrastructure. This skill provides a structured pattern to separate concerns using a pure core, a side-effect shell, and explicit ports/adapters.

Core Features & Use Cases

  • Ports as function signatures that define domain capabilities.
  • Adapters that implement ports to connect with IO or external systems.
  • Pure core that performs domain logic without side effects.
  • Pipeline-style composition that wires inputs to outputs through pure steps.

Quick Start

Define a small domain function, its port, and a minimal adapter to wire it into IO.

Frequently Asked Questions about nw-fp-hexagonal-architecture

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

FAQPage Schema
How do I separate domain logic from IO in functional programming?

To separate domain logic from IO in functional programming, use a hexagonal architecture pattern with a pure core for side-effect-free domain operations and a thin shell for infrastructure. This enforces clear boundaries and keeps business logic independent from external systems.

What is a pure core and side-effect shell in hexagonal architecture?

A pure core and side-effect shell in hexagonal architecture define a pattern where domain logic remains side-effect-free, while infrastructure interactions occur through explicit ports as function types and adapters as concrete implementations connecting to IO.

How do I design ports as function types and adapters for dependency provisioning?

Design ports as function types to define domain capabilities, and implement adapters as concrete implementations that connect with IO. Use environment-based dependency provisioning to achieve composable wiring of IO across typical app layers.

Can I use hexagonal architecture patterns to improve testability in functional codebases?

Yes, you can use hexagonal architecture patterns to improve testability in functional codebases by isolating side effects in adapters and keeping the core logic pure. This allows you to test domain capabilities without touching external infrastructure or IO.

What's the best way to wire inputs to outputs through pure steps in a pipeline?

The best way to wire inputs to outputs through pure steps is using pipeline-style composition. This hexagonal architecture pattern connects ports and adapters to perform end-to-end pipelines across typical app layers, ensuring clear boundaries and testability.