# Hexagonal

> Hexagonal Architecture

- Skill: `neuralblitz/hexagonal` (Agent Skill)
- Install (CLI): `npx skillmds@latest add neuralblitz/hexagonal`
- Raw SKILL.md: https://api.skillmd.com/api/skills/neuralblitz/hexagonal/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: NeuralBlitz (https://skillmd.com/u/neuralblitz)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/neuralblitz/hexagonal

---

# Hexagonal Architecture

Hexagonal architecture (Ports and Adapters) organizes code with an inner domain core isolated from external concerns through well-defined ports.

## Key Concepts

- Domain core (business logic)
- Ports (interfaces)
- Adapters (implementations)
- Inner vs outer hexagon
- Dependency inversion

## Common Use Cases

- Testable business logic
- Framework independence
- Multiple delivery mechanisms
- Long-lived business rules
- Clean code organization

## Best Practices

- Keep domain pure
- Define ports clearly
- Adapt infrastructure to domain
- Use dependency injection
- Test domain in isolation

## Resources

- Alistair Cockburn: 12factor.net
- Related Skills: domain-driven-design, clean-architecture

