clean-architecture

Apply Clean Architecture principles to define layer boundaries and enforce the Dependency Rule.

9|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/pantheon-org/tekhne --skill clean-architecture-pantheon-org
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/pantheon-org/tekhne/tree/main/skills/software-engineering/design-principles/clean-architecture
Command: npx skills add https://github.com/pantheon-org/tekhne --skill clean-architecture-pantheon-org

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you design software systems that are easy to understand, test, and maintain by enforcing clear architectural boundaries and dependency rules.

Core Features & Use Cases

  • Layered Architecture: Defines distinct layers (Entities, Use Cases, Interface Adapters, Frameworks) with strict inward-only dependencies.
  • Dependency Rule Enforcement: Identifies and helps resolve dependency violations, including circular dependencies and framework leakage into the domain.
  • Use Case: When designing a new service, use this Skill to establish a robust architecture that separates business logic from infrastructure concerns, ensuring long-term maintainability and testability.

Quick Start

Apply Clean Architecture principles to define layer boundaries and structure your code.

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 infrastructure code in my software design?

Resolve circular dependencies in a layered architecture by applying the Dependency Rule and dependency inversion. This ensures dependencies point strictly inward toward the domain, preventing external framework leakage and untangling cyclic structural references.

What is the best way to structure code for maintainability and testability?

The best way to structure code for maintainability is using a layered architecture that isolates business rules. Separating domain logic from external concerns creates adaptable, testable systems that are easy to understand and maintain over time.

How do I enforce the Dependency Rule when designing a new service?

Enforce the Dependency Rule when designing a new service by establishing clear architectural boundaries between layers. Ensure dependencies flow strictly inward from Frameworks to Interface Adapters to Use Cases to Entities, preventing infrastructure code from leaking into the domain.

Does Clean Architecture work for resolving framework leakage into the domain?

Yes, Clean Architecture resolves framework leakage by isolating domain logic within inner layers. It enforces strict dependency boundaries, ensuring external frameworks and databases remain in the outer layers and do not contaminate core business logic.

When should I not use a layered architecture for my software?

You should not use a layered architecture for simple systems where strict boundary enforcement adds unnecessary complexity. If separating business logic from infrastructure concerns provides no clear maintainability benefit, the overhead of dependency management may be excessive.