clean-architecture

Enforces four-layer clean architecture with defined repository and gateway placements.

81|3|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/j5ik2o/okite-ai --skill clean-architecture-j5ik2o
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/j5ik2o/okite-ai/tree/main/.agent/skills/clean-architecture
Command: npx skills add https://github.com/j5ik2o/okite-ai --skill clean-architecture-j5ik2o

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Clean architecture provides a disciplined way to structure software into four layers—Domain, Use Case, Interface Adapters, and Infrastructure—so teams can reason about dependencies, testability, and maintainability.

Core Features & Use Cases

  • Enforces a strict layer boundary where Repository Interfaces live in the Use Case layer, and Repository/Gateway implementations reside in the Interface Adapters layer.
  • Guides architectural reviews to ensure Infrastructure only hosts cross-cutting concerns (logging, configuration, metrics) and does not house domain logic or persistence code.
  • Provides a reference model for evaluating existing architectures and aligning future designs with clean architecture principles.

Quick Start

Inspect a project to map components to the four layers and adjust placements to reflect clean architecture, then run the review checklist to validate layer responsibilities.

Frequently Asked Questions about clean-architecture

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

FAQPage Schema
How do I enforce clean architecture layer boundaries in my software project?

Clean architecture layer boundaries are enforced by mapping components to four layers—Domain, Use Case, Interface Adapters, and Infrastructure—and ensuring dependencies point inward. This skill validates that Repository Interfaces reside in the Use Case layer while implementations live in Interface Adapters.

What is the correct placement for Repository Interfaces and Gateway Implementations in clean architecture?

Repository Interfaces belong in the Use Case layer, while Repository and Gateway Implementations reside in the Interface Adapters layer. This separation maintains clean architecture principles by keeping dependency directions pointing toward the domain.

How do I run an architecture review to validate clean architecture principles?

Run an architecture review checklist by mapping existing project components to the four clean architecture layers and validating layer responsibilities. This skill guides the review to ensure Infrastructure only hosts cross-cutting concerns like logging and configuration.

Can I use clean architecture for domain-driven design projects that require clear separation of concerns?

Clean architecture is suitable for domain-driven design projects requiring clear separation among Domain, Use Case, Interface Adapters, and Infrastructure layers. It provides a reference model for evaluating existing architectures and aligning future designs with architectural principles.

Why does my Infrastructure layer contain domain logic that should be separated in clean architecture?

Infrastructure layer should only host cross-cutting concerns such as logging, configuration, and metrics. When domain logic or persistence code appears in Infrastructure, it violates clean architecture principles and must be moved to the Domain or Interface Adapters layer.

What is the best way to structure a layered architecture for maintainability and testability?

The best way to structure a layered architecture for maintainability is applying a four-layer clean architecture model. This disciplined structure separates Domain, Use Case, Interface Adapters, and Infrastructure so teams can reason about dependencies and testability.