One-click install
npx skills add https://github.com/roanbrasil/engineer-grade-agent-skills --skill clean-architecture-roanbrasil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/roanbrasil/engineer-grade-agent-skills/tree/main/skills/clean-architecture
Command: npx skills add https://github.com/roanbrasil/engineer-grade-agent-skills --skill clean-architecture-roanbrasil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the pervasive issue of software systems tightly coupled to specific frameworks (such as Spring Boot, Django, or Rails), where business logic is scattered across controllers, repositories, and infrastructure layers. This coupling makes codebases hard to test, difficult to modify, and impossible to swap underlying technologies (like databases or delivery mechanisms) without rewriting core business rules.

Core Features & Use Cases

  • Strict Layer Separation: Defines four distinct layers (Entities, Use Cases, Interface Adapters, Frameworks & Drivers) with clear boundaries for what belongs in each, ensuring business logic stays isolated from infrastructure.
  • Dependency Rule Enforcement: Provides concrete patterns and code examples (in Java, Kotlin, and Python) to ensure source code dependencies only point inward, so inner layers have zero knowledge of outer frameworks or tools.
  • Anti-Pattern Detection & Testing Guidance: Includes checklists for common pitfalls (like anemic domain models or framework leakage into entities) and layer-specific testing strategies to ensure core business logic is fully unit-testable with no external dependencies.
  • Use Case Example: Ideal for long-lived order management, payroll, or customer management systems that need to support multiple delivery interfaces (REST API, CLI, message consumers) without duplicating business rules.

Quick Start

Use the clean-architecture skill to restructure your existing e-commerce order service so that all order total calculation and submission validation rules live in the domain layer, with no framework dependencies in core order entities.

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 framework code in a tightly coupled system?

To separate business logic from framework code, enforce the inward dependency rule across four distinct layers: Entities, Use Cases, Interface Adapters, and Frameworks & Drivers. This ensures inner layers have zero knowledge of outer frameworks, keeping core domain models isolated and fully testable.

What is the best way to support multiple delivery mechanisms like REST API and CLI without duplicating business rules?

The best way to support multiple delivery mechanisms without duplicating business rules is adopting a layered architecture. By placing all validation and calculation logic in the domain layer, REST APIs, CLIs, and message consumers can share the same core use cases without framework leakage.

How do I restructure an existing service to prevent framework leakage into core domain entities?

Restructure an existing service by moving total calculations and validation rules into the domain layer. Apply concrete dependency inversion patterns so source code dependencies point inward, ensuring core order entities and use cases have no framework dependencies.

Does clean architecture work with Java, Kotlin, and Python frameworks like Spring Boot or Django?

Yes, clean architecture works with Java, Kotlin, and Python frameworks like Spring Boot or Django. It provides concrete code examples and patterns to wrap framework-specific infrastructure in interface adapters, allowing you to swap underlying databases or frameworks without rewriting core business rules.

Why does my clean architecture implementation still have low testability and high modification costs?

Low testability and high modification costs persist when anemic domain models or framework leakage bypass layer boundaries. Apply anti-pattern detection checklists and layer-specific testing strategies to ensure core business logic is fully unit-testable with no external dependencies.