clean-architecture

Design software architectures with Domain, Application, Infrastructure, and Interface layers.

Updated Jan 24, 2026
One-click install
npx skills add https://github.com/amaozhao/MySkills --skill clean-architecture-amaozhao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/amaozhao/MySkills/tree/main/skills/clean-architecture
Command: npx skills add https://github.com/amaozhao/MySkills --skill clean-architecture-amaozhao

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams design scalable software architectures by applying layered architecture principles, dependency inversion, and clear boundaries for testability and maintainability.

Core Features & Use Cases

  • Establishes a standard four-layer structure: Domain, Application, Infrastructure, Interface.
  • Defines responsibilities and dependency directions to improve modularity, testability, and collaboration.
  • Use cases include architecture definition for new projects, refactoring existing codebases, and guiding team alignment around clean design.

Quick Start

Identify domain entities, outline use cases, and map dependencies between layers to ensure inner layers depend only on abstractions.

Frequently Asked Questions about clean-architecture

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

FAQPage Schema
What is clean architecture and how does it improve software testability?

Clean architecture improves testability by organizing code into Domain, Application, Infrastructure, and Interface layers with strictly enforced dependency directions. This structure ensures inner layers depend only on abstractions, allowing modules to be tested independently without external framework interference.

How do I design a scalable layered architecture for a new project?

To design a scalable layered architecture, establish the four standard layers: Domain, Application, Infrastructure, and Interface. Identify domain entities, outline use cases, and map dependencies between layers to ensure inner layers never depend on outer layer implementations.

Can I use dependency inversion when refactoring an existing codebase?

Dependency inversion can be applied during module refactors to restructure existing codebases. By defining clear boundaries and responsibilities, you can incrementally migrate dependencies so inner layers depend on abstractions rather than concrete infrastructure implementations.

Do I need external software or frameworks to implement clean architecture?

No external software or frameworks are required to implement clean architecture. The approach focuses entirely on structure, dependency directions, and testability through clearly defined layer responsibilities, making it a pure design methodology rather than a tool-dependent process.

What's the best way to define boundaries between Domain and Infrastructure layers?

The best way to define boundaries is through dependency inversion, ensuring the Infrastructure layer depends on the Domain layer rather than vice versa. Establish clear responsibilities where Domain handles core business logic and Infrastructure manages external concerns.

When should I avoid using a strict four-layer architecture?

A strict four-layer architecture may be excessive for very small projects where modularity overhead outweighs maintainability benefits. If an application lacks complex domain logic or long-term scaling requirements, simpler architectural patterns might better suit the context.