clean-architecture

Structure software around the Dependency Rule with layered entities, use cases, and adapters.

Updated Jun 27, 2026
One-click install
npx skills add https://github.com/rachmadideni/ai-staff-assistant --skill clean-architecture-rachmadideni
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/rachmadideni/ai-staff-assistant/tree/main/.agents/skills/clean-architecture
Command: npx skills add https://github.com/rachmadideni/ai-staff-assistant --skill clean-architecture-rachmadideni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Business logic often becomes tangled with frameworks, databases, and delivery mechanisms, making systems hard to test, change, and maintain. This Skill applies Robert C. Martin's Clean Architecture principles to keep business rules independent of infrastructure details. ## Core Features & Use Cases - Dependency Rule Enforcement: Organize code into concentric circles (Entities, Use Cases, Adapters, Frameworks) where source dependencies always point inward. - Architecture Scoring: Rate any architecture 0-10 against six principle areas and get specific improvements to reach 10/10. - Component & SOLID Guidance: Apply REP, CCP, CRP, ADP, SDP, SAP component principles plus the five SOLID principles with code examples. - Use Case: When deciding where business logic belongs in a codebase, use this Skill to diagnose layer violations, extract use case interactors behind ports, and isolate the framework in the outermost circle. ## Quick Start Review my project structure and score it against Clean Architecture principles, then tell me which layer my order pricing logic belongs in.

Frequently Asked Questions about clean-architecture

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

FAQPage Schema
How do I apply the Dependency Rule in my project?▼

Organize code into concentric circles with entities innermost, then use cases, adapters, and frameworks outermost. Ensure all source code dependencies point inward by defining interfaces in inner circles and implementing them in outer circles via dependency inversion.

What is the difference between entities and use cases in Clean Architecture?▼

Entities encapsulate enterprise-wide business rules that would exist without software, while use cases contain application-specific rules orchestrating data flow to and from entities. Each use case is a single operation like PlaceOrder, implemented as an interactor behind input and output ports.

How do I keep my ORM models out of business logic?▼

Separate domain entities from persistence models and map between them in gateway classes at the adapter layer. Domain entities carry business rules with no ORM annotations, while persistence models handle database schema concerns.

Does Clean Architecture work with microservices?▼

Yes, but services are deployment boundaries, not automatic architectural boundaries. Each service should apply the Dependency Rule internally with its own circles; a microservice sharing a database or data model is a distributed monolith.

When should I use a full boundary versus a partial boundary?▼

Use full boundaries with reciprocal ports when you will definitely swap implementations. Use partial boundaries like the strategy pattern or facade when the need is uncertain, since full boundaries add interfaces, DTOs, and wiring cost.

How do I break circular dependencies between components?▼

Apply the Acyclic Dependencies Principle using two strategies: invert a dependency by extracting an interface one side implements, or extract the shared classes into a new component both sides depend on. The component graph must remain a directed acyclic graph.