Back to Skills

clean-architecture

Clean Architecture principles and best practices from Robert C. Martin's book. This skill should be used when designing software systems, reviewing code structure, or refactoring applications to achieve better separation of concerns. Triggers on tasks involving layers, boundaries, dependency direction, entities, use cases, or system architecture.

163stars12forksUpdated 6/23/2026

Security Assessment

Safe(100/100)

Detected risks:

Agent-reviewed override(Software-architecture principles and reference docs; no executable risk.)
Security Score100/100

About clean-architecture

The clean-architecture skill is a comprehensive guide to Robert C. Martin's Clean Architecture principles for designing maintainable, testable software. It distills the book into 42 rules across eight categories, prioritized by architectural impact, and is meant for designing systems, reviewing code structure, or refactoring toward better separation of concerns.

Its rule categories, in priority order, are dependency direction and entity design (critical), use case isolation and component cohesion (high), boundary definition (medium-high), interface adapters and framework isolation (medium), and testing architecture. Each rule has a prefixed identifier (such as dep-, entity-, or usecase-) and a dedicated reference file with detailed explanation and code examples, covering concepts like inward-only dependencies, persistence-ignorant entities, input and output ports, screaming architecture, humble objects, and a framework-free domain layer.

It is most useful for engineers and architects who want a structured, prioritized checklist of Clean Architecture rules to apply when designing modules, defining layer boundaries, or auditing code for architectural violations.

FAQ

What is this skill based on?

Robert C. Martin's book Clean Architecture, distilled into 42 rules across eight categories prioritized by architectural impact.

When should I use it?

When designing software systems or modules, structuring dependencies between layers, defining business and infrastructure boundaries, or reviewing and refactoring for architectural violations.

What are the rule categories?

Dependency direction, entity design, use case isolation, component cohesion, boundary definition, interface adapters, framework isolation, and testing architecture.

How is the guidance organized?

Each rule has a prefixed identifier and a dedicated reference file with a detailed explanation and code examples.

Which rules are most critical?

Dependency direction and entity design, for example keeping source dependencies pointing inward and keeping entities unaware of how they are persisted.

All Files

46 files
references/adapt-anti-corruption-layer.md3.7 KB
View
references/adapt-presenter-formats.md3.4 KB
View
references/_sections.md1.8 KB
View
references/adapt-mapper-translation.md2.7 KB
View
metadata.json1.0 KB
View
references/adapt-gateway-abstraction.md3.4 KB
View
references/bound-defer-decisions.md3.0 KB
View
references/bound-service-internal-architecture.md4.1 KB
View
references/comp-screaming-architecture.md1.9 KB
View
assets/templates/_template.md1.0 KB
View
references/adapt-controller-thin.md3.2 KB
View
references/bound-boundary-cost-awareness.md3.1 KB
View
references/bound-partial-boundaries.md3.0 KB
View
references/bound-humble-object.md3.2 KB
View
references/comp-common-closure.md1.9 KB
View
references/comp-stable-dependencies.md2.6 KB
View
references/dep-inward-only.md2.0 KB
View
references/entity-no-persistence-awareness.md2.5 KB
View
references/bound-main-component.md3.0 KB
View
references/comp-common-reuse.md2.0 KB
View
references/dep-acyclic-dependencies.md2.3 KB
View
references/dep-no-framework-imports.md2.1 KB
View
references/entity-pure-business-rules.md1.9 KB
View
references/comp-reuse-release-equivalence.md2.0 KB
View
references/dep-data-crossing-boundaries.md1.9 KB
View
references/dep-stable-abstractions.md2.1 KB
View
references/entity-rich-not-anemic.md3.2 KB
View
references/frame-logging-abstraction.md3.2 KB
View
references/test-layer-isolation.md3.3 KB
View
references/dep-interface-ownership.md1.9 KB
View
references/entity-encapsulate-invariants.md2.8 KB
View
references/entity-value-objects.md2.4 KB
View
references/frame-orm-in-infrastructure.md3.1 KB
View
references/test-testable-design.md3.3 KB
View
references/frame-di-container-edge.md3.0 KB
View
references/frame-web-in-infrastructure.md3.5 KB
View
references/test-tests-are-architecture.md3.8 KB
View
references/usecase-orchestrates-not-implements.md2.9 KB
View
references/frame-domain-purity.md3.5 KB
View
references/test-boundary-verification.md3.4 KB
View
references/usecase-explicit-dependencies.md3.2 KB
View
references/usecase-single-responsibility.md3.0 KB
View
references/usecase-input-output-ports.md2.7 KB
View
references/usecase-transaction-boundary.md2.6 KB
View
references/usecase-no-presentation-logic.md3.1 KB
View
SKILL.md7.2 KB
View

Install clean-architecture

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill