architecture-patterns

Implement Clean Architecture, Hexagonal Architecture, and Domain-Driven Design patterns.

38.6k|4.1k|Updated Jul 24, 2025
One-click install
npx skills add https://github.com/wshobson/agents --skill architecture-patterns-wshobson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture-patterns
Source: https://github.com/wshobson/agents/tree/main/plugins/backend-development/skills/architecture-patterns
Command: npx skills add https://github.com/wshobson/agents --skill architecture-patterns-wshobson

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers implement and understand complex backend architecture patterns, leading to more maintainable, testable, and scalable applications.

Core Features & Use Cases

  • Implement Clean Architecture: Structure code with clear layers (Entities, Use Cases, Adapters, Infrastructure) for dependency management.
  • Apply Hexagonal Architecture: Decouple the core domain logic from external concerns using Ports and Adapters.
  • Utilize Domain-Driven Design (DDD): Employ strategic and tactical patterns like Bounded Contexts, Entities, Value Objects, and Aggregates for complex domains.
  • Use Case: When architecting a new microservice or refactoring a monolith, use this Skill to guide the design towards a robust, layered structure that promotes long-term maintainability and testability.

Quick Start

Use the architecture-patterns skill to generate a Python directory structure example for Clean Architecture.

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 application using Clean Architecture?

To structure a backend with Clean Architecture, organize code into clear layers: Entities, Use Cases, Adapters, and Infrastructure. This layered design enforces dependency inversion, ensuring core business logic remains isolated from external concerns for better maintainability and testing.

What is the difference between Hexagonal Architecture and Clean Architecture?

Hexagonal Architecture decouples core domain logic from external concerns using Ports and Adapters, while Clean Architecture structures code into specific layers like Entities and Use Cases. Both patterns utilize dependency inversion to create modular, testable, and scalable backend systems.

When do I need Domain-Driven Design for backend development?

You need Domain-Driven Design when architecting complex domains. DDD employs strategic and tactical patterns like Bounded Contexts, Entities, Value Objects, and Aggregates to model complex business logic, ensuring software aligns with domain requirements and remains highly maintainable.

How do I decouple domain logic from infrastructure in a microservice?

Decouple domain logic from infrastructure by applying Hexagonal Architecture. This pattern uses Ports and Adapters to isolate the core domain, ensuring external concerns like databases or APIs do not leak into your business rules, achieving a scalable and testable system.

Do I need object-oriented programming experience to implement these architecture patterns?

Yes, you need a solid understanding of object-oriented programming and software design principles. Implementing advanced backend architecture patterns like Clean Architecture, Hexagonal Architecture, and DDD requires foundational knowledge of dependency inversion and domain modeling to build robust, maintainable systems.