clean-architecture

Enforce layered architecture with inward-only dependencies across Domain, Application, and Infrastructure.

5|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/elct9620/ai-coding-skills --skill clean-architecture-elct9620
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/elct9620/ai-coding-skills/tree/main/skills/clean-architecture
Command: npx skills add https://github.com/elct9620/ai-coding-skills --skill clean-architecture-elct9620

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clean Architecture provides a disciplined, layered approach to structuring software, separating concerns across Domain, Application, and Infrastructure to improve maintainability and testability.

Core Features & Use Cases

  • Layered structure with Domain, Application, and Infrastructure
  • Dependency rule: inward-only dependencies to prevent leakage of concerns
  • Guidance for domain purity, use cases, and infrastructure isolation
  • Used when creating new modules, documenting architecture, or refactoring existing code

Quick Start

Decompose your project into Domain, Application, and Infrastructure layers and enforce inward dependencies.

Frequently Asked Questions about clean-architecture

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

FAQPage Schema
How do I enforce layered architecture to prevent architectural erosion in my codebase?

To enforce layered architecture and prevent architectural erosion, decompose your project into Domain, Application, and Infrastructure layers with strict inward-only dependencies. This separation ensures concerns do not leak across boundaries during restructuring or new module creation.

What is the dependency rule in clean architecture for maintaining domain purity?

The dependency rule in clean architecture requires inward-only dependencies to maintain domain purity. This means Application and Infrastructure layers depend on the Domain layer, but the Domain layer never depends outward, ensuring business logic remains isolated from infrastructure concerns.

How do I apply dependency inversion when creating new modules with clean architecture?

To apply dependency inversion when creating new modules, use ports and interfaces so that inner layers define contracts while outer infrastructure layers implement them. This enforces strict layering and isolates domain logic from specific infrastructure implementations.

When do I need to restructure an existing codebase into Domain, Application, and Infrastructure layers?

You need to restructure an existing codebase into Domain, Application, and Infrastructure layers when applying clean architecture to prevent architectural erosion. This is necessary when refactoring for maintainability or documenting architecture to align with strict dependency rules.

Can I use clean architecture with domain-driven design for software design layering?

Yes, clean architecture works with domain-driven design for software design layering by aligning Domain, Application, and Infrastructure layers with DDD concepts. This combination enforces domain purity and uses ports and interfaces for dependency inversion to isolate business logic.

What are the limitations of applying strict layered architecture to an existing project?

Applying strict layered architecture to an existing project requires clear dependency rules, domain purity, and dedicated layers, which may demand significant refactoring effort. The process enforces inward-only dependencies, potentially impacting existing infrastructure coupling during restructuring.