clean-architecture

Guide implementing Clean Architecture with dependency rules and layer separation.

Updated Jun 27, 2025
One-click install
npx skills add https://github.com/slym1v98/flownest-flutter --skill clean-architecture-slym1v98
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/slym1v98/flownest-flutter/tree/main/.agents/skills/clean-architecture
Command: npx skills add https://github.com/slym1v98/flownest-flutter --skill clean-architecture-slym1v98

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive framework for designing software systems that are maintainable, testable, and scalable by adhering to the principles of Clean Architecture.

Core Features & Use Cases

  • Architectural Guidance: Offers detailed rules and best practices for structuring code into distinct layers (Entities, Use Cases, Interface Adapters, Frameworks & Drivers).
  • Dependency Management: Enforces strict dependency rules, ensuring inner layers are independent of outer layers and frameworks.
  • Use Case: When designing a new application, refactoring an existing one, or reviewing code for architectural soundness, consult this Skill to ensure adherence to Clean Architecture principles.

Quick Start

Review the dependency direction rules for the Clean Architecture skill.

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 structure software layers?

Clean architecture structures software into distinct layers—Entities, Use Cases, Interface Adapters, and Frameworks & Drivers—to ensure maintainable, testable systems. It enforces strict dependency rules, keeping inner layers independent of outer frameworks and achieving stable abstractions.

How do I implement dependency rules to isolate domain logic from frameworks?

To isolate domain logic, implement strict inward dependency flow where outer layers like Frameworks & Drivers depend on inner Use Cases and Entities, never the reverse. This decoupling ensures your core business rules remain independent of external tools and frameworks.

Does clean architecture work well with domain-driven design and dependency injection?

Yes, clean architecture pairs effectively with domain-driven design and dependency injection. The layered structure isolates domain entities and use cases, while dependency injection facilitates the inward flow of dependencies required to maintain decoupled, testable systems.

When should I use clean architecture for my software design instead of simpler layered approaches?

Use clean architecture when building resilient, scalable software systems that require high testability and long-term maintainability. It is ideal for complex applications where isolating use cases and protecting domain entities from framework changes is critical for architectural soundness.

How do I separate use cases and entities when refactoring an existing application?

To separate use cases and entities during refactoring, isolate your core business rules into the innermost entity layer, encapsulate application-specific business rules into use cases, and ensure all dependencies point inward toward these stable abstractions, away from external interfaces.