Clean Architecture

Organize code into concentric layers with inward-pointing dependencies.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/harrytran998/crossfire --skill clean-architecture-harrytran998
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Clean Architecture
Source: https://github.com/harrytran998/crossfire/tree/main/.agents/skills/clean-architecture
Command: npx skills add https://github.com/harrytran998/crossfire --skill clean-architecture-harrytran998

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a robust architectural pattern to build software that is scalable, maintainable, and testable by enforcing strict separation of concerns and dependency rules.

Core Features & Use Cases

  • Layered Architecture: Organizes code into concentric layers (Entities, Use Cases, Adapters, Frameworks) for clear separation of concerns.
  • Dependency Rule Enforcement: Ensures dependencies always point inward, preventing outer layers from affecting inner core logic.
  • Modularity: Encourages organizing code by business domain rather than technical layer.
  • Use Case: When developing a new feature, this pattern ensures that the core business logic remains independent of the UI or database implementation, allowing for easier testing and future refactoring.

Quick Start

Implement the Clean Architecture pattern by organizing your project into domain, usecases, adapters, and frameworks layers.

Frequently Asked Questions about Clean Architecture

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

FAQPage Schema
How do I structure a software project using clean architecture?

To structure a software project using clean architecture, organize your codebase into concentric layers: entities, use cases, interface adapters, and frameworks. This separation ensures dependencies always point inward, keeping core business logic independent from external concerns like UI or databases.

What is the dependency rule in clean architecture?

The dependency rule in clean architecture mandates that source code dependencies must only point inward. Outer layers like frameworks, drivers, and interface adapters can depend on inner layers, but inner entities and use cases must never depend on outer concerns.

How does domain-driven design work with clean architecture?

Domain-driven design complements clean architecture by organizing code around business domains rather than technical layers. This modularity places core domain logic at the center, ensuring use cases and entities remain independent of external implementations for better maintainability.

How do I test business logic independent of the database and UI?

To test business logic independent of the database and UI, apply clean architecture to isolate use cases and entities within inner layers. Using dependency injection, you decouple core logic from external frameworks, facilitating high testability without requiring actual database or UI connections.

When should I not use clean architecture for software design?

You should avoid clean architecture for small or prototype-level software design where strict separation of concerns and layered modularity introduce unnecessary overhead. The pattern suits complex systems needing high scalability, maintainability, and strict dependency rule enforcement.