clean-architecture

Organize modular monolith backend code into isolated bounded contexts with a minimal shared kernel.

14|1|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/marcioaltoe/claude-craftkit --skill clean-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/marcioaltoe/claude-craftkit/tree/main/plugins/architecture-design/skills/clean-architecture
Command: npx skills add https://github.com/marcioaltoe/claude-craftkit --skill clean-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill explains Clean Architecture principles for Modular Monoliths with bounded contexts and a minimal shared kernel.

Core Features & Use Cases

  • Bounded Contexts: Isolate contexts with complete vertical slices.
  • Minimal Shared Kernel: Define a tiny shared core for universal concepts.
  • Context Communication: Use application services for interaction.

Quick Start

Propose a bounded-context layout with a minimal shared kernel.

Frequently Asked Questions about clean-architecture

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

FAQPage Schema
How do I organize a modular monolith with bounded contexts?

Organize a modular monolith by isolating each bounded context as a complete vertical slice with its own domain logic, repositories, and entities. Enforce strict boundaries so contexts never import domain code from one another, communicating only through application services. This prevents coupling and keeps each context independently testable and maintainable.

What should go in a shared kernel in a modular monolith?

A shared kernel should contain only minimal, universal infrastructure concepts—typically utilities, base types, and cross-cutting concerns like logging or error handling. Avoid placing domain entities, business logic, or repositories in the shared kernel. This constraint prevents the shared core from becoming a dumping ground that couples all contexts together.

How do I prevent cross-context dependencies in a modular monolith?

Prevent cross-context dependencies by establishing file structure rules that make imports across context boundaries syntactically or organizationally difficult. Use application services as the only communication channel between contexts rather than direct domain imports. Regular architecture checks ensure no context pulls domain logic from another.

When should I use a modular monolith with bounded contexts instead of microservices?

Use a modular monolith with bounded contexts when you need isolated domain logic and clear organizational structure without the operational complexity of microservices. It suits teams building backend systems where vertical scalability and simpler deployment outweigh the need for independent service scaling or technology diversity.

How do I design use cases within a bounded context?

Design use cases within a bounded context by keeping them focused on that context's specific responsibility and domain. Use the context's entities, repositories, and value objects; never pull domain objects from other contexts. Apply principles like KISS and YAGNI to keep use-case logic simple and avoid unnecessary abstraction.

What does Duplication Over Coupling mean for bounded contexts?

Duplication Over Coupling means it is better to duplicate a simple concept across contexts than to share domain code to avoid repetition. This preserves context independence and prevents tight coupling through shared libraries. Small, localized duplication is easier to manage than the complexity of cross-context dependencies.