.NET Global Tool on NuGet

Ship .NET Clean Architecture.
Not Boilerplate.

A .NET global tool that scaffolds production-ready Clean Architecture projects with CQRS, the Result pattern, domain events and FluentValidation, in seconds.

5
layers generated
< 10s
to a running solution
0
files to wire by hand
499
downloads on NuGet

Built on patterns used by leading .NET teams

  • .NET 10
  • CQRS
  • Domain-Driven Design
  • FluentValidation
  • EF Core
  • Serilog
Project structure

Every layer. Properly separated.

Each generated project follows the full Clean Architecture layering convention. No shortcuts, no coupling shortcuts.

  1. Domain

    Aggregates, value objects, domain events, exceptions. Zero external dependencies.

    public abstract class Entity<TId>
  2. Application

    Command/query handlers (CQRS), validation decorators, logging decorators, FluentValidation.

    ICommandHandler<TCommand, TResult>
  3. Infrastructure

    EF Core DbContext, migrations, domain event dispatcher, Serilog sinks.

    class AppDbContext : DbContext
  4. WebApi

    Minimal API endpoints, global exception handler, health checks, Scalar OpenAPI.

    public interface IEndpoint
  5. SharedKernel

    Result pattern, Error types, Entity base, ValueObject base, IDomainEvent.

    Result<T>.Failure(Error.NotFound(...))

Why a global tool, not a template?

A template copies files. A global tool can ask questions, prune what you did not choose, and keep working on the solution after it exists.

CleanArchitectureGenerator

A dotnet global tool. Free.

  • Interactive prompts
  • Add aggregates post-scaffold
  • Full layer separation
  • Result pattern built-in
  • Domain events wired
  • Conventions enforced

dotnet new

A file template. Copies, then stops.

Manual setup

A day of wiring, repeated per project.

Neither one gives you:

  • Interactive prompts
  • Add aggregates post-scaffold
  • Full layer separation
  • Result pattern built-in
  • Domain events wired
  • Conventions enforced
What gets generated

A solution you would have written yourself.

CQRS Handlers

Command and query handlers with a decorator pipeline: validation, then logging, then the handler.

public sealed class CreateOrderHandler
  : ICommandHandler<CreateOrder, Guid>
{
  public Task<Result<Guid>> Handle(
    CreateOrder cmd, CancellationToken ct)
}

Result Pattern

Result<T>, Error, ValidationError and ErrorType. Zero exceptions in flow control.

Domain Events

Dispatcher, IDomainEvent, handler registration, transactional publishing.

EF Core Setup

DbContext, IApplicationDbContext abstraction, SQL Server and PostgreSQL support.

Minimal API Endpoints

IEndpoint convention, endpoint scanning, custom problem results.

Serilog and Health Checks

Structured logging to MSSQL or console, a /health endpoint, and correlation IDs on every request.

GET /health  ->  200 Healthy
Pro, coming soon

Go further with Pro.

Aggregate scaffolding, multi-tenancy, event sourcing and the outbox pattern, for teams building serious systems. Waitlist members get 20% off at launch.

See what Pro adds

Up and running in three commands.

Install

Add the tool globally to your .NET CLI.

dotnet tool install -g CleanArchitectureGenerator

Scaffold

Run interactively, or pass flags to skip all prompts.

cleanarch new MyApp -d postgres -o ./MyApp

Ship

Open in Visual Studio or Rider. Run. Build features, not boilerplate.

cd MyApp && dotnet run

Built in the open.

The template repository is fully open-source. Contribute patterns, raise issues, improve the conventions.

Production-ready from day one.

Configuring, connecting and deploying a generated solution correctly, without digging through the code.

  • Secrets and config
  • Database provider
  • Supabase
  • Neon
  • EF Core migrations
Read the reference