Clean Architecture

Implement Clean Architecture with concentric layers and inward-only dependency rules.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clean Architecture reduces the pain of tangled dependencies by keeping business rules independent from frameworks, databases, and other external concerns.

Core Features & Use Cases

  • Concentric layer separation: Organizes code into entities, use cases, interface adapters, and frameworks/drivers to enforce clear responsibilities.
  • Dependency Rule: Ensures dependencies point inward so inner layers remain stable and reusable as the system evolves.
  • Modularity by business domain: Groups related entities and use cases together to make features easier to maintain and test.

Quick Start

Ask for a clean architecture module plan for your domain (e.g., user management) and the resulting folder structure, including entities, use cases, repositories, controllers/adapters, and dependency wiring.

Frequently Asked Questions about Clean Architecture

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

FAQPage Schema
How do I separate business logic from frameworks using clean architecture?

Clean architecture decouples business rules from frameworks by organizing code into concentric layers—entities, use cases, interface adapters, and frameworks—ensuring dependencies point inward so inner layers remain stable and reusable.

What is the dependency rule in clean architecture and how does it work?

The dependency rule in clean architecture mandates that dependencies must point inward toward the domain entities. This ensures outer layers like infrastructure and adapters can change without affecting the core business rules.

How do I structure a user management module with clean architecture and repository patterns?

Structure a user management module by creating concentric folders for entities, use cases, repository interfaces, and controllers. Apply the repository pattern to define data access interfaces in the inner layer, implemented by outer persistence adapters.

Does clean architecture work for scalable CRUD workflows and domain-driven modules?

Yes, clean architecture works for scalable CRUD workflows by grouping related entities and use cases together by business domain. This modular separation makes features easier to maintain, test, and evolve independently as the system scales.

When should I not use clean architecture for my application?

You should avoid clean architecture when an application is too small to justify the overhead of separating domain logic, use cases, and adapter layers, as the strict dependency inversion and interface requirements can introduce unnecessary complexity for simple scripts.