PluginBench
Skill
Review
Audit score 70

clean-architecture

pproenca/dot-skills

Clean Architecture principles and best practices for designing maintainable, testable software systems.

What is clean-architecture?

This skill provides comprehensive guidance on Robert C. Martin's Clean Architecture principles across 42 rules organized into 8 categories. Use it when designing new systems, reviewing code structure, refactoring for better separation of concerns, or defining architectural boundaries and dependencies.

  • Apply dependency direction rules to ensure dependencies point inward only
  • Design entities with pure business rules isolated from persistence concerns
  • Structure use cases with explicit input/output ports and single responsibilities
  • Organize components by cohesion and stability rather than technical frameworks
  • Define clear architectural boundaries using humble objects and partial boundaries
  • Create interface adapters that translate between layers without leaking concerns

How to install clean-architecture

npx skills add https://github.com/pproenca/dot-skills --skill clean-architecture
Claude Code
Cursor
Windsurf
Cline

How to use clean-architecture

  1. 1.Reference the rule categories table to identify which priority level applies to your task (Dependency Direction, Entity Design, Use Case Isolation, etc.)
  2. 2.Read the specific rule reference files for detailed explanations and code examples matching your scenario
  3. 3.Apply the relevant rules when designing new modules, reviewing code, or refactoring existing systems
  4. 4.Use the rule prefixes (dep-, entity-, usecase-, comp-, bound-, adapt-, frame-, test-) to quickly locate guidance on specific architectural concerns
  5. 5.Verify your design against multiple rule categories to ensure comprehensive architectural alignment

Use cases

Good for
  • Designing a new microservice or application from scratch with clean layered architecture
  • Refactoring a tightly coupled monolith to separate business logic from infrastructure
  • Reviewing code structure to identify dependency violations and architectural anti-patterns
  • Establishing component boundaries and defining which classes change together
  • Migrating from one framework to another while preserving domain logic
Who it's for
  • Software architects designing system structure
  • Backend developers refactoring applications toward cleaner architecture
  • Code reviewers evaluating architectural compliance
  • Teams establishing architectural standards and guidelines
  • Developers learning Clean Architecture principles from Robert C. Martin's book

clean-architecture FAQ

When should I apply Clean Architecture versus other architectural patterns?

Apply Clean Architecture when designing systems that need to be maintainable and testable over time, especially when business logic needs to remain independent from frameworks and infrastructure. It's particularly valuable for domain-driven systems where business rules are complex and likely to change.

What's the difference between Clean Architecture and layered architecture?

Clean Architecture is a specific form of layered architecture that emphasizes dependency direction (dependencies point inward), boundary definition, and isolation of business logic from frameworks. It's stricter about what can depend on what compared to generic layered approaches.

How do I handle external dependencies and third-party libraries in Clean Architecture?

External dependencies belong in the infrastructure layer or interface adapters layer. Use anti-corruption layers and gateways to abstract external system details, keeping your domain layer free from framework and library dependencies.

Can I use Clean Architecture in a microservices environment?

Yes. Each microservice should have its own internal clean architecture with proper layer separation. Services must have internal clean architecture even if they communicate across service boundaries.

How do I know if my architecture is truly clean?

Your architecture is clean when: dependencies point inward only, entities contain pure business rules with no persistence awareness, use cases orchestrate entities through ports, frameworks are isolated to outer layers, and tests can verify architectural boundaries.

Full instructions (SKILL.md)

Source of truth, from pproenca/dot-skills.


name: clean-architecture description: 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.

Clean Architecture Best Practices

Comprehensive guide to Clean Architecture principles for designing maintainable, testable software systems. Based on Robert C. Martin's "Clean Architecture: A Craftsman's Guide to Software Structure and Design." Contains 42 rules across 8 categories, prioritized by architectural impact.

When to Apply

Reference these guidelines when:

  • Designing new software systems or modules
  • Structuring dependencies between layers
  • Defining boundaries between business logic and infrastructure
  • Reviewing code for architectural violations
  • Refactoring coupled systems toward cleaner structure

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Dependency DirectionCRITICALdep-
2Entity DesignCRITICALentity-
3Use Case IsolationHIGHusecase-
4Component CohesionHIGHcomp-
5Boundary DefinitionMEDIUM-HIGHbound-
6Interface AdaptersMEDIUMadapt-
7Framework IsolationMEDIUMframe-
8Testing ArchitectureLOW-MEDIUMtest-

Quick Reference

1. Dependency Direction (CRITICAL)

2. Entity Design (CRITICAL)

3. Use Case Isolation (HIGH)

4. Component Cohesion (HIGH)

5. Boundary Definition (MEDIUM-HIGH)

6. Interface Adapters (MEDIUM)

7. Framework Isolation (MEDIUM)

8. Testing Architecture (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Related skills

More from pproenca/dot-skills and the wider catalog.

zod logo

zod

pproenca/dot-skills

Zod schema validation best practices for type safety, parsing, and error handling.

3.8k installsAudited
emilkowal-animations logo

emilkowal-animations

pproenca/dot-skills

Emil Kowalski's animation best practices for React, CSS, and Framer Motion.

1.8k installs
react-hook-form logo

react-hook-form

pproenca/dot-skills

Performance optimization guide for React Hook Form client-side forms with 45 rules across 8 categories.

1.5k installs
vitest logo

vitest

pproenca/dot-skills

Vitest testing framework patterns for test setup, async testing, mocking with vi.*, snapshots, and test performance (formerly test-vitest). This skill should be used when writing or debugging Vitest tests. This skill does NOT cover TDD methodology (use test-tdd skill), API mocking with MSW (use test-msw skill), or Jest-specific APIs.

1.1k installsAudited
nuqs logo

nuqs

pproenca/dot-skills

nuqs (type-safe URL query state) best practices for Next.js and other React frameworks. This skill should be used when writing, reviewing, or refactoring code that uses nuqs for URL state management. Triggers on tasks involving useQueryState, useQueryStates, search params, URL state, query parameters, nuqs parsers, limitUrlUpdates, Standard Schema, NuqsAdapter, or Next.js routing with state.

1.1k installsAudited
code-simplifier logo

code-simplifier

pproenca/dot-skills

Code simplification skill for improving clarity, consistency, and maintainability while preserving exact behavior. Use when simplifying code, reducing complexity, cleaning up recent changes, applying refactoring patterns, or improving readability. Triggers on tasks involving code cleanup, simplification, refactoring, or readability improvements.

1.0k installs