clean-architecture
Skill5 starsChanged 7 days agoMITView on GitHub
.NET clean architecture enforcement — layer rules, dependency direction, DI registration patterns, and project reference validation.
28 other projects use a version of this.
Adopted by
Most recently taken up by
- kinhluan/skillstheir own version, first seen Nov 8, 2026
- codewithmukesh/dotnet-claude-kittheir own version, first seen Nov 8, 2026
- yht-4403/jc-agent-skillstheir own version, first seen Nov 8, 2026
- nledford/engineering-review-boardtheir own version, first seen Nov 3, 2026
- soysantana/skillstheir own version, first seen Nov 1, 2026
- GabrielMartinMoran/mindtheir own version, first seen Nov 1, 2026
Used with
Projects with it also use domain-driven-design, dependency-injection and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
jarrodmedranoSkilldomain-driven-design
This skill should be used whenever domain modeling is taking place. It provides specialized guidance for type-driven and data-driven design based on Rich Hickey and Scott Wlaschin's principles. The skill helps contextualize current modeling within the existing domain model, identifies inconsistencies, builds ubiquitous language, and creates visualizations (Mermaid, Graphviz/DOT, ASCII diagrams) to communicate domain concepts clearly. Use this skill when designing types, modeling business domains, refactoring domain logic, or ensuring domain consistency across a codebase.
Also in 4 projects that use this
HamzaSheikh768Skilldependency-injection
Leverages FastAPI's powerful Depends system for reusable authentication, database sessions, rate limiting, and business logic injection.
Also in 3 projects that use this
ffsshhttiikkSkillhexagonal-architecture
Hexagonal architecture patterns and implementation
Also in 3 projects that use this
xenitV1Skillclean-code
Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
Also in 7 projects that use this
Other versions28 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 28
- ciembor/agent-rules-books★ 2.8ksame name
- wondelai/skills★ 2.6ksame name
- codewithmukesh/dotnet-claude-kit★ 808same name
- Mindrally/skills★ 275same name
- Resgrid/Core★ 238same name
- GabrielMartinMoran/mind★ 193same name
- tokenaissance/clean-architecture★ 17same name
- G1Joshi/Agent-Skills★ 15same name
- korallis/skills-collection★ 14same name
- nledford/engineering-review-board★ 11same name
18 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- aspnet-api-patternsSkill
- authenticationSkill
- cachingSkill
- convention-learnerSkill
- dddSkill
- dotnet-project-initSkill
- ef-core-patternsSkill
- error-handlingSkill
- loggingSkill
- modern-csharpSkill
- opentelemetrySkill
- resilienceSkill
- testing-dotnetSkill
- vertical-sliceSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 26 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Contains: Use-case handlers/services, repository and gateway interfaces, DTOs, validators
- Distinctive: line 46
Packages: Test framework, mocking library, assertions, WebApplicationFactory
“Common” is measured: kept by at least 6 in 10 of the 26 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Clean Architecture for .NET
Reference for architectural decisions. This skill is the source of truth for layer rules;
ddd documents its one variant (repository interfaces in Domain).
Layer Definitions
Domain (innermost)
- Contains: Entities, value objects, domain events, domain errors, enums, the
Result<TValue, TError>type (skills/error-handling/SKILL.md) - References: Nothing (zero project references)
- Packages allowed: none — the BCL covers it (
TimeProviderincluded) - Packages forbidden: EF Core, ASP.NET Core, MediatR, FluentValidation, any infrastructure
Application
- Contains: Use-case handlers/services, repository and gateway interfaces, DTOs, validators
- References: Domain only
- Packages allowed: FluentValidation; MediatR / AutoMapper only with the licence check below
- Packages forbidden: EF Core, database drivers, HTTP clients
Licensing: MediatR 13+ and AutoMapper 15+ are commercial (Lucky Penny Software, since July 2025; a free Community edition covers qualifying organisations). Earlier versions stay open source but get no fixes. Before adding either, confirm the licence or use a plain handler interface and hand-written mapping — neither library is needed for this layering.
Infrastructure
- Contains: DbContext, repositories, external service clients, email senders
- References: Domain, Application
- Packages allowed: EF Core, database drivers, HTTP clients, file system
- Implements: Interfaces defined in Application
API/Web (outermost)
- Contains: Controllers/endpoints, middleware, Program.cs, DI composition root
- References: Application, Infrastructure
- Packages allowed: Microsoft.AspNetCore.OpenApi (built-in
AddOpenApi()/MapOpenApi()), authentication, rate limiting - Responsibility: Wire everything together, no business logic. Referencing Infrastructure here is the composition root's job, not a violation
Tests
- References: Any (unrestricted)
- Packages: Test framework, mocking library, assertions, WebApplicationFactory
DI Registration Pattern
// In Infrastructure project:
public static class InfrastructureServiceExtensions
{
public static IServiceCollection AddInfrastructureServices(
this IServiceCollection services, IConfiguration config)
{
services.AddDbContext<ApplicationDbContext>(options =>
options.UseNpgsql(config.GetConnectionString("DefaultConnection")));
services.AddScoped<IUserRepository, UserRepository>();
return services;
}
}
// In Application project:
public static class ApplicationServiceExtensions
{
public static IServiceCollection AddApplicationServices(this IServiceCollection services)
{
services.AddScoped<IUserService, UserService>();
services.AddValidatorsFromAssembly(typeof(ApplicationServiceExtensions).Assembly);
return services;
}
}
// In Program.cs (API project):
builder.Services.AddApplicationServices();
builder.Services.AddInfrastructureServices(builder.Configuration);Validation Rules
| Rule | Check |
| Domain independence | Domain .csproj has 0 <ProjectReference> elements |
| Application → Domain only | Application .csproj references only Domain |
| No reverse dependencies | Domain never references Application/Infrastructure/API |
| Interface ownership | Application defines interfaces (Domain, under the DDD variant); Infrastructure implements |
| Composition root | Only API project wires DI container |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

