clean-architecture

Enforces dependency direction and designs deep modules for scalable software architectures.

1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/tswr/engineering-mastery-plugin --skill clean-architecture-tswr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/tswr/engineering-mastery-plugin/tree/main/skills/clean-architecture
Command: npx skills add https://github.com/tswr/engineering-mastery-plugin --skill clean-architecture-tswr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Large, domain-heavy codebases often suffer from uncontrolled complexity: simple changes require editing dozens of files, new engineers struggle to understand where logic belongs, and dependency leaks make testing and refactoring risky. This Skill solves that by providing proven principles for structuring systems so they remain understandable, testable, and easy to change as they scale.

Core Features & Use Cases

  • Enforce the Dependency Rule: Keep all source code dependencies pointing inward toward higher-level domain logic, preventing infrastructure and framework details from leaking into business rules.
  • Design Deep Modules: Prioritize modules that hide significant complexity behind simple interfaces over shallow pass-through layers, reducing cognitive load for engineers working in large repos.
  • Apply Strategic DDD Patterns: Use bounded contexts, anti-corruption layers, and context mapping to align code structure with business domain boundaries, especially in multi-team environments where uncoordinated model changes cause coupling.
  • Use Case: For a 10-team e-commerce platform, use this Skill to define bounded contexts for authentication, billing, and product recommendations, set up anti-corruption layers for third-party payment and shipping integrations, and ensure no team's domain logic depends on another's infrastructure details.

Quick Start

Use the clean-architecture skill to evaluate the module structure of the current checkout service and identify any dependency direction violations or shallow pass-through adapters.

Frequently Asked Questions about clean-architecture

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

FAQPage Schema
How do I fix dependency direction violations in a large codebase?

Fix dependency direction violations by enforcing the dependency rule, ensuring all source code dependencies point inward toward higher-level domain logic to prevent infrastructure details from leaking into business rules.

What is the best way to structure modules for domain-heavy enterprise software?

The best way to structure modules for domain-heavy enterprise software is designing deep modules that hide significant complexity behind simple interfaces, reducing cognitive load and change amplification across large repositories.

How do bounded contexts reduce coupling in multi-team software projects?

Bounded contexts reduce coupling in multi-team software projects by aligning code structure with business domain boundaries, preventing uncoordinated model changes from causing cross-team dependencies and integration conflicts.

Can I apply domain-driven design patterns to an existing microservices architecture?

You can apply domain-driven design patterns to existing microservices by defining bounded contexts, setting up anti-corruption layers for third-party integrations, and establishing explicit cross-module contracts to isolate infrastructure details.

Why does changing a simple feature require editing dozens of files in my codebase?

Changing a simple feature requires editing dozens of files due to poor module boundaries and shallow pass-through layers that leak complexity, making refactoring risky and increasing cognitive load for engineers.

When do I need anti-corruption layers for third-party integrations?

You need anti-corruption layers for third-party integrations when external services like payment or shipping providers have uncoordinated model changes that risk leaking infrastructure details into your core domain logic.