architecture-patterns

Designs backend architecture boundaries for services and modules using inward dependency rules and abstract ports.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/Jhabbig/Habbig --skill architecture-patterns-jhabbig
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture-patterns
Source: https://github.com/Jhabbig/Habbig/tree/main/.claude/plugins/wshobson/backend-development/skills/architecture-patterns
Command: npx skills add https://github.com/Jhabbig/Habbig --skill architecture-patterns-jhabbig

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you structure backend systems so business logic stays isolated from frameworks, databases, and delivery layers. It reduces dependency cycles, makes services easier to test, and gives teams a clear way to design microservices or refactor tangled monoliths.

Core Features & Use Cases

  • Clean Architecture Planning: Define inward-pointing layers with entities, use cases, adapters, and infrastructure.
  • Hexagonal Design: Create ports and adapters so external systems can be swapped without changing core logic.
  • DDD Structuring: Model bounded contexts, aggregates, value objects, repositories, and domain events.
  • Refactoring Guidance: Identify when business rules have leaked into controllers, ORMs, or infrastructure code.
  • Testing Strategy: Support in-memory adapters and unit tests that do not require a running database or network.

Quick Start

Ask the assistant to design a backend service using Clean Architecture, hexagonal ports, and DDD boundaries, and include the layer structure and test approach.

Frequently Asked Questions about architecture-patterns

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

FAQPage Schema
How do I structure a backend service using clean architecture and hexagonal ports?

To structure a backend service with clean architecture, you define inward-pointing dependency layers starting with domain entities, use cases, and abstract ports, followed by interface adapters and outer infrastructure. This isolates business logic from frameworks and databases.

What is the best way to refactor a monolith with dependency cycles and leaked business rules?

Refactoring a tangled monolith involves identifying where business rules have leaked into controllers or ORMs, then applying domain-driven design bounded contexts and dependency inversion to break cycles and isolate core logic into testable modules.

How do I design bounded contexts and aggregates for domain-driven design?

Designing bounded contexts for domain-driven design involves modeling aggregates, value objects, and domain events, then defining repositories and use cases to enforce clear module boundaries and prevent cross-domain dependency leaks.

Can I unit test backend business logic without a running database or network?

Yes, you can unit test backend business logic without a running database by implementing in-memory adapters for your repositories and ports. Hexagonal architecture ensures external systems can be swapped without changing the core domain logic.

When do I need hexagonal architecture for my microservices?

You need hexagonal architecture when you want to decouple core business logic from delivery layers and external systems. It is ideal for new microservices or monolith refactoring where testability and dependency cycle debugging are primary concerns.

Why does my backend code have dependency cycles between modules?

Backend dependency cycles occur when outward infrastructure layers like frameworks or ORMs are directly referenced by inner domain logic. Enforcing inward dependency rules and abstract ports breaks these cycles by forcing external interactions through interface adapters.