clean-architecture

Applies Clean Architecture rules to design, review, and refactor layered software systems.

3|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/GabrielMartinMoran/nova-agent-squad --skill clean-architecture-gabrielmartinmoran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/GabrielMartinMoran/nova-agent-squad/tree/main/.agents/skills/clean-architecture
Command: npx skills add https://github.com/GabrielMartinMoran/nova-agent-squad --skill clean-architecture-gabrielmartinmoran

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Software systems often become tangled when business logic mixes with frameworks, databases, and UI code, making them hard to test, change, and maintain. This Skill provides 42 prioritized rules from Robert C. Martin's Clean Architecture to guide system design, code review, and refactoring toward proper separation of concerns. ## Core Features & Use Cases - 42 Prioritized Rules Across 8 Categories: Covers dependency direction, entity design, use case isolation, component cohesion, boundaries, interface adapters, framework isolation, and testing architecture, each tagged by architectural impact. - Detailed Reference Files with Code Examples: Every rule includes incorrect vs. correct implementations in multiple languages (TypeScript, Java, Python, Go, C#) with explanations of benefits and trade-offs. - Use Case: When reviewing a codebase where controllers contain business logic and entities import ORM annotations, consult the relevant rules to identify violations and apply patterns like thin controllers, dependency inversion, and persistence-ignorant entities. ## Quick Start Review my order processing module against Clean Architecture principles and identify dependency direction violations.

Frequently Asked Questions about clean-architecture

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

FAQPage Schema
How do I apply Clean Architecture to an existing codebase?

Start with the highest-impact rules: enforce inward-only dependency direction and remove framework imports from entities and use cases. Then introduce repository interfaces owned by the application layer and move ORM or web framework code into infrastructure adapters incrementally.

What is the Dependency Rule in Clean Architecture?

The Dependency Rule states that source code dependencies must point inward only, toward higher-level policies. Inner layers like entities and use cases must never import from outer layers such as infrastructure, frameworks, or UI; instead they define interfaces that outer layers implement.

Should entities know about the database or ORM?

No, entities must be persistence-ignorant. Keep ORM annotations and database mappings in separate infrastructure classes, and use mappers to translate between database rows and pure domain entities so database changes never affect business rules.

When should I use partial boundaries instead of full separation?

Use partial boundaries when you anticipate needing a boundary but full separation costs too much now, such as with a small team and unified deployment. Options include a facade, an interface with a single implementation, or a one-dimensional boundary that can be split later.

Do microservices replace the need for Clean Architecture?

No, each service still needs internal clean architecture with domain, application, infrastructure, and interface layers. Splitting a tangled monolith into services without internal structure just creates a distributed monolith with network overhead and the same maintainability problems.

Why keep controllers thin in Clean Architecture?

Thin controllers only parse requests, validate input format, call use cases, and map exceptions to HTTP status codes. Business logic like credit checks or stock validation belongs in use cases, which keeps controllers easy to test and prevents logic duplication across delivery mechanisms.