.NET Global Tool · NuGet

Ship Clean Architecture.
Not Boilerplate.

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

5 layers generated< 10 seconds0 manual setup

Built on patterns used by leading .NET teams

.NET 10CQRSDomain-Driven DesignFluentValidationEF CoreSerilog

Every layer. Properly separated.

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

Domain

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

public abstract class Entity<TId>

Application

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

ICommandHandler<TCommand, TResult>

Infrastructure

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

class AppDbContext : DbContext

WebApi

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

public interface IEndpoint

SharedKernel

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

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

Why a global tool, not a template?

dotnet new

Template

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

CleanArchGenerator

Recommended

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

Manual setup

From scratch

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

What gets generated

CQRS Handlers

Command and query handlers with decorator pipeline — validation → logging → handler.

Result Pattern

Result<T>, Error, ValidationError, ErrorType — zero exceptions in flow control.

Domain Events

Dispatcher, IDomainEvent, handler registration, transactional publishing.

EF Core Setup

DbContext, IApplicationDbContext abstraction, multi-DB support (SQL Server + PostgreSQL).

Minimal API Endpoints

IEndpoint convention, endpoint scanning, custom problem results.

Serilog + Health Checks

Structured logging to MSSQL/Console, /health endpoint, correlation IDs.

PRO — Coming Soon

Go further with Pro.

Everything in the free tier, plus advanced patterns for teams building serious systems.

Aggregate Scaffolding

Add new aggregates to existing projects without touching existing files.

Multi-tenant Architecture

Built-in tenant isolation patterns with middleware scaffolding.

Event Sourcing Scaffold

EventStore-ready aggregate base, snapshots, event replay scaffolding.

Outbox Pattern

Transactional outbox table, dispatcher, and EF Core interceptor.

Architecture Tests

Pre-wired ArchUnitNET test project enforcing layer dependency rules.

CI/CD Templates

GitHub Actions workflows for build, test, NuGet publish, Docker build.

Early Bird PricingWaitlist members get 20% off when Pro launches — no code needed.

No spam. First access when Pro ships.

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.

$ dotnet run --project CleanArchitectureGenerator -- new -n MyApp -p postgresql

Ship

Open in VS or Rider. Run. Build features — not boilerplate.

$ cd YourProject && 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.

Everything you need to configure, connect, and deploy correctly — without digging through the code.

CleanArchitectureGenerator/docs/best-practices.md
main
·Add database provider docs·MIT

Never commit secrets to source control

The generated project wires two named connection strings: LocalDb for development and ProdDb for production. Neither should ever appear in appsettings.json or any file tracked by git.

Development — User Secrets

Use dotnet user-secrets to store your local connection string outside the project directory, where git cannot reach it regardless of .gitignore configuration.

dotnet user-secrets init
dotnet user-secrets set "ConnectionStrings:LocalDb" "Server=(localdb)\mssqllocaldb;Database=MyProject;Trusted_Connection=true;"

Production — Environment Variables

In production (Azure App Service, Docker, GitHub Actions), inject secrets as environment variables using the double-underscore convention that maps to nested configuration keys:

ConnectionStrings__ProdDb=Server=prod-server;Database=MyProject;...
The generated Program.cs intentionally throws InvalidOperationException at startup if ProdDb is missing in a non-Development environment. Do not remove this guard — it prevents silent misconfiguration in production.

What belongs in appsettings.json

Only non-sensitive, environment-agnostic configuration should be committed. Safe values include:

{
  "Database": {
    "Provider": "SqlServer"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}

CI/CD Pipelines

Store secrets as GitHub Actions secrets or pipeline variables and inject them at build time as environment variables — never bake them into the image or pass them as build arguments.