clean-architecture

Guide Clean Architecture, Hexagonal Architecture, and Domain-Driven Design principles.

20|1|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill clean-architecture-krzysztofsurdy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/krzysztofsurdy/code-virtuoso/tree/main/skills/knowledge/clean-architecture
Command: npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill clean-architecture-krzysztofsurdy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of building software that is maintainable, testable, and adaptable to changing requirements by providing a structured approach to software design.

Core Features & Use Cases

  • Architectural Guidance: Explains Clean Architecture, Hexagonal Architecture, and Domain-Driven Design principles.
  • Dependency Management: Enforces the Dependency Rule, ensuring inner layers are independent of outer layers.
  • DDD Patterns: Details tactical patterns like Entities, Value Objects, Aggregates, Repositories, and strategic patterns like Bounded Contexts.
  • Use Case: When designing a new feature, use this Skill to understand how to structure your code to isolate business logic from framework details, making future refactoring and testing significantly easier.

Quick Start

Use the clean-architecture skill to understand the Dependency Rule and how to enforce it.

Frequently Asked Questions about clean-architecture

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

FAQPage Schema
How does clean architecture enforce the dependency rule to isolate business logic?

Hexagonal architecture isolates business logic by defining boundary crossings and port interfaces, ensuring domain layers remain independent of external frameworks, databases, and UI dependencies.

When do I need domain-driven design tactical patterns like aggregates and value objects?

You need domain-driven design tactical patterns when modeling complex business domains, utilizing aggregates, value objects, and repositories to maintain strict consistency and encapsulate core domain logic.

What is the best way to structure a new feature using hexagonal architecture?

The best way to structure a feature using hexagonal architecture is to separate core domain logic from external concerns through boundary crossings, enforcing layer responsibilities to isolate business logic from framework details.

How do I apply CQRS and event sourcing within a clean architecture?

Apply CQRS and event sourcing within clean architecture by separating read and write models into distinct boundaries, using strategic patterns to manage bounded contexts while maintaining testable system design.

What testing strategies work best for maintaining boundaries in clean architecture?

Effective testing strategies for clean architecture target layer responsibilities and boundary crossings, validating that inner layers remain independent from outer layers and framework dependencies to ensure robust system design.