clean-architecture

Organize .NET projects into Domain, Application, Infrastructure, and Api layers.

640|145|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill clean-architecture-codewithmukesh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture
Source: https://github.com/codewithmukesh/dotnet-claude-kit/tree/main/skills/clean-architecture
Command: npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill clean-architecture-codewithmukesh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clean Architecture provides a disciplined structure for .NET applications, ensuring that domain logic remains independent from infrastructure and delivery layers.

Core Features & Use Cases

  • Enforces a four-project layout: Domain, Application, Infrastructure, Api.
  • Defines clear dependency rules and domain-owned behavior via entities and domain services.
  • Guides end-to-end wiring of use cases to HTTP endpoints via a thin API layer.

Quick Start

Create a new .NET solution and structure it into Domain, Application, Infrastructure, and Api folders following the guidance in this skill.

Frequently Asked Questions about clean-architecture

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

FAQPage Schema
How do I structure a .NET solution using clean architecture?

You structure a .NET solution into four projects: Domain, Application, Infrastructure, and Api. This clean architecture layout enforces dependency rules, keeping domain logic independent from infrastructure and delivery layers.

What is the dependency rule in clean architecture for C# applications?

The dependency rule in clean architecture requires inner layers like Domain and Application to remain independent of outer layers. Dependencies must always point inward toward the domain model, ensuring infrastructure and API layers do not pollute core business logic.

How do I wire HTTP endpoints to use cases in a .NET clean architecture project?

You wire HTTP endpoints to use cases by implementing a thin API layer that delegates requests directly to application use cases. This ensures the API layer remains free of business logic, acting only as a delivery mechanism for the .NET application.

Does clean architecture support domain-driven design in .NET?

Yes, clean architecture supports domain-driven design in .NET by placing entities and domain services in the core Domain layer. This guarantees domain-owned behavior remains isolated from infrastructure concerns like database access or external APIs.

Can I use dependency injection with a four-layer .NET clean architecture?

Yes, dependency injection is essential for a four-layer .NET clean architecture. It enables dependency inversion by allowing the API layer to inject application services and infrastructure implementations without violating inward dependency rules.

When should I not use clean architecture for my dotnet application?

You should avoid clean architecture for simple .NET applications where the overhead of four separate projects outweighs the benefit. If the domain model is minimal and infrastructure concerns are tightly coupled, this disciplined layout adds unnecessary complexity.